diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+0.8, release 2020-12-11
+
+* Fix a bug for Windows users by explicitly setting output to utf-8. (Issue #123)
+* New detailed view to display per-band information
+* Update vega assets to latest versions
+
 0.7, released 2020-03-26
 
 * Use native interactive legend in new version of vega-lite
diff --git a/eventlog2html.cabal b/eventlog2html.cabal
--- a/eventlog2html.cabal
+++ b/eventlog2html.cabal
@@ -1,5 +1,6 @@
+cabal-version:       2.4
 Name:                eventlog2html
-Version:             0.7.0
+Version:             0.8.0
 Synopsis:            Visualise an eventlog
 Description:         eventlog2html is a library for visualising eventlogs.
                      At the moment, the intended use is to visualise eventlogs
@@ -13,7 +14,7 @@
                      a more exploratory feel to heap profile analysis.
 Homepage:            https://mpickering.github.io/eventlog2html
 Bug-reports:         https://github.com/mpickering/eventlog2html/issues
-License:             BSD3
+License:             BSD-3-Clause
 License-file:        LICENSE
 Author:              Matthew Pickering, David Binder, Claude Heiland-Allen
 Maintainer:          matthewtpickering@gmail.com
@@ -21,21 +22,18 @@
 Category:            Development
 Build-type:          Simple
 Extra-source-files:
-  javascript/vega-lite@4.7.0
-  javascript/vega-embed@6.3.2
-  javascript/vega@5.10.0
-  javascript/stylesheet.css
-  javascript/tablogic.js
-  javascript/ccmap.vg
-  javascript/milligram.min.css
-  javascript/normalize.min.css
-cabal-version: 1.18
+  javascript/**/*.js
+  javascript/**/*.css
+  javascript/generated/vega-embed@6.14.0
+  javascript/generated/vega@5.17.0
+  javascript/generated/vega-lite@4.17.0
 extra-doc-files: README.md
                  CHANGELOG
 Tested-With:         GHC ==8.6.5
 
 Library
   Build-depends:
+    cpu,
     aeson                >= 1.4.3 && < 1.5,
     attoparsec           >= 0.13.2 && < 0.14,
     array                >= 0.5.3 && < 0.6,
@@ -45,7 +43,7 @@
     containers           >= 0.5.0 && < 0.7,
     file-embed           >= 0.0.11 && < 0.1,
     filepath             >= 1.4.2 && < 1.5,
-    ghc-events           >= 0.10.0 && < 0.13,
+    ghc-events           >= 0.13.0 && < 0.14,
     hashtables           >= 1.2.3 && < 1.3,
     hvega                >= 0.6.0 && < 0.7,
     mtl                  >= 2.2.2 && < 2.3,
@@ -55,7 +53,11 @@
     time                 >= 1.8.0 && < 2.0,
     vector               >= 0.11,
     trie-simple          >= 0.4,
-    hashable             >= 1.0
+    hashable             >= 1.0,
+    directory,
+    strict,
+    statistics-linreg,
+    ghc-heap
 
   GHC-options:         -Wall
   default-language:    Haskell2010
@@ -73,8 +75,10 @@
                        Eventlog.Vega
                        Eventlog.HtmlTemplate
                        Eventlog.VegaTemplate
-                       Eventlog.VegaVersions
+                       Eventlog.AssetVersions
+                       Eventlog.Detailed
   other-modules:       Paths_eventlog2html
+  autogen-modules:     Paths_eventlog2html
 
 Executable eventlog2html
   GHC-options:         -Wall
diff --git a/javascript/ccmap.vg b/javascript/ccmap.vg
deleted file mode 100644
--- a/javascript/ccmap.vg
+++ /dev/null
@@ -1,102 +0,0 @@
-{
-  "$schema": "https://vega.github.io/schema/vega/v5.json",
-  "width": 1000,
-  "height": 600,
-  "padding": 5,
-
-  "signals": [
-  ],
-
-  "data": [
-    {
-      "name": "tree",
-      "values": desc_json,
-      "transform": [
-        {
-          "type": "stratify",
-          "key": "id",
-          "parentKey": "parent"
-        },
-        {
-          "type": "tree",
-          "method": "tidy",
-          "size": [{"signal": "width - 100"}, {"signal": "height"}],
-          "separation": false,
-          "as": ["x", "y", "depth", "children"]
-        }
-      ]
-    },
-    {
-      "name": "links",
-      "source": "tree",
-      "transform": [
-        { "type": "treelinks" },
-        {
-          "type": "linkpath",
-          "orient": "vertical",
-          "shape": "diagonal"
-        }
-      ]
-    }
-  ],
-
-  "scales": [
-    {
-      "name": "color",
-      "type": "ordinal",
-      "domain": { "fields": [{"data": "tree", "field": "c"}
-                            ,{"data": "tree", "field": "c"}], "sort": true},
-      "range": {"scheme": colour_scheme}
-    }
-  ],
-
-  "marks": [
-    {
-      "type": "path",
-      "from": {"data": "links"},
-      "encode": {
-        "update": {
-          "path": {"field": "path"},
-          "stroke": {"value": "#ccc"}
-        }
-      }
-    },
-    {
-      "type": "symbol",
-      "from": {"data": "tree"},
-      "encode": {
-        "enter": {
-          "size": {"value": 500},
-          "stroke": {"value": "black"},
-          "tooltip": {"signal": "datum.name"}
-        },
-        "update": {
-          "x": {"field": "x"},
-          "y": {"field": "y"},
-          "fill": {"scale": "color", "field": "c"}
-        }
-      }
-    },
-    {
-      "type": "text",
-      "from": {"data": "tree"},
-      "encode": {
-        "enter": {
-          "text": {"field": "ccs"},
-          "fontSize": {"value": 9},
-          "baseline": {"value": "middle"}
-        },
-        "update": {
-          "x": {"field": "x"},
-          "y": {"field": "y"},
-          "angle": {"signal": "datum.children ? 0 : 0"},
-          "dy": {"signal": "datum.children ? 0 : 0"},
-          "dx": {"signal": "datum.children ? 0 : 0"},
-          "align": {"signal": "datum.children ? 'center' : 'center'"},
-          "opacity": 0
-        }
-      }
-    }
-  ]
-}
-
diff --git a/javascript/generated/bootstrap.min.css b/javascript/generated/bootstrap.min.css
new file mode 100644
--- /dev/null
+++ b/javascript/generated/bootstrap.min.css
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v4.3.1 (https://getbootstrap.com/)
+ * Copyright 2011-2019 The Bootstrap Authors
+ * Copyright 2011-2019 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:center right calc(.375em + .1875rem);background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc((1em + .75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip{display:block}.form-control-file.is-valid~.valid-feedback,.form-control-file.is-valid~.valid-tooltip,.was-validated .form-control-file:valid~.valid-feedback,.was-validated .form-control-file:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");background-repeat:no-repeat;background-position:center right calc(.375em + .1875rem);background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc((1em + .75rem) * 3 / 4 + 1.75rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip{display:block}.form-control-file.is-invalid~.invalid-feedback,.form-control-file.is-invalid~.invalid-tooltip,.was-validated .form-control-file:invalid~.invalid-feedback,.was-validated .form-control-file:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:calc(1rem + .4rem);padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-ms-flexbox;display:flex;-ms-flex:1 0 0%;flex:1 0 0%;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:first-of-type) .card-header:first-child{border-radius:0}.accordion>.card:not(:first-of-type):not(:last-of-type){border-bottom:0;border-radius:0}.accordion>.card:first-of-type{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:last-of-type{border-top-left-radius:0;border-top-right-radius:0}.accordion>.card .card-header{margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-sm .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-md .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-lg .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl .list-group-item{margin-right:-1px;margin-bottom:0}.list-group-horizontal-xl .list-group-item:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl .list-group-item:last-child{margin-right:0;border-top-right-radius:.25rem;border-bottom-right-radius:.25rem;border-bottom-left-radius:0}}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush .list-group-item:last-child{margin-bottom:-1px}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{margin-bottom:0;border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #dee2e6;border-bottom-right-radius:.3rem;border-bottom-left-radius:.3rem}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:0s .6s opacity}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-break:break-word!important;overflow-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}
+/*# sourceMappingURL=bootstrap.min.css.map */
diff --git a/javascript/generated/bootstrap.min.js b/javascript/generated/bootstrap.min.js
new file mode 100644
--- /dev/null
+++ b/javascript/generated/bootstrap.min.js
@@ -0,0 +1,7 @@
+/*!
+  * Bootstrap v4.3.1 (https://getbootstrap.com/)
+  * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
+  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+  */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,y),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(y);t||(t=new n(this),g(this).data(y,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",x=g.fn[L],F={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",z="carousel-item-right",X="carousel-item-left",$="carousel-item-next",G="carousel-item-prev",J="pointer-event",Z=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?W:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},F,t),_.typeCheckConfig(L,t,U),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(J)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===W,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Z));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===W?(n=X,i=$,M):(n=z,i=G,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},F,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return F}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=x,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",yt="collapsed",Et="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(yt).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(yt).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(Et)?Et:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(yt,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method named "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",xt="dropdown-menu-right",Ft="position-static",Ut='[data-toggle="dropdown"]',Wt=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",zt="right-start",Xt="left-start",$t={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Gt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Jt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Ft),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(xt)&&(e=Bt)):t.hasClass(Ht)?e=zt:t.hasClass(Rt)?e=Xt:g(this._menu).hasClass(xt)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".navbar").length},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(Ut)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(Ut);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return $t}},{key:"DefaultType",get:function(){return Gt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,Ut,Jt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Jt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Jt._clearMenus).on(kt.CLICK_DATA_API,Ut,function(t){t.preventDefault(),t.stopPropagation(),Jt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Wt,function(t){t.stopPropagation()}),g.fn[It]=Jt._jQueryInterface,g.fn[It].Constructor=Jt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Jt._jQueryInterface};var Zt="modal",te="bs.modal",ee="."+te,ne=g.fn[Zt],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-dialog-scrollable",ae="modal-scrollbar-measure",le="modal-backdrop",ce="modal-open",he="fade",ue="show",fe=".modal-dialog",de=".modal-body",ge='[data-toggle="modal"]',_e='[data-dismiss="modal"]',me=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",pe=".sticky-top",ve=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(fe),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(he)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,_e,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(he);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(ue),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig(Zt,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(he);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),g(this._dialog).hasClass(se)?this._dialog.querySelector(de).scrollTop=0:this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(ue),this._config.focus&&this._enforceFocus();var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(ce),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(he)?he:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=le,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(ue),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(ue);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(he)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(me)),e=[].slice.call(document.querySelectorAll(pe));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(ce)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(me));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+pe));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=ae,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,ge,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});ve._jQueryInterface.call(g(e),o,this)}),g.fn[Zt]=ve._jQueryInterface,g.fn[Zt].Constructor=ve,g.fn[Zt].noConflict=function(){return g.fn[Zt]=ne,ve._jQueryInterface};var ye=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ee={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ce=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Te=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function Se(t,s,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(s),l=[].slice.call(n.body.querySelectorAll("*")),i=function(t,e){var n=l[t],i=n.nodeName.toLowerCase();if(-1===a.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var o=[].slice.call(n.attributes),r=[].concat(s["*"]||[],s[i]||[]);o.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===ye.indexOf(n)||Boolean(t.nodeValue.match(Ce)||t.nodeValue.match(Te));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,r)||n.removeAttribute(t.nodeName)})},o=0,r=l.length;o<r;o++)i(o);return n.body.innerHTML}var be="tooltip",Ie="bs.tooltip",De="."+Ie,we=g.fn[be],Ae="bs-tooltip",Ne=new RegExp("(^|\\s)"+Ae+"\\S+","g"),Oe=["sanitize","whiteList","sanitizeFn"],ke={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},Pe={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Le={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ye),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Je}},{key:"NAME",get:function(){return Ve}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return rn}},{key:"EVENT_KEY",get:function(){return ze}},{key:"DefaultType",get:function(){return Ze}}]),i}(Be);g.fn[Ve]=sn._jQueryInterface,g.fn[Ve].Constructor=sn,g.fn[Ve].noConflict=function(){return g.fn[Ve]=Xe,sn._jQueryInterface};var an="scrollspy",ln="bs.scrollspy",cn="."+ln,hn=g.fn[an],un={offset:10,method:"auto",target:""},fn={offset:"number",method:"string",target:"(string|element)"},dn={ACTIVATE:"activate"+cn,SCROLL:"scroll"+cn,LOAD_DATA_API:"load"+cn+".data-api"},gn="dropdown-item",_n="active",mn='[data-spy="scroll"]',pn=".nav, .list-group",vn=".nav-link",yn=".nav-item",En=".list-group-item",Cn=".dropdown",Tn=".dropdown-item",Sn=".dropdown-toggle",bn="offset",In="position",Dn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+vn+","+this._config.target+" "+En+","+this._config.target+" "+Tn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(dn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?bn:In,o="auto"===this._config.method?t:this._config.method,r=o===In?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,ln),g(this._scrollElement).off(cn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},un,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(an),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(an,t,fn),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(gn)?(n.closest(Cn).find(Sn).addClass(_n),n.addClass(_n)):(n.addClass(_n),n.parents(pn).prev(vn+", "+En).addClass(_n),n.parents(pn).prev(yn).children(vn).addClass(_n)),g(this._scrollElement).trigger(dn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(_n)}).forEach(function(t){return t.classList.remove(_n)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(ln);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data(ln,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return un}}]),n}();g(window).on(dn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(mn)),e=t.length;e--;){var n=g(t[e]);Dn._jQueryInterface.call(n,n.data())}}),g.fn[an]=Dn._jQueryInterface,g.fn[an].Constructor=Dn,g.fn[an].noConflict=function(){return g.fn[an]=hn,Dn._jQueryInterface};var wn="bs.tab",An="."+wn,Nn=g.fn.tab,On={HIDE:"hide"+An,HIDDEN:"hidden"+An,SHOW:"show"+An,SHOWN:"shown"+An,CLICK_DATA_API:"click"+An+".data-api"},kn="dropdown-menu",Pn="active",Ln="disabled",jn="fade",Hn="show",Rn=".dropdown",xn=".nav, .list-group",Fn=".active",Un="> li > .active",Wn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',qn=".dropdown-toggle",Mn="> .dropdown-menu .active",Kn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(Pn)||g(this._element).hasClass(Ln))){var t,i,e=g(this._element).closest(xn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?Un:Fn;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(On.HIDE,{relatedTarget:this._element}),a=g.Event(On.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(On.HIDDEN,{relatedTarget:n._element}),e=g.Event(On.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,wn),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(Fn):g(e).find(Un))[0],r=n&&o&&g(o).hasClass(jn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(Hn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(Pn);var i=g(e.parentNode).find(Mn)[0];i&&g(i).removeClass(Pn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(Pn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),t.classList.contains(jn)&&t.classList.add(Hn),t.parentNode&&g(t.parentNode).hasClass(kn)){var o=g(t).closest(Rn)[0];if(o){var r=[].slice.call(o.querySelectorAll(qn));g(r).addClass(Pn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(wn);if(e||(e=new i(this),t.data(wn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(On.CLICK_DATA_API,Wn,function(t){t.preventDefault(),Kn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Kn._jQueryInterface,g.fn.tab.Constructor=Kn,g.fn.tab.noConflict=function(){return g.fn.tab=Nn,Kn._jQueryInterface};var Qn="toast",Bn="bs.toast",Vn="."+Bn,Yn=g.fn[Qn],zn={CLICK_DISMISS:"click.dismiss"+Vn,HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn},Xn="fade",$n="hide",Gn="show",Jn="showing",Zn={animation:"boolean",autohide:"boolean",delay:"number"},ti={animation:!0,autohide:!0,delay:500},ei='[data-dismiss="toast"]',ni=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(zn.SHOW),this._config.animation&&this._element.classList.add(Xn);var e=function(){t._element.classList.remove(Jn),t._element.classList.add(Gn),g(t._element).trigger(zn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove($n),this._element.classList.add(Jn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Gn)&&(g(this._element).trigger(zn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Gn)&&this._element.classList.remove(Gn),g(this._element).off(zn.CLICK_DISMISS),g.removeData(this._element,Bn),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},ti,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Qn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(zn.CLICK_DISMISS,ei,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add($n),g(t._element).trigger(zn.HIDDEN)};if(this._element.classList.remove(Gn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Bn);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Bn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"DefaultType",get:function(){return Zn}},{key:"Default",get:function(){return ti}}]),i}();g.fn[Qn]=ni._jQueryInterface,g.fn[Qn].Constructor=ni,g.fn[Qn].noConflict=function(){return g.fn[Qn]=Yn,ni._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Jt,t.Modal=ve,t.Popover=sn,t.Scrollspy=Dn,t.Tab=Kn,t.Toast=ni,t.Tooltip=Be,Object.defineProperty(t,"__esModule",{value:!0})});
+//# sourceMappingURL=bootstrap.min.js.map
diff --git a/javascript/generated/fancyTable.min.js b/javascript/generated/fancyTable.min.js
new file mode 100644
--- /dev/null
+++ b/javascript/generated/fancyTable.min.js
@@ -0,0 +1,9 @@
+/*!
+ * jQuery fancyTable plugin v1.0.19
+ * https://github.com/myspace-nu
+ *
+ * Copyright 2018 Johan Johansson
+ * Released under the MIT license
+ */
+
+!function(o){o.fn.fancyTable=function(a){var l=o.extend({inputStyle:"",inputPlaceholder:"Search...",pagination:!1,paginationClass:"btn btn-light",paginationClassActive:"active",pagClosest:3,perPage:10,sortable:!0,searchable:!0,onInit:function(){},onUpdate:function(){},testing:!1},a),i=this;return this.settings=l,this.tableUpdate=function(n){if(n.fancyTable.matches=0,o(n).find("tbody tr").each(function(){var a=0,e=!0,t=!1;o(this).find("td").each(function(){l.globalSearch||!n.fancyTable.searchArr[a]||new RegExp(n.fancyTable.searchArr[a],"i").test(o(this).html())?!l.globalSearch||n.fancyTable.search&&!new RegExp(n.fancyTable.search,"i").test(o(this).html())||Array.isArray(l.globalSearchExcludeColumns)&&l.globalSearchExcludeColumns.includes(a+1)||(t=!0):e=!1,a++}),l.globalSearch&&t||!l.globalSearch&&e?(n.fancyTable.matches++,!l.pagination||n.fancyTable.matches>n.fancyTable.perPage*(n.fancyTable.page-1)&&n.fancyTable.matches<=n.fancyTable.perPage*n.fancyTable.page?o(this).show():o(this).hide()):o(this).hide()}),n.fancyTable.pages=Math.ceil(n.fancyTable.matches/n.fancyTable.perPage),l.pagination){var a=n.fancyTable.paginationElement?o(n.fancyTable.paginationElement):o(n).find(".pag");a.empty();for(var e=1;e<=n.fancyTable.pages;e++)if(1==e||e>n.fancyTable.page-(l.pagClosest+1)&&e<n.fancyTable.page+(l.pagClosest+1)||e==n.fancyTable.pages){var t=o("<a>",{html:e,"data-n":e,style:"margin:0.2em",class:l.paginationClass+" "+(e==n.fancyTable.page?l.paginationClassActive:"")}).css("cursor","pointer").bind("click",function(){n.fancyTable.page=o(this).data("n"),i.tableUpdate(n)});e==n.fancyTable.pages&&n.fancyTable.page<n.fancyTable.pages-l.pagClosest-1&&a.append(o("<span>...</span>")),a.append(t),1==e&&n.fancyTable.page>l.pagClosest+2&&a.append(o("<span>...</span>"))}}l.onUpdate.call(this,n)},this.reinit=function(a){o(this).each(function(){o(this).find("th a").contents().unwrap(),o(this).find("tr.fancySearchRow").remove()}),o(this).fancyTable(this.settings)},this.tableSort=function(l){if(void 0!==l.fancyTable.sortColumn&&l.fancyTable.sortColumn<l.fancyTable.nColumns){o(l).find("thead th div.sortArrow").each(function(){o(this).remove()});var a=o("<div>",{class:"sortArrow"}).css({margin:"0.1em",display:"inline-block",width:0,height:0,"border-left":"0.4em solid transparent","border-right":"0.4em solid transparent"});a.css(0<l.fancyTable.sortOrder?{"border-top":"0.4em solid #000"}:{"border-bottom":"0.4em solid #000"}),o(l).find("thead th a").eq(l.fancyTable.sortColumn).append(a);var e=o(l).find("tbody tr").toArray().sort(function(a,e){var t=o(a).find("td").eq(l.fancyTable.sortColumn),n=o(e).find("td").eq(l.fancyTable.sortColumn),s=o(t).data("sortvalue")?o(t).data("sortvalue"):t.html(),r=o(n).data("sortvalue")?o(n).data("sortvalue"):n.html();return"case-insensitive"==l.fancyTable.sortAs[l.fancyTable.sortColumn]&&(s=s.toLowerCase(),r=r.toLowerCase()),"numeric"==l.fancyTable.sortAs[l.fancyTable.sortColumn]?0<l.fancyTable.sortOrder?parseFloat(s)-parseFloat(r):parseFloat(r)-parseFloat(s):s<r?-l.fancyTable.sortOrder:r<s?l.fancyTable.sortOrder:0});o(l).find("tbody").empty().append(e)}},this.each(function(){if("TABLE"!==o(this).prop("tagName"))return console.warn("fancyTable: Element is not a table."),!0;var t=this;if(t.fancyTable={nColumns:o(t).find("td").first().parent().find("td").length,nRows:o(this).find("tbody tr").length,perPage:l.perPage,page:1,pages:0,matches:0,searchArr:[],search:"",sortColumn:l.sortColumn,sortOrder:void 0===l.sortOrder?1:new RegExp("desc","i").test(l.sortOrder)||-1==l.sortOrder?-1:1,sortAs:[],paginationElement:l.paginationElement},0==o(t).find("tbody").length){var a=o(t).html();o(t).empty(),o(t).append("<tbody>").append(o(a))}if(0==o(t).find("thead").length&&o(t).prepend(o("<thead>")),l.sortable){var n=0;o(t).find("thead th").each(function(){t.fancyTable.sortAs.push("numeric"==o(this).data("sortas")?"numeric":"case-insensitive"==o(this).data("sortas")?"case-insensitive":null);var a=o(this).html(),e=o("<a>",{html:a,"data-n":n,class:""}).css("cursor","pointer").bind("click",function(){t.fancyTable.sortColumn==o(this).data("n")?t.fancyTable.sortOrder=-t.fancyTable.sortOrder:t.fancyTable.sortOrder=1,t.fancyTable.sortColumn=o(this).data("n"),i.tableSort(t),i.tableUpdate(t)});o(this).empty(),o(this).append(e),n++})}if(l.searchable){var s=o("<tr>").addClass("fancySearchRow");if(l.globalSearch){var e=o("<input>",{placeholder:l.inputPlaceholder,style:"width:100%;"+l.inputStyle}).bind("change paste keyup",function(){t.fancyTable.search=o(this).val(),t.fancyTable.page=1,i.tableUpdate(t)}),r=o("<th>",{style:"padding:2px;"}).attr("colspan",t.fancyTable.nColumns);o(e).appendTo(o(r)),o(r).appendTo(o(s))}else{n=0;o(t).find("td").first().parent().find("td").each(function(){t.fancyTable.searchArr.push("");var a=o("<input>",{"data-n":n,placeholder:l.inputPlaceholder,style:"width:100%;"+l.inputStyle}).bind("change paste keyup",function(){t.fancyTable.searchArr[o(this).data("n")]=o(this).val(),t.fancyTable.page=1,i.tableUpdate(t)}),e=o("<th>",{style:"padding:2px;"});o(a).appendTo(o(e)),o(e).appendTo(o(s)),n++})}s.appendTo(o(t).find("thead"))}i.tableSort(t),l.pagination&&!l.paginationElement&&(o(t).find("tfoot").remove(),o(t).append(o("<tfoot><tr></tr></tfoot>")),o(t).find("tfoot tr").append(o("<td class='pag'></td>",{}).attr("colspan",t.fancyTable.nColumns))),i.tableUpdate(t),l.onInit.call(this,t)}),this}}(jQuery);
diff --git a/javascript/generated/jquery-3.3.1.min.js b/javascript/generated/jquery-3.3.1.min.js
new file mode 100644
--- /dev/null
+++ b/javascript/generated/jquery-3.3.1.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
diff --git a/javascript/generated/jquery.sparkline.min.js b/javascript/generated/jquery.sparkline.min.js
new file mode 100644
--- /dev/null
+++ b/javascript/generated/jquery.sparkline.min.js
@@ -0,0 +1,5 @@
+/* jquery.sparkline 2.1.2 - http://omnipotent.net/jquery.sparkline/ 
+** Licensed under the New BSD License - see above site for details */
+
+(function(a,b,c){(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)})(function(d){"use strict";var e={},f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=0;f=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:c,normalRangeMax:c,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:c,chartRangeMax:c,chartRangeMinX:c,chartRangeMaxX:c,tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:c,nullColor:c,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,colorMap:c,tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:c,thresholdValue:0,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,tooltipFormat:new h("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:c,tooltipFormat:new h("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:c,targetColor:"#4a2",chartRangeMax:c,chartRangeMin:c,tooltipFormat:new h("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},E='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',g=function(){var a,b;return a=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(a.prototype=d.extend(new arguments[0],arguments[arguments.length-1]),a._super=arguments[0].prototype):a.prototype=arguments[arguments.length-1],arguments.length>2&&(b=Array.prototype.slice.call(arguments,1,-1),b.unshift(a.prototype),d.extend.apply(d,b))):a.prototype=arguments[0],a.prototype.cls=a,a},d.SPFormatClass=h=g({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(a,b){this.format=a,this.fclass=b},render:function(a,b,d){var e=this,f=a,g,h,i,j,k;return this.format.replace(this.fre,function(){var a;return h=arguments[1],i=arguments[3],g=e.precre.exec(h),g?(k=g[2],h=g[1]):k=!1,j=f[h],j===c?"":i&&b&&b[i]?(a=b[i],a.get?b[i].get(j)||j:b[i][j]||j):(n(j)&&(d.get("numberFormatter")?j=d.get("numberFormatter")(j):j=s(j,k,d.get("numberDigitGroupCount"),d.get("numberDigitGroupSep"),d.get("numberDecimalMark"))),j)})}}),d.spformat=function(a,b){return new h(a,b)},i=function(a,b,c){return a<b?b:a>c?c:a},j=function(a,c){var d;return c===2?(d=b.floor(a.length/2),a.length%2?a[d]:(a[d-1]+a[d])/2):a.length%2?(d=(a.length*c+c)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1]):(d=(a.length*c+2)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1])},k=function(a){var b;switch(a){case"undefined":a=c;break;case"null":a=null;break;case"true":a=!0;break;case"false":a=!1;break;default:b=parseFloat(a),a==b&&(a=b)}return a},l=function(a){var b,c=[];for(b=a.length;b--;)c[b]=k(a[b]);return c},m=function(a,b){var c,d,e=[];for(c=0,d=a.length;c<d;c++)a[c]!==b&&e.push(a[c]);return e},n=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},s=function(a,b,c,e,f){var g,h;a=(b===!1?parseFloat(a).toString():a.toFixed(b)).split(""),g=(g=d.inArray(".",a))<0?a.length:g,g<a.length&&(a[g]=f);for(h=g-c;h>0;h-=c)a.splice(h,0,e);return a.join("")},o=function(a,b,c){var d;for(d=b.length;d--;){if(c&&b[d]===null)continue;if(b[d]!==a)return!1}return!0},p=function(a){var b=0,c;for(c=a.length;c--;)b+=typeof a[c]=="number"?a[c]:0;return b},r=function(a){return d.isArray(a)?a:[a]},q=function(b){var c;a.createStyleSheet?a.createStyleSheet().cssText=b:(c=a.createElement("style"),c.type="text/css",a.getElementsByTagName("head")[0].appendChild(c),c[typeof a.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=b)},d.fn.simpledraw=function(b,e,f,g){var h,i;if(f&&(h=this.data("_jqs_vcanvas")))return h;if(d.fn.sparkline.canvas===!1)return!1;if(d.fn.sparkline.canvas===c){var j=a.createElement("canvas");if(!j.getContext||!j.getContext("2d")){if(!a.namespaces||!!a.namespaces.v)return d.fn.sparkline.canvas=!1,!1;a.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),d.fn.sparkline.canvas=function(a,b,c,d){return new J(a,b,c)}}else d.fn.sparkline.canvas=function(a,b,c,d){return new I(a,b,c,d)}}return b===c&&(b=d(this).innerWidth()),e===c&&(e=d(this).innerHeight()),h=d.fn.sparkline.canvas(b,e,this,g),i=d(this).data("_jqs_mhandler"),i&&i.registerCanvas(h),h},d.fn.cleardraw=function(){var a=this.data("_jqs_vcanvas");a&&a.reset()},d.RangeMapClass=t=g({init:function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&typeof b=="string"&&b.indexOf(":")>-1&&(c=b.split(":"),c[0]=c[0].length===0?-Infinity:parseFloat(c[0]),c[1]=c[1].length===0?Infinity:parseFloat(c[1]),c[2]=a[b],d.push(c));this.map=a,this.rangelist=d||!1},get:function(a){var b=this.rangelist,d,e,f;if((f=this.map[a])!==c)return f;if(b)for(d=b.length;d--;){e=b[d];if(e[0]<=a&&e[1]>=a)return e[2]}return c}}),d.range_map=function(a){return new t(a)},u=g({init:function(a,b){var c=d(a);this.$el=c,this.options=b,this.currentPageX=0,this.currentPageY=0,this.el=a,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!b.get("disableTooltips"),this.highlightEnabled=!b.get("disableHighlight")},registerSparkline:function(a){this.splist.push(a),this.over&&this.updateDisplay()},registerCanvas:function(a){var b=d(a.canvas);this.canvas=a,this.$canvas=b,b.mouseenter(d.proxy(this.mouseenter,this)),b.mouseleave(d.proxy(this.mouseleave,this)),b.click(d.proxy(this.mouseclick,this))},reset:function(a){this.splist=[],this.tooltip&&a&&(this.tooltip.remove(),this.tooltip=c)},mouseclick:function(a){var b=d.Event("sparklineClick");b.originalEvent=a,b.sparklines=this.splist,this.$el.trigger(b)},mouseenter:function(b){d(a.body).unbind("mousemove.jqs"),d(a.body).bind("mousemove.jqs",d.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=b.pageX,this.currentPageY=b.pageY,this.currentEl=b.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new v(this.options),this.tooltip.updatePosition(b.pageX,b.pageY)),this.updateDisplay()},mouseleave:function(){d(a.body).unbind("mousemove.jqs");var b=this.splist,c=b.length,e=!1,f,g;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(g=0;g<c;g++)f=b[g],f.clearRegionHighlight()&&(e=!0);e&&this.canvas.render()},mousemove:function(a){this.currentPageX=a.pageX,this.currentPageY=a.pageY,this.currentEl=a.target,this.tooltip&&this.tooltip.updatePosition(a.pageX,a.pageY),this.updateDisplay()},updateDisplay:function(){var a=this.splist,b=a.length,c=!1,e=this.$canvas.offset(),f=this.currentPageX-e.left,g=this.currentPageY-e.top,h,i,j,k,l;if(!this.over)return;for(j=0;j<b;j++)i=a[j],k=i.setRegionHighlight(this.currentEl,f,g),k&&(c=!0);if(c){l=d.Event("sparklineRegionChange"),l.sparklines=this.splist,this.$el.trigger(l);if(this.tooltip){h="";for(j=0;j<b;j++)i=a[j],h+=i.getCurrentRegionTooltip();this.tooltip.setContent(h)}this.disableHighlight||this.canvas.render()}k===null&&this.mouseleave()}}),v=g({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(b){var c=b.get("tooltipClassname","jqstooltip"),e=this.sizeStyle,f;this.container=b.get("tooltipContainer")||a.body,this.tooltipOffsetX=b.get("tooltipOffsetX",10),this.tooltipOffsetY=b.get("tooltipOffsetY",12),d("#jqssizetip").remove(),d("#jqstooltip").remove(),this.sizetip=d("<div/>",{id:"jqssizetip",style:e,"class":c}),this.tooltip=d("<div/>",{id:"jqstooltip","class":c}).appendTo(this.container),f=this.tooltip.offset(),this.offsetLeft=f.left,this.offsetTop=f.top,this.hidden=!0,d(window).unbind("resize.jqs scroll.jqs"),d(window).bind("resize.jqs scroll.jqs",d.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=d(window).scrollTop(),this.scrollLeft=d(window).scrollLeft(),this.scrollRight=this.scrollLeft+d(window).width(),this.updatePosition()},getSize:function(a){this.sizetip.html(a).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(a){if(!a){this.tooltip.css("visibility","hidden"),this.hidden=!0;return}this.getSize(a),this.tooltip.html(a).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(a,b){if(a===c){if(this.mousex===c)return;a=this.mousex-this.offsetLeft,b=this.mousey-this.offsetTop}else this.mousex=a-=this.offsetLeft,this.mousey=b-=this.offsetTop;if(!this.height||!this.width||this.hidden)return;b-=this.height+this.tooltipOffsetY,a+=this.tooltipOffsetX,b<this.scrollTop&&(b=this.scrollTop),a<this.scrollLeft?a=this.scrollLeft:a+this.width>this.scrollRight&&(a=this.scrollRight-this.width),this.tooltip.css({left:a,top:b})},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=c,d(window).unbind("resize.jqs scroll.jqs")}}),F=function(){q(E)},d(F),K=[],d.fn.sparkline=function(b,e){return this.each(function(){var f=new d.fn.sparkline.options(this,e),g=d(this),h,i;h=function(){var e,h,i,j,k,l,m;if(b==="html"||b===c){m=this.getAttribute(f.get("tagValuesAttribute"));if(m===c||m===null)m=g.html();e=m.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")}else e=b;h=f.get("width")==="auto"?e.length*f.get("defaultPixelsPerValue"):f.get("width");if(f.get("height")==="auto"){if(!f.get("composite")||!d.data(this,"_jqs_vcanvas"))j=a.createElement("span"),j.innerHTML="a",g.html(j),i=d(j).innerHeight()||d(j).height(),d(j).remove(),j=null}else i=f.get("height");f.get("disableInteraction")?k=!1:(k=d.data(this,"_jqs_mhandler"),k?f.get("composite")||k.reset():(k=new u(this,f),d.data(this,"_jqs_mhandler",k)));if(f.get("composite")&&!d.data(this,"_jqs_vcanvas")){d.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),d.data(this,"_jqs_errnotify",!0));return}l=new(d.fn.sparkline[f.get("type")])(this,e,f,h,i),l.render(),k&&k.registerSparkline(l)};if(d(this).html()&&!f.get("disableHiddenCheck")&&d(this).is(":hidden")||!d(this).parents("body").length){if(!f.get("composite")&&d.data(this,"_jqs_pending"))for(i=K.length;i;i--)K[i-1][0]==this&&K.splice(i-1,1);K.push([this,h]),d.data(this,"_jqs_pending",!0)}else h.call(this)})},d.fn.sparkline.defaults=f(),d.sparkline_display_visible=function(){var a,b,c,e=[];for(b=0,c=K.length;b<c;b++)a=K[b][0],d(a).is(":visible")&&!d(a).parents().is(":hidden")?(K[b][1].call(a),d.data(K[b][0],"_jqs_pending",!1),e.push(b)):!d(a).closest("html").length&&!d.data(a,"_jqs_pending")&&(d.data(K[b][0],"_jqs_pending",!1),e.push(b));for(b=e.length;b;b--)K.splice(e[b-1],1)},d.fn.sparkline.options=g({init:function(a,b){var c,f,g,h;this.userOptions=b=b||{},this.tag=a,this.tagValCache={},f=d.fn.sparkline.defaults,g=f.common,this.tagOptionsPrefix=b.enableTagOptions&&(b.tagOptionsPrefix||g.tagOptionsPrefix),h=this.getTagSetting("type"),h===e?c=f[b.type||g.type]:c=f[h],this.mergedOptions=d.extend({},g,c,b)},getTagSetting:function(a){var b=this.tagOptionsPrefix,d,f,g,h;if(b===!1||b===c)return e;if(this.tagValCache.hasOwnProperty(a))d=this.tagValCache.key;else{d=this.tag.getAttribute(b+a);if(d===c||d===null)d=e;else if(d.substr(0,1)==="["){d=d.substr(1,d.length-2).split(",");for(f=d.length;f--;)d[f]=k(d[f].replace(/(^\s*)|(\s*$)/g,""))}else if(d.substr(0,1)==="{"){g=d.substr(1,d.length-2).split(","),d={};for(f=g.length;f--;)h=g[f].split(":",2),d[h[0].replace(/(^\s*)|(\s*$)/g,"")]=k(h[1].replace(/(^\s*)|(\s*$)/g,""))}else d=k(d);this.tagValCache.key=d}return d},get:function(a,b){var d=this.getTagSetting(a),f;return d!==e?d:(f=this.mergedOptions[a])===c?b:f}}),d.fn.sparkline._base=g({disabled:!1,init:function(a,b,e,f,g){this.el=a,this.$el=d(a),this.values=b,this.options=e,this.width=f,this.height=g,this.currentRegion=c},initTarget:function(){var a=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),a))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return this.disabled?(this.el.innerHTML="",!1):!0},getRegion:function(a,b){},setRegionHighlight:function(a,b,d){var e=this.currentRegion,f=!this.options.get("disableHighlight"),g;return b>this.canvasWidth||d>this.canvasHeight||b<0||d<0?null:(g=this.getRegion(a,b,d),e!==g?(e!==c&&f&&this.removeHighlight(),this.currentRegion=g,g!==c&&f&&this.renderHighlight(),!0):!1)},clearRegionHighlight:function(){return this.currentRegion!==c?(this.removeHighlight(),this.currentRegion=c,!0):!1},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(a){},getCurrentRegionTooltip:function(){var a=this.options,b="",e=[],f,g,i,j,k,l,m,n,o,p,q,r,s,t;if(this.currentRegion===c)return"";f=this.getCurrentRegionFields(),q=a.get("tooltipFormatter");if(q)return q(this,a,f);a.get("tooltipChartTitle")&&(b+='<div class="jqs jqstitle">'+a.get("tooltipChartTitle")+"</div>\n"),g=this.options.get("tooltipFormat");if(!g)return"";d.isArray(g)||(g=[g]),d.isArray(f)||(f=[f]),m=this.options.get("tooltipFormatFieldlist"),n=this.options.get("tooltipFormatFieldlistKey");if(m&&n){o=[];for(l=f.length;l--;)p=f[l][n],(t=d.inArray(p,m))!=-1&&(o[t]=f[l]);f=o}i=g.length,s=f.length;for(l=0;l<i;l++){r=g[l],typeof r=="string"&&(r=new h(r)),j=r.fclass||"jqsfield";for(t=0;t<s;t++)if(!f[t].isNull||!a.get("tooltipSkipNull"))d.extend(f[t],{prefix:a.get("tooltipPrefix"),suffix:a.get("tooltipSuffix")}),k=r.render(f[t],a.get("tooltipValueLookups"),a),e.push('<div class="'+j+'">'+k+"</div>")}return e.length?b+e.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(a,c){var d=c.get("highlightColor"),e=c.get("highlightLighten"),f,g,h,j;if(d)return d;if(e){f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(a);if(f){h=[],g=a.length===4?16:1;for(j=0;j<3;j++)h[j]=i(b.round(parseInt(f[j+1],16)*g*e),0,255);return"rgb("+h.join(",")+")"}}return a}}),w={changeHighlight:function(a){var b=this.currentRegion,c=this.target,e=this.regionShapes[b],f;e&&(f=this.renderRegion(b,a),d.isArray(f)||d.isArray(e)?(c.replaceWithShapes(e,f),this.regionShapes[b]=d.map(f,function(a){return a.id})):(c.replaceWithShape(e,f),this.regionShapes[b]=f.id))},render:function(){var a=this.values,b=this.target,c=this.regionShapes,e,f,g,h;if(!this.cls._super.render.call(this))return;for(g=a.length;g--;){e=this.renderRegion(g);if(e)if(d.isArray(e)){f=[];for(h=e.length;h--;)e[h].append(),f.push(e[h].id);c[g]=f}else e.append(),c[g]=e.id;else c[g]=null}b.render()}},d.fn.sparkline.line=x=g(d.fn.sparkline._base,{type:"line",init:function(a,b,c,d,e){x._super.init.call(this,a,b,c,d,e),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(a,b,d){var e,f=this.regionMap;for(e=f.length;e--;)if(f[e]!==null&&b>=f[e][0]&&b<=f[e][1])return f[e][2];return c},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.yvalues[a]===null,x:this.xvalues[a],y:this.yvalues[a],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:a}},renderHighlight:function(){var a=this.currentRegion,b=this.target,d=this.vertices[a],e=this.options,f=e.get("spotRadius"),g=e.get("highlightSpotColor"),h=e.get("highlightLineColor"),i,j;if(!d)return;f&&g&&(i=b.drawCircle(d[0],d[1],f,c,g),this.highlightSpotId=i.id,b.insertAfterShape(this.lastShapeId,i)),h&&(j=b.drawLine(d[0],this.canvasTop,d[0],this.canvasTop+this.canvasHeight,h),this.highlightLineId=j.id,b.insertAfterShape(this.lastShapeId,j))},removeHighlight:function(){var a=this.target;this.highlightSpotId&&(a.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(a.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var a=this.values,c=a.length,d=this.xvalues,e=this.yvalues,f=this.yminmax,g,h,i,j,k;for(g=0;g<c;g++)h=a[g],i=typeof a[g]=="string",j=typeof a[g]=="object"&&a[g]instanceof Array,k=i&&a[g].split(":"),i&&k.length===2?(d.push(Number(k[0])),e.push(Number(k[1])),f.push(Number(k[1]))):j?(d.push(h[0]),e.push(h[1]),f.push(h[1])):(d.push(g),a[g]===null||a[g]==="null"?e.push(null):(e.push(Number(h)),f.push(Number(h))));this.options.get("xvalues")&&(d=this.options.get("xvalues")),this.maxy=this.maxyorg=b.max.apply(b,f),this.miny=this.minyorg=b.min.apply(b,f),this.maxx=b.max.apply(b,d),this.minx=b.min.apply(b,d),this.xvalues=d,this.yvalues=e,this.yminmax=f},processRangeOptions:function(){var a=this.options,b=a.get("normalRangeMin"),d=a.get("normalRangeMax");b!==c&&(b<this.miny&&(this.miny=b),d>this.maxy&&(this.maxy=d)),a.get("chartRangeMin")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMin")<this.miny)&&(this.miny=a.get("chartRangeMin")),a.get("chartRangeMax")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMax")>this.maxy)&&(this.maxy=a.get("chartRangeMax")),a.get("chartRangeMinX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMinX")<this.minx)&&(this.minx=a.get("chartRangeMinX")),a.get("chartRangeMaxX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMaxX")>this.maxx)&&(this.maxx=a.get("chartRangeMaxX"))},drawNormalRange:function(a,d,e,f,g){var h=this.options.get("normalRangeMin"),i=this.options.get("normalRangeMax"),j=d+b.round(e-e*((i-this.miny)/g)),k=b.round(e*(i-h)/g);this.target.drawRect(a,j,f,k,c,this.options.get("normalRangeColor")).append()},render:function(){var a=this.options,e=this.target,f=this.canvasWidth,g=this.canvasHeight,h=this.vertices,i=a.get("spotRadius"),j=this.regionMap,k,l,m,n,o,p,q,r,s,u,v,w,y,z,A,B,C,D,E,F,G,H,I,J,K;if(!x._super.render.call(this))return;this.scanValues(),this.processRangeOptions(),I=this.xvalues,J=this.yvalues;if(!this.yminmax.length||this.yvalues.length<2)return;n=o=0,k=this.maxx-this.minx===0?1:this.maxx-this.minx,l=this.maxy-this.miny===0?1:this.maxy-this.miny,m=this.yvalues.length-1,i&&(f<i*4||g<i*4)&&(i=0);if(i){G=a.get("highlightSpotColor")&&!a.get("disableInteraction");if(G||a.get("minSpotColor")||a.get("spotColor")&&J[m]===this.miny)g-=b.ceil(i);if(G||a.get("maxSpotColor")||a.get("spotColor")&&J[m]===this.maxy)g-=b.ceil(i),n+=b.ceil(i);if(G||(a.get("minSpotColor")||a.get("maxSpotColor"))&&(J[0]===this.miny||J[0]===this.maxy))o+=b.ceil(i),f-=b.ceil(i);if(G||a.get("spotColor")||a.get("minSpotColor")||a.get("maxSpotColor")&&(J[m]===this.miny||J[m]===this.maxy))f-=b.ceil(i)}g--,a.get("normalRangeMin")!==c&&!a.get("drawNormalOnTop")&&this.drawNormalRange(o,n,g,f,l),q=[],r=[q],z=A=null,B=J.length;for(K=0;K<B;K++)s=I[K],v=I[K+1],u=J[K],w=o+b.round((s-this.minx)*(f/k)),y=K<B-1?o+b.round((v-this.minx)*(f/k)):f,A=w+(y-w)/2,j[K]=[z||0,A,K],z=A,u===null?K&&(J[K-1]!==null&&(q=[],r.push(q)),h.push(null)):(u<this.miny&&(u=this.miny),u>this.maxy&&(u=this.maxy),q.length||q.push([w,n+g]),p=[w,n+b.round(g-g*((u-this.miny)/l))],q.push(p),h.push(p));C=[],D=[],E=r.length;for(K=0;K<E;K++)q=r[K],q.length&&(a.get("fillColor")&&(q.push([q[q.length-1][0],n+g]),D.push(q.slice(0)),q.pop()),q.length>2&&(q[0]=[q[0][0],q[1][1]]),C.push(q));E=D.length;for(K=0;K<E;K++)e.drawShape(D[K],a.get("fillColor"),a.get("fillColor")).append();a.get("normalRangeMin")!==c&&a.get("drawNormalOnTop")&&this.drawNormalRange(o,n,g,f,l),E=C.length;for(K=0;K<E;K++)e.drawShape(C[K],a.get("lineColor"),c,a.get("lineWidth")).append();if(i&&a.get("valueSpots")){F=a.get("valueSpots"),F.get===c&&(F=new t(F));for(K=0;K<B;K++)H=F.get(J[K]),H&&e.drawCircle(o+b.round((I[K]-this.minx)*(f/k)),n+b.round(g-g*((J[K]-this.miny)/l)),i,c,H).append()}i&&a.get("spotColor")&&J[m]!==null&&e.drawCircle(o+b.round((I[I.length-1]-this.minx)*(f/k)),n+b.round(g-g*((J[m]-this.miny)/l)),i,c,a.get("spotColor")).append(),this.maxy!==this.minyorg&&(i&&a.get("minSpotColor")&&(s=I[d.inArray(this.minyorg,J)],e.drawCircle(o+b.round((s-this.minx)*(f/k)),n+b.round(g-g*((this.minyorg-this.miny)/l)),i,c,a.get("minSpotColor")).append()),i&&a.get("maxSpotColor")&&(s=I[d.inArray(this.maxyorg,J)],e.drawCircle(o+b.round((s-this.minx)*(f/k)),n+b.round(g-g*((this.maxyorg-this.miny)/l)),i,c,a.get("maxSpotColor")).append())),this.lastShapeId=e.getLastShapeId(),this.canvasTop=n,e.render()}}),d.fn.sparkline.bar=y=g(d.fn.sparkline._base,w,{type:"bar",init:function(a,e,f,g,h){var j=parseInt(f.get("barWidth"),10),n=parseInt(f.get("barSpacing"),10),o=f.get("chartRangeMin"),p=f.get("chartRangeMax"),q=f.get("chartRangeClip"),r=Infinity,s=-Infinity,u,v,w,x,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R;y._super.init.call(this,a,e,f,g,h);for(A=0,B=e.length;A<B;A++){O=e[A],u=typeof O=="string"&&O.indexOf(":")>-1;if(u||d.isArray(O))J=!0,u&&(O=e[A]=l(O.split(":"))),O=m(O,null),v=b.min.apply(b,O),w=b.max.apply(b,O),v<r&&(r=v),w>s&&(s=w)}this.stacked=J,this.regionShapes={},this.barWidth=j,this.barSpacing=n,this.totalBarWidth=j+n,this.width=g=e.length*j+(e.length-1)*n,this.initTarget(),q&&(H=o===c?-Infinity:o,I=p===c?Infinity:p),z=[],x=J?[]:z;var S=[],T=[];for(A=0,B=e.length;A<B;A++)if(J){K=e[A],e[A]=N=[],S[A]=0,x[A]=T[A]=0;for(L=0,M=K.length;L<M;L++)O=N[L]=q?i(K[L],H,I):K[L],O!==null&&(O>0&&(S[A]+=O),r<0&&s>0?O<0?T[A]+=b.abs(O):x[A]+=O:x[A]+=b.abs(O-(O<0?s:r)),z.push(O))}else O=q?i(e[A],H,I):e[A],O=e[A]=k(O),O!==null&&z.push(O);this.max=G=b.max.apply(b,z),this.min=F=b.min.apply(b,z),this.stackMax=s=J?b.max.apply(b,S):G,this.stackMin=r=J?b.min.apply(b,z):F,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<F)&&(F=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>G)&&(G=f.get("chartRangeMax")),this.zeroAxis=D=f.get("zeroAxis",!0),F<=0&&G>=0&&D?E=0:D==0?E=F:F>0?E=F:E=G,this.xaxisOffset=E,C=J?b.max.apply(b,x)+b.max.apply(b,T):G-F,this.canvasHeightEf=D&&F<0?this.canvasHeight-2:this.canvasHeight-1,F<E?(Q=J&&G>=0?s:G,P=(Q-E)/C*this.canvasHeight,P!==b.ceil(P)&&(this.canvasHeightEf-=2,P=b.ceil(P))):P=this.canvasHeight,this.yoffset=P,d.isArray(f.get("colorMap"))?(this.colorMapByIndex=f.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=f.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new t(this.colorMapByValue))),this.range=C},getRegion:function(a,d,e){var f=b.floor(d/this.totalBarWidth);return f<0||f>=this.values.length?c:f},getCurrentRegionFields:function(){var a=this.currentRegion,b=r(this.values[a]),c=[],d,e;for(e=b.length;e--;)d=b[e],c.push({isNull:d===null,value:d,color:this.calcColor(e,d,a),offset:a});return c},calcColor:function(a,b,e){var f=this.colorMapByIndex,g=this.colorMapByValue,h=this.options,i,j;return this.stacked?i=h.get("stackedBarColor"):i=b<0?h.get("negBarColor"):h.get("barColor"),b===0&&h.get("zeroColor")!==c&&(i=h.get("zeroColor")),g&&(j=g.get(b))?i=j:f&&f.length>e&&(i=f[e]),d.isArray(i)?i[a%i.length]:i},renderRegion:function(a,e){var f=this.values[a],g=this.options,h=this.xaxisOffset,i=[],j=this.range,k=this.stacked,l=this.target,m=a*this.totalBarWidth,n=this.canvasHeightEf,p=this.yoffset,q,r,s,t,u,v,w,x,y,z;f=d.isArray(f)?f:[f],w=f.length,x=f[0],t=o(null,f),z=o(h,f,!0);if(t)return g.get("nullColor")?(s=e?g.get("nullColor"):this.calcHighlightColor(g.get("nullColor"),g),q=p>0?p-1:p,l.drawRect(m,q,this.barWidth-1,0,s,s)):c;u=p;for(v=0;v<w;v++){x=f[v];if(k&&x===h){if(!z||y)continue;y=!0}j>0?r=b.floor(n*(b.abs(x-h)/j))+1:r=1,x<h||x===h&&p===0?(q=u,u+=r):(q=p-r,p-=r),s=this.calcColor(v,x,a),e&&(s=this.calcHighlightColor(s,g)),i.push(l.drawRect(m,q,this.barWidth-1,r-1,s,s))}return i.length===1?i[0]:i}}),d.fn.sparkline.tristate=z=g(d.fn.sparkline._base,w,{type:"tristate",init:function(a,b,e,f,g){var h=parseInt(e.get("barWidth"),10),i=parseInt(e.get("barSpacing"),10);z._super.init.call(this,a,b,e,f,g),this.regionShapes={},this.barWidth=h,this.barSpacing=i,this.totalBarWidth=h+i,this.values=d.map(b,Number),this.width=f=b.length*h+(b.length-1)*i,d.isArray(e.get("colorMap"))?(this.colorMapByIndex=e.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=e.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new t(this.colorMapByValue))),this.initTarget()},getRegion:function(a,c,d){return b.floor(c/this.totalBarWidth)},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],color:this.calcColor(this.values[a],a),offset:a}},calcColor:function(a,b){var c=this.values,d=this.options,e=this.colorMapByIndex,f=this.colorMapByValue,g,h;return f&&(h=f.get(a))?g=h:e&&e.length>b?g=e[b]:c[b]<0?g=d.get("negBarColor"):c[b]>0?g=d.get("posBarColor"):g=d.get("zeroBarColor"),g},renderRegion:function(a,c){var d=this.values,e=this.options,f=this.target,g,h,i,j,k,l;g=f.pixelHeight,i=b.round(g/2),j=a*this.totalBarWidth,d[a]<0?(k=i,h=i-1):d[a]>0?(k=0,h=i-1):(k=i-1,h=2),l=this.calcColor(d[a],a);if(l===null)return;return c&&(l=this.calcHighlightColor(l,e)),f.drawRect(j,k,this.barWidth-1,h-1,l,l)}}),d.fn.sparkline.discrete=A=g(d.fn.sparkline._base,w,{type:"discrete",init:function(a,e,f,g,h){A._super.init.call(this,a,e,f,g,h),this.regionShapes={},this.values=e=d.map(e,Number),this.min=b.min.apply(b,e),this.max=b.max.apply(b,e),this.range=this.max-this.min,this.width=g=f.get("width")==="auto"?e.length*2:this.width,this.interval=b.floor(g/e.length),this.itemWidth=g/e.length,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<this.min)&&(this.min=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>this.max)&&(this.max=f.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight=f.get("lineHeight")==="auto"?b.round(this.canvasHeight*.3):f.get("lineHeight"))},getRegion:function(a,c,d){return b.floor(c/this.itemWidth)},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],offset:a}},renderRegion:function(a,c){var d=this.values,e=this.options,f=this.min,g=this.max,h=this.range,j=this.interval,k=this.target,l=this.canvasHeight,m=this.lineHeight,n=l-m,o,p,q,r;return p=i(d[a],f,g),r=a*j,o=b.round(n-n*((p-f)/h)),q=e.get("thresholdColor")&&p<e.get("thresholdValue")?e.get("thresholdColor"):e.get("lineColor"),c&&(q=this.calcHighlightColor(q,e)),k.drawLine(r,o,r,o+m,q)}}),d.fn.sparkline.bullet=B=g(d.fn.sparkline._base,{type:"bullet",init:function(a,d,e,f,g){var h,i,j;B._super.init.call(this,a,d,e,f,g),this.values=d=l(d),j=d.slice(),j[0]=j[0]===null?j[2]:j[0],j[1]=d[1]===null?j[2]:j[1],h=b.min.apply(b,d),i=b.max.apply(b,d),e.get("base")===c?h=h<0?h:0:h=e.get("base"),this.min=h,this.max=i,this.range=i-h,this.shapes={},this.valueShapes={},this.regiondata={},this.width=f=e.get("width")==="auto"?"4.0em":f,this.target=this.$el.simpledraw(f,g,e.get("composite")),d.length||(this.disabled=!0),this.initTarget()},getRegion:function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},getCurrentRegionFields:function(){var a=this.currentRegion;return{fieldkey:a.substr(0,1),value:this.values[a.substr(1)],region:a}},changeHighlight:function(a){var b=this.currentRegion,c=this.valueShapes[b],d;delete this.shapes[c];switch(b.substr(0,1)){case"r":d=this.renderRange(b.substr(1),a);break;case"p":d=this.renderPerformance(a);break;case"t":d=this.renderTarget(a)}this.valueShapes[b]=d.id,this.shapes[d.id]=b,this.target.replaceWithShape(c,d)},renderRange:function(a,c){var d=this.values[a],e=b.round(this.canvasWidth*((d-this.min)/this.range)),f=this.options.get("rangeColors")[a-2];return c&&(f=this.calcHighlightColor(f,this.options)),this.target.drawRect(0,0,e-1,this.canvasHeight-1,f,f)},renderPerformance:function(a){var c=this.values[1],d=b.round(this.canvasWidth*((c-this.min)/this.range)),e=this.options.get("performanceColor");return a&&(e=this.calcHighlightColor(e,this.options)),this.target.drawRect(0,b.round(this.canvasHeight*.3),d-1,b.round(this.canvasHeight*.4)-1,e,e)},renderTarget:function(a){var c=this.values[0],d=b.round(this.canvasWidth*((c-this.min)/this.range)-this.options.get("targetWidth")/2),e=b.round(this.canvasHeight*.1),f=this.canvasHeight-e*2,g=this.options.get("targetColor");return a&&(g=this.calcHighlightColor(g,this.options)),this.target.drawRect(d,e,this.options.get("targetWidth")-1,f-1,g,g)},render:function(){var a=this.values.length,b=this.target,c,d;if(!B._super.render.call(this))return;for(c=2;c<a;c++)d=this.renderRange(c).append(),this.shapes[d.id]="r"+c,this.valueShapes["r"+c]=d.id;this.values[1]!==null&&(d=this.renderPerformance().append(),this.shapes[d.id]="p1",this.valueShapes.p1=d.id),this.values[0]!==null&&(d=this.renderTarget().append(),this.shapes[d.id]="t0",this.valueShapes.t0=d.id),b.render()}}),d.fn.sparkline.pie=C=g(d.fn.sparkline._base,{type:"pie",init:function(a,c,e,f,g){var h=0,i;C._super.init.call(this,a,c,e,f,g),this.shapes={},this.valueShapes={},this.values=c=d.map(c,Number),e.get("width")==="auto"&&(this.width=this.height);if(c.length>0)for(i=c.length;i--;)h+=c[i];this.total=h,this.initTarget(),this.radius=b.floor(b.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],percent:this.values[a]/this.total*100,color:this.options.get("sliceColors")[a%this.options.get("sliceColors").length],offset:a}},changeHighlight:function(a){var b=this.currentRegion,c=this.renderSlice(b,a),d=this.valueShapes[b];delete this.shapes[d],this.target.replaceWithShape(d,c),this.valueShapes[b]=c.id,this.shapes[c.id]=b},renderSlice:function(a,d){var e=this.target,f=this.options,g=this.radius,h=f.get("borderWidth"),i=f.get("offset"),j=2*b.PI,k=this.values,l=this.total,m=i?2*b.PI*(i/360):0,n,o,p,q,r;q=k.length;for(p=0;p<q;p++){n=m,o=m,l>0&&(o=m+j*(k[p]/l));if(a===p)return r=f.get("sliceColors")[p%f.get("sliceColors").length],d&&(r=this.calcHighlightColor(r,f)),e.drawPieSlice(g,g,g-h,n,o,c,r);m=o}},render:function(){var a=this.target,d=this.values,e=this.options,f=this.radius,g=e.get("borderWidth"),h,i;if(!C._super.render.call(this))return;g&&a.drawCircle(f,f,b.floor(f-g/2),e.get("borderColor"),c,g).append();for(i=d.length;i--;)d[i]&&(h=this.renderSlice(i).append(),this.valueShapes[i]=h.id,this.shapes[h.id]=i);a.render()}}),d.fn.sparkline.box=D=g(d.fn.sparkline._base,{type:"box",init:function(a,b,c,e,f){D._super.init.call(this,a,b,c,e,f),this.values=d.map(b,Number),this.width=c.get("width")==="auto"?"4.0em":e,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var a=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles
+[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==c&&a.push({field:"lo",value:this.loutlier}),this.routlier!==c&&a.push({field:"ro",value:this.routlier}),this.lwhisker!==c&&a.push({field:"lw",value:this.lwhisker}),this.rwhisker!==c&&a.push({field:"rw",value:this.rwhisker}),a},render:function(){var a=this.target,d=this.values,e=d.length,f=this.options,g=this.canvasWidth,h=this.canvasHeight,i=f.get("chartRangeMin")===c?b.min.apply(b,d):f.get("chartRangeMin"),k=f.get("chartRangeMax")===c?b.max.apply(b,d):f.get("chartRangeMax"),l=0,m,n,o,p,q,r,s,t,u,v,w;if(!D._super.render.call(this))return;if(f.get("raw"))f.get("showOutliers")&&d.length>5?(n=d[0],m=d[1],p=d[2],q=d[3],r=d[4],s=d[5],t=d[6]):(m=d[0],p=d[1],q=d[2],r=d[3],s=d[4]);else{d.sort(function(a,b){return a-b}),p=j(d,1),q=j(d,2),r=j(d,3),o=r-p;if(f.get("showOutliers")){m=s=c;for(u=0;u<e;u++)m===c&&d[u]>p-o*f.get("outlierIQR")&&(m=d[u]),d[u]<r+o*f.get("outlierIQR")&&(s=d[u]);n=d[0],t=d[e-1]}else m=d[0],s=d[e-1]}this.quartiles=[p,q,r],this.lwhisker=m,this.rwhisker=s,this.loutlier=n,this.routlier=t,w=g/(k-i+1),f.get("showOutliers")&&(l=b.ceil(f.get("spotRadius")),g-=2*b.ceil(f.get("spotRadius")),w=g/(k-i+1),n<m&&a.drawCircle((n-i)*w+l,h/2,f.get("spotRadius"),f.get("outlierLineColor"),f.get("outlierFillColor")).append(),t>s&&a.drawCircle((t-i)*w+l,h/2,f.get("spotRadius"),f.get("outlierLineColor"),f.get("outlierFillColor")).append()),a.drawRect(b.round((p-i)*w+l),b.round(h*.1),b.round((r-p)*w),b.round(h*.8),f.get("boxLineColor"),f.get("boxFillColor")).append(),a.drawLine(b.round((m-i)*w+l),b.round(h/2),b.round((p-i)*w+l),b.round(h/2),f.get("lineColor")).append(),a.drawLine(b.round((m-i)*w+l),b.round(h/4),b.round((m-i)*w+l),b.round(h-h/4),f.get("whiskerColor")).append(),a.drawLine(b.round((s-i)*w+l),b.round(h/2),b.round((r-i)*w+l),b.round(h/2),f.get("lineColor")).append(),a.drawLine(b.round((s-i)*w+l),b.round(h/4),b.round((s-i)*w+l),b.round(h-h/4),f.get("whiskerColor")).append(),a.drawLine(b.round((q-i)*w+l),b.round(h*.1),b.round((q-i)*w+l),b.round(h*.9),f.get("medianColor")).append(),f.get("target")&&(v=b.ceil(f.get("spotRadius")),a.drawLine(b.round((f.get("target")-i)*w+l),b.round(h/2-v),b.round((f.get("target")-i)*w+l),b.round(h/2+v),f.get("targetColor")).append(),a.drawLine(b.round((f.get("target")-i)*w+l-v),b.round(h/2),b.round((f.get("target")-i)*w+l+v),b.round(h/2),f.get("targetColor")).append()),a.render()}}),G=g({init:function(a,b,c,d){this.target=a,this.id=b,this.type=c,this.args=d},append:function(){return this.target.appendShape(this),this}}),H=g({_pxregex:/(\d+)(px)?\s*$/i,init:function(a,b,c){if(!a)return;this.width=a,this.height=b,this.target=c,this.lastShapeId=null,c[0]&&(c=c[0]),d.data(c,"_jqs_vcanvas",this)},drawLine:function(a,b,c,d,e,f){return this.drawShape([[a,b],[c,d]],e,f)},drawShape:function(a,b,c,d){return this._genShape("Shape",[a,b,c,d])},drawCircle:function(a,b,c,d,e,f){return this._genShape("Circle",[a,b,c,d,e,f])},drawPieSlice:function(a,b,c,d,e,f,g){return this._genShape("PieSlice",[a,b,c,d,e,f,g])},drawRect:function(a,b,c,d,e,f){return this._genShape("Rect",[a,b,c,d,e,f])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(a,b){d(b).html(a)},_calculatePixelDims:function(a,b,c){var e;e=this._pxregex.exec(b),e?this.pixelHeight=e[1]:this.pixelHeight=d(c).height(),e=this._pxregex.exec(a),e?this.pixelWidth=e[1]:this.pixelWidth=d(c).width()},_genShape:function(a,b){var c=L++;return b.unshift(c),new G(this,c,a,b)},appendShape:function(a){alert("appendShape not implemented")},replaceWithShape:function(a,b){alert("replaceWithShape not implemented")},insertAfterShape:function(a,b){alert("insertAfterShape not implemented")},removeShapeId:function(a){alert("removeShapeId not implemented")},getShapeAt:function(a,b,c){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),I=g(H,{init:function(b,e,f,g){I._super.init.call(this,b,e,f),this.canvas=a.createElement("canvas"),f[0]&&(f=f[0]),d.data(f,"_jqs_vcanvas",this),d(this.canvas).css({display:"inline-block",width:b,height:e,verticalAlign:"top"}),this._insert(this.canvas,f),this._calculatePixelDims(b,e,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=g,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c,d(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(a,b,d){var e=this.canvas.getContext("2d");return a!==c&&(e.strokeStyle=a),e.lineWidth=d===c?1:d,b!==c&&(e.fillStyle=b),e},reset:function(){var a=this._getContext();a.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c},_drawShape:function(a,b,d,e,f){var g=this._getContext(d,e,f),h,i;g.beginPath(),g.moveTo(b[0][0]+.5,b[0][1]+.5);for(h=1,i=b.length;h<i;h++)g.lineTo(b[h][0]+.5,b[h][1]+.5);d!==c&&g.stroke(),e!==c&&g.fill(),this.targetX!==c&&this.targetY!==c&&g.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},_drawCircle:function(a,d,e,f,g,h,i){var j=this._getContext(g,h,i);j.beginPath(),j.arc(d,e,f,0,2*b.PI,!1),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a),g!==c&&j.stroke(),h!==c&&j.fill()},_drawPieSlice:function(a,b,d,e,f,g,h,i){var j=this._getContext(h,i);j.beginPath(),j.moveTo(b,d),j.arc(b,d,e,f,g,!1),j.lineTo(b,d),j.closePath(),h!==c&&j.stroke(),i&&j.fill(),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},_drawRect:function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b+d,c],[b+d,c+e],[b,c+e],[b,c]],f,g)},appendShape:function(a){return this.shapes[a.id]=a,this.shapeseq.push(a.id),this.lastShapeId=a.id,a.id},replaceWithShape:function(a,b){var c=this.shapeseq,d;this.shapes[b.id]=b;for(d=c.length;d--;)c[d]==a&&(c[d]=b.id);delete this.shapes[a]},replaceWithShapes:function(a,b){var c=this.shapeseq,d={},e,f,g;for(f=a.length;f--;)d[a[f]]=!0;for(f=c.length;f--;)e=c[f],d[e]&&(c.splice(f,1),delete this.shapes[e],g=f);for(f=b.length;f--;)c.splice(g,0,b[f].id),this.shapes[b[f].id]=b[f]},insertAfterShape:function(a,b){var c=this.shapeseq,d;for(d=c.length;d--;)if(c[d]===a){c.splice(d+1,0,b.id),this.shapes[b.id]=b;return}},removeShapeId:function(a){var b=this.shapeseq,c;for(c=b.length;c--;)if(b[c]===a){b.splice(c,1);break}delete this.shapes[a]},getShapeAt:function(a,b,c){return this.targetX=b,this.targetY=c,this.render(),this.currentTargetShapeId},render:function(){var a=this.shapeseq,b=this.shapes,c=a.length,d=this._getContext(),e,f,g;d.clearRect(0,0,this.pixelWidth,this.pixelHeight);for(g=0;g<c;g++)e=a[g],f=b[e],this["_draw"+f.type].apply(this,f.args);this.interact||(this.shapes={},this.shapeseq=[])}}),J=g(H,{init:function(b,c,e){var f;J._super.init.call(this,b,c,e),e[0]&&(e=e[0]),d.data(e,"_jqs_vcanvas",this),this.canvas=a.createElement("span"),d(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:b,height:c,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,e),this._calculatePixelDims(b,c,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,f='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'"'+' style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",f),this.group=d(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(a,b,d,e,f){var g=[],h,i,j,k,l,m,n;for(n=0,m=b.length;n<m;n++)g[n]=""+b[n][0]+","+b[n][1];return h=g.splice(0,1),f=f===c?1:f,i=d===c?' stroked="false" ':' strokeWeight="'+f+'px" strokeColor="'+d+'" ',j=e===c?' filled="false"':' fillColor="'+e+'" filled="true" ',k=g[0]===g[g.length-1]?"x ":"",l='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+a+'" '+i+j+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+h+" l "+g.join(", ")+" "+k+'e">'+" </v:shape>",l},_drawCircle:function(a,b,d,e,f,g,h){var i,j,k;return b-=e,d-=e,i=f===c?' stroked="false" ':' strokeWeight="'+h+'px" strokeColor="'+f+'" ',j=g===c?' filled="false"':' fillColor="'+g+'" filled="true" ',k='<v:oval  id="jqsshape'+a+'" '+i+j+' style="position:absolute;top:'+d+"px; left:"+b+"px; width:"+e*2+"px; height:"+e*2+'px"></v:oval>',k},_drawPieSlice:function(a,d,e,f,g,h,i,j){var k,l,m,n,o,p,q,r;if(g===h)return"";h-g===2*b.PI&&(g=0,h=2*b.PI),l=d+b.round(b.cos(g)*f),m=e+b.round(b.sin(g)*f),n=d+b.round(b.cos(h)*f),o=e+b.round(b.sin(h)*f);if(l===n&&m===o){if(h-g<b.PI)return"";l=n=d+f,m=o=e}return l===n&&m===o&&h-g<b.PI?"":(k=[d-f,e-f,d+f,e+f,l,m,n,o],p=i===c?' stroked="false" ':' strokeWeight="1px" strokeColor="'+i+'" ',q=j===c?' filled="false"':' fillColor="'+j+'" filled="true" ',r='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+a+'" '+p+q+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+d+","+e+" wa "+k.join(", ")+' x e">'+" </v:shape>",r)},_drawRect:function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b,c+e],[b+d,c+e],[b+d,c],[b,c]],f,g)},reset:function(){this.group.innerHTML=""},appendShape:function(a){var b=this["_draw"+a.type].apply(this,a.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",b):this.prerender+=b,this.lastShapeId=a.id,a.id},replaceWithShape:function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].outerHTML=e},replaceWithShapes:function(a,b){var c=d("#jqsshape"+a[0]),e="",f=b.length,g;for(g=0;g<f;g++)e+=this["_draw"+b[g].type].apply(this,b[g].args);c[0].outerHTML=e;for(g=1;g<a.length;g++)d("#jqsshape"+a[g]).remove()},insertAfterShape:function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].insertAdjacentHTML("afterEnd",e)},removeShapeId:function(a){var b=d("#jqsshape"+a);this.group.removeChild(b[0])},getShapeAt:function(a,b,c){var d=a.id.substr(8);return d},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})})(document,Math);
diff --git a/javascript/generated/vega-embed@6.14.0 b/javascript/generated/vega-embed@6.14.0
new file mode 100644
--- /dev/null
+++ b/javascript/generated/vega-embed@6.14.0
@@ -0,0 +1,27 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vega"),require("vega-lite")):"function"==typeof define&&define.amd?define(["vega","vega-lite"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).vegaEmbed=t(e.vega,e.vegaLite)}(this,(function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(e),i=r(t),o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}
+/*!
+   * https://github.com/Starcounter-Jack/JSON-Patch
+   * (c) 2017 Joachim Wester
+   * MIT license
+   */var l,c=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h=Object.prototype.hasOwnProperty;function u(e,t){return h.call(e,t)}function p(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)u(e,n)&&t.push(n);return t}function f(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function d(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function v(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function g(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function m(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(m(e[t]))return!0}else if("object"==typeof e){var n=p(e),i=n.length;for(t=0;t<i;t++)if(m(e[n[t]]))return!0}return!1}function E(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var b=function(e){function t(t,r,n,i,o){var a=this.constructor,s=e.call(this,E(t,{name:r,index:n,operation:i,tree:o}))||this;return s.name=r,s.index=n,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=E(t,{name:r,index:n,operation:i,tree:o}),s}return c(t,e),t}(Error),y=b,w=f,O={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=I(r,this.path);n&&(n=f(n));var i=R(r,{op:"remove",path:this.from}).removed;return R(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=I(r,this.from);return R(r,{op:"add",path:this.path,value:f(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:S(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},A={add:function(e,t,r){return d(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:O.move,copy:O.copy,test:O.test,_get:O._get};function I(e,t){if(""==t)return e;var r={op:"_get",path:t};return R(e,r),r.value}function R(e,t,r,n,i,o){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=0),r&&("function"==typeof r?r(t,0,e,t.path):x(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=I(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=S(e,t.value),!1===a.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}n||(e=f(e));var s=(t.path||"").split("/"),l=e,c=1,h=s.length,u=void 0,p=void 0,v=void 0;for(v="function"==typeof r?r:x;;){if(p=s[c],i&&"__proto__"==p)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===u&&(void 0===l[p]?u=s.slice(0,c).join("/"):c==h-1&&(u=t.path),void 0!==u&&v(t,0,e,u)),c++,Array.isArray(l)){if("-"===p)p=l.length;else{if(r&&!d(p))throw new y("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);d(p)&&(p=~~p)}if(c>=h){if(r&&"add"===t.op&&p>l.length)throw new y("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=A[t.op].call(t,l,p,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(p&&-1!=p.indexOf("~")&&(p=g(p)),c>=h){if(!1===(a=O[t.op].call(t,l,p,e)).test)throw new y("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}l=l[p]}}function N(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=f(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=R(e,t[a],r,!0,i,a),e=o[a].newDocument;return o.newDocument=e,o}function x(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new y("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!O[e.op])throw new y("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new y("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new y('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new y("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&m(e.value))throw new y("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,o=n.split("/").length;if(i!==o+1&&i!==o)throw new y("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new y("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=$([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new y("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function $(e,t,r){try{if(!Array.isArray(e))throw new y("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)N(f(t),f(e),r||!0);else{r=r||x;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof y)return e;throw e}}function S(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!S(e[r],t[r]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!S(e[i=s[r]],t[i]))return!1;return!0}return e!=e&&t!=t}var T=Object.freeze({__proto__:null,JsonPatchError:y,deepClone:w,getValueByPointer:I,applyOperation:R,applyPatch:N,applyReducer:function(e,t,r){var n=R(e,t);if(!1===n.test)throw new y("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument},validator:x,validate:$,_areEquals:S}),L=new WeakMap,C=function(e){this.observers=new Map,this.obj=e},D=function(e,t){this.callback=e,this.observer=t};
+/*!
+   * https://github.com/Starcounter-Jack/JSON-Patch
+   * (c) 2017 Joachim Wester
+   * MIT license
+   */function k(e,t){void 0===t&&(t=!1);var r=L.get(e.object);F(r.value,e.object,e.patches,"",t),e.patches.length&&N(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function F(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=p(t),a=p(e),s=!1,l=a.length-1;l>=0;l--){var c=e[d=a[l]];if(!u(t,d)||void 0===t[d]&&void 0!==c&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+v(d),value:f(c)}),r.push({op:"remove",path:n+"/"+v(d)}),s=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}));else{var h=t[d];"object"==typeof c&&null!=c&&"object"==typeof h&&null!=h?F(c,h,r,n+"/"+v(d),i):c!==h&&(i&&r.push({op:"test",path:n+"/"+v(d),value:f(c)}),r.push({op:"replace",path:n+"/"+v(d),value:f(h)}))}}if(s||o.length!=a.length)for(l=0;l<o.length;l++){var d;u(e,d=o[l])||void 0===t[d]||r.push({op:"add",path:n+"/"+v(d),value:f(t[d])})}}}var P=Object.freeze({__proto__:null,unobserve:function(e,t){t.unobserve()},observe:function(e,t){var r,n=function(e){return L.get(e)}(e);if(n){var i=function(e,t){return e.observers.get(t)}(n,t);r=i&&i.observer}else n=new C(e),L.set(e,n);if(r)return r;if(r={},n.value=f(e),t){r.callback=t,r.next=null;var o=function(){k(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=[],r.object=e,r.unobserve=function(){k(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},n.observers.set(t,new D(t,r)),r},generate:k,compare:function(e,t,r){void 0===r&&(r=!1);var n=[];return F(e,t,n,"",r),n}});Object.assign({},T,P,{JsonPatchError:b,deepClone:f,escapePathComponent:v,unescapePathComponent:g});var _=/("(?:[^\\"]|\\.)*")|[:,]/g,j=function(e,t){var r,n,i;return t=t||{},r=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),n=""===r?1/0:void 0===t.maxLength?80:t.maxLength,i=t.replacer,function e(t,o,a){var s,l,c,h,u,p,f,d,v,g,m,E;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(m=JSON.stringify(t,i)))return m;if(f=n-o.length-a,m.length<=f&&(v=m.replace(_,(function(e,t){return t||e+" "}))).length<=f)return v;if(null!=i&&(t=JSON.parse(m),i=void 0),"object"==typeof t&&null!==t){if(d=o+r,c=[],l=0,Array.isArray(t))for(g="[",s="]",f=t.length;l<f;l++)c.push(e(t[l],d,l===f-1?0:1)||"null");else for(g="{",s="}",f=(p=Object.keys(t)).length;l<f;l++)h=p[l],u=JSON.stringify(h)+": ",void 0!==(E=e(t[h],d,u.length+(l===f-1?0:1)))&&c.push(u+E);if(c.length>0)return[g,r+c.join(",\n"+d),s].join("\n"+o)}return m}(e,"",0)};var z={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var M="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},B=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=z,n=(t=e.exports={}).re=[],i=t.src=[],o=t.t={};let a=0;const s=(e,t,r)=>{const s=a++;M(s,t),o[e]=s,i[s]=t,n[s]=new RegExp(t,r?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\.${i[o.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${i[o.BUILDIDENTIFIER]}(?:\\.${i[o.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),s("FULL",`^${i[o.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),s("LOOSE",`^${i[o.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${i[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${i[o.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),s("XRANGEPLAINLOOSE",`[v=\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),s("XRANGE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),s("COERCERTL",i[o.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${i[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${i[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${i[o.GTLT]}\\s*(${i[o.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${i[o.XRANGEPLAIN]})\\s+-\\s+(${i[o.XRANGEPLAIN]})\\s*$`),s("HYPHENRANGELOOSE",`^\\s*(${i[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[o.XRANGEPLAINLOOSE]})\\s*$`),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}));const G=["includePrerelease","loose","rtl"];var U=e=>e?"object"!=typeof e?{loose:!0}:G.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const X=/^[0-9]+$/,V=(e,t)=>{const r=X.test(e),n=X.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var W={compareIdentifiers:V,rcompareIdentifiers:(e,t)=>V(t,e)};const{MAX_LENGTH:H,MAX_SAFE_INTEGER:q}=z,{re:Y,t:J}=B,{compareIdentifiers:Q}=W;class Z{constructor(e,t){if(t=U(t),e instanceof Z){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>H)throw new TypeError(`version is longer than ${H} characters`);M("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?Y[J.LOOSE]:Y[J.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>q||this.major<0)throw new TypeError("Invalid major version");if(this.minor>q||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>q||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<q)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(M("SemVer.compare",this.version,this.options,e),!(e instanceof Z)){if("string"==typeof e&&e===this.version)return 0;e=new Z(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Z||(e=new Z(e,this.options)),Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)}comparePre(e){if(e instanceof Z||(e=new Z(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(M("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return Q(r,n)}while(++t)}compareBuild(e){e instanceof Z||(e=new Z(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(M("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return Q(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var K=Z;const{MAX_LENGTH:ee}=z,{re:te,t:re}=B;var ne=(e,t)=>{if(t=U(t),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>ee)return null;if(!(t.loose?te[re.LOOSE]:te[re.FULL]).test(e))return null;try{return new K(e,t)}catch(e){return null}};var ie=(e,t)=>{const r=ne(e,t);return r?r.version:null};var oe=(e,t)=>{const r=ne(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ae=(e,t,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new K(e,r).inc(t,n).version}catch(e){return null}};var se=(e,t,r)=>new K(e,r).compare(new K(t,r));var le=(e,t,r)=>0===se(e,t,r);var ce=(e,t)=>{if(le(e,t))return null;{const r=ne(e),n=ne(t),i=r.prerelease.length||n.prerelease.length,o=i?"pre":"",a=i?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==n[e])return o+e;return a}};var he=(e,t)=>new K(e,t).major;var ue=(e,t)=>new K(e,t).minor;var pe=(e,t)=>new K(e,t).patch;var fe=(e,t)=>{const r=ne(e,t);return r&&r.prerelease.length?r.prerelease:null};var de=(e,t,r)=>se(t,e,r);var ve=(e,t)=>se(e,t,!0);var ge=(e,t,r)=>{const n=new K(e,r),i=new K(t,r);return n.compare(i)||n.compareBuild(i)};var me=(e,t)=>e.sort(((e,r)=>ge(e,r,t)));var Ee=(e,t)=>e.sort(((e,r)=>ge(r,e,t)));var be=(e,t,r)=>se(e,t,r)>0;var ye=(e,t,r)=>se(e,t,r)<0;var we=(e,t,r)=>0!==se(e,t,r);var Oe=(e,t,r)=>se(e,t,r)>=0;var Ae=(e,t,r)=>se(e,t,r)<=0;var Ie=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return le(e,r,n);case"!=":return we(e,r,n);case">":return be(e,r,n);case">=":return Oe(e,r,n);case"<":return ye(e,r,n);case"<=":return Ae(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const{re:Re,t:Ne}=B;var xe=(e,t)=>{if(e instanceof K)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=Re[Ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),Re[Ne.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;Re[Ne.COERCERTL].lastIndex=-1}else r=e.match(Re[Ne.COERCE]);return null===r?null:ne(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)},$e=Se;function Se(e){var t=this;if(t instanceof Se||(t=new Se),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}function Te(e,t,r){var n=t===e.head?new De(r,null,t,e):new De(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function Le(e,t){e.tail=new De(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Ce(e,t){e.head=new De(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function De(e,t,r,n){if(!(this instanceof De))return new De(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}Se.Node=De,Se.create=Se,Se.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Se.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Se.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Se.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Le(this,arguments[e]);return this.length},Se.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Ce(this,arguments[e]);return this.length},Se.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Se.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Se.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},Se.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},Se.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},Se.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},Se.prototype.map=function(e,t){t=t||this;for(var r=new Se,n=this.head;null!==n;)r.push(e.call(t,n.value,this)),n=n.next;return r},Se.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Se,n=this.tail;null!==n;)r.push(e.call(t,n.value,this)),n=n.prev;return r},Se.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},Se.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},Se.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},Se.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},Se.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Se;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;for(;null!==i&&n<t;n++,i=i.next)r.push(i.value);return r},Se.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new Se;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;null!==i&&n>t;n--)i=i.prev;for(;null!==i&&n>e;n--,i=i.prev)r.push(i.value);return r},Se.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<r.length;n++)i=Te(this,i,r[n]);return o},Se.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{!function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}(Se)}catch(e){}const ke=Symbol("max"),Fe=Symbol("length"),Pe=Symbol("lengthCalculator"),_e=Symbol("allowStale"),je=Symbol("maxAge"),ze=Symbol("dispose"),Me=Symbol("noDisposeOnSet"),Be=Symbol("lruList"),Ge=Symbol("cache"),Ue=Symbol("updateAgeOnGet"),Xe=()=>1;const Ve=(e,t,r)=>{const n=e[Ge].get(t);if(n){const t=n.value;if(We(e,t)){if(qe(e,n),!e[_e])return}else r&&(e[Ue]&&(n.value.now=Date.now()),e[Be].unshiftNode(n));return t.value}},We=(e,t)=>{if(!t||!t.maxAge&&!e[je])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[je]&&r>e[je]},He=e=>{if(e[Fe]>e[ke])for(let t=e[Be].tail;e[Fe]>e[ke]&&null!==t;){const r=t.prev;qe(e,t),t=r}},qe=(e,t)=>{if(t){const r=t.value;e[ze]&&e[ze](r.key,r.value),e[Fe]-=r.length,e[Ge].delete(r.key),e[Be].removeNode(t)}};class Ye{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const Je=(e,t,r,n)=>{let i=r.value;We(e,i)&&(qe(e,r),e[_e]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Qe=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[ke]=e.max||1/0;const t=e.length||Xe;if(this[Pe]="function"!=typeof t?Xe:t,this[_e]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[je]=e.maxAge||0,this[ze]=e.dispose,this[Me]=e.noDisposeOnSet||!1,this[Ue]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[ke]=e||1/0,He(this)}get max(){return this[ke]}set allowStale(e){this[_e]=!!e}get allowStale(){return this[_e]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[je]=e,He(this)}get maxAge(){return this[je]}set lengthCalculator(e){"function"!=typeof e&&(e=Xe),e!==this[Pe]&&(this[Pe]=e,this[Fe]=0,this[Be].forEach((e=>{e.length=this[Pe](e.value,e.key),this[Fe]+=e.length}))),He(this)}get lengthCalculator(){return this[Pe]}get length(){return this[Fe]}get itemCount(){return this[Be].length}rforEach(e,t){t=t||this;for(let r=this[Be].tail;null!==r;){const n=r.prev;Je(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[Be].head;null!==r;){const n=r.next;Je(this,e,r,t),r=n}}keys(){return this[Be].toArray().map((e=>e.key))}values(){return this[Be].toArray().map((e=>e.value))}reset(){this[ze]&&this[Be]&&this[Be].length&&this[Be].forEach((e=>this[ze](e.key,e.value))),this[Ge]=new Map,this[Be]=new $e,this[Fe]=0}dump(){return this[Be].map((e=>!We(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Be]}set(e,t,r){if((r=r||this[je])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,i=this[Pe](t,e);if(this[Ge].has(e)){if(i>this[ke])return qe(this,this[Ge].get(e)),!1;const o=this[Ge].get(e).value;return this[ze]&&(this[Me]||this[ze](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[Fe]+=i-o.length,o.length=i,this.get(e),He(this),!0}const o=new Ye(e,t,i,n,r);return o.length>this[ke]?(this[ze]&&this[ze](e,t),!1):(this[Fe]+=o.length,this[Be].unshift(o),this[Ge].set(e,this[Be].head),He(this),!0)}has(e){if(!this[Ge].has(e))return!1;const t=this[Ge].get(e).value;return!We(this,t)}get(e){return Ve(this,e,!0)}peek(e){return Ve(this,e,!1)}pop(){const e=this[Be].tail;return e?(qe(this,e),e.value):null}del(e){qe(this,this[Ge].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[Ge].forEach(((e,t)=>Ve(this,t,!1)))}};class Ze{constructor(e,t){if(t=U(t),e instanceof Ze)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Ze(e.raw,t);if(e instanceof At)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!at(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&st(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=et.get(t);if(r)return r;const n=this.options.loose,i=n?tt[rt.HYPHENRANGELOOSE]:tt[rt.HYPHENRANGE];e=e.replace(i,bt(this.options.includePrerelease)),M("hyphen replace",e),e=e.replace(tt[rt.COMPARATORTRIM],nt),M("comparator trim",e,tt[rt.COMPARATORTRIM]),e=(e=(e=e.replace(tt[rt.TILDETRIM],it)).replace(tt[rt.CARETTRIM],ot)).split(/\s+/).join(" ");const o=n?tt[rt.COMPARATORLOOSE]:tt[rt.COMPARATOR],a=e.split(" ").map((e=>ct(e,this.options))).join(" ").split(/\s+/).map((e=>Et(e,this.options))).filter(this.options.loose?e=>!!e.match(o):()=>!0).map((e=>new At(e,this.options))),s=(a.length,new Map);for(const e of a){if(at(e))return[e];s.set(e.value,e)}s.size>1&&s.has("")&&s.delete("");const l=[...s.values()];return et.set(t,l),l}intersects(e,t){if(!(e instanceof Ze))throw new TypeError("a Range is required");return this.set.some((r=>lt(r,t)&&e.set.some((e=>lt(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new K(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(yt(this.set[t],e,this.options))return!0;return!1}}var Ke=Ze;const et=new Qe({max:1e3}),{re:tt,t:rt,comparatorTrimReplace:nt,tildeTrimReplace:it,caretTrimReplace:ot}=B,at=e=>"<0.0.0-0"===e.value,st=e=>""===e.value,lt=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},ct=(e,t)=>(M("comp",e,t),e=ft(e,t),M("caret",e),e=ut(e,t),M("tildes",e),e=vt(e,t),M("xrange",e),e=mt(e,t),M("stars",e),e),ht=e=>!e||"x"===e.toLowerCase()||"*"===e,ut=(e,t)=>e.trim().split(/\s+/).map((e=>pt(e,t))).join(" "),pt=(e,t)=>{const r=t.loose?tt[rt.TILDELOOSE]:tt[rt.TILDE];return e.replace(r,((t,r,n,i,o)=>{let a;return M("tilde",e,t,r,n,i,o),ht(r)?a="":ht(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:ht(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(M("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,M("tilde return",a),a}))},ft=(e,t)=>e.trim().split(/\s+/).map((e=>dt(e,t))).join(" "),dt=(e,t)=>{M("caret",e,t);const r=t.loose?tt[rt.CARETLOOSE]:tt[rt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,a)=>{let s;return M("caret",e,t,r,i,o,a),ht(r)?s="":ht(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:ht(o)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(M("replaceCaret pr",a),s="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(M("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),M("caret return",s),s}))},vt=(e,t)=>(M("replaceXRanges",e,t),e.split(/\s+/).map((e=>gt(e,t))).join(" ")),gt=(e,t)=>{e=e.trim();const r=t.loose?tt[rt.XRANGELOOSE]:tt[rt.XRANGE];return e.replace(r,((r,n,i,o,a,s)=>{M("xRange",e,r,n,i,o,a,s);const l=ht(i),c=l||ht(o),h=c||ht(a),u=h;return"="===n&&u&&(n=""),s=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&u?(c&&(o=0),a=0,">"===n?(n=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(s="-0"),r=`${n+i}.${o}.${a}${s}`):c?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:h&&(r=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`),M("xRange return",r),r}))},mt=(e,t)=>(M("replaceStars",e,t),e.trim().replace(tt[rt.STAR],"")),Et=(e,t)=>(M("replaceGTE0",e,t),e.trim().replace(tt[t.includePrerelease?rt.GTE0PRE:rt.GTE0],"")),bt=e=>(t,r,n,i,o,a,s,l,c,h,u,p,f)=>`${r=ht(n)?"":ht(i)?`>=${n}.0.0${e?"-0":""}`:ht(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=ht(c)?"":ht(h)?`<${+c+1}.0.0-0`:ht(u)?`<${c}.${+h+1}.0-0`:p?`<=${c}.${h}.${u}-${p}`:e?`<${c}.${h}.${+u+1}-0`:`<=${l}`}`.trim(),yt=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(M(e[r].semver),e[r].semver!==At.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},wt=Symbol("SemVer ANY");class Ot{static get ANY(){return wt}constructor(e,t){if(t=U(t),e instanceof Ot){if(e.loose===!!t.loose)return e;e=e.value}M("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===wt?this.value="":this.value=this.operator+this.semver.version,M("comp",this)}parse(e){const t=this.options.loose?It[Rt.COMPARATORLOOSE]:It[Rt.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new K(r[2],this.options.loose):this.semver=wt}toString(){return this.value}test(e){if(M("Comparator.test",e,this.options.loose),this.semver===wt||e===wt)return!0;if("string"==typeof e)try{e=new K(e,this.options)}catch(e){return!1}return Ie(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ot))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new Ke(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new Ke(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=Ie(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=Ie(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||i&&o||a||s}}var At=Ot;const{re:It,t:Rt}=B;var Nt=(e,t,r)=>{try{t=new Ke(t,r)}catch(e){return!1}return t.test(e)};var xt=(e,t)=>new Ke(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));var $t=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Ke(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&-1!==i.compare(e)||(n=e,i=new K(n,r)))})),n};var St=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Ke(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(n&&1!==i.compare(e)||(n=e,i=new K(n,r)))})),n};var Tt=(e,t)=>{e=new Ke(e,t);let r=new K("0.0.0");if(e.test(r))return r;if(r=new K("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let i=null;n.forEach((e=>{const t=new K(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!be(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!be(r,i)||(r=i)}return r&&e.test(r)?r:null};var Lt=(e,t)=>{try{return new Ke(e,t).range||"*"}catch(e){return null}};const{ANY:Ct}=At;var Dt=(e,t,r,n)=>{let i,o,a,s,l;switch(e=new K(e,n),t=new Ke(t,n),r){case">":i=be,o=Ae,a=ye,s=">",l=">=";break;case"<":i=ye,o=Oe,a=be,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Nt(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const c=t.set[r];let h=null,u=null;if(c.forEach((e=>{e.semver===Ct&&(e=new At(">=0.0.0")),h=h||e,u=u||e,i(e.semver,h.semver,n)?h=e:a(e.semver,u.semver,n)&&(u=e)})),h.operator===s||h.operator===l)return!1;if((!u.operator||u.operator===s)&&o(e,u.semver))return!1;if(u.operator===l&&a(e,u.semver))return!1}return!0};var kt=(e,t,r)=>Dt(e,t,">",r);var Ft=(e,t,r)=>Dt(e,t,"<",r);var Pt=(e,t,r)=>(e=new Ke(e,r),t=new Ke(t,r),e.intersects(t));const{ANY:_t}=At,jt=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===_t)return 1===t.length&&t[0].semver===_t;const n=new Set;let i,o,a,s,l,c,h;for(const t of e)">"===t.operator||">="===t.operator?i=zt(i,t,r):"<"===t.operator||"<="===t.operator?o=Mt(o,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&o){if(a=se(i.semver,o.semver,r),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of n){if(i&&!Nt(e,String(i),r))return null;if(o&&!Nt(e,String(o),r))return null;for(const n of t)if(!Nt(e,String(n),r))return!1;return!0}for(const e of t){if(h=h||">"===e.operator||">="===e.operator,c=c||"<"===e.operator||"<="===e.operator,i)if(">"===e.operator||">="===e.operator){if(s=zt(i,e,r),s===e&&s!==i)return!1}else if(">="===i.operator&&!Nt(i.semver,String(e),r))return!1;if(o)if("<"===e.operator||"<="===e.operator){if(l=Mt(o,e,r),l===e&&l!==o)return!1}else if("<="===o.operator&&!Nt(o.semver,String(e),r))return!1;if(!e.operator&&(o||i)&&0!==a)return!1}return!(i&&c&&!o&&0!==a)&&!(o&&h&&!i&&0!==a)},zt=(e,t,r)=>{if(!e)return t;const n=se(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},Mt=(e,t,r)=>{if(!e)return t;const n=se(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};var Bt=(e,t,r)=>{if(e===t)return!0;e=new Ke(e,r),t=new Ke(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=jt(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0},Gt={re:B.re,src:B.src,tokens:B.t,SEMVER_SPEC_VERSION:z.SEMVER_SPEC_VERSION,SemVer:K,compareIdentifiers:W.compareIdentifiers,rcompareIdentifiers:W.rcompareIdentifiers,parse:ne,valid:ie,clean:oe,inc:ae,diff:ce,major:he,minor:ue,patch:pe,prerelease:fe,compare:se,rcompare:de,compareLoose:ve,compareBuild:ge,sort:me,rsort:Ee,gt:be,lt:ye,eq:le,neq:we,gte:Oe,lte:Ae,cmp:Ie,coerce:xe,Comparator:At,Range:Ke,satisfies:Nt,toComparators:xt,maxSatisfying:$t,minSatisfying:St,minVersion:Tt,validRange:Lt,outside:Dt,gtr:kt,ltr:Ft,intersects:Pt,simplifyRange:(e,t,r)=>{const n=[];let i=null,o=null;const a=e.sort(((e,t)=>se(e,t,r)));for(const e of a){Nt(e,t,r)?(o=e,i||(i=e)):(o&&n.push([i,o]),o=null,i=null)}i&&n.push([i,null]);const s=[];for(const[e,t]of n)e===t?s.push(e):t||e!==a[0]?t?e===a[0]?s.push(`<=${t}`):s.push(`${e} - ${t}`):s.push(`>=${e}`):s.push("*");const l=s.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length<c.length?l:t},subset:Bt};function Ut(e){const[t,r]=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:r}}const Xt="#fff",Vt={background:"#333",title:{color:Xt},style:{"guide-label":{fill:Xt},"guide-title":{fill:Xt}},axis:{domainColor:Xt,gridColor:"#888",tickColor:Xt}},Wt="#4572a7",Ht={background:"#fff",arc:{fill:Wt},area:{fill:Wt},line:{stroke:Wt,strokeWidth:2},path:{stroke:Wt},rect:{fill:Wt},shape:{stroke:Wt},symbol:{fill:Wt,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},qt="#30a2da",Yt="#cbcbcb",Jt="#f0f0f0",Qt="#333",Zt={arc:{fill:qt},area:{fill:qt},axis:{domainColor:Yt,grid:!0,gridColor:Yt,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Yt,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Jt,group:{fill:Jt},legend:{labelColor:Qt,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Qt,titleFontSize:14,titlePadding:10},line:{stroke:qt,strokeWidth:2},path:{stroke:qt,strokeWidth:.5},rect:{fill:qt},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:qt},bar:{binSpacing:2,fill:qt,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Kt="#000",er={group:{fill:"#e5e5e5"},arc:{fill:Kt},area:{fill:Kt},line:{stroke:Kt},path:{stroke:Kt},rect:{fill:Kt},shape:{stroke:Kt},symbol:{fill:Kt,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},tr="Benton Gothic, sans-serif",rr="#82c6df",nr="Benton Gothic Bold, sans-serif",ir="normal",or={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},ar={background:"#ffffff",title:{anchor:"start",color:"#000000",font:nr,fontSize:22,fontWeight:"normal"},arc:{fill:rr},area:{fill:rr},line:{stroke:rr,strokeWidth:2},path:{stroke:rr},rect:{fill:rr},shape:{stroke:rr},symbol:{fill:rr,size:30},axis:{labelFont:tr,labelFontSize:11.5,labelFontWeight:"normal",titleFont:nr,titleFontSize:13,titleFontWeight:ir},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:tr,labelFontSize:11.5,symbolType:"square",titleFont:nr,titleFontSize:13,titleFontWeight:ir},range:{category:or["category-6"],diverging:or["fireandice-6"],heatmap:or["fire-7"],ordinal:or["fire-7"],ramp:or["fire-7"]}},sr="#ab5787",lr="#979797",cr={background:"#f9f9f9",arc:{fill:sr},area:{fill:sr},line:{stroke:sr},path:{stroke:sr},rect:{fill:sr},shape:{stroke:sr},symbol:{fill:sr,size:30},axis:{domainColor:lr,domainWidth:.5,gridWidth:.2,labelColor:lr,tickColor:lr,tickWidth:.2,titleColor:lr},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},hr="#3e5c69",ur={background:"#fff",arc:{fill:hr},area:{fill:hr},line:{stroke:hr},path:{stroke:hr},rect:{fill:hr},shape:{stroke:hr},symbol:{fill:hr},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},pr="#1696d2",fr="#000000",dr="Lato",vr="Lato",gr={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},mr={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:dr},axisX:{domain:!0,domainColor:fr,domainWidth:1,grid:!1,labelFontSize:12,labelFont:vr,labelAngle:0,tickColor:fr,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:dr},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:vr,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:dr,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:vr,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:dr,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:gr["six-groups-cat-1"],diverging:gr["diverging-colors"],heatmap:gr["diverging-colors"],ordinal:gr["six-groups-seq"],ramp:gr["shades-blue"]},area:{fill:pr},rect:{fill:pr},line:{color:pr,stroke:pr,strokeWidth:5},trail:{color:pr,stroke:pr,strokeWidth:0,size:1},path:{stroke:pr,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:pr,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:pr,stroke:null}},arc:{fill:pr},shape:{stroke:pr},symbol:{fill:pr,size:30}},Er="#3366CC",br="#ccc",yr="Arial, sans-serif",wr={arc:{fill:Er},area:{fill:Er},path:{stroke:Er},rect:{fill:Er},shape:{stroke:Er},symbol:{stroke:Er},circle:{fill:Er},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:yr,fontSize:12},"guide-title":{font:yr,fontSize:12},"group-title":{font:yr,fontSize:12}},title:{font:yr,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:br,tickColor:br,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Or="2.9.1";var Ar=Object.freeze({__proto__:null,dark:Vt,excel:Ht,fivethirtyeight:Zt,ggplot2:er,googlecharts:wr,latimes:ar,quartz:cr,urbaninstitute:mr,version:Or,vox:ur});function Ir(e,t,r){return e.fields=t||[],e.fname=r,e}function Rr(e){return 1===e.length?Nr(e[0]):xr(e)}const Nr=e=>function(t){return t[e]},xr=e=>{const t=e.length;return function(r){for(let n=0;n<t;++n)r=r[e[n]];return r}};function $r(e){throw Error(e)}(function(e,t,r){const n=function(e){const t=[],r=e.length;let n,i,o,a=null,s=0,l="";function c(){t.push(l+e.substring(n,i)),l="",n=i+1}for(e+="",n=i=0;i<r;++i)if(o=e[i],"\\"===o)l+=e.substring(n,i),l+=e.substring(++i,++i),n=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;n===s&&'"'===o||n===s&&"'"===o?(n=i+1,a=o):"."!==o||s?"["===o?(i>n&&c(),s=n=i+1):"]"===o&&(s||$r("Access path missing open bracket: "+e),s>0&&c(),s=0,n=i+1):i>n?c():n=i+1}return s&&$r("Access path missing closing bracket: "+e),a&&$r("Access path missing closing quote: "+e),i>n&&(i++,c()),t}(e);e=1===n.length?n[0]:e,Ir((r&&r.get||Rr)(n),[e],t||e)})("id"),Ir((e=>e),[],"identity"),Ir((()=>0),[],"zero"),Ir((()=>1),[],"one"),Ir((()=>!0),[],"true"),Ir((()=>!1),[],"false");var Sr=Array.isArray;function Tr(e){return e===Object(e)}var Lr="#vg-tooltip-element {\n  visibility: hidden;\n  padding: 8px;\n  position: fixed;\n  z-index: 1000;\n  font-family: sans-serif;\n  font-size: 11px;\n  border-radius: 3px;\n  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n  /* The default theme is the light theme. */\n  background-color: rgba(255, 255, 255, 0.95);\n  border: 1px solid #d9d9d9;\n  color: black; }\n  #vg-tooltip-element.visible {\n    visibility: visible; }\n  #vg-tooltip-element h2 {\n    margin-top: 0;\n    margin-bottom: 10px;\n    font-size: 13px; }\n  #vg-tooltip-element img {\n    max-width: 200px;\n    max-height: 200px; }\n  #vg-tooltip-element table {\n    border-spacing: 0; }\n    #vg-tooltip-element table tr {\n      border: none; }\n      #vg-tooltip-element table tr td {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        padding-top: 2px;\n        padding-bottom: 2px; }\n        #vg-tooltip-element table tr td.key {\n          color: #808080;\n          max-width: 150px;\n          text-align: right;\n          padding-right: 4px; }\n        #vg-tooltip-element table tr td.value {\n          display: block;\n          max-width: 300px;\n          max-height: 7em;\n          text-align: left; }\n  #vg-tooltip-element.dark-theme {\n    background-color: rgba(32, 32, 32, 0.9);\n    border: 1px solid #f5f5f5;\n    color: white; }\n    #vg-tooltip-element.dark-theme td.key {\n      color: #bfbfbf; }\n";const Cr="vg-tooltip-element",Dr={offsetX:10,offsetY:10,id:Cr,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};function kr(e,t,r){if(Sr(e))return`[${e.map((e=>t("string"==typeof e?e:Fr(e,r)))).join(", ")}]`;if(Tr(e)){let n="";const i=e,{title:o,image:a}=i,s=
+/*! *****************************************************************************
+  Copyright (c) Microsoft Corporation.
+
+  Permission to use, copy, modify, and/or distribute this software for any
+  purpose with or without fee is hereby granted.
+
+  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  PERFORMANCE OF THIS SOFTWARE.
+  ***************************************************************************** */
+function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(i,["title","image"]);o&&(n+=`<h2>${t(o)}</h2>`),a&&(n+=`<img src="${t(a)}">`);const l=Object.keys(s);if(l.length>0){n+="<table>";for(const e of l){let i=s[e];void 0!==i&&(Tr(i)&&(i=Fr(i,r)),n+=`<tr><td class="key">${t(e)}:</td><td class="value">${t(i)}</td></tr>`)}n+="</table>"}return n||"{}"}return t(e)}function Fr(e,t){return JSON.stringify(e,function(e){const t=[];return function(r,n){if("object"!=typeof n||null===n)return n;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(n)>=0?"[Circular]":(t.push(n),n)}}(t))}class Pr{constructor(e){this.options=Object.assign(Object.assign({},Dr),e);const t=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Lr.toString().replace(Cr,e)}(t);const r=document.head;r.childNodes.length>0?r.insertBefore(e,r.childNodes[0]):r.appendChild(e)}this.el=document.getElementById(t),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",t),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(e,t,r,n){if(null==n||""===n)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=kr(n,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(e,t,r,n){let i=e.clientX+r;i+t.width>window.innerWidth&&(i=+e.clientX-r-t.width);let o=e.clientY+n;return o+t.height>window.innerHeight&&(o=+e.clientY-n-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${o}px; left: ${i}px`)}}var _r;function jr(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")}function zr(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0,i=t;n<i.length;n++){var o=i[n];Mr(e,o)}return e}function Mr(t,r){for(var n=0,i=Object.keys(r);n<i.length;n++){var o=i[n];e.writeConfig(t,o,r[o],!0)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});var Br=n,Gr=i,Ur="undefined"!=typeof window?window:void 0;void 0===Gr&&(null===(_r=null==Ur?void 0:Ur.vl)||void 0===_r?void 0:_r.compile)&&(Gr=Ur.vl);var Xr={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Vr={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Wr={vega:"Vega","vega-lite":"Vega-Lite"},Hr={vega:Br.version,"vega-lite":Gr?Gr.version:"not available"},qr={vega:function(e){return e},"vega-lite":function(e,t){return Gr.compile(e,{config:t}).spec}};function Yr(e,t,r,n){var i="<html><head>"+t+'</head><body><pre><code class="json">',o="</code></pre>"+r+"</body></html>",a=window.open("");a.document.write(i+e+o),a.document.title=Wr[n]+" JSON Source"}function Jr(t,r,n){var i,l,c;return void 0===n&&(n={}),a(this,void 0,void 0,(function(){var a,h,u,p,f,d,v,g;return s(this,(function(s){switch(s.label){case 0:return m=n.loader,a=m&&"load"in m?n.loader:Br.loader(n.loader),e.isString(r)?(f=(p=JSON).parse,[4,a.load(r)]):[3,2];case 1:return u=f.apply(p,[s.sent()]),[3,3];case 2:u=r,s.label=3;case 3:return[4,Qr(null!==(i=(h=u).usermeta&&h.usermeta.embedOptions)&&void 0!==i?i:{},a)];case 4:return d=s.sent(),[4,Qr(n,a)];case 5:return v=s.sent(),g=o(o({},zr(v,d)),{config:e.mergeConfig(null!==(l=v.config)&&void 0!==l?l:{},null!==(c=d.config)&&void 0!==c?c:{})}),[4,Zr(t,h,g,a)];case 6:return[2,s.sent()]}var m}))}))}function Qr(t,r){var n;return a(this,void 0,void 0,(function(){var i,a,l,c,h,u,p,f;return s(this,(function(s){switch(s.label){case 0:return e.isString(t.config)?(c=(l=JSON).parse,[4,r.load(t.config)]):[3,2];case 1:return a=c.apply(l,[s.sent()]),[3,3];case 2:a=null!==(n=t.config)&&void 0!==n?n:{},s.label=3;case 3:return i=a,e.isString(t.patch)?(f=(p=JSON).parse,[4,r.load(t.patch)]):[3,5];case 4:return u=f.apply(p,[s.sent()]),[3,6];case 5:u=t.patch,s.label=6;case 6:return h=u,[2,o(o(o({},t),h?{patch:h}:{}),i?{config:i}:{})]}}))}))}function Zr(t,r,n,i){var l,c,h,u,p,f;return void 0===n&&(n={}),a(this,void 0,void 0,(function(){function d(){U&&document.removeEventListener("click",U),P.finalize()}var v,g,m,E,b,y,w,O,A,I,R,x,$,S,T,L,C,D,k,F,P,_,z,M,B,G,U,X,V,W,H,q,Y,J,Q,Z,K,ee;return s(this,(function(te){switch(te.label){case 0:if(v=n.theme?e.mergeConfig(Ar[n.theme],null!==(l=n.config)&&void 0!==l?l:{}):n.config,g=e.isBoolean(n.actions)?n.actions:zr({},Xr,null!==(c=n.actions)&&void 0!==c?c:{}),m=o(o({},Vr),n.i18n),E=null!==(h=n.renderer)&&void 0!==h?h:"canvas",b=null!==(u=n.logLevel)&&void 0!==u?u:Br.Warn,y=null!==(p=n.downloadFileName)&&void 0!==p?p:"visualization",!(w="string"==typeof t?document.querySelector(t):t))throw new Error(t+" does not exist");return!1!==n.defaultStyle&&(O="vega-embed-style",A=function(e){var t,r=e.getRootNode?e.getRootNode():document;return r instanceof ShadowRoot?{root:r,rootContainer:r}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}(w),I=A.root,R=A.rootContainer,I.getElementById(O)||((x=document.createElement("style")).id=O,x.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?'.vega-embed {\n  position: relative;\n  display: inline-block;\n  box-sizing: border-box; }\n  .vega-embed.has-actions {\n    padding-right: 38px; }\n  .vega-embed details:not([open]) > :not(summary) {\n    display: none !important; }\n  .vega-embed summary {\n    list-style: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    padding: 6px;\n    z-index: 1000;\n    background: white;\n    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n    color: #1b1e23;\n    border: 1px solid #aaa;\n    border-radius: 999px;\n    opacity: 0.2;\n    transition: opacity 0.4s ease-in;\n    outline: none;\n    cursor: pointer;\n    line-height: 0px; }\n    .vega-embed summary::-webkit-details-marker {\n      display: none; }\n    .vega-embed summary:active {\n      box-shadow: #aaa 0px 0px 0px 1px inset; }\n    .vega-embed summary svg {\n      width: 14px;\n      height: 14px; }\n  .vega-embed details[open] summary {\n    opacity: 0.7; }\n  .vega-embed:hover summary,\n  .vega-embed:focus summary {\n    opacity: 1 !important;\n    transition: opacity 0.2s ease; }\n  .vega-embed .vega-actions {\n    position: absolute;\n    z-index: 1001;\n    top: 35px;\n    right: -9px;\n    display: flex;\n    flex-direction: column;\n    padding-bottom: 8px;\n    padding-top: 8px;\n    border-radius: 4px;\n    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n    border: 1px solid #d9d9d9;\n    background: white;\n    animation-duration: 0.15s;\n    animation-name: scale-in;\n    animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n    text-align: left; }\n    .vega-embed .vega-actions a {\n      padding: 8px 16px;\n      font-family: sans-serif;\n      font-size: 14px;\n      font-weight: 600;\n      white-space: nowrap;\n      color: #434a56;\n      text-decoration: none; }\n      .vega-embed .vega-actions a:hover {\n        background-color: #f7f7f9;\n        color: black; }\n    .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n      content: "";\n      display: inline-block;\n      position: absolute; }\n    .vega-embed .vega-actions::before {\n      left: auto;\n      right: 14px;\n      top: -16px;\n      border: 8px solid #0000;\n      border-bottom-color: #d9d9d9; }\n    .vega-embed .vega-actions::after {\n      left: auto;\n      right: 15px;\n      top: -14px;\n      border: 7px solid #0000;\n      border-bottom-color: #fff; }\n  .vega-embed .chart-wrapper {\n    width: 100%;\n    height: 100%; }\n\n.vega-embed-wrapper {\n  max-width: 100%;\n  overflow: auto;\n  padding-right: 14px; }\n\n@keyframes scale-in {\n  from {\n    opacity: 0;\n    transform: scale(0.6); }\n  to {\n    opacity: 1;\n    transform: scale(1); } }\n'.toString():n.defaultStyle,R.appendChild(x))),$=function(e,t){var r;if(e.$schema){var n=Ut(e.$schema);t&&t!==n.library&&console.warn("The given visualization spec is written in "+Wr[n.library]+", but mode argument sets "+(null!==(r=Wr[t])&&void 0!==r?r:t)+".");var i=n.library;return Gt.satisfies(Hr[i],"^"+n.version.slice(1))||console.warn("The input spec uses "+Wr[i]+" "+n.version+", but the current version of "+Wr[i]+" is v"+Hr[i]+"."),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}(r,n.mode),S=qr[$](r,v),"vega-lite"===$&&S.$schema&&(T=Ut(S.$schema),Gt.satisfies(Hr.vega,"^"+T.version.slice(1))||console.warn("The compiled spec uses Vega "+T.version+", but current version is v"+Hr.vega+".")),w.classList.add("vega-embed"),g&&w.classList.add("has-actions"),w.innerHTML="",L=w,g&&((C=document.createElement("div")).classList.add("chart-wrapper"),w.appendChild(C),L=C),(D=n.patch)&&(S=D instanceof Function?D(S):N(S,D,!0,!1).newDocument),n.formatLocale&&Br.formatLocale(n.formatLocale),n.timeFormatLocale&&Br.timeFormatLocale(n.timeFormatLocale),k=n.ast,F=Br.parse(S,"vega-lite"===$?{}:v,{ast:k}),P=new Br.View(F,o({loader:i,logLevel:b,renderer:E},k?{expr:Br.expressionInterpreter}:{})),!1!==n.tooltip&&(_=void 0,re=n.tooltip,_="function"==typeof re?n.tooltip:new Pr(!0===n.tooltip?{}:n.tooltip).call,P.tooltip(_)),void 0===(z=n.hover)&&(z="vega"===$),z&&(B=(M="boolean"==typeof z?{}:z).hoverSet,G=M.updateSet,P.hover(B,G)),n&&(null!=n.width&&P.width(n.width),null!=n.height&&P.height(n.height),null!=n.padding&&P.padding(n.padding)),[4,P.initialize(L,n.bind).runAsync()];case 1:if(te.sent(),!1!==g){if(X=w,!1!==n.defaultStyle&&((V=document.createElement("details")).title=m.CLICK_TO_VIEW_ACTIONS,w.append(V),X=V,(W=document.createElement("summary")).innerHTML='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n  <circle r="2" cy="8" cx="2"></circle>\n  <circle r="2" cy="8" cx="8"></circle>\n  <circle r="2" cy="8" cx="14"></circle>\n</svg>',V.append(W),U=function(e){V.contains(e.target)||V.removeAttribute("open")},document.addEventListener("click",U)),H=document.createElement("div"),X.append(H),H.classList.add("vega-actions"),!0===g||!1!==g.export)for(q=function(e){if(!0===g||!0===g.export||g.export[e]){var t=m[e.toUpperCase()+"_ACTION"],r=document.createElement("a");r.text=t,r.href="#",r.target="_blank",r.download=y+"."+e,r.addEventListener("mousedown",(function(t){return a(this,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return t.preventDefault(),[4,P.toImageURL(e,n.scaleFactor)];case 1:return r=i.sent(),this.href=r,[2]}}))}))})),H.append(r)}},Y=0,J=["svg","png"];Y<J.length;Y++)q(J[Y]);!0!==g&&!1===g.source||((Q=document.createElement("a")).text=m.SOURCE_ACTION,Q.href="#",Q.addEventListener("click",(function(e){var t,i;Yr(j(r),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"",$),e.preventDefault()})),H.append(Q)),"vega-lite"!==$||!0!==g&&!1===g.compiled||((Z=document.createElement("a")).text=m.COMPILED_ACTION,Z.href="#",Z.addEventListener("click",(function(e){var t,r;Yr(j(S),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"","vega"),e.preventDefault()})),H.append(Z)),!0!==g&&!1===g.editor||(K=null!==(f=n.editorUrl)&&void 0!==f?f:"https://vega.github.io/editor/",(ee=document.createElement("a")).text=m.EDITOR_ACTION,ee.href="#",ee.addEventListener("click",(function(e){!function(e,t,r){var n=e.open(t),i=new URL(t).origin,o=40;e.addEventListener("message",(function t(r){r.source===n&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(n.postMessage(r,i),setTimeout(e,250),o-=1)}),250)}(window,K,{config:v,mode:$,renderer:E,spec:j(r)}),e.preventDefault()})),H.append(ee))}return[2,{view:P,spec:r,vgSpec:S,finalize:d}]}var re}))}))}function Kr(e,t){var r;return void 0===t&&(t={}),a(this,void 0,void 0,(function(){var n,i,a,l;return s(this,(function(s){switch(s.label){case 0:return(n=document.createElement("div")).classList.add("vega-embed-wrapper"),i=document.createElement("div"),n.appendChild(i),a=!0===t.actions||!1===t.actions?t.actions:o({export:!0,source:!1,compiled:!0,editor:!0},null!==(r=t.actions)&&void 0!==r?r:{}),[4,Jr(i,e,o({actions:a},null!=t?t:{}))];case 1:return l=s.sent(),n.value=l.view,[2,n]}}))}))}function en(e){return e instanceof HTMLElement}var tn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1&&(e.isString(t[0])&&!jr(t[0])||en(t[0])||3===t.length)?Jr(t[0],t[1],t[2]):Kr(t[0],t[1])};return tn.vegaLite=Gr,tn.vl=Gr,tn.container=Kr,tn.embed=Jr,tn.vega=Br,tn.default=Jr,tn.version="6.14.0",tn}));
+//# sourceMappingURL=vega-embed.min.js.map
diff --git a/javascript/generated/vega-lite@4.17.0 b/javascript/generated/vega-lite@4.17.0
new file mode 100644
--- /dev/null
+++ b/javascript/generated/vega-lite@4.17.0
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vegaLite={})}(this,(function(e){"use strict";function t(e,t,n){return e.fields=t||[],e.fname=n,e}function n(e){return 1===e.length?i(e[0]):o(e)}const i=e=>function(t){return t[e]},o=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function r(e){throw Error(e)}function a(e){const t=[],n=e.length;let i,o,a,s=null,c=0,u="";function l(){t.push(u+e.substring(i,o)),u="",i=o+1}for(e+="",i=o=0;o<n;++o)if(a=e[o],"\\"===a)u+=e.substring(i,o),u+=e.substring(++o,++o),i=o;else if(a===s)l(),s=null,c=-1;else{if(s)continue;i===c&&'"'===a||i===c&&"'"===a?(i=o+1,s=a):"."!==a||c?"["===a?(o>i&&l(),c=i=o+1):"]"===a&&(c||r("Access path missing open bracket: "+e),c>0&&l(),c=0,i=o+1):o>i?l():i=o+1}return c&&r("Access path missing closing bracket: "+e),s&&r("Access path missing closing quote: "+e),o>i&&(o++,l()),t}!function(e,i,o){const r=a(e);e=1===r.length?r[0]:e,t((o&&o.get||n)(r),[e],i||e)}("id");const s=t((e=>e),[],"identity");t((()=>0),[],"zero"),t((()=>1),[],"one"),t((()=>!0),[],"true"),t((()=>!1),[],"false");function c(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}var u=Array.isArray;function l(e){return e===Object(e)}const f=e=>"__proto__"!==e;function d(...e){return e.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=m(e.signals,t.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;p(e,n,t[n],i)}return e}),{})}function p(e,t,n,i){if(!f(t))return;let o,r;if(l(n)&&!u(n))for(o in r=l(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[o])?p(r,o,n[o]):f(o)&&(r[o]=n[o]);else e[t]=n}function m(e,t){if(null==e)return t;const n={},i=[];function o(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(o),e.forEach(o),i}function h(e){return null!=e?u(e)?e:[e]:[]}const g=Object.prototype.hasOwnProperty;function v(e,t){return g.call(e,t)}function y(e){return"boolean"==typeof e}function b(e){return"number"==typeof e}function x(e){return"string"==typeof e}function w(e){return u(e)?"["+e.map(w)+"]":l(e)||x(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function A(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,(function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var D=function(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}((function(e){var t=function(){function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{i=Promise}catch(e){i=function(){}}function o(r,s,c,u,l){"object"==typeof s&&(c=s.depth,u=s.prototype,l=s.includeNonEnumerable,s=s.circular);var f=[],d=[],p="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===c&&(c=1/0),function r(c,m){if(null===c)return null;if(0===m)return c;var h,g;if("object"!=typeof c)return c;if(e(c,t))h=new t;else if(e(c,n))h=new n;else if(e(c,i))h=new i((function(e,t){c.then((function(t){e(r(t,m-1))}),(function(e){t(r(e,m-1))}))}));else if(o.__isArray(c))h=[];else if(o.__isRegExp(c))h=new RegExp(c.source,a(c)),c.lastIndex&&(h.lastIndex=c.lastIndex);else if(o.__isDate(c))h=new Date(c.getTime());else{if(p&&Buffer.isBuffer(c))return h=Buffer.allocUnsafe?Buffer.allocUnsafe(c.length):new Buffer(c.length),c.copy(h),h;e(c,Error)?h=Object.create(c):void 0===u?(g=Object.getPrototypeOf(c),h=Object.create(g)):(h=Object.create(u),g=u)}if(s){var v=f.indexOf(c);if(-1!=v)return d[v];f.push(c),d.push(h)}for(var y in e(c,t)&&c.forEach((function(e,t){var n=r(t,m-1),i=r(e,m-1);h.set(n,i)})),e(c,n)&&c.forEach((function(e){var t=r(e,m-1);h.add(t)})),c){var b;g&&(b=Object.getOwnPropertyDescriptor(g,y)),b&&null==b.set||(h[y]=r(c[y],m-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(y=0;y<x.length;y++){var w=x[y];(!(D=Object.getOwnPropertyDescriptor(c,w))||D.enumerable||l)&&(h[w]=r(c[w],m-1),D.enumerable||Object.defineProperty(h,w,{enumerable:!1}))}}if(l){var A=Object.getOwnPropertyNames(c);for(y=0;y<A.length;y++){var D,F=A[y];(D=Object.getOwnPropertyDescriptor(c,F))&&D.enumerable||(h[F]=r(c[F],m-1),Object.defineProperty(h,F,{enumerable:!1}))}}return h}(r,c)}function r(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return o.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},o.__objToStr=r,o.__isDate=function(e){return"object"==typeof e&&"[object Date]"===r(e)},o.__isArray=function(e){return"object"==typeof e&&"[object Array]"===r(e)},o.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===r(e)},o.__getRegExpFlags=a,o}();e.exports&&(e.exports=t)})),F=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,i="boolean"==typeof t.cycles&&t.cycles,o=t.cmp&&(n=t.cmp,function(e){return function(t,i){var o={key:t,value:e[t]},r={key:i,value:e[i]};return n(o,r)}}),r=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==r.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=r.push(t)-1,c=Object.keys(t).sort(o&&o(t));for(a="",n=0;n<c.length;n++){var u=c[n],l=e(t[u]);l&&(a&&(a+=","),a+=JSON.stringify(u)+":"+l)}return r.splice(s,1),"{"+a+"}"}}(e)};function k(e){return!!e.or}function C(e){return!!e.and}function E(e){return!!e.not}function S(e,t){if(E(e))S(e.not,t);else if(C(e))for(const n of e.and)S(n,t);else if(k(e))for(const n of e.or)S(n,t);else t(e)}function B(e,t){return E(e)?{not:B(e.not,t)}:C(e)?{and:e.and.map((e=>B(e,t)))}:k(e)?{or:e.or.map((e=>B(e,t)))}:t(e)}const _=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,o,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(o=i;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;for(o=i;0!=o--;){var a=r[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n},z=D;function O(e,t){const n={};for(const i of t)v(e,i)&&(n[i]=e[i]);return n}function N(e,t){const n={...e};for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return"Set(".concat([...this].map((e=>F(e))).join(","),")")};const P=F;function j(e){if(b(e))return e;const t=x(e)?e:F(e);if(t.length<250)return t;let n=0;for(let e=0;e<t.length;e++){n=(n<<5)-n+t.charCodeAt(e),n&=n}return n}function M(e){return!1===e||null===e}function T(e,t){return e.indexOf(t)>-1}function L(e,t){let n=0;for(const[i,o]of e.entries())if(t(o,i,n++))return!0;return!1}function q(e,t){let n=0;for(const[i,o]of e.entries())if(!t(o,i,n++))return!1;return!0}function R(e,...t){for(const n of t)W(e,null!=n?n:{});return e}function W(e,t){for(const n of J(t))p(e,n,t[n],!0)}function U(e,t){const n=[],i={};let o;for(const r of e)o=t(r),o in i||(i[o]=1,n.push(r));return n}function I(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function H(e,t){for(const n of e)if(t.has(n))return!0;return!1}function G(e){const t=new Set;for(const n of e){const e=a(n).map(((e,t)=>0===t?e:"[".concat(e,"]"))),i=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of i)t.add(e)}return t}function V(e,t){return void 0===e||void 0===t||H(G(e),G(t))}function Y(e){return 0===J(e).length}const J=Object.keys,X=Object.values,Q=Object.entries;function $(e){return!0===e||!1===e}function K(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Z(e,t){return E(e)?"!("+Z(e.not,t)+")":C(e)?"("+e.and.map((e=>Z(e,t))).join(") && (")+")":k(e)?"("+e.or.map((e=>Z(e,t))).join(") || (")+")":t(e)}function ee(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&ee(e[n],t)&&delete e[n],Y(e)}function te(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ne(e,t="datum"){const n=a(e),i=[];for(let e=1;e<=n.length;e++){const o="[".concat(n.slice(0,e).map(w).join("]["),"]");i.push("".concat(t).concat(o))}return i.join(" && ")}function ie(e,t="datum"){return"".concat(t,"[").concat(w(a(e).join(".")),"]")}function oe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function re(e){return"".concat(a(e).map(oe).join("\\."))}function ae(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function se(e){return"".concat(a(e).join("."))}function ce(e){return e?a(e).length:0}function ue(...e){for(const t of e)if(void 0!==t)return t}let le=42;function fe(e){const t=++le;return e?String(e)+t:t}function de(e){return pe(e)?e:"__".concat(e)}function pe(e){return 0===e.indexOf("__")}function me(e){if(void 0!==e)return(e%360+360)%360}function he(e){return!!b(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const ge={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ve(e){return e&&e.condition}const ye=["domain","grid","labels","ticks","title"],be={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},xe={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},we={...xe,style:1,labelExpr:1,encoding:1};function Ae(e){return!!we[e]}const De=J({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),Fe={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},ke={count:1,min:1,max:1};function Ce(e){return!!e&&!!e.argmin}function Ee(e){return!!e&&!!e.argmax}function Se(e){return x(e)&&!!Fe[e]}const Be=["count","valid","missing","distinct"];function _e(e){return x(e)&&T(Be,e)}const ze=["count","sum","distinct","valid","missing"],Oe=A(["mean","average","median","q1","q3","min","max"]),Ne="row",Pe="column",je="facet",Me="x",Te="y",Le="x2",qe="y2",Re="radius",We="radius2",Ue="theta",Ie="theta2",He="latitude",Ge="longitude",Ve="latitude2",Ye="longitude2",Je="color",Xe="fill",Qe="stroke",$e="shape",Ke="size",Ze="angle",et="opacity",tt="fillOpacity",nt="strokeOpacity",it="strokeWidth",ot="strokeDash",rt="text",at="order",st="detail",ct="key",ut="tooltip",lt="href",ft="url",dt="description",pt={theta:1,theta2:1,radius:1,radius2:1};function mt(e){return e in pt}const ht={longitude:1,longitude2:1,latitude:1,latitude2:1};const gt=J(ht),vt={x:1,y:1,x2:1,y2:1,...pt,...ht,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function yt(e){return e===Je||e===Xe||e===Qe}const bt={row:1,column:1,facet:1},xt=J(bt),wt={...vt,...bt},At=J(wt),{order:Dt,detail:Ft,tooltip:kt,...Ct}=wt,{row:Et,column:St,facet:Bt,..._t}=Ct;function zt(e){return!!wt[e]}const Ot=[Le,qe,Ve,Ye,Ie,We];function Nt(e){return Pt(e)!==e}function Pt(e){switch(e){case Le:return Me;case qe:return Te;case Ve:return He;case Ye:return Ge;case Ie:return Ue;case We:return Re}return e}function jt(e){if(mt(e))switch(e){case Ue:return"startAngle";case Ie:return"endAngle";case Re:return"outerRadius";case We:return"innerRadius"}return e}function Mt(e){switch(e){case Me:return Le;case Te:return qe;case He:return Ve;case Ge:return Ye;case Ue:return Ie;case Re:return We}}function Tt(e){switch(e){case Me:case Le:return"width";case Te:case qe:return"height"}}const{x:Lt,y:qt,x2:Rt,y2:Wt,latitude:Ut,longitude:It,latitude2:Ht,longitude2:Gt,theta:Vt,theta2:Yt,radius:Jt,radius2:Xt,...Qt}=vt,$t=J(Qt),Kt={x:1,y:1},Zt=J(Kt);function en(e){return e in Kt}const tn={theta:1,radius:1},nn=J(tn);function on(e){return"width"===e?Me:Te}const{text:rn,tooltip:an,href:sn,url:cn,description:un,detail:ln,key:fn,order:dn,...pn}=Qt,mn=J(pn);const hn={...Kt,...tn,...pn},gn=J(hn);function vn(e){return!!hn[e]}function yn(e,t){return function(e){switch(e){case Je:case Xe:case Qe:case dt:case st:case ct:case ut:case lt:case at:case et:case tt:case nt:case it:case je:case Ne:case Pe:return bn;case Me:case Te:case He:case Ge:return wn;case Le:case qe:case Ve:case Ye:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Ke:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case ot:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case $e:return{point:"always",geoshape:"always"};case rt:return{text:"always"};case Ze:return{point:"always",square:"always",text:"always"};case ft:return{image:"always"};case Ue:case Re:return{text:"always",arc:"always"};case Ie:case We:return{arc:"always"}}}(e)[t]}const bn={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:xn,...wn}=bn;function An(e){switch(e){case Me:case Te:case Ue:case Re:case Ke:case Ze:case it:case et:case tt:case nt:case Le:case qe:case Ie:case We:return;case je:case Ne:case Pe:case $e:case ot:case rt:case ut:case lt:case ft:case dt:return"discrete";case Je:case Xe:case Qe:return"flexible";case He:case Ge:case Ve:case Ye:case st:case ct:case at:return}}function Dn(e){return y(e)&&(e=pa(e,void 0)),"bin"+J(e).map((t=>En(e[t])?K("_".concat(t,"_").concat(Q(e[t]))):K("_".concat(t,"_").concat(e[t])))).join("")}function Fn(e){return!0===e||Cn(e)&&!e.binned}function kn(e){return"binned"===e||Cn(e)&&!0===e.binned}function Cn(e){return l(e)}function En(e){return null==e?void 0:e.selection}function Sn(e){switch(e){case Ne:case Pe:case Ke:case Je:case Xe:case Qe:case it:case et:case tt:case nt:case $e:return 6;case ot:return 4;default:return 10}}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _n(e,t,n){var i=t.get(e);if(!i)throw new TypeError("attempted to set private field on non-instance");if(i.set)i.set.call(e,n);else{if(!i.writable)throw new TypeError("attempted to set read only private field");i.value=n}return n}function zn(e){return"Invalid specification ".concat(JSON.stringify(e),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}const On='Autosize "fit" only works for single views and layered views.';function Nn(e){return"".concat("width"==e?"Width":"Height",' "container" only works for single views and layered views.')}function Pn(e){const t="width"==e?"x":"y";return"".concat("width"==e?"Width":"Height",' "container" only works well with autosize "fit" or "fit-').concat(t,'".')}function jn(e){return e?'Dropping "fit-'.concat(e,'" because spec has discrete ').concat(Tt(e),"."):'Dropping "fit" because spec has discrete size.'}function Mn(e){return"Unknown field for ".concat(e,". Cannot calculate view size.")}function Tn(e){return'Cannot project a selection on encoding channel "'.concat(e,'", which has no field.')}function Ln(e,t){return'Cannot project a selection on encoding channel "'.concat(e,'" as it uses an aggregate function ("').concat(t,'").')}function qn(e){return"Selection not supported for ".concat(e," yet.")}const Rn="The same selection must be used to override scale domains in a layered view.";function Wn(e){return'The "columns" property cannot be used when "'.concat(e,'" has nested row/column.')}function Un(e,t,n){return'An ancestor parsed field "'.concat(e,'" as ').concat(n," but a child wants to parse the field as ").concat(t,".")}function In(e){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(e," are dropped.")}function Hn(e){return'Invalid field type "'.concat(e,'".')}function Gn(e,t){const{fill:n,stroke:i}=t;return"Dropping color ".concat(e," as the plot also has ").concat(n&&i?"fill and stroke":n?"fill":"stroke",".")}function Vn(e,t){return"Dropping ".concat(P(e),' from channel "').concat(t,'" since it does not contain any data field, datum, value, or signal.')}function Yn(e,t,n){return"".concat(e,' dropped as it is incompatible with "').concat(t,'"').concat(n?" when ".concat(n):"",".")}function Jn(e){return"".concat(e," encoding should be discrete (ordinal / nominal / binned).")}function Xn(e,t){return'Using discrete channel "'.concat(e,'" to encode "').concat(t,'" field can be misleading as it does not encode ').concat("ordinal"===t?"order":"magnitude",".")}function Qn(e){return"Using unaggregated domain with raw field has no effect (".concat(P(e),").")}function $n(e){return'Unaggregated domain not applicable for "'.concat(e,'" since it produces values outside the origin domain of the source data.')}function Kn(e){return"Unaggregated domain is currently unsupported for log scale (".concat(P(e),").")}function Zn(e,t,n){return"".concat(n,"-scale's \"").concat(t,'" is dropped as it does not work with ').concat(e," scale.")}function ei(e){return'The step for "'.concat(e,'" is dropped because the ').concat("width"===e?"x":"y"," is continuous.")}const ti="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function ni(e,t){return"Invalid ".concat(e,": ").concat(P(t),".")}function ii(e){return"1D error band does not support ".concat(e,".")}function oi(e){return"Channel ".concat(e,' is required for "binned" bin.')}const ri=function(e,t){let n=e||0;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=1&&c(t||"error","ERROR",arguments),this},warn(){return n>=2&&c(t||"warn","WARN",arguments),this},info(){return n>=3&&c(t||"log","INFO",arguments),this},debug(){return n>=4&&c(t||"log","DEBUG",arguments),this}}}(2);let ai=ri;function si(...e){ai.warn(...e)}function ci(e){if(e&&l(e))for(const t of gi)if(t in e)return!0;return!1}const ui=["january","february","march","april","may","june","july","august","september","october","november","december"],li=ui.map((e=>e.substr(0,3))),fi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],di=fi.map((e=>e.substr(0,3)));function pi(e,t){const n=[];if(t&&void 0!==e.day&&J(e).length>1&&(si(function(e){return"Dropping day from datetime ".concat(P(e)," as day cannot be combined with other units.")}(e)),delete(e=z(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const i=t?function(e){if(he(e)&&(e=+e),b(e))return e-1;{const t=e.toLowerCase(),n=ui.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),o=li.indexOf(i);if(-1!==o)return o;throw new Error(ni("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(he(e)&&(e=+e),b(e))return e>4&&si(ni("quarter",e)),e-1;throw new Error(ni("quarter",e))}(e.quarter):e.quarter;n.push(b(i)?3*i:i+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const i=t?function(e){if(he(e)&&(e=+e),b(e))return e%7;{const t=e.toLowerCase(),n=fi.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),o=di.indexOf(i);if(-1!==o)return o;throw new Error(ni("day",e))}}(e.day):e.day;n.push(b(i)?i+1:i+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const i=e[t];n.push(void 0===i?0:i)}return n}function mi(e){const t=pi(e,!0).join(", ");return e.utc?"utc(".concat(t,")"):"datetime(".concat(t,")")}const hi={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},gi=J(hi);function vi(e){return e.startsWith("utc")}const yi={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function bi(e){const t=[];for(const n of gi)xi(e,n)&&t.push(n);return t}function xi(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function wi(e,t,{end:n}={end:!1}){const i=ne(t),o=vi(e)?"utc":"";let r;const a={};for(const t of gi)xi(e,t)&&(a[t]="quarter"===(s=t)?"(".concat(o,"quarter(").concat(i,")-1)"):"".concat(o).concat(s,"(").concat(i,")"),r=t);var s;return n&&(a[r]+="+1"),function(e){const t=pi(e,!1).join(", ");return e.utc?"utc(".concat(t,")"):"datetime(".concat(t,")")}(a)}function Ai(e){if(!e)return;const t=bi(e);return"timeUnitSpecifier(".concat(F(t),", ").concat(F(yi),")")}function Di(e){if(!e)return;let t;return x(e)?t={unit:e}:l(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),vi(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function Fi(e){return e&&!!e.signal}function ki(e){return!!e.step}function Ci(e){return!u(e)&&("field"in e&&"data"in e)}const Ei=J({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Si={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Bi=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function _i(e){return e&&!!e.field&&void 0!==e.equal}function zi(e){return e&&!!e.field&&void 0!==e.lt}function Oi(e){return e&&!!e.field&&void 0!==e.lte}function Ni(e){return e&&!!e.field&&void 0!==e.gt}function Pi(e){return e&&!!e.field&&void 0!==e.gte}function ji(e){if(e&&e.field){if(u(e.range)&&2===e.range.length)return!0;if(Fi(e.range))return!0}return!1}function Mi(e){return e&&!!e.field&&(u(e.oneOf)||u(e.in))}function Ti(e){return Mi(e)||_i(e)||ji(e)||zi(e)||Ni(e)||Oi(e)||Pi(e)}function Li(e,t){return ga(e,{timeUnit:t,wrapTime:!0})}function qi(e,t=!0){var n;const{field:i}=e,o=null===(n=Di(e.timeUnit))||void 0===n?void 0:n.unit,r=o?"time("+wi(o,i)+")":Kr(e,{expr:"datum"});if(_i(e))return r+"==="+Li(e.equal,o);if(zi(e)){const t=e.lt;return"".concat(r,"<").concat(Li(t,o))}if(Ni(e)){const t=e.gt;return"".concat(r,">").concat(Li(t,o))}if(Oi(e)){const t=e.lte;return"".concat(r,"<=").concat(Li(t,o))}if(Pi(e)){const t=e.gte;return"".concat(r,">=").concat(Li(t,o))}if(Mi(e))return"indexof([".concat(function(e,t){return e.map((e=>Li(e,t)))}(e.oneOf,o).join(","),"], ").concat(r,") !== -1");if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Ri(r,e.valid);if(ji(e)){const{range:n}=e,i=Fi(n)?{signal:"".concat(n.signal,"[0]")}:n[0],a=Fi(n)?{signal:"".concat(n.signal,"[1]")}:n[1];if(null!==i&&null!==a&&t)return"inrange("+r+", ["+Li(i,o)+", "+Li(a,o)+"])";const s=[];return null!==i&&s.push("".concat(r," >= ").concat(Li(i,o))),null!==a&&s.push("".concat(r," <= ").concat(Li(a,o))),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(JSON.stringify(e)))}function Ri(e,t=!0){return t?"isValid(".concat(e,") && isFinite(+").concat(e,")"):"!isValid(".concat(e,") || !isFinite(+").concat(e,")")}function Wi(e){var t;return Ti(e)&&e.timeUnit?{...e,timeUnit:null===(t=Di(e.timeUnit))||void 0===t?void 0:t.unit}:e}const Ui="quantitative",Ii="ordinal",Hi="temporal",Gi="nominal",Vi="geojson";const Yi="linear",Ji="log",Xi="pow",Qi="sqrt",$i="symlog",Ki="time",Zi="utc",eo="quantile",to="quantize",no="threshold",io="point",oo="band",ro={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function ao(e,t){const n=ro[e],i=ro[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const so={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function co(e){return so[e]}const uo=["linear","log","pow","sqrt","symlog","time","utc"],lo=A(uo),fo=A(["linear","log","pow","sqrt","symlog"]);const po=A(["quantile","quantize","threshold"]),mo=A(uo.concat(["quantile","quantize","threshold","sequential","identity"])),ho=A(["ordinal","bin-ordinal","point","band"]);function go(e){return e in ho}function vo(e){return e in mo}function yo(e){return e in lo}function bo(e){return e in po}function xo(e){return null==e?void 0:e.selection}const{type:wo,domain:Ao,range:Do,rangeMax:Fo,rangeMin:ko,scheme:Co,...Eo}={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},So=J(Eo);function Bo(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!T(["point","band","identity"],e);case"bins":return!T(["point","band","identity","ordinal"],e);case"round":return yo(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return yo(e)||T(["point","band"],e);case"paddingOuter":case"align":return T(["point","band"],e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"clamp":return yo(e);case"nice":return yo(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return vo(e)&&!T(["log","time","utc","threshold","quantile"],e)}}function _o(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return yt(e)?void 0:'Cannot use the scale property "'.concat(e,'" with non-color channel.');case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function zo(e){return e&&!!e.expr}function Oo(e){const t=J(e||{}),n={};for(const i of t)n[i]=Aa(e[i]);return n}const No={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Po=No.arc,jo=No.area,Mo=No.bar,To=No.image,Lo=No.line,qo=No.point,Ro=No.rect,Wo=No.rule,Uo=No.text,Io=No.tick,Ho=No.trail,Go=No.circle,Vo=No.square,Yo=No.geoshape;function Jo(e){return T(["line","area","trail"],e)}function Xo(e){return T(["rect","bar","image","arc"],e)}const Qo=J(No);function $o(e){return e.type}A(Qo);const Ko=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Zo=J({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),er=J({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1}),tr={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},nr={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},ir={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function or(e){const{channel:t,channelDef:n,markDef:i,scale:o,config:r}=e,a=lr(e);return qr(n)&&!_e(n.aggregate)&&o&&yo(o.get("type"))&&!1===o.get("zero")?rr({fieldDef:n,channel:t,markDef:i,ref:a,config:r}):a}function rr({fieldDef:e,channel:t,markDef:n,ref:i,config:o}){if(Jo(n.type))return i;return null===Ba("invalid",n,o)?i:[ar(e,t),i]}function ar(e,t){return{test:sr(e,!0),..."y"===Pt(t)?{field:{group:"height"}}:{value:0}}}function sr(e,t=!0){return Ri(x(e)?e:Kr(e,{expr:"datum"}),!t)}function cr(e,t,n,i){const o={};if(t&&(o.scale=t),Wr(e)){const{datum:t}=e;ci(t)?o.signal=mi(t):Fi(t)?o.signal=t.signal:zo(t)?o.signal=t.expr:o.value=t}else o.field=Kr(e,n);if(i){const{offset:e,band:t}=i;e&&(o.offset=e),t&&(o.band=t)}return o}function ur({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:o,band:r=.5}){const a=0<r&&r<1?"datum":void 0,s=Kr(t,{expr:a,suffix:o}),c=void 0!==n?Kr(n,{expr:a}):Kr(t,{suffix:"end",expr:a}),u={};if(0===r||1===r){u.scale=e;const t=0===r?s:c;u.field=t}else{const t="".concat(r," * ").concat(s," + ").concat(1-r," * ").concat(c);u.signal='scale("'.concat(e,'", ').concat(t,")")}return i&&(u.offset=i),u}function lr({channel:e,channelDef:t,channel2Def:n,markDef:i,config:o,scaleName:r,scale:a,stack:s,offset:c,defaultRef:u,band:l}){if(t){if(Hr(t)){var f,d;if(Gr(t)){var p;l=null!==(p=l)&&void 0!==p?p:Pr({channel:e,fieldDef:t,fieldDef2:n,markDef:i,stack:s,config:o,isMidPoint:!0});const{bin:a,timeUnit:u,type:f}=t;if(Fn(a)||l&&u&&f===Hi)return s&&s.impute?cr(t,r,{binSuffix:"mid"},{offset:c}):l?ur({scaleName:r,fieldOrDatumDef:t,band:l,offset:c}):cr(t,r,ya(t,e)?{binSuffix:"range"}:{},{offset:c});if(kn(a)){if(qr(n))return ur({scaleName:r,fieldOrDatumDef:t,fieldOrDatumDef2:n,band:l,offset:c});si(oi(e===Me?Le:qe))}}const u=null==a?void 0:a.get("type");return cr(t,r,go(u)?{binSuffix:"range"}:{},{offset:c,band:"band"===u?null!==(f=null!==(d=l)&&void 0!==d?d:t.band)&&void 0!==f?f:.5:void 0})}if(Vr(t)){const n=c?{offset:c}:{};return{...fr(e,t.value),...n}}}return"function"==typeof u&&(u=u()),u?{...u,...c?{offset:c}:{}}:u}function fr(e,t){return T(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:T(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:Fa(t)}function dr(e){return e&&"number"!==e&&"time"!==e}function pr(e,t,n){return"".concat(e,"(").concat(t).concat(n?", ".concat(JSON.stringify(n)):"",")")}function mr({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:o,config:r}){if(dr(n))return gr({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:r});const a=hr(e,i,o);if(ha(e)){var s,c;const n=function(e,t,n,i,o){return!t||n?(n=x(n)?n:i,"".concat(o?"utc":"time","Format(").concat(e,", '").concat(n,"')")):function(e,t,n){if(!e)return;const i=Ai(e),o=n||vi(e);return"".concat(o?"utc":"time","Format(").concat(t,", ").concat(i,")")}(t,e,o)}(a,qr(e)?null===(s=Di(e.timeUnit))||void 0===s?void 0:s.unit:void 0,t,r.timeFormat,Yr(e)&&(null===(c=e.scale)||void 0===c?void 0:c.type)===Zi);return n?{signal:n}:void 0}if(t=br(Rr(e),t,r),qr(e)&&Fn(e.bin)){return{signal:Ar(a,Kr(e,{expr:i,binSuffix:"end"}),t,n,r)}}return t||"quantitative"===Rr(e)?{signal:"".concat(xr(a,t))}:{signal:"isValid(".concat(a,") ? ").concat(a,' : ""+').concat(a)}}function hr(e,t,n){return qr(e)?n?"".concat(Kr(e,{expr:t,suffix:"end"}),"-").concat(Kr(e,{expr:t,suffix:"start"})):Kr(e,{expr:t}):function(e){const{datum:t}=e;return ci(t)?mi(t):"".concat(JSON.stringify(t))}(e)}function gr({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:o,config:r,field:a}){var s;if(a=null!==(s=a)&&void 0!==s?s:hr(e,i,o),qr(e)&&Fn(e.bin)){return{signal:Ar(a,Kr(e,{expr:i,binSuffix:"end"}),t,n,r)}}return{signal:pr(n,a,t)}}function vr(e,t,n,i,o,r){if(!dr(i)){if(ha(e)){var a;return function(e,t,n,i){if(e)return e;if(t)return{signal:Ai(t)};return i?void 0:n.timeFormat}(n,qr(e)?null===(a=Di(e.timeUnit))||void 0===a?void 0:a.unit:void 0,o,r)}return br(t,n,o)}}function yr(e,t,n){return e&&(Fi(e)||"number"===e||"time"===e)?e:ha(t)&&"time"!==n&&"utc"!==n?"time":void 0}function br(e,t,n){return x(t)?t:e===Ui?n.numberFormat:void 0}function xr(e,t){return"format(".concat(e,', "').concat(t||"",'")')}function wr(e,t,n,i){var o;return dr(n)?pr(n,e,t):xr(e,null!==(o=x(t)?t:void 0)&&void 0!==o?o:i.numberFormat)}function Ar(e,t,n,i,o){const r=wr(e,n,i,o),a=wr(t,n,i,o);return"".concat(Ri(e,!1),' ? "null" : ').concat(r,' + "').concat(" – ",'" + ').concat(a)}const Dr="min",Fr={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function kr(e){return e in Fr}function Cr(e){return!!e&&!!e.encoding}function Er(e){return!(!e||"count"!==e.op&&!e.field)}function Sr(e){return!!e&&u(e)}function Br(e){return"row"in e||"column"in e}function _r(e){return!!e&&"header"in e}function zr(e){return"facet"in e}function Or(e){const{field:t,timeUnit:n,bin:i,aggregate:o}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...o?{aggregate:o}:{},field:t}}function Nr(e){return"sort"in e}function Pr({channel:e,fieldDef:t,fieldDef2:n,markDef:i,stack:o,config:r,isMidPoint:a}){if(Hr(t)&&void 0!==t.band)return t.band;if(qr(t)){const{timeUnit:e,bin:o}=t;if(e&&!n)return a?_a("timeUnitBandPosition",i,r):Xo(i.type)?_a("timeUnitBand",i,r):0;if(Fn(o))return Xo(i.type)&&!a?1:.5}return(null==o?void 0:o.fieldChannel)===e&&a?.5:void 0}function jr(e,t,n,i,o,r){return!!(Fn(t.bin)||t.timeUnit&&Gr(t)&&"temporal"===t.type)&&!!Pr({channel:e,fieldDef:t,fieldDef2:n,stack:i,markDef:o,config:r})}function Mr(e){return!!e&&"condition"in e}function Tr(e){const t=e&&e.condition;return!!t&&!u(t)&&qr(t)}function Lr(e){const t=e&&e.condition;return!!t&&!u(t)&&Hr(t)}function qr(e){return!(!e||!e.field&&"count"!==e.aggregate)}function Rr(e){return e&&e.type}function Wr(e){return!!e&&"datum"in e}function Ur(e){return Gr(e)&&ea(e)||Ir(e)}function Ir(e){return Wr(e)&&b(e.datum)}function Hr(e){return qr(e)||Wr(e)}function Gr(e){return!!e&&("field"in e||"count"===e.aggregate)&&"type"in e}function Vr(e){return e&&"value"in e&&"value"in e}function Yr(e){return!!e&&("scale"in e||"sort"in e)}function Jr(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function Xr(e){return!!e&&"legend"in e}function Qr(e){return!!e&&("format"in e||"formatType"in e)}function $r(e){return N(e,["legend","axis","header","scale"])}function Kr(e,t={}){let n=e.field;const i=t.prefix;let o=t.suffix,r="";if(function(e){return"count"===e.aggregate}(e))n=de("count");else{let i;if(!t.nofn)if(function(e){return"op"in e}(e))i=e.op;else{const{bin:u,aggregate:l,timeUnit:f}=e;var a,s;if(Fn(u))i=Dn(u),o=(null!==(a=t.binSuffix)&&void 0!==a?a:"")+(null!==(s=t.suffix)&&void 0!==s?s:"");else if(l)Ee(l)?(r='["'.concat(n,'"]'),n="argmax_".concat(l.argmax)):Ce(l)?(r='["'.concat(n,'"]'),n="argmin_".concat(l.argmin)):i=String(l);else if(f){var c;i=function(e){const{utc:t,...n}=Di(e);return n.unit?(t?"utc":"")+J(n).map((e=>K("".concat("unit"===e?"":"_".concat(e,"_")).concat(n[e])))).join(""):(t?"utc":"")+"timeunit"+J(n).map((e=>K("_".concat(e,"_").concat(n[e])))).join("")}(f),o=(!T(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(c=t.suffix)&&void 0!==c?c:"")}}i&&(n=n?"".concat(i,"_").concat(n):i)}return o&&(n="".concat(n,"_").concat(o)),i&&(n="".concat(i,"_").concat(n)),t.forAs?se(n):t.expr?ie(n,t.expr)+r:re(n)+r}function Zr(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return qr(e)&&!!e.bin;case"temporal":return!1}throw new Error(Hn(e.type))}function ea(e){return!Zr(e)}const ta=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:o}=e;if(Ee(t))return"".concat(o," for argmax(").concat(t.argmax,")");if(Ce(t))return"".concat(o," for argmin(").concat(t.argmin,")");const r=Di(i),a=t||(null==r?void 0:r.unit)||(null==r?void 0:r.maxbins)&&"timeunit"||Fn(n)&&"bin";return a?a.toUpperCase()+"("+o+")":o}(e);default:return function(e,t){const{field:n,bin:i,timeUnit:o,aggregate:r}=e;if("count"===r)return t.countTitle;if(Fn(i))return"".concat(n," (binned)");if(o){var a;const e=null===(a=Di(o))||void 0===a?void 0:a.unit;if(e)return"".concat(n," (").concat(bi(e).join("-"),")")}else if(r)return Ee(r)?"".concat(n," for max ").concat(r.argmax):Ce(r)?"".concat(n," for min ").concat(r.argmin):"".concat(te(r)," of ").concat(n);return n}(e,t)}};let na=ta;function ia(e){na=e}function oa(e,t,{allowDisabling:n,includeDefault:i=!0}){var o;const r=null===(o=ra(e))||void 0===o?void 0:o.title;if(!qr(e))return r;const a=e,s=i?aa(a,t):void 0;return n?ue(r,a.title,s):null!==(c=null!=r?r:a.title)&&void 0!==c?c:s;var c}function ra(e){return Jr(e)&&e.axis?e.axis:Xr(e)&&e.legend?e.legend:_r(e)&&e.header?e.header:void 0}function aa(e,t){return na(e,t)}function sa(e){if(Qr(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{var t;const n=null!==(t=ra(e))&&void 0!==t?t:{},{format:i,formatType:o}=n;return{format:i,formatType:o}}}function ca(e){return qr(e)?e:Tr(e)?e.condition:void 0}function ua(e){return Hr(e)?e:Lr(e)?e.condition:void 0}function la(e,t,n,i={}){if(x(e)||b(e)||y(e)){return si(function(e,t,n){return"Channel ".concat(e," is a ").concat(t,". Converted to {value: ").concat(P(n),"}.")}(t,x(e)?"string":b(e)?"number":"boolean",e)),{value:e}}return Hr(e)?fa(e,t,n,i):Lr(e)?{...e,condition:fa(e.condition,t,n,i)}:e}function fa(e,t,n,i){if(Qr(e)){const{format:o,formatType:r,...a}=e;if(dr(r)&&!n.customFormatTypes)return si(In(t)),fa(a,t,n,i)}else{const o=Jr(e)?"axis":Xr(e)?"legend":_r(e)?"header":null;if(o&&e[o]){const{format:r,formatType:a,...s}=e[o];if(dr(a)&&!n.customFormatTypes)return si(In(t)),fa({...e,[o]:s},t,n,i)}}return qr(e)?da(e,t,i):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=b(n)?"quantitative":x(n)?"nominal":ci(n)?"temporal":void 0,{...e,type:t}}(e)}function da(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:o,bin:r,field:a}=e,s={...e};if(n||!i||Se(i)||Ee(i)||Ce(i)||(si(function(e){return'Invalid aggregation operator "'.concat(e,'".')}(i)),delete s.aggregate),o&&(s.timeUnit=Di(o)),a&&(s.field="".concat(a)),Fn(r)&&(s.bin=pa(r,t)),kn(r)&&!en(t)&&si(function(e){return"Channel ".concat(e,' should not be used with "binned" bin.')}(t)),Gr(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Ui:return"quantitative";case"t":case Hi:return"temporal";case"o":case Ii:return"ordinal";case"n":case Gi:return"nominal";case Vi:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&_e(i)&&(si(function(e,t){return'Invalid field type "'.concat(e,'" for aggregate: "').concat(t,'", using "quantitative" instead.')}(e,i)),s.type="quantitative")}else if(!Nt(t)){const e=function(e,t){var n;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Nr(e)&&u(e.sort))return"ordinal";const{aggregate:i,bin:o,timeUnit:r}=e;if(r)return"temporal";if(o||i&&!Ee(i)&&!Ce(i))return"quantitative";if(Yr(e)&&(null===(n=e.scale)||void 0===n?void 0:n.type))switch(ro[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(Gr(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:"Channel ".concat(t," should not be used with a geojson data.")};switch(t){case Ne:case Pe:case je:return ea(e)?{compatible:!1,warning:Jn(t)}:ma;case Me:case Te:case Je:case Xe:case Qe:case rt:case st:case ct:case ut:case lt:case ft:case Ze:case Ue:case Re:case dt:return ma;case Ge:case Ye:case He:case Ve:return n!==Ui?{compatible:!1,warning:"Channel ".concat(t," should be used with a quantitative field only, not ").concat(e.type," field.")}:ma;case et:case tt:case nt:case it:case Ke:case Ie:case We:case Le:case qe:return"nominal"!==n||e.sort?ma:{compatible:!1,warning:"Channel ".concat(t," should not be used with an unsorted discrete field.")};case ot:return T(["ordinal","nominal"],e.type)?ma:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case $e:return T(["ordinal","nominal","geojson"],e.type)?ma:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case at:return"nominal"!==e.type||"sort"in e?ma:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{};!1===e&&si(n)}if(Nr(s)&&x(s.sort)){const{sort:e}=s;if(kr(e))return{...s,sort:{encoding:e}};const t=e.substr(1);if("-"===e.charAt(0)&&kr(t))return{...s,sort:{encoding:t,order:"descending"}}}if(_r(s)){const{header:e}=s,{orient:t,...n}=e;if(t)return{...s,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}return s}function pa(e,t){return y(e)?{maxbins:Sn(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:Sn(t)}}const ma={compatible:!0};function ha(e){const{formatType:t}=sa(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||qr(n)&&!!n.timeUnit));var n}function ga(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:o}){var r;const a=t&&(null===(r=Di(t))||void 0===r?void 0:r.unit);let s,c=a||"temporal"===n;return zo(e)?s=e.expr:Fi(e)?s=e.signal:ci(e)?(c=!0,s=mi(e)):(x(e)||b(e))&&c&&(s="datetime(".concat(JSON.stringify(e),")"),function(e){return!!hi[e]}(a)&&(b(e)&&e<1e4||x(e)&&isNaN(Date.parse(e)))&&(s=mi({[a]:e}))),s?i&&c?"time(".concat(s,")"):s:o?void 0:JSON.stringify(e)}function va(e,t){const{type:n}=e;return t.map((t=>{const i=ga(t,{timeUnit:qr(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t}))}function ya(e,t){return Fn(e.bin)?vn(t)&&T(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}function ba(e){const{anchor:t,frame:n,offset:i,orient:o,color:r,subtitleColor:a,subtitleFont:s,subtitleFontSize:c,subtitleFontStyle:u,subtitleFontWeight:l,subtitleLineHeight:f,subtitlePadding:d,...p}=e,m={...p,...r?{fill:r}:{}},h={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...o?{orient:o}:{}},g={...a?{subtitleColor:a}:{},...s?{subtitleFont:s}:{},...c?{subtitleFontSize:c}:{},...u?{subtitleFontStyle:u}:{},...l?{subtitleFontWeight:l}:{},...f?{subtitleLineHeight:f}:{},...d?{subtitlePadding:d}:{}};return{titleMarkConfig:m,subtitleMarkConfig:O(m,["align","baseline","dx","dy","limit"]),nonMark:h,subtitle:g}}function xa(e){return x(e)||u(e)&&x(e[0])}function wa(e){const t=u(e.condition)?e.condition.map(Da):Da(e.condition);return{...Aa(e),condition:t}}function Aa(e){if(zo(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Da(e){if(zo(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Fa(e){if(zo(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Fi(e)?e:void 0!==e?{value:e}:void 0}function ka(e){return Fi(e)?e.signal:w(e.value)}function Ca(e){return Fi(e)?e.signal:null==e?null:w(e)}function Ea(e,t,n){for(const i of n){const n=_a(i,t.markDef,t.config);void 0!==n&&(e[i]=Fa(n))}return e}function Sa(e){var t;return[].concat(e.type,null!==(t=e.style)&&void 0!==t?t:[])}function Ba(e,t,n,i={}){const{vgChannel:o,ignoreVgConfig:r}=i;return o&&void 0!==t[o]?t[o]:void 0!==t[e]?t[e]:!r||o&&o!==e?_a(e,t,n,i):void 0}function _a(e,t,n,{vgChannel:i}={}){return ue(i?za(e,t,n.style):void 0,za(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function za(e,t,n){return Oa(e,Sa(t),n)}function Oa(e,t,n){let i;t=h(t);for(const o of t){const t=n[o];t&&void 0!==t[e]&&(i=t[e])}return i}function Na(e,t){return h(e).reduce(((e,n)=>{var i;return e.field.push(Kr(n,t)),e.order.push(null!==(i=n.sort)&&void 0!==i?i:"ascending"),e}),{field:[],order:[]})}function Pa(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(_(t,e))return;n.push(e)})),n}function ja(e,t){return _(e,t)||!t?e:e?[...h(e),...h(t)].join(", "):t}function Ma(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((xa(n)||Fi(n))&&(xa(i)||Fi(i)))return{explicit:e.explicit,value:ja(n,i)};if(xa(n)||Fi(n))return{explicit:e.explicit,value:n};if(xa(i)||Fi(i))return{explicit:e.explicit,value:i};if(!(xa(n)||Fi(n)||xa(i)||Fi(i)))return{explicit:e.explicit,value:Pa(n,i)};throw new Error("It should never reach here")}function Ta(e){return"mark"in e}class La{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!Ta(e)&&($o(t=e.mark)?t.type:t)===this.name;var t}}function qa(e,t){const n=e&&e[t];return!!n&&(u(n)?L(n,(e=>!!e.field)):qr(n)||Tr(n))}function Ra(e){return L(At,(t=>{if(qa(e,t)){const n=e[t];if(u(n))return L(n,(e=>!!e.aggregate));{const e=ca(n);return e&&!!e.aggregate}}return!1}))}function Wa(e,t){const n=[],i=[],o=[],r=[],a={};return Ha(e,((s,c)=>{if(qr(s)){const{field:u,aggregate:l,bin:f,timeUnit:d,...p}=s;if(l||d||f){const e=ra(s),m=e&&e.title;let h=Kr(s,{forAs:!0});const g={...m?[]:{title:oa(s,t,{allowDisabling:!0})},...p,field:h};if(l){let e;if(Ee(l)?(e="argmax",h=Kr({op:"argmax",field:l.argmax},{forAs:!0}),g.field="".concat(h,".").concat(u)):Ce(l)?(e="argmin",h=Kr({op:"argmin",field:l.argmin},{forAs:!0}),g.field="".concat(h,".").concat(u)):"boxplot"!==l&&"errorbar"!==l&&"errorband"!==l&&(e=l),e){const t={op:e,as:h};u&&(t.field=u),r.push(t)}}else if(n.push(h),Gr(s)&&Fn(f)){if(i.push({bin:f,field:u,as:h}),n.push(Kr(s,{binSuffix:"end"})),ya(s,c)&&n.push(Kr(s,{binSuffix:"range"})),en(c)){const e={field:h+"_end"};a[c+"2"]=e}g.bin="binned",Nt(c)||(g.type=Ui)}else if(d){o.push({timeUnit:d,field:u,as:h});const e=Gr(s)&&s.type!==Hi&&"time";e&&(c===rt||c===ut?g.formatType=e:!function(e){return!!Qt[e]}(c)?en(c)&&(g.axis={formatType:e,...g.axis}):g.legend={formatType:e,...g.legend})}a[c]=g}else n.push(u),a[c]=e[c]}else a[c]=e[c]})),{bins:i,timeUnits:o,aggregate:r,groupby:n,encoding:a}}function Ua(e,t,n,i){return J(e).reduce(((o,r)=>{if(!zt(r))return si(function(e){return"".concat(e,"-encoding is dropped as ").concat(e," is not a valid encoding channel.")}(r)),o;const a=e[r];if("angle"!==r||"arc"!==t||e.theta||(si("Arc marks uses theta channel rather than angle, replacing angle with theta."),r=Ue),!function(e,t,n){const i=yn(t,n);if(!i)return!1;if("binned"===i){const n=e[t===Le?Me:Te];return!!(qr(n)&&qr(e[t])&&kn(n.bin))}return!0}(e,r,t))return si(Yn(r,t)),o;if(r===Ke&&"line"===t){const t=ca(e[r]);if(null==t?void 0:t.aggregate)return si("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),o}if(r===Je&&(n?"fill"in e:"stroke"in e))return si(Gn("encoding",{fill:"fill"in e,stroke:"stroke"in e})),o;if(r===st||r===at&&!u(a)&&!Vr(a)||r===ut&&u(a))a&&(o[r]=h(a).reduce(((e,t)=>(qr(t)?e.push(da(t,r)):si(Vn(t,r)),e)),[]));else{if(r===ut&&null===a)o[r]=null;else if(!(qr(a)||Wr(a)||Vr(a)||Mr(a)||Fi(a)))return si(Vn(a,r)),o;o[r]=la(a,r,i)}return o}),{})}function Ia(e,t){const n={};for(const i of J(e)){const o=la(e[i],i,t,{compositeMark:!0});n[i]=o}return n}function Ha(e,t,n){if(e)for(const i of J(e)){const o=e[i];if(u(o))for(const e of o)t.call(n,e,i);else t.call(n,o,i)}}function Ga(e,t){return J(t).reduce(((n,i)=>{switch(i){case Me:case Te:case lt:case dt:case ft:case Le:case qe:case Ue:case Ie:case Re:case We:case He:case Ge:case Ve:case Ye:case rt:case $e:case Ze:case ut:return n;case at:if("line"===e||"trail"===e)return n;case st:case ct:{const e=t[i];if(u(e)||qr(e))for(const t of h(e))t.aggregate||n.push(Kr(t,{}));return n}case Ke:if("trail"===e)return n;case Je:case Xe:case Qe:case et:case tt:case nt:case ot:case it:{const e=ca(t[i]);return e&&!e.aggregate&&n.push(Kr(e,{})),n}}}),[])}function Va(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map((({fieldPrefix:e,titlePrefix:n})=>{const o=i?" of ".concat(Ya(t)):"";return{field:e+t.field,type:t.type,title:Fi(n)?{signal:n+'"'.concat(escape(o),'"')}:n+o}})),...U(function(e){const t=[];for(const n of J(e))if(qa(e,n)){const i=h(e[n]);for(const e of i)qr(e)?t.push(e):Tr(e)&&t.push(e.condition)}return t}(n).map($r),j)]}}function Ya(e){const{title:t,field:n}=e;return ue(t,n)}function Ja(e,t,n,i,o){const{scale:r,axis:a}=n;return({partName:s,mark:c,positionPrefix:u,endPositionPrefix:l,extraEncoding:f={}})=>{const d=Ya(n);return Xa(e,s,o,{mark:c,encoding:{[t]:{field:u+"_"+n.field,type:n.type,...void 0!==d?{title:d}:{},...void 0!==r?{scale:r}:{},...void 0!==a?{axis:a}:{}},...x(l)?{[t+"2"]:{field:l+"_"+n.field}}:{},...i,...f}})}}function Xa(e,t,n,i){const{clip:o,color:r,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[{...i,mark:{...n[t],...o?{clip:o}:{},...r?{color:r}:{},...a?{opacity:a}:{},...$o(i.mark)?i.mark:{type:i.mark},style:"".concat(s,"-").concat(t),...y(e[t])?{}:e[t]}}]:[]}function Qa(e,t,n){const{encoding:i}=e,o="vertical"===t?"y":"x",r=i[o],a=i[o+"2"],s=i[o+"Error"],c=i[o+"Error2"];return{continuousAxisChannelDef:$a(r,n),continuousAxisChannelDef2:$a(a,n),continuousAxisChannelDefError:$a(s,n),continuousAxisChannelDefError2:$a(c,n),continuousAxis:o}}function $a(e,t){if(e&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&si(function(e,t){return"Continuous axis should not have customized aggregation function ".concat(e,"; ").concat(t," already agregates the axis.")}(n,t)),i}return e}function Ka(e,t){const{mark:n,encoding:i}=e,{x:o,y:r}=i;if($o(n)&&n.orient)return n.orient;if(Ur(o)){if(Ur(r)){const e=qr(o)&&o.aggregate,n=qr(r)&&r.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return ha(r)&&!ha(o)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Ur(r))return"vertical";throw new Error("Need a valid continuous axis for ".concat(t,"s"))}const Za="boxplot",es=new La(Za,ns);function ts(e){return b(e)?"tukey":e}function ns(e,{config:t}){var n;e={...e,encoding:Ia(e.encoding,t)};const{mark:i,encoding:o,selection:r,projection:a,...s}=e,c=$o(i)?i:{type:i};r&&si(qn("boxplot"));const f=null!==(n=c.extent)&&void 0!==n?n:t.boxplot.extent,d=Ba("size",c,t),p=ts(f),{bins:m,timeUnits:h,transform:g,continuousAxisChannelDef:v,continuousAxis:y,groupby:b,aggregate:x,encodingWithoutContinuousAxis:w,ticksOrient:A,boxOrient:D,customTooltipWithoutAggregatedField:F}=function(e,t,n){const i=Ka(e,Za),{continuousAxisChannelDef:o,continuousAxis:r}=Qa(e,i,Za),a=o.field,s=ts(t),c=[...is(a),{op:"median",field:a,as:"mid_box_"+a},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],l="min-max"===s||"tukey"===s?[]:[{calculate:'datum["upper_box_'.concat(a,'"] - datum["lower_box_').concat(a,'"]'),as:"iqr_"+a},{calculate:'min(datum["upper_box_'.concat(a,'"] + datum["iqr_').concat(a,'"] * ').concat(t,', datum["max_').concat(a,'"])'),as:"upper_whisker_"+a},{calculate:'max(datum["lower_box_'.concat(a,'"] - datum["iqr_').concat(a,'"] * ').concat(t,', datum["min_').concat(a,'"])'),as:"lower_whisker_"+a}],{[r]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:m}=function(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,o;if(u(t)){for(const e of t)e.aggregate?(i||(i=[]),i.push(e)):(o||(o=[]),o.push(e));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:o=t;return u(o)&&1===o.length&&(o=o[0]),{customTooltipWithoutAggregatedField:o,filteredEncoding:n}}(d),{bins:h,timeUnits:g,aggregate:v,groupby:y,encoding:b}=Wa(m,n),x="vertical"===i?"horizontal":"vertical",w=i,A=[...h,...g,{aggregate:[...v,...c],groupby:y},...l];return{bins:h,timeUnits:g,transform:A,groupby:y,aggregate:v,continuousAxisChannelDef:o,continuousAxis:r,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:p}}(e,f,t),{color:k,size:C,...E}=w,S=e=>Ja(c,y,v,e,t.boxplot),B=S(E),_=S(w),z=S({...E,...C?{size:C}:{}}),O=Va([{fieldPrefix:"min-max"===p?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===p?"lower_whisker_":"min_",titlePrefix:"Min"}],v,w),P={type:"tick",color:"black",opacity:1,orient:A,invalid:null,aria:!1},j="min-max"===p?O:Va([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],v,w),M=[...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:j}),...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:j}),...B({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:j}),...B({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:j})],T=[..."tukey"!==p?M:[],..._({partName:"box",mark:{type:"bar",...d?{size:d}:{},orient:D,invalid:null,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:O}),...z({partName:"median",mark:{type:"tick",invalid:null,...l(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...d?{size:d}:{},orient:A,aria:!1},positionPrefix:"mid_box",extraEncoding:O})];var L;if("min-max"===p)return{...s,transform:(null!==(L=s.transform)&&void 0!==L?L:[]).concat(g),layer:T};const q='datum["lower_box_'.concat(v.field,'"]'),R='datum["upper_box_'.concat(v.field,'"]'),W="(".concat(R," - ").concat(q,")"),U="".concat(q," - ").concat(f," * ").concat(W),I="".concat(R," + ").concat(f," * ").concat(W),H='datum["'.concat(v.field,'"]'),G={joinaggregate:is(v.field),groupby:b},V={transform:[{filter:"(".concat(U," <= ").concat(H,") && (").concat(H," <= ").concat(I,")")},{aggregate:[{op:"min",field:v.field,as:"lower_whisker_"+v.field},{op:"max",field:v.field,as:"upper_whisker_"+v.field},{op:"min",field:"lower_box_"+v.field,as:"lower_box_"+v.field},{op:"max",field:"upper_box_"+v.field,as:"upper_box_"+v.field},...x],groupby:b}],layer:M},{tooltip:J,...X}=E,{scale:Q,axis:$}=v,K=Ya(v),Z=N($,["title"]),ee=Xa(c,"outliers",t.boxplot,{transform:[{filter:"(".concat(H," < ").concat(U,") || (").concat(H," > ").concat(I,")")}],mark:"point",encoding:{[y]:{field:v.field,type:v.type,...void 0!==K?{title:K}:{},...void 0!==Q?{scale:Q}:{},...Y(Z)?{}:{axis:Z}},...X,...k?{color:k}:{},...F?{tooltip:F}:{}}})[0];let te;const ne=[...m,...h,G];return ee?te={transform:ne,layer:[ee,V]}:(te=V,te.transform.unshift(...ne)),{...s,layer:[te,{transform:g,layer:T}]}}function is(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}const os="errorbar",rs=new La(os,as);function as(e,{config:t}){e={...e,encoding:Ia(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:r,ticksOrient:a,markDef:s,outerSpec:c,tooltipEncoding:u}=cs(e,os,t);delete r.size;const l=Ja(s,o,i,r,t.errorbar),f=s.thickness,d=s.size,p={type:"tick",orient:a,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==d?{size:d}:{}},m=[...l({partName:"ticks",mark:p,positionPrefix:"lower",extraEncoding:u}),...l({partName:"ticks",mark:p,positionPrefix:"upper",extraEncoding:u}),...l({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...c,transform:n,...m.length>1?{layer:m}:{...m[0]}}}function ss(e,t){const{encoding:n}=e;if(function(e){return(Hr(e.x)||Hr(e.y))&&!Hr(e.x2)&&!Hr(e.y2)&&!Hr(e.xError)&&!Hr(e.xError2)&&!Hr(e.yError)&&!Hr(e.yError2)}(n))return{orient:Ka(e,t),inputType:"raw"};const i=function(e){return Hr(e.x2)||Hr(e.y2)}(n),o=function(e){return Hr(e.xError)||Hr(e.xError2)||Hr(e.yError)||Hr(e.yError2)}(n),r=n.x,a=n.y;if(i){if(o)throw new Error("".concat(t," cannot be both type aggregated-upper-lower and aggregated-error"));const e=n.x2,i=n.y2;if(Hr(e)&&Hr(i))throw new Error("".concat(t," cannot have both x2 and y2"));if(Hr(e)){if(Ur(r))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(t))}if(Hr(i)){if(Ur(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in ".concat(t))}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,o=n.yError,s=n.yError2;if(Hr(i)&&!Hr(e))throw new Error("".concat(t," cannot have xError2 without xError"));if(Hr(s)&&!Hr(o))throw new Error("".concat(t," cannot have yError2 without yError"));if(Hr(e)&&Hr(o))throw new Error("".concat(t," cannot have both xError and yError with both are quantiative"));if(Hr(e)){if(Ur(r))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Hr(o)){if(Ur(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function cs(e,t,n){var i;const{mark:o,encoding:r,selection:a,projection:s,...c}=e,u=$o(o)?o:{type:o};a&&si(qn(t));const{orient:l,inputType:f}=ss(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:p,continuousAxisChannelDefError:m,continuousAxisChannelDefError2:h,continuousAxis:g}=Qa(e,l,t),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,i,o,r,a,s){let c=[],u=[];const l=t.field;let f,d=!1;if("raw"===r){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&si(function(e,t,n){return"".concat(e," is not usually used with ").concat(t," for ").concat(n,".")}(t,n,a)),"stderr"===n||"stdev"===n)c=[{op:n,field:l,as:"extent_"+l},{op:t,field:l,as:"center_"+l}],u=[{calculate:'datum["center_'.concat(l,'"] + datum["extent_').concat(l,'"]'),as:"upper_"+l},{calculate:'datum["center_'.concat(l,'"] - datum["extent_').concat(l,'"]'),as:"lower_"+l}],f=[{fieldPrefix:"center_",titlePrefix:te(t)},{fieldPrefix:"upper_",titlePrefix:us(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:us(t,n,"-")}],d=!0;else{let e,t,i;"ci"===n?(e="mean",t="ci0",i="ci1"):(e="median",t="q1",i="q3"),c=[{op:t,field:l,as:"lower_"+l},{op:i,field:l,as:"upper_"+l},{op:e,field:l,as:"center_"+l}],f=[{fieldPrefix:"upper_",titlePrefix:oa({field:l,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:oa({field:l,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:oa({field:l,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&si((p=e.center,m=e.extent,"".concat(m?"extent ":"").concat(m&&p?"and ":"").concat(p?"center ":"").concat(m&&p?"are ":"is ","not needed when data are aggregated."))),"aggregated-upper-lower"===r?(f=[],u=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_"+l},{calculate:'datum["'.concat(l,'"]'),as:"lower_"+l}]):"aggregated-error"===r&&(f=[{fieldPrefix:"",titlePrefix:l}],u=[{calculate:'datum["'.concat(l,'"] + datum["').concat(i.field,'"]'),as:"upper_"+l}],o?u.push({calculate:'datum["'.concat(l,'"] + datum["').concat(o.field,'"]'),as:"lower_"+l}):u.push({calculate:'datum["'.concat(l,'"] - datum["').concat(i.field,'"]'),as:"lower_"+l}));for(const e of u)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:ae(ae(e.calculate,'datum["',""),'"]',"")})}var p,m;return{postAggregateCalculates:u,errorBarSpecificAggregate:c,tooltipSummary:f,tooltipTitleWithFieldName:d}}(u,d,p,m,h,f,t,n),{[g]:w,["x"===g?"x2":"y2"]:A,["x"===g?"xError":"yError"]:D,["x"===g?"xError2":"yError2"]:F,...k}=r,{bins:C,timeUnits:E,aggregate:S,groupby:B,encoding:_}=Wa(k,n),z=[...S,...v],O="raw"!==f?[]:B,N=Va(b,d,_,x);return{transform:[...null!==(i=c.transform)&&void 0!==i?i:[],...C,...E,...0===z.length?[]:[{aggregate:z,groupby:O}],...y],groupby:O,continuousAxisChannelDef:d,continuousAxis:g,encodingWithoutContinuousAxis:_,ticksOrient:"vertical"===l?"horizontal":"vertical",markDef:u,outerSpec:c,tooltipEncoding:N}}function us(e,t,n){return te(e)+" "+n+" "+t}const ls="errorband",fs=new La(ls,ds);function ds(e,{config:t}){e={...e,encoding:Ia(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:r,markDef:a,outerSpec:s,tooltipEncoding:c}=cs(e,ls,t),u=a,l=Ja(u,o,i,r,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},p={type:f?"line":"rule"};const m={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...m,ariaRoleDescription:"errorband"},p={...p,...m,aria:!1}):u.interpolate?si(ii("interpolate")):u.tension&&si(ii("tension")),{...s,transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"lower",extraEncoding:c}),...l({partName:"borders",mark:p,positionPrefix:"upper",extraEncoding:c})]}}const ps={};function ms(e,t,n){const i=new La(e,t);ps[e]={normalizer:i,parts:n}}ms(Za,ns,["box","median","outliers","rule","ticks"]),ms(os,as,["ticks","rule"]),ms(ls,ds,["band","borders"]);const hs=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],gs={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},vs={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},ys=J(gs),bs=J(vs),xs=J({header:1,headerRow:1,headerColumn:1,headerFacet:1}),ws=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"];function As(e){const t=[];for(const n of e||[]){const{expr:e,bind:i,...o}=n;if(i&&e){const n={...o,bind:i,init:e};t.push(n)}else{const n={...o,...e?{update:e}:{},...i?{bind:i}:{}};t.push(n)}}return t}const Ds="_vgsid_",Fs={single:{on:"click",fields:[Ds],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:[Ds],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function ks(e){return!(!e||"legend"!==e&&!e.legend)}function Cs(e){return ks(e)&&l(e)}function Es(e){return"concat"in e}function Ss(e){return"vconcat"in e}function Bs(e){return"hconcat"in e}const _s=["background","padding"];function zs(e,t){const n={};for(const t of _s)e&&void 0!==e[t]&&(n[t]=Aa(e[t]));return t&&(n.params=e.params),n}function Os(e){return l(e)&&void 0!==e.step}function Ns(e){return e.view||e.width||e.height}const Ps=J({align:1,bounds:1,center:1,columns:1,spacing:1});function js(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e["width"===t?"continuousWidth":"continuousHeight"]}function Ms(e,t){const n=Ts(e,t);return Os(n)?n.step:Ls}function Ts(e,t){var n;return ue(null!==(n=e[t])&&void 0!==n?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const Ls=20,qs={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Ls},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:nr,circle:{},geoshape:{},image:{},line:{},point:{},rect:ir,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Fs,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},Rs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Ws={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Us={blue:Rs[0],orange:Rs[1],red:Rs[2],teal:Rs[3],green:Rs[4],yellow:Rs[5],purple:Rs[6],pink:Rs[7],brown:Rs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Is(e){const t=J(e||{}),n={};for(const i of t){const t=e[i];n[i]=ve(t)?wa(t):Aa(t)}return n}const Hs=[...er,...De,...xs,"background","padding","legend","lineBreak","scale","style","title","view"];function Gs(e={}){const{color:t,font:n,fontSize:i,...o}=e,r=d({},qs,n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:l(e)?{...Us,...e}:Us}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},i?function(e){return{signals:[{name:"fontSize",value:l(e)?{...Ws,...e}:Ws}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},o||{}),a=N(r,Hs);for(const e of["background","lineBreak","padding"])r[e]&&(a[e]=Aa(r[e]));for(const e of er)r[e]&&(a[e]=Oo(r[e]));for(const e of De)r[e]&&(a[e]=Is(r[e]));for(const e of xs)r[e]&&(a[e]=Oo(r[e]));return r.legend&&(a.legend=Oo(r.legend)),r.scale&&(a.scale=Oo(r.scale)),r.style&&(a.style=function(e){const t=J(e),n={};for(const i of t)n[i]=Is(e[i]);return n}(r.style)),r.title&&(a.title=Oo(r.title)),r.view&&(a.view=Oo(r.view)),a}const Vs=["view",...Qo],Ys=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Js={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};function Xs(e){e=z(e);for(const t of Ys)delete e[t];if(e.axis)for(const t in e.axis)ve(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of hs)delete e.legend[t];if(e.mark){for(const t of Zo)delete e.mark[t];e.mark.tooltip&&l(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(As(e.params)),delete e.params);for(const t of Vs){for(const n of Zo)delete e[t][n];const n=Js[t];if(n)for(const i of n)delete e[t][i];Qs(e,t)}for(const t of J(ps))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=ba(e.title);Y(t)||(e.style["group-title"]={...e.style["group-title"],...t});Y(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n});Y(i)?delete e.title:e.title=i}(e);for(const t in e)l(e[t])&&Y(e[t])&&delete e[t];return Y(e)?void 0:e}function Qs(e,t,n,i){var o;"view"===t&&(n="cell");const r={...i?e[t][i]:e[t],...e.style[null!==(o=n)&&void 0!==o?o:t]};var a;Y(r)||(e.style[null!==(a=n)&&void 0!==a?a:t]=r);i||delete e[t]}function $s(e){return"layer"in e}const Ks={zero:1,center:1,normalize:1};const Zs=new Set([Po,Mo,jo,Wo,qo,Go,Vo,Lo,Uo,Io]),ec=new Set([Mo,jo,Po]);function tc(e,t){const n="x"===t?"y":"radius",i=e[t],o=e[n];if(qr(i)&&qr(o))if("quantitative"===Rr(i)&&"quantitative"===Rr(o)){if(i.stack)return t;if(o.stack)return n;const e=qr(i)&&!!i.aggregate;if(e!==(qr(o)&&!!o.aggregate))return e?t:n;{var r,a;const e=null===(r=i.scale)||void 0===r?void 0:r.type,s=null===(a=o.scale)||void 0===a?void 0:a.type;if(e&&"linear"!==e)return n;if(s&&"linear"!==s)return t}}else{if("quantitative"===Rr(i))return t;if("quantitative"===Rr(o))return n}else{if("quantitative"===Rr(i))return t;if("quantitative"===Rr(o))return n}}function nc(e,t,n={}){const i=$o(e)?e.type:e;if(!Zs.has(i))return null;const o=tc(t,"x")||tc(t,"theta");if(!o)return null;const r=t[o],a=qr(r)?Kr(r,{}):void 0;let s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(o),c=t[s],u=qr(c)?Kr(c,{}):void 0;u===a&&(u=void 0,c=void 0,s=void 0);const l=$t.reduce(((e,n)=>{if("tooltip"!==n&&qa(t,n)){const i=t[n];for(const t of h(i)){const i=ca(t);if(i.aggregate)continue;const o=Kr(i,{});o&&o===u||e.push({channel:n,fieldDef:i})}}return e}),[]);let f;if(void 0!==r.stack?f=y(r.stack)?r.stack?"zero":null:r.stack:l.length>0&&ec.has(i)&&(f="zero"),!f||!(f in Ks))return null;var d,p;if(Ra(t)&&0===l.length)return null;if(r.scale&&r.scale.type&&r.scale.type!==Yi){if(n.disallowNonLinearStack)return null;si(function(e){return"Cannot stack non-linear scale (".concat(e,").")}(r.scale.type))}return Hr(t[Mt(o)])?(void 0!==r.stack&&si('Cannot stack "'.concat(d=o,'" if there is already "').concat(d,'2".')),null):(qr(r)&&r.aggregate&&!T(ze,r.aggregate)&&si((p=r.aggregate,'Stacking is applied even though the aggregate function is non-summative ("'.concat(p,'").'))),{groupbyChannel:c?s:void 0,groupbyField:u,fieldChannel:o,impute:null!==r.impute&&Jo(i),stackBy:l,offset:f})}function ic(e){const{point:t,line:n,...i}=e;return J(i).length>1?i:i.type}function oc(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:N(e[t],["point","line"])});return e}function rc(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?l(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?l(t.point)?t.point:{}:void 0}function ac(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class sc{constructor(){Bn(this,"name","path-overlay")}hasMatchingType(e,t){if(Ta(e)){const{mark:n,encoding:i}=e,o=$o(n)?n:{type:n};switch(o.type){case"line":case"rule":case"trail":return!!rc(o,t[o.type],i);case"area":return!!rc(o,t[o.type],i)||!!ac(o,t[o.type])}}return!1}run(e,t,n){const{config:i}=t,{selection:o,projection:r,mark:a,encoding:s,...c}=e,u=Ia(s,i),l=$o(a)?a:{type:a},f=rc(l,i[l.type],u),d="area"===l.type&&ac(l,i[l.type]),p=[{...o?{selection:o}:{},mark:ic({..."area"===l.type&&void 0===l.opacity&&void 0===l.fillOpacity?{opacity:.7}:{},...l}),encoding:N(u,["shape"])}],m=nc(l,u);let h=u;if(m){const{fieldChannel:e,offset:t}=m;h={...u,[e]:{...u[e],...t?{stack:t}:{}}}}return d&&p.push({...r?{projection:r}:{},mark:{type:"line",...O(l,["clip","interpolate","tension","tooltip"]),...d},encoding:h}),f&&p.push({...r?{projection:r}:{},mark:{type:"point",opacity:1,filled:!0,...O(l,["clip","tooltip"]),...f},encoding:h}),n({...c,layer:p},{...t,config:oc(i)})}}class cc{constructor(){Bn(this,"name","RangeStep")}hasMatchingType(e){if(Ta(e)&&e.encoding)for(const n of Zt){const i=e.encoding[n];var t;if(i&&Hr(i))if(null==i||null===(t=i.scale)||void 0===t?void 0:t.rangeStep)return!0}return!1}run(e){const t={};let n={...e.encoding};for(const e of Zt){const o=Tt(e),r=n[e];var i;if(r&&Hr(r))if(null==r||null===(i=r.scale)||void 0===i?void 0:i.rangeStep){const{scale:i,...a}=r,{rangeStep:s,...c}=i;t[o]={step:i.rangeStep},si('Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.'),n={...n,[e]:{...a,...Y(c)?{}:{scale:c}}}}}return{...t,...e,encoding:n}}}function uc(e,t){return t?Br(e)?hc(e,t):dc(e,t):e}function lc(e,t){return t?hc(e,t):e}function fc(e,t,n){const i=t[e];return function(e){return e&&!x(e)&&"repeat"in e}(i)?i.repeat in n?{...t,[e]:n[i.repeat]}:void si(function(e){return'Unknown repeated value "'.concat(e,'".')}(i.repeat)):t}function dc(e,t){if(void 0!==(e=fc("field",e,t))){if(null===e)return null;if(Nr(e)&&Er(e.sort)){const n=fc("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function pc(e,t){if(qr(e))return dc(e,t);{const n=fc("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function mc(e,t){if(!Hr(e)){if(Lr(e)){const n=pc(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=pc(e,t);if(n)return n;if(Mr(e))return{condition:e.condition}}}function hc(e,t){const n={};for(const i in e)if(v(e,i)){const o=e[i];if(u(o))n[i]=o.map((e=>mc(e,t))).filter((e=>e));else{const e=mc(o,t);void 0!==e&&(n[i]=e)}}return n}class gc{constructor(){Bn(this,"name","RuleForRangedLine")}hasMatchingType(e){if(Ta(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of Ot){const n=t[Pt(e)];if(t[e]&&(qr(n)&&!kn(n.bin)||Wr(n)))return!0}}return!1}run(e,t,n){const{encoding:i}=e;var o,r;return si((o=!!i.x2,r=!!i.y2,"Line mark is for continuous lines and thus cannot be used with ".concat(o&&r?"x2 and y2":o?"x2":"y2",". We will use the rule mark (line segments) instead."))),n({...e,mark:"rule"},t)}}function vc({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const o=new Set([...J(e),...J(t)]);for(const r of o){const o=t[r],a=e[r];if(Hr(o)){const e={...a,...o};i[r]=e}else Lr(o)?i[r]={...o,condition:{...a,...o.condition}}:o||null===o?i[r]=o:(n||Vr(a)||Fi(a)||Hr(a)||u(a))&&(i[r]=a)}}else i=t;return!i||Y(i)?void 0:i}function yc(e){const{parentProjection:t,projection:n}=e;return t&&n&&si(function(e){const{parentProjection:t,projection:n}=e;return"Layer's shared projection ".concat(P(t)," is overridden by a child projection ").concat(P(n),".")}({parentProjection:t,projection:n})),null!=n?n:t}function bc(e,t){void 0===t&&(t=Gs(e.config));const n=function(e,t={}){return xc.map(e,{config:t})}(e,t),{width:i,height:o}=e,r=function(e,t,n){let{width:i,height:o}=t;const r=Ta(e)||$s(e),a={};r?"container"==i&&"container"==o?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==o&&(a.type="fit-y",a.contains="padding"):("container"==i&&(si(Nn("width")),i=void 0),"container"==o&&(si(Nn("height")),o=void 0));const s={type:"pad",...a,...n?wc(n.autosize):{},...wc(e.autosize)};"fit"!==s.type||r||(si(On),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&si(Pn("width"));"container"==o&&"fit"!=s.type&&"fit-y"!=s.type&&si(Pn("height"));if(_(s,{type:"pad"}))return;return s}(n,{width:i,height:o,autosize:e.autosize},t);return{...n,...r?{autosize:r}:{}}}const xc=new class extends class{map(e,t){return zr(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):Bs(e)?this.mapHConcat(e,t):Ss(e)?this.mapVConcat(e,t):Es(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if($s(e))return this.mapLayer(e,t);if(Ta(e))return this.mapUnit(e,t);throw new Error(zn(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...i}=e;return{...i,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}{constructor(...e){super(...e),Bn(this,"nonFacetUnitNormalizers",[es,rs,fs,new sc,new gc,new cc])}map(e,t){if(Ta(e)){const n=qa(e.encoding,Ne),i=qa(e.encoding,Pe),o=qa(e.encoding,je);if(n||i||o)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,o=lc(e.encoding,t.repeater),r={...e,...o?{encoding:o}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(r,t);const a=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(r,t.config))return e.run(r,t,a);return r}mapRepeat(e,t){return function(e){return!u(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:i,...o}=e,{row:r,column:a,layer:s}=n,{repeater:c={},repeaterPrefix:u=""}=t;return r||a?this.mapRepeat({...e,repeat:{...r?{row:r}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},t):{...o,layer:s.map((e=>{const n={...c,layer:e},o=(i.name||"")+u+"child__layer_".concat(K(e)),r=this.mapLayerOrUnit(i,{...t,repeater:n,repeaterPrefix:o});return r.name=o,r}))}}mapNonLayerRepeat(e,t){var n;const{repeat:i,spec:o,data:r,...a}=e;!u(i)&&e.columns&&(e=N(e,["columns"]),si(Wn("repeat")));const s=[],{repeater:c={},repeaterPrefix:l=""}=t,f=!u(i)&&i.row||[c?c.row:null],d=!u(i)&&i.column||[c?c.column:null],p=u(i)&&i||[c?c.repeat:null];for(const e of p)for(const n of f)for(const r of d){const a={repeat:e,row:n,column:r,layer:c.layer},f=(o.name||"")+l+"child__"+(u(i)?"".concat(K(e)):(i.row?"row_".concat(K(n)):"")+(i.column?"column_".concat(K(r)):"")),d=this.map(o,{...t,repeater:a,repeaterPrefix:f});d.name=f,s.push(N(d,["data"]))}const m=u(i)?e.columns:i.column?i.column.length:1;return{data:null!==(n=o.data)&&void 0!==n?n:r,align:"all",...a,columns:m,concat:s}}mapFacet(e,t){const{facet:n}=e;return Br(n)&&e.columns&&(e=N(e,["columns"]),si(Wn("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:o,parentProjection:r,config:a}=t,s=yc({parentProjection:r,projection:i}),c=vc({parentEncoding:o,encoding:lc(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,t){const{row:n,column:i,facet:o,...r}=e.encoding,{mark:a,width:s,projection:c,height:u,view:l,selection:f,encoding:d,...p}=e,{facetMapping:m,layout:h}=this.getFacetMappingAndLayout({row:n,column:i,facet:o},t),g=lc(r,t.repeater);return this.mapFacet({...p,...h,facet:m,spec:{...s?{width:s}:{},...u?{height:u}:{},...l?{view:l}:{},...c?{projection:c}:{},mark:a,encoding:g,...f?{selection:f}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:i,facet:o}=e;if(n||i){o&&si((a=[...n?[Ne]:[],...i?[Pe]:[]],"Facet encoding dropped as ".concat(a.join(" and ")," ").concat(a.length>1?"are":"is"," also specified.")));const t={},s={};for(const n of[Ne,Pe]){const i=e[n];if(i){const{align:e,center:o,spacing:a,columns:c,...u}=i;t[n]=u;for(const e of["align","center","spacing"]){var r;if(void 0!==i[e])s[e]=null!==(r=s[e])&&void 0!==r?r:{},s[e][n]=i[e]}}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:i,columns:r,...a}=o;return{facetMapping:uc(a,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...i?{spacing:i}:{},...r?{columns:r}:{}}}}var a}mapLayer(e,{parentEncoding:t,parentProjection:n,...i}){const{encoding:o,projection:r,...a}=e,s={...i,parentEncoding:vc({parentEncoding:t,encoding:o,layer:!0}),parentProjection:yc({parentProjection:n,projection:r})};return super.mapLayer(a,s)}};function wc(e){return x(e)?{type:e}:null!=e?e:{}}class Ac{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Ac(z(this.explicit),z(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return ue(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of J(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Dc(e){return{explicit:!0,value:e}}function Fc(e){return{explicit:!1,value:e}}function kc(e){return(t,n,i,o)=>{const r=e(t.value,n.value);return r>0?t:r<0?n:Cc(t,n,i,o)}}function Cc(e,t,n,i){return e.explicit&&t.explicit&&si(function(e,t,n,i){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(P(n)," and ").concat(P(i),"). Using ").concat(P(n),".")}(n,i,e.value,t.value)),e}function Ec(e,t,n,i,o=Cc){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:_(e.value,t.value)?e:o(e,t,n,i)}class Sc extends Ac{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function Bc(e){return"url"in e}function _c(e){return"values"in e}function zc(e){return"name"in e&&!Bc(e)&&!_c(e)&&!Oc(e)}function Oc(e){return e&&(Nc(e)||Pc(e)||jc(e))}function Nc(e){return"sequence"in e}function Pc(e){return"sphere"in e}function jc(e){return"graticule"in e}let Mc;function Tc(e){return"filter"in e}function Lc(e){return"lookup"in e}function qc(e){return"pivot"in e}function Rc(e){return"density"in e}function Wc(e){return"quantile"in e}function Uc(e){return"regression"in e}function Ic(e){return"loess"in e}function Hc(e){return"sample"in e}function Gc(e){return"window"in e}function Vc(e){return"joinaggregate"in e}function Yc(e){return"flatten"in e}function Jc(e){return"calculate"in e}function Xc(e){return"bin"in e}function Qc(e){return"impute"in e}function $c(e){return"timeUnit"in e}function Kc(e){return"aggregate"in e}function Zc(e){return"stack"in e}function eu(e){return"fold"in e}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(Mc||(Mc={}));const tu="[",nu="]",iu=/[[\]{}]/,ou={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let ru,au;function su(e,t,n){return ru=t||"view",au=n||ou,uu(e.trim()).map(lu)}function cu(e,t,n,i,o){const r=e.length;let a,s=0;for(;t<r;++t){if(a=e[t],!s&&a===n)return t;o&&o.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function uu(e){const t=[],n=e.length;let i=0,o=0;for(;o<n;)o=cu(e,o,",","[{","]}"),t.push(e.substring(i,o).trim()),i=++o;if(0===t.length)throw"Empty event selector: "+e;return t}function lu(e){return"["===e[0]?function(e){const t=e.length;let n,i=1;if(i=cu(e,i,nu,tu,nu),i===t)throw"Empty between selector: "+e;if(n=uu(e.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+e;n=n.map(lu);const o=lu(e.slice(1).trim());if(o.between)return{between:n,stream:o};o.between=n;return o}(e):function(e){const t={source:ru},n=[];let i,o,r=[0,0],a=0,s=0,c=e.length,u=0;if("}"===e[c-1]){if(u=e.lastIndexOf("{"),!(u>=0))throw"Unmatched right brace: "+e;try{r=function(e){const t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!=n)throw e;return n}))}(e.substring(u+1,c-1))}catch(t){throw"Invalid throttle specification: "+e}c=(e=e.slice(0,u).trim()).length,u=0}if(!c)throw e;"@"===e[0]&&(a=++u);i=cu(e,u,":"),i<c&&(n.push(e.substring(s,i).trim()),s=u=++i);if(u=cu(e,u,tu),u===c)n.push(e.substring(s,c).trim());else if(n.push(e.substring(s,u).trim()),o=[],s=++u,s===c)throw"Unmatched left bracket: "+e;for(;u<c;){if(u=cu(e,u,nu),u===c)throw"Unmatched left bracket: "+e;if(o.push(e.substring(s,u).trim()),u<c-1&&e[++u]!==tu)throw"Expected left bracket: "+e;s=++u}if(!(c=n.length)||iu.test(n[c-1]))throw"Invalid event selector: "+e;c>1?(t.type=n[1],a?t.markname=n[0].slice(1):!function(e){return au[e]}(n[0])?t.source=n[0]:t.marktype=n[0]):t.type=n[0];"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=o&&(t.filter=o);r[0]&&(t.throttle=r[0]);r[1]&&(t.debounce=r[1]);return t}(e)}function fu(e,t,n,i){const o=Mr(t)&&t.condition,r=i(t);if(o){return{[n]:[...h(o).map((t=>{const n=i(t);return{test:function(e){return e.selection}(t)?td(e,t.selection):id(e,t.test),...n}})),...void 0!==r?[r]:[]]}}return void 0!==r?{[n]:r}:{}}function du(e,t="text"){const n=e.encoding[t];return fu(e,n,t,(t=>pu(t,e.config)))}function pu(e,t,n="datum"){if(e){if(Vr(e))return Fa(e.value);if(Hr(e)){const{format:i,formatType:o}=sa(e);return mr({fieldOrDatumDef:e,format:i,formatType:o,expr:n,config:t})}}}function mu(e,t={}){const{encoding:n,markDef:i,config:o,stack:r}=e,a=n.tooltip;if(u(a))return{tooltip:gu({tooltip:a},r,o,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return fu(e,a,"tooltip",(e=>{const a=pu(e,o,s);if(a)return a;if(null===e)return;let c=Ba("tooltip",i,o);return!0===c&&(c={content:"encoding"}),x(c)?{value:c}:l(c)?Fi(c)?c:"encoding"===c.content?gu(n,r,o,t):{signal:s}:void 0}))}}function hu(e,t,n,{reactiveGeom:i}={}){const o={},r=i?"datum.datum":"datum",a=[];function s(i,s){var c;const u=Pt(s),l=Gr(i)?i:{...i,type:e[u].type},f=h(l.title||aa(l,n)).join(", ");let d;if(en(s)){const i="x"===s?"x2":"y2",a=ca(e[i]);if(kn(l.bin)&&a){const e=Kr(l,{expr:r}),t=Kr(a,{expr:r}),{format:s,formatType:c}=sa(l);d=Ar(e,t,s,c,n),o[i]=!0}else if(t&&t.fieldChannel===s&&"normalize"===t.offset){const{format:e,formatType:t}=sa(l);d=mr({fieldOrDatumDef:l,format:e,formatType:t,expr:r,config:n,normalizeStack:!0}).signal}}d=null!==(c=d)&&void 0!==c?c:pu(l,n,r).signal,a.push({channel:s,key:f,value:d})}Ha(e,((e,t)=>{qr(e)?s(e,t):Tr(e)&&s(e.condition,t)}));const c={};for(const{channel:e,key:t,value:n}of a)o[e]||c[t]||(c[t]=n);return c}function gu(e,t,n,{reactiveGeom:i}={}){const o=hu(e,t,n,{reactiveGeom:i}),r=Q(o).map((([e,t])=>'"'.concat(e,'": ').concat(t)));return r.length>0?{signal:"{".concat(r.join(", "),"}")}:void 0}function vu(e){const{markDef:t,config:n}=e,i=Ba("aria",t,n);return!1===i?{}:{...i?{aria:i}:{},...yu(e),...bu(e)}}function yu(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const o=Ba("ariaRoleDescription",n,i);return null!=o?{ariaRoleDescription:{value:o}}:t in Si?{}:{ariaRoleDescription:{value:t}}}function bu(e){const{encoding:t,markDef:n,config:i,stack:o}=e,r=t.description;if(r)return fu(e,r,"description",(t=>pu(t,e.config)));const a=Ba("description",n,i);if(null!=a)return{description:Fa(a)};if(!1===i.aria)return{};const s=hu(t,o,i);return Y(s)?void 0:{description:{signal:Q(s).map((([e,t],n)=>'"'.concat(n>0?"; ":"").concat(e,': " + (').concat(t,")"))).join(" + ")}}}function xu(e,t,n={}){const{markDef:i,encoding:o,config:r}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:c}=n;var u;void 0===s&&(c=null!==(u=c)&&void 0!==u?u:Ba(e,i,r,{vgChannel:a,ignoreVgConfig:!0}),void 0!==c&&(s=Fa(c)));const l=o[e];return fu(t,l,null!=a?a:e,(n=>lr({channel:e,channelDef:n,markDef:i,config:r,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function wu(e,t={filled:void 0}){var n,i,o,r;const{markDef:a,encoding:s,config:c}=e,{type:u}=a,l=null!==(n=t.filled)&&void 0!==n?n:Ba("filled",a,c),f=T(["bar","point","circle","square","geoshape"],u)?"transparent":void 0,d=null!==(i=null!==(o=Ba(!0===l?"color":void 0,a,c,{vgChannel:"fill"}))&&void 0!==o?o:c.mark[!0===l&&"color"])&&void 0!==i?i:f,p=null!==(r=Ba(!1===l?"color":void 0,a,c,{vgChannel:"stroke"}))&&void 0!==r?r:c.mark[!1===l&&"color"],m=l?"fill":"stroke",h={...d?{fill:Fa(d)}:{},...p?{stroke:Fa(p)}:{}};return a.color&&(l?a.fill:a.stroke)&&si(Gn("property",{fill:"fill"in a,stroke:"stroke"in a})),{...h,...xu("color",e,{vgChannel:m,defaultValue:l?d:p}),...xu("fill",e,{defaultValue:s.fill?d:void 0}),...xu("stroke",e,{defaultValue:s.stroke?p:void 0})}}function Au(e){const{encoding:t,mark:n}=e,i=t.order;return!Jo(n)&&Vr(i)?fu(e,i,"zindex",(e=>Fa(e.value))):{}}function Du(e,t){const n=t[function(e){switch(e){case Me:return"xOffset";case Te:return"yOffset";case Le:return"x2Offset";case qe:return"y2Offset";case Ue:return"thetaOffset";case Re:return"radiusOffset";case Ie:return"theta2Offset";case We:return"radius2Offset"}}(e)];if(n)return n}function Fu(e,t,{defaultPos:n,vgChannel:i,isMidPoint:o}){const{encoding:r,markDef:a,config:s,stack:c}=t,u=r[e],l=r[Mt(e)],f=t.scaleName(e),d=t.getScaleComponent(e),p=Du(e,a),m=ku({model:t,defaultPos:n,channel:e,scaleName:f,scale:d}),h=!u&&en(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:i,scaleName:o,stack:r,offset:a,markDef:s,config:c}=e;if(Hr(n)&&r&&t===r.fieldChannel){if(qr(n)){const e=Pr({channel:t,fieldDef:n,isMidPoint:i,markDef:s,stack:r,config:c});if(void 0!==e)return ur({scaleName:o,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:a})}return cr(n,o,{suffix:"end"},{offset:a})}return or(e)}({channel:e,channelDef:u,channel2Def:l,markDef:a,config:s,isMidPoint:o,scaleName:f,scale:d,stack:c,offset:p,defaultRef:m});return h?{[i||e]:h}:void 0}function ku({model:e,defaultPos:t,channel:n,scaleName:i,scale:o}){const{markDef:r,config:a}=e;return()=>{const s=Pt(n),c=jt(n),u=Ba(n,r,a,{vgChannel:c});if(void 0!==u)return fr(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const e=o.get("type");if(T([Ji,Ki,Zi],e));else if(o.domainDefinitelyIncludesZero())return{scale:i,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:"min(".concat(e.width.signal,",").concat(e.height.signal,")/2")};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Tt(n)],mult:.5}}}}const Cu={left:"x",center:"xc",right:"x2"},Eu={top:"y",middle:"yc",bottom:"y2"};function Su(e,t,n,i="middle"){if("radius"===e||"theta"===e)return jt(e);const o="x"===e?"align":"baseline",r=Ba(o,t,n);let a;return Fi(r)?(si(function(e){return"The ".concat(e," for range marks cannot be an expression")}(o)),a=void 0):a=r,"x"===e?Cu[a||("top"===i?"left":"center")]:Eu[a||i]}function Bu(e,t,{defaultPos:n,defaultPos2:i,range:o}){return o?_u(e,t,{defaultPos:n,defaultPos2:i}):Fu(e,t,{defaultPos:n})}function _u(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:o,config:r}=t,a=Mt(e),s=Tt(e),c=function(e,t,n){const{encoding:i,mark:o,markDef:r,stack:a,config:s}=e,c=Pt(n),u=Tt(n),l=jt(n),f=i[c],d=e.scaleName(c),p=e.getScaleComponent(c),m=Du(n in i||n in r?n:c,e.markDef);if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude))return{[l]:{field:e.getName(n)}};const h=function({channel:e,channelDef:t,channel2Def:n,markDef:i,config:o,scaleName:r,scale:a,stack:s,offset:c,defaultRef:u}){if(Hr(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return cr(t,r,{suffix:"start"},{offset:c});return or({channel:e,channelDef:n,scaleName:r,scale:a,stack:s,markDef:i,config:o,offset:c,defaultRef:u})}({channel:n,channelDef:f,channel2Def:i[n],markDef:r,config:s,scaleName:d,scale:p,stack:a,offset:m,defaultRef:void 0});if(void 0!==h)return{[l]:h};return zu(n,r)||zu(n,{[n]:za(n,r,s.style),[u]:za(u,r,s.style)})||zu(n,s[o])||zu(n,s.mark)||{[l]:ku({model:e,defaultPos:t,channel:n,scaleName:d,scale:p})()}}(t,i,a);return{...Fu(e,t,{defaultPos:n,vgChannel:c[s]?Su(e,o,r):jt(e)}),...c}}function zu(e,t){const n=Tt(e),i=jt(e);return void 0!==t[i]?{[i]:fr(e,t[i])}:void 0!==t[e]?{[i]:fr(e,t[e])}:t[n]?{[n]:fr(e,t[n])}:void 0}function Ou(e,t,n){var i,o;const{config:r,encoding:a,markDef:s,stack:c}=e,l=Mt(t),f=Tt(t),d=a[t],p=a[l],m=e.getScaleComponent(t),h=m?m.get("type"):void 0,g=e.scaleName(t),v=s.orient,y=null!==(i=null!==(o=a[f])&&void 0!==o?o:a.size)&&void 0!==i?i:Ba("size",s,r,{vgChannel:f}),b="bar"===n&&("x"===t?"vertical"===v:"horizontal"===v);if(qr(d)&&(Fn(d.bin)||kn(d.bin)||d.timeUnit&&!p)&&!y&&!go(h)){var x,w;const n=Pr({channel:t,fieldDef:d,stack:c,markDef:s,config:r}),i=null===(x=e.component.axes[t])||void 0===x?void 0:x[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:i,scaleName:o,markDef:r,spacing:a=0,axisTranslate:s,reverse:c,config:u}){const l=Mt(n),f=jt(n),d=jt(l),p=Du(n,r);if(Fn(e.bin)||e.timeUnit)return{[d]:ju({channel:n,fieldDef:e,scaleName:o,markDef:r,band:(1-i)/2,offset:Pu(l,a,c,s,p),config:u}),[f]:ju({channel:n,fieldDef:e,scaleName:o,markDef:r,band:1-(1-i)/2,offset:Pu(n,a,c,s,p),config:u})};if(kn(e.bin)){const i=cr(e,o,{},{offset:Pu(l,a,c,s,p)});if(qr(t))return{[d]:i,[f]:cr(t,o,{},{offset:Pu(n,a,c,s,p)})};if(Cn(e.bin)&&e.bin.step)return{[d]:i,[f]:{signal:'scale("'.concat(o,'", ').concat(Kr(e,{expr:"datum"})," + ").concat(e.bin.step,")"),offset:Pu(n,a,c,s,p)}}}return void si(oi(l))}({fieldDef:d,fieldDef2:p,channel:t,markDef:s,scaleName:g,band:n,axisTranslate:null!==(w=null==i?void 0:i.get("translate"))&&void 0!==w?w:.5,spacing:en(t)?Ba("binSpacing",s,r):void 0,reverse:m.get("reverse"),config:r})}return(Hr(d)&&go(h)||b)&&!p?function(e,t,n,i){var o;const{markDef:r,encoding:a,config:s,stack:c}=i,l=r.orient,f=i.scaleName(n),d=i.getScaleComponent(n),p=Tt(n),m=Mt(n),h="horizontal"===l&&"y"===n||"vertical"===l&&"x"===n,g=Ba(h?"size":p,r,s,{vgChannel:p});let v;(a.size||void 0!==g)&&(h?v=xu("size",i,{vgChannel:p,defaultValue:g}):si(function(e){return'Cannot apply size to non-oriented mark "'.concat(e,'".')}(r.type)));const y=null!==(o=Hr(t)?Pr({channel:n,fieldDef:t,markDef:r,stack:c,config:s}):void 0)&&void 0!==o?o:1;v=v||{[p]:Nu(e,p,f,d,s,y)};const b="band"!==(null==d?void 0:d.get("type"))||!("band"in v[p]),x=Su(n,r,s,b?"middle":"top"),w=Du(n,r),A=or({channel:n,channelDef:t,markDef:r,config:s,scaleName:f,scale:d,stack:c,offset:w,defaultRef:ku({model:i,defaultPos:"mid",channel:n,scaleName:f,scale:d}),band:b?.5:(1-y)/2});if(p)return{[x]:A,...v};{const e=jt(m),t=v[p],n=w?{...t,offset:w}:t;return{[x]:A,[e]:u(A)?[A[0],{...A[1],offset:n}]:{...A,offset:n}}}}(n,d,t,e):_u(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Nu(e,t,n,i,o,r){if(i){const t=i.get("type");if("point"===t||"band"===t){if(void 0!==o[e].discreteBandSize)return{value:o[e].discreteBandSize};if(t===io){const e=i.get("range");return ki(e)&&b(e.step)?{value:e.step-2}:{value:Ls-2}}return{scale:n,band:r}}return{value:o[e].continuousBandSize}}const a=Ms(o.view,t),s=ue(o[e].discreteBandSize,a-2);return void 0!==s?{value:s}:void 0}function Pu(e,t,n,i,o){if(mt(e))return 0;const r="x"===e||"y2"===e?-t/2:t/2;if(Fi(n)||Fi(o)||Fi(i)){const e=Ca(n),t=Ca(o),a=Ca(i);return{signal:(a?"".concat(a," + "):"")+(e?"(".concat(e," ? -1 : 1) * "):"")+(t?"(".concat(t," + ").concat(r,")"):r)}}return o=o||0,i+(n?-o-r:+o+r)}function ju({channel:e,fieldDef:t,scaleName:n,markDef:i,band:o,offset:r,config:a}){return rr({fieldDef:t,channel:e,markDef:i,ref:ur({scaleName:n,fieldOrDatumDef:t,band:o,offset:r}),config:a})}const Mu=new Set(["aria"]);function Tu(e,t){const{fill:n,stroke:i}="include"===t.color?wu(e):{};return{...qu(e.markDef,t),...Lu(e,"fill",n),...Lu(e,"stroke",i),...xu("opacity",e),...xu("fillOpacity",e),...xu("strokeOpacity",e),...xu("strokeWidth",e),...xu("strokeDash",e),...Au(e),...mu(e),...du(e,"href"),...vu(e)}}function Lu(e,t,n){const{config:i,mark:o,markDef:r}=e;if("hide"===Ba("invalid",r,i)&&n&&!Jo(o)){const i=function(e,{invalid:t=!1,channels:n}){const i=n.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const o=i.get("type"),r=e.vgField(n,{expr:"datum"});r&&vo(o)&&(t[r]=!0)}return t}),{}),o=J(i);if(o.length>0){const e=t?"||":"&&";return o.map((e=>sr(e,t))).join(" ".concat(e," "))}return}(e,{invalid:!0,channels:gn});if(i)return{[t]:[{test:i,value:null},...h(n)]}}return n?{[t]:n}:{}}function qu(e,t){return Ei.reduce(((n,i)=>(Mu.has(i)||void 0===e[i]||"ignore"===t[i]||(n[i]=Fa(e[i])),n)),{})}function Ru(e){const{config:t,markDef:n}=e;if(Ba("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const i=n.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const o=i.get("type"),r=e.vgField(n,{expr:"datum"});r&&vo(o)&&(t[r]=!0)}return t}),{}),o=J(i);if(o.length>0){const e=t?"||":"&&";return o.map((e=>sr(e,t))).join(" ".concat(e," "))}return}(e,{channels:Zt});if(t)return{defined:{signal:t}}}return{}}function Wu(e,t){if(void 0!==t)return{[e]:Fa(t)}}const Uu="voronoi",Iu={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Uu)},marks:(e,t,n)=>{const{x:i,y:o}=t.project.hasChannel,r=e.mark;if(Jo(r))return si('The "nearest" transform is not supported for '.concat(r," marks.")),n;const a={name:e.getName(Uu),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...mu(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!o?"datum.datum.x || 0":"0"},y:{expr:o||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,c=!1;return n.forEach(((t,n)=>{var i;const o=null!==(i=t.name)&&void 0!==i?i:"";o===e.component.mark[0].name?s=n:o.indexOf(Uu)>=0&&(c=!0)})),c||n.splice(s+1,0,a),n}};class Hu{constructor(e,t){this.debugName=t,Bn(this,"_children",[]),Bn(this,"_parent",null),Bn(this,"_hash",void 0),e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?si("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class Gu extends Hu{clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,Bn(this,"_source",void 0),Bn(this,"_name",void 0),this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output ".concat(fe())),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class Vu extends Hu{clone(){return new Vu(null,z(this.formula))}constructor(e,t){super(e),this.formula=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{const{field:o,timeUnit:r}=n,a=Em(t)?t.encoding[Mt(i)]:void 0,s=Em(t)&&jr(i,n,a,t.stack,t.markDef,t.config);if(r){const t=Kr(n,{forAs:!0});e[j({as:t,field:o,timeUnit:r})]={as:t,field:o,timeUnit:r,...s?{band:!0}:{}}}return e}),{});return Y(n)?null:new Vu(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...i}={...t},o={...i,timeUnit:Di(n)};return new Vu(e,{[j(o)]:o})}merge(e){this.formula={...this.formula};for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,i]of Q(this.formula))e.has(i.as)||(t[n]=i);this.formula=t}producedFields(){return new Set(X(this.formula).map((e=>e.as)))}dependentFields(){return new Set(X(this.formula).map((e=>e.field)))}hash(){return"TimeUnit ".concat(j(this.formula))}assemble(){const e=[];for(const t of X(this.formula)){const{field:n,as:i,timeUnit:o}=t,{unit:r,utc:a,...s}=Di(o);e.push({field:re(n),type:"timeunit",...r?{units:bi(r)}:{},...a?{timezone:"utc"}:{},...s,as:[i,"".concat(i,"_end")]})}return e}}const Yu="_tuple_fields";class Ju{constructor(...e){Bn(this,"hasChannel",void 0),Bn(this,"hasField",void 0),Bn(this,"timeUnit",void 0),Bn(this,"items",void 0),this.items=e,this.hasChannel={},this.hasField={}}}const Xu={has:e=>"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!ks(e.bind),parse:(e,t,n,i)=>{i.on||delete t.events,i.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const i=t.name,o=t.project,r=t.bind,a=t.init&&t.init[0],s=Iu.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return o.items.forEach(((e,o)=>{const c=K("".concat(i,"_").concat(e.field));var u,l;n.filter((e=>e.name===c)).length||n.unshift({name:c,...a?{init:pl(a[o])}:{value:null},on:t.events?[{events:t.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(s,"[").concat(w(e.field),"] : null")}]:[],bind:null!==(u=null!==(l=r[e.field])&&void 0!==l?l:r[e.channel])&&void 0!==u?u:r})})),n},signals:(e,t,n)=>{const i=t.name,o=t.project,r=n.filter((e=>e.name===i+kl))[0],a=i+Yu,s=o.items.map((e=>K("".concat(i,"_").concat(e.field)))),c=s.map((e=>"".concat(e," !== null"))).join(" && ");return s.length&&(r.update="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null")),delete r.value,delete r.on,n}},Qu="_toggle",$u={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Qu,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+kl,i=t.name+Qu;return"".concat(i," ? null : ").concat(n,", ")+("global"===t.resolve?"".concat(i," ? null : true, "):"".concat(i," ? null : {unit: ").concat(_l(e),"}, "))+"".concat(i," ? ").concat(n," : null")}},Ku={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=x(n.clear)?su(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(Xu.has(t))for(const e of t.project.items){const i=n.findIndex((n=>n.name===K("".concat(t.name,"_").concat(e.field))));-1!==i&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));if(i(t,"[0, 0]"),-1===t){i(n.findIndex((t=>t.name===e.signals.data)),"null")}}else{let e=n.findIndex((e=>e.name===t.name+kl));i(e,"null"),$u.has(t)&&(e=n.findIndex((e=>e.name===t.name+Qu)),i(e,"false"))}return n}},Zu={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const o=i.channel;if(!vn(o))continue;const r=e.getScaleComponent(o),a=r?r.get("type"):void 0;if(!r||!vo(a)){si("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const s={selection:t.name,field:i.field};r.set("selectionExtent",s,!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||tl(e)||0===i.length)return n;const o=n.filter((e=>e.name===t.name))[0];let r=o.update;if(r.indexOf(El)>=0)o.update="{".concat(i.map((e=>"".concat(w(e.field),": ").concat(e.signals.data))).join(", "),"}");else{for(const e of i){const t="".concat(w(e.field),": ").concat(e.signals.data);r.indexOf(t)<0&&(r="".concat(r.substring(0,r.length-1),", ").concat(t,"}"))}o.update=r}return n.concat(i.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!tl(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}};function el(e,t){const n=w(e.scaleName(t));return"domain(".concat(n,")")}function tl(e){var t;return e.parent&&_m(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:tl(e.parent.parent))}const nl={has:e=>{const t="global"===e.resolve&&e.bind&&ks(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==Ds;return t&&!n&&si("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,i)=>{if(i.on||delete t.events,i.clear||delete t.clear,i.on||i.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events){var o;n.filter=h(null!==(o=n.filter)&&void 0!==o?o:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}}const r=Cs(t.bind)?t.bind.legend:"click",a=x(r)?su(r,"view"):h(r);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const i=t.name,o=Cs(t.bind)&&t.bind.legend,r=e=>t=>{const n=z(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a="".concat(K(e.field),"_legend"),s="".concat(i,"_").concat(a);if(0===n.filter((e=>e.name===s)).length){const e=o.merge.map(r("".concat(a,"_symbols"))).concat(o.merge.map(r("".concat(a,"_labels")))).concat(o.merge.map(r("".concat(a,"_entries"))));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:o.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,o=t.project,r=n.find((e=>e.name===i+kl)),a=i+Yu,s=o.items.filter((e=>e.hasLegend)).map((e=>K("".concat(i,"_").concat(K(e.field),"_legend")))),c=s.map((e=>"".concat(e," !== null"))).join(" && "),u="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null");t.events&&s.length>0?r.on.push({events:s.map((e=>({signal:e}))),update:u}):s.length>0&&(r.update=u,delete r.value,delete r.on);const l=n.find((e=>e.name===i+Qu)),f=Cs(t.bind)&&t.bind.legend;return l&&(t.events?l.on.push({...l.on[0],events:f}):l.on[0].events=f),n}};const il="_translate_anchor",ol="_translate_delta",rl={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,o=Zu.has(t),r=i+il,{x:a,y:s}=t.project.hasChannel;let c=su(t.translate,"scope");return o||(c=c.map((e=>(e.between[0].markname=i+vl,e)))),n.push({name:r,value:{},on:[{events:c.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(o?el(e,Me):"slice(".concat(a.signals.visual,")")):"")+(void 0!==s?", extent_y: "+(o?el(e,Te):"slice(".concat(s.signals.visual,")")):"")+"}"}]},{name:i+ol,value:{},on:[{events:c,update:"{x: ".concat(r,".x - x(unit), y: ").concat(r,".y - y(unit)}")}]}),void 0!==a&&al(e,t,a,"width",n),void 0!==s&&al(e,t,s,"height",n),n}};function al(e,t,n,i,o){var r;const a=t.name,s=a+il,c=a+ol,u=n.channel,l=Zu.has(t),f=o.filter((e=>e.name===n.signals[l?"data":"visual"]))[0],d=e.getSizeSignalRef(i).signal,p=e.getScaleComponent(u),m=p.get("type"),h=l&&u===Me?"-":"",g="".concat(s,".extent_").concat(u),v="".concat(h).concat(c,".").concat(u," / ")+(l?"".concat(d):"span(".concat(g,")")),y="".concat(l?"log"===m?"panLog":"pow"===m?"panPow":"panLinear":"panLinear","(").concat(g,", ").concat(v)+(l&&"pow"===m?", ".concat(null!==(r=p.get("exponent"))&&void 0!==r?r:1):"")+")";f.on.push({events:{signal:c},update:l?y:"clampRange(".concat(y,", 0, ").concat(d,")")})}const sl="_zoom_anchor",cl="_zoom_delta",ul={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,o=Zu.has(t),r=i+cl,{x:a,y:s}=t.project.hasChannel,c=w(e.scaleName(Me)),u=w(e.scaleName(Te));let l=su(t.zoom,"scope");return o||(l=l.map((e=>(e.markname=i+vl,e)))),n.push({name:i+sl,on:[{events:l,update:o?"{"+[c?"x: invert(".concat(c,", x(unit))"):"",u?"y: invert(".concat(u,", y(unit))"):""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:r,on:[{events:l,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&ll(e,t,a,"width",n),void 0!==s&&ll(e,t,s,"height",n),n}};function ll(e,t,n,i,o){var r;const a=t.name,s=n.channel,c=Zu.has(t),u=o.filter((e=>e.name===n.signals[c?"data":"visual"]))[0],l=e.getSizeSignalRef(i).signal,f=e.getScaleComponent(s),d=f.get("type"),p=c?el(e,s):u.name,m=a+cl,h="".concat(a).concat(sl,".").concat(s),g="".concat(c?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear","(").concat(p,", ").concat(h,", ").concat(m)+(c&&"pow"===d?", ".concat(null!==(r=f.get("exponent"))&&void 0!==r?r:1):"")+")";u.on.push({events:{signal:m},update:c?g:"clampRange(".concat(g,", 0, ").concat(l,")")})}const fl=[{has:()=>!0,parse:(e,t,n)=>{var i;const o=t.name,r=null!==(i=t.project)&&void 0!==i?i:t.project=new Ju,a={},s={},c=new Set,u=(e,t)=>{const n="visual"===t?e.channel:e.field;let i=K("".concat(o,"_").concat(n));for(let e=1;c.has(i);e++)i=K("".concat(o,"_").concat(n,"_").concat(e));return c.add(i),{[t]:i}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of h(n.init))for(const i of J(e))_t[i]?(n.encodings||(n.encodings=[])).push(i):"interval"===n.type?(si('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(i);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(l=n.fields)&&void 0!==l?l:[]){var l;const t={type:"E",field:e};t.signals={...u(t,"data")},r.items.push(t),r.hasField[e]=t}for(const i of null!==(f=n.encodings)&&void 0!==f?f:[]){var f;const n=e.fieldDef(i);if(n){let o=n.field;if(n.aggregate){si(Ln(i,n.aggregate));continue}if(!o){si(Tn(i));continue}if(n.timeUnit){o=e.vgField(i);const t={timeUnit:n.timeUnit,as:o,field:n.field};s[j(t)]=t}if(!a[o]){let s="E";if("interval"===t.type){vo(e.getScaleComponent(i).get("type"))&&(s="R")}else n.bin&&(s="R-RE");const c={field:o,channel:i,type:s};c.signals={...u(c,"data"),...u(c,"visual")},r.items.push(a[o]=c),r.hasField[o]=r.hasChannel[i]=a[o]}}else si(Tn(i))}if(n.init){const e=e=>r.items.map((t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]));if("interval"===n.type)t.init=e(n.init);else{const i=h(n.init);t.init=i.map(e)}}Y(s)||(r.timeUnit=new Vu(null,s))},signals:(e,t,n)=>{const i=t.name+Yu;return n.filter((e=>e.name===i)).length>0?n:n.concat({name:i,value:t.project.items.map((e=>{const{signals:t,hasLegend:n,...i}=e;return i.field=re(i.field),i}))})}},$u,Zu,nl,rl,ul,Xu,Iu,Ku];function dl(e,t){for(const n of fl)n.has(e)&&t(n)}function pl(e,t=!0,n=s){if(u(e)){const i=e.map((e=>pl(e,t,n)));return t?"[".concat(i.join(", "),"]"):i}return ci(e)?n(t?mi(e):function(e){const t=pi(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function ml(e,t){if(e.component.selection&&J(e.component.selection).length){const n=w(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:su("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(n,").datum")}]})}return gl(t)}function hl(e,t){return Bl(e,((n,i)=>{t=i.marks?i.marks(e,n,t):t,dl(n,(i=>{i.marks&&(t=i.marks(e,n,t))}))})),t}function gl(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}const vl="_brush",yl="_scale_trigger",bl={signals:(e,t)=>{const n=t.name,i=n+Yu,o=Zu.has(t),r=[],a=[],s=[];if(t.translate&&!o){const e="!event.item || event.item.mark.name !== ".concat(w(n+vl));xl(t,((t,n)=>{var i;const o=h(null!==(i=n.between[0].filter)&&void 0!==i?i:n.between[0].filter=[]);return o.indexOf(e)<0&&o.push(e),t}))}t.project.items.forEach(((n,i)=>{const o=n.channel;if(o!==Me&&o!==Te)return void si("Interval selections only support x and y encoding channels.");const c=t.init?t.init[i]:null,u=function(e,t,n,i){const o=n.channel,r=n.signals.visual,a=n.signals.data,s=Zu.has(t),c=w(e.scaleName(o)),u=e.getScaleComponent(o),l=u?u.get("type"):void 0,f=e=>"scale(".concat(c,", ").concat(e,")"),d=e.getSizeSignalRef(o===Me?"width":"height").signal,p="".concat(o,"(unit)"),m=xl(t,((e,t)=>[...e,{events:t.between[0],update:"[".concat(p,", ").concat(p,"]")},{events:t,update:"[".concat(r,"[0], clamp(").concat(p,", 0, ").concat(d,")]")}]));return m.push({events:{signal:t.name+yl},update:vo(l)?"[".concat(f("".concat(a,"[0]")),", ").concat(f("".concat(a,"[1]")),"]"):"[0, 0]"}),s?[{name:a,on:[]}]:[{name:r,...i?{init:pl(i,!0,f)}:{value:[]},on:m},{name:a,...i?{init:pl(i)}:{},on:[{events:{signal:r},update:"".concat(r,"[0] === ").concat(r,"[1] ? null : invert(").concat(c,", ").concat(r,")")}]}]}(e,t,n,c),l=n.signals.data,f=n.signals.visual,d=w(e.scaleName(o)),p=vo(e.getScaleComponent(o).get("type"))?"+":"";r.push(...u),a.push(l),s.push({scaleName:e.scaleName(o),expr:"(!isArray(".concat(l,") || ")+"(".concat(p,"invert(").concat(d,", ").concat(f,")[0] === ").concat(p).concat(l,"[0] && ")+"".concat(p,"invert(").concat(d,", ").concat(f,")[1] === ").concat(p).concat(l,"[1]))")})})),o||r.push({name:n+yl,value:{},on:[{events:s.map((e=>({scale:e.scaleName}))),update:s.map((e=>e.expr)).join(" && ")+" ? ".concat(n+yl," : {}")}]});const c=t.init,u="unit: ".concat(_l(e),", fields: ").concat(i,", values");return r.concat({name:n+kl,...c?{init:"{".concat(u,": ").concat(pl(c),"}")}:{},on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+" ? {".concat(u,": [").concat(a,"]} : null")}]})},modifyExpr:(e,t)=>t.name+kl+", "+("global"===t.resolve?"true":"{unit: ".concat(_l(e),"}")),marks:(e,t,n)=>{const i=t.name,{x:o,y:r}=t.project.hasChannel,a=o&&o.signals.visual,s=r&&r.signals.visual,c="data(".concat(w(t.name+Fl),")");if(Zu.has(t))return n;const u={x:void 0!==o?{signal:"".concat(a,"[0]")}:{value:0},y:void 0!==r?{signal:"".concat(s,"[0]")}:{value:0},x2:void 0!==o?{signal:"".concat(a,"[1]")}:{field:{group:"width"}},y2:void 0!==r?{signal:"".concat(s,"[1]")}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of J(u))u[t]=[{test:"".concat(c,".length && ").concat(c,"[0].unit === ").concat(_l(e)),...u[t]},{value:0}];const{fill:l,fillOpacity:f,cursor:d,...p}=t.mark,m=J(p).reduce(((e,t)=>(e[t]=[{test:[void 0!==o&&"".concat(a,"[0] !== ").concat(a,"[1]"),void 0!==r&&"".concat(s,"[0] !== ").concat(s,"[1]")].filter((e=>e)).join(" && "),value:p[t]},{value:null}],e)),{});return[{name:i+vl+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:l},fillOpacity:{value:f}},update:u}},...n,{name:i+vl,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...m}}}]}};function xl(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(si("".concat(n," is not an ordered event stream for interval selections.")),e)),[])}function wl(e,t){const n=t.name,i=n+Yu,o=t.project,r="(item().isVoronoi ? datum.datum : datum)",a=o.items.map((t=>{const n=e.fieldDef(t.channel);return n&&n.bin?"[".concat(r,"[").concat(w(e.vgField(t.channel,{})),"], ")+"".concat(r,"[").concat(w(e.vgField(t.channel,{binSuffix:"end"})),"]]"):"".concat(r,"[").concat(w(t.field),"]")})).join(", "),s="unit: ".concat(_l(e),", fields: ").concat(i,", values"),c=t.events;return[{name:n+kl,on:c?[{events:c,update:"datum && item().mark.marktype !== 'group' ? {".concat(s,": [").concat(a,"]} : null"),force:!0}]:[]}]}const Al={signals:wl,modifyExpr:(e,t)=>t.name+kl+", "+("global"===t.resolve?"null":"{unit: ".concat(_l(e),"}"))},Dl={signals:wl,modifyExpr:(e,t)=>t.name+kl+", "+("global"===t.resolve?"true":"{unit: ".concat(_l(e),"}"))},Fl="_store",kl="_tuple",Cl="_modify",El="vlSelectionResolve",Sl={single:Dl,multi:Al,interval:bl};function Bl(e,t){const n=e.component.selection;if(n)for(const e of X(n)){if(!0===t(e,Sl[e.type]))break}}function _l(e,{escape:t}={escape:!0}){let n=t?w(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!Sm(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of xt)e[t]&&(n+=" + '__facet_".concat(t,"_' + (facet[").concat(w(i.vgField(t)),"])"))}return n}function zl(e){let t=!1;return Bl(e,(e=>{t=t||e.project.items.some((e=>e.field===Ds))})),t}const Ol="RawCode",Nl="Literal",Pl="Property",jl="Identifier",Ml="ArrayExpression",Tl="BinaryExpression",Ll="CallExpression",ql="ConditionalExpression",Rl="LogicalExpression",Wl="MemberExpression",Ul="ObjectExpression",Il="UnaryExpression";function Hl(e){this.type=e}var Gl,Vl,Yl,Jl,Xl;Hl.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case Ml:return e.elements;case Tl:case Rl:return[e.left,e.right];case Ll:return[e.callee].concat(e.arguments);case ql:return[e.test,e.consequent,e.alternate];case Wl:return[e.object,e.property];case Ul:return e.properties;case Pl:return[e.key,e.value];case Il:return[e.argument];case jl:case Nl:case Ol:default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};(Gl={})[1]="Boolean",Gl[2]="<end>",Gl[3]="Identifier",Gl[4]="Keyword",Gl[5]="Null",Gl[6]="Numeric",Gl[7]="Punctuator",Gl[8]="String",Gl[9]="RegularExpression";var Ql="Identifier",$l="Unexpected token %0",Kl="Invalid regular expression",Zl="Invalid regular expression: missing /",ef="Octal literals are not allowed in strict mode.",tf="ILLEGAL",nf="Disabled.",of=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),rf=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function af(e,t){if(!e)throw new Error("ASSERT: "+t)}function sf(e){return e>=48&&e<=57}function cf(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function uf(e){return"01234567".indexOf(e)>=0}function lf(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function ff(e){return 10===e||13===e||8232===e||8233===e}function df(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&of.test(String.fromCharCode(e))}function pf(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&rf.test(String.fromCharCode(e))}const mf={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function hf(){for(;Yl<Jl;){const e=Vl.charCodeAt(Yl);if(!lf(e)&&!ff(e))break;++Yl}}function gf(e){var t,n,i,o=0;for(n="u"===e?4:2,t=0;t<n;++t)Yl<Jl&&cf(Vl[Yl])?(i=Vl[Yl++],o=16*o+"0123456789abcdef".indexOf(i.toLowerCase())):Of({},$l,tf);return String.fromCharCode(o)}function vf(){var e,t,n,i;for(t=0,"}"===(e=Vl[Yl])&&Of({},$l,tf);Yl<Jl&&cf(e=Vl[Yl++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Of({},$l,tf),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function yf(){var e,t;for(e=Vl.charCodeAt(Yl++),t=String.fromCharCode(e),92===e&&(117!==Vl.charCodeAt(Yl)&&Of({},$l,tf),++Yl,(e=gf("u"))&&"\\"!==e&&df(e.charCodeAt(0))||Of({},$l,tf),t=e);Yl<Jl&&pf(e=Vl.charCodeAt(Yl));)++Yl,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Vl.charCodeAt(Yl)&&Of({},$l,tf),++Yl,(e=gf("u"))&&"\\"!==e&&pf(e.charCodeAt(0))||Of({},$l,tf),t+=e);return t}function bf(){var e,t;return e=Yl,{type:1===(t=92===Vl.charCodeAt(Yl)?yf():function(){var e,t;for(e=Yl++;Yl<Jl;){if(92===(t=Vl.charCodeAt(Yl)))return Yl=e,yf();if(!pf(t))break;++Yl}return Vl.slice(e,Yl)}()).length?3:mf.hasOwnProperty(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,value:t,start:e,end:Yl}}function xf(){var e,t,n,i,o=Yl,r=Vl.charCodeAt(Yl),a=Vl[Yl];switch(r){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Yl,{type:7,value:String.fromCharCode(r),start:o,end:Yl};default:if(61===(e=Vl.charCodeAt(Yl+1)))switch(r){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Yl+=2,{type:7,value:String.fromCharCode(r)+String.fromCharCode(e),start:o,end:Yl};case 33:case 61:return Yl+=2,61===Vl.charCodeAt(Yl)&&++Yl,{type:7,value:Vl.slice(o,Yl),start:o,end:Yl}}}return">>>="===(i=Vl.substr(Yl,4))?{type:7,value:i,start:o,end:Yl+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:o,end:Yl+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:o,end:Yl+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:o,end:++Yl}:void Of({},$l,tf)}function wf(){var e,t,n;if(af(sf((n=Vl[Yl]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=Yl,e="","."!==n){if(e=Vl[Yl++],n=Vl[Yl],"0"===e){if("x"===n||"X"===n)return++Yl,function(e){let t="";for(;Yl<Jl&&cf(Vl[Yl]);)t+=Vl[Yl++];return 0===t.length&&Of({},$l,tf),df(Vl.charCodeAt(Yl))&&Of({},$l,tf),{type:6,value:parseInt("0x"+t,16),start:e,end:Yl}}(t);if(uf(n))return function(e){let t="0"+Vl[Yl++];for(;Yl<Jl&&uf(Vl[Yl]);)t+=Vl[Yl++];return(df(Vl.charCodeAt(Yl))||sf(Vl.charCodeAt(Yl)))&&Of({},$l,tf),{type:6,value:parseInt(t,8),octal:!0,start:e,end:Yl}}(t);n&&sf(n.charCodeAt(0))&&Of({},$l,tf)}for(;sf(Vl.charCodeAt(Yl));)e+=Vl[Yl++];n=Vl[Yl]}if("."===n){for(e+=Vl[Yl++];sf(Vl.charCodeAt(Yl));)e+=Vl[Yl++];n=Vl[Yl]}if("e"===n||"E"===n)if(e+=Vl[Yl++],"+"!==(n=Vl[Yl])&&"-"!==n||(e+=Vl[Yl++]),sf(Vl.charCodeAt(Yl)))for(;sf(Vl.charCodeAt(Yl));)e+=Vl[Yl++];else Of({},$l,tf);return df(Vl.charCodeAt(Yl))&&Of({},$l,tf),{type:6,value:parseFloat(e),start:t,end:Yl}}function Af(){var e,t,n,i;return Xl=null,hf(),e=Yl,t=function(){var e,t,n,i;for(af("/"===(e=Vl[Yl]),"Regular expression literal must start with a slash"),t=Vl[Yl++],n=!1,i=!1;Yl<Jl;)if(t+=e=Vl[Yl++],"\\"===e)ff((e=Vl[Yl++]).charCodeAt(0))&&Of({},Zl),t+=e;else if(ff(e.charCodeAt(0)))Of({},Zl);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||Of({},Zl),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";Yl<Jl&&pf((e=Vl[Yl]).charCodeAt(0));)++Yl,"\\"===e&&Yl<Jl?Of({},$l,tf):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Of({},Kl,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";Of({},Kl)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){Of({},Kl)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:Yl}}function Df(){if(hf(),Yl>=Jl)return{type:2,start:Yl,end:Yl};const e=Vl.charCodeAt(Yl);return df(e)?bf():40===e||41===e||59===e?xf():39===e||34===e?function(){var e,t,n,i,o="",r=!1;for(af("'"===(e=Vl[Yl])||'"'===e,"String literal must starts with a quote"),t=Yl,++Yl;Yl<Jl;){if((n=Vl[Yl++])===e){e="";break}if("\\"===n)if((n=Vl[Yl++])&&ff(n.charCodeAt(0)))"\r"===n&&"\n"===Vl[Yl]&&++Yl;else switch(n){case"u":case"x":"{"===Vl[Yl]?(++Yl,o+=vf()):o+=gf(n);break;case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;default:uf(n)?(0!==(i="01234567".indexOf(n))&&(r=!0),Yl<Jl&&uf(Vl[Yl])&&(r=!0,i=8*i+"01234567".indexOf(Vl[Yl++]),"0123".indexOf(n)>=0&&Yl<Jl&&uf(Vl[Yl])&&(i=8*i+"01234567".indexOf(Vl[Yl++]))),o+=String.fromCharCode(i)):o+=n}else{if(ff(n.charCodeAt(0)))break;o+=n}}return""!==e&&Of({},$l,tf),{type:8,value:o,octal:r,start:t,end:Yl}}():46===e?sf(Vl.charCodeAt(Yl+1))?wf():xf():sf(e)?wf():xf()}function Ff(){const e=Xl;return Yl=e.end,Xl=Df(),Yl=e.end,e}function kf(){const e=Yl;Xl=Df(),Yl=e}function Cf(e,t,n){const i=new Hl("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return i.operator=e,i.left=t,i.right=n,i}function Ef(e,t){const n=new Hl("CallExpression");return n.callee=e,n.arguments=t,n}function Sf(e){const t=new Hl(Ql);return t.name=e,t}function Bf(e){const t=new Hl("Literal");return t.value=e.value,t.raw=Vl.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function _f(e,t,n){const i=new Hl("MemberExpression");return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function zf(e,t,n){const i=new Hl("Property");return i.key=t,i.value=n,i.kind=e,i}function Of(e,t){var n,i=Array.prototype.slice.call(arguments,2),o=t.replace(/%(\d)/g,((e,t)=>(af(t<i.length,"Message reference must be in range"),i[t])));throw(n=new Error(o)).index=Yl,n.description=o,n}function Nf(e){2===e.type&&Of(e,"Unexpected end of input"),6===e.type&&Of(e,"Unexpected number"),8===e.type&&Of(e,"Unexpected string"),3===e.type&&Of(e,"Unexpected identifier"),4===e.type&&Of(e,"Unexpected reserved word"),Of(e,$l,e.value)}function Pf(e){const t=Ff();7===t.type&&t.value===e||Nf(t)}function jf(e){return 7===Xl.type&&Xl.value===e}function Mf(e){return 4===Xl.type&&Xl.value===e}function Tf(){const e=[];for(Yl=Xl.start,Pf("[");!jf("]");)jf(",")?(Ff(),e.push(null)):(e.push(Xf()),jf("]")||Pf(","));return Ff(),function(e){const t=new Hl("ArrayExpression");return t.elements=e,t}(e)}function Lf(){Yl=Xl.start;const e=Ff();return 8===e.type||6===e.type?(e.octal&&Of(e,ef),Bf(e)):Sf(e.value)}function qf(){var e,t,n;return Yl=Xl.start,3===(e=Xl).type?(n=Lf(),Pf(":"),zf("init",n,Xf())):2!==e.type&&7!==e.type?(t=Lf(),Pf(":"),zf("init",t,Xf())):void Nf(e)}function Rf(){var e,t,n=[],i={},o=String;for(Yl=Xl.start,Pf("{");!jf("}");)t="$"+((e=qf()).key.type===Ql?e.key.name:o(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?Of({},"Duplicate data property in object literal not allowed in strict mode"):i[t]=!0,n.push(e),jf("}")||Pf(",");return Pf("}"),function(e){const t=new Hl("ObjectExpression");return t.properties=e,t}(n)}const Wf={if:1};function Uf(){var e,t,n;if(jf("("))return function(){Pf("(");const e=Qf();return Pf(")"),e}();if(jf("["))return Tf();if(jf("{"))return Rf();if(e=Xl.type,Yl=Xl.start,3===e||Wf[Xl.value])n=Sf(Ff().value);else if(8===e||6===e)Xl.octal&&Of(Xl,ef),n=Bf(Ff());else{if(4===e)throw new Error(nf);1===e?((t=Ff()).value="true"===t.value,n=Bf(t)):5===e?((t=Ff()).value=null,n=Bf(t)):jf("/")||jf("/=")?(n=Bf(Af()),kf()):Nf(Ff())}return n}function If(){const e=[];if(Pf("("),!jf(")"))for(;Yl<Jl&&(e.push(Xf()),!jf(")"));)Pf(",");return Pf(")"),e}function Hf(){return Pf("."),function(){Yl=Xl.start;const e=Ff();return function(e){return 3===e.type||4===e.type||1===e.type||5===e.type}(e)||Nf(e),Sf(e.value)}()}function Gf(){Pf("[");const e=Qf();return Pf("]"),e}function Vf(){const e=function(){var e;for(e=Uf();;)if(jf("."))e=_f(".",e,Hf());else if(jf("("))e=Ef(e,If());else{if(!jf("["))break;e=_f("[",e,Gf())}return e}();if(7===Xl.type&&(jf("++")||jf("--")))throw new Error(nf);return e}function Yf(){var e,t;if(7!==Xl.type&&4!==Xl.type)t=Vf();else{if(jf("++")||jf("--"))throw new Error(nf);if(jf("+")||jf("-")||jf("~")||jf("!"))e=Ff(),t=Yf(),t=function(e,t){const n=new Hl("UnaryExpression");return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(Mf("delete")||Mf("void")||Mf("typeof"))throw new Error(nf);t=Vf()}}return t}function Jf(e){let t=0;if(7!==e.type&&4!==e.type)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function Xf(){var e,t;return e=function(){var e,t,n,i,o,r,a,s,c,u;if(e=Xl,c=Yf(),0===(o=Jf(i=Xl)))return c;for(i.prec=o,Ff(),t=[e,Xl],r=[c,i,a=Yf()];(o=Jf(Xl))>0;){for(;r.length>2&&o<=r[r.length-2].prec;)a=r.pop(),s=r.pop().value,c=r.pop(),t.pop(),n=Cf(s,c,a),r.push(n);(i=Ff()).prec=o,r.push(i),t.push(Xl),n=Yf(),r.push(n)}for(n=r[u=r.length-1],t.pop();u>1;)t.pop(),n=Cf(r[u-1].value,r[u-2],n),u-=2;return n}(),jf("?")&&(Ff(),t=Xf(),Pf(":"),e=function(e,t,n){const i=new Hl("ConditionalExpression");return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,Xf())),e}function Qf(){const e=Xf();if(jf(","))throw new Error(nf);return e}function $f(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...$f(e.object)),t.push(...$f(e.property))),t)}function Kf(e){return"MemberExpression"===e.object.type?Kf(e.object):"datum"===e.object.name}function Zf(e){const t=function(e){Yl=0,Jl=(Vl=e).length,Xl=null,kf();const t=Qf();if(2!==Xl.type)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&Kf(e)&&n.add($f(e).slice(1).join("."))})),n}class ed extends Hu{clone(){return new ed(null,this.model,z(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,Bn(this,"expr",void 0),Bn(this,"_dependentFields",void 0),this.expr=id(this.model,this.filter,this),this._dependentFields=Zf(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter ".concat(this.expr)}}function td(e,t,n,i="datum"){const o=[];const r=Z(t,(function(t){const r=K(t),a=e.getSelectionComponent(r,t),s=w(r+Fl);if(a.project.timeUnit){const t=null!=n?n:e.component.data.raw,i=a.project.timeUnit.clone();t.parent?i.insertAsParentOf(t):t.parent=i}return"none"!==a.empty&&o.push(s),"vlSelectionTest(".concat(s,", ").concat(i)+("global"===a.resolve?")":", ".concat(w(a.resolve),")"))}));return(o.length?"!("+o.map((e=>"length(data(".concat(e,"))"))).join(" || ")+") || ":"")+"(".concat(r,")")}function nd(e,t){const n=t.encoding;let i=t.field;if(n||i){if(n&&!i){const o=e.project.items.filter((e=>e.channel===n));!o.length||o.length>1?(i=e.project.items[0].field,si((o.length?"Multiple ":"No ")+"matching ".concat(w(n)," encoding found for selection ").concat(w(t.selection),". ")+'Using "field": '.concat(w(i),"."))):i=o[0].field}}else i=e.project.items[0].field,e.project.items.length>1&&si('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat(w(i),"."));return"".concat(e.name,"[").concat(w(i),"]")}function id(e,t,n){return Z(t,(t=>x(t)?t:function(e){return null==e?void 0:e.selection}(t)?td(e,t.selection,n):qi(t)))}function od(e,t,n,i){var o,r,a;e.encode=null!==(o=e.encode)&&void 0!==o?o:{},e.encode[t]=null!==(r=e.encode[t])&&void 0!==r?r:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=i}function rd(e,t,n,i={header:!1}){const{disable:o,orient:r,scale:a,labelExpr:s,title:c,zindex:l,...f}=e.combine();if(!o){for(const e in f){const n=be[e],i=f[e];if(n&&n!==t&&"both"!==n)delete f[e];else if(ve(i)){const{condition:t,...n}=i,o=h(t),r=ge[e];if(r){const{vgProp:t,part:i}=r;od(f,i,t,[...o.map((e=>{const{test:t,...n}=e;return{test:id(null,t),...n}})),n]),delete f[e]}else if(null===r){const t={signal:o.map((e=>{const{test:t,...n}=e;return"".concat(id(null,t)," ? ").concat(ka(n)," : ")})).join("")+ka(n)};f[e]=t}}else if(Fi(i)){const t=ge[e];if(t){const{vgProp:n,part:o}=t;od(f,o,n,i),delete f[e]}}}if("grid"===t){if(!f.grid)return;if(f.encode){const{grid:e}=f.encode;f.encode={...e?{grid:e}:{}},Y(f.encode)&&delete f.encode}return{scale:a,orient:r,...f,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ue(l,0)}}{if(!i.header&&e.mainExtracted)return;if(void 0!==s){var d,p;let e=s;(null===(d=f.encode)||void 0===d||null===(p=d.labels)||void 0===p?void 0:p.update)&&Fi(f.encode.labels.update.text)&&(e=ae(s,"datum.label",f.encode.labels.update.text.signal)),od(f,"labels","text",{signal:e})}if(null===f.labelAlign&&delete f.labelAlign,f.encode){for(const t of ye)e.hasAxisPart(t)||delete f.encode[t];Y(f.encode)&&delete f.encode}const t=function(e,t){if(e)return u(e)&&!xa(e)?e.map((e=>aa(e,t))).join(", "):e}(c,n);return{scale:a,orient:r,grid:!1,...t?{title:t}:{},...f,...!1===n.aria?{aria:!1}:{},zindex:ue(l,0)}}}}function ad(e){const{axes:t}=e.component,n=[];for(const i of Zt)if(t[i])for(const o of t[i])if(!o.get("disable")&&!o.get("gridScale")){const t="x"===i?"height":"width",o=e.getSizeSignalRef(t).signal;t!==o&&n.push({name:t,update:o})}return n}function sd(e,t,n,i){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",o=t["x"===n?"axisBottom":"axisLeft"]||{},r=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...J(o),...J(r)]),s={};for(const t of a.values())s[t]={signal:"".concat(i.signal,' === "').concat(e,'" ? ').concat(Ca(o[t])," : ").concat(Ca(r[t]))};return s}return t[e]}))])}function cd(e,t,n,i){const o="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function(e){return e in fo}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],r="x"===e?"axisX":"axisY",a=Fi(n)?"axisOrient":"axis"+te(n),s=[...o,...o.map((e=>r+e.substr(4)))],c=["axis",a,r];return{vlOnlyAxisConfig:sd(s,i,e,n),vgAxisConfig:sd(c,i,e,n),axisConfigStyle:ud([...c,...s],i)}}function ud(e,t){const n=[{}];for(const o of e){var i;let e=null===(i=t[o])||void 0===i?void 0:i.style;if(e){e=h(e);for(const i of e)n.push(t.style[i])}}return Object.assign.apply(null,n)}function ld(e,t,n,i={}){const o=Oa(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){var r;if(void 0!==(null===(r=i[t])||void 0===r?void 0:r[e]))return{configFrom:t,configValue:i[t][e]}}return{}}const fd={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:i,formatType:o}=n;return vr(e,e.type,i,o,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return yr(i,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{return(!qr(e)||!kn(e.bin))&&(null!==(i=t.grid)&&void 0!==i?i:function(e,t){return!go(e)&&qr(t)&&!Fn(null==t?void 0:t.bin)}(n,e));var i},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||md(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||pd(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var i;return null!==(i=e.labelFlush)&&void 0!==i?i:function(e,t){if("x"===t&&T(["quantitative","temporal"],e))return!0;return}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var i;return null!==(i=e.labelOverlap)&&void 0!==i?i:function(e,t,n,i){if(n&&!l(i)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,qr(t)&&!!t.timeUnit,qr(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:o})=>{var r;const a="x"===e?"width":"y"===e?"height":void 0,s=a?t.getSizeSignalRef(a):void 0;return null!==(r=n.tickCount)&&void 0!==r?r:function({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){if(!i&&!go(t)&&"log"!==t){if(qr(e)){var o;if(Fn(e.bin))return{signal:"ceil(".concat(n.signal,"/10)")};if(e.timeUnit&&T(["month","hours","day","quarter"],null===(o=Di(e.timeUnit))||void 0===o?void 0:o.unit))return}return{signal:"ceil(".concat(n.signal,"/40)")}}return}({fieldOrDatumDef:i,scaleType:o,size:s,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const i=hd(t,n);if(void 0!==i)return i;const o=t.typedFieldDef(n),r="x"===n?"x2":"y2",a=t.fieldDef(r);return Pa(o?[Or(o)]:[],qr(a)?[Or(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if(u(n))return va(t,n);if(Fi(n))return n;return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var i;return null!==(i=e.zindex)&&void 0!==i?i:function(e,t){if("rect"===e&&Zr(t))return 1;return 0}(n,t)}};function dd(e){return"(((".concat(e.signal," % 360) + 360) % 360)")}function pd(e,t,n,i){if(void 0!==e){if("x"===n){if(Fi(e)){const n=dd(e),i=Fi(t)?"(".concat(t.signal,' === "top")'):"top"===t;return{signal:"(45 < ".concat(n," && ").concat(n," < 135) || (225 < ").concat(n," && ").concat(n,' < 315) ? "middle" :')+"(".concat(n," <= 45 || 315 <= ").concat(n,") === ").concat(i,' ? "bottom" : "top"')}}if(45<e&&e<135||225<e&&e<315)return"middle";if(Fi(t)){const n=e<=45||315<=e?"===":"!==";return{signal:"".concat(t.signal," ").concat(n,' "top" ? "bottom" : "top"')}}return(e<=45||315<=e)==("top"===t)?"bottom":"top"}if(Fi(e)){const n=dd(e),o=Fi(t)?"(".concat(t.signal,' === "left")'):"left"===t,r=i?'"middle"':"null";return{signal:"".concat(n," <= 45 || 315 <= ").concat(n," || (135 <= ").concat(n," && ").concat(n," <= 225) ? ").concat(r," : (45 <= ").concat(n," && ").concat(n," <= 135) === ").concat(o,' ? "top" : "bottom"')}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(Fi(t)){const n=45<=e&&e<=135?"===":"!==";return{signal:"".concat(t.signal," ").concat(n,' "left" ? "top" : "bottom"')}}return(45<=e&&e<=135)==("left"===t)?"top":"bottom"}}function md(e,t,n){if(void 0===e)return;const i="x"===n,o=i?0:90,r=i?"bottom":"left";if(Fi(e)){const n=dd(e),a=Fi(t)?"(".concat(t.signal,' === "').concat(r,'")'):t===r;return{signal:"(".concat(o?"("+n+" + 90)":n," % 180 === 0) ? ").concat(i?null:'"center"'," :")+"(".concat(o," < ").concat(n," && ").concat(n," < ").concat(180+o,") === ").concat(a,' ? "left" : "right"')}}if((e+o)%180==0)return i?null:"center";if(Fi(t)){const n=o<e&&e<180+o?"===":"!==",i="".concat(t.signal," ").concat(n,' "').concat(r,'"');return{signal:"".concat(i,' ? "left" : "right"')}}return(o<e&&e<180+o)==(t===r)?"left":"right"}function hd(e,t){const n="x"===t?"x2":"y2",i=e.fieldDef(t),o=e.fieldDef(n),r=i?i.title:void 0,a=o?o.title:void 0;return r&&a?ja(r,a):r||(a||(void 0!==r?r:void 0!==a?a:void 0))}class gd extends Hu{clone(){return new gd(null,z(this.transform))}constructor(e,t){super(e),this.transform=t,Bn(this,"_dependentFields",void 0),this._dependentFields=Zf(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef(((t,n)=>{if(Yr(t)&&Sr(t.sort)){const{field:i,timeUnit:o}=t,r=t.sort,a=r.map(((e,t)=>"".concat(qi({field:i,timeUnit:o,equal:e})," ? ").concat(t," : "))).join("")+r.length;e=new gd(e,{calculate:a,as:vd(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate ".concat(j(this.transform))}}function vd(e,t,n){return Kr(e,{prefix:t,suffix:"sort_index",...null!=n?n:{}})}function yd(e,t){return T(["top","bottom"],t)?"column":T(["left","right"],t)||"row"===e?"row":"column"}function bd(e,t,n,i){const o="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return ue((t||{})[e],o[e],n.header[e])}function xd(e,t,n,i){const o={};for(const r of e){const e=bd(r,t||{},n,i);void 0!==e&&(o[r]=e)}return o}const wd=["row","column"],Ad=["header","footer"];function Dd(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,o=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:r,titleAngle:a,titleOrient:s}=xd(["titleAnchor","titleAngle","titleOrient"],o.header,i,t),c=yd(t,s),u=me(a);return{name:"".concat(t,"-title"),type:"group",role:"".concat(c,"-title"),title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...kd(u,c),...Fd(c,u,r),...Od(i,o,t,ys,gs)}}}function Fd(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=md(t,"row"===e?"left":"top","row"===e?"y":"x");return i?{align:i}:{}}function kd(e,t){const n=pd(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function Cd(e,t){const n=e.component.layoutHeaders[t],i=[];for(const o of Ad)if(n[o])for(const r of n[o]){const a=Bd(e,t,o,n,r);null!=a&&i.push(a)}return i}function Ed(e,t){const{sort:n}=e;var i;return Er(n)?{field:Kr(n,{expr:"datum"}),order:null!==(i=n.order)&&void 0!==i?i:"ascending"}:u(n)?{field:vd(e,t,{expr:"datum"}),order:"ascending"}:{field:Kr(e,{expr:"datum"}),order:null!=n?n:"ascending"}}function Sd(e,t,n){const{format:i,formatType:o,labelAngle:r,labelAnchor:a,labelOrient:s,labelExpr:c}=xd(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=mr({fieldOrDatumDef:e,format:i,formatType:o,expr:"parent",config:n}).signal,l=yd(t,s);return{text:{signal:c?ae(ae(c,"datum.label",u),"datum.value",Kr(e,{expr:"parent"})):u},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...kd(r,l),...Fd(l,r,a),...Od(n,e,t,bs,vs)}}function Bd(e,t,n,i,o){if(o){let r=null;const{facetFieldDef:a}=i,s=e.config?e.config:void 0;if(a&&o.labels){const{labelOrient:e}=xd(["labelOrient"],a.header,s,t);("row"===t&&!T(["top","bottom"],e)||"column"===t&&!T(["left","right"],e))&&(r=Sd(a,t,s))}const c=Sm(e)&&!Br(e.facet),u=o.axes,l=(null==u?void 0:u.length)>0;if(r||l){const s="row"===t?"height":"width";return{name:e.getName("".concat(t,"_").concat(n)),type:"group",role:"".concat(t,"-").concat(n),...i.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:Ed(a,t)}:{},...l&&c?{from:{data:e.getName("facet_domain_".concat(t))}}:{},...r?{title:r}:{},...o.sizeSignal?{encode:{update:{[s]:o.sizeSignal}}}:{},...l?{axes:u}:{}}}}return null}const _d={column:{start:0,end:1},row:{start:1,end:0}};function zd(e,t){return _d[t][e]}function Od(e,t,n,i,o){const r={};for(const a of i){if(!o[a])continue;const i=bd(a,null==t?void 0:t.header,e,n);void 0!==i&&(r[o[a]]=i)}return r}function Nd(e){return[...Pd(e,"width"),...Pd(e,"height"),...Pd(e,"childWidth"),...Pd(e,"childHeight")]}function Pd(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const o=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),r=t.get("range");if(go(i)&&ki(r)){const i=e.scaleName(n);if(Sm(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[jd(i,r)]}return[jd(i,r),{name:o,update:Md(i,t,"domain('".concat(i,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=o.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=js(e.config.view,t?"width":"height"),r="isFinite(".concat(n,") ? ").concat(n," : ").concat(i);return[{name:o,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:o,value:i}]}function jd(e,t){return{name:e+"_step",value:t.step}}function Md(e,t,n){const i=t.get("type"),o=t.get("padding"),r=ue(t.get("paddingOuter"),o);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:o:1,"bandspace(".concat(n,", ").concat(Ca(a),", ").concat(Ca(r),") * ").concat(e,"_step")}function Td(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function Ld(e,t){return J(e).reduce(((n,i)=>{const o=e[i];return{...n,...fu(t,o,i,(e=>Fa(e.value)))}}),{})}function qd(e,t){if(_m(t)||Sm(t))return"shared";if(Bm(t))return en(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function Rd(e,t){const n=e.scale[t],i=en(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&si(function(e){return'Setting the scale to be independent for "'.concat(e,'" means we also have to set the guide (axis or legend) to be independent.')}(t)),"independent"):e[i][t]||"shared"}const Wd=J({aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});class Ud extends Ac{}const Id={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:o,legendType:r}){var a,s,c,l;if("symbol"!==r)return;const{markDef:f,encoding:d,config:p,mark:m}=n,h=f.filled&&"trail"!==m;let g={...Ea({},n,Ko),...wu(n,{filled:h})};const v=null!==(a=o.get("symbolOpacity"))&&void 0!==a?a:p.legend.symbolOpacity,y=null!==(s=o.get("symbolFillColor"))&&void 0!==s?s:p.legend.symbolFillColor,b=null!==(c=o.get("symbolStrokeColor"))&&void 0!==c?c:p.legend.symbolStrokeColor,x=void 0===v?null!==(l=Hd(d.opacity))&&void 0!==l?l:f.opacity:void 0;if(g.fill){var w;if("fill"===i||h&&i===Je)delete g.fill;else if(g.fill.field)if(y)delete g.fill;else g.fill=Fa(null!==(w=p.legend.symbolBaseFillColor)&&void 0!==w?w:"black"),g.fillOpacity=Fa(null!=x?x:1);else if(u(g.fill)){var A,D,F;const e=null!==(A=null!==(D=Gd(null!==(F=d.fill)&&void 0!==F?F:d.color))&&void 0!==D?D:f.fill)&&void 0!==A?A:h&&f.color;e&&(g.fill=Fa(e))}}if(g.stroke)if("stroke"===i||!h&&i===Je)delete g.stroke;else if(g.stroke.field||b)delete g.stroke;else if(u(g.stroke)){const e=ue(Gd(d.stroke||d.color),f.stroke,h?f.color:void 0);e&&(g.stroke={value:e})}if(i!==et){const e=qr(t)&&Yd(n,o,t);e?g.opacity=[{test:e,...Fa(null!=x?x:1)},Fa(p.legend.unselectedOpacity)]:x&&(g.opacity=Fa(x))}return g={...g,...e},Y(g)?void 0:g},gradient:function(e,{model:t,legendType:n,legendCmpt:i}){var o;if("gradient"!==n)return;const{config:r,markDef:a,encoding:s}=t;let c={};const u=void 0===(null!==(o=i.get("gradientOpacity"))&&void 0!==o?o:r.legend.gradientOpacity)?Hd(s.opacity)||a.opacity:void 0;u&&(c.opacity=Fa(u));return c={...c,...e},Y(c)?void 0:c},labels:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:o}){const r=n.legend(i)||{},a=n.config,s=qr(t)?Yd(n,o,t):void 0,c=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:u,formatType:l}=r,f=dr(l)?gr({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:l,config:a}):void 0,d={...c?{opacity:c}:{},...f?{text:f}:{},...e};return Y(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?{...e,fill:{value:"transparent"}}:e}};function Hd(e){return Vd(e,((e,t)=>Math.max(e,t.value)))}function Gd(e){return Vd(e,((e,t)=>ue(e,t.value)))}function Vd(e,t){return function(e){const t=e&&e.condition;return!!t&&(u(t)||Vr(t))}(e)?h(e.condition).reduce(t,e.value):Vr(e)?e.value:void 0}function Yd(e,t,n){const i=t.get("selections");if(!(null==i?void 0:i.length))return;const o=w(n.field);return i.map((e=>{const t=w(K(e)+Fl);return"(!length(data(".concat(t,")) || (").concat(e,"[").concat(o,"] && indexof(").concat(e,"[").concat(o,"], datum.value) >= 0))")})).join(" || ")}const Jd={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:o}=t;return vr(e,e.type,i,o,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return yr(i,t,n)},gradientLength:e=>{var t,n;const{legend:i,legendConfig:o}=e;return null!==(t=null!==(n=i.gradientLength)&&void 0!==n?n:o.gradientLength)&&void 0!==t?t:function({legendConfig:e,model:t,direction:n,orient:i,scaleType:o}){const{gradientHorizontalMaxLength:r,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:c}=e;if(yo(o))return"horizontal"===n?"top"===i||"bottom"===i?$d(t,"width",a,r):a:$d(t,"height",c,s);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var i,o;return null!==(i=null!==(o=e.labelOverlap)&&void 0!==o?o:t.labelOverlap)&&void 0!==i?i:function(e){if(T(["quantile","threshold","log","symlog"],e))return"greedy";return}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>{var o;return null!==(o=e.symbolType)&&void 0!==o?o:function(e,t,n,i){if("shape"!==t){var o;const e=null!==(o=Gd(n))&&void 0!==o?o:i;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,i.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>oa(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(yt(n)&&yo(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;if(u(n))return va(t,n);if(Fi(n))return n;return}(t,e)};function Xd(e){const{legend:t}=e;return ue(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(yt(e)){if(T(["quarter","month","day"],t))return"symbol";if(yo(n))return"gradient"}return"symbol"}(e))}function Qd({legendConfig:e,legendType:t,orient:n,legend:i}){var o,r;return null!==(o=null!==(r=i.direction)&&void 0!==r?r:e[t?"gradientDirection":"symbolDirection"])&&void 0!==o?o:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function $d(e,t,n,i){const o=e.getSizeSignalRef(t).signal;return{signal:"clamp(".concat(o,", ").concat(n,", ").concat(i,")")}}function Kd(e){const t=Em(e)?function(e){const{encoding:t}=e,n={};for(const i of[Je,...ws]){const o=ua(t[i]);o&&e.getScaleComponent(i)&&(i===$e&&qr(o)&&o.type===Vi||(n[i]=ep(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Kd(i);for(const o of J(i.component.legends))n.legend[o]=Rd(e.component.resolve,o),"shared"===n.legend[o]&&(t[o]=tp(t[o],i.component.legends[o]),t[o]||(n.legend[o]="independent",delete t[o]))}for(const i of J(t))for(const t of e.children)t.component.legends[i]&&"shared"===n.legend[i]&&delete t.component.legends[i];return t}(e);return e.component.legends=t,t}function Zd(e,t,n,i){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==i?void 0:i.title))return!0}return e===(n||{})[t]}function ep(e,t){var n,i,o;let r=e.legend(t);const{markDef:a,encoding:s,config:c}=e,u=c.legend,l=new Ud({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var i;const o=null===(i=e.fieldDef(t))||void 0===i?void 0:i.field;Bl(e,(e=>{var i;const r=null!==(i=e.project.hasField[o])&&void 0!==i?i:e.project.hasChannel[t];if(r&&nl.has(e)){var a;const t=null!==(a=n.get("selections"))&&void 0!==a?a:[];t.push(e.name),n.set("selections",t,!1),r.hasLegend=!0}}))}(e,t,l);const f=void 0!==r?!r:u.disable;if(l.set("disable",f,void 0!==r),f)return l;r=r||{};const d=e.getScaleComponent(t).get("type"),p=ua(s[t]),m=qr(p)?null===(n=Di(p.timeUnit))||void 0===n?void 0:n.unit:void 0,h=r.orient||c.legend.orient||"right",g=Xd({legend:r,channel:t,timeUnit:m,scaleType:d}),v={legend:r,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:p,legendConfig:u,config:c,scaleType:d,orient:h,legendType:g,direction:Qd({legend:r,legendType:g,orient:h,legendConfig:u})};for(const n of Wd){if("gradient"===g&&n.startsWith("symbol")||"symbol"===g&&n.startsWith("gradient"))continue;const i=n in Jd?Jd[n](v):r[n];if(void 0!==i){const o=Zd(i,n,r,e.fieldDef(t));(o||void 0===c.legend[n])&&l.set(n,i,o)}}const y=null!==(i=null===(o=r)||void 0===o?void 0:o.encoding)&&void 0!==i?i:{},b=l.get("selections"),x={},w={fieldOrDatumDef:p,model:e,channel:t,legendCmpt:l,legendType:g};for(const t of["labels","legend","title","symbols","gradient","entries"]){var A;const n=Ld(null!==(A=y[t])&&void 0!==A?A:{},e),i=t in Id?Id[t](n,w):n;void 0===i||Y(i)||(x[t]={...(null==b?void 0:b.length)&&qr(p)?{name:"".concat(K(p.field),"_legend_").concat(t)}:{},...(null==b?void 0:b.length)?{interactive:!!b}:{},update:i})}var D;Y(x)||l.set("encode",x,!!(null===(D=r)||void 0===D?void 0:D.encoding));return l}function tp(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let o=!1;for(const n of Wd){const i=Ec(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return np(e,t);case"title":return Ma(e,t);case"type":return o=!0,Fc("symbol")}return Cc(e,t,n,"legend")}));e.setWithExplicit(n,i)}var r,a,s,c;o&&((null===(r=e.implicit)||void 0===r||null===(a=r.encode)||void 0===a?void 0:a.gradient)&&ee(e.implicit,["encode","gradient"]),(null===(s=e.explicit)||void 0===s||null===(c=s.encode)||void 0===c?void 0:c.gradient)&&ee(e.explicit,["encode","gradient"]));return e}function np(e,t){return"circle"===t.value?t:e}function ip(e){const t=e.component.legends,n={};for(const i of J(t)){const o=e.getScaleComponent(i),r=P(o.get("domains"));if(n[r])for(const e of n[r]){tp(e,t[i])||n[r].push(t[i])}else n[r]=[t[i].clone()]}return X(n).flat().map((t=>function(e,t){var n;const{disable:i,labelExpr:o,selections:r,...a}=e.combine();if(i)return;!1===t.aria&&null==a.aria&&(a.aria=!1);if(null===(n=a.encode)||void 0===n?void 0:n.symbols){const e=a.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||a.stroke||(e.stroke={value:"transparent"});for(const t of ws)a[t]&&delete e[t]}a.title||delete a.title;if(void 0!==o){var s,c;let e=o;(null===(s=a.encode)||void 0===s||null===(c=s.labels)||void 0===c?void 0:c.update)&&Fi(a.encode.labels.update.text)&&(e=ae(o,"datum.label",a.encode.labels.update.text.signal)),function(e,t,n,i){var o,r,a;e.encode=null!==(o=e.encode)&&void 0!==o?o:{},e.encode[t]=null!==(r=e.encode[t])&&void 0!==r?r:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=i}(a,"labels","text",{signal:e})}return a}(t,e.config))).filter((e=>void 0!==e))}function op(e){return _m(e)||Bm(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),rp(e))}(e):rp(e)}function rp(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const o={signal:"[".concat(t.size.map((e=>e.signal)).join(", "),"]")},r=t.data.reduce(((t,n)=>{const i=Fi(n)?n.signal:"data('".concat(e.lookupDataSource(n),"')");return T(t,i)||t.push(i),t}),[]);if(r.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:o,fit:{signal:r.length>1?"[".concat(r.join(", "),"]"):r[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const ap=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class sp extends Ac{constructor(e,t,n,i){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,Bn(this,"merged",!1)}get isFit(){return!!this.data}}function cp(e){e.component.projection=Em(e)?function(e){if(e.hasProjection){var t;const n=e.specifiedProjection,i=!(n&&(null!=n.scale||null!=n.translate)),o=i?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=i?function(e){const t=[],{encoding:n}=e;for(const i of[[Ge,He],[Ye,Ve]])(ua(n[i[0]])||ua(n[i[1]]))&&t.push({signal:e.getName("geojson_".concat(t.length))});e.channelHasField($e)&&e.typedFieldDef($e).type===Vi&&t.push({signal:e.getName("geojson_".concat(t.length))});0===t.length&&t.push(e.requestDataName(Mc.Main));return t}(e):void 0;return new sp(e.projectionName(!0),{...null!==(t=e.config.projection)&&void 0!==t?t:{},...null!=n?n:{}},o,r)}return}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)cp(t);const n=q(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=q(ap,(n=>!v(e.explicit,n)&&!v(t.explicit,n)||!(!v(e.explicit,n)||!v(t.explicit,n)||P(e.get(n))!==P(t.get(n)))));if(P(e.size)===P(t.size)){if(n)return e;if(P(e.explicit)===P({}))return t;if(P(t.explicit)===P({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),i=new sp(n,t.specifiedProjection,t.size,z(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&i.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return i}return}(e)}function up(e,t,n,i){if(ya(t,n)){var o,r;const a=Em(e)&&null!==(o=null!==(r=e.axis(n))&&void 0!==r?r:e.legend(n))&&void 0!==o?o:{},s=Kr(t,{expr:"datum"}),c=Kr(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Kr(t,{binSuffix:"range",forAs:!0}),formula:Ar(s,c,a.format,a.formatType,i)}}return{}}function lp(e,t){return"".concat(Dn(e),"_").concat(t)}function fp(e,t,n){var i;const o=lp(null!==(i=pa(n,void 0))&&void 0!==i?i:{},t);return e.getName("".concat(o,"_bins"))}function dp(e,t,n){let i,o;i=function(e){return"as"in e}(e)?x(e.as)?[e.as,"".concat(e.as,"_end")]:[e.as[0],e.as[1]]:[Kr(e,{forAs:!0}),Kr(e,{binSuffix:"end",forAs:!0})];const r={...pa(t,void 0)},a=lp(r,e.field),{signal:s,extentSignal:c}=function(e,t){return{signal:e.getName("".concat(t,"_bins")),extentSignal:e.getName("".concat(t,"_extent"))}}(n,a);if(En(r.extent)){const e=r.extent,t=e.selection;o=nd(n.getSelectionComponent(K(t),t),e),delete r.extent}return{key:a,binComponent:{bin:r,field:e.field,as:[i],...s?{signal:s}:{},...c?{extentSignal:c}:{},...o?{span:o}:{}}}}class pp extends Hu{clone(){return new pp(null,z(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{if(Gr(n)&&Fn(n.bin)){const{key:o,binComponent:r}=dp(n,n.bin,t);e[o]={...r,...e[o],...up(t,n,i,t.config)}}return e}),{});return Y(n)?null:new pp(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:o}=dp(t,t.bin,n);return new pp(e,{[i]:o})}merge(e,t){for(const n of J(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=U([...this.bins[n].as,...e.bins[n].as],j)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(X(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(X(this.bins).map((e=>e.field)))}hash(){return"Bin ".concat(j(this.bins))}assemble(){return X(this.bins).flatMap((e=>{const t=[],[n,...i]=e.as,{extent:o,...r}=e.bin,a={type:"bin",field:re(e.field),as:n,signal:e.signal,...En(o)?{extent:null}:{extent:o},...e.span?{span:{signal:"span(".concat(e.span,")")}}:{},...r};!o&&e.extentSignal&&(t.push({type:"extent",field:re(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const e of i)for(let i=0;i<2;i++)t.push({type:"formula",expr:Kr({field:n[i]},{expr:"datum"}),as:e[i]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function mp(e,t,n,i){const o=Em(i)?i.encoding[Mt(t)]:void 0;if(Gr(n)&&Em(i)&&jr(t,n,o,i.stack,i.markDef,i.config))e.add(Kr(n,{})),e.add(Kr(n,{suffix:"end"})),n.bin&&ya(n,t)&&e.add(Kr(n,{binSuffix:"range"}));else if(t in ht){const n=function(e){switch(e){case He:return"y";case Ve:return"y2";case Ge:return"x";case Ye:return"x2"}}(t);e.add(i.getName(n))}else e.add(Kr(n));return e}class hp extends Hu{clone(){return new hp(null,new Set(this.dimensions),z(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const i={},o=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:r,field:a}=e;if(r)if("count"===r){var s;i["*"]=null!==(s=i["*"])&&void 0!==s?s:{},i["*"].count=new Set([Kr(e,{forAs:!0})])}else{if(Ce(r)||Ee(r)){var c;const e=Ce(r)?"argmin":"argmax",t=r[e];i[t]=null!==(c=i[t])&&void 0!==c?c:{},i[t][e]=new Set([Kr({op:e,field:t},{forAs:!0})])}else{var u;i[a]=null!==(u=i[a])&&void 0!==u?u:{},i[a][r]=new Set([Kr(e,{forAs:!0})])}var l;if(vn(n)&&"unaggregated"===t.scaleDomain(n))i[a]=null!==(l=i[a])&&void 0!==l?l:{},i[a].min=new Set([Kr({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Kr({field:a,aggregate:"max"},{forAs:!0})])}else mp(o,n,e,t)})),o.size+J(i).length===0?null:new hp(e,o,i)):null}static makeFromTransform(e,t){const n=new Set,i={};for(const e of t.aggregate){const{op:t,field:n,as:a}=e;var o,r;if(t)if("count"===t)i["*"]=null!==(o=i["*"])&&void 0!==o?o:{},i["*"].count=new Set([a||Kr(e,{forAs:!0})]);else i[n]=null!==(r=i[n])&&void 0!==r?r:{},i[n][t]=new Set([a||Kr(e,{forAs:!0})])}for(const e of null!==(a=t.groupby)&&void 0!==a?a:[]){var a;n.add(e)}return n.size+J(i).length===0?null:new hp(e,n,i)}merge(e){return I(this.dimensions,e.dimensions)?(function(e,t){for(const i of J(t)){const o=t[i];for(const t of J(o)){var n;i in e?e[i][t]=new Set([...null!==(n=e[i][t])&&void 0!==n?n:[],...o[t]]):e[i]={[t]:o[t]}}}}(this.measures,e.measures),!0):(function(...e){ai.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...J(this.measures)])}producedFields(){const e=new Set;for(const t of J(this.measures))for(const n of J(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add("".concat(n,"_").concat(t)):i.forEach(e.add,e)}return e}hash(){return"Aggregate ".concat(j({dimensions:this.dimensions,measures:this.measures}))}assemble(){const e=[],t=[],n=[];for(const i of J(this.measures))for(const o of J(this.measures[i]))for(const r of this.measures[i][o])n.push(r),e.push(o),t.push("*"===i?null:re(i));return{type:"aggregate",groupby:[...this.dimensions].map(re),ops:e,fields:t,as:n}}}class gp extends Hu{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i,Bn(this,"column",void 0),Bn(this,"row",void 0),Bn(this,"facet",void 0),Bn(this,"childModel",void 0);for(const e of xt){const n=t.facet[e];if(n){const{bin:i,sort:o}=n;this[e]={name:t.getName("".concat(e,"_domain")),fields:[Kr(n),...Fn(i)?[Kr(n,{binSuffix:"end"})]:[]],...Er(o)?{sortField:o}:u(o)?{sortIndexField:vd(n,e)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of xt)this[t]&&(e+=" ".concat(t.charAt(0),":").concat(j(this[t])));return e}get fields(){const e=[];for(const n of xt){var t;(null===(t=this[n])||void 0===t?void 0:t.fields)&&e.push(...this[n].fields)}return e}dependentFields(){const e=new Set(this.fields);for(const t of xt)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of Zt){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),o=n.get("range");if(go(i)&&ki(o)){const n=am(sm(this.childModel,t));n?e[t]=n:si(Mn(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x"}[e],o=[],r=[],a=[];n&&n[i]&&(t?(o.push("distinct_".concat(n[i])),r.push("max")):(o.push(n[i]),r.push("distinct")),a.push("distinct_".concat(n[i])));const{sortField:s,sortIndexField:c}=this[e];if(s){const{op:e=Dr,field:t}=s;o.push(t),r.push(e),a.push(Kr(s,{forAs:!0}))}else c&&(o.push(c),r.push("max"),a.push(c));return{name:this[e].name,source:null!=t?t:this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:r,as:a}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],o={};for(const e of wd){for(const t of Ad){var r;const i=null!==(r=n[e]&&n[e][t])&&void 0!==r?r:[];for(const t of i){var a;if((null===(a=t.axes)||void 0===a?void 0:a.length)>0){o[e]=!0;break}}}if(o[e]){const n='length(data("'.concat(this.facet.name,'"))'),o="row"===e?t?{signal:"ceil(".concat(n," / ").concat(t,")")}:1:t?{signal:"min(".concat(n,", ").concat(t,")")}:{signal:n};i.push({name:"".concat(this.facet.name,"_").concat(e),transform:[{type:"sequence",start:0,stop:o}]})}}const{row:s,column:c}=o;return(s||c)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:r}=this;if(i&&o&&(n.x||n.y)){var a,s;t="cross_".concat(this.column.name,"_").concat(this.row.name);const i=[].concat(null!==(a=n.x)&&void 0!==a?a:[],null!==(s=n.y)&&void 0!==s?s:[]),o=i.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:o}]})}for(const i of[Pe,Ne])this[i]&&e.push(this.assembleRowColumnHeaderData(i,t,n));if(r){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function vp(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function yp(e){const t={};return S(e.filter,(e=>{if(Ti(e)){let i=null;if(_i(e))i=Aa(e.equal);else if(Oi(e))i=Aa(e.lte);else if(zi(e))i=Aa(e.lt);else if(Ni(e))i=Aa(e.gt);else if(Pi(e))i=Aa(e.gte);else if(ji(e))i=e.range[0];else if(Mi(e)){var n;i=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]}i&&(ci(i)?t[e.field]="date":b(i)?t[e.field]="number":x(i)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function bp(e){const t={};function n(e){var n;ha(e)?t[e.field]="date":"quantitative"===e.type&&(x(n=e.aggregate)&&T(["min","max"],n))?t[e.field]="number":ce(e.field)>1?e.field in t||(t[e.field]="flatten"):Yr(e)&&Er(e.sort)&&ce(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((Em(e)||Sm(e))&&e.forEachFieldDef(((t,i)=>{if(Gr(t))n(t);else{const o=Pt(i),r=e.fieldDef(o);n({...t,type:r.type})}})),Em(e)){const{mark:n,markDef:i,encoding:o}=e;if(Jo(n)&&!e.encoding.order){const e=o["horizontal"===i.orient?"y":"x"];qr(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class xp extends Hu{clone(){return new xp(null,z(this._parse))}constructor(e,t){super(e),Bn(this,"_parse",void 0),this._parse=t}hash(){return"Parse ".concat(j(this._parse))}static makeExplicit(e,t,n){let i={};const o=t.data;return!Oc(o)&&o&&o.format&&o.format.parse&&(i=o.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const e of J(n)){const t=i.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:si(Un(e,n[e],t.value)))}for(const e of J(t)){const n=i.get(e);void 0!==n&&(n===t[e]?delete t[e]:si(Un(e,t[e],n)))}const o=new Ac(t,n);i.copyAll(o);const r={};for(const e of J(o.combine())){const t=o.get(e);null!==t&&(r[e]=t)}return 0===J(r).length||i.parseNothing?null:new xp(e,r)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of J(this._parse)){const n=this._parse[t];1===ce(t)&&(e[t]=n)}return e}producedFields(){return new Set(J(this._parse))}dependentFields(){return new Set(J(this._parse))}assembleTransforms(e=!1){return J(this._parse).filter((t=>!e||ce(t)>1)).map((e=>{const t=function(e,t){const n=ne(e);if("number"===t)return"toNumber(".concat(n,")");if("boolean"===t)return"toBoolean(".concat(n,")");if("string"===t)return"toString(".concat(n,")");if("date"===t)return"toDate(".concat(n,")");if("flatten"===t)return n;if(0===t.indexOf("date:")){const e=vp(t.slice(5,t.length));return"timeParse(".concat(n,",'").concat(e,"')")}if(0===t.indexOf("utc:")){const e=vp(t.slice(4,t.length));return"utcParse(".concat(n,",'").concat(e,"')")}return si('Unrecognized parse "'.concat(t,'".')),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:se(e)}})).filter((e=>null!==e))}}class wp extends Hu{clone(){return new wp(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Ds])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ds}}}class Ap extends Hu{clone(){return new Ap(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule ".concat(j(this.params))}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class Dp extends Hu{clone(){return new Dp(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return"Hash ".concat(j(this.params))}assemble(){return{type:"sequence",...this.params}}}class Fp extends Hu{constructor(e){var t;let n;if(super(null),Bn(this,"_data",void 0),Bn(this,"_name",void 0),Bn(this,"_generator",void 0),Oc(e=null!==(t=e)&&void 0!==t?t:{name:"source"})||(n=e.format?{...N(e.format,["parse"])}:{}),_c(e))this._data={values:e.values};else if(Bc(e)){if(this._data={url:e.url},!n.type){let t=/(?:\.([^.]+))?$/.exec(e.url)[1];T(["json","csv","tsv","dsv","topojson"],t)||(t="json"),n.type=t}}else Pc(e)?this._data={values:[{type:"Sphere"}]}:(zc(e)||Oc(e))&&(this._data={});this._generator=Oc(e),e.name&&(this._name=e.name),n&&!Y(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function kp(e){return e instanceof Fp||e instanceof Ap||e instanceof Dp}var Cp=new WeakMap;class Ep{constructor(){Cp.set(this,{writable:!0,value:void 0}),_n(this,Cp,!1)}setModified(){_n(this,Cp,!0)}get modifiedFlag(){return function(e,t){var n=t.get(e);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(e):n.value}(this,Cp)}}class Sp extends Ep{getNodeDepths(e,t,n){n.set(e,t);for(const i of e.children)this.getNodeDepths(i,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class Bp extends Ep{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class _p extends Bp{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let i=0;i<t.length;i++)void 0===n[t[i]]?n[t[i]]=[e.children[i]]:n[t[i]].push(e.children[i]);for(const t of J(n))n[t].length>1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class zp extends Bp{constructor(e){super(),Bn(this,"requiresSelectionId",void 0),this.requiresSelectionId=e&&zl(e)}run(e){e instanceof wp&&(this.requiresSelectionId&&(kp(e.parent)||e.parent instanceof hp||e.parent instanceof xp)||(this.setModified(),e.remove()))}}class Op extends Ep{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof Vu&&(n=e.producedFields(),H(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const i of e.children)this.run(i,new Set([...t,...n]))}}class Np extends Bp{constructor(){super()}run(e){e instanceof Gu&&!e.isRequired()&&(this.setModified(),e.remove())}}class Pp extends Sp{run(e){if(!(kp(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof xp)if(e instanceof xp)this.setModified(),e.merge(t);else{if(V(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class jp extends Sp{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof xp));if(e.numChildren()>1&&n.length>=1){const i={},o=new Set;for(const e of n){const t=e.parse;for(const e of J(t))e in i?i[e]!==t[e]&&o.add(e):i[e]=t[e]}for(const e of o)delete i[e];if(!Y(i)){this.setModified();const n=new xp(e,i);for(const o of t){if(o instanceof xp)for(const e of J(i))delete o.parse[e];e.removeChild(o),o.parent=n,o instanceof xp&&0===J(o.parse).length&&o.remove()}}}}}class Mp extends Sp{run(e){e instanceof Gu||e.numChildren()>0||e instanceof gp||e instanceof Fp||(this.setModified(),e.remove())}}class Tp extends Sp{run(e){const t=e.children.filter((e=>e instanceof Vu)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class Lp extends Sp{run(e){const t=e.children.filter((e=>e instanceof hp)),n={};for(const e of t){const t=j(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of J(n)){const i=n[t];if(i.length>1){const t=i.pop();for(const n of i)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class qp extends Sp{constructor(e){super(),this.model=e}run(e){const t=!(kp(e)||e instanceof ed||e instanceof xp||e instanceof wp),n=[],i=[];for(const o of e.children)o instanceof pp&&(t&&!V(e.producedFields(),o.dependentFields())?n.push(o):i.push(o));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof pp?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class Rp extends Sp{run(e){const t=[...e.children];if(!L(t,(e=>e instanceof Gu))||e.numChildren()<=1)return;const n=[];let i;for(const o of t)if(o instanceof Gu){let t=o;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof Gu))break;t=e}n.push(...t.children),i?(e.removeChild(o),o.parent=i.parent,i.parent.removeChild(i),i.parent=t,this.setModified()):i=t}else n.push(o);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=i}}}class Wp extends Hu{clone(){return new Wp(null,z(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=U(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Kr(e)}hash(){return"JoinAggregateTransform ".concat(j(this.transform))}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==i?{groupby:i}:{}}}}class Up extends Hu{clone(){return new Up(null,z(this._stack))}constructor(e,t){super(e),Bn(this,"_stack",void 0),this._stack=t}static makeFromTransform(e,t){const{stack:n,groupby:i,as:o,offset:r="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const e of t.sort)a.push(e.field),s.push(ue(e.order,"ascending"));const c={field:a,order:s};let l;return l=function(e){return u(e)&&e.every((e=>x(e)))&&e.length>1}(o)?o:x(o)?[o,o+"_end"]:[t.stack+"_start",t.stack+"_end"],new Up(e,{stackField:n,groupby:i,offset:r,sort:c,facetby:[],as:l})}static makeFromEncoding(e,t){const n=t.stack,{encoding:i}=t;if(!n)return null;const{groupbyChannel:o,fieldChannel:r,offset:a,impute:s}=n;let c;if(o){c=ca(i[o])}const l=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Kr(t.fieldDef);return n&&e.push(n),e}),[])}(t),f=t.encoding.order;let d;return d=u(f)||qr(f)?Na(f):l.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===r?"descending":"ascending"),e)),{field:[],order:[]}),new Up(e,{dimensionFieldDef:c,stackField:t.vgField(r),facetby:[],stackby:l,sort:d,offset:a,impute:s,as:[t.vgField(r,{suffix:"start",forAs:!0}),t.vgField(r,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack ".concat(j(this._stack))}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[Kr(e,{binSuffix:"mid"})]:[Kr(e,{}),Kr(e,{binSuffix:"end"})]:[Kr(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:i,stackby:o,sort:r,offset:a,impute:s,as:c}=this._stack;if(s&&n){const{band:r=.5,bin:a}=n;a&&e.push({type:"formula",expr:"".concat(r,"*")+Kr(n,{expr:"datum"})+"+".concat(1-r,"*")+Kr(n,{expr:"datum",binSuffix:"end"}),as:Kr(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[...o,...t],key:Kr(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:r,as:c,offset:a}),e}}class Ip extends Hu{clone(){return new Ip(null,z(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=U(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Kr(e)}hash(){return"WindowTransform ".concat(j(this.transform))}assemble(){const e=[],t=[],n=[],i=[];for(const o of this.transform.window)t.push(o.op),n.push(this.getDefaultName(o)),i.push(void 0===o.param?null:o.param),e.push(void 0===o.field?null:o.field);const o=this.transform.frame,r=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&t.every((e=>Se(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==r?{groupby:r}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort){var c;a.push(e.field),s.push(null!==(c=e.order)&&void 0!==c?c:"ascending")}const u={field:a,order:s},l=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:u,...void 0!==l?{ignorePeers:l}:{},...void 0!==r?{groupby:r}:{},...void 0!==o?{frame:o}:{}}}}function Hp(e){if(e instanceof gp)if(1!==e.numChildren()||e.children[0]instanceof Gu){const n=e.model.component.data.main;Gp(n);const i=(t=e,function e(n){if(!(n instanceof gp)){const i=n.clone();if(i instanceof Gu){const e=Vp+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof hp||i instanceof Up||i instanceof Ip||i instanceof Wp)&&i.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=i;return[i]}return n.children.flatMap(e)}),o=e.children.map(i).flat();for(const e of o)e.parent=n}else{const t=e.children[0];(t instanceof hp||t instanceof Up||t instanceof Ip||t instanceof Wp)&&t.addDimensions(e.fields),t.swapWithParent(),Hp(e)}else e.children.map(Hp);var t}function Gp(e){if(e instanceof Gu&&e.type===Mc.Main&&1===e.numChildren()){const t=e.children[0];t instanceof gp||(t.swapWithParent(),Gp(e))}}const Vp="scale_";function Yp(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!Yp(t.children))return!1}return!0}function Jp(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Xp(e,t,n){let i=e.sources,o=!1;return o=Jp(new Np,i)||o,o=Jp(new zp(t),i)||o,i=i.filter((e=>e.numChildren()>0)),o=Jp(new Mp,i)||o,i=i.filter((e=>e.numChildren()>0)),n||(o=Jp(new Pp,i)||o,o=Jp(new qp(t),i)||o,o=Jp(new Op,i)||o,o=Jp(new jp,i)||o,o=Jp(new Lp,i)||o,o=Jp(new Tp,i)||o,o=Jp(new _p,i)||o,o=Jp(new Rp,i)||o),e.sources=i,o}class Qp{constructor(e){Bn(this,"signal",void 0),Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Qp((()=>e(t)))}}function $p(e){Em(e)?function(e){const t=e.component.scales;for(const n of J(t)){const i=Kp(e,n);if(t[n].setWithExplicit("domains",i),nm(e,n),e.component.data.isFaceted){let t=e;for(;!Sm(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)Ci(e)&&(e.data=Vp+e.data.replace(Vp,""))}}}(e):function(e){for(const t of e.children)$p(t);const t=e.component.scales;for(const n of J(t)){let i,o=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Ec(i,e.getWithExplicit("domains"),"domains","scale",om);const t=e.get("selectionExtent");o&&t&&o.selection!==t.selection&&si(Rn),o=t}}t[n].setWithExplicit("domains",i),o&&t[n].set("selectionExtent",o,!0)}}(e)}function Kp(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,o=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=im(t,n);if(!e)return void si(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=im(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return o!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:o}),"x"===t&&ua(i.x2)?ua(i.x)?Ec(em(n,o,e,"x"),em(n,o,e,"x2"),"domain","scale",om):em(n,o,e,"x2"):"y"===t&&ua(i.y2)?ua(i.y)?Ec(em(n,o,e,"y"),em(n,o,e,"y2"),"domain","scale",om):em(n,o,e,"y2"):em(n,o,e,t)}function Zp(e,t,n){var i;const o=null===(i=Di(n))||void 0===i?void 0:i.unit;return"temporal"===t||o?function(e,t,n){return e.map((e=>{const i=ga(e,{timeUnit:n,type:t});return{signal:"{data: ".concat(i,"}")}}))}(e,t,o):[e]}function em(e,t,n,i){const{encoding:o}=n,r=ua(o[i]),{type:a}=r,s=r.timeUnit;if(function(e){return e&&e.unionWith}(t)){const o=em(e,void 0,n,i),r=Zp(t.unionWith,a,s);return Dc([...o.value,...r])}if(Fi(t))return Dc([t]);if(t&&"unaggregated"!==t&&!xo(t))return Dc(Zp(t,a,s));const c=n.stack;if(c&&i===c.fieldChannel){if("normalize"===c.offset)return Fc([[0,1]]);const e=n.requestDataName(Mc.Main);return Fc([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const u=vn(i)&&qr(r)?function(e,t,n){if(!go(n))return;const i=e.fieldDef(t),o=i.sort;if(Sr(o))return{op:"min",field:vd(i,t),order:"ascending"};const{stack:r}=e,a=r?[...r.groupbyField?[r.groupbyField]:[],...r.stackBy.map((e=>e.fieldDef.field))]:void 0;if(Er(o)){return tm(o,r&&!T(a,o.field))}if(Cr(o)){const{encoding:t,order:n}=o,i=e.fieldDef(t),{aggregate:s,field:c}=i,u=r&&!T(a,c);if(Ce(s)||Ee(s))return tm({field:Kr(i),order:n},u);if(Se(s)||!s)return tm({op:s,field:c,order:n},u)}else{if("descending"===o)return{op:"min",field:e.vgField(t),order:"descending"};if(T(["ascending",void 0],o))return!0}return}(n,i,e):void 0;if(Wr(r)){return Fc(Zp([r.datum],a,s))}const f=r;if("unaggregated"===t){const e=n.requestDataName(Mc.Main),{field:t}=r;return Fc([{data:e,field:Kr({field:t,aggregate:"min"})},{data:e,field:Kr({field:t,aggregate:"max"})}])}if(Fn(f.bin)){if(go(e))return Fc("bin-ordinal"===e?[]:[{data:$(u)?n.requestDataName(Mc.Main):n.requestDataName(Mc.Raw),field:n.vgField(i,ya(f,i)?{binSuffix:"range"}:{}),sort:!0!==u&&l(u)?u:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=f;if(Fn(e)){const t=fp(n,f.field,e);return Fc([new Qp((()=>{const e=n.getSignalName(t);return"[".concat(e,".start, ").concat(e,".stop]")}))])}return Fc([{data:n.requestDataName(Mc.Main),field:n.vgField(i,{})}])}}if(f.timeUnit&&T(["time","utc"],e)&&jr(i,f,Em(n)?n.encoding[Mt(i)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(Mc.Main);return Fc([{data:e,field:n.vgField(i)},{data:e,field:n.vgField(i,{suffix:"end"})}])}return Fc(u?[{data:$(u)?n.requestDataName(Mc.Main):n.requestDataName(Mc.Raw),field:n.vgField(i),sort:u}]:[{data:n.requestDataName(Mc.Main),field:n.vgField(i)}])}function tm(e,t){const{op:n,field:i,order:o}=e;return{op:null!=n?n:t?"sum":Dr,...i?{field:re(i)}:{},...o?{order:o}:{}}}function nm(e,t){var n;const i=e.component.scales[t],o=e.specifiedScales[t].domain,r=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=xo(o)&&o,s=Cn(r)&&En(r.extent)&&r.extent;(a||s)&&i.set("selectionExtent",null!=a?a:s,!0)}function im(e,t){const{aggregate:n,type:i}=e;return n?x(n)&&!Oe[n]?{valid:!1,reason:$n(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:Kn(e)}:{valid:!0}:{valid:!1,reason:Qn(e)}}function om(e,t,n,i){return e.explicit&&t.explicit&&si(function(e,t,n,i){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(P(n)," and ").concat(P(i),"). Using the union of the two domains.")}(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function rm(e){const t=U(e.map((e=>{if(Ci(e)){const{sort:t,...n}=e;return n}return e})),j),n=U(e.map((e=>{if(Ci(e)){const t=e.sort;return void 0===t||$(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),j);if(0===t.length)return;if(1===t.length){const t=e[0];if(Ci(t)&&n.length>0){let e=n[0];if(n.length>1)si(ti),e=!0;else if(l(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}const i=U(n.map((e=>$(e)||!("op"in e)||x(e.op)&&e.op in ke?e:(si(function(e){return"Dropping sort property ".concat(P(e),' as unioned domains only support boolean or op "count", "min", and "max".')}(e)),!0))),j);let o;1===i.length?o=i[0]:i.length>1&&(si(ti),o=!0);const r=U(e.map((e=>Ci(e)?e.data:null)),(e=>e));if(1===r.length&&null!==r[0]){return{data:r[0],fields:t.map((e=>e.field)),...o?{sort:o}:{}}}return{fields:t,...o?{sort:o}:{}}}function am(e){if(Ci(e)&&x(e.field))return e.field;if(function(e){return!u(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(Ci(n)&&x(n.field))if(t){if(t!==n.field)return si("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return si("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!u(e)&&"fields"in e&&"data"in e}(e)){si("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return x(t)?t:void 0}}function sm(e,t){return rm(e.component.scales[t].get("domains").map((t=>(Ci(t)&&(t.data=e.lookupDataSource(t.data)),t))))}function cm(e){return _m(e)||Bm(e)?e.children.reduce(((e,t)=>e.concat(cm(t))),um(e)):um(e)}function um(e){return J(e.component.scales).reduce(((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const o=i.combine(),{name:r,type:a,selectionExtent:s,domains:c,range:u,reverse:f,...d}=o,p=function(e,t,n,i){if(en(n)){if(ki(e))return{step:{signal:t+"_step"}}}else if(l(e)&&Ci(e))return{...e,data:i.lookupDataSource(e.data)};return e}(o.range,r,n,e);let m;s&&(m=function(e,t){const n=t.selection;return{signal:nd(e.getSelectionComponent(n,K(n)),t)}}(e,s));const h=sm(e,n);return t.push({name:r,type:a,...h?{domain:h}:{},...m?{domainRaw:m}:{},range:p,...void 0!==f?{reverse:f}:{},...d}),t}),[])}class lm extends Ac{constructor(e,t){super({},{name:e}),Bn(this,"merged",!1),this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||L(this.get("domains"),(e=>u(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const fm=["range","scheme"];function dm(e){return"x"===e?"width":"y"===e?"height":void 0}function pm(e,t){const n=e.fieldDef(t);if(n&&n.bin&&Fn(n.bin)){const i=fp(e,n.field,n.bin),o=dm(t),r=e.getName(o);return new Qp((()=>{const t=e.getSignalName(i),n="(".concat(t,".stop - ").concat(t,".start) / ").concat(t,".step");return"".concat(e.getSignalName(r)," / (").concat(n,")")}))}}function mm(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const i of fm)if(void 0!==n[i]){const r=Bo(o,i),a=_o(e,i);if(r)if(a)si(a);else switch(i){case"range":{const i=n.range;if(u(i)){if(en(e))return Dc(i.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),i=t.getSignalName.bind(t);return Qp.fromName(i,n)}return e})))}else if(l(i))return Dc({data:t.requestDataName(Mc.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}});return Dc(i)}case"scheme":return Dc(hm(n[i]))}else si(Zn(o,i,e))}if(e===Me||e===Te){const t=e===Me?"width":"height",n=i[t];if(Os(n)){if(go(o))return Dc({step:n.step});si(ei(t))}}const{rangeMin:r,rangeMax:a}=n,s=function(e,t){const{size:n,config:i,mark:o,encoding:r}=t,a=t.getSignalName.bind(t),{type:s}=ua(r[e]),c=t.getScaleComponent(e).get("type"),{domain:l,domainMid:f}=t.specifiedScales[e];switch(e){case Me:case Te:{if(T(["point","band"],c))if(e!==Me||n.width){if(e===Te&&!n.height){const e=Ts(i.view,"height");if(Os(e))return e}}else{const e=Ts(i.view,"width");if(Os(e))return e}const o=dm(e),r=t.getName(o);return e===Te&&vo(c)?[Qp.fromName(a,r),0]:[0,Qp.fromName(a,r)]}case Ke:{const r=gm(o,t.component.scales[e].get("zero"),i),a=function(e,t,n,i){const o={x:pm(n,"x"),y:pm(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=ym(t,o,i.view);return b(e)?e-1:new Qp((()=>"".concat(e.signal," - 1")))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const e=ym(t,o,i.view);return b(e)?Math.pow(vm*e,2):new Qp((()=>"pow(".concat(vm," * ").concat(e.signal,", 2)")))}}throw new Error(Yn("size",e))}(o,n,t,i);return bo(c)?function(e,t,n){const i=()=>{const i=Ca(t),o=Ca(e),r="(".concat(i," - ").concat(o,") / (").concat(n," - 1)");return"sequence(".concat(o,", ").concat(i," + ").concat(r,", ").concat(r,")")};return Fi(t)?new Qp(i):{signal:i()}}(r,a,function(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&u(n)?n.length+1:(si(function(e){return"Domain for ".concat(e," is required for threshold scale.")}(i)),3)}}(c,i,l,e)):[r,a]}case Ue:return[0,2*Math.PI];case Ze:return[0,360];case Re:return[0,new Qp((()=>{const e=t.getSignalName("width"),n=t.getSignalName("height");return"min(".concat(e,",").concat(n,")/2")}))];case it:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case ot:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case $e:return"symbol";case Je:case Xe:case Qe:return"ordinal"===c?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===o||"geoshape"===o?"heatmap":"ramp";case et:case tt:case nt:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error("Scale range undefined for channel ".concat(e))}(e,t);return(void 0!==r||void 0!==a)&&Bo(o,"rangeMin")&&u(s)&&2===s.length?Dc([null!=r?r:s[0],null!=a?a:s[1]]):Fc(s)}function hm(e){return function(e){return!x(e)&&!!e.name}(e)?{scheme:e.name,...N(e,["name"])}:{scheme:e}}function gm(e,t,n){if(t)return Fi(t)?{signal:"".concat(t.signal," ? 0 : ").concat(gm(e,!1,n))}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Yn("size",e))}const vm=.95;function ym(e,t,n){const i=Os(e.width)?e.width.step:Ms(n,"width"),o=Os(e.height)?e.height.step:Ms(n,"height");return t.x||t.y?new Qp((()=>{const e=[t.x?t.x.signal:i,t.y?t.y.signal:o];return"min(".concat(e.join(", "),")")})):Math.min(i,o)}function bm(e,t){Em(e)?function(e,t){const n=e.component.scales,{config:i,encoding:o,markDef:r,specifiedScales:a}=e;for(const s of J(n)){const c=a[s],u=n[s],l=e.getScaleComponent(s),f=ua(o[s]),d=c[t],p=l.get("type"),m=l.get("padding"),h=l.get("paddingInner"),g=Bo(p,t),v=_o(s,t);if(void 0!==d&&(g?v&&si(v):si(Zn(p,t,s))),g&&void 0===v)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":ci(c[t])||"temporal"===n||e?u.set(t,{signal:ga(c[t],{type:n,timeUnit:e})},!0):u.set(t,c[t],!0);break;default:u.copyKeyFromObject(t,c)}}else{const n=t in xm?xm[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:p,scalePadding:m,scalePaddingInner:h,domain:c.domain,markDef:r,config:i}):i.scale[t];void 0!==n&&u.set(t,n,!1)}}}(e,t):Am(e,t)}const xm={bins:({model:e,fieldOrDatumDef:t})=>qr(t)?function(e,t){const n=t.bin;if(Fn(n)){const i=fp(e,t.field,n);return new Qp((()=>e.getSignalName(i)))}if(kn(n)&&Cn(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(T([Je,Xe,Qe],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var i;if((null===(i=ca(n))||void 0===i?void 0:i.bin)||T([Ki,Zi],e))return;return t in Kt||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:o})=>function(e,t,n,i,o,r){if(e in Kt){if(yo(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=o;if("bar"===t&&(!qr(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return r.continuousBandSize}if(t===io)return n.pointPadding}return}(e,t,o.scale,n,i,o.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:i})=>function(e,t,n,i){if(void 0!==e)return;if(t in Kt){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:o}=i;return ue(e,"bar"===n?t:o)}return}(e,t,n.type,i.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:i,scalePaddingInner:o,config:r})=>function(e,t,n,i,o,r){if(void 0!==e)return;if(t in Kt&&n===oo){const{bandPaddingOuter:e}=r;return ue(e,Fi(o)?{signal:"".concat(o.signal,"/2")}:o/2)}return}(e,t,n,i.type,o,r.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>function(e,t,n,i){if("x"===n&&void 0!==i.xReverse)return vo(e)&&"descending"===t?Fi(i.xReverse)?{signal:"!".concat(i.xReverse.signal)}:!i.xReverse:i.xReverse;if(vo(e)&&"descending"===t)return!0;return}(t,qr(e)?e.sort:void 0,n,i.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:o})=>function(e,t,n,i,o){if(n&&"unaggregated"!==n&&vo(o)){if(u(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!bo(o))return!0;if((!qr(t)||!t.bin)&&T([...Zt,...nn],e)){const{orient:t,type:n}=i;return!T(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,i,o)};function wm(e){Em(e)?function(e){const t=e.component.scales;for(const n of gn){const i=t[n];if(!i)continue;const o=mm(n,e);i.setWithExplicit("range",o)}}(e):Am(e,"range")}function Am(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?wm(n):bm(n,t);for(const i of J(n)){let o;for(const n of e.children){const e=n.component.scales[i];if(e){o=Ec(o,e.getWithExplicit(t),t,"scale",kc(((e,n)=>{switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0})))}}n[i].setWithExplicit(t,o)}}function Dm(e,t,n,i){const o=function(e,t,n){var i;switch(t.type){case"nominal":case"ordinal":if(yt(e)||"discrete"===An(e))return"shape"===e&&"ordinal"===t.type&&si(Xn(e,"ordinal")),"ordinal";if(e in Kt){if(T(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in tn)return"band";return void 0!==t.band||Jr(t)&&(null===(i=t.axis)||void 0===i?void 0:i.tickBand)?"band":"point";case"temporal":return yt(e)?"time":"discrete"===An(e)?(si(Xn(e,"temporal")),"ordinal"):qr(t)&&t.timeUnit&&Di(t.timeUnit).utc?"utc":"time";case"quantitative":return yt(e)?qr(t)&&Fn(t.bin)?"bin-ordinal":"linear":"discrete"===An(e)?(si(Xn(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Hn(t.type))}(t,n,i),{type:r}=e;return vn(t)?void 0!==r?function(e,t){if(!vn(e))return!1;switch(e){case Me:case Te:case Ue:case Re:return yo(t)||T(["band","point"],t);case Ke:case it:case et:case tt:case nt:case Ze:return yo(t)||bo(t)||T(["band","point","ordinal"],t);case Je:case Xe:case Qe:return"band"!==t;case ot:return"ordinal"===t||bo(t);case $e:return"ordinal"===t}}(t,r)?qr(n)&&(a=r,s=n.type,!(T([Ii,Gi],s)?void 0===a||go(a):s===Hi?T([Ki,Zi,void 0],a):s!==Ui||T([Ji,Xi,Qi,$i,eo,to,no,Yi,void 0],a)))?(si(function(e,t){return'FieldDef does not work with "'.concat(e,'" scale. We are using "').concat(t,'" scale instead.')}(r,o)),o):r:(si(function(e,t,n){return'Channel "'.concat(e,'" does not work with "').concat(t,'" scale. We are using "').concat(n,'" scale instead.')}(t,r,o)),o):o:null;var a,s}function Fm(e){Em(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return gn.reduce(((i,o)=>{const r=ua(t[o]);if(r&&n===Yo&&o===$e&&r.type===Vi)return i;let a=r&&r.scale;if(r&&null!==a&&!1!==a){var s;a=null!==(s=a)&&void 0!==s?s:{};const t=Dm(a,o,r,n);i[o]=new lm(e.scaleName(o+"",!0),{value:t,explicit:a.type===t})}return i}),{})}(e):e.component.scales=function(e){const t=e.component.scales={},n={},i=e.component.resolve;for(const t of e.children){Fm(t);for(const r of J(t.component.scales)){var o;if(i.scale[r]=null!==(o=i.scale[r])&&void 0!==o?o:qd(r,e),"shared"===i.scale[r]){const e=n[r],o=t.component.scales[r].getWithExplicit("type");e?ao(e.value,o.value)?n[r]=Ec(e,o,"type","scale",km):(i.scale[r]="independent",delete n[r]):n[r]=o}}}for(const i of J(n)){const o=e.scaleName(i,!0),r=n[i];t[i]=new lm(o,r);for(const t of e.children){const e=t.component.scales[i];e&&(t.renameScale(e.get("name"),o),e.merged=!0)}}return t}(e)}const km=kc(((e,t)=>co(e)-co(t)));class Cm{constructor(){Bn(this,"nameMap",void 0),this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function Em(e){return"unit"===(null==e?void 0:e.type)}function Sm(e){return"facet"===(null==e?void 0:e.type)}function Bm(e){return"concat"===(null==e?void 0:e.type)}function _m(e){return"layer"===(null==e?void 0:e.type)}class zm{constructor(e,t,n,i,o,r,a){var s,c;this.type=t,this.parent=n,this.config=o,Bn(this,"name",void 0),Bn(this,"size",void 0),Bn(this,"title",void 0),Bn(this,"description",void 0),Bn(this,"data",void 0),Bn(this,"transforms",void 0),Bn(this,"layout",void 0),Bn(this,"scaleNameMap",void 0),Bn(this,"projectionNameMap",void 0),Bn(this,"signalNameMap",void 0),Bn(this,"component",void 0),Bn(this,"view",void 0),Bn(this,"children",[]),Bn(this,"correctDataNames",(e=>(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e))),this.parent=n,this.config=o,this.view=Oo(a),this.name=null!==(s=e.name)&&void 0!==s?s:i,this.title=xa(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Cm,this.projectionNameMap=n?n.projectionNameMap:new Cm,this.signalNameMap=n?n.signalNameMap:new Cm,this.data=e.data,this.description=e.description,this.transforms=(null!==(c=e.transform)&&void 0!==c?c:[]).map((e=>Tc(e)?{filter:B(e.filter,Wi)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){const i=n[t],o={},{spacing:r,columns:a}=i;void 0!==r&&(o.spacing=r),void 0!==a&&(zr(e)&&!Br(e.facet)||Es(e))&&(o.columns=a),Ss(e)&&(o.columns=1);for(const t of Ps)if(void 0!==e[t])if("spacing"===t){var s,c;const n=e[t];o[t]=b(n)?n:{row:null!==(s=n.row)&&void 0!==s?s:r,column:null!==(c=n.column)&&void 0!==c?c:r}}else o[t]=e[t];return o}(e,t,o),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:zr(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new Ac,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...r?z(r):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){const t=J(e),n={text:Aa(e.text)};for(const i of t)n[i]=Aa(e[i]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){Fm(e),$p(e);for(const t of So)bm(e,t);t||wm(e)}(this)}parseProjection(){cp(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Kd(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(e=null===(t=this.view)||void 0===t?void 0:t.style)&&void 0!==e?e:"cell"}assembleEncodeFromView(e){const{style:t,...n}=e,i={};for(const e of J(n)){const t=n[e];void 0!==t&&(i[e]=Fa(t))}return i}assembleGroupEncodeEntry(e){let t={};var n;if((this.view&&(t=this.assembleEncodeFromView(this.view)),!e)&&(this.description&&(t.description=Fa(this.description)),"unit"===this.type||"layer"===this.type))return{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...null!==(n=t)&&void 0!==n?n:{}};return Y(t)?void 0:t}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:i}=this,o=function(e,t){const n={};for(const i of xt){const o=e[i];if(null==o?void 0:o.facetFieldDef){const{titleAnchor:e,titleOrient:r}=xd(["titleAnchor","titleOrient"],o.facetFieldDef.header,t,i),a=yd(i,r),s=zd(e,a);void 0!==s&&(n[a]=s)}}return Y(n)?void 0:n}(n.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...t,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of xt)e[n].title&&t.push(Dd(this,n));for(const e of wd)t=t.concat(Cd(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map((e=>rd(e,"grid",t))),...i.map((e=>rd(e,"grid",t))),...n.map((e=>rd(e,"main",t))),...i.map((e=>rd(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return ip(this)}assembleProjections(){return op(this)}assembleTitle(){var e;const{encoding:t,...n}=null!==(e=this.title)&&void 0!==e?e:{},i={...ba(this.config.title).nonMark,...n,...t?{encode:{update:t}}:{}};if(i.text){var o,r;if(T(["unit","layer"],this.type)){if(T(["middle",void 0],i.anchor))i.frame=null!==(o=i.frame)&&void 0!==o?o:"group"}else i.anchor=null!==(r=i.anchor)&&void 0!==r?r:"start";return Y(i)?void 0:i}}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Sm(this.parent)?cm(this):[];i.length>0&&(t.scales=i);const o=this.assembleAxes();o.length>0&&(t.axes=o);const r=this.assembleLegends();return r.length>0&&(t.legends=r),t}getName(e){return K((this.name?this.name+"_":"")+e)}getDataName(e){return this.getName(Mc[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(Sm(this.parent)){const t=on(Td(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(go(e)&&ki(i)){const e=n.get("name"),i=am(sm(this,t));if(i){return{signal:Md(e,n,Kr({aggregate:"distinct",field:i},{expr:"datum"}))}}return si(Mn(t)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):zt(e)&&vn(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error('Cannot find a selection named "'.concat(t,'".'));return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class Om extends zm{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Kr(n,t)}reduceFieldDef(e,t){return function(e,t,n,i){return e?J(e).reduce(((n,o)=>{const r=e[o];return u(r)?r.reduce(((e,n)=>t.call(i,e,n,o)),n):t.call(i,n,r,o)}),n):n}(this.getMapping(),((t,n,i)=>{const o=ca(n);return o?e(t,o,i):t}),t)}forEachFieldDef(e,t){Ha(this.getMapping(),((t,n)=>{const i=ca(t);i&&e(i,n)}),t)}}class Nm extends Hu{clone(){return new Nm(null,z(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=z(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"value",null!==(o=r[1])&&void 0!==o?o:"density"]}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform ".concat(j(this.transform))}assemble(){const{density:e,...t}=this.transform;return{type:"kde",field:e,...t}}}class Pm extends Hu{clone(){return new Pm(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:n,mark:i,markDef:o}=t;if("filter"!==Ba("invalid",o,n))return null;const r=t.reduceFieldDef(((e,n,o)=>{const r=vn(o)&&t.getScaleComponent(o);if(r){vo(r.get("type"))&&"count"!==n.aggregate&&!Jo(i)&&(e[n.field]=n)}return e}),{});return J(r).length?new Pm(e,r):null}dependentFields(){return new Set(J(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid ".concat(j(this.filter))}assemble(){const e=J(this.filter).reduce(((e,t)=>{const n=this.filter[t],i=Kr(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push("(isDate(".concat(i,") || (isValid(").concat(i,") && isFinite(+").concat(i,")))")):"quantitative"===n.type&&(e.push("isValid(".concat(i,")")),e.push("isFinite(+".concat(i,")")))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class jm extends Hu{clone(){return new jm(this.parent,z(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=z(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=i[t])&&void 0!==n?n:e}))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform ".concat(j(this.transform))}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class Mm extends Hu{clone(){return new Mm(null,z(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=z(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"key",null!==(o=r[1])&&void 0!==o?o:"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform ".concat(j(this.transform))}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Tm extends Hu{clone(){return new Tm(null,z(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[[Ge,He],[Ye,Ve]]){const o=i.map((e=>{const n=ua(t.encoding[e]);return qr(n)?n.field:Wr(n)?{expr:"".concat(n.datum)}:Vr(n)?{expr:"".concat(n.value)}:void 0}));(o[0]||o[1])&&(e=new Tm(e,o,null,t.getName("geojson_".concat(n++))))}if(t.channelHasField($e)){const i=t.typedFieldDef($e);i.type===Vi&&(e=new Tm(e,null,i.field,t.getName("geojson_".concat(n++))))}return e}constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(x);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return"GeoJSON ".concat(this.geojson," ").concat(this.signal," ").concat(j(this.fields))}assemble(){return{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}}}class Lm extends Hu{clone(){return new Lm(null,this.projection,z(this.fields),z(this.as))}constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[Ge,He],[Ye,Ve]]){const i=n.map((e=>{const n=ua(t.encoding[e]);return qr(n)?n.field:Wr(n)?{expr:"".concat(n.datum)}:Vr(n)?{expr:"".concat(n.value)}:void 0})),o=n[0]===Ye?"2":"";(i[0]||i[1])&&(e=new Lm(e,t.projectionName(),i,[t.getName("x"+o),t.getName("y"+o)]))}return e}dependentFields(){return new Set(this.fields.filter(x))}producedFields(){return new Set(this.as)}hash(){return"Geopoint ".concat(this.projection," ").concat(j(this.fields)," ").concat(j(this.as))}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class qm extends Hu{clone(){return new qm(null,z(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e,o=[t,n,...i?[i]:[]].join(",");return{signal:"sequence(".concat(o,")")}}static makeFromTransform(e,t){return new qm(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,o=n.y;if(qr(i)&&qr(o)){const r=i.impute?i:o.impute?o:void 0;if(void 0===r)return;const a=i.impute?o:o.impute?i:void 0,{method:s,value:c,frame:u,keyvals:l}=r.impute,f=Ga(t.mark,n);return new qm(e,{impute:r.field,key:a.field,...s?{method:s}:{},...void 0!==c?{value:c}:{},...u?{frame:u}:{},...void 0!==l?{keyvals:l}:{},...f.length?{groupby:f}:{}})}return null}hash(){return"Impute ".concat(j(this.transform))}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:o,value:r,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...n?{keyvals:(c=n,void 0!==(null==c?void 0:c.stop)?this.processSequence(n):n)}:{},method:"value",...o?{groupby:o}:{},value:i&&"value"!==i?null:r};var c;if(i&&"value"!==i){return[s,{type:"window",as:["imputed_".concat(e,"_value")],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},{type:"formula",expr:"datum.".concat(e," === null ? datum.imputed_").concat(e,"_value : datum.").concat(e),as:e}]}return[s]}}class Rm extends Hu{clone(){return new Rm(null,z(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=z(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:t.on,null!==(o=r[1])&&void 0!==o?o:t.loess]}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform ".concat(j(this.transform))}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class Wm extends Hu{clone(){return new Wm(null,z(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,i){const o=t.component.data.sources,{from:r}=n;let a=null;if(function(e){return"data"in e}(r)){let e=nh(r.data,o);e||(e=new Fp(r.data),o.push(e));const n=t.getName("lookup_".concat(i));a=new Gu(e,n,Mc.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"selection"in e}(r)){const e=r.selection;if(n={as:e,...n},a=t.getSelectionComponent(K(e),e).materialized,!a)throw new Error('Cannot define and lookup the "'.concat(e,'" selection in the same view. ')+"Try moving the lookup into a second, layered view?")}return new Wm(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?h(this.transform.as):this.transform.from.fields)}hash(){return"Lookup ".concat(j({transform:this.transform,secondary:this.secondary}))}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:h(this.transform.as)}:{}};else{let t=this.transform.as;x(t)||(si('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class Um extends Hu{clone(){return new Um(null,z(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=z(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"prob",null!==(o=r[1])&&void 0!==o?o:"value"]}dependentFields(){var e;return new Set([this.transform.quantile,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform ".concat(j(this.transform))}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class Im extends Hu{clone(){return new Im(null,z(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=z(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:t.on,null!==(o=r[1])&&void 0!==o?o:t.regression]}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform ".concat(j(this.transform))}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class Hm extends Hu{clone(){return new Hm(null,z(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){var t;this.transform.groupby=U((null!==(t=this.transform.groupby)&&void 0!==t?t:[]).concat(e),(e=>e))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return"PivotTransform ".concat(j(this.transform))}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==i?{limit:i}:{},...void 0!==o?{op:o}:{},...void 0!==n?{groupby:n}:{}}}}class Gm extends Hu{clone(){return new Gm(null,z(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform ".concat(j(this.transform))}assemble(){return{type:"sample",size:this.transform.sample}}}function Vm(e){let t=0;return function n(i,o){if(i instanceof Fp&&!i.isGenerator&&!Bc(i.data)){e.push(o);o={name:null,source:o.name,transform:[]}}var r;if(i instanceof xp&&(i.parent instanceof Fp&&!o.source?(o.format={...null!==(r=o.format)&&void 0!==r?r:{},parse:i.assembleFormatParse()},o.transform.push(...i.assembleTransforms(!0))):o.transform.push(...i.assembleTransforms())),i instanceof gp){o.name||(o.name="data_".concat(t++)),!o.source||o.transform.length>0?(e.push(o),i.data=o.name):i.data=o.source;for(const t of i.assemble())e.push(t)}else{if((i instanceof Ap||i instanceof Dp||i instanceof Pm||i instanceof ed||i instanceof gd||i instanceof Lm||i instanceof Tm||i instanceof hp||i instanceof Wm||i instanceof Ip||i instanceof Wp||i instanceof Mm||i instanceof jm||i instanceof Nm||i instanceof Rm||i instanceof Um||i instanceof Im||i instanceof wp||i instanceof Gm||i instanceof Hm)&&o.transform.push(i.assemble()),(i instanceof pp||i instanceof Vu||i instanceof qm||i instanceof Up)&&o.transform.push(...i.assemble()),i instanceof Gu)if(o.source&&0===o.transform.length)i.setSource(o.source);else if(i.parent instanceof Gu)i.setSource(o.name);else if(o.name||(o.name="data_".concat(t++)),i.setSource(o.name),1===i.numChildren()){e.push(o);o={name:null,source:o.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof Gu&&(!o.source||o.transform.length>0)&&e.push(o);break;case 1:n(i.children[0],o);break;default:{o.name||(o.name="data_".concat(t++));let r=o.name;!o.source||o.transform.length>0?e.push(o):r=o.source;for(const e of i.children){n(e,{name:null,source:r,transform:[]})}break}}}}}function Ym(e){return"top"===e||"left"===e||Fi(e)?"header":"footer"}function Jm(e,t){const{facet:n,config:i,child:o,component:r}=e;if(e.channelHasField(t)){var a;const s=n[t],c=bd("title",null,i,t);let l=oa(s,i,{allowDisabling:!0,includeDefault:void 0===c||!!c});o.component.layoutHeaders[t].title&&(l=u(l)?l.join(", "):l,l+=" / "+o.component.layoutHeaders[t].title,o.component.layoutHeaders[t].title=null);const f=bd("labelOrient",s,i,t),d=ue((null!==(a=s.header)&&void 0!==a?a:{}).labels,i.header.labels,!0),p=T(["bottom","right"],f)?"footer":"header";r.layoutHeaders[t]={title:l,facetFieldDef:s,[p]:"facet"===t?[]:[Xm(e,t,d)]}}}function Xm(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function Qm(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:o,resolve:r}=e.component;if(r.axis[t]=Rd(r,t),"shared"===r.axis[t]){const r="x"===t?"column":"row",a=o[r];for(const o of n.component.axes[t]){var i;const t=Ym(o.get("orient"));a[t]=null!==(i=a[t])&&void 0!==i?i:[Xm(e,r,!1)];const n=rd(o,"main",e.config,{header:!0});n&&a[t][0].axes.push(n),o.mainExtracted=!0}}}}function $m(e){for(const t of e.children)t.parseLayoutSize()}function Km(e,t){const n=Td(t),i=on(n),o=e.component.resolve,r=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),r=o.scale[i];if("independent"===r&&"step"===e.value){a=void 0;break}if(a){if("independent"===r&&a.value!==e.value){a=void 0;break}a=Ec(a,e,n,"")}else a=e}if(a){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);r.setWithExplicit(t,a)}else r.setWithExplicit(t,{explicit:!1,value:void 0})}function Zm(e,t){const n="width"===t?"x":"y",i=e.config,o=e.getScaleComponent(n);if(o){const e=o.get("type"),n=o.get("range");if(go(e)){const e=Ts(i.view,t);return ki(n)||Os(e)?"step":e}return js(i.view,t)}if(e.hasProjection||"arc"===e.mark)return js(i.view,t);{const e=Ts(i.view,t);return Os(e)?e.step:e}}function eh(e,t,n){return Kr(t,{suffix:"by_".concat(Kr(e)),...null!=n?n:{}})}class th extends Om{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),Bn(this,"facet",void 0),Bn(this,"child",void 0),Bn(this,"children",void 0),this.child=Eh(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!Br(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=J(e),n={};for(const i of t){if(!T([Ne,Pe],i)){si(Yn(i,"facet"));break}const t=e[i];if(void 0===t.field){si(Vn(t,i));break}n[i]=this.initFacetFieldDef(t,i)}return n}initFacetFieldDef(e,t){const{header:n,...i}=e,o=da(i,t);return n&&(o.header=Oo(n)),o}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=ih(this),this.child.parseData()}parseLayoutSize(){$m(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of xt)Jm(e,t);Qm(e,"x"),Qm(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const o of xt)for(const r of Ad){const a=this.component.layoutHeaders[o],s=a[r],{facetFieldDef:c}=a;if(c){const n=bd("titleOrient",c.header,this.config,o);if(T(["right","bottom"],n)){var t;const i=yd(o,n);e.titleAnchor=null!==(t=e.titleAnchor)&&void 0!==t?t:{},e.titleAnchor[i]="end"}}if(null==s?void 0:s[0]){const t="row"===o?"height":"width",s="header"===r?"headerBand":"footerBand";var n,i;if("facet"!==o&&!this.child.component.layoutSize.get(t))e[s]=null!==(n=e[s])&&void 0!==n?n:{},e[s][o]=.5;if(a.title)e.offset=null!==(i=e.offset)&&void 0!==i?i:{},e.offset["row"===o?"rowTitle":"columnTitle"]=10}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof th)){const e=this.getName("column_domain");return{signal:"length(data('".concat(e,"'))")}}}assembleGroup(e){return this.parent&&this.parent instanceof th?{...this.channelHasField("column")?{encode:{update:{columns:{field:Kr(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof th){if(this.child.channelHasField("column")){const i=Kr(this.child.facet.column);e.push(i),t.push("distinct"),n.push("distinct_".concat(i))}}else for(const i of Zt){const o=this.child.component.scales[i];if(o&&!o.merged){const r=o.get("type"),a=o.get("range");if(go(r)&&ki(a)){const o=am(sm(this.child,i));o?(e.push(o),t.push("distinct"),n.push("distinct_".concat(o))):si(Mn(i))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:o,ops:r,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const e of xt){const t=this.facet[e];if(t){s.push(Kr(t));const{bin:c,sort:l}=t;if(Fn(c)&&s.push(Kr(t,{binSuffix:"end"})),Er(l)){const{field:e,op:s=Dr}=l,c=eh(t,l);n&&i?(o.push(c),r.push("max"),a.push(c)):(o.push(e),r.push(s),a.push(c))}else if(u(l)){const n=vd(t,e);o.push(n),r.push("max"),a.push(n)}}}const c=!!n&&!!i;return{name:e,data:t,groupby:s,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:r,as:a}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,n=t[e];return n?Er(n.sort)?[eh(n,n.sort,{expr:"datum"})]:u(n.sort)?[vd(n,e,{expr:"datum"})]:[Kr(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(Er(e)?e.order:!u(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return Sd(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const o of wd)if(e[o]){var i;const r=bd("labelOrient",null===(i=e[o])||void 0===i?void 0:i.header,t,o);if(T(n[o],r))return Sd(e[o],o,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=Vm(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),o=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:xt.map((e=>this.facetSortFields(e))).flat(),order:xt.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(ml(this,[]))}]}getMapping(){return this.facet}}function nh(e,t){for(const a of t){var n,i,o,r;const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,c=null===(i=t.format)||void 0===i?void 0:i.feature;if(s&&c)continue;const u=null===(o=e.format)||void 0===o?void 0:o.feature;if((u||c)&&u!==c)continue;const l=null===(r=t.format)||void 0===r?void 0:r.mesh;if(!s&&!l||s===l)if(_c(e)&&_c(t)){if(_(e.values,t.values))return a}else if(Bc(e)&&Bc(t)){if(e.url===t.url)return a}else if(zc(e)&&e.name===a.dataName)return a}return null}function ih(e){var t,n,i;let o=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new Fp({values:[]});return t.push(e),e}const n=nh(e.data,t);if(n)return Oc(e.data)||(n.data.format=R({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new Fp(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:r,outputNodeRefCounts:a}=e.component.data,s=e.parent?e.parent.component.data.ancestorParse.clone():new Sc,c=e.data;Oc(c)?(Nc(c)?o=new Dp(o,c.sequence):jc(c)&&(o=new Ap(o,c.graticule)),s.parseNothing=!0):null===(null==c||null===(t=c.format)||void 0===t?void 0:t.parse)&&(s.parseNothing=!0),o=null!==(n=xp.makeExplicit(o,e,s))&&void 0!==n?n:o,o=new wp(o);const u=e.parent&&_m(e.parent);var l;(Em(e)||Sm(e))&&(u&&(o=null!==(l=pp.makeFromEncoding(o,e))&&void 0!==l?l:o));e.transforms.length>0&&(o=function(e,t,n){let i=0;for(const a of t.transforms){let s,c=void 0;if(Jc(a))s=e=new gd(e,a),c="derived";else if(Tc(a)){var o;const i=yp(a);s=e=null!==(o=xp.makeWithAncestors(e,{},i,n))&&void 0!==o?o:e,e=new ed(e,t,a.filter)}else if(Xc(a))s=e=pp.makeFromTransform(e,a,t),c="number";else if($c(a))c="date",void 0===n.getWithExplicit(a.field).value&&(e=new xp(e,{[a.field]:c}),n.set(a.field,c,!1)),s=e=Vu.makeFromTransform(e,a);else if(Kc(a))s=e=hp.makeFromTransform(e,a),c="number",zl(t)&&(e=new wp(e));else if(Lc(a))s=e=Wm.make(e,t,a,i++),c="derived";else if(Gc(a))s=e=new Ip(e,a),c="number";else if(Vc(a))s=e=new Wp(e,a),c="number";else if(Zc(a))s=e=Up.makeFromTransform(e,a),c="derived";else if(eu(a))s=e=new Mm(e,a),c="derived";else if(Yc(a))s=e=new jm(e,a),c="derived";else if(qc(a))s=e=new Hm(e,a),c="derived";else if(Hc(a))e=new Gm(e,a);else if(Qc(a))s=e=qm.makeFromTransform(e,a),c="derived";else if(Rc(a))s=e=new Nm(e,a),c="derived";else if(Wc(a))s=e=new Um(e,a),c="derived";else if(Uc(a))s=e=new Im(e,a),c="derived";else{if(!Ic(a)){si("Ignoring an invalid transform: ".concat(P(a),"."));continue}s=e=new Rm(e,a),c="derived"}if(s&&void 0!==c)for(const e of null!==(r=s.producedFields())&&void 0!==r?r:[]){var r;n.set(e,c,!1)}}return e}(o,e,s));const f=function(e){const t={};if(Em(e)&&e.component.selection)for(const n of J(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&ce(e.field)>1&&(t[e.field]="flatten")}return t}(e),d=bp(e);if(o=null!==(i=xp.makeWithAncestors(o,{},{...f,...d},s))&&void 0!==i?i:o,Em(e)&&(o=Tm.parseAll(o,e),o=Lm.parseAll(o,e)),Em(e)||Sm(e)){var p,m;if(!u)o=null!==(m=pp.makeFromEncoding(o,e))&&void 0!==m?m:o;o=null!==(p=Vu.makeFromEncoding(o,e))&&void 0!==p?p:o,o=gd.parseAllForSortIndex(o,e)}const h=e.getDataName(Mc.Raw),g=new Gu(o,h,Mc.Raw,a);if(r[h]=g,o=g,Em(e)){var v,y;const t=hp.makeFromEncoding(o,e);t&&(o=t,zl(e)&&(o=new wp(o))),o=null!==(v=qm.makeFromEncoding(o,e))&&void 0!==v?v:o,o=null!==(y=Up.makeFromEncoding(o,e))&&void 0!==y?y:o}var b;Em(e)&&(o=null!==(b=Pm.make(o,e))&&void 0!==b?b:o);const x=e.getDataName(Mc.Main),w=new Gu(o,x,Mc.Main,a);r[x]=w,o=w,Em(e)&&function(e,t){Bl(e,(n=>{const i=n.name,o=e.getName("lookup_".concat(i));e.component.data.outputNodes[o]=n.materialized=new Gu(new ed(t,e,{selection:i}),o,Mc.Lookup,e.component.data.outputNodeRefCounts)}))}(e,w);let A=null;if(Sm(e)){var D;const t=e.getName("facet");o=null!==(D=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const o of[n,i])if(Er(o.sort)){const{field:n,op:i=Dr}=o.sort;e=t=new Wp(e,{joinaggregate:[{op:i,field:n,as:eh(o,o.sort,{forAs:!0})}],groupby:[Kr(o)]})}return t}return null}(o,e.facet))&&void 0!==D?D:o,A=new gp(o,e,t,w.getSource()),r[t]=A}return{...e.component.data,outputNodes:r,outputNodeRefCounts:a,raw:g,main:w,facetRoot:A,ancestorParse:s}}class oh extends zm{constructor(e,t,n,i){var o,r,a,s;super(e,"concat",t,n,i,e.resolve),Bn(this,"children",void 0),"shared"!==(null===(o=e.resolve)||void 0===o||null===(r=o.axis)||void 0===r?void 0:r.x)&&"shared"!==(null===(a=e.resolve)||void 0===a||null===(s=a.axis)||void 0===s?void 0:s.y)||si("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>Eh(e,this,this.getName("concat_"+t),void 0,i)))}parseData(){this.component.data=ih(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of J(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return Ss(e)?e.vconcat:Bs(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){$m(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";Km(e,t),Km(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=Nd(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}}))}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}const rh={disable:1,gridScale:1,scale:1,...xe,labelExpr:1,encode:1},ah=J(rh);class sh extends Ac{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new sh(z(this.explicit),z(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return Fi(this.explicit.orient)}}const ch={bottom:"top",top:"bottom",left:"right",right:"left"};function uh(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const n=e[i],o=t[i];if(!!n!=!!o)return;if(n&&o){const t=n.getWithExplicit("orient"),r=o.getWithExplicit("orient");if(t.explicit&&r.explicit&&t.value!==r.value)return;e[i]=lh(n,o)}}}return e}function lh(e,t){for(const n of ah){const i=Ec(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",((e,t)=>{switch(n){case"title":return Ma(e,t);case"gridScale":return{explicit:e.explicit,value:ue(e.value,t.value)}}return Cc(e,t,n,"axis")}));e.setWithExplicit(n,i)}return e}function fh(e,t,n,i,o){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Fi(n.labelAngle)?n.labelAngle:me(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===hd(i,o))return!0}return e===n[t]}const dh=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ph(e,t){var n,i,o,r,a;let s=t.axis(e);const c=new sh,u=ua(t.encoding[e]),{mark:l,config:f}=t,d=(null===(n=s)||void 0===n?void 0:n.orient)||(null===(i=f["x"===e?"axisX":"axisY"])||void 0===i?void 0:i.orient)||(null===(o=f.axis)||void 0===o?void 0:o.orient)||function(e){return"x"===e?"bottom":"left"}(e),p=t.getScaleComponent(e).get("type"),m=cd(e,p,d,t.config),h=void 0!==s?!s:ld("disable",f.style,null===(r=s)||void 0===r?void 0:r.style,m).configValue;if(c.set("disable",h,void 0!==s),h)return c;s=s||{};const g=function(e,t,n,i,o){const r=null==t?void 0:t.labelAngle;if(void 0!==r)return Fi(r)?r:me(r);{const{configValue:r}=ld("labelAngle",i,null==t?void 0:t.style,o);return void 0!==r?me(r):n!==Me||!T([Gi,Ii],e.type)||qr(e)&&e.timeUnit?void 0:270}}(u,s,e,f.style,m),v={fieldOrDatumDef:u,axis:s,channel:e,model:t,scaleType:p,orient:d,labelAngle:g,mark:l,config:f};for(const n of ah){const i=n in fd?fd[n](v):Ae(n)?s[n]:void 0,o=void 0!==i,r=fh(i,n,s,t,e);if(o&&r)c.set(n,i,r);else{const{configValue:e,configFrom:t}=Ae(n)&&"values"!==n?ld(n,f.style,s.style,m):{},a=void 0!==e;o&&!a?c.set(n,i,r):("vgAxisConfig"!==t||dh.has(n)&&a||ve(e)||Fi(e))&&c.set(n,e,!1)}}const y=null!==(a=s.encoding)&&void 0!==a?a:{},b=ye.reduce(((n,i)=>{var o;if(!c.hasAxisPart(i))return n;const r=Ld(null!==(o=y[i])&&void 0!==o?o:{},t),a="labels"===i?function(e,t,n){var i;const{encoding:o,config:r}=e,a=null!==(i=ua(o[t]))&&void 0!==i?i:ua(o[Mt(t)]),s=e.axis(t)||{},{format:c,formatType:u}=s;return dr(u)?{text:gr({fieldOrDatumDef:a,field:"datum.value",format:c,formatType:u,config:r}),...n}:n}(t,e,r):r;return void 0===a||Y(a)||(n[i]={update:a}),n}),{});return Y(b)||c.set("encode",b,!!s.encoding||void 0!==s.labelAngle),c}function mh(e,t,n){const i=Oo(e),o=Ba("orient",i,n);var r,a;if(i.orient=function(e,t,n){switch(e){case qo:case Go:case Vo:case Uo:case Ro:case To:return}const{x:i,y:o,x2:r,y2:a}=t;switch(e){case Mo:if(qr(i)&&(kn(i.bin)||qr(o)&&o.aggregate&&!i.aggregate))return"vertical";if(qr(o)&&(kn(o.bin)||qr(i)&&i.aggregate&&!o.aggregate))return"horizontal";if(a||r){if(n)return n;if(!r&&(qr(i)&&i.type===Ui&&!Fn(i.bin)||Ir(i)))return"horizontal";if(!a&&(qr(o)&&o.type===Ui&&!Fn(o.bin)||Ir(o)))return"vertical"}case Wo:if(r&&(!qr(i)||!kn(i.bin))&&a&&(!qr(o)||!kn(o.bin)))return;case jo:if(a)return qr(o)&&kn(o.bin)?"horizontal":"vertical";if(r)return qr(i)&&kn(i.bin)?"vertical":"horizontal";if(e===Wo){if(i&&!o)return"vertical";if(o&&!i)return"horizontal"}case Lo:case Io:{const t=Ur(i),r=Ur(o);if(t&&!r)return"tick"!==e?"horizontal":"vertical";if(!t&&r)return"tick"!==e?"vertical":"horizontal";if(t&&r){const t=i,r=o,a=t.type===Hi,s=r.type===Hi;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&r.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!r.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(i.type,t,o),void 0!==o&&o!==i.orient&&si((r=i.orient,a=o,'Specified orient "'.concat(r,'" overridden with "').concat(a,'".'))),"bar"===i.type&&i.orient){const e=Ba("cornerRadiusEnd",i,n);if(void 0!==e){const n="horizontal"===i.orient&&t.x2||"vertical"===i.orient&&t.y2?["cornerRadius"]:tr[i.orient];for(const t of n)i[t]=e;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===Ba("opacity",i,n)&&(i.opacity=function(e,t){if(T([qo,Io,Go,Vo],e)&&!Ra(t))return.7;return}(i.type,t));return void 0===Ba("cursor",i,n)&&(i.cursor=function(e,t,n){if(t.href||e.href||Ba("href",e,n))return"pointer";return e.cursor}(i,t,n)),i}function hh(e,t){const{config:n}=e;return{...Tu(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Fu("x",e,{defaultPos:"mid"}),...Fu("y",e,{defaultPos:"mid"}),...xu("size",e),...xu("angle",e),...gh(e,n,t)}}function gh(e,t,n){return n?{shape:{value:n}}:xu("shape",e)}function vh(e,t,n){if(void 0===Ba("align",e,n))return"center"}function yh(e,t,n){if(void 0===Ba("baseline",e,n))return"middle"}function bh(e){var t;const{config:n,markDef:i}=e,{orient:o}=i,r="horizontal"===o?"width":"height",a=e.getScaleComponent("horizontal"===o?"x":"y"),s=null!==(t=Ba("size",i,n,{vgChannel:r}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==s)return s;{const e=a?a.get("range"):void 0;if(e&&ki(e)&&b(e.step))return 3*e.step/4;return 3*Ms(n.view,r)/4}}const xh={arc:{vgMark:"arc",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Fu("x",e,{defaultPos:"mid"}),...Fu("y",e,{defaultPos:"mid"}),...Ou(e,"radius","arc"),...Ou(e,"theta","arc")})},area:{vgMark:"area",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Bu("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...Bu("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...Ru(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ou(e,"x","bar"),...Ou(e,"y","bar")})},circle:{vgMark:"symbol",encodeEntry:e=>hh(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&qr(n)&&n.type===Vi?{field:Kr(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Ou(e,"x","image"),...Ou(e,"y","image"),...du(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Fu("x",e,{defaultPos:"mid"}),...Fu("y",e,{defaultPos:"mid"}),...xu("size",e,{vgChannel:"strokeWidth"}),...Ru(e)})},point:{vgMark:"symbol",encodeEntry:e=>hh(e)},rect:{vgMark:"rect",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ou(e,"x","rect"),...Ou(e,"y","rect")})},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...Tu(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Bu("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Bu("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...xu("size",e,{vgChannel:"strokeWidth"})}:{}}},square:{vgMark:"symbol",encodeEntry:e=>hh(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Tu(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Fu("x",e,{defaultPos:"mid"}),...Fu("y",e,{defaultPos:"mid"}),...du(e),...xu("size",e,{vgChannel:"fontSize"}),...xu("angle",e),...Wu("align",vh(e.markDef,n,t)),...Wu("baseline",yh(e.markDef,n,t)),...Fu("radius",e,{defaultPos:null,isMidPoint:!0}),...Fu("theta",e,{defaultPos:null,isMidPoint:!0})}}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,o="horizontal"===i?"width":"height",r="horizontal"===i?"height":"width";return{...Tu(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Fu("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Fu("y",e,{defaultPos:"mid",vgChannel:"yc"}),...xu("size",e,{defaultValue:bh(e),vgChannel:o}),[r]:Fa(Ba("thickness",n,t))}}},trail:{vgMark:"trail",encodeEntry:e=>({...Tu(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Fu("x",e,{defaultPos:"mid"}),...Fu("y",e,{defaultPos:"mid"}),...xu("size",e),...Ru(e)})}};function wh(e){if(T([Lo,jo,Ho],e.mark)){const t=Ga(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Ah+e.requestDataName(Mc.Main),data:e.requestDataName(Mc.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Fh(e,{fromPrefix:Ah})}]}(e,t)}else if(T([Mo],e.mark)){const t=Bi.some((t=>Ba(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=Fh(e,{fromPrefix:Dh}),n=e.scaleName(e.stack.fieldChannel),i=(t={})=>e.vgField(e.stack.fieldChannel,t),o=(e,t)=>{const o=[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})];return"".concat(e,"(").concat(o.map((e=>"scale('".concat(n,"',").concat(e,")"))).join(","),")")};let r,a;"x"===e.stack.fieldChannel?(r={...O(t.encode.update,["y","yc","y2","height",...Bi]),x:{signal:o("min","datum")},x2:{signal:o("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...N(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(r={...O(t.encode.update,["x","xc","x2","width"]),y:{signal:o("min","datum")},y2:{signal:o("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...N(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const n of Bi){const i=_a(n,e.markDef,e.config);t.encode.update[n]?(r[n]=t.encode.update[n],delete t.encode.update[n]):i&&(r[n]=Fa(i)),i&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),c=Kr(s)?[Kr(s)]:[];((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&c.push(Kr(s,{binSuffix:"end"}));r=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,i)=>{if(t.encode.update[i])return{...n,[i]:t.encode.update[i]};{const t=_a(i,e.markDef,e.config);return void 0!==t?{...n,[i]:Fa(t)}:n}}),r),r.stroke&&(r.strokeForeground={value:!0},r.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(Mc.Main),name:Dh+e.requestDataName(Mc.Main),groupby:c,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:r},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return Fh(e)}const Ah="faceted_path_";const Dh="stack_group_";function Fh(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:o,config:r}=e,a=ue(i.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=Sa(i),c=o.key,l=function(e){const{encoding:t,stack:n,mark:i,markDef:o,config:r}=e,a=t.order;if(!(!u(a)&&Vr(a)&&M(a.value)||!a&&M(Ba("order",o,r)))){if((u(a)||qr(a))&&!n)return Na(a,{expr:"datum"});if(Jo(i)){const n="horizontal"===o.orient?"y":"x",i=t[n];if(qr(i)){const t=i.sort;return u(t)?{field:Kr(i,{prefix:n,suffix:"sort_index",expr:"datum"})}:Er(t)?{field:Kr({aggregate:Ra(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:Cr(t)?{field:Kr(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:Kr(i,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}}}(e),f=function(e){if(!e.component.selection)return null;const t=J(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=J(i.component.selection).length,i=i.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),d=Ba("aria",i,r),p=xh[n].postEncodingTransform?xh[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:xh[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...f||{},...!1===d?{aria:d}:{},from:{data:t.fromPrefix+e.requestDataName(Mc.Main)},encode:{update:xh[n].encodeEntry(e)},...p?{transform:p}:{}}]}class kh extends Om{constructor(e,t,n,i={},o){super(e,"unit",t,n,o,void 0,Ns(e)?e.view:void 0),Bn(this,"markDef",void 0),Bn(this,"encoding",void 0),Bn(this,"specifiedScales",{}),Bn(this,"stack",void 0),Bn(this,"specifiedAxes",{}),Bn(this,"specifiedLegends",{}),Bn(this,"specifiedProjection",{}),Bn(this,"selection",{}),Bn(this,"children",[]);const r=$o(e.mark)?{...e.mark}:{type:e.mark},a=r.type;void 0===r.filled&&(r.filled=function(e,t,{graticule:n}){if(n)return!1;const i=_a("filled",e,t),o=e.type;return ue(i,o!==qo&&o!==Lo&&o!==Wo)}(r,o,{graticule:e.data&&jc(e.data)}));const s=this.encoding=Ua(e.encoding||{},a,r.filled,o);this.markDef=mh(r,s,o),this.size=function({encoding:e,size:t}){for(const n of Zt){const i=Tt(n);Os(t[i])&&Ur(e[n])&&(delete t[i],si(ei(i)))}return t}({encoding:s,size:Ns(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=nc(a,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===Yo,n=e&&gt.some((t=>Hr(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return gn.reduce(((e,n)=>{const i=ua(t[n]);var o;i&&(e[n]=this.initScale(null!==(o=i.scale)&&void 0!==o?o:{}));return e}),{})}initScale(e){const{domain:t,range:n}=e,i=Oo(e);return u(t)&&(i.domain=t.map(Aa)),u(n)&&(i.range=n.map(Aa)),i}initAxes(e){return Zt.reduce(((t,n)=>{const i=e[n];if(Hr(i)||n===Me&&Hr(e.x2)||n===Te&&Hr(e.y2)){const e=Hr(i)?i.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=J(e),n={};for(const i of t){const t=e[i];n[i]=ve(t)?wa(t):Aa(t)}return n}initLegends(e){return mn.reduce(((t,n)=>{const i=ua(e[n]);if(i&&function(e){switch(e){case Je:case Xe:case Qe:case Ke:case $e:case et:case it:case ot:return!0;case tt:case nt:case Ze:return!1}}(n)){const e=i.legend;t[n]=e?Oo(e):e}return t}),{})}parseData(){this.component.data=ih(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of Zt){const o=Tt(i);if(t[o]){const e=t[o];n.layoutSize.set(o,Os(e)?"step":e,!0)}else{const t=Zm(e,o);n.layoutSize.set(o,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){const n={},i=e.config.selection;for(const r of J(null!=t?t:{})){const a=z(t[r]),{fields:s,encodings:c,...u}=i[a.type];for(const e in u){var o;"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]={...u[e],...a[e]}),(void 0===a[e]||!0===a[e])&&(a[e]=null!==(o=u[e])&&void 0!==o?o:a[e]))}const l=K(r),f=n[l]={...a,name:l,events:x(a.on)?su(a.on,"scope"):z(a.on)};dl(f,(n=>{n.has(f)&&n.parse&&n.parse(e,f,a,t[r])}))}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=wh(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,Zt.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[ph(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;Bl(e,((i,o)=>{const r=i.name,a=w(r+Fl);if(0===t.filter((e=>e.name===r)).length){const e="global"===i.resolve?"union":i.resolve,n="multi"===i.type?", true)":")";t.push({name:i.name,update:"".concat(El,"(").concat(a,", ").concat(w(e)).concat(n)})}n=!0,o.topLevelSignals&&(t=o.topLevelSignals(e,i,t)),dl(i,(n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,i,t))}))})),n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return gl(t)}(this,e)}assembleSignals(){return[...ad(this),...(e=this,t=[],Bl(e,((n,i)=>{const o=n.name;let r=i.modifyExpr(e,n);t.push(...i.signals(e,n)),dl(n,(i=>{i.signals&&(t=i.signals(e,n,t)),i.modifyExpr&&(r=i.modifyExpr(e,n,r))})),t.push({name:o+Cl,on:[{events:{signal:n.name+kl},update:"modify(".concat(w(n.name+Fl),", ").concat(r,")")}]})})),gl(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return Bl(e,(t=>{const i={name:t.name+Fl};if(t.init){const n=t.project.items.map((e=>{const{signals:t,...n}=e;return n})),o=t.init.map((e=>pl(e,!1)));i.values="interval"===t.type?[{unit:_l(e,{escape:!1}),fields:n,values:o}]:o.map((t=>({unit:_l(e,{escape:!1}),fields:n,values:t})))}n.filter((e=>e.name===t.name+Fl)).length||n.push(i)})),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Nd(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&_m(this.parent)||(t=hl(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return qa(this.encoding,e)}fieldDef(e){return ca(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Gr(t)?t:null}}class Ch extends zm{constructor(e,t,n,i,o){super(e,"layer",t,n,o,e.resolve,e.view),Bn(this,"children",void 0);const r={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if($s(e))return new Ch(e,this,this.getName("layer_"+t),r,o);if(Ta(e))return new kh(e,this,this.getName("layer_"+t),r,o);throw new Error(zn(e))}))}parseData(){this.component.data=ih(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;$m(e=this),Km(e,"width"),Km(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of J(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of J(i.component.axes))n.axis[o]=Rd(e.component.resolve,o),"shared"===n.axis[o]&&(t[o]=uh(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of Zt){for(const a of e.children)if(a.component.axes[r]){if("independent"===n.axis[r]){var o;t[r]=(null!==(o=t[r])&&void 0!==o?o:[]).concat(a.component.axes[r]);for(const e of a.component.axes[r]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!Fi(t)){if(i[t]>0&&!n){const n=ch[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[r]}if("independent"===n.axis[r]&&t[r]&&t[r].length>1)for(const e of t[r])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),ad(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),Nd(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Em(n)&&(t=hl(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),ip(this))}}function Eh(e,t,n,i,o){if(zr(e))return new th(e,t,n,o);if($s(e))return new Ch(e,t,n,i,o);if(Ta(e))return new kh(e,t,n,i,o);if(function(e){return Ss(e)||Bs(e)||Es(e)}(e))return new oh(e,t,n,o);throw new Error(zn(e))}e.accessPathDepth=ce,e.accessPathWithDatum=ne,e.compile=function(e,t={}){var n;t.logger&&(n=t.logger,ai=n),t.fieldTitle&&ia(t.fieldTitle);try{const n=Gs(d(t.config,e.config)),i=bc(e,n),o=Eh(i,null,"",void 0,n);o.parse(),function(e,t){Yp(e.sources);let n=0,i=0;for(let i=0;i<5&&Xp(e,t,!0);i++)n++;e.sources.map(Hp);for(let n=0;n<5&&Xp(e,t,!1);n++)i++;Yp(e.sources),5===Math.max(n,i)&&si("Maximum optimization runs(".concat(5,") reached."))}(o.component.data,o);return{spec:function(e,t,n={},i){const o=e.config?Xs(e.config):void 0,r=[].concat(e.assembleSelectionData([]),function(e,t){const n=[],i=Vm(n);let o=0;for(const t of e.sources){t.hasName()||(t.dataName="source_".concat(o++));const e=t.assemble();i(t,e)}for(const e of n)0===e.transform.length&&delete e.transform;let r=0;for(const[e,t]of n.entries()){var a;0!==(null!==(a=t.transform)&&void 0!==a?a:[]).length||t.source||n.splice(r++,0,n.splice(e,1)[0])}for(const t of n)for(const n of null!==(s=t.transform)&&void 0!==s?s:[]){var s;"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource())}for(const e of n)e.name in t&&(e.values=t[e.name]);return n}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),c=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let l=e.assembleLayoutSignals();l=l.filter((e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...s?{title:s}:{},...c?{style:c}:{},...u?{encode:{update:u}}:{},data:r,...a.length>0?{projections:a}:{},...e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([]),...As(f)]),...o?{config:o}:{},...i?{usermeta:i}:{}}}(o,function(e,t,n,i){const o=i.component.layoutSize.get("width"),r=i.component.layoutSize.get("height");void 0===t?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):x(t)&&(t={type:t});if(o&&r&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===o&&"step"===r)si(jn()),t.type="pad";else if("step"===o||"step"===r){const e="step"===o?"width":"height";si(jn(on(e)));const n="width"===e?"height":"width";t.type=function(e){return e?"fit-".concat(on(e)):"fit"}(n)}var a;return{...1===J(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...zs(n,!1),...zs(e,!0)}}(e,i.autosize,n,o),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&(ai=ri),t.fieldTitle&&ia(ta)}},e.contains=T,e.deepEqual=_,e.deleteNestedProperty=ee,e.duplicate=z,e.entries=Q,e.every=q,e.fieldIntersection=V,e.flatAccessWithDatum=ie,e.getFirstDefined=ue,e.hasIntersection=H,e.hash=j,e.internalField=de,e.isBoolean=$,e.isEmpty=Y,e.isEqual=function(e,t){const n=J(e),i=J(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0},e.isInternalField=pe,e.isNullOrFalse=M,e.isNumeric=he,e.keys=J,e.logicalExpr=Z,e.mergeDeep=R,e.normalize=bc,e.normalizeAngle=me,e.omit=N,e.pick=O,e.prefixGenerator=G,e.removePathFromField=se,e.replaceAll=ae,e.replacePathInField=re,e.resetIdCounter=function(){le=42},e.setEqual=I,e.some=L,e.stringify=P,e.titleCase=te,e.unique=U,e.uniqueId=fe,e.vals=X,e.varName=K,e.version="4.17.0",Object.defineProperty(e,"__esModule",{value:!0})}));
+//# sourceMappingURL=vega-lite.min.js.map
diff --git a/javascript/generated/vega@5.17.0 b/javascript/generated/vega@5.17.0
new file mode 100644
--- /dev/null
+++ b/javascript/generated/vega@5.17.0
@@ -0,0 +1,2 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={})}(this,(function(t){"use strict";function e(t,e,n){return t.fields=e||[],t.fname=n,t}function n(t){return null==t?null:t.fname}function r(t){return null==t?null:t.fields}function i(t){return 1===t.length?o(t[0]):a(t)}const o=t=>function(e){return e[t]},a=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function u(t){throw Error(t)}function s(t){const e=[],n=t.length;let r,i,o,a=null,s=0,l="";function c(){e.push(l+t.substring(r,i)),l="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)l+=t.substring(r,i),l+=t.substring(++i,++i),r=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&c(),s=r=i+1):"]"===o&&(s||u("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&u("Access path missing closing bracket: "+t),a&&u("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function l(t,n,r){const o=s(t);return t=1===o.length?o[0]:t,e((r&&r.get||i)(o),[t],n||t)}const c=l("id"),f=e((t=>t),[],"identity"),h=e((()=>0),[],"zero"),d=e((()=>1),[],"one"),p=e((()=>!0),[],"true"),g=e((()=>!1),[],"false");function m(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}function y(t,e){let n=t||0;return{level(t){return arguments.length?(n=+t,this):n},error(){return n>=1&&m(e||"error","ERROR",arguments),this},warn(){return n>=2&&m(e||"warn","WARN",arguments),this},info(){return n>=3&&m(e||"log","INFO",arguments),this},debug(){return n>=4&&m(e||"log","DEBUG",arguments),this}}}var v=Array.isArray;function _(t){return t===Object(t)}const x=t=>"__proto__"!==t;function b(...t){return t.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=k(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;w(t,n,e[n],r)}return t}),{})}function w(t,e,n,r){if(!x(e))return;let i,o;if(_(n)&&!v(n))for(i in o=_(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?w(o,i,n[i]):x(i)&&(o[i]=n[i]);else t[e]=n}function k(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function M(t){return t[t.length-1]}function A(t){return null==t||""===t?null:+t}const E=t=>e=>t*Math.exp(e),D=t=>e=>Math.log(t*e),C=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),F=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,S=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function B(t,e,n,r){const i=n(t[0]),o=n(M(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function T(t,e){return B(t,e,A,f)}function z(t,e){var n=Math.sign(t[0]);return B(t,e,D(n),E(n))}function N(t,e,n){return B(t,e,S(n),S(1/n))}function O(t,e,n){return B(t,e,C(n),F(n))}function R(t,e,n,r,i){const o=r(t[0]),a=r(M(t)),u=null!=e?r(e):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function L(t,e,n){return R(t,e,n,A,f)}function U(t,e,n){const r=Math.sign(t[0]);return R(t,e,n,D(r),E(r))}function q(t,e,n,r){return R(t,e,n,S(r),S(1/r))}function P(t,e,n,r){return R(t,e,n,C(r),F(r))}function j(t){return 1+~~(new Date(t).getMonth()/3)}function I(t){return 1+~~(new Date(t).getUTCMonth()/3)}function $(t){return null!=t?v(t)?t:[t]:[]}function W(t,e,n){let r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function H(t){return"function"==typeof t}function Y(t,n,i){i=i||{},n=$(n)||[];const o=[],a=[],u={},s=i.comparator||G;return $(t).forEach(((t,e)=>{null!=t&&(o.push("descending"===n[e]?-1:1),a.push(t=H(t)?t:l(t,null,i)),(r(t)||[]).forEach((t=>u[t]=1)))})),0===a.length?null:e(s(a,o),Object.keys(u))}const V=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0),G=(t,e)=>1===t.length?X(t[0],e[0]):J(t,e,t.length),X=(t,e)=>function(n,r){return V(t(n),t(r))*e},J=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,u=-1;for(;0===a&&++u<n;)o=t[u],a=V(o(r),o(i));return a*e[u]});function Z(t){return H(t)?t:()=>t}function Q(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}function K(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}function tt(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!=r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!=r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}function et(t,e){const n=t.length;let r,i,o,a,u,s=-1;if(null==e){for(;++s<n;)if(i=t[s],null!=i&&i>=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++s<n;)i=t[s],null!=i&&(r>i&&(r=i,a=s),o<i&&(o=i,u=s))}else{for(;++s<n;)if(i=e(t[s],s,t),null!=i&&i>=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++s<n;)i=e(t[s],s,t),null!=i&&(r>i&&(r=i,a=s),o<i&&(o=i,u=s))}return[a,u]}const nt=Object.prototype.hasOwnProperty;function rt(t,e){return nt.call(t,e)}const it={};function ot(t){let e,n={};function r(t){return rt(n,t)&&n[t]!==it}const i={size:0,empty:0,object:n,has:r,get:t=>r(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===it&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=it),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===it||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach((e=>{i.set(e,t[e])})),i}function at(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let u,s=t[0],l=M(t);l<s&&(u=s,s=l,l=u),u=Math.abs(e-s);const c=Math.abs(l-e);return u<c&&u<=a?r:c<=a?i:o}function ut(t,e,n){const r=t.prototype=Object.create(e.prototype);return r.constructor=t,K(r,n)}function st(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)}function lt(t){return"boolean"==typeof t}function ct(t){return"[object Date]"===Object.prototype.toString.call(t)}function ft(t){return t&&H(t[Symbol.iterator])}function ht(t){return"number"==typeof t}function dt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function pt(t){return"string"==typeof t}function gt(t,n,r){t&&(t=n?$(t).map((t=>t.replace(/\\(.)/g,"$1"))):$(t));const o=t&&t.length,a=r&&r.get||i,u=t=>a(n?[t]:s(t));let l;if(o)if(1===o){const e=u(t[0]);l=function(t){return""+e(t)}}else{const e=t.map(u);l=function(t){let n=""+e[0](t),r=0;for(;++r<o;)n+="|"+e[r](t);return n}}else l=function(){return""};return e(l,t,"key")}function mt(t,e){const n=t[0],r=M(t),i=+e;return i?1===i?r:n+i*(r-n):n}function yt(t){let e,n,r;t=+t||1e4;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>rt(e,t)||rt(n,t),get:t=>rt(e,t)?e[t]:rt(n,t)?o(t,n[t]):void 0,set:(t,n)=>rt(e,t)?e[t]=n:o(t,n)}}function vt(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let u=0,s=0,l=0;for(;u<i&&s<o;++l)a[l]=t(e[u],n[s])>0?n[s++]:e[u++];for(;u<i;++u,++l)a[l]=e[u];for(;s<o;++s,++l)a[l]=n[s];return a}function _t(t,e){let n="";for(;--e>=0;)n+=t;return n}function xt(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?_t(i,a)+o:"center"===r?_t(i,~~(a/2))+o+_t(i,Math.ceil(a/2)):o+_t(i,a)}function bt(t){return t&&M(t)-t[0]||0}function wt(t){return v(t)?"["+t.map(wt)+"]":_(t)||pt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function kt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Mt=t=>ht(t)||ct(t)?t:Date.parse(t);function At(t,e){return e=e||Mt,null==t||""===t?null:e(t)}function Et(t){return null==t||""===t?null:t+""}function Dt(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Ct(t,e,n,r){const i=null!=r?r:"…",o=t+"",a=o.length,u=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-u):"center"===n?o.slice(0,Math.ceil(u/2))+i+o.slice(a-~~(u/2)):o.slice(0,u)+i}function Ft(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}const St=/^([A-Za-z]+:)?\/\//,Bt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Tt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,zt="file://";async function Nt(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function Ot(t,e){e=K({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=Bt.test(t.replace(Tt,""));null!=t&&"string"==typeof t&&s||u("Sanitize failure, invalid URI: "+wt(t));const l=St.test(t);return(a=e.baseURL)&&!l&&(t.startsWith("/")||"/"===a[a.length-1]||(t="/"+t),t=a+t),o=(i=t.startsWith(zt))||"file"===e.mode||"http"!==e.mode&&!l&&n,i?t=t.slice(zt.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function Rt(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):Lt}async function Lt(){u("No file system access.")}function Ut(t){return t?async function(e,n){const r=K({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?H(o[i])?o[i]():o.text():u(o.status+""+o.statusText)}:qt}async function qt(){u("No HTTP fetch method available.")}const Pt=t=>!(Number.isNaN(+t)||t instanceof Date),jt={boolean:kt,integer:A,number:A,date:At,string:Et,unknown:f},It=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>Pt(t)&&Number.isInteger(+t),Pt,t=>!Number.isNaN(Date.parse(t))],$t=["boolean","integer","number","date"];function Wt(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=It.length,i=It.map(((t,e)=>e+1));for(let a,u,s=0,l=0;s<n;++s)for(u=e?t[s][e]:t[s],a=0;a<r;++a)if(i[a]&&(null!=(o=u)&&o==o)&&!It[a](u)&&(i[a]=0,++l,l===It.length))return"string";var o;return $t[i.reduce(((t,e)=>0===t?e:t),0)-1]}function Ht(t,e){return e.reduce(((e,n)=>(e[n]=Wt(t,n),e)),{})}var Yt={},Vt={};function Gt(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Xt(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function Jt(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Zt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+Jt(-t,6):t>9999?"+"+Jt(t,6):Jt(t,4)}(t.getUTCFullYear())+"-"+Jt(t.getUTCMonth()+1,2)+"-"+Jt(t.getUTCDate(),2)+(i?"T"+Jt(e,2)+":"+Jt(n,2)+":"+Jt(r,2)+"."+Jt(i,3)+"Z":r?"T"+Jt(e,2)+":"+Jt(n,2)+":"+Jt(r,2)+"Z":n||e?"T"+Jt(e,2)+":"+Jt(n,2)+"Z":"")}function Qt(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,u=0,s=o<=0,l=!1;function c(){if(s)return Vt;if(l)return l=!1,Yt;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?s=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return s=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=c())!==Vt;){for(var f=[];r!==Yt&&r!==Vt;)f.push(r),r=c();e&&null==(f=e(f,u++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?Zt(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Gt(t);return function(r,i){return e(n(r),i,t)}}(t,e):Gt(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Xt(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Xt(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function Kt(t){const e=function(e,n){const r={delimiter:t};return te(e,n?K(n,r):r)};return e.responseType="text",e}function te(t,e){return e.header&&(t=e.header.map(wt).join(e.delimiter)+"\n"+t),Qt(e.delimiter).parse(t+"")}function ee(t,e){const n=e&&e.property?l(e.property):f;return!_(t)||(r=t,"function"==typeof Buffer&&H(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){!v(t)&&ft(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var r}function ne(t){return t}function re(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return ie(t,e)}))}:ie(t,e)}function ie(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=oe(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function oe(t,e){var n=function(t){if(null==t)return ne;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,u){u||(e=n=0);var s=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*r+o,c[1]=(n+=t[1])*i+a;s<l;)c[s]=t[s],++s;return c}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function u(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(u)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:r,coordinates:n}}(e)}function ae(t,e){var n={},r={},i={},o=[],a=-1;function u(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),u=a[0],s=a[1];if(n=i[u])if(delete i[n.end],n.push(e),n.end=s,o=r[s]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[s])if(delete r[n.start],n.unshift(e),n.start=u,o=i[u]){delete i[o.end];var c=o===n?n:o.concat(n);r[c.start=o.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=u]=i[n.end=s]=n})),u(i,r),u(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function ue(t){return oe(t,se.apply(this,arguments))}function se(t,e,n){var r,i,o;if(arguments.length>1)r=le(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:ae(t,r)}}function le(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function u(t){t.forEach(a)}function s(t){t.forEach(u)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":u(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(s)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}te.responseType="text",ee.responseType="json";const ce={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function fe(t,e){let n,r,i,o;return t=ee(t,e),e&&e.feature?(n=re,i=e.feature):e&&e.mesh?(n=ue,i=e.mesh,o=ce[e.filter]):u("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):u("Invalid TopoJSON object: "+i),r&&r.features||[r]}fe.responseType="json";const he={dsv:te,csv:Kt(","),tsv:Kt("\t"),json:ee,topojson:fe};function de(t,e){return arguments.length>1?(he[t]=e,this):rt(he,t)?he[t]:null}function pe(t){const e=de(t);return e&&e.responseType||"text"}function ge(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function me(t){let e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>ge(t(e),n)}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);const a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}function ye(t){return null===t?NaN:+t}const ve=me(ge),_e=ve.right,xe=ve.left;me(ye).center;class be{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var we=Math.sqrt(50),ke=Math.sqrt(10),Me=Math.sqrt(2);function Ae(t,e,n){var r,i,o,a,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=Ee(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++u<i;)o[u]=(t+u)*a;else for(a=-a,t=Math.ceil(t*a),e=Math.floor(e*a),o=new Array(i=Math.ceil(e-t+1));++u<i;)o[u]=(t+u)/a;return r&&o.reverse(),o}function Ee(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=we?10:o>=ke?5:o>=Me?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=we?10:o>=ke?5:o>=Me?2:1)}function De(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=we?i*=10:o>=ke?i*=5:o>=Me&&(i*=2),e<t?-i:i}function Ce(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Fe(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Se(t,e,n=0,r=t.length-1,i=ge){for(;r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,u=Math.log(o),s=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*s*(o-s)/o)*(a-o/2<0?-1:1);Se(t,e,Math.max(n,Math.floor(e-a*s/o+l)),Math.min(r,Math.floor(e+(o-a)*s/o+l)),i)}const o=t[e];let a=n,u=r;for(Be(t,n,e),i(t[r],o)>0&&Be(t,n,r);a<u;){for(Be(t,a,u),++a,--u;i(t[a],o)<0;)++a;for(;i(t[u],o)>0;)--u}0===i(t[n],o)?Be(t,n,u):(++u,Be(t,u,r)),u<=e&&(n=u+1),e<=u&&(r=u-1)}return t}function Be(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Te(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return Fe(t);if(e>=1)return Ce(t);var r,i=(r-1)*e,o=Math.floor(i),a=Ce(Se(t,o).subarray(0,o+1));return a+(Fe(t.subarray(o+1))-a)*(i-o)}}function ze(t,e,n=ye){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function Ne(t,e){return Te(t,.5,e)}function Oe(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Re(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Le(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Ue(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function qe(t){return(t=Ue(Math.abs(t)))?t[1]:NaN}var Pe,je=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ie(t){if(!(e=je.exec(t)))throw new Error("invalid format: "+t);var e;return new $e({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function $e(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function We(t,e){var n=Ue(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Ie.prototype=$e.prototype,$e.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var He={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>We(100*t,e),r:We,s:function(t,e){var n=Ue(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Pe=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ue(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ye(t){return t}var Ve,Ge,Xe,Je=Array.prototype.map,Ze=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qe(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ye:(e=Je.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ye:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Je.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ie(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):He[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?s:"",b=He[v],w=/[defgprs%]/.test(v);function k(t){var i,o,s,h=_,k=x;if("c"===v)k=b(t)+k,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:b(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==f&&(M=!1),h=(M?"("===f?f:l:"-"===f||"("===f?"":f)+h,k=("s"===v?Ze[8+Pe/3]:"")+k+(M&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(s=t.charCodeAt(i))||s>57){k=(46===s?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var A=h.length+t.length+k.length,E=A<p?new Array(p-A+1).join(e):"";switch(g&&d&&(t=r(E+t,E.length?p-k.length:1/0),E=""),n){case"<":t=h+t+k+E;break;case"=":t=h+E+t+k;break;case"^":t=E.slice(0,A=E.length>>1)+h+t+k+E.slice(A);break;default:t=E+h+t+k}return u(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Ie(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(qe(e)/3))),i=Math.pow(10,-r),o=Ze[8+r/3];return function(t){return n(i*t)+o}}}}function Ke(t){return Math.max(0,-qe(Math.abs(t)))}function tn(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(qe(e)/3)))-qe(Math.abs(t)))}function en(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qe(e)-qe(t))+1}!function(t){Ve=Qe(t),Ge=Ve.format,Xe=Ve.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var nn=new Date,rn=new Date;function on(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,u=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return u;do{u.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return u},i.filter=function(n){return on((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return nn.setTime(+e),rn.setTime(+r),t(nn),t(rn),Math.floor(n(nn,rn))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var an=on((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));an.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?on((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):an:null};var un=1e3,sn=6e4,ln=36e5,cn=864e5,fn=6048e5,hn=on((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*un)}),(function(t,e){return(e-t)/un}),(function(t){return t.getUTCSeconds()})),dn=on((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*un)}),(function(t,e){t.setTime(+t+e*sn)}),(function(t,e){return(e-t)/sn}),(function(t){return t.getMinutes()})),pn=on((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*un-t.getMinutes()*sn)}),(function(t,e){t.setTime(+t+e*ln)}),(function(t,e){return(e-t)/ln}),(function(t){return t.getHours()})),gn=on((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*sn)/cn),(t=>t.getDate()-1));function mn(t){return on((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*sn)/fn}))}var yn=mn(0),vn=mn(1),_n=(mn(2),mn(3),mn(4)),xn=(mn(5),mn(6),on((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),bn=on((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));bn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?on((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var wn=on((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*sn)}),(function(t,e){return(e-t)/sn}),(function(t){return t.getUTCMinutes()})),kn=on((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*ln)}),(function(t,e){return(e-t)/ln}),(function(t){return t.getUTCHours()})),Mn=on((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/cn}),(function(t){return t.getUTCDate()-1}));function An(t){return on((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/fn}))}var En=An(0),Dn=An(1),Cn=(An(2),An(3),An(4)),Fn=(An(5),An(6),on((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),Sn=on((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Sn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?on((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const Bn="year",Tn="quarter",zn="month",Nn="week",On="date",Rn="day",Ln="dayofyear",Un="hours",qn="minutes",Pn="seconds",jn="milliseconds",In=[Bn,Tn,zn,Nn,On,Rn,Ln,Un,qn,Pn,jn],$n=In.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function Wn(t){const e=$(t).slice(),n={};e.length||u("Missing time unit."),e.forEach((t=>{rt($n,t)?n[t]=1:u("Invalid time unit: ".concat(t,"."))}));return(n.week||n.day?1:0)+(n.quarter||n.month||n.date?1:0)+(n.dayofyear?1:0)>1&&u("Incompatible time units: ".concat(t)),e.sort(((t,e)=>$n[t]-$n[e])),e}const Hn={[Bn]:"%Y ",[Tn]:"Q%q ",[zn]:"%b ",[On]:"%d ",[Nn]:"W%U ",[Rn]:"%a ",[Ln]:"%j ",[Un]:"%H:00",[qn]:"00:%M",[Pn]:":%S",[jn]:".%L",["".concat(Bn,"-").concat(zn)]:"%Y-%m ",["".concat(Bn,"-").concat(zn,"-").concat(On)]:"%Y-%m-%d ",["".concat(Un,"-").concat(qn)]:"%H:%M"};function Yn(t,e){const n=K({},Hn,e),r=Wn(t),i=r.length;let o,a,u="",s=0;for(s=0;s<i;)for(o=r.length;o>s;--o)if(a=r.slice(s,o).join("-"),null!=n[a]){u+=n[a],s=o;break}return u.trim()}const Vn=new Date;function Gn(t){return Vn.setFullYear(t),Vn.setMonth(0),Vn.setDate(1),Vn.setHours(0,0,0,0),Vn}function Xn(t){return Zn(new Date(t))}function Jn(t){return Qn(new Date(t))}function Zn(t){return gn.count(Gn(t.getFullYear())-1,t)}function Qn(t){return yn.count(Gn(t.getFullYear())-1,t)}function Kn(t){return Gn(t).getDay()}function tr(t,e,n,r,i,o,a){if(0<=t&&t<100){const u=new Date(-1,e,n,r,i,o,a);return u.setFullYear(t),u}return new Date(t,e,n,r,i,o,a)}function er(t){return rr(new Date(t))}function nr(t){return ir(new Date(t))}function rr(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Mn.count(e-1,t)}function ir(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return En.count(e-1,t)}function or(t){return Vn.setTime(Date.UTC(t,0,1)),Vn.getUTCDay()}function ar(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function ur(t,e,n,r,i){const o=e||1,a=M(t),u=(t,e,i)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[i=i||t],r[i],t===a&&o,e),s=new Date,l=Dt(t),c=l.year?u(Bn):Z(2012),f=l.month?u(zn):l.quarter?u(Tn):h,p=l.week&&l.day?u(Rn,1,Nn+Rn):l.week?u(Nn,1):l.day?u(Rn,1):l.date?u(On,1):l.dayofyear?u(Ln,1):d,g=l.hours?u(Un):h,m=l.minutes?u(qn):h,y=l.seconds?u(Pn):h,v=l.milliseconds?u(jn):h;return function(t){s.setTime(+t);const e=c(s);return i(e,f(s),p(s,e),g(s),m(s),y(s),v(s))}}function sr(t,e,n){return e+7*t-(n+6)%7}const lr={[Bn]:t=>t.getFullYear(),[Tn]:t=>Math.floor(t.getMonth()/3),[zn]:t=>t.getMonth(),[On]:t=>t.getDate(),[Un]:t=>t.getHours(),[qn]:t=>t.getMinutes(),[Pn]:t=>t.getSeconds(),[jn]:t=>t.getMilliseconds(),[Ln]:t=>Zn(t),[Nn]:t=>Qn(t),[Nn+Rn]:(t,e)=>sr(Qn(t),t.getDay(),Kn(e)),[Rn]:(t,e)=>sr(1,t.getDay(),Kn(e))},cr={[Tn]:t=>3*t,[Nn]:(t,e)=>sr(t,0,Kn(e))};function fr(t,e){return ur(t,e||1,lr,cr,tr)}const hr={[Bn]:t=>t.getUTCFullYear(),[Tn]:t=>Math.floor(t.getUTCMonth()/3),[zn]:t=>t.getUTCMonth(),[On]:t=>t.getUTCDate(),[Un]:t=>t.getUTCHours(),[qn]:t=>t.getUTCMinutes(),[Pn]:t=>t.getUTCSeconds(),[jn]:t=>t.getUTCMilliseconds(),[Ln]:t=>rr(t),[Nn]:t=>ir(t),[Rn]:(t,e)=>sr(1,t.getUTCDay(),or(e)),[Nn+Rn]:(t,e)=>sr(ir(t),t.getUTCDay(),or(e))},dr={[Tn]:t=>3*t,[Nn]:(t,e)=>sr(t,0,or(e))};function pr(t,e){return ur(t,e||1,hr,dr,ar)}const gr={[Bn]:bn,[Tn]:xn.every(3),[zn]:xn,[Nn]:yn,[On]:gn,[Rn]:gn,[Ln]:gn,[Un]:pn,[qn]:dn,[Pn]:hn,[jn]:an},mr={[Bn]:Sn,[Tn]:Fn.every(3),[zn]:Fn,[Nn]:En,[On]:Mn,[Rn]:Mn,[Ln]:Mn,[Un]:kn,[qn]:wn,[Pn]:hn,[jn]:an};function yr(t){return gr[t]}function vr(t){return mr[t]}function _r(t,e,n){return t?t.offset(e,n):void 0}function xr(t,e,n){return _r(yr(t),e,n)}function br(t,e,n){return _r(vr(t),e,n)}function wr(t,e,n,r){return t?t.range(e,n,r):void 0}function kr(t,e,n,r){return wr(yr(t),e,n,r)}function Mr(t,e,n,r){return wr(vr(t),e,n,r)}const Ar=1e3,Er=6e4,Dr=36e5,Cr=864e5,Fr=2592e6,Sr=31536e6,Br=[Bn,zn,On,Un,qn,Pn,jn],Tr=Br.slice(0,-1),zr=Tr.slice(0,-1),Nr=zr.slice(0,-1),Or=Nr.slice(0,-1),Rr=[Bn,zn],Lr=[Bn],Ur=[[Tr,1,Ar],[Tr,5,5e3],[Tr,15,15e3],[Tr,30,3e4],[zr,1,Er],[zr,5,3e5],[zr,15,9e5],[zr,30,18e5],[Nr,1,Dr],[Nr,3,108e5],[Nr,6,216e5],[Nr,12,432e5],[Or,1,Cr],[[Bn,Nn],1,6048e5],[Rr,1,Fr],[Rr,3,7776e6],[Lr,1,Sr]];function qr(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(bt(e))/n;let i,o,a=me((t=>t[2])).right(Ur,r);return a===Ur.length?(i=Lr,o=De(e[0]/Sr,e[1]/Sr,n)):a?(a=Ur[r/Ur[a-1][2]<Ur[a][2]/r?a-1:a],i=a[0],o=a[1]):(i=Br,o=Math.max(De(e[0],e[1],n),1)),{units:i,step:o}}function Pr(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function jr(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ir(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function $r(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,s=t.shortMonths,l=ei(i),c=ni(i),f=ei(o),h=ni(o),d=ei(a),p=ni(a),g=ei(u),m=ni(u),y=ei(s),v=ni(s),_={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:ki,e:ki,f:Ci,g:qi,G:ji,H:Mi,I:Ai,j:Ei,L:Di,m:Fi,M:Si,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:co,s:fo,S:Bi,u:Ti,U:zi,V:Oi,w:Ri,W:Li,x:null,X:null,y:Ui,Y:Pi,Z:Ii,"%":lo},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:$i,e:$i,f:Gi,g:oo,G:uo,H:Wi,I:Hi,j:Yi,L:Vi,m:Xi,M:Ji,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:co,s:fo,S:Zi,u:Qi,U:Ki,V:eo,w:no,W:ro,x:null,X:null,y:io,Y:ao,Z:so,"%":lo},b={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return M(t,e,n,r)},d:di,e:di,f:_i,g:li,G:si,H:gi,I:gi,j:pi,L:vi,m:hi,M:mi,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:fi,Q:bi,s:wi,S:yi,u:ii,U:oi,V:ai,w:ri,W:ui,x:function(t,e,r){return M(t,n,e,r)},X:function(t,e,n){return M(t,r,e,n)},y:li,Y:si,Z:ci,"%":xi};function w(t,e){return function(n){var r,i,o,a=[],u=-1,s=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++u<l;)37===t.charCodeAt(u)&&(a.push(t.slice(s,u)),null!=(i=Xr[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),s=u+1);return a.push(t.slice(s,u)),a.join("")}}function k(t,e){return function(n){var r,i,o=Ir(1900,void 0,1);if(M(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=jr(Ir(o.y,0,1))).getUTCDay(),r=i>4||0===i?Dn.ceil(r):Dn(r),r=Mn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Pr(Ir(o.y,0,1))).getDay(),r=i>4||0===i?vn.ceil(r):vn(r),r=gn.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?jr(Ir(o.y,0,1)).getUTCDay():Pr(Ir(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,jr(o)):Pr(o)}}function M(t,e,n,r){for(var i,o,a=0,u=e.length,s=n.length;a<u;){if(r>=s)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=b[i in Xr?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return _.x=w(n,_),_.X=w(r,_),_.c=w(e,_),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Wr,Hr,Yr,Vr,Gr,Xr={"-":"",_:" ",0:"0"},Jr=/^\s*\d+/,Zr=/^%/,Qr=/[\\^$*+?|[\]().{}]/g;function Kr(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function ti(t){return t.replace(Qr,"\\$&")}function ei(t){return new RegExp("^(?:"+t.map(ti).join("|")+")","i")}function ni(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function ri(t,e,n){var r=Jr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ii(t,e,n){var r=Jr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function oi(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ai(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ui(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function si(t,e,n){var r=Jr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function li(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ci(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function fi(t,e,n){var r=Jr.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function hi(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function di(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function pi(t,e,n){var r=Jr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function gi(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function mi(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function yi(t,e,n){var r=Jr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function vi(t,e,n){var r=Jr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function _i(t,e,n){var r=Jr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function xi(t,e,n){var r=Zr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function bi(t,e,n){var r=Jr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function wi(t,e,n){var r=Jr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ki(t,e){return Kr(t.getDate(),e,2)}function Mi(t,e){return Kr(t.getHours(),e,2)}function Ai(t,e){return Kr(t.getHours()%12||12,e,2)}function Ei(t,e){return Kr(1+gn.count(bn(t),t),e,3)}function Di(t,e){return Kr(t.getMilliseconds(),e,3)}function Ci(t,e){return Di(t,e)+"000"}function Fi(t,e){return Kr(t.getMonth()+1,e,2)}function Si(t,e){return Kr(t.getMinutes(),e,2)}function Bi(t,e){return Kr(t.getSeconds(),e,2)}function Ti(t){var e=t.getDay();return 0===e?7:e}function zi(t,e){return Kr(yn.count(bn(t)-1,t),e,2)}function Ni(t){var e=t.getDay();return e>=4||0===e?_n(t):_n.ceil(t)}function Oi(t,e){return t=Ni(t),Kr(_n.count(bn(t),t)+(4===bn(t).getDay()),e,2)}function Ri(t){return t.getDay()}function Li(t,e){return Kr(vn.count(bn(t)-1,t),e,2)}function Ui(t,e){return Kr(t.getFullYear()%100,e,2)}function qi(t,e){return Kr((t=Ni(t)).getFullYear()%100,e,2)}function Pi(t,e){return Kr(t.getFullYear()%1e4,e,4)}function ji(t,e){var n=t.getDay();return Kr((t=n>=4||0===n?_n(t):_n.ceil(t)).getFullYear()%1e4,e,4)}function Ii(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Kr(e/60|0,"0",2)+Kr(e%60,"0",2)}function $i(t,e){return Kr(t.getUTCDate(),e,2)}function Wi(t,e){return Kr(t.getUTCHours(),e,2)}function Hi(t,e){return Kr(t.getUTCHours()%12||12,e,2)}function Yi(t,e){return Kr(1+Mn.count(Sn(t),t),e,3)}function Vi(t,e){return Kr(t.getUTCMilliseconds(),e,3)}function Gi(t,e){return Vi(t,e)+"000"}function Xi(t,e){return Kr(t.getUTCMonth()+1,e,2)}function Ji(t,e){return Kr(t.getUTCMinutes(),e,2)}function Zi(t,e){return Kr(t.getUTCSeconds(),e,2)}function Qi(t){var e=t.getUTCDay();return 0===e?7:e}function Ki(t,e){return Kr(En.count(Sn(t)-1,t),e,2)}function to(t){var e=t.getUTCDay();return e>=4||0===e?Cn(t):Cn.ceil(t)}function eo(t,e){return t=to(t),Kr(Cn.count(Sn(t),t)+(4===Sn(t).getUTCDay()),e,2)}function no(t){return t.getUTCDay()}function ro(t,e){return Kr(Dn.count(Sn(t)-1,t),e,2)}function io(t,e){return Kr(t.getUTCFullYear()%100,e,2)}function oo(t,e){return Kr((t=to(t)).getUTCFullYear()%100,e,2)}function ao(t,e){return Kr(t.getUTCFullYear()%1e4,e,4)}function uo(t,e){var n=t.getUTCDay();return Kr((t=n>=4||0===n?Cn(t):Cn.ceil(t)).getUTCFullYear()%1e4,e,4)}function so(){return"+0000"}function lo(){return"%"}function co(t){return+t}function fo(t){return Math.floor(+t/1e3)}function ho(t){const e={};return n=>e[n]||(e[n]=t(n))}function po(t){const e=ho(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=Ie(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var r,i},formatSpan(t,r,i,o){o=Ie(null==o?",f":o);const a=De(t,r,i),u=Math.max(Math.abs(t),Math.abs(r));let s;if(null==o.precision)switch(o.type){case"s":return isNaN(s=tn(a,u))||(o.precision=s),n(o,u);case"":case"e":case"g":case"p":case"r":isNaN(s=en(a,u))||(o.precision=s-("e"===o.type));break;case"f":case"%":isNaN(s=Ke(a))||(o.precision=s-2*("%"===o.type))}return e(o)}}}let go,mo;function yo(){return go=po({format:Ge,formatPrefix:Xe})}function vo(t){return po(Qe(t))}function _o(t){return arguments.length?go=vo(t):go}function xo(t,e,n){_(n=n||{})||u("Invalid time multi-format specifier: ".concat(n));const r=e(Pn),i=e(qn),o=e(Un),a=e(On),s=e(Nn),l=e(zn),c=e(Tn),f=e(Bn),h=t(n.milliseconds||".%L"),d=t(n.seconds||":%S"),p=t(n.minutes||"%I:%M"),g=t(n.hours||"%I %p"),m=t(n.date||n.day||"%a %d"),y=t(n.week||"%b %d"),v=t(n.month||"%B"),x=t(n.quarter||"%B"),b=t(n.year||"%Y");return t=>(r(t)<t?h:i(t)<t?d:o(t)<t?p:a(t)<t?g:l(t)<t?s(t)<t?m:y:f(t)<t?c(t)<t?v:x:b)(t)}function bo(t){const e=ho(t.format),n=ho(t.utcFormat);return{timeFormat:t=>pt(t)?e(t):xo(e,yr,t),utcFormat:t=>pt(t)?n(t):xo(n,vr,t),timeParse:ho(t.parse),utcParse:ho(t.utcParse)}}function wo(){return mo=bo({format:Hr,parse:Yr,utcFormat:Vr,utcParse:Gr})}function ko(t){return bo($r(t))}function Mo(t){return arguments.length?mo=ko(t):mo}!function(t){Wr=$r(t),Hr=Wr.format,Yr=Wr.parse,Vr=Wr.utcFormat,Gr=Wr.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]}),yo(),wo();const Ao=(t,e)=>K({},t,e);function Eo(t,e){const n=t?vo(t):_o(),r=e?ko(e):Mo();return Ao(n,r)}function Do(t,e){const n=arguments.length;return n&&2!==n&&u("defaultLocale expects either zero or two arguments."),n?Ao(_o(t),Mo(e)):Ao(_o(),Mo())}function Co(t,e,n,r){const i=de((e=e||{}).type||"json");return i||u("Unknown data format type: "+e.type),t=i(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=Mo();n=n||i.timeParse,r=r||i.utcParse;let o,a,u,s,l,c,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=Ht(t,f));f=Object.keys(e);const h=f.map((t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?r:n)(a)}if(!jt[i])throw Error("Illegal format pattern: "+t+":"+i);return jt[i]}));for(u=0,l=t.length,c=f.length;u<l;++u)for(o=t[u],s=0;s<c;++s)a=f[s],o[a]=h[s](o[a])}(t,e.parse,n,r),rt(t,"columns")&&delete t.columns,t}const Fo=function(t,e){return n=>({options:n||{},sanitize:Ot,load:Nt,fileAccess:!!e,file:Rt(e),http:Ut(t)})}("undefined"!=typeof fetch&&fetch,null);function So(t){const e=t||f,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function Bo(t,e){try{await e(t)}catch(e){t.error(e)}}const To=Symbol("vega_id");let zo=1;function No(t){return!(!t||!Oo(t))}function Oo(t){return t[To]}function Ro(t,e){return t[To]=e,t}function Lo(t){const e=t===Object(t)?t:{data:t};return Oo(e)?e:Ro(e,zo++)}function Uo(t){return qo(t,Lo({}))}function qo(t,e){for(const n in t)e[n]=t[n];return e}function Po(t,e){return Ro(e,Oo(t))}function jo(t,e){return t?e?(n,r)=>t(n,r)||Oo(e(n))-Oo(e(r)):(e,n)=>t(e,n)||Oo(e)-Oo(n):null}function Io(t){return t&&t.constructor===$o}function $o(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:$o,insert(e){const n=$(e),r=n.length;for(let e=0;e<r;++e)t.push(n[e]);return this},remove(t){const n=H(t)?r:e,i=$(t),o=i.length;for(let t=0;t<o;++t)n.push(i[t]);return this},modify(t,e,r){const o={field:e,value:Z(r)};return H(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return H(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(u,s){const l={},c={};let f,h,d,p,g,m;for(f=0,h=s.length;f<h;++f)l[Oo(s[f])]=1;for(f=0,h=e.length;f<h;++f)g=e[f],l[Oo(g)]=-1;for(f=0,h=r.length;f<h;++f)p=r[f],s.forEach((t=>{p(t)&&(l[Oo(t)]=-1)}));for(f=0,h=t.length;f<h;++f)g=t[f],m=Oo(g),l[m]?l[m]=1:u.add.push(Lo(t[f]));for(f=0,h=s.length;f<h;++f)g=s[f],l[Oo(g)]<0&&u.rem.push(g);function y(t,e,n){n?t[e]=n(t):u.encode=e,a||(c[Oo(t)]=t)}for(f=0,h=n.length;f<h;++f)d=n[f],g=d.tuple,p=d.field,m=l[Oo(g)],m>0&&(y(g,p,d.value),u.modifies(p));for(f=0,h=i.length;f<h;++f)d=i[f],p=d.filter,s.forEach((t=>{p(t)&&l[Oo(t)]>0&&y(t,d.field,d.value)})),u.modifies(d.field);if(a)u.mod=e.length||r.length?s.filter((t=>l[Oo(t)]>0)):s.slice();else for(m in c)u.mod.push(c[m]);return(o||null==o&&(e.length||r.length))&&u.clean(!0),u}}}const Wo="_:mod:_";function Ho(){Object.defineProperty(this,Wo,{writable:!0,value:{}})}Ho.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[Wo];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=v(n)?1+n.length:-1),i},modified(t,e){const n=this[Wo];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(v(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[Wo]={},this}};let Yo=0;const Vo=new Ho;function Go(t,e,n,r){this.id=++Yo,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function Xo(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Go.prototype={targets(){return this._targets||(this._targets=So(c))},set(t){return this.value!==t?(this.value=t,1):0},skip:Xo(1),modified:Xo(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new Ho,i=this._argops=this._argops||[],o=[];let a,s,l,c;const f=(t,n,a)=>{a instanceof Go?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)$(s).forEach((t=>{t instanceof Go?t!==this&&(t.targets().add(this),o.push(t)):u("Pulse parameters must be operator instances.")})),this.source=s;else if(v(s))for(r.set(a,-1,Array(l=s.length)),c=0;c<l;++c)f(a,c,s[c]);else f(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||Vo,n=this._argops;let r,i,o,a;if(n){const u=n.length;for(i=0;i<u;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<u;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this)},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let Jo=0;function Zo(t,e,n){this.id=++Jo,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Qo(t,e,n){return new Zo(t,e,n)}Zo.prototype={_filter:p,_apply:f,targets(){return this._targets||(this._targets=So(c))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Qo(t);return this.targets().add(e),e},apply(t){const e=Qo(null,t);return this.targets().add(e),e},merge(){const t=Qo();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=Qo();return this.targets().add(Qo(null,null,Q(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(Qo(null,null,(()=>n=!0))),e.targets().add(Qo(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){}};const Ko={skip:!0};function ta(t,e,n,r,i,o){const a=K({},o,Ko);let u,s;H(n)||(n=Z(n)),void 0===r?u=e=>t.touch(n(e)):H(r)?(s=new Go(null,r,i,!1),u=e=>{s.evaluate(e);const r=n(e),i=s.value;Io(i)?t.pulse(r,i,o):t.update(r,i,a)}):u=e=>t.update(n(e),r,a),e.apply(u)}function ea(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},u=new Go(null,function(t,e){return e=H(e)?e:Z(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);u.modified(a.force),u.rank=e.rank,e.targets().add(u),n&&(u.skip(!0),u.value=n.value,u.targets().add(n),t.connect(n,[u]))}}const na={};function ra(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function ia(t,e){const n=[];return Ft(t,e,(t=>n.push(t))),n}function oa(t,e){const n={};return t.visit(e,(t=>{n[Oo(t)]=1})),t=>n[Oo(t)]?null:t}function aa(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function ua(t,e,n,r){const i=this,o=n.length;let a=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let t=0;t<o;++t){const r=n[t];if(r.stamp===e){if(r.fields){const t=i.fields||(i.fields={});for(const e in r.fields)t[e]=1}r.changed(i.ADD)&&(a|=i.ADD),r.changed(i.REM)&&(a|=i.REM),r.changed(i.MOD)&&(a|=i.MOD)}}this.changes=a}function sa(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}ra.prototype={StopPropagation:na,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new ra(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new ra(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,oa(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return v(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?v(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=aa(n.addF,e)),2&t&&(n.remF=aa(n.remF,e)),4&t&&(n.modF=aa(n.modF,e)),16&t&&(n.srcF=aa(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=ia(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=ia(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=ia(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return Ft(n.source,n.srcF,r),n;1&t&&Ft(n.add,n.addF,r),2&t&&Ft(n.rem,n.remF,r),4&t&&Ft(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||Ft(i,t?oa(n,5):n.srcF,r)}return n}},ut(ua,ra,{fork(t){const e=new ra(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?v(t)?t.some((t=>n[t])):n[t]:0},filter(){u("MultiPulse does not support filtering.")},materialize(){u("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});const la={skip:!1,force:!1};function ca(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),fa(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,u=1+(e<<1);for(;u<i;)a=u+1,a<i&&n(t[u],t[a])>=0&&(u=a),t[e]=t[u],u=1+((e=u)<<1);t[e]=o,fa(t,r,e,n)}(e,0,t)):r=n,r}}}function fa(t,e,n,r){let i,o;const a=t[n];for(;n>e&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,n=o;return t[n]=a}function ha(){this.logger(y()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=Do();try{this._loader=Fo()}catch(t){}this._touched=So(c),this._input={},this._pulse=null,this._heap=ca(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function da(t){return function(){return this._log[t].apply(this,arguments)}}function pa(t,e){Go.call(this,t,null,e)}ha.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:da("error"),warn:da("warn"),info:da("info"),debug:da("debug"),logLevel:da("level"),cleanThreshold:1e4,add:function(t,e,n,r){let i,o=1;return t instanceof Go?i=t:t&&t.prototype instanceof Go?i=new t:H(t)?i=new Go(null,t):(o=0,i=new Go(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i<r;++i)if(n<e[i].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&u("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||la);const r=new ra(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||la;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||la;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:$o,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Co(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(p).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:pe(e&&e.type)});try{r=n.parse(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=Qo(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(t){i.error(t)}finally{i.run()}};let u;u="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):$(t);const s=u.length;for(let t=0;t<s;++t)u[t].addEventListener(e,a);return o},on:function(t,e,n,r,i){return(t instanceof Go?ea:ta)(this,t,e,n,r,i),this},evaluate:async function(t,e,n){const r=this,i=[];if(r._pulse)return sa(r);if(r._pending&&await r._pending,e&&await Bo(r,e),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;const o=++r._clock;r._pulse=new ra(r,o,t),r._touched.forEach((t=>r._enqueue(t,!0))),r._touched=So(c);let a,u,s,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(u=a.run(r._getPulse(a,t)),u.then?u=await u:u.async&&(i.push(u.async),u=na),u!==na&&a._targets&&a._targets.forEach((t=>r._enqueue(t))),++l):r._enqueue(a,!0)}catch(t){r._heap.clear(),s=t}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),s&&(r._postrun=[],r.error(s)),r._postrun.length){const t=r._postrun.sort(((t,e)=>e.priority-t.priority));r._postrun=[];for(let e=0;e<t.length;++e)await Bo(r,t[e].callback)}return n&&await Bo(r,n),i.length&&Promise.all(i).then((t=>r.runAsync(null,(()=>{t.forEach((t=>{try{t(r)}catch(t){r.error(t)}}))})))),r},run:function(t,e,n){return this._pulse?sa(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,e){const n=t.source,r=this._clock;return n&&v(n)?new ua(this,r,n.map((t=>t.pulse)),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==na&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},ut(pa,Go,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const ga={};function ma(t){const e=ya(t);return e&&e.Definition||null}function ya(t){return t=t&&t.toLowerCase(),rt(ga,t)?ga[t]:null}function*va(t,e){if(null==e)for(let e of t)null!=e&&""!==e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function _a(t,e,n){const r=Float64Array.from(va(t,n));return r.sort(ge),e.map((t=>ze(r,t)))}function xa(t,e){return _a(t,[.25,.5,.75],e)}function ba(t,e){const n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let u of t)null!=(u=e(u,++a,t))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=xa(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function wa(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,u,s,l,c,f=t.extent[0],h=t.extent[1];const d=t.span||h-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(s=d/e,l=0,c=t.steps.length;l<c&&t.steps[l]<s;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/r),u=t.minstep||0,o=Math.max(u,Math.pow(n,Math.round(Math.log(d)/r)-a));Math.ceil(d/o)>e;)o*=n;for(l=0,c=i.length;l<c;++l)s=o/i[l],s>=u&&d/s<=e&&(o=s)}s=Math.log(o);const p=s>=0?0:1+~~(-s/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(s=Math.floor(f/o+g)*o,f=f<s?s-o:s,h=Math.ceil(h/o)*o),{start:f,stop:h===f?f+o:h,step:o}}function ka(e,n,r,i){if(!e.length)return[void 0,void 0];const o=Float64Array.from(va(e,i)),a=o.length,u=n;let s,l,c,f;for(c=0,f=Array(u);c<u;++c){for(s=0,l=0;l<a;++l)s+=o[~~(t.random()*a)];f[c]=s/a}return f.sort(ge),[Te(f,r/2),Te(f,1-r/2)]}function Ma(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,u=0,s=1,l=r(t[0]),c=l,f=l+e;for(;s<i;++s){if(a=r(t[s]),a>=f){for(c=(l+c)/2;u<s;++u)o[u]=c;f=a+e,l=a}c=a}for(c=(l+c)/2;u<s;++u)o[u]=c;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}t.random=Math.random;const Aa=Math.sqrt(2*Math.PI),Ea=Math.SQRT2;let Da=NaN;function Ca(e,n){e=e||0,n=null==n?1:n;let r,i,o=0,a=0;if(Da==Da)o=Da,Da=NaN;else{do{o=2*t.random()-1,a=2*t.random()-1,r=o*o+a*a}while(0===r||r>1);i=Math.sqrt(-2*Math.log(r)/r),o*=i,Da=a*i}return e+o*n}function Fa(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Aa)}function Sa(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function Ba(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*Ea*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function Ta(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Ca(n,r),pdf:t=>Fa(t,n,r),cdf:t=>Sa(t,n,r),icdf:t=>Ba(t,n,r)};return i.mean(t).stdev(e)}function za(e,n){const r=Ta();let i=0;const o={data(t){return arguments.length?(e=t,i=t?t.length:0,o.bandwidth(n)):e},bandwidth(t){return arguments.length?(!(n=t)&&e&&(n=ba(e)),o):n},sample:()=>e[~~(t.random()*i)]+n*r.sample(),pdf(t){let o=0,a=0;for(;a<i;++a)o+=r.pdf((t-e[a])/n);return o/n/i},cdf(t){let o=0,a=0;for(;a<i;++a)o+=r.cdf((t-e[a])/n);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return o.data(e)}function Na(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+Ca()*e)}function Oa(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*Aa*t)}function Ra(t,e,n){return Sa(Math.log(t),e,n)}function La(t,e,n){return Math.exp(Ba(t,e,n))}function Ua(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Na(n,r),pdf:t=>Oa(t,n,r),cdf:t=>Ra(t,n,r),icdf:t=>La(t,n,r)};return i.mean(t).stdev(e)}function qa(e,n){let r,i=0;const o={weights(t){return arguments.length?(r=function(t){const e=[];let n,r=0;for(n=0;n<i;++n)r+=e[n]=null==t[n]?1:+t[n];for(n=0;n<i;++n)e[n]/=r;return e}(n=t||[]),o):n},distributions(t){return arguments.length?(t?(i=t.length,e=t):(i=0,e=[]),o.weights(n)):e},sample(){const n=t.random();let o=e[i-1],a=r[0],u=0;for(;u<i-1;a+=r[++u])if(n<a){o=e[u];break}return o.sample()},pdf(t){let n=0,o=0;for(;o<i;++o)n+=r[o]*e[o].pdf(t);return n},cdf(t){let n=0,o=0;for(;o<i;++o)n+=r[o]*e[o].cdf(t);return n},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(n)}function Pa(e,n){return null==n&&(n=null==e?1:e,e=0),e+(n-e)*t.random()}function ja(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Ia(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function $a(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function Wa(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Pa(n,r),pdf:t=>ja(t,n,r),cdf:t=>Ia(t,n,r),icdf:t=>$a(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function Ha(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function Ya(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let u,s,l,c=0,f=0,h=0;for(l of t)o[c]=u=+e(l),a[c]=s=+n(l),++c,f+=(u-f)/c,h+=(s-h)/c;for(c=0;c<i;++c)o[c]-=f,a[c]-=h;return[o,a,f,h]}function Va(t,e,n,r){let i,o,a=-1;for(const u of t)i=e(u),o=n(u),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function Ga(t,e,n,r,i){let o=0,a=0;return Va(t,e,n,((t,e)=>{const n=e-i(t),u=e-r;o+=n*n,a+=u*u})),1-o/a}function Xa(t,e,n){let r=0,i=0,o=0,a=0,u=0;Va(t,e,n,((t,e)=>{++u,r+=(t-r)/u,i+=(e-i)/u,o+=(t*e-o)/u,a+=(t*t-a)/u}));const s=Ha(r,i,o,a),l=t=>s[0]+s[1]*t;return{coef:s,predict:l,rSquared:Ga(t,e,n,i,l)}}function Ja(t,e,n){let r=0,i=0,o=0,a=0,u=0;Va(t,e,n,((t,e)=>{++u,t=Math.log(t),r+=(t-r)/u,i+=(e-i)/u,o+=(t*e-o)/u,a+=(t*t-a)/u}));const s=Ha(r,i,o,a),l=t=>s[0]+s[1]*Math.log(t);return{coef:s,predict:l,rSquared:Ga(t,e,n,i,l)}}function Za(t,e,n){const[r,i,o,a]=Ya(t,e,n);let u,s,l,c=0,f=0,h=0,d=0,p=0;Va(t,e,n,((t,e)=>{u=r[p++],s=Math.log(e),l=u*e,c+=(e*s-c)/p,f+=(l-f)/p,h+=(l*s-h)/p,d+=(u*l-d)/p}));const[g,m]=Ha(f/a,c/a,h/a,d/a),y=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:Ga(t,e,n,a,y)}}function Qa(t,e,n){let r=0,i=0,o=0,a=0,u=0,s=0;Va(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++s,r+=(n-r)/s,i+=(l-i)/s,o+=(n*l-o)/s,a+=(n*n-a)/s,u+=(e-u)/s}));const l=Ha(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Ga(t,e,n,u,c)}}function Ka(t,e,n){const[r,i,o,a]=Ya(t,e,n),u=r.length;let s,l,c,f,h=0,d=0,p=0,g=0,m=0;for(s=0;s<u;)l=r[s],c=i[s++],f=l*l,h+=(f-h)/s,d+=(f*l-d)/s,p+=(f*f-p)/s,g+=(l*c-g)/s,m+=(f*c-m)/s;const y=p-h*h,v=h*y-d*d,_=(m*h-g*d)/v,x=(g*y-m*d)/v,b=-_*h,w=t=>_*(t-=o)*t+x*t+b+a;return{coef:[b-x*o+_*o*o+a,x-2*_*o,_],predict:w,rSquared:Ga(t,e,n,a,w)}}function tu(t,e,n,r){if(1===r)return Xa(t,e,n);if(2===r)return Ka(t,e,n);const[i,o,a,u]=Ya(t,e,n),s=i.length,l=[],c=[],f=r+1;let h,d,p,g,m;for(h=0;h<f;++h){for(p=0,g=0;p<s;++p)g+=Math.pow(i[p],h)*o[p];for(l.push(g),m=new Float64Array(f),d=0;d<f;++d){for(p=0,g=0;p<s;++p)g+=Math.pow(i[p],h+d);m[d]=g}c.push(m)}c.push(l);const y=function(t){const e=t.length-1,n=[];let r,i,o,a,u;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)u=t[o][r],t[o][r]=t[o][a],t[o][a]=u;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(u=0,o=i+1;o<e;++o)u+=t[o][i]*n[o];n[i]=(t[e][i]-u)/t[i][i]}return n}(c),v=t=>{t-=a;let e=u+y[0]+y[1]*t+y[2]*t*t;for(h=3;h<f;++h)e+=y[h]*Math.pow(t,h);return e};return{coef:eu(f,y,-a,u),predict:v,rSquared:Ga(t,e,n,u,v)}}function eu(t,e,n,r){const i=Array(t);let o,a,u,s;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(u=e[o],s=1,i[o]+=u,a=1;a<=o;++a)s*=(o+1-a)/a,i[o-a]+=u*Math.pow(n,a)*s;return i[0]+=r,i}function nu(t,e,n,r){const[i,o,a,u]=Ya(t,e,n,!0),s=i.length,l=Math.max(2,~~(r*s)),c=new Float64Array(s),f=new Float64Array(s),h=new Float64Array(s).fill(1);for(let t=-1;++t<=2;){const e=[0,l-1];for(let t=0;t<s;++t){const n=i[t],r=e[0],a=e[1],u=n-i[r]>i[a]-n?r:a;let s=0,l=0,d=0,p=0,g=0;const m=1/Math.abs(i[u]-n||1);for(let t=r;t<=a;++t){const e=i[t],r=o[t],a=ru(Math.abs(n-e)*m)*h[t],u=e*a;s+=a,l+=u,d+=r*a,p+=r*u,g+=e*u}const[y,v]=Ha(l/s,d/s,p/s,g/s);c[t]=y+v*n,f[t]=Math.abs(o[t]-c[t]),iu(i,t+1,e)}if(2===t)break;const n=Ne(f);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r<s;++r)t=f[r]/(6*n),h[r]=t>=1?1e-12:(e=1-t*t)*e}return function(t,e,n,r){const i=t.length,o=[];let a,u=0,s=0,l=[];for(;u<i;++u)a=t[u]+n,l[0]===a?l[1]+=(e[u]-l[1])/++s:(s=0,l[1]+=r,l=[a,e[u]],o.push(l));return l[1]+=r,o}(i,c,a,u)}function ru(t){return(t=1-t*t*t)*t*t}function iu(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const ou=.1*Math.PI/180;function au(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],u=a-o,s=u/r,l=[i(o)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(o+t/n*u));return l.push(i(a)),l}c.push(i(a));for(let t=n;--t>0;)c.push(i(o+t/n*u));let f=l[0],h=c[c.length-1];for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=s&&uu(f,t,h)>ou?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}function uu(t,e,n){const r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}function su(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function lu(t,e,n){return n||t+(e?"_"+e:"")}const cu=()=>{},fu={init:cu,add:cu,rem:cu,idx:0},hu={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e<t.min||void 0===t.min)&&(t.min=e)},rem:(t,e)=>{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e<t.min&&(t.argmin=n)},rem:(t,e)=>{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},du=Object.keys(hu);function pu(t,e){return hu[t](e)}function gu(t,e){return t.idx-e.idx}function mu(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function yu(t,e){null!=t&&""!==t?t==t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function vu(t,e){null!=t&&""!==t?t==t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function _u(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function xu(t,e){const n=e||f,r=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=hu[t]())}))};return t.forEach(n),Object.values(e).sort(gu)}(t),i=t.slice().sort(gu);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=mu,o.prototype.add=yu,o.prototype.rem=vu,o.prototype.set=_u,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function bu(t){this._key=t?l(t):Oo,this.reset()}du.forEach((t=>{hu[t]=function(t,e){return n=>K({name:t,out:n||t},fu,e)}(t,hu[t])}));const wu=bu.prototype;function ku(t){pa.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}wu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},wu.add=function(t){this._add.push(t)},wu.rem=function(t){this._rem.push(t)},wu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let u,s,l;for(u=0;u<i;++u)a[n(e[u])]=1;for(u=0,s=0;u<r;++u)a[n(l=t[u])]?a[n(l)]=0:o[s++]=l;return this._rem=[],this._add=o},wu.distinct=function(t){const e=this.values(),n={};let r,i=e.length,o=0;for(;--i>=0;)r=t(e[i])+"",rt(n,r)||(n[r]=1,++o);return o},wu.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=et(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},wu.argmin=function(t){return this.extent(t)[0]||{}},wu.argmax=function(t){return this.extent(t)[1]||{}},wu.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},wu.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},wu.quartile=function(t){return this._get===t&&this._q||(this._q=xa(this.values(),t),this._get=t),this._q},wu.q1=function(t){return this.quartile(t)[0]},wu.q2=function(t){return this.quartile(t)[1]},wu.q3=function(t){return this.quartile(t)[2]},wu.ci=function(t){return this._get===t&&this._ci||(this._ci=ka(this.values(),1e3,.05,t),this._get=t),this._ci},wu.ci0=function(t){return this.ci(t)[0]},wu.ci1=function(t){return this.ci(t)[1]},ku.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:du},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},ut(ku,pa,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map((()=>({}))),i=n.length;function o(t){let e,o,a,u;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][u=a[n[o]]]=u}o(t._prev),o(e),function o(a,u,s){const l=n[s],c=r[s++];for(const n in c){const r=a?a+"|"+n:n;u[l]=c[n],s<i?o(r,u,s):e[r]||t.cell(r,u)}}("",{},0)},init(t){const e=this._inputs=[],i=this._outputs=[],o={};function a(t){const n=$(r(t)),i=n.length;let a,u=0;for(;u<i;++u)o[a=n[u]]||(o[a]=1,e.push(a))}this._dims=$(t.groupby),this._dnames=this._dims.map((t=>{const e=n(t);return a(t),i.push(e),e})),this.cellkey=t.key?t.key:su(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=t.fields||[null],l=t.ops||["count"],c=t.as||[],f=s.length,h={};let d,p,g,m,y,v;for(f!==l.length&&u("Unmatched number of fields and aggregate ops."),v=0;v<f;++v)d=s[v],p=l[v],null==d&&"count"!==p&&u("Null aggregate field specified."),m=n(d),y=lu(p,m,c[v]),i.push(y),"count"!==p?(g=h[m],g||(a(d),g=h[m]=[],g.field=d,this._measures.push(g)),"count"!==p&&(this._countOnly=!1),g.push(pu(p,y))):this._counts.push(y);return this._measures=this._measures.map((t=>xu(t,t.field))),{}},cellkey:su(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let r=0;r<e;++r)n.agg[r]=new t[r](n)}return n.store&&(n.data=new bu),n},newtuple(t,e){const n=this._dnames,r=this._dims,i=r.length,o={};for(let e=0;e<i;++e)o[n[e]]=r[e](t);return e?Po(e.tuple,o):Lo(o)},clean(){const t=this.value;for(const e in t)0===t[e].num&&delete t[e]},add(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(t);const r=n.agg;for(let e=0,n=r.length;e<n;++e)r[e].add(r[e].get(t),t)},rem(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(t);const r=n.agg;for(let e=0,n=r.length;e<n;++e)r[e].rem(r[e].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let r=0,i=n.length;r<i;++r)e[n[r]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,r=n.length;t<r;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,r=this._prev,i=this._drop,o=t.add,a=t.rem,u=t.mod;let s,l,c,f;if(r)for(l in r)s=r[l],i&&!s.num||a.push(s.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(e[c])),e[c]=null;for(c=0,f=this._mlen;c<f;++c)s=n[c],(0===s.num&&i?a:u).push(this.celltuple(s)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,t}});function Mu(t){pa.call(this,null,t)}function Au(t,e,n){const r=t;let i=e||[],o=n||[],a={},u=0;return{add:t=>o.push(t),remove:t=>a[r(t)]=++u,size:()=>i.length,data:(t,e)=>(u&&(i=i.filter((t=>!a[r(t)])),a={},u=0),e&&t&&i.sort(t),o.length&&(i=t?vt(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function Eu(t){pa.call(this,[],t)}function Du(t){Go.call(this,null,Cu,t)}function Cu(t){return this.value&&!t.modified()?this.value:Y(t.fields,t.orders)}function Fu(t){pa.call(this,null,t)}function Su(t){pa.call(this,null,t)}Mu.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},ut(Mu,pa,{transform(t,e){const n=!1!==t.interval,i=this._bins(t),o=i.start,a=i.step,u=t.as||["bin0","bin1"],s=u[0],l=u[1];let c;return c=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(r(t.field))?e.ADD_MOD:e.ADD,e.visit(c,n?t=>{const e=i(t);t[s]=e,t[l]=null==e?null:o+a*(1+(e-o)/a)}:t=>t[s]=i(t)),e.modifies(n?u:s)},_bins(t){if(this.value&&!t.modified())return this.value;const i=t.field,o=wa(t),a=o.step;let u,s,l=o.start,c=l+Math.ceil((o.stop-l)/a)*a;null!=(u=t.anchor)&&(s=u-(l+a*Math.floor((u-l)/a)),l+=s,c+=s);const f=function(t){let e=A(i(t));return null==e?null:e<l?-1/0:e>c?1/0:(e=Math.max(l,Math.min(e,c-a)),l+a*Math.floor(1e-14+(e-l)/a))};return f.start=l,f.stop=o.stop,f.step=a,this.value=e(f,r(i),t.name||"bin_"+n(i))}}),Eu.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},ut(Eu,pa,{transform(t,e){const n=e.fork(e.ALL),r=Au(Oo,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(jo(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),ut(Du,Go),Fu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},ut(Fu,pa,{transform(t,e){const n=e=>n=>{for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(u(n),t.case,o)||[],s=0,l=i.length;s<l;++s)a.test(r=i[s])||e(r)},r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,u=t.field,s=t.as||["text","count"],l=n((t=>i[t]=1+(i[t]||0))),c=n((t=>i[t]-=1));return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,s)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let u,s,l;for(u in n)s=r[u],l=n[u]||0,!s&&l?(r[u]=s=Lo({}),s[i]=u,s[o]=l,a.add.push(s)):0===l?(s&&a.rem.push(s),n[u]=null,r[u]=null):s[o]!==l&&(s[o]=l,a.mod.push(s));return a.modifies(e)}}),Su.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},ut(Su,pa,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let u=this.value;return a?(u&&(n.rem=u),u=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],u={},s=t.length,l=0;l<s;++l)for(u[e]=o=t[l],i=0;i<s;++i)u[n]=t[i],r(u)&&(a.push(Lo(u)),(u={})[e]=o);return a}(u,i,o,t.filter||p)):n.mod=u,n.source=this.value,n.modifies(r)}});const Bu={kde:za,mixture:qa,normal:Ta,lognormal:Ua,uniform:Wa},Tu="function";function zu(t,e){const n=t.function;rt(Bu,n)||u("Unknown distribution function: "+n);const r=Bu[n]();for(const n in t)"field"===n?r.data((t.from||e()).map(t[n])):"distributions"===n?r[n](t[n].map((t=>zu(t,e)))):typeof r[n]===Tu&&r[n](t[n]);return r}function Nu(t){pa.call(this,null,t)}const Ou=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Ru={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Ou},{name:"weights",type:"number",array:!0}]};function Lu(t,e){return t?t.map(((t,r)=>e[r]||n(t))):null}function Uu(t,e,n){const r=[],i=t=>t(s);let o,a,u,s,l,c;if(null==e)r.push(t.map(n));else for(o={},a=0,u=t.length;a<u;++a)s=t[a],l=e.map(i),c=o[l],c||(o[l]=c=[],c.dims=l,r.push(c)),c.push(n(s));return r}Nu.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Ou.concat(Ru)},{name:"as",type:"string",array:!0,default:["value","density"]}]},ut(Nu,pa,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=zu(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&u("Invalid density method: "+a),t.extent||r.data||u("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],l=au(a,t.extent||tt(r.data()),i,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],Lo(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function qu(t){pa.call(this,null,t)}qu.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Pu(t){Go.call(this,null,ju,t),this.modified(!0)}function ju(t){const i=t.expr;return this.value&&!t.modified("expr")?this.value:e((e=>i(e,t)),r(i),n(i))}function Iu(t){pa.call(this,[void 0,void 0],t)}function $u(t,e){Go.call(this,t),this.parent=e,this.count=0}function Wu(t){pa.call(this,{},t),this._keys=ot();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;n<r;++n)t(e[n],n,e)}}function Hu(t){Go.call(this,null,Yu,t)}function Yu(t){return this.value&&!t.modified()?this.value:v(t.name)?$(t.name).map((t=>l(t))):l(t.name,t.as)}function Vu(t){pa.call(this,ot(),t)}function Gu(t){pa.call(this,[],t)}function Xu(t){pa.call(this,[],t)}function Ju(t){pa.call(this,null,t)}function Zu(t){pa.call(this,[],t)}ut(qu,pa,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=Uu(e.source,t.groupby,f),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>bt(tt(t,e))/30)(n,o),u=jo(((t,e)=>o(t)-o(e))),s=t.as||"bin",l=r.length;let c,h=1/0,d=-1/0,p=0;for(;p<l;++p){const t=r[p].sort(u);c=-1;for(const e of Ma(t,a,i,o))e<h&&(h=e),e>d&&(d=e),t[++c][s]=e}return this.value={start:h,stop:d,step:a},e.reflow(!0).modifies(s)}}),ut(Pu,Go),Iu.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},ut(Iu,pa,{transform(t,e){const r=this.value,i=t.field,o=e.changed()||e.modified(i.fields)||t.modified("field");let a=r[0],u=r[1];if((o||null==a)&&(a=1/0,u=-1/0),e.visit(o?e.SOURCE:e.ADD,(t=>{const e=A(i(t));null!=e&&(e<a&&(a=e),e>u&&(u=e))})),!Number.isFinite(a)||!Number.isFinite(u)){let t=n(i);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(a,", ").concat(u,"]")),a=u=void 0}this.value=[a,u]}}),ut($u,Go,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),ut(Wu,pa,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,u=rt(i,t)&&i[t];return u?u.value.stamp<n.stamp&&(u.init(n),this.activate(u)):(a=r||(a=this._group[t])&&a.tuple,o=n.dataflow,u=new $u(n.fork(n.NO_SOURCE),this),o.add(u).connect(e(o,t,a)),i[t]=u,this.activate(u)),u},clean(){const t=this.value;for(const e in t)if(0===t[e].count){const n=t[e].detachSubflow;n&&n(),delete t[e]}},initTargets(){const t=this._targets,e=t.length;for(let n=0;n<e&&null!=t[n];++n)t[n]=null;t.active=0},transform(t,e){const n=e.dataflow,r=t.key,i=t.subflow,o=this._keys,a=t.modified("key"),u=t=>this.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=Oo(t),n=o.get(e);void 0!==n&&(o.delete(e),u(n).rem(t))})),e.visit(e.ADD,(t=>{const e=r(t);o.set(Oo(t),e),u(e).add(t)})),a||e.modified(r.fields)?e.visit(e.MOD,(t=>{const e=Oo(t),n=o.get(e),i=r(t);n===i?u(i).mod(t):(o.set(e,i),u(n).rem(t),u(i).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{u(o.get(Oo(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=Oo(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),u(n).rem(t),u(i).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),ut(Hu,Go),Vu.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},ut(Vu,pa,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,u=i.mod,s=t.expr;let l=!0;function c(e){const n=Oo(e),i=s(e,t),c=r.get(n);i&&c?(r.delete(n),o.push(e)):i||c?l&&i&&!c&&u.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=Oo(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{s(e,t)?o.push(e):r.set(Oo(e),1)})),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Gu.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},ut(Gu,pa,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Lu(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=r.map((e=>e(t))),u=e.reduce(((t,e)=>Math.max(t,e.length)),0);let s,l,c,f=0;for(;f<u;++f){for(l=Uo(t),s=0;s<a;++s)l[i[s]]=null==(c=e[s][f])?null:c;o&&(l[o]=f),n.add.push(l)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}}),Xu.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},ut(Xu,pa,{transform(t,e){const r=e.fork(e.NO_SOURCE),i=t.fields,o=i.map(n),a=t.as||["key","value"],u=a[0],s=a[1],l=i.length;return r.rem=this.value,e.visit(e.SOURCE,(t=>{for(let e,n=0;n<l;++n)e=Uo(t),e[u]=o[n],e[s]=i[n](t),r.add.push(e)})),this.value=r.source=r.add,r.modifies(a)}}),Ju.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},ut(Ju,pa,{transform(t,e){const n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,(e=>e[r]=n(e,t)))}}),ut(Zu,pa,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,u=this.value,s=t.size-u.length;if(s>0){for(i=[];--s>=0;)i.push(a=Lo(r(t))),u.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=u.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,u=u.slice(-s);return n.source=this.value=u,n}});const Qu={value:"value",median:Ne,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:Fe,max:Ce},Ku=[];function ts(t){pa.call(this,[],t)}function es(t){ku.call(this,t)}function ns(t){pa.call(this,null,t)}function rs(t){Go.call(this,null,is,t)}function is(t){return this.value&&!t.modified()?this.value:gt(t.fields,t.flat)}function os(t){pa.call(this,[],t),this._pending=null}function as(t,e,n){n.forEach(Lo);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function us(t){pa.call(this,{},t)}function ss(t){Go.call(this,null,ls,t)}function ls(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;r<n;++r)i=e[r],i[0]<o&&(o=i[0]),i[1]>a&&(a=i[1]);return[o,a]}function cs(t){Go.call(this,null,fs,t)}function fs(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function hs(t){pa.call(this,null,t)}function ds(t){ku.call(this,t)}function ps(t){Wu.call(this,t)}function gs(t){pa.call(this,null,t)}function ms(t){pa.call(this,null,t)}function ys(t){pa.call(this,null,t)}ts.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},ut(ts,pa,{transform(t,e){var r,i,o,a,s,l,c,f,h,d,p=e.fork(e.ALL),g=function(t){var e,n=t.method||Qu.value;if(null!=Qu[n])return n===Qu.value?(e=void 0!==t.value?t.value:0,()=>e):Qu[n];u("Unrecognized imputation method: "+n)}(t),m=function(t){const e=t.field;return t=>t?e(t):NaN}(t),y=n(t.field),v=n(t.key),_=(t.groupby||[]).map(n),x=function(t,e,n,r){var i,o,a,u,s,l,c,f,h=t=>t(f),d=[],p=r?r.slice():[],g={},m={};for(p.forEach(((t,e)=>g[t]=e+1)),u=0,c=t.length;u<c;++u)l=n(f=t[u]),s=g[l]||(g[l]=p.push(l)),(a=m[o=(i=e?e.map(h):Ku)+""])||(a=m[o]=[],d.push(a),a.values=i),a[s-1]=f;return d.domain=p,d}(e.source,t.groupby,t.key,t.keyvals),b=[],w=this.value,k=x.domain.length;for(s=0,f=x.length;s<f;++s)for(o=(r=x[s]).values,i=NaN,c=0;c<k;++c)if(null==r[c]){for(a=x.domain[c],d={_impute:!0},l=0,h=o.length;l<h;++l)d[_[l]]=o[l];d[v]=a,d[y]=Number.isNaN(i)?i=g(r,m):i,b.push(Lo(d))}return b.length&&(p.add=p.materialize(p.ADD).add.concat(b)),w.length&&(p.rem=p.materialize(p.REM).rem.concat(w)),this.value=b,p}}),es.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:du},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},ut(es,ku,{transform(t,e){const n=this,r=t.modified();let i;return n.value&&(r||e.modified(n._inputs,!0))?(i=n.value=r?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(i=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{K(t,i[n.cellkey(t)].tuple)})),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(t[n]),t[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),ns.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},ut(ns,pa,{transform(t,e){const r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,o=Uu(i,t.groupby,t.field),a=(t.groupby||[]).map(n),s=t.bandwidth,l=t.cumulative?"cdf":"pdf",c=t.as||["value","density"],f=[];let h=t.extent,d=t.steps||t.minsteps||25,p=t.steps||t.maxsteps||200;"pdf"!==l&&"cdf"!==l&&u("Invalid density method: "+l),"shared"===t.resolve&&(h||(h=tt(i,t.field)),d=p=t.steps||p),o.forEach((e=>{const n=za(e,s)[l],r=t.counts?e.length:1;au(n,h||tt(e),d,p).forEach((t=>{const n={};for(let t=0;t<a.length;++t)n[a[t]]=e.dims[t];n[c[0]]=t[0],n[c[1]]=t[1]*r,f.push(Lo(n))}))})),this.value&&(r.rem=this.value),this.value=r.add=r.source=f}return r}}),ut(rs,Go),ut(os,pa,{transform(t,e){const n=e.dataflow;if(this._pending)return as(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return as(this,e,n.parse(t.values,t.format));if(t.async){return{async:n.request(t.url,t.format).then((t=>(this._pending=$(t.data),t=>t.touch(this))))}}return n.request(t.url,t.format).then((t=>as(this,e,$(t.data))))}}),us.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},ut(us,pa,{transform(t,e){const r=t.fields,i=t.index,o=t.values,a=null==t.default?null:t.default,s=t.modified(),l=r.length;let c,f,h,d=s?e.SOURCE:e.ADD,p=e,g=t.as;return o?(f=o.length,l>1&&!g&&u('Multi-field lookup requires explicit "as" parameter.'),g&&g.length!==l*f&&u('The "as" parameter has too few output field names.'),g=g||o.map(n),c=function(t){for(var e,n,u=0,s=0;u<l;++u)if(null==(n=i.get(r[u](t))))for(e=0;e<f;++e,++s)t[g[s]]=a;else for(e=0;e<f;++e,++s)t[g[s]]=o[e](n)}):(g||u("Missing output field names."),c=function(t){for(var e,n=0;n<l;++n)e=i.get(r[n](t)),t[g[n]]=null==e?a:e}),s?p=e.reflow(!0):(h=r.some((t=>e.modified(t.fields))),d|=h?e.MOD:0),e.visit(d,c),p.modifies(g)}}),ut(ss,Go),ut(cs,Go),ut(hs,pa,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),ds.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:du,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},ut(ds,ku,{_transform:ku.prototype.transform,transform(t,n){return this._transform(function(t,n){const i=t.field,o=t.value,a=("count"===t.op?"__count__":t.op)||"sum",u=r(i).concat(r(o)),s=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,(e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort(V),e?i.slice(0,e):i}(i,t.limit||0,n);n.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:s.map((()=>a)),fields:s.map((t=>function(t,n,r,i){return e((e=>n(e)===t?r(e):NaN),i,t+"")}(t,i,o,u))),as:s.map((t=>t+"")),modified:t.modified.bind(t)}}(t,n),n)}}),ut(ps,Wu,{transform(t,e){const n=t.subflow,i=t.field,o=t=>this.subflow(Oo(t),n,e,t);return(t.modified("field")||i&&e.modified(r(i)))&&u("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(t=>{const e=o(t);i(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=o(t);i(t).forEach((t=>e.add(Lo(t))))})),e.visit(e.REM,(t=>{const e=o(t);i(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>o(t).mod(t))),e.visit(e.ADD,(t=>o(t).add(t))),e.visit(e.REM,(t=>o(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),gs.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},ut(gs,pa,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Lu(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,r,i):qo;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,(t=>{const e=Oo(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,Lo({}));a[Oo(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[Oo(t)]))})),n}}),ut(ms,pa,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),ys.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function vs(t){pa.call(this,null,t)}function _s(t){pa.call(this,[],t),this.count=0}function xs(t){pa.call(this,null,t)}function bs(t){pa.call(this,null,t),this.modified(!0)}function ws(t){pa.call(this,null,t)}ut(ys,pa,{transform(t,e){const r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return r.source=this.value,r;const o=Uu(e.materialize(e.SOURCE).source,t.groupby,t.field),a=(t.groupby||[]).map(n),u=[],s=t.step||.01,l=t.probs||Re(s/2,1-1e-14,s),c=l.length;return o.forEach((t=>{const e=_a(t,l);for(let n=0;n<c;++n){const r={};for(let e=0;e<a.length;++e)r[a[e]]=t.dims[e];r[i[0]]=l[n],r[i[1]]=e[n],u.push(Lo(r))}})),this.value&&(r.rem=this.value),this.value=r.add=r.source=u,r}}),ut(vs,pa,{transform(t,e){let n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(t=>{const e=Oo(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(t=>{const e=Uo(t);r[Oo(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=r[Oo(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)}))),n}}),_s.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},ut(_s,pa,{transform(e,n){const r=n.fork(n.NO_SOURCE),i=e.modified("size"),o=e.size,a=this.value.reduce(((t,e)=>(t[Oo(e)]=1,t)),{});let u=this.value,s=this.count,l=0;function c(e){let n,i;u.length<o?u.push(e):(i=~~((s+1)*t.random()),i<u.length&&i>=l&&(n=u[i],a[Oo(n)]&&r.rem.push(n),u[i]=e)),++s}if(n.rem.length&&(n.visit(n.REM,(t=>{const e=Oo(t);a[e]&&(a[e]=-1,r.rem.push(t)),--s})),u=u.filter((t=>-1!==a[Oo(t)]))),(n.rem.length||i)&&u.length<o&&n.source&&(l=s=u.length,n.visit(n.SOURCE,(t=>{a[Oo(t)]||c(t)})),l=-1),i&&u.length>o){const t=u.length-o;for(let e=0;e<t;++e)a[Oo(u[e])]=-1,r.rem.push(u[e]);u=u.slice(t)}return n.mod.length&&n.visit(n.MOD,(t=>{a[Oo(t)]&&r.mod.push(t)})),n.add.length&&n.visit(n.ADD,c),(n.add.length||l<0)&&(r.add=u.filter((t=>!a[Oo(t)]))),this.count=s,this.value=r.source=u,r}}),xs.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},ut(xs,pa,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Re(t.start,t.stop,t.step||1).map((t=>{const e={};return e[r]=t,Lo(e)})),n.add=e.add.concat(this.value),n}}),ut(bs,pa,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const ks=["unit0","unit1"];function Ms(t){pa.call(this,ot(),t)}function As(t){pa.call(this,null,t)}ws.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:In,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:ks}]},ut(ws,pa,{transform(t,e){const n=t.field,i=!1!==t.interval,o="utc"===t.timezone,a=this._floor(t,e),u=(o?vr:yr)(a.unit).offset,s=t.as||ks,l=s[0],c=s[1],f=a.step;let h=a.start||1/0,d=a.stop||-1/0,p=e.ADD;return(t.modified()||e.modified(r(n)))&&(p=(e=e.reflow(!0)).SOURCE,h=1/0,d=-1/0),e.visit(p,(t=>{const e=n(t);let r,o;null==e?(t[l]=null,i&&(t[c]=null)):(t[l]=r=o=a(e),i&&(t[c]=o=u(r,f)),r<h&&(h=r),o>d&&(d=o))})),a.start=h,a.stop=d,e.modifies(i?s:l)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:qr({extent:t.extent||tt(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Wn(r),a=this.value||{},u=(n?pr:fr)(o,i);return u.unit=M(o),u.units=o,u.step=i,u.start=a.start,u.stop=a.stop,this.value=u}}),ut(Ms,pa,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>i.delete(r(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),ut(As,pa,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(jo(t.sort)):e.source).map(t.field))}});const Es={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=Es.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;t=i}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||u("ntile num must be greater than zero.");const n=Es.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||u("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};const Ds=Object.keys(Es);function Cs(t){const e=$(t.ops),i=$(t.fields),o=$(t.params),a=$(t.as),s=this.outputs=[],l=this.windows=[],c={},f={},d=[],p=[];let g=!0;function m(t){$(r(t)).forEach((t=>c[t]=1))}m(t.sort),e.forEach(((t,e)=>{const r=i[e],c=n(r),y=lu(t,c,a[e]);if(m(r),s.push(y),rt(Es,t))l.push(function(t,e,n,r){const i=Es[t](e,n);return{init:i.init||h,update:function(t,e){e[r]=i.next(t)}}}(t,i[e],o[e],y));else{if(null==r&&"count"!==t&&u("Null aggregate field specified."),"count"===t)return void d.push(y);g=!1;let e=f[c];e||(e=f[c]=[],e.field=r,p.push(e)),e.push(pu(t,y))}})),(d.length||p.length)&&(this.cell=function(t,e,n){t=t.map((t=>xu(t,t.field)));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var u=r.data=new bu;return r.add=function(t){if(r.num+=1,!n){u&&u.add(t);for(let e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){u&&u.rem(t);for(let e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){let i,a;for(u&&u.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,u&&u.reset();for(let t=0;t<i;++t)o[t].init()},r}(p,d,g)),this.inputs=Object.keys(c)}const Fs=Cs.prototype;function Ss(t){pa.call(this,{},t),this._mlen=0,this._mods=[]}function Bs(t,e,n,r){const i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],u=t.data(n),s=u.length,l=o?me(i):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:u,compare:i||Z(-1)};e.init();for(let t=0;t<s;++t)Ts(c,a,t,s),o&&zs(c,l),e.update(c,u[t])}function Ts(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function zs(t,e){const n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}Fs.init=function(){this.windows.forEach((t=>t.init())),this.cell&&this.cell.init()},Fs.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(i[a]);for(a=t.p1;a<t.i1;++a)n.add(i[a]);n.set(e)}for(a=0;a<o;++a)r[a].update(t,e)},Ss.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ds.concat(du)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},ut(Ss,pa,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),r=jo(t.sort),i=su(t.groupby),o=t=>this.group(i(t));let a=this.state;a&&!n||(a=this.state=new Cs(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let e=0,n=this._mlen;e<n;++e)Bs(this._mods[e],a,r,t);return this._mlen=0,this._mods=[],e.reflow(n).modifies(a.outputs)},group(t){let e=this.value[t];return e||(e=this.value[t]=Au(Oo),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}});var Ns=Object.freeze({__proto__:null,aggregate:ku,bin:Mu,collect:Eu,compare:Du,countpattern:Fu,cross:Su,density:Nu,dotbin:qu,expression:Pu,extent:Iu,facet:Wu,field:Hu,filter:Vu,flatten:Gu,fold:Xu,formula:Ju,generate:Zu,impute:ts,joinaggregate:es,kde:ns,key:rs,load:os,lookup:us,multiextent:ss,multivalues:cs,params:hs,pivot:ds,prefacet:ps,project:gs,proxy:ms,quantile:ys,relay:vs,sample:_s,sequence:xs,sieve:bs,subflow:$u,timeunit:ws,tupleindex:Ms,values:As,window:Ss});const Os=Math.PI,Rs=2*Os,Ls=1e-6,Us=Rs-Ls;function qs(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ps(){return new qs}function js(t){return function(){return t}}qs.prototype=Ps.prototype={constructor:qs,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,u=n-t,s=r-e,l=o-t,c=a-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>Ls)if(Math.abs(c*u-s*l)>Ls&&i){var h=n-o,d=r-a,p=u*u+s*s,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Os-Math.acos((p+f-g)/(2*m*y)))/2),_=v/y,x=v/m;Math.abs(_-1)>Ls&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*d)+","+(this._x1=t+x*u)+","+(this._y1=e+x*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+a,l=e+u,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>Ls||Math.abs(this._y1-l)>Ls)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%Rs+Rs),f>Us?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>Ls&&(this._+="A"+n+","+n+",0,"+ +(f>=Os)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Is=Math.abs,$s=Math.atan2,Ws=Math.cos,Hs=Math.max,Ys=Math.min,Vs=Math.sin,Gs=Math.sqrt,Xs=1e-12,Js=Math.PI,Zs=Js/2,Qs=2*Js;function Ks(t){return t>1?0:t<-1?Js:Math.acos(t)}function tl(t){return t>=1?Zs:t<=-1?-Zs:Math.asin(t)}function el(t){return t.innerRadius}function nl(t){return t.outerRadius}function rl(t){return t.startAngle}function il(t){return t.endAngle}function ol(t){return t&&t.padAngle}function al(t,e,n,r,i,o,a,u){var s=n-t,l=r-e,c=a-i,f=u-o,h=f*s-c*l;if(!(h*h<Xs))return[t+(h=(c*(e-o)-f*(t-i))/h)*s,e+h*l]}function ul(t,e,n,r,i,o,a){var u=t-n,s=e-r,l=(a?o:-o)/Gs(u*u+s*s),c=l*s,f=-l*u,h=t+c,d=e+f,p=n+c,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,_=g-d,x=v*v+_*_,b=i-o,w=h*g-p*d,k=(_<0?-1:1)*Gs(Hs(0,b*b*x-w*w)),M=(w*_-v*k)/x,A=(-w*v-_*k)/x,E=(w*_+v*k)/x,D=(-w*v+_*k)/x,C=M-m,F=A-y,S=E-m,B=D-y;return C*C+F*F>S*S+B*B&&(M=E,A=D),{cx:M,cy:A,x01:-c,y01:-f,x11:M*(i/b-1),y11:A*(i/b-1)}}function sl(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ll(t){this._context=t}function cl(t){return new ll(t)}function fl(t){return t[0]}function hl(t){return t[1]}function dl(t,e){var n=js(!0),r=null,i=cl,o=null;function a(a){var u,s,l,c=(a=sl(a)).length,f=!1;for(null==r&&(o=i(l=Ps())),u=0;u<=c;++u)!(u<c&&n(s=a[u],u,a))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(s,u,a),+e(s,u,a));if(l)return o=null,l+""||null}return t="function"==typeof t?t:void 0===t?fl:js(t),e="function"==typeof e?e:void 0===e?hl:js(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:js(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:js(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:js(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}function pl(t,e,n){var r=null,i=js(!0),o=null,a=cl,u=null;function s(s){var l,c,f,h,d,p=(s=sl(s)).length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(u=a(d=Ps())),l=0;l<=p;++l){if(!(l<p&&i(h=s[l],l,s))===g)if(g=!g)c=l,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),f=l-1;f>=c;--f)u.point(m[f],y[f]);u.lineEnd(),u.areaEnd()}g&&(m[l]=+t(h,l,s),y[l]=+e(h,l,s),u.point(r?+r(h,l,s):m[l],n?+n(h,l,s):y[l]))}if(d)return u=null,d+""||null}function l(){return dl().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?fl:js(+t),e="function"==typeof e?e:js(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?hl:js(+n),s.x=function(e){return arguments.length?(t="function"==typeof e?e:js(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:js(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:js(+t),s):r},s.y=function(t){return arguments.length?(e="function"==typeof t?t:js(+t),n=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:js(+t),s):e},s.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:js(+t),s):n},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(n)},s.lineX1=function(){return l().x(r).y(e)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:js(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}ll.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var gl={draw:function(t,e){var n=Math.sqrt(e/Js);t.moveTo(n,0),t.arc(0,0,n,0,Qs)}};function ml(){}function yl(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function vl(t){this._context=t}function _l(t){this._context=t}function xl(t){this._context=t}function bl(t,e){this._basis=new vl(t),this._beta=e}vl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:yl(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:yl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},_l.prototype={areaStart:ml,areaEnd:ml,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:yl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:yl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},bl.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*e[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var wl=function t(e){function n(t){return 1===e?new vl(t):new bl(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function kl(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ml(t,e){this._context=t,this._k=(1-e)/6}Ml.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kl(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:kl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Al=function t(e){function n(t){return new Ml(t,e)}return n.tension=function(e){return t(+e)},n}(0);function El(t,e){this._context=t,this._k=(1-e)/6}El.prototype={areaStart:ml,areaEnd:ml,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Dl=function t(e){function n(t){return new El(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Cl(t,e){this._context=t,this._k=(1-e)/6}Cl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Fl=function t(e){function n(t){return new Cl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Sl(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Xs){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>Xs){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Bl(t,e){this._context=t,this._alpha=e}Bl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Sl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tl=function t(e){function n(t){return e?new Bl(t,e):new Ml(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function zl(t,e){this._context=t,this._alpha=e}zl.prototype={areaStart:ml,areaEnd:ml,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Sl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Nl=function t(e){function n(t){return e?new zl(t,e):new El(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ol(t,e){this._context=t,this._alpha=e}Ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Sl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Rl=function t(e){function n(t){return e?new Ol(t,e):new Cl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ll(t){this._context=t}function Ul(t){return t<0?-1:1}function ql(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Ul(o)+Ul(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Pl(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function jl(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function Il(t){this._context=t}function $l(t){this._context=new Wl(t)}function Wl(t){this._context=t}function Hl(t){this._context=t}function Yl(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function Vl(t,e){this._context=t,this._t=e}function Gl(t,e){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}Ll.prototype={areaStart:ml,areaEnd:ml,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Il.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:jl(this,this._t0,Pl(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,jl(this,Pl(this,n=ql(this,t,e)),n);break;default:jl(this,this._t0,n=ql(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},($l.prototype=Object.create(Il.prototype)).point=function(t,e){Il.prototype.point.call(this,e,t)},Wl.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Hl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=Yl(t),i=Yl(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Vl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const Xl=()=>"undefined"!=typeof Image?Image:null;function Jl(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Zl(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Ql=Symbol("implicit");function Kl(){var t=new Map,e=[],n=[],r=Ql;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Ql)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Kl(e,n).unknown(r)},Jl.apply(i,arguments),i}function tc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ec(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function nc(){}var rc=.7,ic=1/rc,oc="\\s*([+-]?\\d+)\\s*",ac="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",uc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sc=/^#([0-9a-f]{3,8})$/,lc=new RegExp("^rgb\\("+[oc,oc,oc]+"\\)$"),cc=new RegExp("^rgb\\("+[uc,uc,uc]+"\\)$"),fc=new RegExp("^rgba\\("+[oc,oc,oc,ac]+"\\)$"),hc=new RegExp("^rgba\\("+[uc,uc,uc,ac]+"\\)$"),dc=new RegExp("^hsl\\("+[ac,uc,uc]+"\\)$"),pc=new RegExp("^hsla\\("+[ac,uc,uc,ac]+"\\)$"),gc={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 mc(){return this.rgb().formatHex()}function yc(){return this.rgb().formatRgb()}function vc(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=sc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_c(e):3===n?new kc(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xc(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=lc.exec(t))?new kc(e[1],e[2],e[3],1):(e=cc.exec(t))?new kc(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=fc.exec(t))?xc(e[1],e[2],e[3],e[4]):(e=hc.exec(t))?xc(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dc.exec(t))?Dc(e[1],e[2]/100,e[3]/100,1):(e=pc.exec(t))?Dc(e[1],e[2]/100,e[3]/100,e[4]):gc.hasOwnProperty(t)?_c(gc[t]):"transparent"===t?new kc(NaN,NaN,NaN,0):null}function _c(t){return new kc(t>>16&255,t>>8&255,255&t,1)}function xc(t,e,n,r){return r<=0&&(t=e=n=NaN),new kc(t,e,n,r)}function bc(t){return t instanceof nc||(t=vc(t)),t?new kc((t=t.rgb()).r,t.g,t.b,t.opacity):new kc}function wc(t,e,n,r){return 1===arguments.length?bc(t):new kc(t,e,n,null==r?1:r)}function kc(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Mc(){return"#"+Ec(this.r)+Ec(this.g)+Ec(this.b)}function Ac(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ec(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Dc(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Sc(t,e,n,r)}function Cc(t){if(t instanceof Sc)return new Sc(t.h,t.s,t.l,t.opacity);if(t instanceof nc||(t=vc(t)),!t)return new Sc;if(t instanceof Sc)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n<r):n===o?(r-e)/u+2:(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new Sc(a,u,s,t.opacity)}function Fc(t,e,n,r){return 1===arguments.length?Cc(t):new Sc(t,e,n,null==r?1:r)}function Sc(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Bc(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}tc(nc,vc,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:mc,formatHex:mc,formatHsl:function(){return Cc(this).formatHsl()},formatRgb:yc,toString:yc}),tc(kc,wc,ec(nc,{brighter:function(t){return t=null==t?ic:Math.pow(ic,t),new kc(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?rc:Math.pow(rc,t),new kc(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mc,formatHex:Mc,formatRgb:Ac,toString:Ac})),tc(Sc,Fc,ec(nc,{brighter:function(t){return t=null==t?ic:Math.pow(ic,t),new Sc(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?rc:Math.pow(rc,t),new Sc(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new kc(Bc(t>=240?t-240:t+120,i,r),Bc(t,i,r),Bc(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Tc=Math.PI/180,zc=180/Math.PI,Nc=.96422,Oc=.82521,Rc=4/29,Lc=6/29,Uc=3*Lc*Lc;function qc(t){if(t instanceof jc)return new jc(t.l,t.a,t.b,t.opacity);if(t instanceof Gc)return Xc(t);t instanceof kc||(t=bc(t));var e,n,r=Hc(t.r),i=Hc(t.g),o=Hc(t.b),a=Ic((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=Ic((.4360747*r+.3850649*i+.1430804*o)/Nc),n=Ic((.0139322*r+.0971045*i+.7141733*o)/Oc)),new jc(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Pc(t,e,n,r){return 1===arguments.length?qc(t):new jc(t,e,n,null==r?1:r)}function jc(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Ic(t){return t>.008856451679035631?Math.pow(t,1/3):t/Uc+Rc}function $c(t){return t>Lc?t*t*t:Uc*(t-Rc)}function Wc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Hc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Yc(t){if(t instanceof Gc)return new Gc(t.h,t.c,t.l,t.opacity);if(t instanceof jc||(t=qc(t)),0===t.a&&0===t.b)return new Gc(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*zc;return new Gc(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Vc(t,e,n,r){return 1===arguments.length?Yc(t):new Gc(t,e,n,null==r?1:r)}function Gc(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Xc(t){if(isNaN(t.h))return new jc(t.l,0,0,t.opacity);var e=t.h*Tc;return new jc(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}tc(jc,Pc,ec(nc,{brighter:function(t){return new jc(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new jc(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,n=isNaN(this.b)?t:t-this.b/200;return new kc(Wc(3.1338561*(e=Nc*$c(e))-1.6168667*(t=1*$c(t))-.4906146*(n=Oc*$c(n))),Wc(-.9787684*e+1.9161415*t+.033454*n),Wc(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),tc(Gc,Vc,ec(nc,{brighter:function(t){return new Gc(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Gc(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Xc(this).rgb()}}));var Jc=-.14861,Zc=1.78277,Qc=-.29227,Kc=-.90649,tf=1.97294,ef=tf*Kc,nf=tf*Zc,rf=Zc*Qc-Kc*Jc;function of(t){if(t instanceof uf)return new uf(t.h,t.s,t.l,t.opacity);t instanceof kc||(t=bc(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(rf*r+ef*e-nf*n)/(rf+ef-nf),o=r-i,a=(tf*(n-i)-Qc*o)/Kc,u=Math.sqrt(a*a+o*o)/(tf*i*(1-i)),s=u?Math.atan2(a,o)*zc-120:NaN;return new uf(s<0?s+360:s,u,i,t.opacity)}function af(t,e,n,r){return 1===arguments.length?of(t):new uf(t,e,n,null==r?1:r)}function uf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function sf(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function lf(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<e-1?t[r+2]:2*o-i;return sf((n-r/e)*e,a,i,o,u)}}function cf(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return sf((n-r/e)*e,i,o,a,u)}}tc(uf,af,ec(nc,{brighter:function(t){return t=null==t?ic:Math.pow(ic,t),new uf(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?rc:Math.pow(rc,t),new uf(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Tc,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new kc(255*(e+n*(Jc*r+Zc*i)),255*(e+n*(Qc*r+Kc*i)),255*(e+n*(tf*r)),this.opacity)}}));var ff=t=>()=>t;function hf(t,e){return function(n){return t+n*e}}function df(t,e){var n=e-t;return n?hf(t,n>180||n<-180?n-360*Math.round(n/360):n):ff(isNaN(t)?e:t)}function pf(t){return 1==(t=+t)?gf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):ff(isNaN(e)?n:e)}}function gf(t,e){var n=e-t;return n?hf(t,n):ff(isNaN(t)?e:t)}var mf=function t(e){var n=pf(e);function r(t,e){var r=n((t=wc(t)).r,(e=wc(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=gf(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function yf(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;n<i;++n)r=wc(e[n]),o[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}var vf=yf(lf),_f=yf(cf);function xf(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function bf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function wf(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Ff(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function kf(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Mf(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Af(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Ff(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var Ef=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Df=new RegExp(Ef.source,"g");function Cf(t,e){var n,r,i,o=Ef.lastIndex=Df.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=Ef.exec(t))&&(r=Df.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Mf(n,r)})),o=Df.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}function Ff(t,e){var n,r=typeof e;return null==e||"boolean"===r?ff(e):("number"===r?Mf:"string"===r?(n=vc(e))?(e=n,mf):Cf:e instanceof vc?mf:e instanceof Date?kf:bf(e)?xf:Array.isArray(e)?wf:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Af:Mf)(t,e)}function Sf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Bf,Tf=180/Math.PI,zf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Nf(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Tf,skewX:Math.atan(s)*Tf,scaleX:a,scaleY:u}}function Of(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,e,null,n);u.push({i:s-4,x:Mf(t,i)},{i:s-2,x:Mf(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,u,s),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Mf(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Mf(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Mf(t,n)},{i:u-2,x:Mf(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n<r;)u[(e=s[n]).i]=e.x(t);return u.join("")}}}var Rf=Of((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?zf:Nf(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Lf=Of((function(t){return null==t?zf:(Bf||(Bf=document.createElementNS("http://www.w3.org/2000/svg","g")),Bf.setAttribute("transform",t),(t=Bf.transform.baseVal.consolidate())?Nf((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):zf)}),", ",")",")");function Uf(t){return((t=Math.exp(t))+1/t)/2}var qf=function t(e,n,r){function i(t,i){var o,a,u=t[0],s=t[1],l=t[2],c=i[0],f=i[1],h=i[2],d=c-u,p=f-s,g=d*d+p*p;if(g<1e-12)a=Math.log(h/l)/e,o=function(t){return[u+t*d,s+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(h*h-l*l+r*g)/(2*l*n*m),v=(h*h-l*l-r*g)/(2*h*n*m),_=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-_)/e,o=function(t){var r=t*a,i=Uf(_),o=l/(n*m)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*r+_)-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[u+o*d,s+o*p,l*i/Uf(e*r+_)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function Pf(t){return function(e,n){var r=t((e=Fc(e)).h,(n=Fc(n)).h),i=gf(e.s,n.s),o=gf(e.l,n.l),a=gf(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var jf=Pf(df),If=Pf(gf);function $f(t){return function(e,n){var r=t((e=Vc(e)).h,(n=Vc(n)).h),i=gf(e.c,n.c),o=gf(e.l,n.l),a=gf(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var Wf=$f(df),Hf=$f(gf);function Yf(t){return function e(n){function r(e,r){var i=t((e=af(e)).h,(r=af(r)).h),o=gf(e.s,r.s),a=gf(e.l,r.l),u=gf(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=u(t),e+""}}return n=+n,r.gamma=e,r}(1)}var Vf=Yf(df),Gf=Yf(gf);function Xf(t,e){void 0===e&&(e=t,t=Ff);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}var Jf=Object.freeze({__proto__:null,interpolate:Ff,interpolateArray:function(t,e){return(bf(e)?xf:wf)(t,e)},interpolateBasis:lf,interpolateBasisClosed:cf,interpolateDate:kf,interpolateDiscrete:function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},interpolateHue:function(t,e){var n=df(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},interpolateNumber:Mf,interpolateNumberArray:xf,interpolateObject:Af,interpolateRound:Sf,interpolateString:Cf,interpolateTransformCss:Rf,interpolateTransformSvg:Lf,interpolateZoom:qf,interpolateRgb:mf,interpolateRgbBasis:vf,interpolateRgbBasisClosed:_f,interpolateHsl:jf,interpolateHslLong:If,interpolateLab:function(t,e){var n=gf((t=Pc(t)).l,(e=Pc(e)).l),r=gf(t.a,e.a),i=gf(t.b,e.b),o=gf(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}},interpolateHcl:Wf,interpolateHclLong:Hf,interpolateCubehelix:Vf,interpolateCubehelixLong:Gf,piecewise:Xf,quantize:function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}});function Zf(t){return+t}var Qf=[0,1];function Kf(t){return t}function th(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function eh(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=th(i,r),o=n(a,o)):(r=th(r,i),o=n(o,a)),function(t){return o(r(t))}}function nh(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=th(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=_e(t,e,1,r)-1;return o[n](i[n](e))}}function rh(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ih(){var t,e,n,r,i,o,a=Qf,u=Qf,s=Ff,l=Kf;function c(){var t=Math.min(a.length,u.length);return l!==Kf&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?nh:eh,i=o=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),u,s)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(u,a.map(t),Mf)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Zf),c()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),c()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),s=Sf,c()},f.clamp=function(t){return arguments.length?(l=!!t||Kf,c()):l!==Kf},f.interpolate=function(t){return arguments.length?(s=t,c()):s},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function oh(){return ih()(Kf,Kf)}function ah(t,e,n,r){var i,o=De(t,e,n);switch((r=Ie(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=tn(o,a))||(r.precision=i),Xe(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=en(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ke(o))||(r.precision=i-2*("%"===r.type))}return Ge(r)}function uh(t){var e=t.domain;return t.ticks=function(t){var n=e();return Ae(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ah(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,u=o.length-1,s=o[a],l=o[u],c=10;for(l<s&&(i=s,s=l,l=i,i=a,a=u,u=i);c-- >0;){if((i=Ee(s,l,n))===r)return o[a]=s,o[u]=l,e(o);if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function sh(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function lh(t){return Math.log(t)}function ch(t){return Math.exp(t)}function fh(t){return-Math.log(-t)}function hh(t){return-Math.exp(-t)}function dh(t){return isFinite(t)?+("1e"+t):t<0?0:t}function ph(t){return function(e){return-t(-e)}}function gh(t){var e,n,r=t(lh,ch),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?dh:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=ph(e),n=ph(n),t(fh,hh)):t(lh,ch),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),u=a[0],s=a[a.length-1];(r=s<u)&&(h=u,u=s,s=h);var l,c,f,h=e(u),d=e(s),p=null==t?10:+t,g=[];if(!(o%1)&&d-h<p){if(h=Math.floor(h),d=Math.ceil(d),u>0){for(;h<=d;++h)for(c=1,l=n(h);c<o;++c)if(!((f=l*c)<u)){if(f>s)break;g.push(f)}}else for(;h<=d;++h)for(c=o-1,l=n(h);c>=1;--c)if(!((f=l*c)<u)){if(f>s)break;g.push(f)}2*g.length<p&&(g=Ae(u,s,p))}else g=Ae(h,d,Math.min(d-h,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Ge(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(sh(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function mh(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function yh(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function vh(t){var e=1,n=t(mh(e),yh(e));return n.constant=function(n){return arguments.length?t(mh(e=+n),yh(e)):e},uh(n)}function _h(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function xh(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function bh(t){return t<0?-t*t:t*t}function wh(t){var e=t(Kf,Kf),n=1;function r(){return 1===n?t(Kf,Kf):.5===n?t(xh,bh):t(_h(n),_h(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},uh(e)}function kh(){var t=wh(ih());return t.copy=function(){return rh(t,kh()).exponent(t.exponent())},Jl.apply(t,arguments),t}var Mh=1e3,Ah=6e4,Eh=36e5,Dh=864e5,Ch=2592e6,Fh=31536e6;function Sh(t){return new Date(t)}function Bh(t){return t instanceof Date?+t:+new Date(+t)}function Th(t,e,n,r,i,o,a,u,s){var l=oh(),c=l.invert,f=l.domain,h=s(".%L"),d=s(":%S"),p=s("%I:%M"),g=s("%I %p"),m=s("%a %d"),y=s("%b %d"),v=s("%B"),_=s("%Y"),x=[[a,1,Mh],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,Ah],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,Eh],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Dh],[r,2,1728e5],[n,1,6048e5],[e,1,Ch],[e,3,7776e6],[t,1,Fh]];function b(u){return(a(u)<u?h:o(u)<u?d:i(u)<u?p:r(u)<u?g:e(u)<u?n(u)<u?m:y:t(u)<u?v:_)(u)}function w(e,n,r){if(null==e&&(e=10),"number"==typeof e){var i,o=Math.abs(r-n)/e,a=me((function(t){return t[2]})).right(x,o);return a===x.length?(i=De(n/Fh,r/Fh,e),e=t):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max(De(n,r,e),1),e=u),e.every(i)}return e}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?f(Array.from(t,Bh)):f().map(Sh)},l.ticks=function(t){var e,n=f(),r=n[0],i=n[n.length-1],o=i<r;return o&&(e=r,r=i,i=e),e=(e=w(t,r,i))?e.range(r,i+1):[],o?e.reverse():e},l.tickFormat=function(t,e){return null==e?b:s(e)},l.nice=function(t){var e=f();return(t=w(t,e[0],e[e.length-1]))?f(sh(e,t)):l},l.copy=function(){return rh(l,Th(t,e,n,r,i,o,a,u,s))},l}function zh(){var t,e,n,r,i,o=0,a=1,u=Kf,s=!1;function l(e){return isNaN(e=+e)?i:u(0===n?.5:(e=(r(e)-t)*n,s?Math.max(0,Math.min(1,e)):e))}function c(t){return function(e){var n,r;return arguments.length?([n,r]=e,u=t(n,r),l):[u(0),u(1)]}}return l.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(s=!!t,l):s},l.interpolator=function(t){return arguments.length?(u=t,l):u},l.range=c(Ff),l.rangeRound=c(Sf),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}function Nh(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Oh(){var t=uh(zh()(Kf));return t.copy=function(){return Nh(t,Oh())},Zl.apply(t,arguments)}function Rh(){var t=wh(zh());return t.copy=function(){return Nh(t,Rh()).exponent(t.exponent())},Zl.apply(t,arguments)}function Lh(){var t,e,n,r,i,o,a,u=0,s=.5,l=1,c=1,f=Kf,h=!1;function d(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(c*t<c*e?r:i),f(h?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=Xf(t,[n,r,i]),d):[f(0),f(.5),f(1)]}}return d.domain=function(a){return arguments.length?([u,s,l]=a,t=o(u=+u),e=o(s=+s),n=o(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d):[u,s,l]},d.clamp=function(t){return arguments.length?(h=!!t,d):h},d.interpolator=function(t){return arguments.length?(f=t,d):f},d.range=p(Ff),d.rangeRound=p(Sf),d.unknown=function(t){return arguments.length?(a=t,d):a},function(a){return o=a,t=a(u),e=a(s),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d}}function Uh(){var t=wh(Lh());return t.copy=function(){return Nh(t,Uh()).exponent(t.exponent())},Zl.apply(t,arguments)}function qh(t,e,n){const r=t-e+2*n;return t?r>0?r:1:0}const Ph="linear",jh="log",Ih="pow",$h="sqrt",Wh="symlog",Hh="time",Yh="utc",Vh="sequential",Gh="diverging",Xh="quantile",Jh="quantize",Zh="threshold",Qh="ordinal",Kh="point",td="band",ed="bin-ordinal",nd="continuous",rd="discrete",id="discretizing",od="interpolating",ad="temporal";function ud(){const t=Kl().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,u=0,s=0,l=.5;function c(){const t=e().length,c=o[1]<o[0],f=o[1-c],h=qh(t,u,s);let d=o[c-0];r=(f-d)/(h||1),a&&(r=Math.floor(r)),d+=(f-d-r*(t-u))*l,i=r*(1-u),a&&(d=Math.round(d),i=Math.round(i));const p=Re(t).map((t=>d+r*t));return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u=s,c()):u},t.paddingInner=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.paddingOuter=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]<o[0],a=r?n().reverse():n(),u=a.length-1;let s,l,c,f=+t[0],h=+t[1];return f!=f||h!=h||(h<f&&(c=f,f=h,h=c),h<a[0]||f>o[1-r])?void 0:(s=Math.max(0,_e(a,f)-1),l=f===h?s:_e(a,h)-1,f-a[s]>i+1e-10&&++s,r&&(c=s,s=u-l,l=u-c),s>l?void 0:e().slice(s,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return ud().domain(e()).range(o).round(a).paddingInner(u).paddingOuter(s).align(l)},c()}function sd(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return sd(e())},t}var ld=Array.prototype.map;function cd(t){return ld.call(t,A)}const fd=Array.prototype.slice;const hd={};function dd(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let r,i,o,a,u=e[0],s=e[1],l=-1;for(s<u&&(i=u,u=s,s=i),o=0,a=n.length;o<a;++o)n[o]>=u&&n[o]<=s&&(l<0&&(l=o),r=o);if(!(l<0))return u=t.invertExtent(n[l]),s=t.invertExtent(n[r]),[void 0===u[0]?u[1]:u[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=t,n};return r.metadata=Dt($(n)),r}function pd(t,e,n){return arguments.length>1?(hd[t]=dd(t,e,n),this):gd(t)?hd[t]:void 0}function gd(t){return rt(hd,t)}function md(t,e){const n=hd[t];return n&&n.metadata[e]}function yd(t){return md(t,nd)}function vd(t){return md(t,rd)}function _d(t){return md(t,id)}function xd(t){return md(t,jh)}function bd(t){return md(t,od)}function wd(t){return md(t,Xh)}pd("identity",(function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Zf),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Zf):[0,1],uh(r)})),pd(Ph,(function t(){var e=oh();return e.copy=function(){return rh(e,t())},Jl.apply(e,arguments),uh(e)}),nd),pd(jh,(function t(){var e=gh(ih()).domain([1,10]);return e.copy=function(){return rh(e,t()).base(e.base())},Jl.apply(e,arguments),e}),[nd,jh]),pd(Ih,kh,nd),pd($h,(function(){return kh.apply(null,arguments).exponent(.5)}),nd),pd(Wh,(function t(){var e=vh(ih());return e.copy=function(){return rh(e,t()).constant(e.constant())},Jl.apply(e,arguments)}),nd),pd(Hh,(function(){return Jl.apply(Th(bn,xn,yn,gn,pn,dn,hn,an,Hr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[nd,ad]),pd(Yh,(function(){return Jl.apply(Th(Sn,Fn,En,Mn,kn,wn,hn,an,Vr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[nd,ad]),pd(Vh,Oh,[nd,od]),pd("".concat(Vh,"-").concat(Ph),Oh,[nd,od]),pd("".concat(Vh,"-").concat(jh),(function t(){var e=gh(zh()).domain([1,10]);return e.copy=function(){return Nh(e,t()).base(e.base())},Zl.apply(e,arguments)}),[nd,od,jh]),pd("".concat(Vh,"-").concat(Ih),Rh,[nd,od]),pd("".concat(Vh,"-").concat($h),(function(){return Rh.apply(null,arguments).exponent(.5)}),[nd,od]),pd("".concat(Vh,"-").concat(Wh),(function t(){var e=vh(zh());return e.copy=function(){return Nh(e,t()).constant(e.constant())},Zl.apply(e,arguments)}),[nd,od]),pd("".concat(Gh,"-").concat(Ph),(function t(){var e=uh(Lh()(Kf));return e.copy=function(){return Nh(e,t())},Zl.apply(e,arguments)}),[nd,od]),pd("".concat(Gh,"-").concat(jh),(function t(){var e=gh(Lh()).domain([.1,1,10]);return e.copy=function(){return Nh(e,t()).base(e.base())},Zl.apply(e,arguments)}),[nd,od,jh]),pd("".concat(Gh,"-").concat(Ih),Uh,[nd,od]),pd("".concat(Gh,"-").concat($h),(function(){return Uh.apply(null,arguments).exponent(.5)}),[nd,od]),pd("".concat(Gh,"-").concat(Wh),(function t(){var e=vh(Lh());return e.copy=function(){return Nh(e,t()).constant(e.constant())},Zl.apply(e,arguments)}),[nd,od]),pd(Xh,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=ze(n,t/e);return a}function a(t){return isNaN(t=+t)?e:r[_e(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(ge),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},Jl.apply(a,arguments)}),[id,Xh]),pd(Jh,(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function u(t){return t<=t?a[_e(o,t,0,i)]:e}function s(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return u}return u.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,s()):[n,r]},u.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,s()):a.slice()},u.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},u.unknown=function(t){return arguments.length?(e=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([n,r]).range(a).unknown(e)},Jl.apply(uh(u),arguments)}),id),pd(Zh,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return t<=t?r[_e(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},Jl.apply(o,arguments)}),id),pd(ed,(function t(){let e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(_e(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=cd(t),r):e.slice()},r.range=function(t){return arguments.length?(n=fd.call(t),r):n.slice()},r.tickFormat=function(t,n){return ah(e[0],M(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),[rd,id]),pd(Qh,Kl,rd),pd(td,ud,rd),pd(Kh,(function(){return sd(ud().paddingInner(1))}),rd);const kd=["clamp","base","constant","exponent"];function Md(t,e){const n=e[0],r=M(e)-n;return function(e){return t(n+e*r)}}function Ad(t,e,n){return Xf(Cd(e||"rgb",n),t)}function Ed(t,e){const n=new Array(e),r=e+1;for(let i=0;i<e;)n[i]=t(++i/r);return n}function Dd(t,e,n){const r=n-e;let i,o,a;return r&&Number.isFinite(r)?(i=(o=t.type).indexOf("-"),o=i<0?o:o.slice(i+1),a=pd(o)().domain([e,n]).range([0,1]),kd.forEach((e=>t[e]?a[e](t[e]()):0)),a):Z(.5)}function Cd(t,e){const n=Jf[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function Fd(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function Sd(t,e){for(const n in t)Td(n,e(t[n]))}const Bd={};function Td(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Bd[t]=e,this):Bd[t]}Sd({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},Fd),Sd({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(t=>Ad(Fd(t))));const zd="symbol",Nd=t=>v(t)?t.map((t=>String(t))):String(t),Od=(t,e)=>t[1]-e[1],Rd=(t,e)=>e[1]-t[1];function Ld(t,e,n){let r;return ht(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(bt(t.domain())/n||1)))),_(e)&&(r=e.step,e=e.interval),pt(e)&&(e=t.type===Hh?yr(e):t.type==Yh?vr(e):u("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function Ud(t,e,n){let r=t.range(),i=r[0],o=M(r),a=Od;if(i>o&&(r=o,o=i,i=r,a=Rd),i=Math.floor(i),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>i<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],M(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function qd(t,e){return t.bins?Ud(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Pd(t,e,n,r,i,o){const a=e.type;let u=Nd;if(a===Hh||i===Hh)u=t.timeFormat(r);else if(a===Yh||i===Yh)u=t.utcFormat(r);else if(xd(a)){const i=t.formatFloat(r);if(o||e.bins)u=i;else{const t=jd(e,n,!1);u=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();u=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(u=t.format(r));return u}function jd(t,e,n){const r=qd(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),u=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(u):u}const Id={[Xh]:"quantiles",[Jh]:"thresholds",[Zh]:"domain"},$d={[Xh]:"quantiles",[Jh]:"domain"};function Wd(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=M(t),e}(t.bins):t.type===jh?jd(t,e,!0):Id[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[Id[t.type]]()):qd(t,e)}function Hd(t,e,n,r,i,o,a){const u=$d[e.type]&&o!==Hh&&o!==Yh?function(t,e,n){const r=e[$d[e.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o<i;++o)a=Math.min(a,r[o]-r[o-1]);return t.formatSpan(0,a,30,n)}(t,e,i):Pd(t,e,n,i,o,a);return r===zd&&(t=>Id[t.type]||t.bins)(e)?Yd(u):"discrete"===r?Gd(u):Xd(u)}const Yd=t=>(e,n,r)=>{const i=Vd(r[n+1],Vd(r.max,1/0)),o=Jd(e,t),a=Jd(i,t);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Vd=(t,e)=>null!=t?t:e,Gd=t=>(e,n)=>n?t(e):null,Xd=t=>e=>t(e),Jd=(t,e)=>Number.isFinite(t)?e(t):null;function Zd(t,e,n,r){const i=r||e.type;return pt(n)&&function(t){return md(t,ad)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Hh?n||i!==Yh?Hd(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function Qd(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Zd(t,e,n.format,n.formatType);if(_d(e.type)){const t=Wd(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(vd(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i(M(t)))}}let Kd=0;const tp="p_";function ep(t){return t&&t.gradient}function np(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?tp:"";return i||(i=t.id="gradient_"+Kd++,"radial"===r?(t.x1=rp(t.x1,.5),t.y1=rp(t.y1,.5),t.r1=rp(t.r1,0),t.x2=rp(t.x2,.5),t.y2=rp(t.y2,.5),t.r2=rp(t.r2,.5),o=tp):(t.x1=rp(t.x1,0),t.y1=rp(t.y1,0),t.x2=rp(t.x2,1),t.y2=rp(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function rp(t,e){return null!=t?t:e}function ip(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const op={basis:{curve:function(t){return new vl(t)}},"basis-closed":{curve:function(t){return new _l(t)}},"basis-open":{curve:function(t){return new xl(t)}},bundle:{curve:wl,tension:"beta",value:.85},cardinal:{curve:Al,tension:"tension",value:0},"cardinal-open":{curve:Fl,tension:"tension",value:0},"cardinal-closed":{curve:Dl,tension:"tension",value:0},"catmull-rom":{curve:Tl,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Nl,tension:"alpha",value:.5},"catmull-rom-open":{curve:Rl,tension:"alpha",value:.5},linear:{curve:cl},"linear-closed":{curve:function(t){return new Ll(t)}},monotone:{horizontal:function(t){return new $l(t)},vertical:function(t){return new Il(t)}},natural:{curve:function(t){return new Hl(t)}},step:{curve:function(t){return new Vl(t,.5)}},"step-after":{curve:function(t){return new Vl(t,1)}},"step-before":{curve:function(t){return new Vl(t,0)}}};function ap(t,e,n){var r=rt(op,t)&&op[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const up={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},sp=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function lp(t){const e=[];let n,r,i,o,a,u,s,l,c,f;const h=t.slice().replace(sp[0],"###$1").split(sp[1]).slice(1);for(s=0,c=h.length;s<c;++s){for(n=h[s],r=n.slice(1).trim().replace(sp[2],"$1###$2").replace(sp[3],"$1###$2").split(sp[4]),a=n.charAt(0),i=[a],l=0,f=r.length;l<f;++l)(o=+r[l])===o&&i.push(o);if(u=up[a.toLowerCase()],i.length-1>u){const t=i.length;for(l=1,e.push([a].concat(i.slice(l,l+=u))),a="M"===a?"L":"m"===a?"l":a;l<t;l+=u)e.push([a].concat(i.slice(l,l+u)))}else e.push(i)}return e}const cp=Math.PI/180,fp=Math.PI/2,hp=2*Math.PI,dp=Math.sqrt(3)/2;var pp={},gp={},mp=[].join;function yp(t){const e=mp.call(t);if(gp[e])return gp[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],l=t[7];const c=l*a,f=-s*u,h=s*a,d=l*u,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),y=Math.sin(o),v=.5*(o-i),_=Math.sin(.5*v),x=8/3*_*_/Math.sin(v),b=n+p-x*g,w=r+g+x*p,k=n+m,M=r+y,A=k+x*y,E=M-x*m;return gp[e]=[c*b+f*w,h*b+d*w,c*A+f*E,h*A+d*E,c*k+f*M,h*k+d*M]}const vp=["l",0,0,0,0,0,0,0];function _p(t,e,n){const r=vp[0]=t[0];if("a"===r||"A"===r)vp[1]=e*t[1],vp[2]=n*t[2],vp[3]=t[3],vp[4]=t[4],vp[5]=t[5],vp[6]=e*t[6],vp[7]=n*t[7];else if("h"===r||"H"===r)vp[1]=e*t[1];else if("v"===r||"V"===r)vp[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)vp[i]=(i%2==1?e:n)*t[i];return vp}function xp(t,e,n,r,i,o){var a,u,s,l,c,f=null,h=0,d=0,p=0,g=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var m=0,y=e.length;m<y;++m){switch(a=e[m],1===i&&1===o||(a=_p(a,i,o)),a[0]){case"l":h+=a[1],d+=a[2],t.lineTo(h+n,d+r);break;case"L":h=a[1],d=a[2],t.lineTo(h+n,d+r);break;case"h":h+=a[1],t.lineTo(h+n,d+r);break;case"H":h=a[1],t.lineTo(h+n,d+r);break;case"v":d+=a[1],t.lineTo(h+n,d+r);break;case"V":d=a[1],t.lineTo(h+n,d+r);break;case"m":h+=a[1],d+=a[2],t.moveTo(h+n,d+r);break;case"M":h=a[1],d=a[2],t.moveTo(h+n,d+r);break;case"c":u=h+a[5],s=d+a[6],p=h+a[3],g=d+a[4],t.bezierCurveTo(h+a[1]+n,d+a[2]+r,p+n,g+r,u+n,s+r),h=u,d=s;break;case"C":h=a[5],d=a[6],p=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,g+r,h+n,d+r);break;case"s":u=h+a[3],s=d+a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,h+a[1]+n,d+a[2]+r,u+n,s+r),p=h+a[1],g=d+a[2],h=u,d=s;break;case"S":u=a[3],s=a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,a[1]+n,a[2]+r,u+n,s+r),h=u,d=s,p=a[1],g=a[2];break;case"q":u=h+a[3],s=d+a[4],p=h+a[1],g=d+a[2],t.quadraticCurveTo(p+n,g+r,u+n,s+r),h=u,d=s;break;case"Q":u=a[3],s=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,u+n,s+r),h=u,d=s,p=a[1],g=a[2];break;case"t":u=h+a[1],s=d+a[2],null===f[0].match(/[QqTt]/)?(p=h,g=d):"t"===f[0]?(p=2*h-l,g=2*d-c):"q"===f[0]&&(p=2*h-p,g=2*d-g),l=p,c=g,t.quadraticCurveTo(p+n,g+r,u+n,s+r),d=s,p=(h=u)+a[1],g=d+a[2];break;case"T":u=a[1],s=a[2],p=2*h-p,g=2*d-g,t.quadraticCurveTo(p+n,g+r,u+n,s+r),h=u,d=s;break;case"a":bp(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+h+n,a[7]+d+r]),h+=a[6],d+=a[7];break;case"A":bp(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),h=a[6],d=a[7];break;case"z":case"Z":t.closePath()}f=a}}function bp(t,e,n,r){const i=function(t,e,n,r,i,o,a,u,s){const l=mp.call(arguments);if(pp[l])return pp[l];const c=a*cp,f=Math.sin(c),h=Math.cos(c),d=h*(u-t)*.5+f*(s-e)*.5,p=h*(s-e)*.5-f*(u-t)*.5;let g=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);const m=h/n,y=f/n,v=-f/r,_=h/r,x=m*u+y*s,b=v*u+_*s,w=m*t+y*e,k=v*t+_*e;let M=1/((w-x)*(w-x)+(k-b)*(k-b))-.25;M<0&&(M=0);let A=Math.sqrt(M);o==i&&(A=-A);const E=.5*(x+w)-A*(k-b),D=.5*(b+k)+A*(w-x),C=Math.atan2(b-D,x-E);let F=Math.atan2(k-D,w-E)-C;F<0&&1===o?F+=hp:F>0&&0===o&&(F-=hp);const S=Math.ceil(Math.abs(F/(fp+.001))),B=[];for(let t=0;t<S;++t){const e=C+t*F/S,i=C+(t+1)*F/S;B[t]=[E,D,e,i,n,r,f,h]}return pp[l]=B}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n);for(let e=0;e<i.length;++e){const n=yp(i[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}const wp=.5773502691896257,kp={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,hp)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n,i=r-n*wp,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n,i=r-n*wp;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=dp*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function Mp(t){return rt(kp,t)?kp[t]:function(t){if(!rt(Ap,t)){const e=lp(t);Ap[t]={draw:function(t,n){xp(t,e,0,0,Math.sqrt(n)/2)}}}return Ap[t]}(t)}var Ap={};const Ep=.448084975506;function Dp(t){return t.x}function Cp(t){return t.y}function Fp(t){return t.width}function Sp(t){return t.height}function Bp(t){return"function"==typeof t?t:()=>+t}function Tp(t,e,n){return Math.max(e,Math.min(t,n))}function zp(){var t=Dp,e=Cp,n=Fp,r=Sp,i=Bp(0),o=i,a=i,u=i,s=null;function l(l,c,f){var h,d=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=Tp(+i.call(this,l),0,y),_=Tp(+o.call(this,l),0,y),x=Tp(+a.call(this,l),0,y),b=Tp(+u.call(this,l),0,y);if(s||(s=h=Ps()),v<=0&&_<=0&&x<=0&&b<=0)s.rect(d,p,g,m);else{var w=d+g,k=p+m;s.moveTo(d+v,p),s.lineTo(w-_,p),s.bezierCurveTo(w-Ep*_,p,w,p+Ep*_,w,p+_),s.lineTo(w,k-b),s.bezierCurveTo(w,k-Ep*b,w-Ep*b,k,w-b,k),s.lineTo(d+x,k),s.bezierCurveTo(d+Ep*x,k,d,k-Ep*x,d,k-x),s.lineTo(d,p+v),s.bezierCurveTo(d,p+Ep*v,d+Ep*v,p,d+v,p),s.closePath()}if(h)return s=null,h+""||null}return l.x=function(e){return arguments.length?(t=Bp(e),l):t},l.y=function(t){return arguments.length?(e=Bp(t),l):e},l.width=function(t){return arguments.length?(n=Bp(t),l):n},l.height=function(t){return arguments.length?(r=Bp(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=Bp(t),o=null!=e?Bp(e):i,u=null!=n?Bp(n):i,a=null!=r?Bp(r):o,l):i},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Np(){var t,e,n,r,i,o,a,u,s=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*u,d=(c/=f)*u,p=Math.atan2(c,l);s.moveTo(o-h,a-d),s.lineTo(t-l*r,e-c*r),s.arc(t,e,r,p-Math.PI,p),s.lineTo(o+h,a+d),s.arc(o,a,u,p,p+Math.PI)}else s.arc(t,e,r,0,hp);s.closePath()}else i=1;o=t,a=e,u=r}function c(o){var a,u,c,f=o.length,h=!1;for(null==s&&(s=c=Ps()),a=0;a<=f;++a)!(a<f&&r(u=o[a],a,o))===h&&(h=!h)&&(i=0),h&&l(+t(u,a,o),+e(u,a,o),+n(u,a,o));if(c)return s=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}function Op(t,e){return null!=t?t:e}const Rp=t=>t.x||0,Lp=t=>t.y||0,Up=t=>!(!1===t.defined),qp=function(){var t=el,e=nl,n=js(0),r=null,i=rl,o=il,a=ol,u=null;function s(){var s,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-Zs,d=o.apply(this,arguments)-Zs,p=Is(d-h),g=d>h;if(u||(u=s=Ps()),f<c&&(l=f,f=c,c=l),f>Xs)if(p>Qs-Xs)u.moveTo(f*Ws(h),f*Vs(h)),u.arc(0,0,f,h,d,!g),c>Xs&&(u.moveTo(c*Ws(d),c*Vs(d)),u.arc(0,0,c,d,h,g));else{var m,y,v=h,_=d,x=h,b=d,w=p,k=p,M=a.apply(this,arguments)/2,A=M>Xs&&(r?+r.apply(this,arguments):Gs(c*c+f*f)),E=Ys(Is(f-c)/2,+n.apply(this,arguments)),D=E,C=E;if(A>Xs){var F=tl(A/c*Vs(M)),S=tl(A/f*Vs(M));(w-=2*F)>Xs?(x+=F*=g?1:-1,b-=F):(w=0,x=b=(h+d)/2),(k-=2*S)>Xs?(v+=S*=g?1:-1,_-=S):(k=0,v=_=(h+d)/2)}var B=f*Ws(v),T=f*Vs(v),z=c*Ws(b),N=c*Vs(b);if(E>Xs){var O,R=f*Ws(_),L=f*Vs(_),U=c*Ws(x),q=c*Vs(x);if(p<Js&&(O=al(B,T,U,q,R,L,z,N))){var P=B-O[0],j=T-O[1],I=R-O[0],$=L-O[1],W=1/Vs(Ks((P*I+j*$)/(Gs(P*P+j*j)*Gs(I*I+$*$)))/2),H=Gs(O[0]*O[0]+O[1]*O[1]);D=Ys(E,(c-H)/(W-1)),C=Ys(E,(f-H)/(W+1))}}k>Xs?C>Xs?(m=ul(U,q,B,T,f,C,g),y=ul(R,L,z,N,f,C,g),u.moveTo(m.cx+m.x01,m.cy+m.y01),C<E?u.arc(m.cx,m.cy,C,$s(m.y01,m.x01),$s(y.y01,y.x01),!g):(u.arc(m.cx,m.cy,C,$s(m.y01,m.x01),$s(m.y11,m.x11),!g),u.arc(0,0,f,$s(m.cy+m.y11,m.cx+m.x11),$s(y.cy+y.y11,y.cx+y.x11),!g),u.arc(y.cx,y.cy,C,$s(y.y11,y.x11),$s(y.y01,y.x01),!g))):(u.moveTo(B,T),u.arc(0,0,f,v,_,!g)):u.moveTo(B,T),c>Xs&&w>Xs?D>Xs?(m=ul(z,N,R,L,c,-D,g),y=ul(B,T,U,q,c,-D,g),u.lineTo(m.cx+m.x01,m.cy+m.y01),D<E?u.arc(m.cx,m.cy,D,$s(m.y01,m.x01),$s(y.y01,y.x01),!g):(u.arc(m.cx,m.cy,D,$s(m.y01,m.x01),$s(m.y11,m.x11),!g),u.arc(0,0,c,$s(m.cy+m.y11,m.cx+m.x11),$s(y.cy+y.y11,y.cx+y.x11),g),u.arc(y.cx,y.cy,D,$s(y.y11,y.x11),$s(y.y01,y.x01),!g))):u.arc(0,0,c,b,x,g):u.lineTo(z,N)}else u.moveTo(0,0);if(u.closePath(),s)return u=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Js/2;return[Ws(r)*n,Vs(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:js(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:js(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:js(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:js(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:js(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:js(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:js(+t),s):a},s.context=function(t){return arguments.length?(u=null==t?null:t,s):u},s}().startAngle((t=>t.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),Pp=pl().x(Rp).y1(Lp).y0((t=>(t.y||0)+(t.height||0))).defined(Up),jp=pl().y(Lp).x1(Rp).x0((t=>(t.x||0)+(t.width||0))).defined(Up),Ip=dl().x(Rp).y(Lp).defined(Up),$p=zp().x(Rp).y(Lp).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>Op(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>Op(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>Op(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>Op(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),Wp=function(t,e){var n=null;function r(){var r;if(n||(n=r=Ps()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:js(t||gl),e="function"==typeof e?e:js(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:js(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:js(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>Mp(t.shape||"circle"))).size((t=>Op(t.size,64))),Hp=Np().x(Rp).y(Lp).defined(Up).size((t=>t.size||1));function Yp(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Vp(t,e,n,r){return $p.context(t)(e,n,r)}var Gp=1;function Xp(){Gp=1}function Jp(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+Gp++),a=i.clipping[o]||(i.clipping[o]={id:o});return H(r)?a.path=r(null):Yp(n)?a.path=Vp(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Zp(t){this.clear(),t&&this.union(t)}function Qp(t){this.mark=t,this.bounds=this.bounds||new Zp}function Kp(t){Qp.call(this,t),this.items=this.items||[]}function tg(t){this._pending=0,this._loader=t||Fo()}function eg(t){t._pending+=1}function ng(t){t._pending-=1}function rg(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}Zp.prototype={clone(){return new Zp(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,u=Math.cos(t),s=Math.sin(t),l=e-e*u+n*s,c=n-e*s-n*u;return[u*r-s*i+l,s*r+u*i+c,u*r-s*a+l,s*r+u*a+c,u*o-s*i+l,s*o+u*i+c,u*o-s*a+l,s*o+u*a+c]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ut(Kp,Qp),tg.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return eg(e),e._loader.sanitize(t,{context:"href"}).then((t=>(ng(e),t))).catch((()=>(ng(e),null)))},loadImage(t){const e=this,n=Xl();return eg(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=rt(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>ng(e),i.onerror=()=>ng(e),i.src=r,i})).catch((t=>(ng(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(r){t.pending()?setTimeout((()=>{n(!0)}),10):e(r)}(!1)}))}};const ig=hp-1e-8;let og,ag,ug,sg,lg,cg,fg,hg;const dg=(t,e)=>og.add(t,e),pg=(t,e)=>dg(ag=t,ug=e),gg=t=>dg(t,og.y1),mg=t=>dg(og.x1,t),yg=(t,e)=>lg*t+fg*e,vg=(t,e)=>cg*t+hg*e,_g=(t,e)=>dg(yg(t,e),vg(t,e)),xg=(t,e)=>pg(yg(t,e),vg(t,e));function bg(t,e){return og=t,e?(sg=e*cp,lg=hg=Math.cos(sg),cg=Math.sin(sg),fg=-cg):(lg=hg=1,sg=cg=fg=0),wg}const wg={beginPath(){},closePath(){},moveTo:xg,lineTo:xg,rect(t,e,n,r){sg?(_g(t+n,e),_g(t+n,e+r),_g(t,e+r),xg(t,e)):(dg(t+n,e+r),pg(t,e))},quadraticCurveTo(t,e,n,r){const i=yg(t,e),o=vg(t,e),a=yg(n,r),u=vg(n,r);kg(ag,i,a,gg),kg(ug,o,u,mg),pg(a,u)},bezierCurveTo(t,e,n,r,i,o){const a=yg(t,e),u=vg(t,e),s=yg(n,r),l=vg(n,r),c=yg(i,o),f=vg(i,o);Mg(ag,a,s,c,gg),Mg(ug,u,l,f,mg),pg(c,f)},arc(t,e,n,r,i,o){if(r+=sg,i+=sg,ag=n*Math.cos(i)+t,ug=n*Math.sin(i)+e,Math.abs(i-r)>ig)dg(t-n,e-n),dg(t+n,e+n);else{const a=r=>dg(n*Math.cos(r)+t,n*Math.sin(r)+e);let u,s;if(a(r),a(i),i!==r)if((r%=hp)<0&&(r+=hp),(i%=hp)<0&&(i+=hp),i<r&&(o=!o,u=r,r=i,i=u),o)for(i-=hp,u=r-r%fp,s=0;s<4&&u>i;++s,u-=fp)a(u);else for(u=r-r%fp+fp,s=0;s<4&&u<i;++s,u+=fp)a(u)}}};function kg(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function Mg(t,e,n,r,i){const o=r-t+3*e-3*n,a=t+n-2*e,u=t-e;let s,l=0,c=0;Math.abs(o)>1e-14?(s=a*a+u*o,s>=0&&(s=Math.sqrt(s),l=(-a+s)/o,c=(-a-s)/o)):l=.5*u/a,0<l&&l<1&&i(Ag(l,t,e,n,r)),0<c&&c<1&&i(Ag(c,t,e,n,r))}function Ag(t,e,n,r,i){const o=1-t,a=o*o,u=t*t;return a*o*e+3*a*t*n+3*o*u*r+u*t*i}var Eg=(Eg=Gl(1,1))?Eg.getContext("2d"):null;const Dg=new Zp;function Cg(t){return function(e,n){if(!Eg)return!0;t(Eg,e),Dg.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=Dg;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(Eg.isPointInPath(e,t))return!0;return!1}}function Fg(t,e){return e.contains(t.x||0,t.y||0)}function Sg(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(Dg.set(n,r,n+i,r+o))}function Bg(t,e){const n=t.x||0,r=t.y||0;return Tg(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function Tg(t,e,n,r,i){const{x1:o,y1:a,x2:u,y2:s}=t,l=r-e,c=i-n;let f,h,d,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-l,h=-(o-e)),1===p&&(f=l,h=u-e),2===p&&(f=-c,h=-(a-n)),3===p&&(f=c,h=s-n),Math.abs(f)<1e-10&&h<0)return!1;if(d=h/f,f<0){if(d>m)return!1;d>g&&(g=d)}else if(f>0){if(d<g)return!1;d<m&&(m=d)}}return!0}function zg(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Ng(t,e){return null==t?e:t}function Og(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function Rg(t,e,n){return ep(n)?function(t,e,n){const r=n.width(),i=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+Ng(e.x1,.5)*r,n.y1+Ng(e.y1,.5)*i,Math.max(r,i)*Ng(e.r1,0),n.x1+Ng(e.x2,.5)*r,n.y1+Ng(e.y2,.5)*i,Math.max(r,i)*Ng(e.r2,.5));else{const a=Ng(e.x1,0),u=Ng(e.y1,0),s=Ng(e.x2,1),l=Ng(e.y2,0);if(a!==s&&u!==l&&r!==i){const n=Gl(Math.ceil(r),Math.ceil(i)),o=n.getContext("2d");return o.scale(r,i),o.fillStyle=Og(o.createLinearGradient(a,u,s,l),e.stops),o.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*r,n.y1+u*i,n.x1+s*r,n.y1+l*i)}return Og(o,e.stops)}(t,n,e.bounds):n}function Lg(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Rg(t,e,e.fill),!0)}var Ug=[];function qg(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Rg(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Ug),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Pg(t,e){return t.zindex-e.zindex||t.index-e.index}function jg(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Pg)}function Ig(t,e){var n,r,i=t.items;if(!i||!i.length)return;const o=jg(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}function $g(t,e){var n,r,i=t.items;if(!i||!i.length)return null;const o=jg(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function Wg(t){return function(e,n,r){Ig(n,(n=>{r&&!r.intersects(n.bounds)||Yg(t,e,n,n)}))}}function Hg(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Yg(t,e,n.items[0],n.items)}}function Yg(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(zg(e,n),n.fill&&Lg(e,n,i)&&e.fill(),n.stroke&&qg(e,n,i)&&e.stroke()))}function Vg(t){return t=t||p,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,$g(n,(n=>{const u=n.bounds;if((!u||u.contains(o,a))&&u)return t(e,n,r,i,o,a)?n:void 0}))}}function Gg(t,e){return function(n,r,i,o){var a,u,s=Array.isArray(r)?r[0]:r,l=null==e?s.fill:e,c=s.stroke&&n.isPointInStroke;return c&&(a=s.strokeWidth,u=s.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=u?u:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function Xg(t){return Vg(Gg(t))}function Jg(t,e){return"translate("+t+","+e+")"}function Zg(t){return"rotate("+t+")"}function Qg(t){return Jg(t.x||0,t.y||0)}function Kg(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=cp),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return Jg(t.x||0,t.y||0)+(t.angle?" "+Zg(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(bg(t,n.angle),n),rg(t,n).translate(n.x||0,n.y||0)},draw:Wg(r),pick:Xg(r),isect:n||Cg(r)}}var tm=Kg("arc",(function(t,e){return qp.context(t)(e)}));function em(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=Gg(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(bg(t),r),rg(t,r[0]))},draw:Hg(r),pick:function(t,e,n,r,o,a){var u=e.items,s=e.bounds;return!u||!u.length||s&&!s.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,u,n,r)?u[0]:null)},isect:Fg,tip:n}}var nm=em("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?jp:Pp).curve(ap(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,u=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<u&&(u=r,n=t[a]);return n}));function rm(t,e){t.beginPath(),Yp(e)?Vp(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function im(t){const e=Ng(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function om(t,e){const n=im(e);t("d",Vp(null,e,n,n))}function am(t,e,n,r){const i=im(e);t.beginPath(),Vp(t,e,(n||0)+i,(r||0)+i)}const um=Gg(am),sm=Gg(am,!1),lm=Gg(am,!0);var cm={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Qg(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e<r;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),rg(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){Ig(e,(e=>{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(am(t,e,r,i),zg(t,e),e.fill&&Lg(t,e,a)&&t.fill(),e.stroke&&!o&&qg(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&rm(t,e),n&&n.translate(-r,-i),Ig(e,(e=>{this.draw(t,e,n)})),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(am(t,e,r,i),zg(t,e),qg(t,e,a)&&t.stroke())}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,u=r*t.pixelRatio;return $g(e,(s=>{let l,c,f;const h=s.bounds;if(h&&!h.contains(i,o))return;c=s.x||0,f=s.y||0;const d=c+(s.width||0),p=f+(s.height||0),g=s.clip;if(g&&(i<c||i>d||o<f||o>p))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&Yp(s)&&!lm(t,s,a,u))return t.restore(),null;const m=s.strokeForeground,y=!1!==e.interactive;return y&&m&&s.stroke&&sm(t,s,a,u)?(t.restore(),s):(l=$g(s,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null)),!l&&y&&(s.fill||!m&&s.stroke)&&um(t,s,a,u)&&(l=s),t.restore(),l||null)}))},isect:Sg,content:function(t,e,n){t("clip-path",e.clip?Jp(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),om(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?om(t,e):t("d","")}},fm={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function hm(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function dm(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function pm(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function gm(t,e){return"center"===t?e/2:"right"===t?e:0}function mm(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var ym={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=hm(e,n),i=dm(e,r),o=pm(e,r),a=(e.x||0)-gm(e.align,i),u=(e.y||0)-mm(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",fm["xmlns:xlink"],"xlink:href"),t("transform",Jg(a,u)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=dm(e,n),i=pm(e,n),o=(e.x||0)-gm(e.align,r),a=(e.y||0)-mm(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){Ig(e,(e=>{if(n&&!n.intersects(e.bounds))return;const r=hm(e,this);let i,o,a,u,s=dm(e,r),l=pm(e,r),c=(e.x||0)-gm(e.align,s),f=(e.y||0)-mm(e.baseline,l);!1!==e.aspect&&(o=r.width/r.height,a=e.width/e.height,o==o&&a==a&&o!==a&&(a<o?(u=s/o,f+=(l-u)/2,l=u):(u=l*o,c+=(s-u)/2,s=u))),(r.complete||r.toDataURL)&&(zg(t,e),t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(r,c,f,s,l))}))},pick:Vg(),isect:p,get:hm,xOffset:gm,yOffset:mm},vm=em("line",(function(t,e){const n=e[0],r=n.interpolate||"linear";return Ip.curve(ap(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function _m(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,u=(e.angle||0)*cp,s=e.pathCache;s&&s.path===n||((e.pathCache=s=lp(n)).path=n),u&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(u),xp(t,s,0,0,o,a),t.rotate(-u),t.translate(-r,-i)):xp(t,s,r,i,o,a)}var xm={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return Jg(t.x||0,t.y||0)+(t.angle?" "+Zg(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}(e)),t("d",e.path)},bound:function(t,e){return _m(bg(t,e.angle),e)?t.set(0,0,0,0):rg(t,e,!0)},draw:Wg(_m),pick:Xg(_m),isect:Cg(_m)};function bm(t,e){t.beginPath(),Vp(t,e)}var wm={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Vp(null,e))},bound:function(t,e){var n,r;return rg(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:Wg(bm),pick:Xg(bm),isect:Sg};function km(t,e,n){var r,i,o,a;return!(!e.stroke||!qg(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Mm={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Qg(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return rg(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){Ig(e,(e=>{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&km(t,e,r)&&(zg(t,e),t.stroke())}}))},pick:Vg((function(t,e,n,r){return!!t.isPointInStroke&&(km(t,e,1)&&t.isPointInStroke(n,r))})),isect:Bg},Am=Kg("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Em=Kg("symbol",(function(t,e){return Wp.context(t)(e)}),Fg);const Dm=yt();var Cm={height:Nm,measureWidth:Tm,estimateWidth:Sm,width:Sm,canvas:Fm};function Fm(t){Cm.width=t&&Eg?Tm:Sm}function Sm(t,e){return Bm(Um(t,e),Nm(t))}function Bm(t,e){return~~(.8*t.length*e)}function Tm(t,e){return Nm(t)<=0||!(e=Um(t,e))?0:zm(e,Pm(t))}function zm(t,e){const n="(".concat(e,") ").concat(t);let r=Dm.get(n);return void 0===r&&(Eg.font=e,r=Eg.measureText(t).width,Dm.set(n,r)),r}function Nm(t){return null!=t.fontSize?+t.fontSize||0:11}function Om(t){return null!=t.lineHeight?t.lineHeight:Nm(t)+2}function Rm(t){return e=t.lineBreak&&t.text&&!v(t.text)?t.text.split(t.lineBreak):t.text,v(e)?e.length>1?e:e[0]:e;var e}function Lm(t){const e=Rm(t);return(v(e)?e.length-1:0)*Om(t)}function Um(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(Cm.width===Tm){const e=Pm(t);return t=>zm(t,e)}{const e=Nm(t);return t=>Bm(t,e)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"…",a="rtl"===t.dir,u=0,s=e.length;if(n-=r(o),a){for(;u<s;)i=u+s>>>1,r(e.slice(i))>n?u=i+1:s=i;return o+e.slice(u)}for(;u<s;)i=1+(u+s>>>1),r(e.slice(0,i))<n?u=i:s=i-1;return e.slice(0,u)+o}(t,n):n}function qm(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Pm(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Nm(t)+"px "+qm(t,e)}function jm(t){var e=t.baseline,n=Nm(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Om(t):"line-bottom"===e?.29*n-.5*Om(t):0)}Fm(!0);const Im={left:"start",center:"middle",right:"end"},$m=new Zp;function Wm(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-fp,n+=i*Math.cos(e),r+=i*Math.sin(e)),$m.x1=n,$m.y1=r,$m}function Hm(t,e,n){var r,i=Cm.height(e),o=e.align,a=Wm(e),u=a.x1,s=a.y1,l=e.dx||0,c=(e.dy||0)+jm(e)-Math.round(.8*i),f=Rm(e);if(v(f)?(i+=Om(e)*(f.length-1),r=f.reduce(((t,n)=>Math.max(t,Cm.width(e,n))),0)):r=Cm.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=u,c+=s,l+r,c+i),e.angle&&!n)t.rotate(e.angle*cp,u,s);else if(2===n)return t.rotatedPoints(e.angle*cp,u,s);return t}var Ym={arc:tm,area:nm,group:cm,image:ym,line:vm,path:xm,rect:wm,rule:Mm,shape:Am,symbol:Em,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+jm(e),o=Wm(e),a=o.x1,u=o.y1,s=e.angle||0;t("text-anchor",Im[e.align]||"start"),s?(n=Jg(a,u)+" "+Zg(s),(r||i)&&(n+=" "+Jg(r,i))):n=Jg(a+r,u+i),t("transform",n)},bound:Hm,draw:function(t,e,n){Ig(e,(e=>{var r,i,o,a,u,s,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Pm(e),t.textAlign=e.align||"left",i=(r=Wm(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*cp),i=o=0),i+=e.dx||0,o+=(e.dy||0)+jm(e),s=Rm(e),zg(t,e),v(s))for(u=Om(e),a=0;a<s.length;++a)l=Um(e,s[a]),e.fill&&Lg(t,e,c)&&t.fillText(l,i,o),e.stroke&&qg(t,e,c)&&t.strokeText(l,i,o),o+=u;else l=Um(e,s),e.fill&&Lg(t,e,c)&&t.fillText(l,i,o),e.stroke&&qg(t,e,c)&&t.strokeText(l,i,o);e.angle&&t.restore()}}))},pick:Vg((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=Wm(e),u=a.x1,s=a.y1,l=Hm($m,e,1),c=-e.angle*cp,f=Math.cos(c),h=Math.sin(c),d=f*i-h*o+(u-f*u+h*s),p=h*i+f*o+(s-h*u-f*s);return l.contains(d,p)})),isect:function(t,e){const n=Hm($m,t,2);return Tg(e,n[0],n[1],n[2],n[3])||Tg(e,n[0],n[1],n[4],n[5])||Tg(e,n[4],n[5],n[6],n[7])||Tg(e,n[2],n[3],n[6],n[7])}},trail:em("trail",(function(t,e){return Hp.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))};function Vm(t,e,n){var r=Ym[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new Zp),t,n)}var Gm={mark:null};function Xm(t,e,n){var r,i,o,a,u=Ym[t.marktype],s=u.bound,l=t.items,c=l&&l.length;if(u.nested)return c?o=l[0]:(Gm.mark=t,o=Gm),a=Vm(o,s,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new Zp,c)for(r=0,i=l.length;r<i;++r)e.union(Vm(l[r],s,n));return t.bounds=e}const Jm=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Zm(t,e){return JSON.stringify(t,Jm,e)}function Qm(t){return Km("string"==typeof t?JSON.parse(t):t)}function Km(t){var e,n,r,i=t.marktype,o=t.items;if(o)for(n=0,r=o.length;n<r;++n)e=i?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(i||e)&&Km(o[n]);return i&&Xm(t),t}function ty(t){arguments.length?this.root=Qm(t):(this.root=ey({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Kp(this.root)])}function ey(t,e){const n={bounds:new Zp,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function ny(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function ry(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function iy(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=ny(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function oy(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function ay(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function uy(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function sy(t,e){this._active=null,this._handlers={},this._loader=t||Fo(),this._tooltip=e||ly}function ly(t,e,n,r){t.element().setAttribute("title",r||"")}function cy(t){this._el=null,this._bgcolor=null,this._loader=new tg(t)}ty.prototype={toJSON(t){return Zm(this.root,t||0)},mark(t,e,n){const r=ey(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},sy.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const t in e)n.push(...e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),r=ny(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=Ym[a.marktype]).tip){for((o=uy(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let u=i.x1+r[0]+n.left,s=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,s+=t.y||0;return{x:u,y:s,width:o,height:a,left:u,top:s,right:u+o,bottom:s+a}}},cy.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const fy="dragenter",hy="dragleave",dy="dragover",py="mousedown",gy="mousemove",my="mouseout",yy="mouseover",vy="click",_y="mousewheel",xy="touchstart",by="touchmove",wy="touchend",ky=gy,My=my,Ay=vy;function Ey(t,e){sy.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Dy(t,e){(t=>t===xy||t===by||t===wy?[xy,by,wy]:[t])(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function Cy(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Fy(t){return function(e){this.fire(t,e),this._active=null}}ut(Ey,sy,{initialize(t,e,n){return this._canvas=t&&ry(t,"canvas"),[vy,py,gy,my,hy].forEach((t=>Dy(this,t))),sy.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",fy,hy,dy,py,"mouseup",gy,my,yy,vy,"dblclick","wheel",_y,xy,by,wy],DOMMouseScroll(t){this.fire(_y,t)},mousemove:Cy(gy,yy,my),dragover:Cy(dy,fy,hy),mouseout:Fy(my),dragleave:Fy(hy),mousedown(t){this._down=this._active,this.fire(py,t)},click(t){this._down===this._active&&(this.fire(vy,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(xy,t,!0)},touchmove(t){this.fire(by,t,!0)},touchend(t){this.fire(wy,t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===Ay&&r&&r.href?this.handleHref(e,r,r.href):t!==ky&&t!==My||this.handleTooltip(e,r,t!==My),i)for(let t=0,n=i.length;t<n;++t)i[t].handler.call(this._obj,e,r)},on(t,e){const n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(Dy(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},pickEvent(t){const e=uy(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return Ym[t.marktype].pick.call(this,o,t,e,n,r,i)}});var Sy="undefined"!=typeof window&&window.devicePixelRatio||1;function By(t){cy.call(this,t),this._options={},this._redraw=!1,this._dirty=new Zp,this._tempb=new Zp}const Ty=cy.prototype;function zy(t,e){sy.call(this,t,e);const n=this;n._hrefHandler=Ny(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=Ny(n,((t,e)=>{n.handleTooltip(t,e,t.type!==My)}))}ut(By,cy,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Gl(1,1,this._options.type),t&&this._canvas&&(oy(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Ty.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(Ty.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,u=t.getContext("2d"),s=a?Sy:i;t.width=e*s,t.height=n*s;for(const t in o)u[t]=o[t];a&&1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),u.pixelRatio=s,u.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||u("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((t,e,n)=>(new Zp).set(0,0,e,n).translate(-t[0],-t[1]))(n,r,i);e.save();const u=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,u),e.restore(),o.clear(),this},draw(t,e,n){const r=Ym[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),H(n)?(t.beginPath(),n(t),t.clip()):rm(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const Ny=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};ut(zy,sy,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(Ay,this._hrefHandler),r.removeEventListener(ky,this._tooltipHandler),r.removeEventListener(My,this._tooltipHandler)),this._svg=r=t&&ry(t,"svg"),r&&(r.addEventListener(Ay,this._hrefHandler),r.addEventListener(ky,this._tooltipHandler),r.addEventListener(My,this._tooltipHandler)),sy.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:Ny(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const Oy="aria-hidden",Ry="aria-label",Ly="role",Uy="aria-roledescription",qy="graphics-object",Py="graphics-symbol",jy=(t,e,n)=>({[Ly]:t,[Uy]:e,[Ry]:n||void 0}),Iy=Dt(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),$y={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?Gy(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),u=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(vd(u)?"discrete":u," scale")+" with ".concat(Qd(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?Gy(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,u=a.scales[i[o[0]]].value,s=a.dataflow.locale();return l=r,(l.length?l[0].toUpperCase()+l.slice(1):l)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return(t=t.map((t=>t+("fill"===t||"stroke"===t?" color":"")))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+M(t)}(o))+" with ".concat(Qd(s,u,t));var l}},"title-text":{desc:"title",caption:t=>"Title text '".concat(Vy(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(Vy(t),"'")}},Wy={ariaRole:Ly,ariaRoleDescription:Uy,description:Ry};function Hy(t,e){const n=!1===e.aria;if(t(Oy,n||void 0),n||null==e.description)for(const e in Wy)t(Wy[e],void 0);else{const n=e.mark.marktype;t(Ry,e.description),t(Ly,e.ariaRole||("group"===n?qy:Py)),t(Uy,e.ariaRoleDescription||"".concat(n," mark"))}}function Yy(t){return!1===t.aria?{[Oy]:!0}:Iy[t.role]?null:$y[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return jy(e.role||Py,e.desc,n.description||r(n))}catch(t){return null}}(t,$y[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return jy(n?qy:Py,"".concat(e," mark container"),t.description)}(t)}function Vy(t){return $(t.text).join(" ")}function Gy(t){try{return $(M(t.items).items[0].text).join(" ")}catch(t){return null}}const Xy=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function Jy(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(Xy(n).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"),'"')),a),a={open(u,...s){(o=>{e&&(t+="".concat(e,">").concat(n),i()),r.push(o)})(u),e="<"+u;for(const t of s)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?">".concat(n,"</").concat(o,">"):"/>"):"</".concat(o,">"),i(),a},attr:o,text:t=>(n+=Xy(t),a),toString:()=>t};return a}const Zy=t=>Qy(Jy(),t)+"";function Qy(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e<r;++e)t.attr(n[e].name,n[e].value)}if(e.hasChildNodes()){const n=e.childNodes,r=n.length;for(let e=0;e<r;e++){const r=n[e];3===r.nodeType?t.text(r.nodeValue):Qy(t,r)}}return t.close()}const Ky={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},tv={fill:"none","stroke-miterlimit":10},ev=fm.xmlns;function nv(t){cy.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const rv=cy.prototype;function iv(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function ov(t,e,n){let r,i,o;if("radial"===e.gradient){let r=iy(t,n++,"pattern",ev);dv(r,{id:tp+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=iy(r,0,"rect",ev),dv(r,{width:1,height:1,fill:"url(".concat(gv(),"#").concat(e.id,")")}),dv(t=iy(t,n++,"radialGradient",ev),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else dv(t=iy(t,n++,"linearGradient",ev),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r<i;++r)o=iy(t,r,"stop",ev),o.setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return oy(t,r),n}function av(t,e,n){let r;return(t=iy(t,n,"clipPath",ev)).setAttribute("id",e.id),e.path?(r=iy(t,0,"path",ev),r.setAttribute("d",e.path)):(r=iy(t,0,"rect",ev),dv(r,{x:0,y:0,width:e.width,height:e.height})),oy(t,1),n+1}function uv(t,e,n,r,i){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=ny(o,r,ev),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){const e=ny(o,"path",ev);a.appendChild(e),e.__data__=t;const n=ny(o,"g",ev);a.appendChild(n),n.__data__=t;const r=ny(o,"path",ev);a.appendChild(r),r.__data__=t,r.__values__={fill:"default"}}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}ut(nv,cy,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=iy(t,0,"svg",ev),dv(this._svg,fm),this._svg.setAttribute("class","marks"),oy(t,1),this._root=iy(this._svg,0,"g",ev),dv(this._root,tv),oy(this._svg,1)),this.background(this._bgcolor),rv.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),rv.background.apply(this,arguments)},resize(t,e,n,r){return rv.resize.call(this,t,e,n,r),this._svg&&(dv(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=iy(t,0,"rect",ev),dv(n,{width:this._width,height:this._height,fill:e}));const r=Zy(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),oy(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,u,s;for(a=0,u=t.length;a<u;++a)n=t[a],r=n.mark,r.marktype!==i&&(i=r.marktype,o=Ym[i]),r.zdirty&&r.dirty!==e&&(this._dirtyAll=!1,iv(n,e),r.items.forEach((t=>{t.dirty=e}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(s=r.items[0],s._svg&&this._update(o,s._svg,s)):n._svg&&(s=n._svg.parentNode,s&&s.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,iv(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=Ym[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag;let u=null,s=0;const l=uv(e,t,n,"g",r);l.setAttribute("class",ay(e));const c=Yy(e);for(const t in c)pv(l,t,c[t]);a||pv(l,"pointer-events",o),pv(l,"clip-path",e.clip?Jp(this,e,e.group):null);const f=t=>{const e=this.isDirty(t),n=uv(t,l,u,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;Ig(n,(n=>{r=t.mark(e,n,r),++i})),oy(e,1+i)}(this,n,t)),u=n,++s};return i.nested?e.items.length&&f(e.items[0]):Ig(e,f),oy(l,s),l},_update(t,e,n){sv=e,lv=e.__values__,Hy(fv,n),t.attr(fv,n,this);const r=cv[t.type];r&&r.call(this,t,e,n),sv&&this.style(sv,n)},style(t,e){if(null!=e)for(const n in Ky){let r="font"===n?qm(e):e[n];if(r===lv[n])continue;const i=Ky[n];null==r?t.removeAttribute(i):(ep(r)&&(r=np(r,this._defs.gradient,gv())),t.setAttribute(i,r+"")),lv[n]=r}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=iy(t,1,"defs",ev)),r=ov(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=iy(t,1,"defs",ev)),r=av(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):oy(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let sv=null,lv=null;const cv={group(t,e,n){const r=sv=e.childNodes[2];lv=r.__values__,t.foreground(fv,n,this),lv=e.__values__,sv=e.childNodes[1],t.content(fv,n,this);const i=sv=e.childNodes[0];t.background(fv,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==lv.events&&(pv(r,"pointer-events",o),pv(i,"pointer-events",o),lv.events=o),n.strokeForeground&&n.stroke){const t=n.fill;pv(r,"display",null),this.style(i,n),pv(i,"stroke",null),t&&(n.fill=null),lv=r.__values__,this.style(r,n),t&&(n.fill=t),sv=null}else pv(r,"display","none")},image(t,e,n){!1===n.smooth?(hv(e,"image-rendering","optimizeSpeed"),hv(e,"image-rendering","pixelated")):hv(e,"image-rendering",null)},text(t,e,n){const r=Rm(n);let i,o,a,u;v(r)?(o=r.map((t=>Um(n,t))),i=o.join("\n"),i!==lv.text&&(oy(e,0),a=e.ownerDocument,u=Om(n),o.forEach(((t,r)=>{const i=ny(a,"tspan",ev);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",u)),e.appendChild(i)})),lv.text=i)):(o=Um(n,r),o!==lv.text&&(e.textContent=o,lv.text=o)),pv(e,"font-family",qm(n)),pv(e,"font-size",Nm(n)+"px"),pv(e,"font-style",n.fontStyle),pv(e,"font-variant",n.fontVariant),pv(e,"font-weight",n.fontWeight)}};function fv(t,e,n){e!==lv[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(sv,t,e,n):pv(sv,t,e),lv[t]=e)}function hv(t,e,n){n!==lv[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),lv[e]=n)}function dv(t,e){for(const n in e)pv(t,n,e[n])}function pv(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function gv(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function mv(t){cy.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}ut(mv,cy,{svg(){return this._text},_render(t){const e=Jy();e.open("svg",K({},fm,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",tv,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Ym[e.marktype],r=n.tag,i=[Hy,n.attr];t.open("g",{class:ay(e),"clip-path":e.clip?Jp(this,e,e.group):null},Yy(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=Rm(o);if(v(e)){const n={x:0,dy:Om(o)};for(let r=0;r<e.length;++r)t.open("tspan",r?n:null).text(Um(o,e[r])).close()}else t.text(Um(o,e))}else if("g"===r){const r=o.strokeForeground,i=o.fill,a=o.stroke;r&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),Ig(o,(e=>this.mark(t,e))),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):Ig(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),r&&function(t,e,n,r,i){if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=qm(e),t["font-size"]=Nm(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in Ky){let r=e[n];const o=Ky[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(ep(r)&&(r=np(r,i.gradient,"")),t[o]=r)}}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:tp+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e<i.length;++e)t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close();t.close()}for(const e in n){const r=n[e];t.open("clipPath",{id:e}),r.path?t.open("path",{d:r.path}).close():t.open("rect",{x:0,y:0,width:r.width,height:r.height}).close(),t.close()}t.close()}}});const yv="canvas",vv="none",_v={Canvas:yv,PNG:"png",SVG:"svg",None:vv},xv={};function bv(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(xv[t]=e,this):xv[t]}function wv(t,e,n){const r=[],i=(new Zp).union(e),o=t.marktype;return o?kv(t,i,n,r):"group"===o?Mv(t,i,n,r):u("Intersect scene must be mark node or group item.")}function kv(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,o=t.marktype,a=i.length;let u=0;if("group"===o)for(;u<a;++u)Mv(i[u],e,n,r);else for(const t=Ym[o].isect;u<a;++u){const n=i[u];Av(n,e,t)&&r.push(n)}}return r}function Mv(t,e,n,r){n&&n(t.mark)&&Av(t,e,Ym.group.isect)&&r.push(t);const i=t.items,o=i&&i.length;if(o){const a=t.x||0,u=t.y||0;e.translate(-a,-u);for(let t=0;t<o;++t)kv(i[t],e,n,r);e.translate(a,u)}return r}function Av(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}xv.canvas=xv.png={renderer:By,headless:By,handler:Ey},xv.svg={renderer:nv,headless:mv,handler:zy},xv.none={};const Ev=new Zp;function Dv(t){const e=t.clip;if(H(e))e(bg(Ev.clear()));else{if(!e)return;Ev.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Ev)}function Cv(t,e,n){return t===e||("path"===n?Fv(t,e):t instanceof Date&&e instanceof Date?+t==+e:ht(t)&&ht(e)?Math.abs(t-e)<=1e-9:t&&e&&(_(t)||_(e))?function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!Cv(t[n=i[r]],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Fv(t,e){return Cv(lp(t),lp(e))}const Sv="top",Bv="left",Tv="right",zv="bottom",Nv="start",Ov="middle",Rv="end",Lv="group",Uv="axis",qv="title",Pv="frame",jv="scope",Iv="legend",$v="row-header",Wv="row-footer",Hv="row-title",Yv="column-header",Vv="column-footer",Gv="column-title",Xv="padding",Jv="fit",Zv="fit-x",Qv="fit-y",Kv="none",t_="all",e_="each",n_="flush",r_="column",i_="row";function o_(t){pa.call(this,null,t)}function a_(t,e,n){return e(t.bounds.clear(),t,n)}ut(o_,pa,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Ym[i],a=o.bound;let u,s=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),s=a_(r,a),r.items.forEach((t=>{t.bounds.clear().union(s)}));else if(i===Lv||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),s.clear(),r.items.forEach((t=>s.union(a_(t,a)))),r.role){case Uv:case Iv:case qv:e.reflow()}else u=e.changed(e.REM),e.visit(e.ADD,(t=>{s.union(a_(t,a))})),e.visit(e.MOD,(t=>{u=u||s.alignsWith(t.bounds),n.dirty(t),s.union(a_(t,a))})),u&&(s.clear(),r.items.forEach((t=>s.union(t.bounds))));return Dv(r),e.modifies("bounds")}});const u_=":vega_identifier:";function s_(t){pa.call(this,0,t)}function l_(t){pa.call(this,null,t)}function c_(t){pa.call(this,null,t)}s_.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ut(s_,pa,{transform(t,e){const n=(i=e.dataflow)._signals[u_]||(i._signals[u_]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,(t=>t[r]=t[r]||++o)),n.set(this.value=o),e}}),ut(l_,pa,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===Lv?Kp:Qp;return e.visit(e.ADD,(t=>r.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const f_={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,r)=>r&&h_(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},h_=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),d_=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(h_(o,n=t[r].bounds,e))return!0},p_=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},g_=t=>(t.forEach((t=>t.opacity=1)),t),m_=(t,e)=>t.reflow(e.modified()).modifies("opacity");function y_(t){pa.call(this,null,t)}ut(c_,pa,{transform(t,e){const n=f_[t.method]||f_.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(g_(a),e=m_(e,t)),e;if(a=a.filter(p_),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=g_(a),e=m_(e,t),i.length>=3&&d_(i,r)){do{i=n(i,r)}while(i.length>=3&&d_(i,r));i.length<3&&!M(a).opacity&&(i.length>1&&(M(i).opacity=0),M(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var r=t.range(),i=new Zp;return e===Sv||e===zv?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),t=>i.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const u=i[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&u.union(t.bounds)})),e}}),ut(y_,pa,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const v_=new Zp;function __(t,e,n){return t[e]===n?0:(t[e]=n,1)}function x_(t){var e=t.items[0].orient;return e===Bv||e===Tv}function b_(t,e,n,r){var i,o,a=e.items[0],u=a.datum,s=null!=a.translate?a.translate:.5,l=a.orient,c=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(u),f=a.range,h=a.offset,d=a.position,p=a.minExtent,g=a.maxExtent,m=u.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,_=m&&Lm(m),x=0,b=0;switch(v_.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case Sv:x=d||0,b=-h,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&w_(t,m,o,y,_,0,-1,v);break;case Bv:x=-h,b=d||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&w_(t,m,o,y,_,1,-1,v);break;case Tv:x=n+h,b=d||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&w_(t,m,o,y,_,1,1,v);break;case zv:x=d||0,b=r+h,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&w_(t,m,o,y,0,0,1,v);break;default:x=a.x,b=a.y}return rg(v.translate(x,b),a),__(a,"x",x+s)|__(a,"y",b+s)&&(a.bounds=v_,t.dirty(a),a.bounds=v,t.dirty(a)),a.mark.bounds.clear().union(v)}function w_(t,e,n,r,i,o,a,u){const s=e.bounds;if(e.auto){const u=a*(n+i+r);let l=0,c=0;t.dirty(e),o?l=(e.x||0)-(e.x=u):c=(e.y||0)-(e.y=u),e.mark.bounds.clear().union(s.translate(-l,-c)),t.dirty(e)}u.union(s)}const k_=(t,e)=>Math.floor(Math.min(t,e)),M_=(t,e)=>Math.ceil(Math.max(t,e));function A_(t){return(new Zp).set(0,0,t.width||0,t.height||0)}function E_(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function D_(t,e,n){const r=_(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function C_(t){return t<0?Math.ceil(-t):0}function F_(t,e,n){var r,i,o,a,u,s,l,c,f,h,d,p=!n.nodirty,g=n.bounds===n_?A_:E_,m=v_.set(0,0,0,0),y=D_(n.align,r_),v=D_(n.align,i_),_=D_(n.padding,r_),x=D_(n.padding,i_),b=n.columns||e.length,w=b<=0?1:Math.ceil(e.length/b),k=e.length,M=Array(k),A=Array(b),E=0,D=Array(k),C=Array(w),F=0,S=Array(k),B=Array(k),T=Array(k);for(i=0;i<b;++i)A[i]=0;for(i=0;i<w;++i)C[i]=0;for(i=0;i<k;++i)s=e[i],u=T[i]=g(s),s.x=s.x||0,S[i]=0,s.y=s.y||0,B[i]=0,o=i%b,a=~~(i/b),E=Math.max(E,l=Math.ceil(u.x2)),F=Math.max(F,c=Math.ceil(u.y2)),A[o]=Math.max(A[o],l),C[a]=Math.max(C[a],c),M[i]=_+C_(u.x1),D[i]=x+C_(u.y1),p&&t.dirty(e[i]);for(i=0;i<k;++i)i%b==0&&(M[i]=0),i<b&&(D[i]=0);if(y===e_)for(o=1;o<b;++o){for(d=0,i=o;i<k;i+=b)d<M[i]&&(d=M[i]);for(i=o;i<k;i+=b)M[i]=d+A[o-1]}else if(y===t_){for(d=0,i=0;i<k;++i)i%b&&d<M[i]&&(d=M[i]);for(i=0;i<k;++i)i%b&&(M[i]=d+E)}else for(y=!1,o=1;o<b;++o)for(i=o;i<k;i+=b)M[i]+=A[o-1];if(v===e_)for(a=1;a<w;++a){for(d=0,r=(i=a*b)+b;i<r;++i)d<D[i]&&(d=D[i]);for(i=a*b;i<r;++i)D[i]=d+C[a-1]}else if(v===t_){for(d=0,i=b;i<k;++i)d<D[i]&&(d=D[i]);for(i=b;i<k;++i)D[i]=d+F}else for(v=!1,a=1;a<w;++a)for(r=(i=a*b)+b;i<r;++i)D[i]+=C[a-1];for(f=0,i=0;i<k;++i)f=M[i]+(i%b?f:0),S[i]+=f-e[i].x;for(o=0;o<b;++o)for(h=0,i=o;i<k;i+=b)h+=D[i],B[i]+=h-e[i].y;if(y&&D_(n.center,r_)&&w>1)for(i=0;i<k;++i)(f=(u=y===t_?E:A[i%b])-T[i].x2-e[i].x-S[i])>0&&(S[i]+=f/2);if(v&&D_(n.center,i_)&&1!==b)for(i=0;i<k;++i)(h=(u=v===t_?F:C[~~(i/b)])-T[i].y2-e[i].y-B[i])>0&&(B[i]+=h/2);for(i=0;i<k;++i)m.union(T[i].translate(S[i],B[i]));switch(f=D_(n.anchor,"x"),h=D_(n.anchor,"y"),D_(n.anchor,r_)){case Rv:f-=m.width();break;case Ov:f-=m.width()/2}switch(D_(n.anchor,i_)){case Rv:h-=m.height();break;case Ov:h-=m.height()/2}for(f=Math.round(f),h=Math.round(h),m.clear(),i=0;i<k;++i)e[i].mark.bounds.clear();for(i=0;i<k;++i)(s=e[i]).x+=S[i]+=f,s.y+=B[i]+=h,m.union(s.mark.bounds.union(s.bounds.translate(S[i],B[i]))),p&&t.dirty(s);return m}function S_(t,e,n){var r,i,o,a,u,s,l,c=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<i;++o)if(n=(e=r[o]).items,e.marktype===Lv)switch(e.role){case Uv:case Iv:case qv:break;case $v:a.rowheaders.push(...n);break;case Wv:a.rowfooters.push(...n);break;case Yv:a.colheaders.push(...n);break;case Vv:a.colfooters.push(...n);break;case Hv:a.rowtitle=n[0];break;case Gv:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=c.marks,h=n.bounds===n_?B_:T_,d=n.offset,p=n.columns||f.length,g=p<=0?1:Math.ceil(f.length/p),m=g*p;const y=F_(t,f,n);y.empty()&&y.set(0,0,0,0),c.rowheaders&&(s=D_(n.headerBand,i_,null),r=z_(t,c.rowheaders,f,p,g,-D_(d,"rowHeader"),k_,0,h,"x1",0,p,1,s)),c.colheaders&&(s=D_(n.headerBand,r_,null),i=z_(t,c.colheaders,f,p,p,-D_(d,"columnHeader"),k_,1,h,"y1",0,1,p,s)),c.rowfooters&&(s=D_(n.footerBand,i_,null),o=z_(t,c.rowfooters,f,p,g,D_(d,"rowFooter"),M_,0,h,"x2",p-1,p,1,s)),c.colfooters&&(s=D_(n.footerBand,r_,null),a=z_(t,c.colfooters,f,p,p,D_(d,"columnFooter"),M_,1,h,"y2",m-p,1,p,s)),c.rowtitle&&(u=D_(n.titleAnchor,i_),l=D_(d,"rowTitle"),l=u===Rv?o+l:r-l,s=D_(n.titleBand,i_,.5),N_(t,c.rowtitle,l,0,y,s)),c.coltitle&&(u=D_(n.titleAnchor,r_),l=D_(d,"columnTitle"),l=u===Rv?a+l:i-l,s=D_(n.titleBand,r_,.5),N_(t,c.coltitle,l,1,y,s))}function B_(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function T_(t,e){return t.bounds[e]}function z_(t,e,n,r,i,o,a,u,s,l,c,f,h,d){var p,g,m,y,v,_,x,b,w,k=n.length,M=0,A=0;if(!k)return M;for(p=c;p<k;p+=f)n[p]&&(M=a(M,s(n[p],l)));if(!e.length)return M;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),M+=o,g=0,y=e.length;g<y;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=c,g=0,y=e.length;g<y;++g,p+=f){for(v=(_=e[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=h);u?(b=null==d?x.x:Math.round(x.bounds.x1+d*x.bounds.width()),w=M):(b=M,w=null==d?x.y:Math.round(x.bounds.y1+d*x.bounds.height())),v.union(_.bounds.translate(b-(_.x||0),w-(_.y||0))),_.x=b,_.y=w,t.dirty(_),A=a(A,v[l])}return A}function N_(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,u=n;r?a=Math.round(i.x1+o*i.width()):u=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),u-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=u,t.dirty(e)}}function O_(t,e,n,r,i,o,a){const u=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),s=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,u("offset",0)),l=u("anchor",Nv),c=l===Rv?1:l===Ov?.5:0,f={align:e_,bounds:u("bounds",n_),columns:"vertical"===u("direction")?1:t.length,padding:u("margin",8),center:u("center"),nodirty:!0};switch(e){case Bv:f.anchor={x:Math.floor(r.x1)-s,column:Rv,y:c*(a||r.height()+2*r.y1),row:l};break;case Tv:f.anchor={x:Math.ceil(r.x2)+s,y:c*(a||r.height()+2*r.y1),row:l};break;case Sv:f.anchor={y:Math.floor(i.y1)-s,row:Rv,x:c*(o||i.width()+2*i.x1),column:l};break;case zv:f.anchor={y:Math.ceil(i.y2)+s,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:s,y:s};break;case"top-right":f.anchor={x:o-s,y:s,column:Rv};break;case"bottom-left":f.anchor={x:s,y:a-s,row:Rv};break;case"bottom-right":f.anchor={x:o-s,y:a-s,column:Rv,row:Rv}}return f}function R_(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,u=i.bounds,s=i.x,l=i.y;return i._bounds?i._bounds.clear().union(u):i._bounds=u.clone(),u.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],u=a.anchor,s=e.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case Bv:i+=Math.ceil(a.bounds.width())+s;break;case Tv:case zv:break;default:o+=a.bounds.height()+s}switch((i||o)&&U_(t,n,i,o),a.orient){case Bv:c+=L_(e,n,a,u,1,1);break;case Tv:l+=L_(e,n,a,Rv,0,0)+s,c+=L_(e,n,a,u,1,1);break;case zv:l+=L_(e,n,a,u,0,0),c+=L_(e,n,a,Rv,-1,0,1)+s;break;default:l+=L_(e,n,a,u,0,0)}(l||c)&&U_(t,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(U_(t,n,-l,0),U_(t,a,-l,0))}else(i||o)&&U_(t,n,i,o)}(t,i,i.items[0].items[0]),u=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(i,u),n=2*i.padding,r=2*i.padding,u.empty()||(n=Math.ceil(u.width()+n),r=Math.ceil(u.height()+r)),"symbol"===o.type&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(i.items[0].items[0].items[0].items),a!==Kv&&(i.x=s=0,i.y=l=0),i.width=n,i.height=r,rg(u.set(s,l,s+n,l+r),i),i.mark.bounds.clear().union(u),i}function L_(t,e,n,r,i,o,a){const u="symbol"!==t.datum.type,s=n.datum.vgrad,l=(!u||!o&&s||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=s&&o?l:0,f=s&&o?0:l,h=i<=0?0:Lm(n);return Math.round(r===Nv?c:r===Rv?f-h:.5*(l-h))}function U_(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function q_(t){pa.call(this,null,t)}ut(q_,pa,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&S_(n,e,t.layout),function(t,e,n){var r,i,o,a,u,s=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),f=(new Zp).set(0,0,l,c),h=f.clone(),d=f.clone(),p=[];for(a=0,u=s.length;a<u;++a)switch((i=s[a]).role){case Uv:(x_(i)?h:d).union(b_(t,i,l,c));break;case qv:r=i;break;case Iv:p.push(R_(t,i));break;case Pv:case jv:case $v:case Wv:case Hv:case Yv:case Vv:case Gv:h.union(i.bounds),d.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach((t=>{(o=t.orient||Tv)!==Kv&&(e[o]||(e[o]=[])).push(t)}));for(const r in e){const i=e[r];F_(t,i,O_(i,r,n.legends,h,d,l,c))}p.forEach((e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&n.autosize.type===Jv)switch(e.orient){case Bv:case Tv:f.add(r.x1,0).add(r.x2,0);break;case Sv:case zv:f.add(0,r.y1).add(0,r.y2)}else f.union(r)}))}f.union(h).union(d),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],u=a.frame,s=a.orient,l=a.anchor,c=a.offset,f=a.padding,h=a.items[0].items[0],d=a.items[1]&&a.items[1].items[0],p=s===Bv||s===Tv?r:n,g=0,m=0,y=0,v=0,_=0;if(u!==Lv?s===Bv?(g=i.y2,p=i.y1):s===Tv?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):s===Bv&&(g=r,p=0),o=l===Nv?g:l===Rv?p:(g+p)/2,d&&d.text){switch(s){case Sv:case zv:_=h.bounds.height()+f;break;case Bv:v=h.bounds.width()+f;break;case Tv:v=-h.bounds.width()-f}v_.clear().union(d.bounds),v_.translate(v-(d.x||0),_-(d.y||0)),__(d,"x",v)|__(d,"y",_)&&(t.dirty(d),d.bounds.clear().union(v_),d.mark.bounds.clear().union(v_),t.dirty(d)),v_.clear().union(d.bounds)}else v_.clear();switch(v_.union(h.bounds),s){case Sv:m=o,y=i.y1-v_.height()-c;break;case Bv:m=i.x1-v_.width()-c,y=o;break;case Tv:m=i.x2+v_.width()+c,y=o;break;case zv:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return __(a,"x",m)|__(a,"y",y)&&(v_.translate(m,y),t.dirty(a),a.bounds.clear().union(v_),e.bounds.clear().union(v_),t.dirty(a)),a.bounds}(t,r,l,c,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,u=t._height,s=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-s)),d=Math.max(0,Math.ceil(n.y2-c));if(i.contains===Xv){const e=t.padding();a-=e.left+e.right,u-=e.top+e.bottom}o===Kv?(l=0,f=0,s=a,c=u):o===Jv?(s=Math.max(0,a-l-h),c=Math.max(0,u-f-d)):o===Zv?(s=Math.max(0,a-l-h),u=c+f+d):o===Qv?(a=s+l+h,c=Math.max(0,u-f-d)):"pad"===o&&(a=s+l+h,u=c+f+d);t._resizeView(a,u,s,c,[l,f],i.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}});var P_=Object.freeze({__proto__:null,bound:o_,identifier:s_,mark:l_,overlap:c_,render:y_,viewlayout:q_});function j_(t){pa.call(this,null,t)}function I_(t){pa.call(this,null,t)}function $_(){return Lo({})}function W_(t){pa.call(this,null,t)}function H_(t){pa.call(this,[],t)}ut(j_,pa,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=Ld(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),u=t.format||Pd(n,o,a,t.formatSpecifier,t.formatType,!!t.values),s=t.values?Ud(o,t.values,a):qd(o,a);return i&&(r.rem=i),i=s.map(((t,e)=>Lo({index:e/(s.length-1||1),value:t,label:u(t)}))),t.extra&&i.length&&i.push(Lo({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),ut(I_,pa,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||$_,o=t.key||Oo,a=this.value;return v(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&u("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=ot().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),ut(W_,pa,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(v(o)){if(!n.changed()&&!o.every((t=>i[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,u=i.update||g,s=i.enter||g,l=i.exit||g,c=(o&&!a?i[o]:u)||g;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{s(e,t),u(e,t)})),n.modifies(s.output),n.modifies(u.output),c!==g&&c!==u&&(e.visit(e.ADD,(e=>{c(e,t)})),n.modifies(c.output))),e.changed(e.REM)&&l!==g&&(e.visit(e.REM,(e=>{l(e,t)})),n.modifies(l.output)),a||c!==g){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,(e=>{const i=s(e,t)||r;(c(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(s.output)):e.visit(i,(e=>{(c(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation}}),ut(H_,pa,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,u=e.dataflow.locale(),s=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,c=t.type||zd,f=t.scale,h=+t.limit,d=Ld(f,null==t.count?5:t.count,t.minstep),p=!!t.values||c===zd,g=t.format||Hd(u,f,d,c,t.formatSpecifier,t.formatType,p),m=t.values||Wd(f,d);return l&&(s.rem=l),c===zd?(h&&m.length>h?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,h-1),a=!0):l=m,H(i=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((e,n)=>Math.max(e,i(n,t))),0)):i=Z(o=i||8),l=l.map(((e,n)=>Lo({index:n,label:g(e,n,l),value:e,offset:o,size:i(e,t)}))),a&&(a=m[l.length],l.push(Lo({index:l.length,label:"…".concat(m.length-l.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=f.domain(),r=Dd(f,n[0],M(n)),m.length<3&&!t.values&&n[0]!==M(n)&&(m=[n[0],M(n)]),l=m.map(((t,e)=>Lo({index:e,label:g(t,e,m),value:t,perc:r(t)})))):(i=m.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+M(e),o=i-r;if(t.type===Zh){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),l=m.map(((t,e)=>Lo({index:e,label:g(t,e,m),value:t,perc:e?r(t):0,perc2:e===i?1:r(m[e+1])})))),s.source=l,s.add=l,this.value=l,s}});const Y_=t=>t.source.x,V_=t=>t.source.y,G_=t=>t.target.x,X_=t=>t.target.y;function J_(t){pa.call(this,{},t)}J_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},ut(J_,pa,{transform(t,e){var n=t.sourceX||Y_,r=t.sourceY||V_,i=t.targetX||G_,o=t.targetY||X_,a=t.as||"path",s=t.orient||"vertical",l=t.shape||"line",c=tx.get(l+"-"+s)||tx.get(l);return c||u("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=c(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const Z_=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,Q_=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},K_=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),u=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+u)+" "+(n+u)+","+(r-a)+" "+n+","+r},tx=ot({line:Z_,"line-radial":(t,e,n,r)=>Z_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:Q_,"arc-radial":(t,e,n,r)=>Q_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:K_,"curve-radial":(t,e,n,r)=>K_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),u=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*u+"L"+r*a+","+r*u},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),u=Math.sin(n),s=(e+r)/2;return"M"+e*i+","+e*o+"C"+s*i+","+s*o+" "+s*a+","+s*u+" "+r*a+","+r*u}});function ex(t){pa.call(this,null,t)}ex.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},ut(ex,pa,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],u=o[1],s=t.field||d,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,h=f.map(s),p=h.length,g=l,m=(c-l)/Le(h),y=Re(p);for(t.sort&&y.sort(((t,e)=>h[t]-h[e])),n=0;n<p;++n)i=h[y[n]],(r=f[y[n]])[a]=g,r[u]=g+=i*m;return this.value=h,e.reflow(t.modified()).modifies(o)}});function nx(t){return yd(t)&&t!==Vh}const rx=Dt(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function ix(t){pa.call(this,null,t),this.modified(!0)}function ox(t,e,n){xd(t)&&(Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0))!==e.length&&n.warn("Log scale domain includes zero: "+wt(e)));return e}function ax(t,e,n){return H(t)&&(e||n)?Md(t,ux(e||[0,1],n)):t}function ux(t,e){return e?t.slice().reverse():t}function sx(t){pa.call(this,null,t)}ut(ix,pa,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if(n===Vh)return"sequential-linear";(function(t){const e=t.type;return yd(e)&&e!==Hh&&e!==Yh&&(t.scheme||t.range&&t.range.length&&t.range.every(pt))})(t)&&(r=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?"sequential-":3===e?"diverging-":"");return(r+n||Ph).toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=pd(i)()),t)if(!rx[i]){if("padding"===i&&nx(r.type))continue;H(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==td&&t!==Kh&&u("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===Kh?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*qh(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i=e.schemeExtent;v(e.scheme)?r=Ad(e.scheme,e.interpolate,e.interpolateGamma):(r=Td(e.scheme.toLowerCase()))||u("Unrecognized scheme name: ".concat(e.scheme));return n=t===Zh?n+1:t===ed?n-1:t===Xh||t===Jh?+e.schemeCount||5:n,bd(t)?ax(r,i,e.reverse):H(r)?Ed(ax(r,i),n):t===Qh?r:r.slice(0,n)}(r,e,n),H(o))){if(t.interpolator)return t.interpolator(o);u("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&bd(r))return t.interpolator(Ad(ux(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Cd(e.interpolate,e.interpolateGamma)):H(t.round)?t.round(i):H(t.rangeRound)&&t.interpolate(i?Sf:Ff);o&&t.range(ux(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!v(r)){const e=t.domain(),n=e[0],i=M(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||u("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>i&&(s=o*Math.floor(i/o)),r=Re(a,s+o/2,o)}r?t.bins=r:t.bins&&delete t.bins;t.type===ed&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(ox(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,u=t.type,s=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===Ph||e===Ih||e===$h)}(t);if(!a)return 0;nx(u)&&e.padding&&a[0]!==M(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(M(n)-n[0]),u=a/(a-2*r),s=t===jh?U(e,null,u):t===$h?q(e,null,u,.5):t===Ih?q(e,null,u,i||1):t===Wh?P(e,null,u,o||1):L(e,null,u);return(e=e.slice())[0]=s[0],e[e.length-1]=s[1],e}(u,a,e.range,e.padding,e.exponent,e.constant));if((s||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,s&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:o<a[0]?0:i;t!==i&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(ox(u,a,n)),u===Qh&&t.unknown(e.domainImplicit?Ql:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Ld(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),ut(sx,pa,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(jo(t.sort)),this.modified(n),e}});const lx="zero",cx="center",fx="normalize",hx=["y0","y1"];function dx(t){pa.call(this,null,t)}function px(t,e,n,r,i){for(var o,a=(e-t.sum)/2,u=t.length,s=0;s<u;++s)(o=t[s])[r]=a,o[i]=a+=Math.abs(n(o))}function gx(t,e,n,r,i){for(var o,a=1/t.sum,u=0,s=t.length,l=0,c=0;l<s;++l)(o=t[l])[r]=u,o[i]=u=a*(c+=Math.abs(n(o)))}function mx(t,e,n,r,i){for(var o,a,u=0,s=0,l=t.length,c=0;c<l;++c)(o=+n(a=t[c]))<0?(a[r]=s,a[i]=s+=o):(a[r]=u,a[i]=u+=o)}dx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:lx,values:[lx,cx,fx]},{name:"as",type:"string",array:!0,length:2,default:hx}]},ut(dx,pa,{transform(t,e){var n,r,i,o,a=t.as||hx,u=a[0],s=a[1],l=jo(t.sort),c=t.field||d,f=t.offset===cx?px:t.offset===fx?gx:mx;for(n=function(t,e,n,r){var i,o,a,u,s,l,c,f,h,d=[],p=t=>t(s);if(null==e)d.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)s=t[o],(c=i[l=e.map(p)])||(i[l]=c=[],d.push(c)),c.push(s);for(l=0,h=0,u=d.length;l<u;++l){for(o=0,f=0,a=(c=d[l]).length;o<a;++o)f+=Math.abs(r(c[o]));c.sum=f,f>h&&(h=f),n&&c.sort(n)}return d.max=h,d}(e.source,t.groupby,l,c),r=0,i=n.length,o=n.max;r<i;++r)f(n[r],o,c,u,s);return e.reflow(t.modified()).modifies(a)}});var yx=Object.freeze({__proto__:null,axisticks:j_,datajoin:I_,encode:W_,legendentries:H_,linkpath:J_,pie:ex,scale:ix,sortitems:sx,stack:dx}),vx=1e-6,_x=1e-12,xx=Math.PI,bx=xx/2,wx=xx/4,kx=2*xx,Mx=180/xx,Ax=xx/180,Ex=Math.abs,Dx=Math.atan,Cx=Math.atan2,Fx=Math.cos,Sx=Math.ceil,Bx=Math.exp,Tx=Math.hypot,zx=Math.log,Nx=Math.pow,Ox=Math.sin,Rx=Math.sign||function(t){return t>0?1:t<0?-1:0},Lx=Math.sqrt,Ux=Math.tan;function qx(t){return t>1?0:t<-1?xx:Math.acos(t)}function Px(t){return t>1?bx:t<-1?-bx:Math.asin(t)}function jx(){}function Ix(t,e){t&&Wx.hasOwnProperty(t.type)&&Wx[t.type](t,e)}var $x={Feature:function(t,e){Ix(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Ix(n[r].geometry,e)}},Wx={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 n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Hx(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Hx(n[r],e,0)},Polygon:function(t,e){Yx(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yx(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Ix(n[r],e)}};function Hx(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Yx(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Hx(t[n],e,1);e.polygonEnd()}function Vx(t,e){t&&$x.hasOwnProperty(t.type)?$x[t.type](t,e):Ix(t,e)}var Gx,Xx,Jx,Zx,Qx,Kx,tb,eb,nb,rb,ib,ob,ab,ub,sb,lb,cb=new be,fb=new be,hb={point:jx,lineStart:jx,lineEnd:jx,polygonStart:function(){cb=new be,hb.lineStart=db,hb.lineEnd=pb},polygonEnd:function(){var t=+cb;fb.add(t<0?kx+t:t),this.lineStart=this.lineEnd=this.point=jx},sphere:function(){fb.add(kx)}};function db(){hb.point=gb}function pb(){mb(Gx,Xx)}function gb(t,e){hb.point=mb,Gx=t,Xx=e,Jx=t*=Ax,Zx=Fx(e=(e*=Ax)/2+wx),Qx=Ox(e)}function mb(t,e){var n=(t*=Ax)-Jx,r=n>=0?1:-1,i=r*n,o=Fx(e=(e*=Ax)/2+wx),a=Ox(e),u=Qx*a,s=Zx*o+u*Fx(i),l=u*r*Ox(i);cb.add(Cx(l,s)),Jx=t,Zx=o,Qx=a}function yb(t){return[Cx(t[1],t[0]),Px(t[2])]}function vb(t){var e=t[0],n=t[1],r=Fx(n);return[r*Fx(e),r*Ox(e),Ox(n)]}function _b(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xb(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 bb(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function wb(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kb(t){var e=Lx(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Mb,Ab,Eb,Db,Cb,Fb,Sb,Bb,Tb,zb,Nb,Ob,Rb,Lb,Ub,qb,Pb={point:jb,lineStart:$b,lineEnd:Wb,polygonStart:function(){Pb.point=Hb,Pb.lineStart=Yb,Pb.lineEnd=Vb,ub=new be,hb.polygonStart()},polygonEnd:function(){hb.polygonEnd(),Pb.point=jb,Pb.lineStart=$b,Pb.lineEnd=Wb,cb<0?(Kx=-(eb=180),tb=-(nb=90)):ub>vx?nb=90:ub<-1e-6&&(tb=-90),lb[0]=Kx,lb[1]=eb},sphere:function(){Kx=-(eb=180),tb=-(nb=90)}};function jb(t,e){sb.push(lb=[Kx=t,eb=t]),e<tb&&(tb=e),e>nb&&(nb=e)}function Ib(t,e){var n=vb([t*Ax,e*Ax]);if(ab){var r=xb(ab,n),i=xb([r[1],-r[0],0],r);kb(i),i=yb(i);var o,a=t-rb,u=a>0?1:-1,s=i[0]*Mx*u,l=Ex(a)>180;l^(u*rb<s&&s<u*t)?(o=i[1]*Mx)>nb&&(nb=o):l^(u*rb<(s=(s+360)%360-180)&&s<u*t)?(o=-i[1]*Mx)<tb&&(tb=o):(e<tb&&(tb=e),e>nb&&(nb=e)),l?t<rb?Gb(Kx,t)>Gb(Kx,eb)&&(eb=t):Gb(t,eb)>Gb(Kx,eb)&&(Kx=t):eb>=Kx?(t<Kx&&(Kx=t),t>eb&&(eb=t)):t>rb?Gb(Kx,t)>Gb(Kx,eb)&&(eb=t):Gb(t,eb)>Gb(Kx,eb)&&(Kx=t)}else sb.push(lb=[Kx=t,eb=t]);e<tb&&(tb=e),e>nb&&(nb=e),ab=n,rb=t}function $b(){Pb.point=Ib}function Wb(){lb[0]=Kx,lb[1]=eb,Pb.point=jb,ab=null}function Hb(t,e){if(ab){var n=t-rb;ub.add(Ex(n)>180?n+(n>0?360:-360):n)}else ib=t,ob=e;hb.point(t,e),Ib(t,e)}function Yb(){hb.lineStart()}function Vb(){Hb(ib,ob),hb.lineEnd(),Ex(ub)>vx&&(Kx=-(eb=180)),lb[0]=Kx,lb[1]=eb,ab=null}function Gb(t,e){return(e-=t)<0?e+360:e}function Xb(t,e){return t[0]-e[0]}function Jb(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var Zb={sphere:jx,point:Qb,lineStart:tw,lineEnd:rw,polygonStart:function(){Zb.lineStart=iw,Zb.lineEnd=ow},polygonEnd:function(){Zb.lineStart=tw,Zb.lineEnd=rw}};function Qb(t,e){t*=Ax;var n=Fx(e*=Ax);Kb(n*Fx(t),n*Ox(t),Ox(e))}function Kb(t,e,n){++Mb,Eb+=(t-Eb)/Mb,Db+=(e-Db)/Mb,Cb+=(n-Cb)/Mb}function tw(){Zb.point=ew}function ew(t,e){t*=Ax;var n=Fx(e*=Ax);Lb=n*Fx(t),Ub=n*Ox(t),qb=Ox(e),Zb.point=nw,Kb(Lb,Ub,qb)}function nw(t,e){t*=Ax;var n=Fx(e*=Ax),r=n*Fx(t),i=n*Ox(t),o=Ox(e),a=Cx(Lx((a=Ub*o-qb*i)*a+(a=qb*r-Lb*o)*a+(a=Lb*i-Ub*r)*a),Lb*r+Ub*i+qb*o);Ab+=a,Fb+=a*(Lb+(Lb=r)),Sb+=a*(Ub+(Ub=i)),Bb+=a*(qb+(qb=o)),Kb(Lb,Ub,qb)}function rw(){Zb.point=Qb}function iw(){Zb.point=aw}function ow(){uw(Ob,Rb),Zb.point=Qb}function aw(t,e){Ob=t,Rb=e,t*=Ax,e*=Ax,Zb.point=uw;var n=Fx(e);Lb=n*Fx(t),Ub=n*Ox(t),qb=Ox(e),Kb(Lb,Ub,qb)}function uw(t,e){t*=Ax;var n=Fx(e*=Ax),r=n*Fx(t),i=n*Ox(t),o=Ox(e),a=Ub*o-qb*i,u=qb*r-Lb*o,s=Lb*i-Ub*r,l=Tx(a,u,s),c=Px(l),f=l&&-c/l;Tb.add(f*a),zb.add(f*u),Nb.add(f*s),Ab+=c,Fb+=c*(Lb+(Lb=r)),Sb+=c*(Ub+(Ub=i)),Bb+=c*(qb+(qb=o)),Kb(Lb,Ub,qb)}function sw(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function lw(t,e){return[Ex(t)>xx?t+Math.round(-t/kx)*kx:t,e]}function cw(t,e,n){return(t%=kx)?e||n?sw(hw(t),dw(e,n)):hw(t):e||n?dw(e,n):lw}function fw(t){return function(e,n){return[(e+=t)>xx?e-kx:e<-xx?e+kx:e,n]}}function hw(t){var e=fw(t);return e.invert=fw(-t),e}function dw(t,e){var n=Fx(t),r=Ox(t),i=Fx(e),o=Ox(e);function a(t,e){var a=Fx(e),u=Fx(t)*a,s=Ox(t)*a,l=Ox(e),c=l*n+u*r;return[Cx(s*i-c*o,u*n-l*r),Px(c*i+s*o)]}return a.invert=function(t,e){var a=Fx(e),u=Fx(t)*a,s=Ox(t)*a,l=Ox(e),c=l*i-s*o;return[Cx(s*i+l*o,u*n+c*r),Px(c*n-u*r)]},a}function pw(t,e){(e=vb(e))[0]-=t,kb(e);var n=qx(-e[1]);return((-e[2]<0?-n:n)+kx-vx)%kx}function gw(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:jx,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function mw(t,e){return Ex(t[0]-e[0])<vx&&Ex(t[1]-e[1])<vx}function yw(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function vw(t,e,n,r,i){var o,a,u=[],s=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(mw(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}u.push(n=new yw(r,t,null,!0)),s.push(n.o=new yw(r,null,n,!1)),u.push(n=new yw(a,t,null,!1)),s.push(n.o=new yw(a,null,n,!0))}})),u.length){for(s.sort(e),_w(u),_w(s),o=0,a=s.length;o<a;++o)s[o].e=n=!n;for(var l,c,f=u[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=l.length;o<a;++o)i.point((c=l[o])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function _w(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function xw(t){return Ex(t[0])<=xx?t[0]:Rx(t[0])*((Ex(t[0])+xx)%kx-xx)}function bw(t,e,n,r){return function(i){var o,a,u,s=e(i),l=gw(),c=e(l),f=!1,h={point:d,lineStart:g,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=v,h.lineEnd=_,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=m,a=Oe(a);var t=function(t,e){var n=xw(e),r=e[1],i=Ox(r),o=[Ox(n),-Fx(n),0],a=0,u=0,s=new be;1===i?r=bx+vx:-1===i&&(r=-bx-vx);for(var l=0,c=t.length;l<c;++l)if(h=(f=t[l]).length)for(var f,h,d=f[h-1],p=xw(d),g=d[1]/2+wx,m=Ox(g),y=Fx(g),v=0;v<h;++v,p=x,m=w,y=k,d=_){var _=f[v],x=xw(_),b=_[1]/2+wx,w=Ox(b),k=Fx(b),M=x-p,A=M>=0?1:-1,E=A*M,D=E>xx,C=m*w;if(s.add(Cx(C*A*Ox(E),y*k+C*Fx(E))),a+=D?M+A*kx:M,D^p>=n^x>=n){var F=xb(vb(d),vb(_));kb(F);var S=xb(o,F);kb(S);var B=(D^M>=0?-1:1)*Px(S[2]);(r>B||r===B&&(F[0]||F[1]))&&(u+=D^M>=0?1:-1)}}return(a<-1e-6||a<vx&&s<-1e-12)^1&u}(o,r);a.length?(f||(i.polygonStart(),f=!0),vw(a,kw,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){s.point(t,e)}function g(){h.point=p,s.lineStart()}function m(){h.point=d,s.lineEnd()}function y(t,e){u.push([t,e]),c.point(t,e)}function v(){c.lineStart(),u=[]}function _(){y(u[0][0],u[0][1]),c.lineEnd();var t,e,n,r,s=c.clean(),h=l.result(),d=h.length;if(u.pop(),o.push(u),u=null,d)if(1&s){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&s&&h.push(h.pop().concat(h.shift())),a.push(h.filter(ww))}return h}}function ww(t){return t.length>1}function kw(t,e){return((t=t.x)[0]<0?t[1]-bx-vx:bx-t[1])-((e=e.x)[0]<0?e[1]-bx-vx:bx-e[1])}lw.invert=lw;var Mw=bw((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?xx:-xx,s=Ex(o-n);Ex(s-xx)<vx?(t.point(n,r=(r+a)/2>0?bx:-bx),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=xx&&(Ex(n-i)<vx&&(n-=i*vx),Ex(o-u)<vx&&(o-=u*vx),r=function(t,e,n,r){var i,o,a=Ox(t-n);return Ex(a)>vx?Dx((Ox(e)*(o=Fx(r))*Ox(n)-Ox(r)*(i=Fx(e))*Ox(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*bx,r.point(-xx,i),r.point(0,i),r.point(xx,i),r.point(xx,0),r.point(xx,-i),r.point(0,-i),r.point(-xx,-i),r.point(-xx,0),r.point(-xx,i);else if(Ex(t[0]-e[0])>vx){var o=t[0]<e[0]?xx:-xx;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-xx,-bx]);function Aw(t){var e=Fx(t),n=6*Ax,r=e>0,i=Ex(e)>vx;function o(t,n){return Fx(t)*Fx(n)>e}function a(t,n,r){var i=[1,0,0],o=xb(vb(t),vb(n)),a=_b(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var l=e*a/s,c=-e*u/s,f=xb(i,o),h=wb(i,l);bb(h,wb(o,c));var d=f,p=_b(h,d),g=_b(d,d),m=p*p-g*(_b(h,h)-1);if(!(m<0)){var y=Lx(m),v=wb(d,(-p-y)/g);if(bb(v,h),v=yb(v),!r)return v;var _,x=t[0],b=n[0],w=t[1],k=n[1];b<x&&(_=x,x=b,b=_);var M=b-x,A=Ex(M-xx)<vx;if(!A&&k<w&&(_=w,w=k,k=_),A||M<vx?A?w+k>0^v[1]<(Ex(v[0]-x)<vx?w:k):w<=v[1]&&v[1]<=k:M>xx^(x<=v[0]&&v[0]<=b)){var E=wb(d,(-p+y)/g);return bb(E,h),[v,yb(E)]}}}function u(e,n){var i=r?t:xx-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return bw(o,(function(t){var e,n,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,h){var d,p=[f,h],g=o(f,h),m=r?g?0:u(f,h):g?u(f+(f<0?xx:-xx),h):0;if(!e&&(l=s=g)&&t.lineStart(),g!==s&&(!(d=a(e,p))||mw(e,d)||mw(p,d))&&(p[2]=1),g!==s)c=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var y;m&n||!(y=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&mw(e,p)||t.point(p[0],p[1]),e=p,s=g,n=m},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return c|(l&&s)<<1}}}),(function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=Fx(e),u=Ox(e),s=r*n;null==i?(i=e+r*kx,o=e-s/2):(i=pw(a,i),o=pw(a,o),(r>0?i<o:i>o)&&(i+=r*kx));for(var l,c=i;r>0?c>o:c<o;c-=s)l=yb([a,-u*Fx(c),-u*Ox(c)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-xx,t-xx])}var Ew=1e9,Dw=-Ew;function Cw(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,u,l){var c=0,f=0;if(null==i||(c=a(i,u))!==(f=a(o,u))||s(i,o)<0^u>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+u+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return Ex(r[0]-t)<vx?i>0?0:3:Ex(r[0]-n)<vx?i>0?2:1:Ex(r[1]-e)<vx?i>0?1:0:i>0?3:2}function u(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,l,c,f,h,d,p,g,m,y,v,_=a,x=gw(),b={point:w,lineStart:function(){b.point=k,l&&l.push(c=[]);y=!0,m=!1,p=g=NaN},lineEnd:function(){s&&(k(f,h),d&&m&&x.rejoin(),s.push(x.result()));b.point=w,m&&_.lineEnd()},polygonStart:function(){_=x,s=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,u=l[n],s=1,c=u.length,f=u[0],h=f[0],d=f[1];s<c;++s)o=h,a=d,h=(f=u[s])[0],d=f[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=v&&e,i=(s=Oe(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&vw(s,u,e,o,a),a.polygonEnd());_=a,s=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function k(o,a){var u=i(o,a);if(l&&c.push([o,a]),y)f=o,h=a,d=u,y=!1,u&&(_.lineStart(),_.point(o,a));else if(u&&m)_.point(o,a);else{var s=[p=Math.max(Dw,Math.min(Ew,p)),g=Math.max(Dw,Math.min(Ew,g))],x=[o=Math.max(Dw,Math.min(Ew,o)),a=Math.max(Dw,Math.min(Ew,a))];!function(t,e,n,r,i,o){var a,u=t[0],s=t[1],l=0,c=1,f=e[0]-u,h=e[1]-s;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<c&&(c=a)}else if(f>0){if(a>c)return;a>l&&(l=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<c&&(c=a)}if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<c&&(c=a)}else if(h>0){if(a>c)return;a>l&&(l=a)}if(a=o-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<c&&(c=a)}return l>0&&(t[0]=u+l*f,t[1]=s+l*h),c<1&&(e[0]=u+c*f,e[1]=s+c*h),!0}}}}}(s,x,t,e,n,r)?u&&(_.lineStart(),_.point(o,a),v=!1):(m||(_.lineStart(),_.point(s[0],s[1])),_.point(x[0],x[1]),u||_.lineEnd(),v=!1)}p=o,g=a,m=u}return b}}function Fw(t,e,n){var r=Re(t,e-vx,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Sw(t,e,n){var r=Re(t,e-vx,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}var Bw,Tw,zw,Nw,Ow=t=>t,Rw=new be,Lw=new be,Uw={point:jx,lineStart:jx,lineEnd:jx,polygonStart:function(){Uw.lineStart=qw,Uw.lineEnd=Iw},polygonEnd:function(){Uw.lineStart=Uw.lineEnd=Uw.point=jx,Rw.add(Ex(Lw)),Lw=new be},result:function(){var t=Rw/2;return Rw=new be,t}};function qw(){Uw.point=Pw}function Pw(t,e){Uw.point=jw,Bw=zw=t,Tw=Nw=e}function jw(t,e){Lw.add(Nw*t-zw*e),zw=t,Nw=e}function Iw(){jw(Bw,Tw)}var $w=1/0,Ww=$w,Hw=-$w,Yw=Hw,Vw={point:function(t,e){t<$w&&($w=t);t>Hw&&(Hw=t);e<Ww&&(Ww=e);e>Yw&&(Yw=e)},lineStart:jx,lineEnd:jx,polygonStart:jx,polygonEnd:jx,result:function(){var t=[[$w,Ww],[Hw,Yw]];return Hw=Yw=-(Ww=$w=1/0),t}};var Gw,Xw,Jw,Zw,Qw=0,Kw=0,tk=0,ek=0,nk=0,rk=0,ik=0,ok=0,ak=0,uk={point:sk,lineStart:lk,lineEnd:hk,polygonStart:function(){uk.lineStart=dk,uk.lineEnd=pk},polygonEnd:function(){uk.point=sk,uk.lineStart=lk,uk.lineEnd=hk},result:function(){var t=ak?[ik/ak,ok/ak]:rk?[ek/rk,nk/rk]:tk?[Qw/tk,Kw/tk]:[NaN,NaN];return Qw=Kw=tk=ek=nk=rk=ik=ok=ak=0,t}};function sk(t,e){Qw+=t,Kw+=e,++tk}function lk(){uk.point=ck}function ck(t,e){uk.point=fk,sk(Jw=t,Zw=e)}function fk(t,e){var n=t-Jw,r=e-Zw,i=Lx(n*n+r*r);ek+=i*(Jw+t)/2,nk+=i*(Zw+e)/2,rk+=i,sk(Jw=t,Zw=e)}function hk(){uk.point=sk}function dk(){uk.point=gk}function pk(){mk(Gw,Xw)}function gk(t,e){uk.point=mk,sk(Gw=Jw=t,Xw=Zw=e)}function mk(t,e){var n=t-Jw,r=e-Zw,i=Lx(n*n+r*r);ek+=i*(Jw+t)/2,nk+=i*(Zw+e)/2,rk+=i,ik+=(i=Zw*t-Jw*e)*(Jw+t),ok+=i*(Zw+e),ak+=3*i,sk(Jw=t,Zw=e)}function yk(t){this._context=t}yk.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,kx)}},result:jx};var vk,_k,xk,bk,wk,kk=new be,Mk={point:jx,lineStart:function(){Mk.point=Ak},lineEnd:function(){vk&&Ek(_k,xk),Mk.point=jx},polygonStart:function(){vk=!0},polygonEnd:function(){vk=null},result:function(){var t=+kk;return kk=new be,t}};function Ak(t,e){Mk.point=Ek,_k=bk=t,xk=wk=e}function Ek(t,e){bk-=t,wk-=e,kk.add(Lx(bk*bk+wk*wk)),bk=t,wk=e}function Dk(){this._string=[]}function Ck(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Fk(t,e){var n,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Vx(t,n(r))),r.result()}return o.area=function(t){return Vx(t,n(Uw)),Uw.result()},o.measure=function(t){return Vx(t,n(Mk)),Mk.result()},o.bounds=function(t){return Vx(t,n(Vw)),Vw.result()},o.centroid=function(t){return Vx(t,n(uk)),uk.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,Ow):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Dk):new yk(e=t),"function"!=typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)}function Sk(t){return function(e){var n=new Bk;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Bk(){}function Tk(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Vx(n,t.stream(Vw)),e(Vw.result()),null!=r&&t.clipExtent(r),t}function zk(t,e,n){return Tk(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])}),n)}function Nk(t,e,n){return zk(t,[[0,0],e],n)}function Ok(t,e,n){return Tk(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Rk(t,e,n){return Tk(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}Dk.prototype={_radius:4.5,_circle:Ck(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Ck(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Bk.prototype={constructor:Bk,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()}};var Lk=Fx(30*Ax);function Uk(t,e){return+e?function(t,e){function n(r,i,o,a,u,s,l,c,f,h,d,p,g,m){var y=l-r,v=c-i,_=y*y+v*v;if(_>4*e&&g--){var x=a+h,b=u+d,w=s+p,k=Lx(x*x+b*b+w*w),M=Px(w/=k),A=Ex(Ex(w)-1)<vx||Ex(o-f)<vx?(o+f)/2:Cx(b,x),E=t(A,M),D=E[0],C=E[1],F=D-r,S=C-i,B=v*F-y*S;(B*B/_>e||Ex((y*F+v*S)/_-.5)>.3||a*h+u*d+s*p<Lk)&&(n(r,i,o,a,u,s,D,C,A,x/=k,b/=k,w,g,m),m.point(D,C),n(D,C,A,x,b,w,l,c,f,h,d,p,g,m))}}return function(e){var r,i,o,a,u,s,l,c,f,h,d,p,g={point:m,lineStart:y,lineEnd:_,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,g.point=v,e.lineStart()}function v(r,i){var o=vb([r,i]),a=t(r,i);n(c,f,l,h,d,p,c=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],16,e),e.point(c,f)}function _(){g.point=m,e.lineEnd()}function x(){y(),g.point=b,g.lineEnd=w}function b(t,e){v(r=t,e),i=c,o=f,a=h,u=d,s=p,g.point=v}function w(){n(c,f,l,h,d,p,i,o,r,a,u,s,16,e),g.lineEnd=_,_()}return g}}(t,e):function(t){return Sk({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var qk=Sk({point:function(t,e){this.stream.point(t*Ax,e*Ax)}});function Pk(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=Fx(o),u=Ox(o),s=a*t,l=u*t,c=a/t,f=u/t,h=(u*n-a*e)/t,d=(u*e+a*n)/t;function p(t,o){return[s*(t*=r)-l*(o*=i)+e,n-l*t-s*o]}return p.invert=function(t,e){return[r*(c*t-f*e+h),i*(d-f*t-c*e)]},p}function jk(t){return Ik((function(){return t}))()}function Ik(t){var e,n,r,i,o,a,u,s,l,c,f=150,h=480,d=250,p=0,g=0,m=0,y=0,v=0,_=0,x=1,b=1,w=null,k=Mw,M=null,A=Ow,E=.5;function D(t){return s(t[0]*Ax,t[1]*Ax)}function C(t){return(t=s.invert(t[0],t[1]))&&[t[0]*Mx,t[1]*Mx]}function F(){var t=Pk(f,0,0,x,b,_).apply(null,e(p,g)),r=Pk(f,h-t[0],d-t[1],x,b,_);return n=cw(m,y,v),u=sw(e,r),s=sw(n,u),a=Uk(u,E),S()}function S(){return l=c=null,D}return D.stream=function(t){return l&&c===t?l:l=qk(function(t){return Sk({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(k(a(A(c=t)))))},D.preclip=function(t){return arguments.length?(k=t,w=void 0,S()):k},D.postclip=function(t){return arguments.length?(A=t,M=r=i=o=null,S()):A},D.clipAngle=function(t){return arguments.length?(k=+t?Aw(w=t*Ax):(w=null,Mw),S()):w*Mx},D.clipExtent=function(t){return arguments.length?(A=null==t?(M=r=i=o=null,Ow):Cw(M=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),S()):null==M?null:[[M,r],[i,o]]},D.scale=function(t){return arguments.length?(f=+t,F()):f},D.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],F()):[h,d]},D.center=function(t){return arguments.length?(p=t[0]%360*Ax,g=t[1]%360*Ax,F()):[p*Mx,g*Mx]},D.rotate=function(t){return arguments.length?(m=t[0]%360*Ax,y=t[1]%360*Ax,v=t.length>2?t[2]%360*Ax:0,F()):[m*Mx,y*Mx,v*Mx]},D.angle=function(t){return arguments.length?(_=t%360*Ax,F()):_*Mx},D.reflectX=function(t){return arguments.length?(x=t?-1:1,F()):x<0},D.reflectY=function(t){return arguments.length?(b=t?-1:1,F()):b<0},D.precision=function(t){return arguments.length?(a=Uk(u,E=t*t),S()):Lx(E)},D.fitExtent=function(t,e){return zk(D,t,e)},D.fitSize=function(t,e){return Nk(D,t,e)},D.fitWidth=function(t,e){return Ok(D,t,e)},D.fitHeight=function(t,e){return Rk(D,t,e)},function(){return e=t.apply(this,arguments),D.invert=e.invert&&C,F()}}function $k(t){var e=0,n=xx/3,r=Ik(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Ax,n=t[1]*Ax):[e*Mx,n*Mx]},i}function Wk(t,e){var n=Ox(t),r=(n+Ox(e))/2;if(Ex(r)<vx)return function(t){var e=Fx(t);function n(t,n){return[t*e,Ox(n)/e]}return n.invert=function(t,n){return[t/e,Px(n*e)]},n}(t);var i=1+n*(2*r-n),o=Lx(i)/r;function a(t,e){var n=Lx(i-2*r*Ox(e))/r;return[n*Ox(t*=r),o-n*Fx(t)]}return a.invert=function(t,e){var n=o-e,a=Cx(t,Ex(n))*Rx(n);return n*r<0&&(a-=xx*Rx(t)*Rx(n)),[a/r,Px((i-(t*t+n*n)*r*r)/(2*r))]},a}function Hk(){return $k(Wk).scale(155.424).center([0,33.6442])}function Yk(){return Hk().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Vk(t){return function(e,n){var r=Fx(e),i=Fx(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Ox(e),o*Ox(n)]}}function Gk(t){return function(e,n){var r=Lx(e*e+n*n),i=t(r),o=Ox(i),a=Fx(i);return[Cx(e*o,r*a),Px(r&&n*o/r)]}}var Xk=Vk((function(t){return Lx(2/(1+t))}));Xk.invert=Gk((function(t){return 2*Px(t/2)}));var Jk=Vk((function(t){return(t=qx(t))&&t/Ox(t)}));function Zk(t,e){return[t,zx(Ux((bx+e)/2))]}function Qk(t){var e,n,r,i=jk(t),o=i.center,a=i.scale,u=i.translate,s=i.clipExtent,l=null;function c(){var o=xx*a(),u=i(function(t){function e(e){return(e=t(e[0]*Ax,e[1]*Ax))[0]*=Mx,e[1]*=Mx,e}return t=cw(t[0]*Ax,t[1]*Ax,t.length>2?t[2]*Ax:0),e.invert=function(e){return(e=t.invert(e[0]*Ax,e[1]*Ax))[0]*=Mx,e[1]*=Mx,e},e}(i.rotate()).invert([0,0]));return s(null==l?[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]:t===Zk?[[Math.max(u[0]-o,l),e],[Math.min(u[0]+o,n),r]]:[[l,Math.max(u[1]-o,e)],[n,Math.min(u[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(u(t),c()):u()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function Kk(t){return Ux((bx+t)/2)}function tM(t,e){var n=Fx(t),r=t===e?Ox(t):zx(n/Fx(e))/zx(Kk(e)/Kk(t)),i=n*Nx(Kk(t),r)/r;if(!r)return Zk;function o(t,e){i>0?e<-bx+vx&&(e=-bx+vx):e>bx-vx&&(e=bx-vx);var n=i/Nx(Kk(e),r);return[n*Ox(r*t),i-n*Fx(r*t)]}return o.invert=function(t,e){var n=i-e,o=Rx(r)*Lx(t*t+n*n),a=Cx(t,Ex(n))*Rx(n);return n*r<0&&(a-=xx*Rx(t)*Rx(n)),[a/r,2*Dx(Nx(i/o,1/r))-bx]},o}function eM(t,e){return[t,e]}function nM(t,e){var n=Fx(t),r=t===e?Ox(t):(n-Fx(e))/(e-t),i=n/r+t;if(Ex(r)<vx)return eM;function o(t,e){var n=i-e,o=r*t;return[n*Ox(o),i-n*Fx(o)]}return o.invert=function(t,e){var n=i-e,o=Cx(t,Ex(n))*Rx(n);return n*r<0&&(o-=xx*Rx(t)*Rx(n)),[o/r,i-Rx(r)*Lx(t*t+n*n)]},o}Jk.invert=Gk((function(t){return t})),Zk.invert=function(t,e){return[t,2*Dx(Bx(e))-bx]},eM.invert=eM;var rM=1.340264,iM=-.081106,oM=893e-6,aM=.003796,uM=Lx(3)/2;function sM(t,e){var n=Px(uM*Ox(e)),r=n*n,i=r*r*r;return[t*Fx(n)/(uM*(rM+3*iM*r+i*(7*oM+9*aM*r))),n*(rM+iM*r+i*(oM+aM*r))]}function lM(t,e){var n=Fx(e),r=Fx(t)*n;return[n*Ox(t)/r,Ox(e)/r]}function cM(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function fM(t,e){return[Fx(e)*Ox(t),Ox(e)]}function hM(t,e){var n=Fx(e),r=1+Fx(t)*n;return[n*Ox(t)/r,Ox(e)/r]}function dM(t,e){return[zx(Ux((bx+e)/2)),-t]}sM.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(rM+iM*i+o*(oM+aM*i))-e)/(rM+3*iM*i+o*(7*oM+9*aM*i)))*r)*i*i,!(Ex(n)<_x));++a);return[uM*t*(rM+3*iM*i+o*(7*oM+9*aM*i))/Fx(r),Px(Ox(r)/uM)]},lM.invert=Gk(Dx),cM.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Ex(n)>vx&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},fM.invert=Gk(Px),hM.invert=Gk((function(t){return 2*Dx(t)})),dM.invert=function(t,e){return[-e,2*Dx(Bx(t))-bx]};var pM=Math.abs,gM=Math.cos,mM=Math.sin,yM=Math.PI,vM=yM/2,_M=function(t){return t>0?Math.sqrt(t):0}(2);function xM(t){return t>1?vM:t<-1?-vM:Math.asin(t)}function bM(t,e){var n,r=t*mM(e),i=30;do{e-=n=(e+mM(e)-r)/(1+gM(e))}while(pM(n)>1e-6&&--i>0);return e/2}var wM=function(t,e,n){function r(r,i){return[t*r*gM(i=bM(n,i)),e*mM(i)]}return r.invert=function(r,i){return i=xM(i/e),[r/(t*gM(i)),xM((2*i+mM(2*i))/n)]},r}(_M/vM,_M,yM);const kM=Fk(),MM=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function AM(t,e){return function n(){const r=e();return r.type=t,r.path=Fk().projection(r),r.copy=r.copy||function(){const t=n();return MM.forEach((e=>{r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},r}}function EM(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(CM[t]=AM(t,e),this):CM[t]||null}function DM(t){return t&&t.path||kM}const CM={albers:Yk,albersusa:function(){var t,e,n,r,i,o,a=Yk(),u=Hk().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Hk().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),u.stream(n),s.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},c.precision=function(t){return arguments.length?(a.precision(t),u.precision(t),s.precision(t),f()):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),u.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(),o=+t[0],c=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,c-.238*e],[o+.455*e,c+.238*e]]).stream(l),r=u.translate([o-.307*e,c+.201*e]).clipExtent([[o-.425*e+vx,c+.12*e+vx],[o-.214*e-vx,c+.234*e-vx]]).stream(l),i=s.translate([o-.205*e,c+.212*e]).clipExtent([[o-.214*e+vx,c+.166*e+vx],[o-.115*e-vx,c+.234*e-vx]]).stream(l),f()},c.fitExtent=function(t,e){return zk(c,t,e)},c.fitSize=function(t,e){return Nk(c,t,e)},c.fitWidth=function(t,e){return Ok(c,t,e)},c.fitHeight=function(t,e){return Rk(c,t,e)},c.scale(1070)},azimuthalequalarea:function(){return jk(Xk).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return jk(Jk).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return $k(tM).scale(109.5).parallels([30,30])},conicequalarea:Hk,conicequidistant:function(){return $k(nM).scale(131.154).center([0,13.9389])},equalEarth:function(){return jk(sM).scale(177.158)},equirectangular:function(){return jk(eM).scale(152.63)},gnomonic:function(){return jk(lM).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a,u=1,s=0,l=0,c=1,f=1,h=0,d=null,p=1,g=1,m=Sk({point:function(t,e){var n=_([t,e]);this.stream.point(n[0],n[1])}}),y=Ow;function v(){return p=u*c,g=u*f,o=a=null,_}function _(n){var r=n[0]*p,i=n[1]*g;if(h){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+s,i+l]}return _.invert=function(n){var r=n[0]-s,i=n[1]-l;if(h){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},_.stream=function(t){return o&&a===t?o:o=m(y(a=t))},_.postclip=function(t){return arguments.length?(y=t,d=n=r=i=null,v()):y},_.clipExtent=function(t){return arguments.length?(y=null==t?(d=n=r=i=null,Ow):Cw(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),v()):null==d?null:[[d,n],[r,i]]},_.scale=function(t){return arguments.length?(u=+t,v()):u},_.translate=function(t){return arguments.length?(s=+t[0],l=+t[1],v()):[s,l]},_.angle=function(n){return arguments.length?(e=Ox(h=n%360*Ax),t=Fx(h),v()):h*Mx},_.reflectX=function(t){return arguments.length?(c=t?-1:1,v()):c<0},_.reflectY=function(t){return arguments.length?(f=t?-1:1,v()):f<0},_.fitExtent=function(t,e){return zk(_,t,e)},_.fitSize=function(t,e){return Nk(_,t,e)},_.fitWidth=function(t,e){return Ok(_,t,e)},_.fitHeight=function(t,e){return Rk(_,t,e)},_},mercator:function(){return Qk(Zk).scale(961/kx)},mollweide:function(){return jk(wM).scale(169.529)},naturalEarth1:function(){return jk(cM).scale(175.295)},orthographic:function(){return jk(fM).scale(249.5).clipAngle(90.000001)},stereographic:function(){return jk(hM).scale(250).clipAngle(142)},transversemercator:function(){var t=Qk(dM),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const t in CM)EM(t,CM[t]);function FM(){}const SM=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function BM(){var t=1,e=1,n=a;function r(t,e){return e.map((e=>i(t,e)))}function i(r,i){var a=[],u=[];return function(n,r,i){var a,u,s,l,c,f,h=new Array,d=new Array;a=u=-1,l=n[0]>=r,SM[l<<1].forEach(p);for(;++a<t-1;)s=l,l=n[a+1]>=r,SM[s|l<<1].forEach(p);SM[l<<0].forEach(p);for(;++u<e-1;){for(a=-1,l=n[u*t+t]>=r,c=n[u*t]>=r,SM[l<<1|c<<2].forEach(p);++a<t-1;)s=l,l=n[u*t+t+a+1]>=r,f=c,c=n[u*t+a+1]>=r,SM[s|l<<1|c<<2|f<<3].forEach(p);SM[l|c<<3].forEach(p)}a=-1,c=n[u*t]>=r,SM[c<<2].forEach(p);for(;++a<t-1;)f=c,c=n[u*t+a+1]>=r,SM[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+u],s=[t[1][0]+a,t[1][1]+u],l=o(r),c=o(s);(e=d[l])?(n=h[c])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=c]=e):(e=h[c])?(n=d[l])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=l]=e):h[l]=d[c]={start:l,end:c,ring:[r,s]}}SM[c<<3].forEach(p)}(r,i,(t=>{n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):u.push(t)})),u.forEach((t=>{for(var e,n=0,r=a.length;n<r;++n)if(-1!==TM((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((n=>{var o,a=n[0],u=n[1],s=0|a,l=0|u,c=r[l*t+s];a>0&&a<t&&s===a&&(o=r[l*t+s-1],n[0]=a+(i-o)/(c-o)-.5),u>0&&u<e&&l===u&&(o=r[(l-1)*t+s],n[1]=u+(i-o)/(c-o)-.5)}))}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);return i>=0&&o>=0||u("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:FM,r):n===a},r}function TM(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=zM(t,e[r]))return n;return 0}function zM(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,u=a-1;o<a;u=o++){var s=t[o],l=s[0],c=s[1],f=t[u],h=f[0],d=f[1];if(NM(s,f,e))return 0;c>r!=d>r&&n<(h-l)*(r-c)/(d-c)+l&&(i=-i)}return i}function NM(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function OM(t,e,n){return function(r){var i=tt(r),o=n?Math.min(i[0],0):i[0],a=i[1],u=a-o,s=e?De(o,a,t):u/(t+1);return Re(s,a,s)}}function RM(t){pa.call(this,null,t)}function LM(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,u=e*n<0;function s(t){t.forEach(l)}function l(t){u&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(s),t}}function UM(t,e,n){const r=t>=0?t:ba(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function qM(t){return H(t)?t:Z(+t)}function PM(){var t=t=>t[0],e=t=>t[1],n=d,r=[-1,-1],i=960,o=500,a=2;function s(u,s){const l=UM(r[0],u,t)>>a,c=UM(r[1],u,e)>>a,f=l?l+2:0,h=c?c+2:0,d=2*f+(i>>a),p=2*h+(o>>a),g=new Float32Array(d*p),m=new Float32Array(d*p);let y=g;u.forEach((r=>{const i=f+(+t(r)>>a),o=h+(+e(r)>>a);i>=0&&i<d&&o>=0&&o<p&&(g[i+o*d]+=+n(r))})),l>0&&c>0?(jM(d,p,g,m,l),IM(d,p,m,g,c),jM(d,p,g,m,l),IM(d,p,m,g,c),jM(d,p,g,m,l),IM(d,p,m,g,c)):l>0?(jM(d,p,g,m,l),jM(d,p,m,g,l),jM(d,p,g,m,l),y=m):c>0&&(IM(d,p,g,m,c),IM(d,p,m,g,c),IM(d,p,g,m,c),y=m);const v=s?Math.pow(2,-2*a):1/Le(y);for(let t=0,e=d*p;t<e;++t)y[t]*=v;return{values:y,scale:1<<a,width:d,height:p,x1:f,y1:h,x2:f+(i>>a),y2:h+(o>>a)}}return s.x=function(e){return arguments.length?(t=qM(e),s):t},s.y=function(t){return arguments.length?(e=qM(t),s):e},s.weight=function(t){return arguments.length?(n=qM(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||u("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||u("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=$(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&u("invalid bandwidth"),r=t,s):r},s}function jM(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<e;++a)for(let e=0,u=0;e<t+i;++e)e<t&&(u+=n[e+a*t]),e>=i&&(e>=o&&(u-=n[e-o+a*t]),r[e-i+a*t]=u/Math.min(e+1,t-1+o-e,o))}function IM(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<t;++a)for(let u=0,s=0;u<e+i;++u)u<e&&(s+=n[a+u*t]),u>=i&&(u>=o&&(s-=n[a+(u-o)*t]),r[a+(u-i)*t]=s/Math.min(u+1,e-1+o-u,o))}function $M(t){pa.call(this,null,t)}RM.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},ut(RM,pa,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||f,o=BM().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=OM(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map((t=>Ce(e(t).values))))}(r,i,t),u=null===t.as?null:t.as||"contour",s=[];return r.forEach((e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,v(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;H(i)&&(i=i(n,r));H(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=(ht(i)?i:i[0])||1,u=(ht(i)?i:i[1])||1,s=o&&o[0]||0,l=o&&o[1]||0;t.forEach(LM(e,a,u,s,l))}(r,n,e,t),r.forEach((t=>{s.push(qo(e,Lo(null!=u?{[u]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=s,n}}),$M.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const WM=["x","y","weight","size","cellSize","bandwidth"];function HM(t,e){return WM.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function YM(t){pa.call(this,null,t)}ut($M,pa,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=function(t,e){var n,r,i,o,a,u,s=[],l=t=>t(o);if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(u=n[a=e.map(l)])||(n[a]=u=[],u.dims=a,s.push(u)),u.push(o);return s}(e.materialize(e.SOURCE).source,t.groupby),a=(t.groupby||[]).map(n),u=HM(PM(),t),s=t.as||"grid";return r=o.map((e=>Lo(function(t,e){for(let n=0;n<a.length;++n)t[a[n]]=e[n];return t}({[s]:u(e,t.counts)},e.dims)))),this.value&&(i.rem=this.value),this.value=i.source=i.add=r,i}}),YM.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},ut(YM,pa,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=BM().smooth(!1!==t.smooth),a=t.values,u=t.thresholds||OM(t.count||10,t.nice,!!a),s=t.size;return a||(a=e.materialize(e.SOURCE).source,r=LM(n=HM(PM(),t)(a,!0),n.scale||1,n.scale||1,0,0),s=[n.width,n.height],a=n.values),u=v(u)?u:u(a),a=o.size(s)(a,u),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(Lo),i}});const VM="Feature",GM="FeatureCollection";function XM(t){pa.call(this,null,t)}function JM(t){pa.call(this,null,t)}function ZM(t){pa.call(this,null,t)}function QM(t){pa.call(this,null,t)}function KM(t){pa.call(this,[],t),this.generator=function(){var t,e,n,r,i,o,a,u,s,l,c,f,h=10,d=h,p=90,g=360,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return Re(Sx(r/p)*p,n,p).map(c).concat(Re(Sx(u/g)*g,a,g).map(f)).concat(Re(Sx(e/h)*h,t,h).filter((function(t){return Ex(t%p)>vx})).map(s)).concat(Re(Sx(o/d)*d,i,d).filter((function(t){return Ex(t%g)>vx})).map(l))}return y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(u).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),u>a&&(t=u,u=a,a=t),y.precision(m)):[[r,u],[n,a]]},y.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(m=+h,s=Fw(o,i,90),l=Sw(e,t,m),c=Fw(u,a,90),f=Sw(r,n,m),y):m},y.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()}function tA(t){pa.call(this,null,t)}function eA(t){if(!H(t))return!1;const e=Dt(r(t));return e.$x||e.$y||e.$value||e.$max}function nA(t){pa.call(this,null,t),this.modified(!0)}function rA(t,e,n){H(t[e])&&t[e](n)}XM.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},ut(XM,pa,{transform(t,e){var n,i=this._features,o=this._points,a=t.fields,u=a&&a[0],s=a&&a[1],l=t.geojson||!a&&f,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(r(l))||u&&e.modified(r(u))||s&&e.modified(r(s)),this.value&&!n||(c=e.SOURCE,this._features=i=[],this._points=o=[]),l&&e.visit(c,(t=>i.push(l(t)))),u&&s&&(e.visit(c,(t=>{var e=u(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&o.push([e,n])})),i=i.concat({type:VM,geometry:{type:"MultiPoint",coordinates:o}})),this.value={type:GM,features:i}}}),JM.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},ut(JM,pa,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||f,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=DM(t.projection),n.materialize().reflow()):a=i===f||e.modified(i.fields)?n.ADD_MOD:n.ADD;const u=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,(t=>t[o]=r(i(t)))),r.pointRadius(u),n.modifies(o)}}),ZM.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},ut(ZM,pa,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],u=a[0],s=a[1];function l(t){const e=r([i(t),o(t)]);e?(t[u]=e[0],t[s]=e[1]):(t[u]=void 0,t[s]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),QM.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},ut(QM,pa,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(DM(t.projection),t.field||l("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[i]=r)),n.modifies(i)}}),KM.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},ut(KM,pa,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const e in t)H(i[e])&&i[e](t[e]);return n=i(),r.length?e.mod.push(Po(r[0],n)):e.add.push(Lo(n)),r[0]=n,e}}),tA.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},ut(tA,pa,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||f,o=function(t,e){let n;H(t)?(n=n=>t(n,e),n.dep=eA(t)):t?n=Z(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;H(t)?(n=n=>wc(t(n,e)),n.dep=eA(t)):n=Z(wc(t||"#888"));return n}(t.color,t),u=t.as||"image",s={$x:0,$y:0,$value:0,$max:r?Ce(n.map((t=>Ce(i(t).values)))):0};return n.forEach((t=>{const e=i(t),n=K({},t,s);r||(n.$max=Ce(e.values||[])),t[u]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,u=t.y1||0,s=t.x2||i,l=t.y2||o,c=t.values,f=c?t=>c[t]:h,d=Gl(s-a,l-u),p=d.getContext("2d"),g=p.getImageData(0,0,s-a,l-u),m=g.data;for(let t=u,o=0;t<l;++t){e.$y=t-u;for(let u=a,l=t*i;u<s;++u,o+=4){e.$x=u-a,e.$value=f(u+l);const t=n(e);m[o+0]=t.r,m[o+1]=t.g,m[o+2]=t.b,m[o+3]=~~(255*r(e))}}return p.putImageData(g,0,0),d}(e,n,a.dep?a:Z(a(n)),o.dep?o:Z(o(n)))})),e.reflow(!0).modifies(u)}}),ut(nA,pa,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=EM((t||"mercator").toLowerCase());e||u("Unrecognized projection type: "+t);return e()}(t.type),MM.forEach((e=>{null!=t[e]&&rA(n,e,t[e])}))):MM.forEach((e=>{t.modified(e)&&rA(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return 1===(t=$(t)).length?t[0]:{type:GM,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===GM?t.features:$(t).filter((t=>null!=t)).map((t=>t.type===VM?t:{type:VM,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var iA=Object.freeze({__proto__:null,contour:YM,geojson:XM,geopath:JM,geopoint:ZM,geoshape:QM,graticule:KM,heatmap:tA,isocontour:RM,kde2d:$M,projection:nA});function oA(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,l,c,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)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),(l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function aA(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function uA(t){return t[0]}function sA(t){return t[1]}function lA(t,e,n){var r=new cA(null==e?uA:e,null==n?sA:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function cA(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function fA(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var hA=lA.prototype=cA.prototype;function dA(t){return function(){return t}}function pA(t){return 1e-6*(t()-.5)}function gA(t){return t.x+t.vx}function mA(t){return t.y+t.vy}function yA(t){return t.index}function vA(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}hA.copy=function(){var t,e,n=new cA(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=fA(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=fA(e));return n},hA.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return oA(this.cover(e,n),e,n,t)},hA.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),n=0;n<o;++n)oA(this,a[n],u[n],t[n]);return this},hA.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=l,l=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},hA.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},hA.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]]},hA.find=function(t,e,n){var r,i,o,a,u,s,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new aA(g,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(g=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)<c||(u=s.y1)<f))if(g.length){var m=(i+a)/2,y=(o+u)/2;p.push(new aA(g[3],m,y,a,u),new aA(g[2],i,y,m,u),new aA(g[1],m,o,a,y),new aA(g[0],i,o,m,y)),(l=(e>=y)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var v=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),x=v*v+_*_;if(x<n){var b=Math.sqrt(n=x);c=t-b,f=e-b,h=t+b,d=e+b,r=g.data}}return r},hA.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,l,c,f,h,d=this._root,p=this._x0,g=this._y0,m=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(u=(p+m)/2))?p=u:m=u,(c=a>=(s=(g+y)/2))?g=s:y=s,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.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&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},hA.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},hA.root=function(){return this._root},hA.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},hA.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new aA(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var l=(r+o)/2,c=(i+a)/2;(n=s[3])&&u.push(new aA(n,l,c,o,a)),(n=s[2])&&u.push(new aA(n,r,c,l,a)),(n=s[1])&&u.push(new aA(n,l,i,o,c)),(n=s[0])&&u.push(new aA(n,r,i,l,c))}return this},hA.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new aA(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,l=e.y1,c=(a+s)/2,f=(u+l)/2;(o=i[0])&&n.push(new aA(o,a,u,c,f)),(o=i[1])&&n.push(new aA(o,c,u,s,f)),(o=i[2])&&n.push(new aA(o,a,f,c,l)),(o=i[3])&&n.push(new aA(o,c,f,s,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},hA.x=function(t){return arguments.length?(this._x=t,this):this._x},hA.y=function(t){return arguments.length?(this._y=t,this):this._y};var _A={value:()=>{}};function xA(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new bA(r)}function bA(t){this._=t}function wA(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function kA(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function MA(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=_A,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}bA.prototype=xA.prototype={constructor:bA,on:function(t,e){var n,r=this._,i=wA(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=MA(r[n],t.name,e);else if(null==e)for(n in r)r[n]=MA(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=kA(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new bA(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var AA,EA,DA=0,CA=0,FA=0,SA=0,BA=0,TA=0,zA="object"==typeof performance&&performance.now?performance:Date,NA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function OA(){return BA||(NA(RA),BA=zA.now()+TA)}function RA(){BA=0}function LA(){this._call=this._time=this._next=null}function UA(t,e,n){var r=new LA;return r.restart(t,e,n),r}function qA(){BA=(SA=zA.now())+TA,DA=CA=0;try{!function(){OA(),++DA;for(var t,e=AA;e;)(t=BA-e._time)>=0&&e._call.call(null,t),e=e._next;--DA}()}finally{DA=0,function(){var t,e,n=AA,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:AA=e);EA=t,jA(r)}(),BA=0}}function PA(){var t=zA.now(),e=t-SA;e>1e3&&(TA-=e,SA=t)}function jA(t){DA||(CA&&(CA=clearTimeout(CA)),t-BA>24?(t<1/0&&(CA=setTimeout(qA,t-zA.now()-TA)),FA&&(FA=clearInterval(FA))):(FA||(SA=zA.now(),FA=setInterval(PA,1e3)),DA=1,NA(qA)))}LA.prototype=UA.prototype={constructor:LA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?OA():+n)+(null==e?0:+e),this._next||EA===this||(EA?EA._next=this:AA=this,EA=this),this._call=t,this._time=n,jA()},stop:function(){this._call&&(this._call=null,this._time=1/0,jA())}};const IA=4294967296;function $A(t){return t.x}function WA(t){return t.y}var HA=Math.PI*(3-Math.sqrt(5));function YA(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=UA(f),l=xA("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%IA)/IA}();function f(){h(),l.call("tick",e),n<r&&(s.stop(),l.call("end",e))}function h(r){var s,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,u.forEach((function(t){t(n)})),s=0;s<c;++s)null==(l=t[s]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*HA;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return s.restart(f),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,u.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(u=t[l]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}const VA={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i},collide:function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=lA(e,gA,mA).visitAfter(u),t=0;t<d;++t)s=e[t],f=n[s.index],h=f*f,l=s.x+s.vx,c=s.y+s.vy,a.visit(g);function g(t,e,n,o,a){var u=t.data,d=t.r,p=f+d;if(!u)return e>l+p||o<l-p||n>c+p||a<c-p;if(u.index>s.index){var g=l-u.x-u.vx,m=c-u.y-u.vy,y=g*g+m*m;y<p*p&&(0===g&&(y+=(g=pA(r))*g),0===m&&(y+=(m=pA(r))*m),y=(p-(y=Math.sqrt(y)))/y*i,s.vx+=(g*=y)*(p=(d*=d)/(h+d)),s.vy+=(m*=y)*p,u.vx-=g*(p=1-p),u.vy-=m*p)}}}function u(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 s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=dA(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:dA(+e),s(),a):t},a},nbody:function(){var t,e,n,r,i,o=dA(-30),a=1,u=1/0,s=.81;function l(n){var i,o=t.length,a=lA(t,$A,WA).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/s<p)return p<u&&(0===f&&(p+=(f=pA(n))*f),0===h&&(p+=(h=pA(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===f&&(p+=(f=pA(n))*f),0===h&&(p+=(h=pA(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:dA(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l.theta=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l},link:function(t){var e,n,r,i,o,a,u=yA,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=dA(30),c=1;function f(r){for(var i=0,u=t.length;i<c;++i)for(var s,l,f,h,d,p,g,m=0;m<u;++m)l=(s=t[m]).source,h=(f=s.target).x+f.vx-l.x-l.vx||pA(a),d=f.y+f.vy-l.y-l.vy||pA(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[m])/p*r*e[m],d*=p,f.vx-=h*(g=o[m]),f.vy-=d*g,l.vx+=h*(g=1-g),l.vy+=d*g}function h(){if(r){var a,s,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=vA(f,s.source)),"object"!=typeof s.target&&(s.target=vA(f,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(u=t,f):u},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(s="function"==typeof t?t:dA(+t),d(),f):s},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:dA(+t),p(),f):l},f},x:function(t){var e,n,r,i=dA(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=dA(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:dA(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:dA(+e),a(),o):t},o},y:function(t){var e,n,r,i=dA(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=dA(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:dA(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:dA(+e),a(),o):t},o}},GA="forces",XA=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],JA=["static","iterations"],ZA=["x","y","vx","vy"];function QA(t){pa.call(this,null,t)}function KA(t,e,n,r){var i,o,a,u,s=$(e.forces);for(i=0,o=XA.length;i<o;++i)(a=XA[i])!==GA&&e.modified(a)&&t[a](e[a]);for(i=0,o=s.length;i<o;++i)u=GA+i,(a=n||e.modified(GA,i)?eE(s[i]):r&&tE(s[i],r)?t.force(u):null)&&t.force(u,a);for(o=t.numForces||0;i<o;++i)t.force(GA+i,null);return t.numForces=s.length,t}function tE(t,e){var n,i;for(n in t)if(H(i=t[n])&&e.modified(r(i)))return 1;return 0}function eE(t){var e,n;for(n in rt(VA,t.force)||u("Unrecognized force: "+t.force),e=VA[t.force](),t)H(e[n])&&nE(e[n],t[n],t);return e}function nE(t,e,n){t(H(e)?t=>e(t,n):e)}QA.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:ZA}]},ut(QA,pa,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(XA),u=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&KA(i,t,0,e)):(this.value=i=function(t,e){const n=YA(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),KA(n,e,!0).on("end",(()=>o=!0))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(JA)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/u)),t.static)for(i.stop();--u>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let t,e=this._argops,u=0,s=e.length;u<s;++u)if(t=e[u],t.name===GA&&"link"===t.op._argval.force)for(var r,i=t.op._argops,o=0,a=i.length;o<a;++o)if("links"===i[o].name&&(r=i[o].op.source)){n.pulse(r,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(ZA)}});var rE=Object.freeze({__proto__:null,force:QA});function iE(t,e){return t.parent===e.parent?1:2}function oE(t,e){return t+e.x}function aE(t,e){return Math.max(t,e.y)}function uE(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function sE(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=cE)):void 0===e&&(e=lE);for(var n,r,i,o,a,u=new dE(t),s=[u];n=s.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)s.push(r=i[o]=new dE(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(hE)}function lE(t){return t.children}function cE(t){return Array.isArray(t)?t[1]:null}function fE(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hE(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function dE(t){this.data=t,this.depth=this.height=0,this.parent=null}function pE(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(Array.from(t))).length,o=[];r<i;)e=t[r],n&&yE(n,e)?++r:(n=_E(o=gE(o,e)),r=0);return n}function gE(t,e){var n,r;if(vE(e,t))return[e];for(n=0;n<t.length;++n)if(mE(e,t[n])&&vE(xE(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(mE(xE(t[n],t[r]),e)&&mE(xE(t[n],e),t[r])&&mE(xE(t[r],e),t[n])&&vE(bE(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function mE(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function yE(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function vE(t,e){for(var n=0;n<e.length;++n)if(!yE(t,e[n]))return!1;return!0}function _E(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return xE(t[0],t[1]);case 3:return bE(t[0],t[1],t[2])}}function xE(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,u=e.r,s=o-n,l=a-r,c=u-i,f=Math.sqrt(s*s+l*l);return{x:(n+o+s/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+u)/2}}function bE(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,u=e.y,s=e.r,l=n.x,c=n.y,f=n.r,h=r-a,d=r-l,p=i-u,g=i-c,m=s-o,y=f-o,v=r*r+i*i-o*o,_=v-a*a-u*u+s*s,x=v-l*l-c*c+f*f,b=d*p-h*g,w=(p*x-g*_)/(2*b)-r,k=(g*m-p*y)/b,M=(d*_-h*x)/(2*b)-i,A=(h*y-d*m)/b,E=k*k+A*A-1,D=2*(o+w*k+M*A),C=w*w+M*M-o*o,F=-(E?(D+Math.sqrt(D*D-4*E*C))/(2*E):C/D);return{x:r+w+k*F,y:i+M+A*F,r:F}}function wE(t,e,n){var r,i,o,a,u=t.x-e.x,s=t.y-e.y,l=u*u+s*s;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*u-o*s,n.y=t.y-r*s+o*u):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*u-o*s,n.y=e.y+r*s+o*u)):(n.x=e.x+n.r,n.y=e.y)}function kE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function ME(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function AE(t){this._=t,this.next=null,this.previous=null}function EE(t){if(!(i=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var e,n,r,i,o,a,u,s,l,c,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;wE(n,e,r=t[2]),e=new AE(e),n=new AE(n),r=new AE(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;u<i;++u){wE(e._,n._,r=t[u]),r=new AE(r),s=n.next,l=e.previous,c=n._.r,f=e._.r;do{if(c<=f){if(kE(s._,r._)){n=s,e.next=n,n.previous=e,--u;continue t}c+=s._.r,s=s.next}else{if(kE(l._,r._)){(e=l).next=n,n.previous=e,--u;continue t}f+=l._.r,l=l.previous}}while(s!==l.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,o=ME(e);(r=r.next)!==n;)(a=ME(r))<o&&(e=r,o=a);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=pE(e),u=0;u<i;++u)(e=t[u]).x-=r.x,e.y-=r.y;return r.r}function DE(t){return null==t?null:CE(t)}function CE(t){if("function"!=typeof t)throw new Error;return t}function FE(){return 0}function SE(t){return function(){return t}}function BE(t){return Math.sqrt(t.value)}function TE(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function zE(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,u=t(n)*e||0;if(u)for(i=0;i<a;++i)r[i].r+=u;if(o=EE(r),u)for(i=0;i<a;++i)r[i].r-=u;n.r=o+u}}}function NE(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function OE(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function RE(t,e,n,r,i){for(var o,a=t.children,u=-1,s=a.length,l=t.value&&(r-e)/t.value;++u<s;)(o=a[u]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}dE.prototype=sE.prototype={constructor:dE,count:function(){return this.eachAfter(uE)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],u=[],s=-1;o=a.pop();)if(u.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=u.pop();)t.call(e,o,++s,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return sE(this).eachBefore(fE)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};var LE={depth:-1},UE={};function qE(t){return t.id}function PE(t){return t.parentId}function jE(){var t=qE,e=PE;function n(n){var r,i,o,a,u,s,l,c=Array.from(n),f=c.length,h=new Map;for(i=0;i<f;++i)r=c[i],u=c[i]=new dE(r),null!=(s=t(r,i,n))&&(s+="")&&(l=u.id=s,h.set(l,h.has(l)?UE:u)),null!=(s=e(r,i,n))&&(s+="")&&(u.parent=s);for(i=0;i<f;++i)if(s=(u=c[i]).parent){if(!(a=h.get(s)))throw new Error("missing: "+s);if(a===UE)throw new Error("ambiguous: "+s);a.children?a.children.push(u):a.children=[u],u.parent=a}else{if(o)throw new Error("multiple roots");o=u}if(!o)throw new Error("no root");if(o.parent=LE,o.eachBefore((function(t){t.depth=t.parent.depth+1,--f})).eachBefore(hE),o.parent=null,f>0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=CE(e),n):t},n.parentId=function(t){return arguments.length?(e=CE(t),n):e},n}function IE(t,e){return t.parent===e.parent?1:2}function $E(t){var e=t.children;return e?e[0]:t.t}function WE(t){var e=t.children;return e?e[e.length-1]:t.t}function HE(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function YE(t,e,n){return t.a.parent===e.parent?t.a:n}function VE(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function GE(t,e,n,r,i){for(var o,a=t.children,u=-1,s=a.length,l=t.value&&(i-n)/t.value;++u<s;)(o=a[u]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}VE.prototype=Object.create(dE.prototype);var XE=(1+Math.sqrt(5))/2;function JE(t,e,n,r,i,o){for(var a,u,s,l,c,f,h,d,p,g,m,y=[],v=e.children,_=0,x=0,b=v.length,w=e.value;_<b;){s=i-n,l=o-r;do{c=v[x++].value}while(!c&&x<b);for(f=h=c,m=c*c*(g=Math.max(l/s,s/l)/(w*t)),p=Math.max(h/m,m/f);x<b;++x){if(c+=u=v[x].value,u<f&&(f=u),u>h&&(h=u),m=c*c*g,(d=Math.max(h/m,m/f))>p){c-=u;break}p=d}y.push(a={value:c,dice:s<l,children:v.slice(_,x)}),a.dice?RE(a,n,r,i,w?r+=l*c/w:o):GE(a,n,r,w?n+=s*c/w:i,o),w-=c,_=x}return y}var ZE=function t(e){function n(t,n,r,i,o){JE(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(XE);var QE=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,s,l,c,f=-1,h=a.length,d=t.value;++f<h;){for(s=(u=a[f]).children,l=u.value=0,c=s.length;l<c;++l)u.value+=s[l].value;u.dice?RE(u,n,r,i,d?r+=(o-r)*u.value/d:o):GE(u,n,r,d?n+=(i-n)*u.value/d:i,o),d-=u.value}else t._squarify=a=JE(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(XE);function KE(t,e,n){const r={};return t.each((t=>{const i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t}function tD(t){pa.call(this,null,t)}tD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const eD=t=>t.values;function nD(){const t=[],e={entries:t=>r(n(t,0),0),key:n=>(t.push(n),e)};function n(e,r){if(r>=t.length)return e;const i=e.length,o=t[r++],a={},u={};let s,l,c,f=-1;for(;++f<i;)s=o(l=e[f])+"",(c=a[s])?c.push(l):a[s]=[l];for(s in a)u[s]=n(a[s],r);return u}function r(e,n){if(++n>t.length)return e;const i=[];for(const t in e)i.push({key:t,values:r(e[t],n)});return i}return e}function rD(t){pa.call(this,null,t)}ut(tD,pa,{transform(t,e){e.source||u("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each((t=>{t.children&&No(t.data)&&i.rem.push(t.data)})),this.value=o=sE({values:$(t.keys).reduce(((t,e)=>(t.key(e),t)),nD()).entries(i.source)},eD),n&&o.each((t=>{t.children&&(t=Lo(t.data),i.add.push(t),i.source.push(t))})),KE(o,Oo,Oo)),i.source.root=o,i}});const iD=(t,e)=>t.parent===e.parent?1:2;ut(rD,pa,{transform(t,e){e.source&&e.source.root||u(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(jo(t.sort,(t=>t.data))),function(t,e,n){for(let r,i=0,o=e.length;i<o;++i)r=e[i],r in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?iD:d);try{this.value=n(i)}catch(t){u(t)}return i.each((t=>function(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o<i;++o)r[n[o]]=t[e[o]];r[n[i]]=t.children?t.children.length:0}(t,r,o))),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const oD=["x","y","r","depth","children"];function aD(t){rD.call(this,t)}aD.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:oD.length,default:oD}]},ut(aD,rD,{layout:function(){var t=null,e=1,n=1,r=FE;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(TE(t)).eachAfter(zE(r,.5)).eachBefore(NE(1)):i.eachBefore(TE(BE)).eachAfter(zE(FE,1)).eachAfter(zE(r,i.r/Math.min(e,n))).eachBefore(NE(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=DE(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:SE(+t),i):r},i},params:["radius","size","padding"],fields:oD});const uD=["x0","y0","x1","y1","depth","children"];function sD(t){rD.call(this,t)}function lD(t){pa.call(this,null,t)}sD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:uD.length,default:uD}]},ut(sD,rD,{layout:function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&RE(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,u=r.y1-n;a<i&&(i=a=(i+a)/2),u<o&&(o=u=(o+u)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=u}}(e,o)),r&&i.eachBefore(OE),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},params:["size","round","padding"],fields:uD}),lD.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},ut(lD,pa,{transform(t,e){e.source||u("Stratify transform requires an upstream data source.");let n=this.value;const r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!n||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?KE(jE().id(t.key).parentId(t.parentKey)(i.source),t.key,p):KE(jE()([{}]),t.key,t.key)),i.source.root=this.value=n,i}});const cD={tidy:function(){var t=IE,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new VE(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new VE(r[i],i)),n.parent=e;return(a.parent=new VE(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>c.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=l===c?1:t(l,c)/2,d=h-l.x,p=e/(c.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,s=o.parent.children[0],l=o.m,c=a.m,f=u.m,h=s.m;u=WE(u),o=$E(o),u&&o;)s=$E(s),(a=WE(a)).a=e,(i=u.z+f-o.z-l+t(u._,o._))>0&&(HE(YE(u,e,r),e,i),l+=i,c+=i),f+=u.m,l+=o.m,h+=s.m,c+=a.m;u&&!WE(a)&&(a.t=u,a.m+=f-c),o&&!$E(s)&&(s.t=o,s.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=iE,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(oE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(aE,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=u.x-t(u,s)/2,c=s.x+t(s,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},fD=["x","y","depth","children"];function hD(t){rD.call(this,t)}function dD(t){pa.call(this,[],t)}hD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:fD.length,default:fD}]},ut(hD,rD,{layout(t){const e=t||"tidy";if(rt(cD,e))return cD[e]();u("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:fD}),dD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ut(dD,pa,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||u("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(t=>o[Oo(t)]=1)),r.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[Oo(e)]&&o[Oo(n)]&&i.add.push(Lo({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[Oo(t)]=1)),n.forEach((t=>{(o[Oo(t.source)]||o[Oo(t.target)])&&i.mod.push(t)}))),i}});const pD={binary:function(t,e,n,r,i){var o,a,u=t.children,s=u.length,l=new Array(s+1);for(l[0]=a=o=0;o<s;++o)l[o+1]=a+=u[o].value;!function t(e,n,r,i,o,a,s){if(e>=n-1){var c=u[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=s)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var m=l[d]-f,y=r-m;if(a-i>s-o){var v=r?(i*y+a*m)/r:a;t(e,d,m,i,o,v,s),t(d,n,y,v,o,a,s)}else{var _=r?(o*y+s*m)/r:s;t(e,d,m,i,o,a,_),t(d,n,y,i,_,a,s)}}(0,s,t.value,e,n,r,i)},dice:RE,slice:GE,slicedice:function(t,e,n,r,i){(1&t.depth?GE:RE)(t,e,n,r,i)},squarify:ZE,resquarify:QE},gD=["x0","y0","x1","y1","depth","children"];function mD(t){rD.call(this,t)}mD.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:gD.length,default:gD}]},ut(mD,rD,{layout(){const t=function(){var t=ZE,e=!1,n=1,r=1,i=[0],o=FE,a=FE,u=FE,s=FE,l=FE;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(OE),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,(f-=u(e)-n)<r&&(r=f=(r+f)/2),(h-=s(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,f,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=CE(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:SE(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:SE(+t),c):a},c.paddingRight=function(t){return arguments.length?(u="function"==typeof t?t:SE(+t),c):u},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:SE(+t),c):s},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:SE(+t),c):l},c}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{rt(pD,e)?t.tile(pD[e]):u("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:gD});var yD=Object.freeze({__proto__:null,nest:tD,pack:aD,partition:sD,stratify:lD,tree:hD,treelinks:dD,treemap:mD});function vD(t,e,n,r){const i=t.width,o=t.height,a=n||r,u=Gl(i,o).getContext("2d");e.forEach((t=>_D(u,t,a)));const s=new Uint32Array(u.getImageData(0,0,i,o).data.buffer),l=t.bitmap(),c=a&&t.bitmap();let f,h,d,p,g;for(h=0;h<o;++h)for(f=0;f<i;++f)g=4278190080&s[h*i+f],g&&(d=t(f),p=t(h),r||l.set(d,p),a&&268435456^g&&c.set(d,p));return[l,c]}function _D(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach((e=>{e.items.forEach((e=>_D(t,e.items,n)))})):Ym[r].draw(t,{items:n?e.map(xD):e})}function xD(t){const e=qo(t,{});return e.stroke&&(e.strokeOpacity=1),e.fill&&(e.fillOpacity=.0625,e.stroke="#000",e.strokeOpacity=1,e.strokeWidth=2),e}const bD=31,wD=new Uint32Array(33),kD=new Uint32Array(33);kD[0]=0,wD[0]=~kD[0];for(let t=1;t<=32;++t)kD[t]=kD[t-1]<<1|1,wD[t]=~kD[t];function MD(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),a=t=>~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+32)/32));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>5]&1<<(i&bD)},set:(e,n)=>{const i=n*t+e;r(i>>>5,1<<(i&bD))},clear:(e,n)=>{const r=n*t+e;i(r>>>5,~(1<<(r&bD)))},getRange:(e,r,i,o)=>{let a,u,s,l,c=o;for(;c>=r;--c)if(a=c*t+e,u=c*t+i,s=a>>>5,l=u>>>5,s===l){if(n[s]&wD[a&bD]&kD[1+(u&bD)])return!0}else{if(n[s]&wD[a&bD])return!0;if(n[l]&kD[1+(u&bD)])return!0;for(let t=s+1;t<l;++t)if(n[t])return!0}return!1},setRange:(e,n,i,o)=>{let a,u,s,l,c;for(;n<=o;++n)if(a=n*t+e,u=n*t+i,s=a>>>5,l=u>>>5,s===l)r(s,wD[a&bD]&kD[1+(u&bD)]);else for(r(s,wD[a&bD]),r(l,kD[1+(u&bD)]),c=s+1;c<l;++c)r(c,4294967295)},clearRange:(e,n,r,o)=>{let a,u,s,l,c;for(;n<=o;++n)if(a=n*t+e,u=n*t+r,s=a>>>5,l=u>>>5,s===l)i(s,kD[a&bD]|wD[1+(u&bD)]);else for(i(s,kD[a&bD]),i(l,wD[1+(u&bD)]),c=s+1;c<l;++c)i(c,0)},outOfBounds:(n,r,i,o)=>n<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}function AD(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function ED(t,e,n,r,i,o,a,u){const s=i*o/(2*r),l=t(e-s),c=t(e+s),f=t(n-(o/=2)),h=t(n+o);return a.outOfBounds(l,f,c,h)||a.getRange(l,f,c,h)||u&&u.getRange(l,f,c,h)}const DD=[-1,-1,1,1],CD=[-1,1,-1,1];const FD=["right","center","left"],SD=["bottom","middle","top"];function BD(t,e,n,r,i,o,a,u,s,l,c,f){return!(i.outOfBounds(t,n,e,r)||(f&&o?o.getRange(t,n,e,r)||!function(t,e,n,r,i){return i[0]<=t&&n<=i[2]&&i[3]<=e&&r<=i[5]}(a,s,u,l,c):i.getRange(t,n,e,r)))}const TD={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},zD={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,u=Cm.width(t.datum,t.datum.text);let s,l,c,f,h,d,p,g=0;for(let r=0;r<n;++r)s=e[r].x,c=e[r].y,l=void 0===e[r].x2?s:e[r].x2,f=void 0===e[r].y2?c:e[r].y2,h=(s+l)/2,d=(c+f)/2,p=Math.abs(l-s+f-c),p>=g&&(g=p,t.x=h,t.y=d);return h=u/2,d=a/2,s=t.x-h,l=t.x+h,c=t.y-d,f=t.y+d,t.align="center",s<0&&l<=i?t.align="left":0<=s&&i<l&&(t.align="right"),t.baseline="middle",c<0&&f<=o?t.baseline="top":0<=c&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,r){const i=t.width,o=t.height,a=e[0],u=e[1];function s(e,n,r,s,l){const c=t.invert(e),f=t.invert(n);let h,d=r,p=o;if(!AD(c,f,s,l,i,o)&&!ED(t,c,f,l,s,d,a,u)&&!ED(t,c,f,l,s,l,a,null)){for(;p-d>=1;)h=(d+p)/2,ED(t,c,f,l,s,h,a,u)?p=h:d=h;if(d>r)return[c,f,d,!0]}}return function(e){const u=e.datum.datum.items[r].items,l=u.length,c=e.datum.fontSize,f=Cm.width(e.datum,e.datum.text);let h,d,p,g,m,y,v,_,x,b,w,k,M,A,E,D,C,F=n?c:0,S=!1,B=!1,T=0;for(let r=0;r<l;++r){for(h=u[r].x,p=u[r].y,d=void 0===u[r].x2?h:u[r].x2,g=void 0===u[r].y2?p:u[r].y2,h>d&&(C=h,h=d,d=C),p>g&&(C=p,p=g,g=C),x=t(h),w=t(d),b=~~((x+w)/2),k=t(p),A=t(g),M=~~((k+A)/2),v=b;v>=x;--v)for(_=M;_>=k;--_)D=s(v,_,F,f,c),D&&([e.x,e.y,F,S]=D);for(v=b;v<=w;++v)for(_=M;_<=A;++_)D=s(v,_,F,f,c),D&&([e.x,e.y,F,S]=D);S||n||(E=Math.abs(d-h+g-p),m=(h+d)/2,y=(p+g)/2,E>=T&&!AD(m,y,f,c,i,o)&&!ED(t,m,y,c,f,c,a,null)&&(T=E,e.x=m,e.y=y,B=!0))}return!(!S&&!B)&&(m=f/2,y=c/2,a.setRange(t(e.x-m),t(e.y-y),t(e.x+m),t(e.y+y)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,r){const i=t.width,o=t.height,a=e[0],u=e[1],s=t.bitmap();return function(e){const l=e.datum.datum.items[r].items,c=l.length,f=e.datum.fontSize,h=Cm.width(e.datum,e.datum.text),d=[];let p,g,m,y,v,_,x,b,w,k,M,A,E=n?f:0,D=!1,C=!1,F=0;for(let r=0;r<c;++r){for(p=l[r].x,m=l[r].y,g=void 0===l[r].x2?p:l[r].x2,y=void 0===l[r].y2?m:l[r].y2,d.push([t((p+g)/2),t((m+y)/2)]);d.length;)if([x,b]=d.pop(),!(a.get(x,b)||u.get(x,b)||s.get(x,b))){s.set(x,b);for(let t=0;t<4;++t)v=x+DD[t],_=b+CD[t],s.outOfBounds(v,_,v,_)||d.push([v,_]);if(v=t.invert(x),_=t.invert(b),w=E,k=o,!AD(v,_,h,f,i,o)&&!ED(t,v,_,f,h,w,a,u)&&!ED(t,v,_,f,h,f,a,null)){for(;k-w>=1;)M=(w+k)/2,ED(t,v,_,f,h,M,a,u)?k=M:w=M;w>E&&(e.x=v,e.y=_,E=w,D=!0)}}D||n||(A=Math.abs(g-p+y-m),v=(p+g)/2,_=(m+y)/2,A>=F&&!AD(v,_,h,f,i,o)&&!ED(t,v,_,f,h,f,a,null)&&(F=A,e.x=v,e.y=_,C=!0))}return!(!D&&!C)&&(v=h/2,_=f/2,a.setRange(t(e.x-v),t(e.y-_),t(e.x+v),t(e.y+_)),e.align="center",e.baseline="middle",!0)}}};function ND(t,e,n,r,i,o,a,u,s,l,c){if(!t.length)return t;const f=Math.max(r.length,i.length),h=function(t,e){const n=new Float64Array(e),r=t.length;for(let e=0;e<r;++e)n[e]=t[e]||0;for(let t=r;t<e;++t)n[t]=n[r-1];return n}(r,f),d=function(t,e){const n=new Int8Array(e),r=t.length;for(let e=0;e<r;++e)n[e]|=TD[t[e]];for(let t=r;t<e;++t)n[t]=n[r-1];return n}(i,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,g="group"===p&&t[0].datum.items[s].marktype,m="area"===g,y=function(t,e,n,r){const i=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(p,g,u,s),v=MD(e[0],e[1],l),_=m&&"naive"===c;var x;const b=t.map((t=>({datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(t)})));let w;if(!_){n&&b.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;t<d.length&&!e;++t)e=5===d[t]||h[t]<0;p&&(a||m)&&(o=[t.map((t=>t.datum))].concat(o)),w=o.length?vD(v,o,e,m):function(t,e){const n=t.bitmap();return(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}(v,a&&b)}const k=m?zD[c](v,w,a,s):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],u=e[1],s=r.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,h,d,p,g,m,y,v,_,x,b,w,k,M,A,E=0;for(let i=0;i<s;++i){if(f=(3&n[i])-1,h=(n[i]>>>2&3)-1,d=0===f&&0===h||r[i]<0,p=f&&h?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,b=l[4+h]+g*c*h/2+r[i]*h*p,v=b-c/2,_=b+c/2,w=t(m),M=t(v),A=t(_),!E){if(!BD(w,w,M,A,a,u,m,m,v,_,l,d))continue;E=Cm.width(e.datum,e.datum.text)}if(x=m+g*E*f/2,m=x-E/2,y=x+E/2,w=t(m),k=t(y),BD(w,k,M,A,a,u,m,y,v,_,l,d))return e.x=f?f*g<0?y:m:x,e.y=h?h*g<0?_:v:b,e.align=FD[f*g+1],e.baseline=SD[h*g+1],a.setRange(w,M,k,A),!0}return!1}}(v,w,d,h);return b.forEach((t=>t.opacity=+k(t))),b}const OD=["x","y","opacity","align","baseline"],RD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function LD(t){pa.call(this,null,t)}LD.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:RD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:OD.length,default:OD}]},ut(LD,pa,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const r=t[n];return H(r)&&e.modified(r.fields)}("sort")))return;t.size&&2===t.size.length||u("Size parameter should be specified as a [width, height] array.");const r=t.as||OD;return ND(e.materialize(e.SOURCE).source,t.size,t.sort,$(t.offset||1),$(t.anchor||RD),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,t.padding||0,t.method||"naive").forEach((t=>{const e=t.datum;e[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline})),e.reflow(n).modifies(r)}});var UD=Object.freeze({__proto__:null,label:LD});function qD(t,e){var n,r,i,o,a,u,s=[],l=function(t){return t(o)};if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(u=n[a=e.map(l)])||(n[a]=u=[],u.dims=a,s.push(u)),u.push(o);return s}function PD(t){pa.call(this,null,t)}PD.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},ut(PD,pa,{transform(t,e){const r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=qD(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(n),a=o.length,u=t.as||[n(t.x),n(t.y)],s=[];i.forEach((e=>{nu(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let t=0;t<a;++t)n[o[t]]=e.dims[t];n[u[0]]=t[0],n[u[1]]=t[1],s.push(Lo(n))}))})),this.value&&(r.rem=this.value),this.value=r.add=r.source=s}return r}});const jD={linear:Xa,log:Ja,exp:Za,pow:Qa,quad:Ka,poly:tu};function ID(t){pa.call(this,null,t)}ID.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(jD)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},ut(ID,pa,{transform(t,e){const r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=qD(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(n),a=t.method||"linear",s=t.order||3,l=((t,e)=>"poly"===t?e:"quad"===t?2:1)(a,s),c=t.as||[n(t.x),n(t.y)],f=jD[a],h=[];let d=t.extent;rt(jD,a)||u("Invalid regression method: "+a),null!=d&&"log"===a&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach((n=>{if(n.length<=l)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=f(n,t.x,t.y,s);if(t.params)return void h.push(Lo({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const i=d||tt(n,t.x),u=t=>{const e={};for(let t=0;t<o.length;++t)e[o[t]]=n.dims[t];e[c[0]]=t[0],e[c[1]]=t[1],h.push(Lo(e))};"linear"===a?i.forEach((t=>u([t,r.predict(t)]))):au(r.predict,i,25,200).forEach(u)})),this.value&&(r.rem=this.value),this.value=r.add=r.source=h}return r}});var $D=Object.freeze({__proto__:null,loess:PD,regression:ID});const WD=Math.pow(2,-52),HD=new Uint32Array(512);class YD{static from(t,e=tC,n=eC){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new YD(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,s=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[2*e],r=t[2*e+1];n<a&&(a=n),r<u&&(u=r),n>s&&(s=n),r>l&&(l=r),this._ids[e]=e}const c=(a+s)/2,f=(u+l)/2;let h,d,p,g=1/0;for(let e=0;e<o;e++){const n=VD(c,f,t[2*e],t[2*e+1]);n<g&&(h=e,g=n)}const m=t[2*h],y=t[2*h+1];g=1/0;for(let e=0;e<o;e++){if(e===h)continue;const n=VD(m,y,t[2*e],t[2*e+1]);n<g&&n>0&&(d=e,g=n)}let v=t[2*d],_=t[2*d+1],x=1/0;for(let e=0;e<o;e++){if(e===h||e===d)continue;const n=ZD(m,y,v,_,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let b=t[2*p],w=t[2*p+1];if(x===1/0){for(let e=0;e<o;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];QD(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(XD(m,y,v,_,b,w)){const t=d,e=v,n=_;d=p,v=b,_=w,p=t,b=e,w=n}const k=function(t,e,n,r,i,o){const a=n-t,u=r-e,s=i-t,l=o-e,c=a*a+u*u,f=s*s+l*l,h=.5/(a*l-u*s);return{x:t+(l*c-u*f)*h,y:e+(a*f-s*c)*h}}(m,y,v,_,b,w);this._cx=k.x,this._cy=k.y;for(let e=0;e<o;e++)this._dists[e]=VD(t[2*e],t[2*e+1],k.x,k.y);QD(this._ids,this._dists,0,o-1),this._hullStart=h;let M=3;n[h]=e[p]=d,n[d]=e[h]=p,n[p]=e[d]=h,r[h]=0,r[d]=1,r[p]=2,i.fill(-1),i[this._hashKey(m,y)]=h,i[this._hashKey(v,_)]=d,i[this._hashKey(b,w)]=p,this.trianglesLen=0,this._addTriangle(h,d,p,-1,-1,-1);for(let o,a,u=0;u<this._ids.length;u++){const s=this._ids[u],l=t[2*s],c=t[2*s+1];if(u>0&&Math.abs(l-o)<=WD&&Math.abs(c-a)<=WD)continue;if(o=l,a=c,s===h||s===d||s===p)continue;let f=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(f=i[(e+t)%this._hashSize],-1===f||f===n[f]);t++);f=e[f];let g,m=f;for(;g=n[m],!XD(l,c,t[2*m],t[2*m+1],t[2*g],t[2*g+1]);)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,s,n[m],-1,-1,r[m]);r[s]=this._legalize(y+2),r[m]=y,M++;let v=n[m];for(;g=n[v],XD(l,c,t[2*v],t[2*v+1],t[2*g],t[2*g+1]);)y=this._addTriangle(v,s,g,r[s],-1,r[v]),r[s]=this._legalize(y+2),n[v]=v,M--,v=g;if(m===f)for(;g=e[m],XD(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1]);)y=this._addTriangle(g,s,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,M--,m=g;this._hullStart=e[s]=m,n[m]=e[v]=s,n[s]=v,i[this._hashKey(l,c)]=s,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=HD[--i];continue}const s=a-a%3,l=u+(t+1)%3,c=s+(a+2)%3,f=e[o],h=e[t],d=e[l],p=e[c];if(JD(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);const u=s+(a+1)%3;i<HD.length&&(HD[i++]=u)}else{if(0===i)break;t=HD[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function VD(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function GD(t,e,n,r,i,o){const a=(r-e)*(i-t),u=(n-t)*(o-e);return Math.abs(a-u)>=33306690738754716e-32*Math.abs(a+u)?a-u:0}function XD(t,e,n,r,i,o){return(GD(i,o,t,e,n,r)||GD(t,e,n,r,i,o)||GD(n,r,i,o,t,e))<0}function JD(t,e,n,r,i,o,a,u){const s=t-a,l=e-u,c=n-a,f=r-u,h=i-a,d=o-u,p=c*c+f*f,g=h*h+d*d;return s*(f*g-p*d)-l*(c*g-p*h)+(s*s+l*l)*(c*d-f*h)<0}function ZD(t,e,n,r,i,o){const a=n-t,u=r-e,s=i-t,l=o-e,c=a*a+u*u,f=s*s+l*l,h=.5/(a*l-u*s),d=(l*c-u*f)*h,p=(a*f-s*c)*h;return d*d+p*p}function QD(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;KD(t,n+r>>1,i),e[t[n]]>e[t[r]]&&KD(t,n,r),e[t[i]]>e[t[r]]&&KD(t,i,r),e[t[n]]>e[t[i]]&&KD(t,n,i);const a=t[i],u=e[a];for(;;){do{i++}while(e[t[i]]<u);do{o--}while(e[t[o]]>u);if(o<i)break;KD(t,i,o)}t[n+1]=t[o],t[o]=a,r-i+1>=o-n?(QD(t,e,i,r),QD(t,e,n,o-1)):(QD(t,e,n,o-1),QD(t,e,i,r))}}function KD(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function tC(t){return t[0]}function eC(t){return t[1]}const nC=1e-6;class rC{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(r,",").concat(i):(Math.abs(this._x1-r)>nC||Math.abs(this._y1-i)>nC)&&(this._+="L"+r+","+i),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=r,",").concat(this._y1=i))}rect(t,e,n,r){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+r,"h").concat(-n,"Z")}value(){return this._||null}}class iC{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class oC{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,o=0,a=0,u=n.length;o<u;o+=3,a+=2){const u=2*n[o],s=2*n[o+1],l=2*n[o+2],c=t[u],f=t[u+1],h=t[s],d=t[s+1],p=t[l],g=t[l+1],m=h-c,y=d-f,v=p-c,_=g-f,x=m*m+y*y,b=v*v+_*_,w=2*(m*_-y*v);if(w)if(Math.abs(w)<1e-8)e=(c+p)/2,r=(f+g)/2;else{const t=1/w;e=c+(_*x-y*b)*t,r=f+(m*b-v*x)*t}else e=(c+p)/2-1e8*_,r=(f+g)/2+1e8*v;i[a]=e,i[a+1]=r}let o,a,u,s=e[e.length-1],l=4*s,c=t[2*s],f=t[2*s+1];r.fill(0);for(let n=0;n<e.length;++n)s=e[n],o=l,a=c,u=f,l=4*s,c=t[2*s],f=t[2*s+1],r[o+2]=r[l]=u-f,r[o+3]=r[l+1]=c-a}render(t){const e=null==t?t=new rC:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),a=2*Math.floor(r/3),u=o[i],s=o[i+1],l=o[a],c=o[a+1];this._renderSegment(u,s,l,c,t)}let u,s=i[i.length-1];for(let e=0;e<i.length;++e){u=s,s=i[e];const n=2*Math.floor(r[s]/3),l=o[n],c=o[n+1],f=4*u,h=this._project(l,c,a[f+2],a[f+3]);h&&this._renderSegment(l,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new rC:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new rC:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new iC;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let o;const a=this._regioncode(t,e),u=this._regioncode(n,r);0===a&&0===u?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,u))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[r]==t[o]&&e[r+1]==t[o+1]&&e[(r+2)%i]==t[(o+a-2)%a]&&e[(r+3)%i]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(-1===o)return null;const a=[];let u=o;do{const n=Math.floor(u/3);if(a.push(e[2*n],e[2*n+1]),u=u%3==2?u-2:u+1,i[u]!==t)break;u=r[u]}while(u!==o&&-1!==u);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,o,a,u,s=null,l=e[n-2],c=e[n-1],f=this._regioncode(l,c);for(let h=0;h<n;h+=2)if(r=l,i=c,l=e[h],c=e[h+1],o=f,f=this._regioncode(l,c),0===o&&0===f)a=u,u=0,s?s.push(l,c):s=[l,c];else{let e,n,h,d,p;if(0===o){if(null===(e=this._clipSegment(r,i,l,c,o,f)))continue;[n,h,d,p]=e}else{if(null===(e=this._clipSegment(l,c,r,i,f,o)))continue;[d,p,n,h]=e,a=u,u=this._edgecode(n,h),a&&u&&this._edge(t,a,u,s,s.length),s?s.push(n,h):s=[n,h]}a=u,u=this._edgecode(d,p),a&&u&&this._edge(t,a,u,s,s.length),s?s.push(d,p):s=[d,p]}if(s)a=u,u=this._edgecode(s[0],s[1]),a&&u&&this._edge(t,a,u,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;let a,u,s=i||o;8&s?(a=t+(n-t)*(this.ymax-e)/(r-e),u=this.ymax):4&s?(a=t+(n-t)*(this.ymin-e)/(r-e),u=this.ymin):2&s?(u=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(u=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=u,i=this._regioncode(t,e)):(n=a,r=u,o=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,o){let a,u=Array.from(e);if((a=this._project(u[0],u[1],n,r))&&u.unshift(a[0],a[1]),(a=this._project(u[u.length-2],u[u.length-1],i,o))&&u.push(a[0],a[1]),u=this._clipFinite(t,u))for(let e,n=0,r=u.length,i=this._edgecode(u[r-2],u[r-1]);n<r;n+=2)e=i,i=this._edgecode(u[n],u[n+1]),e&&i&&(n=this._edge(t,e,i,u,n),r=u.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(u=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return u}_edge(t,e,n,r,i){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}r[i]===n&&r[i+1]===o||!this.contains(t,n,o)||(r.splice(i,0,n,o),i+=2)}if(r.length>4)for(let t=0;t<r.length;t+=2){const e=(t+2)%r.length,n=(t+4)%r.length;(r[t]===r[e]&&r[e]===r[n]||r[t+1]===r[e+1]&&r[e+1]===r[n+1])&&(r.splice(e,2),t-=2)}return i}_project(t,e,n,r){let i,o,a,u=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<u&&(a=this.ymin,o=t+(u=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<u&&(a=this.ymax,o=t+(u=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<u&&(o=this.xmax,a=e+(u=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<u&&(o=this.xmin,a=e+(u=i)*r)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const aC=2*Math.PI,uC=Math.pow;function sC(t){return t[0]}function lC(t){return t[1]}function cC(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class fC{static from(t,e=sC,n=lC,r){return new fC("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){const i=t[a];o[2*a]=e.call(r,i,a,t),o[2*a+1]=n.call(r,i,a,t)}return o}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new YD(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],o=2*e[t+2];if((n[o]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=cC(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new YD(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==o[e]||(o[e]=t)}for(let t=0,e=r.length;t<e;++t)a[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],o[r[0]]=1,2===r.length&&(o[r[1]]=0))}voronoi(t){return new oC(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const u=e[t];if(-1===u)return;let s=u,l=-1;do{if(yield l=o[s],s=s%3==2?s-2:s+1,o[s]!==t)return;if(s=i[s],-1===s){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(s!==u)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:s}=this;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);let l=t,c=uC(e-s[2*t],2)+uC(n-s[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=uC(e-s[2*r],2)+uC(n-s[2*r+1],2);if(f<c&&(c=f,l=r),h=h%3==2?h-2:h+1,u[h]!==t)break;if(h=a[h],-1===h){if(h=i[(o[t]+1)%i.length],h!==r&&uC(e-s[2*h],2)+uC(n-s[2*h+1],2)<c)return h;break}}while(h!==f);return l}render(t){const e=null==t?t=new rC:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,o=r.length;e<o;++e){const o=r[e];if(o<e)continue;const a=2*i[e],u=2*i[o];t.moveTo(n[a],n[a+1]),t.lineTo(n[u],n[u+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e=2){const n=null==t?t=new rC:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],o=r[n+1];t.moveTo(i+e,o),t.arc(i,o,e,0,aC)}return n&&n.value()}renderHull(t){const e=null==t?t=new rC:void 0,{hull:n,points:r}=this,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<o;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new iC;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new rC:void 0,{points:r,triangles:i}=this,o=2*i[t*=3],a=2*i[t+1],u=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[u],r[u+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new iC;return this.renderTriangle(t,e),e.value()}}function hC(t){pa.call(this,null,t)}hC.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const dC=[-1e5,-1e5,1e5,1e5];function pC(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}ut(hC,pa,{transform(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:dC;const o=this.value=fC.from(r,t.x,t.y).voronoi(i);for(let t=0,e=r.length;t<e;++t){const e=o.cellPolygon(t);r[t][n]=e?pC(e):null}return e.reflow(t.modified()).modifies(n)}});var gC=Object.freeze({__proto__:null,voronoi:hC}),mC=Math.PI/180,yC=2048;function vC(){var t,e,n,r,i,o,a,u=[256,256],s=kC,l=[],c=Math.random,f={};function h(t,e,n){for(var r,i,o,a=e.x,l=e.y,f=Math.sqrt(u[0]*u[0]+u[1]*u[1]),h=s(u),d=c()<.5?1:-1,p=-d;(r=h(p+=d))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=f));)if(e.x=a+i,e.y=l+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>u[0]||e.y+e.y1>u[1])&&(!n||!xC(e,t,u[0]))&&(!n||wC(e,n))){for(var g,m=e.sprite,y=e.width>>5,v=u[0]>>5,_=e.x-(y<<4),x=127&_,b=32-x,w=e.y1-e.y0,k=(e.y+e.y0)*v+(_>>5),M=0;M<w;M++){g=0;for(var A=0;A<=y;A++)t[k+A]|=g<<b|(A<y?(g=m[M*y+A])>>>x:0);k+=v}return e.sprite=null,!0}return!1}return f.layout=function(){for(var s=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=yC/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Gl()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((u[0]>>5)*u[1]),d=null,p=l.length,g=-1,m=[],y=l.map((u=>({text:t(u),font:e(u),style:r(u),weight:i(u),rotate:o(u),size:~~(n(u)+1e-14),padding:a(u),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:u}))).sort(((t,e)=>e.size-t.size));++g<p;){var v=y[g];v.x=u[0]*(c()+.5)>>1,v.y=u[1]*(c()+.5)>>1,_C(s,v,y,g),v.hasText&&h(f,v,d)&&(m.push(v),d?bC(d,v):d=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=u[0]>>1,v.y-=u[1]>>1)}return m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(u=[+t[0],+t[1]],f):u},f.font=function(t){return arguments.length?(e=MC(t),f):e},f.fontStyle=function(t){return arguments.length?(r=MC(t),f):r},f.fontWeight=function(t){return arguments.length?(i=MC(t),f):i},f.rotate=function(t){return arguments.length?(o=MC(t),f):o},f.text=function(e){return arguments.length?(t=MC(e),f):t},f.spiral=function(t){return arguments.length?(s=AC[t]||t,f):s},f.fontSize=function(t){return arguments.length?(n=MC(t),f):n},f.padding=function(t){return arguments.length?(a=MC(t),f):a},f.random=function(t){return arguments.length?(c=t,f):c},f}function _C(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,yC/o);var a,u,s,l,c,f=0,h=0,d=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,s=e.size<<1,e.rotate){var g=Math.sin(e.rotate*mC),m=Math.cos(e.rotate*mC),y=a*m,v=a*g,_=s*m,x=s*g;a=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,s=~~Math.max(Math.abs(v+_),Math.abs(v-_))}else a=a+31>>5<<5;if(s>d&&(d=s),f+a>=2048&&(f=0,h+=d,d=0),h+s>=yC)break;i.translate((f+(a>>1))/o,(h+(s>>1))/o),e.rotate&&i.rotate(e.rotate*mC),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=s,e.xoff=f,e.yoff=h,e.x1=a>>1,e.y1=s>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var b=i.getImageData(0,0,2048/o,yC/o).data,w=[];--r>=0;)if((e=n[r]).hasText){for(u=(a=e.width)>>5,s=e.y1-e.y0,l=0;l<s*u;l++)w[l]=0;if(null==(f=e.xoff))return;h=e.yoff;var k=0,M=-1;for(c=0;c<s;c++){for(l=0;l<a;l++){var A=u*c+(l>>5),E=b[2048*(h+c)+(f+l)<<2]?1<<31-l%32:0;w[A]|=E,k|=E}k?M=c:(e.y0++,s--,c--,h++)}e.y1=e.y0+M,e.sprite=w.slice(0,(e.y1-e.y0)*u)}}}function xC(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),u=127&a,s=32-u,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),f=0;f<l;f++){r=0;for(var h=0;h<=o;h++)if((r<<s|(h<o?(r=i[f*o+h])>>>u:0))&e[c+h])return!0;c+=n}return!1}function bC(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function wC(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function kC(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function MC(t){return"function"==typeof t?t:function(){return t}}var AC={archimedean:kC,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};const EC=["x","y","font","fontSize","fontStyle","fontWeight","angle"],DC=["text","font","rotate","fontSize","fontStyle","fontWeight"];function CC(t){pa.call(this,vC(),t)}CC.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:EC}]},ut(CC,pa,{transform(e,n){!e.size||e.size[0]&&e.size[1]||u("Wordcloud size dimensions must be non-zero.");const r=e.modified();if(!(r||n.changed(n.ADD_REM)||DC.some((function(t){const r=e[t];return H(r)&&n.modified(r.fields)}))))return;const i=n.materialize(n.SOURCE).source,o=this.value,a=e.as||EC;let s,l=e.fontSize||14;if(H(l)?s=e.fontSizeRange:l=Z(l),s){const t=l,e=pd("sqrt")().domain(tt(i,t)).range(s);l=n=>e(t(n))}i.forEach((t=>{t[a[0]]=NaN,t[a[1]]=NaN,t[a[3]]=0}));const c=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(l).random(t.random).layout(),f=o.size(),h=f[0]>>1,d=f[1]>>1,p=c.length;for(let t,e,n=0;n<p;++n)t=c[n],e=t.datum,e[a[0]]=t.x+h,e[a[1]]=t.y+d,e[a[2]]=t.font,e[a[3]]=t.size,e[a[4]]=t.style,e[a[5]]=t.weight,e[a[6]]=t.rotate;return n.reflow(r).modifies(a)}});var FC=Object.freeze({__proto__:null,wordcloud:CC});const SC=t=>new Uint8Array(t),BC=t=>new Uint16Array(t),TC=t=>new Uint32Array(t);function zC(t,e,n){const r=(e<257?SC:e<65537?BC:TC)(t);return n&&r.set(n),r}function NC(t,e,n){const r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,i=n.bisect(n.range,t.value),o=t.index,a=i[0],u=i[1],s=o.length;let l;for(l=0;l<a;++l)e[o[l]]|=r;for(l=u;l<s;++l)e[o[l]]|=r;return n}}}function OC(){let t=TC(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];const a=n,u=i.length,s=TC(u);let l,c,f,h=Array(u);for(f=0;f<u;++f)h[f]=r(i[f]),s[f]=f;if(h=function(t,e){return t.sort.call(e,((e,n)=>{const r=t[e],i=t[n];return r<i?-1:r>i?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(h,s),a)l=e,c=t,e=Array(a+u),t=TC(a+u),function(t,e,n,r,i,o,a,u,s){let l,c=0,f=0;for(l=0;c<r&&f<a;++l)e[c]<i[f]?(u[l]=e[c],s[l]=n[c++]):(u[l]=i[f],s[l]=o[f++]+t);for(;c<r;++c,++l)u[l]=e[c],s[l]=n[c];for(;f<a;++f,++l)u[l]=i[f],s[l]=o[f]+t}(o,l,c,a,h,s,u,e,t);else{if(o>0)for(f=0;f<u;++f)s[f]+=o;e=h,t=s}return n=a+u,{index:s,value:h}},remove:function(r,i){const o=n;let a,u,s;for(u=0;!i[t[u]]&&u<o;++u);for(s=u;u<o;++u)i[a=t[u]]||(t[s]=a,e[s]=e[u],++s);n=o-r},bisect:function(t,r){let i;return r?i=r.length:(r=e,i=n),[xe(r,t[0],0,i),_e(r,t[1],0,i)]},reindex:function(e){for(let r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:()=>t,size:()=>n}}function RC(t){pa.call(this,function(){let t=8,e=[],n=TC(0),r=zC(0,t),i=zC(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,r=0,i=e.length,o=t.length;r<o;++r)n=t[r],n._index=i++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),u=e;let s,l,c;for(l=0;!n[l]&&l<o;++l)a[l]=e[l],u[l]=l;for(c=l;l<o;++l)s=e[l],n[l]?u[l]=-1:(u[l]=c,r[c]=r[l],i[c]=i[l],a[c]=s,s._index=c++),r[l]=0;return e=a,u},size:()=>e.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=zC(e,t,r),i=zC(e,t))}}}(),t),this._indices=null,this._dims=null}function LC(t){pa.call(this,null,t)}RC.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},ut(RC,pa,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let u,s,l=0;for(;l<a;++l)u=n[l].fname,s=i[u]||(i[u]=OC()),o.push(NC(s,l,r[l]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),r=t.fields,i=t.query,o=this._indices,a=this._dims,u=this.value,s=u.curr(),l=u.prev(),c=u.all(),f=n.rem=n.add,h=n.mod,d=i.length,p={};let g,m,y,v,_,x,b,w,k;if(l.set(s),e.rem.length&&(_=this.remove(t,e,n)),e.add.length&&u.add(e.add),e.mod.length)for(x={},v=e.mod,b=0,w=v.length;b<w;++b)x[v[b]._index]=1;for(b=0;b<d;++b)k=r[b],(!a[b]||t.modified("fields",b)||e.modified(k.fields))&&(y=k.fname,(g=p[y])||(o[y]=m=OC(),p[y]=g=m.insert(k,e.source,0)),a[b]=NC(m,b,i[b]).onAdd(g,s));for(b=0,w=u.data().length;b<w;++b)_[b]||(l[b]!==s[b]?f.push(b):x[b]&&s[b]!==c&&h.push(b));return u.mask=(1<<d)-1,n},eval(t,e){const n=e.materialize().fork(),r=this._dims.length;let i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},insert(t,e,n){const r=e.add,i=this.value,o=this._dims,a=this._indices,u=t.fields,s={},l=n.add,c=i.size()+r.length,f=o.length;let h,d,p,g=i.size();i.resize(c,f),i.add(r);const m=i.curr(),y=i.prev(),v=i.all();for(h=0;h<f;++h)d=u[h].fname,p=s[d]||(s[d]=a[d].insert(u[h],r,g)),o[h].onAdd(p,m);for(;g<c;++g)y[g]=v,m[g]!==v&&l.push(g)},modify(t,e){const n=e.mod,r=this.value,i=r.curr(),o=r.all(),a=t.mod;let u,s,l;for(u=0,s=a.length;u<s;++u)l=a[u]._index,i[l]!==o&&n.push(l)},remove(t,e,n){const r=this._indices,i=this.value,o=i.curr(),a=i.prev(),u=i.all(),s={},l=n.rem,c=e.rem;let f,h,d,p;for(f=0,h=c.length;f<h;++f)d=c[f]._index,s[d]=1,a[d]=p=o[d],o[d]=u,p!==u&&l.push(d);for(d in r)r[d].remove(h,s);return this.reindex(e,h,s),s},reindex(t,e,n){const r=this._indices,i=this.value;t.runAfter((()=>{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)}))},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let u,s,l=0;for(n.filters=0,s=0;s<a;++s)t.modified("query",s)&&(u=s,++l);if(1===l)l=r[u].one,this.incrementOne(r[u],i[u],n.add,n.rem);else for(s=0,l=0;s<a;++s)t.modified("query",s)&&(l|=r[s].one,this.incrementAll(r[s],i[s],o,n.add),n.rem=n.add);return l},incrementAll(t,e,n,r){const i=this.value,o=i.seen(),a=i.curr(),u=i.prev(),s=t.index(),l=t.bisect(t.range),c=t.bisect(e),f=c[0],h=c[1],d=l[0],p=l[1],g=t.one;let m,y,v;if(f<d)for(m=f,y=Math.min(d,h);m<y;++m)v=s[m],o[v]!==n&&(u[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;else if(f>d)for(m=d,y=Math.min(f,p);m<y;++m)v=s[m],o[v]!==n&&(u[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;if(h>p)for(m=Math.max(f,p),y=h;m<y;++m)v=s[m],o[v]!==n&&(u[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;else if(h<p)for(m=Math.max(d,h),y=p;m<y;++m)v=s[m],o[v]!==n&&(u[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;t.range=e.slice()},incrementOne(t,e,n,r){const i=this.value.curr(),o=t.index(),a=t.bisect(t.range),u=t.bisect(e),s=u[0],l=u[1],c=a[0],f=a[1],h=t.one;let d,p,g;if(s<c)for(d=s,p=Math.min(c,l);d<p;++d)g=o[d],i[g]^=h,n.push(g);else if(s>c)for(d=c,p=Math.min(s,f);d<p;++d)g=o[d],i[g]^=h,r.push(g);if(l>f)for(d=Math.max(s,f),p=l;d<p;++d)g=o[d],i[g]^=h,n.push(g);else if(l<f)for(d=Math.max(c,l),p=f;d<p;++d)g=o[d],i[g]^=h,r.push(g);t.range=e.slice()}}),LC.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},ut(LC,pa,{transform(t,e){const n=~(t.ignore||0),r=t.filter,i=r.mask;if(0==(i&n))return e.StopPropagation;const o=e.fork(e.ALL),a=r.data(),u=r.curr(),s=r.prev(),l=t=>u[t]&n?null:a[t];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(t=>{const e=u[t]&n;return!e&&e^s[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=u[t]&n;return e&&!(e^e^s[t]&n)?a[t]:null}))):(o.filter(o.ADD,l),o.filter(o.REM,(t=>(u[t]&n)===i?a[t]:null))),o.filter(o.SOURCE,(t=>l(t._index)))}});var UC=Object.freeze({__proto__:null,crossfilter:RC,resolvefilter:LC});const qC="RawCode",PC="Literal",jC="Property",IC="Identifier",$C="ArrayExpression",WC="BinaryExpression",HC="CallExpression",YC="ConditionalExpression",VC="LogicalExpression",GC="MemberExpression",XC="ObjectExpression",JC="UnaryExpression";function ZC(t){this.type=t}var QC,KC,tF,eF,nF;ZC.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case $C:return t.elements;case WC:case VC:return[t.left,t.right];case HC:return[t.callee].concat(t.arguments);case YC:return[t.test,t.consequent,t.alternate];case GC:return[t.object,t.property];case XC:return t.properties;case jC:return[t.key,t.value];case JC:return[t.argument];case IC:case PC:case qC:default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};(QC={})[1]="Boolean",QC[2]="<end>",QC[3]="Identifier",QC[4]="Keyword",QC[5]="Null",QC[6]="Numeric",QC[7]="Punctuator",QC[8]="String",QC[9]="RegularExpression";var rF="Identifier",iF="Unexpected token %0",oF="Invalid regular expression",aF="Invalid regular expression: missing /",uF="Octal literals are not allowed in strict mode.",sF="ILLEGAL",lF="Disabled.",cF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),fF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function hF(t,e){if(!t)throw new Error("ASSERT: "+e)}function dF(t){return t>=48&&t<=57}function pF(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function gF(t){return"01234567".indexOf(t)>=0}function mF(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function yF(t){return 10===t||13===t||8232===t||8233===t}function vF(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&cF.test(String.fromCharCode(t))}function _F(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&fF.test(String.fromCharCode(t))}const xF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function bF(){for(;tF<eF;){const t=KC.charCodeAt(tF);if(!mF(t)&&!yF(t))break;++tF}}function wF(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)tF<eF&&pF(KC[tF])?(r=KC[tF++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):UF({},iF,sF);return String.fromCharCode(i)}function kF(){var t,e,n,r;for(e=0,"}"===(t=KC[tF])&&UF({},iF,sF);tF<eF&&pF(t=KC[tF++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&UF({},iF,sF),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function MF(){var t,e;for(t=KC.charCodeAt(tF++),e=String.fromCharCode(t),92===t&&(117!==KC.charCodeAt(tF)&&UF({},iF,sF),++tF,(t=wF("u"))&&"\\"!==t&&vF(t.charCodeAt(0))||UF({},iF,sF),e=t);tF<eF&&_F(t=KC.charCodeAt(tF));)++tF,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==KC.charCodeAt(tF)&&UF({},iF,sF),++tF,(t=wF("u"))&&"\\"!==t&&_F(t.charCodeAt(0))||UF({},iF,sF),e+=t);return e}function AF(){var t,e;return t=tF,{type:1===(e=92===KC.charCodeAt(tF)?MF():function(){var t,e;for(t=tF++;tF<eF;){if(92===(e=KC.charCodeAt(tF)))return tF=t,MF();if(!_F(e))break;++tF}return KC.slice(t,tF)}()).length?3:xF.hasOwnProperty(e)?4:"null"===e?5:"true"===e||"false"===e?1:3,value:e,start:t,end:tF}}function EF(){var t,e,n,r,i=tF,o=KC.charCodeAt(tF),a=KC[tF];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++tF,{type:7,value:String.fromCharCode(o),start:i,end:tF};default:if(61===(t=KC.charCodeAt(tF+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return tF+=2,{type:7,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:tF};case 33:case 61:return tF+=2,61===KC.charCodeAt(tF)&&++tF,{type:7,value:KC.slice(i,tF),start:i,end:tF}}}return">>>="===(r=KC.substr(tF,4))?{type:7,value:r,start:i,end:tF+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:tF+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:7,value:e,start:i,end:tF+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++tF}:void UF({},iF,sF)}function DF(){var t,e,n;if(hF(dF((n=KC[tF]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=tF,t="","."!==n){if(t=KC[tF++],n=KC[tF],"0"===t){if("x"===n||"X"===n)return++tF,function(t){let e="";for(;tF<eF&&pF(KC[tF]);)e+=KC[tF++];return 0===e.length&&UF({},iF,sF),vF(KC.charCodeAt(tF))&&UF({},iF,sF),{type:6,value:parseInt("0x"+e,16),start:t,end:tF}}(e);if(gF(n))return function(t){let e="0"+KC[tF++];for(;tF<eF&&gF(KC[tF]);)e+=KC[tF++];return(vF(KC.charCodeAt(tF))||dF(KC.charCodeAt(tF)))&&UF({},iF,sF),{type:6,value:parseInt(e,8),octal:!0,start:t,end:tF}}(e);n&&dF(n.charCodeAt(0))&&UF({},iF,sF)}for(;dF(KC.charCodeAt(tF));)t+=KC[tF++];n=KC[tF]}if("."===n){for(t+=KC[tF++];dF(KC.charCodeAt(tF));)t+=KC[tF++];n=KC[tF]}if("e"===n||"E"===n)if(t+=KC[tF++],"+"!==(n=KC[tF])&&"-"!==n||(t+=KC[tF++]),dF(KC.charCodeAt(tF)))for(;dF(KC.charCodeAt(tF));)t+=KC[tF++];else UF({},iF,sF);return vF(KC.charCodeAt(tF))&&UF({},iF,sF),{type:6,value:parseFloat(t),start:e,end:tF}}function CF(){var t,e,n,r;return nF=null,bF(),t=tF,e=function(){var t,e,n,r;for(hF("/"===(t=KC[tF]),"Regular expression literal must start with a slash"),e=KC[tF++],n=!1,r=!1;tF<eF;)if(e+=t=KC[tF++],"\\"===t)yF((t=KC[tF++]).charCodeAt(0))&&UF({},aF),e+=t;else if(yF(t.charCodeAt(0)))UF({},aF);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||UF({},aF),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";tF<eF&&_F((t=KC[tF]).charCodeAt(0));)++tF,"\\"===t&&tF<eF?UF({},iF,sF):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&UF({},oF,n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";UF({},oF)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){UF({},oF)}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:tF}}function FF(){if(bF(),tF>=eF)return{type:2,start:tF,end:tF};const t=KC.charCodeAt(tF);return vF(t)?AF():40===t||41===t||59===t?EF():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(hF("'"===(t=KC[tF])||'"'===t,"String literal must starts with a quote"),e=tF,++tF;tF<eF;){if((n=KC[tF++])===t){t="";break}if("\\"===n)if((n=KC[tF++])&&yF(n.charCodeAt(0)))"\r"===n&&"\n"===KC[tF]&&++tF;else switch(n){case"u":case"x":"{"===KC[tF]?(++tF,i+=kF()):i+=wF(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:gF(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),tF<eF&&gF(KC[tF])&&(o=!0,r=8*r+"01234567".indexOf(KC[tF++]),"0123".indexOf(n)>=0&&tF<eF&&gF(KC[tF])&&(r=8*r+"01234567".indexOf(KC[tF++]))),i+=String.fromCharCode(r)):i+=n}else{if(yF(n.charCodeAt(0)))break;i+=n}}return""!==t&&UF({},iF,sF),{type:8,value:i,octal:o,start:e,end:tF}}():46===t?dF(KC.charCodeAt(tF+1))?DF():EF():dF(t)?DF():EF()}function SF(){const t=nF;return tF=t.end,nF=FF(),tF=t.end,t}function BF(){const t=tF;nF=FF(),tF=t}function TF(t,e,n){const r=new ZC("||"===t||"&&"===t?"LogicalExpression":"BinaryExpression");return r.operator=t,r.left=e,r.right=n,r}function zF(t,e){const n=new ZC("CallExpression");return n.callee=t,n.arguments=e,n}function NF(t){const e=new ZC(rF);return e.name=t,e}function OF(t){const e=new ZC("Literal");return e.value=t.value,e.raw=KC.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function RF(t,e,n){const r=new ZC("MemberExpression");return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function LF(t,e,n){const r=new ZC("Property");return r.key=e,r.value=n,r.kind=t,r}function UF(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(hF(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=tF,n.description=i,n}function qF(t){2===t.type&&UF(t,"Unexpected end of input"),6===t.type&&UF(t,"Unexpected number"),8===t.type&&UF(t,"Unexpected string"),3===t.type&&UF(t,"Unexpected identifier"),4===t.type&&UF(t,"Unexpected reserved word"),UF(t,iF,t.value)}function PF(t){const e=SF();7===e.type&&e.value===t||qF(e)}function jF(t){return 7===nF.type&&nF.value===t}function IF(t){return 4===nF.type&&nF.value===t}function $F(){const t=[];for(tF=nF.start,PF("[");!jF("]");)jF(",")?(SF(),t.push(null)):(t.push(eS()),jF("]")||PF(","));return SF(),function(t){const e=new ZC("ArrayExpression");return e.elements=t,e}(t)}function WF(){tF=nF.start;const t=SF();return 8===t.type||6===t.type?(t.octal&&UF(t,uF),OF(t)):NF(t.value)}function HF(){var t,e,n;return tF=nF.start,3===(t=nF).type?(n=WF(),PF(":"),LF("init",n,eS())):2!==t.type&&7!==t.type?(e=WF(),PF(":"),LF("init",e,eS())):void qF(t)}function YF(){var t,e,n=[],r={},i=String;for(tF=nF.start,PF("{");!jF("}");)e="$"+((t=HF()).key.type===rF?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?UF({},"Duplicate data property in object literal not allowed in strict mode"):r[e]=!0,n.push(t),jF("}")||PF(",");return PF("}"),function(t){const e=new ZC("ObjectExpression");return e.properties=t,e}(n)}const VF={if:1};function GF(){var t,e,n;if(jF("("))return function(){PF("(");const t=nS();return PF(")"),t}();if(jF("["))return $F();if(jF("{"))return YF();if(t=nF.type,tF=nF.start,3===t||VF[nF.value])n=NF(SF().value);else if(8===t||6===t)nF.octal&&UF(nF,uF),n=OF(SF());else{if(4===t)throw new Error(lF);1===t?((e=SF()).value="true"===e.value,n=OF(e)):5===t?((e=SF()).value=null,n=OF(e)):jF("/")||jF("/=")?(n=OF(CF()),BF()):qF(SF())}return n}function XF(){const t=[];if(PF("("),!jF(")"))for(;tF<eF&&(t.push(eS()),!jF(")"));)PF(",");return PF(")"),t}function JF(){return PF("."),function(){tF=nF.start;const t=SF();return function(t){return 3===t.type||4===t.type||1===t.type||5===t.type}(t)||qF(t),NF(t.value)}()}function ZF(){PF("[");const t=nS();return PF("]"),t}function QF(){const t=function(){var t;for(t=GF();;)if(jF("."))t=RF(".",t,JF());else if(jF("("))t=zF(t,XF());else{if(!jF("["))break;t=RF("[",t,ZF())}return t}();if(7===nF.type&&(jF("++")||jF("--")))throw new Error(lF);return t}function KF(){var t,e;if(7!==nF.type&&4!==nF.type)e=QF();else{if(jF("++")||jF("--"))throw new Error(lF);if(jF("+")||jF("-")||jF("~")||jF("!"))t=SF(),e=KF(),e=function(t,e){const n=new ZC("UnaryExpression");return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(IF("delete")||IF("void")||IF("typeof"))throw new Error(lF);e=QF()}}return e}function tS(t){let e=0;if(7!==t.type&&4!==t.type)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function eS(){var t,e;return t=function(){var t,e,n,r,i,o,a,u,s,l;if(t=nF,s=KF(),0===(i=tS(r=nF)))return s;for(r.prec=i,SF(),e=[t,nF],o=[s,r,a=KF()];(i=tS(nF))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),u=o.pop().value,s=o.pop(),e.pop(),n=TF(u,s,a),o.push(n);(r=SF()).prec=i,o.push(r),e.push(nF),n=KF(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=TF(o[l-1].value,o[l-2],n),l-=2;return n}(),jF("?")&&(SF(),e=eS(),PF(":"),t=function(t,e,n){const r=new ZC("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,eS())),t}function nS(){const t=eS();if(jF(","))throw new Error(lF);return t}var rS={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function iS(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&u("Missing arguments to clamp function."),e.length>3&&u("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),replace:e("replace",r),trim:e("trim",r,0),regexp:i,test:e("test",i),if:function(e){e.length<3&&u("Missing arguments to if function."),e.length>3&&u("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}const oS="intersect",aS="union";var uS="index:unit";function sS(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,u=0;u<a;++u)if((r=i[u]).getter=l.getter||l(r.field),ct(n=r.getter(t))&&(n=A(n)),ct(o[u])&&(o[u]=A(o[u])),ct(o[u][0])&&(o[u]=o[u].map(A)),"E"===r.type){if(v(o[u])?o[u].indexOf(n)<0:n!==o[u])return!1}else if("R"===r.type){if(!st(n,o[u]))return!1}else if("R-RE"===r.type){if(!st(n,o[u],!0,!1))return!1}else if("R-E"===r.type){if(!st(n,o[u],!1,!1))return!1}else if("R-LE"===r.type&&!st(n,o[u],!1,!0))return!1;return!0}var lS={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((t=>e.indexOf(t)>=0)):e},R_union:function(t,e){var n=A(e[0]),r=A(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=A(e[0]),r=A(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};function cS(t,e,n,r){e[0].type!==PC&&u("First argument to selection functions must be a string literal.");const i=e[0].value,o="unit",a="@unit",s=":"+i;(e.length>=2&&M(e).value)!==oS||rt(r,a)||(r["@unit"]=n.getData(i).indataRef(n,o)),rt(r,s)||(r[s]=n.getData(i).tuplesRef())}function fS(t){const e=this.context.data[t];return e?e.values.value:[]}const hS=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},dS=hS("format"),pS=hS("timeFormat"),gS=hS("utcFormat"),mS=hS("timeParse"),yS=hS("utcParse"),vS=new Date(2e3,0,1);function _S(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(vS.setYear(2e3),vS.setMonth(t),vS.setDate(e),pS.call(this,vS,n)):""}function xS(t,e,n,r){e[0].type!==PC&&u("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!rt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(t){}}function bS(t,e,n,r){if(e[0].type===PC)wS(n,r,e[0].value);else for(t in n.scales)wS(n,r,t)}function wS(t,e,n){const r="%"+n;if(!rt(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}function kS(t,e){let n;return H(t)?t:pt(t)?(n=e.scales[t])&&n.value:void 0}function MS(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=bS,n._range=bS,n._scale=bS;const r=e=>"_["+(e.type===PC?wt("%"+e.value):wt("%")+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}function AS(t,e){return function(n,r,i){if(n){const e=kS(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const ES=AS("area",(function(t){return fb=new be,Vx(t,hb),2*fb})),DS=AS("bounds",(function(t){var e,n,r,i,o,a,u;if(nb=eb=-(Kx=tb=1/0),sb=[],Vx(t,Pb),n=sb.length){for(sb.sort(Xb),e=1,o=[r=sb[0]];e<n;++e)Jb(r,(i=sb[e])[0])||Jb(r,i[1])?(Gb(r[0],i[1])>Gb(r[0],r[1])&&(r[1]=i[1]),Gb(i[0],r[1])>Gb(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=Gb(r[1],i[0]))>a&&(a=u,Kx=i[0],eb=r[1])}return sb=lb=null,Kx===1/0||tb===1/0?[[NaN,NaN],[NaN,NaN]]:[[Kx,tb],[eb,nb]]})),CS=AS("centroid",(function(t){Mb=Ab=Eb=Db=Cb=Fb=Sb=Bb=0,Tb=new be,zb=new be,Nb=new be,Vx(t,Zb);var e=+Tb,n=+zb,r=+Nb,i=Tx(e,n,r);return i<_x&&(e=Fb,n=Sb,r=Bb,Ab<vx&&(e=Eb,n=Db,r=Cb),(i=Tx(e,n,r))<_x)?[NaN,NaN]:[Cx(n,e)*Mx,Px(r/i)*Mx]}));function FS(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function SS(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function BS(t){const e=wc(t);return.2126*SS(e.r)+.7152*SS(e.g)+.0722*SS(e.b)}function TS(t,e){return t===e||t!=t&&e!=e||(v(t)?!(!v(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!TS(t[n],e[n]))return!1;return!0}(t,e):!(!_(t)||!_(e))&&zS(t,e))}function zS(t,e){for(const n in t)if(!TS(t[n],e[n]))return!1;return!0}function NS(t){return e=>zS(t,e)}const OS=t=>t.data;function RS(t,e){const n=fS.call(e,t);return n.root&&n.root.lookup||{}}const LS=()=>"undefined"!=typeof window&&window||null;const US={random:()=>t.random(),cumulativeNormal:Sa,cumulativeLogNormal:Ra,cumulativeUniform:Ia,densityNormal:Fa,densityLogNormal:Oa,densityUniform:ja,quantileNormal:Ba,quantileLogNormal:La,quantileUniform:$a,sampleNormal:Ca,sampleLogNormal:Na,sampleUniform:Pa,isArray:v,isBoolean:lt,isDate:ct,isDefined:t=>void 0!==t,isNumber:ht,isObject:_,isRegExp:dt,isString:pt,isTuple:No,isValid:t=>null!=t&&t==t,toBoolean:kt,toDate:At,toNumber:A,toString:Et,flush:at,lerp:mt,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),K(...t)},pad:xt,peek:M,span:bt,inrange:st,truncate:Ct,rgb:wc,lab:Pc,hcl:Vc,hsl:Fc,luminance:BS,contrast:function(t,e){const n=BS(t),r=BS(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Re,format:dS,utcFormat:gS,utcParse:yS,utcOffset:br,utcSequence:Mr,timeFormat:pS,timeParse:mS,timeOffset:xr,timeSequence:kr,timeUnitSpecifier:Yn,monthFormat:function(t){return _S.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return _S.call(this,t,1,"%b")},dayFormat:function(t){return _S.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return _S.call(this,0,2+t,"%a")},quarter:j,utcquarter:I,week:Jn,utcweek:nr,dayofyear:Xn,utcdayofyear:er,warn:function(){return FS(this.context.dataflow,"warn",arguments)},info:function(){return FS(this.context.dataflow,"info",arguments)},debug:function(){return FS(this.context.dataflow,"debug",arguments)},extent:tt,inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];const[r,i]=t,o=(new Zp).set(r[0],r[1],i[0],i[1]);return wv(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=$(t.marktype),r=$(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))},clampRange:W,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=LS();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=LS();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return qh(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(p).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?xp(n,e=e||lp(t)):t}},panLinear:T,panLog:z,panPow:N,panSymlog:O,zoomLinear:L,zoomLog:U,zoomPow:q,zoomSymlog:P,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,u=this.context.data[t],s=u.input,l=a.stamp();let c,f,h=u.changes;if(!1===a._trigger||!(s.value.length||e||r))return 0;if((!h||h.stamp<l)&&(u.changes=h=a.changeset(),h.stamp=l,a.runAfter((()=>{u.modified=!0,a.pulse(s,h).run()}),!0,1)),n&&(c=!0===n?p:v(n)||No(n)?n:NS(n),h.remove(c)),e&&h.insert(e),r&&(c=NS(r),s.value.some(c)?h.remove(c):h.insert(r)),i)for(f in o)h.modify(i,f,o[f]);return 1}},qS=["view","item","group","xy","x","y"],PS="this.",jS={},IS={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat(wt("$"+t),"]"),functions:function(t){const e=iS(t);qS.forEach((t=>e[t]="event.vega."+t));for(const t in US)e[t]=PS+t;return K(e,MS(t,US,jS)),e},constants:rS,visitors:jS},$S=function(t){const e=(t=t||{}).allowed?Dt(t.allowed):{},n=t.forbidden?Dt(t.forbidden):{},r=t.constants||rS,i=(t.functions||iS)(h),o=t.globalvar,a=t.fieldvar,s=H(o)?o:t=>"".concat(o,'["').concat(t,'"]');let l={},c={},f=0;function h(t){if(pt(t))return t;const e=d[t.type];return null==e&&u("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return f>0?i:rt(n,i)?u("Illegal identifier: "+i):rt(r,i)?r[i]:rt(e,i)?i:(l[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=h(t.object);e&&(f+=1);const r=h(t.property);return n===a&&(c[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(f-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&u("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=rt(i,e)&&i[e];return r||u("Unrecognized function: "+e),H(r)?r(n):r+"("+n.map(h).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(h).join(",")+"]",BinaryExpression:t=>"("+h(t.left)+t.operator+h(t.right)+")",UnaryExpression:t=>"("+t.operator+h(t.argument)+")",ConditionalExpression:t=>"("+h(t.test)+"?"+h(t.consequent)+":"+h(t.alternate)+")",LogicalExpression:t=>"("+h(t.left)+t.operator+h(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(h).join(",")+"}",Property:t=>{f+=1;const e=h(t.key);return f-=1,e+":"+h(t.value)}};function p(t){const e={code:h(t),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},e}return p.functions=i,p.constants=r,p}(IS);function WS(t,e,n){return 1===arguments.length?US[t]:(US[t]=e,n&&(jS[t]=n),$S&&($S.functions[t]=PS+t),this)}function HS(t,e){const n={};let r;try{r=function(t){tF=0,eF=(KC=t).length,nF=null,BF();const e=nS();if(2!==nF.type)throw new Error("Unexpect token after expression.");return e}(t=pt(t)?t:wt(t)+"")}catch(e){u("Expression parse error: "+t)}r.visit((t=>{if(t.type!==HC)return;const r=t.callee.name,i=IS.visitors[r];i&&i(r,t.arguments,e,n)}));const i=$S(r);return i.globals.forEach((t=>{const r="$"+t;!rt(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))})),{$expr:K({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}WS("bandwidth",(function(t,e){const n=kS(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),bS),WS("copy",(function(t,e){const n=kS(t,(e||this).context);return n?n.copy():void 0}),bS),WS("domain",(function(t,e){const n=kS(t,(e||this).context);return n?n.domain():[]}),bS),WS("range",(function(t,e){const n=kS(t,(e||this).context);return n&&n.range?n.range():[]}),bS),WS("invert",(function(t,e,n){const r=kS(t,(n||this).context);return r?v(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),bS),WS("scale",(function(t,e,n){const r=kS(t,(n||this).context);return r?r(e):void 0}),bS),WS("gradient",(function(t,e,n,r,i){t=kS(t,(i||this).context);const o=ip(e,n);let a=t.domain(),u=a[0],s=M(a),l=f;return s-u?l=Dd(t,u,s):t=(t.interpolator?pd("sequential")().interpolator(t.interpolator()):pd("linear")().interpolate(t.interpolate()).range(t.range())).domain([u=0,s=1]),t.ticks&&(a=t.ticks(+r||15),u!==a[0]&&a.unshift(u),s!==M(a)&&a.push(s)),a.forEach((e=>o.stop(l(e),t(e)))),o}),bS),WS("geoArea",ES,bS),WS("geoBounds",DS,bS),WS("geoCentroid",CS,bS),WS("geoShape",(function(t,e,n){const r=kS(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),bS),WS("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==PC&&u("First argument to indata must be a string literal."),e[1].type!==PC&&u("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;rt(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),WS("data",fS,xS),WS("treePath",(function(t,e,n){const r=RS(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(OS):void 0}),xS),WS("treeAncestors",(function(t,e){const n=RS(t,this)[e];return n?n.ancestors().map(OS):void 0}),xS),WS("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,u,s=this.context.data[t],l=s?s.values.value:[],c=s?s[uS]&&s[uS].value:void 0,f=n===oS,h=l.length,d=0;d<h;++d)if(r=l[d],c&&f){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(u=sS(e,r),i[a]=u?-1:++o,u&&1===c.size)return!0;if(!u&&o===c.get(a).count)return!1}else if(f^(u=sS(e,r)))return u;return h&&f}),cS),WS("vlSelectionResolve",(function(t,e,n){for(var r,i,o,a,u,s,l,c,f,h,d,p=this.context.data[t],g=p?p.values.value:[],m={},y={},v={},_=g.length,x=0;x<_;++x){for(a=(r=g[x]).unit,i=r.fields,o=r.values,h=0,d=i.length;h<d;++h)u=i[h],l=(s=m[u.field]||(m[u.field]={}))[a]||(s[a]=[]),v[u.field]=c=u.type.charAt(0),f=lS[c+"_union"],s[a]=f(l,$(o[h]));n&&(l=y[a]||(y[a]=[])).push($(o).reduce(((t,e,n)=>(t[i[n].field]=e,t)),{}))}return e=e||aS,Object.keys(m).forEach((t=>{m[t]=Object.keys(m[t]).map((e=>m[t][e])).reduce(((n,r)=>void 0===n?r:lS[v[t]+"_"+e](n,r)))})),g=Object.keys(y),n&&g.length&&(m.vlMulti=e===aS?{or:g.reduce(((t,e)=>(t.push(...y[e]),t)),[])}:{and:g.map((t=>({or:y[t]})))}),m}),cS);const YS=Dt(["rule"]),VS=Dt(["group","image","rect"]);function GS(t){return(t+"").toLowerCase()}function XS(t,e,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var JS={operator:(t,e)=>XS(t,["_"],e.code),parameter:(t,e)=>XS(t,["datum","_"],e.code),event:(t,e)=>XS(t,["event"],e.code),handler:(t,e)=>XS(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const t in r){const e="o["+wt(t)+"]";i+="$=".concat(r[t].code,";if(").concat(e,"!==$)").concat(e,"=$,m=1;")}return i+=function(t,e){let n="";return YS[e]||(t.x2&&(t.x?(VS[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(VS[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",XS(t,["item","_"],i)},codegen:{get(t){const e="[".concat(t.map(wt).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const r=Function("a","b","var u, v; return "+t.map(((t,r)=>{const i=e[r];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+r]=t,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n  : (u > v || v == null) && u != null ? ").concat(r,"\n  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n  : v !== v && u === u ? ").concat(r," : ")}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function ZS(t,e,n){if(!t||!_(t))return t;for(let r,i=0,o=QS.length;i<o;++i)if(r=QS[i],rt(t,r.key))return r.parse(t,e,n);return t}var QS=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||u("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=gt(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,n,r){t.$params&&n.parseParameters(t.$params,r);const i="e:"+t.$expr.code+"_"+t.$name;return n.fn[i]||(n.fn[i]=e(n.parameterExpression(t.$expr),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=l(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,n){const r=t.$encode,i={};for(const t in r){const o=r[t];i[t]=e(n.encodeExpression(o.$expr),o.$fields),i[t].output=o.$output}return i}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,r=$(t.$compare).map((t=>t&&t.$tupleid?Oo:t));return e.fn[n]||(e.fn[n]=Y(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return Oo}}];const KS={skip:!0};function tB(t,e,n,r){return new eB(t,e,n,r)}function eB(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||JS,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function nB(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function rB(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}eB.prototype=nB.prototype={fork(){const t=new nB(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),function(t){return"collect"===GS(t)}(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const r in t.data){const i=n.data[r]||(n.data[r]={});t.data[r].forEach((t=>i[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[GS(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===GS(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||u("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=v(i)?i.map((t=>ZS(t,n,e))):ZS(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&u("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=this,r=_(r=t.source)?r.$ref:r,i=n.get(r),o=t.update,a=void 0;i||u("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,i,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((t=>{n.update(e.signals[t],i[t],KS)})),Object.keys(r||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(p).insert(r[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)}))}};const iB="default";function oB(t,e){const n=t.globalCursor()?"undefined"!=typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function aB(t,e){var n=t._runtime.data;return rt(n,e)||u("Unrecognized data set: "+e),n[e]}function uB(t,e){Io(e)||u("Second argument to changes must be a changeset.");const n=aB(this,t);return n.modified=!0,this.pulse(n.input,e)}function sB(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function lB(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function cB(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function fB(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=cB(t),(r=uy(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;pt(t)&&(t=i(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Z(t),item:Z(e||{}),group:i,xy:o,x:function(t){return o(t)[0]},y:function(t){return o(t)[1]}}}(t,n,r),e}const hB="view",dB={trap:!1};function pB(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||_(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function gB(t){return t.item}function mB(t){return t.item.mark.source}function yB(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function vB(t,e,n){const r=document.createElement(t);for(const t in e)r.setAttribute(t,e[t]);return null!=n&&(r.textContent=n),r}const _B="vega-bind",xB="vega-bind-name";function bB(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!==t.signal(r.signal)&&t.runAsync(null,(()=>{i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=Q(r.debounce,i.update))),function(t,e,n,r){const i=vB("div",{class:_B}),o="radio"===n.input?i:i.appendChild(vB("label"));o.appendChild(vB("span",{class:xB},n.name||n.signal)),e.appendChild(i);let a=wB;switch(n.input){case"checkbox":a=kB;break;case"select":a=MB;break;case"radio":a=AB;break;case"range":a=EB}a(t,o,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0),i}function wB(t,e,n,r){const i=vB("input");for(const t in n)"signal"!==t&&"element"!==t&&i.setAttribute("input"===t?"type":t,n[t]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(()=>t.update(i.value))),t.elements=[i],t.set=t=>i.value=t}function kB(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=vB("input",i);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function MB(t,e,n,r){const i=vB("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};DB(t,r)&&(n.selected=!0),i.appendChild(vB("option",n,(o[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(()=>{t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e<r;++e)if(DB(n.options[e],t))return void(i.selectedIndex=e)}}function AB(t,e,n,r){const i=vB("span",{class:"vega-bind-radio"}),o=n.labels||[];e.appendChild(i),t.elements=n.options.map(((e,a)=>{const u={type:"radio",name:n.signal,value:e};DB(e,r)&&(u.checked=!0);const s=vB("input",u);s.addEventListener("change",(()=>t.update(e)));const l=vB("label",{},(o[a]||e)+"");return l.prepend(s),i.appendChild(l),s})),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t<r;++t)DB(n[t].value,e)&&(n[t].checked=!0)}}function EB(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;const i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||De(o,i,100),u=vB("input",{type:"range",name:n.signal,min:o,max:i,step:a});u.value=r;const s=vB("span",{},+r);e.appendChild(u),e.appendChild(s);const l=()=>{s.textContent=u.value,t.update(+u.value)};u.addEventListener("input",l),u.addEventListener("change",l),t.elements=[u],t.set=t=>{u.value=t,s.textContent=t}}function DB(t,e){return t===e||t+""==e+""}function CB(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,sB(t),lB(t),cB(t),i,o).background(t.background())}function FB(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function SB(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}const BB=t=>+t||0;function TB(t){return _(t)?{top:BB(t.top),bottom:BB(t.bottom),left:BB(t.left),right:BB(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(BB(t))}async function zB(t,e,n,r){const i=bv(e),o=i&&i.headless;return o||u("Unrecognized renderer type: "+e),await t.runAsync(),CB(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var NB="width",OB="height",RB="padding",LB={skip:!0};function UB(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===RB?r.left+r.right:0)}function qB(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===RB?r.top+r.bottom:0)}function PB(t,e){return e.modified&&v(e.input.value)&&t.indexOf("_:vega:_")}function jB(t,e){return!("parent"===t||e instanceof ga.proxy)}function IB(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":v(t)?$B(t):_(t)&&!ct(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+(v(n)?$B(n):WB(n))})).join("\n")):t+"";var e}(r))}function $B(t){return"["+t.map(WB).join(", ")+"]"}function WB(t){return v(t)?"[…]":_(t)&&!ct(t)?"{…}":t}function HB(t,e){const n=this;if(e=e||{},ha.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const r=K({},t.locale,e.locale);n.locale(Eo(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||_v.Canvas,n._scenegraph=new ty;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||IB,n._redraw=!0,n._handler=(new Ey).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=K({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{v(t[e])&&(t[e]=Dt(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(t,e,n){return tB(t,ga,US,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:K({},t)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=UB(n,n._width),n._viewHeight=qB(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=UB(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=qB(t,e.size),o()}),{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:iB,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const r=e.value,i=r?pt(r)?r:r.user:iB,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(e){let n=e.cursor,r=this.value;return pt(n)||(r=n.item,n=n.user),oB(t,n&&n!==iB?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function YB(t,e){return rt(t._signals,e)?t._signals[e]:u("Unrecognized signal name: "+wt(e))}function VB(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function GB(t,e,n,r){let i=VB(n,r);return i||(i=FB(t,(()=>r(e,n.value))),i.handler=r,t.on(n,null,i)),t}function XB(t,e,n){const r=VB(e,n);return r&&e._targets.remove(r),t}ut(HB,ha,{async evaluate(t,e,n){if(await ha.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=cB(t),n=sB(t),r=lB(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,r)}catch(e){t.error(e)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}return n&&Bo(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&rB(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=YB(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",TB(t)):TB(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(bv(t)||u("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(ha.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(YB(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter((a=>{let u=0;a._autosize=0,a.width()!==n&&(u=1,a.signal(NB,n,LB),a._resizeWidth.skip(!0)),a.height()!==r&&(u=1,a.signal(OB,r,LB),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),u&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=FB(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return GB(this,t,YB(this,t),e)},removeSignalListener(t,e){return XB(this,YB(this,t),e)},addDataListener(t,e){return GB(this,t,aB(this,t).values,e)},removeDataListener(t,e){return XB(this,aB(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=oB(this,null);this._globalCursor=!!t,e&&oB(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var r=new LA,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?OA():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new Zo(n),a=function(n,r){i.runAsync(null,(()=>{t===hB&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(fB(i,n,r))}))};if("timer"===t)pB(i,"timer",e)&&i.timer(a,e);else if(t===hB)pB(i,"view",e)&&i.addEventListener(e,a,dB);else if("window"===t?pB(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&pB(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var u=0,s=r.length;u<s;++u)r[u].addEventListener(e,a);i._eventListeners.push({type:e,sources:r,handler:a})}else i.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",gB),mB,yB(t)),this.on(this.events("view","mouseout",gB),mB,yB(e)),this},data:function(t,e){return arguments.length<2?aB(this,t).values.value:uB.call(this,t,$o().remove(p).insert(e))},change:uB,insert:function(t,e){return uB.call(this,t,$o().insert(e))},remove:function(t,e){return uB.call(this,t,$o().remove(e))},scale:function(t){var e=this._runtime.scales;return rt(e,t)||u("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=bv(r);t=n._el=t?SB(n,t):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),rB(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Ey,u=t?o.renderer:o.headless;return n._renderer=u?CB(n,n._renderer,t,u):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),FB(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,cB(t),t);return e&&e.handlers().forEach((t=>{i.on(t.type,t.handler)})),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=SB(n,e):t.appendChild(vB("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==i&&(t.element=SB(n,t.param.element))})),n._bind.forEach((t=>{bB(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==_v.Canvas&&t!==_v.SVG&&t!==_v.PNG&&u("Unrecognized image type: "+t);const n=await zB(this,t,e);return t===_v.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await zB(this,_v.Canvas,t,e)).canvas()},toSVG:async function(t){return(await zB(this,_v.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:PB,signals:jB,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});const JB="[",ZB="]",QB=/[[\]{}]/,KB={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let tT,eT;function nT(t,e,n,r,i){const o=t.length;let a,u=0;for(;e<o;++e){if(a=t[e],!u&&a===n)return e;i&&i.indexOf(a)>=0?--u:r&&r.indexOf(a)>=0&&++u}return e}function rT(t){const e=[],n=t.length;let r=0,i=0;for(;i<n;)i=nT(t,i,",","[{","]}"),e.push(t.substring(r,i).trim()),r=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function iT(t){return"["===t[0]?function(t){const e=t.length;let n,r=1;if(r=nT(t,r,ZB,JB,ZB),r===e)throw"Empty between selector: "+t;if(n=rT(t.substring(1,r)),2!==n.length)throw"Between selector must have two elements: "+t;if(">"!==(t=t.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+t;n=n.map(iT);const i=iT(t.slice(1).trim());if(i.between)return{between:n,stream:i};i.between=n;return i}(t):function(t){const e={source:tT},n=[];let r,i,o=[0,0],a=0,u=0,s=t.length,l=0;if("}"===t[s-1]){if(l=t.lastIndexOf("{"),!(l>=0))throw"Unmatched right brace: "+t;try{o=function(t){const e=t.split(",");if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!=n)throw t;return n}))}(t.substring(l+1,s-1))}catch(e){throw"Invalid throttle specification: "+t}s=(t=t.slice(0,l).trim()).length,l=0}if(!s)throw t;"@"===t[0]&&(a=++l);r=nT(t,l,":"),r<s&&(n.push(t.substring(u,r).trim()),u=l=++r);if(l=nT(t,l,JB),l===s)n.push(t.substring(u,s).trim());else if(n.push(t.substring(u,l).trim()),i=[],u=++l,u===s)throw"Unmatched left bracket: "+t;for(;l<s;){if(l=nT(t,l,ZB),l===s)throw"Unmatched left bracket: "+t;if(i.push(t.substring(u,l).trim()),l<s-1&&t[++l]!==JB)throw"Expected left bracket: "+t;u=++l}if(!(s=n.length)||QB.test(n[s-1]))throw"Invalid event selector: "+t;s>1?(e.type=n[1],a?e.markname=n[0].slice(1):!function(t){return eT[t]}(n[0])?e.source=n[0]:e.marktype=n[0]):e.type=n[0];"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=i&&(e.filter=i);o[0]&&(e.throttle=o[0]);o[1]&&(e.debounce=o[1]);return e}(t)}function oT(t){return _(t)?t:{type:t||"pad"}}const aT=t=>+t||0;function uT(t){return _(t)?t.signal?t:{top:aT(t.top),bottom:aT(t.bottom),left:aT(t.left),right:aT(t.right)}:{top:e=aT(t),bottom:e,left:e,right:e};var e}const sT=t=>_(t)&&!v(t)?K({},t):{value:t};function lT(t,e,n,r){if(null!=n){return _(n)&&!v(n)||v(n)&&n.length&&_(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1}return 0}function cT(t,e,n){for(const n in e)lT(t,n,e[n]);for(const e in n)lT(t,e,n[e],"update")}function fT(t,e,n){for(const r in e)n&&rt(n,r)||(t[r]=K(t[r]||{},e[r]));return t}function hT(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const dT="mark",pT="frame",gT="scope",mT="legend-label",yT="title-text",vT="title-subtitle";function _T(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const xT=t=>pt(t)?wt(t):t.signal?"(".concat(t.signal,")"):MT(t);function bT(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:wt(t)));for(;e.length&&null==M(e);)e.pop();return e.unshift(xT(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?wT("hcl",t.h,t.c,t.l):t.h||t.s?wT("hsl",t.h,t.s,t.l):t.l||t.a?wT("lab",t.l,t.a,t.b):t.r||t.g||t.b?wT("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?MT(t.field):void 0!==t.value?wt(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=xT(t.scale);null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1==+t.band?"":"*"+kT(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(kT(t.exponent),")")),null!=t.mult&&(e+="*".concat(kT(t.mult))),null!=t.offset&&(e+="+".concat(kT(t.offset))),t.round&&(e="round(".concat(e,")")),e}const wT=(t,e,n,r)=>"(".concat(t,"(").concat([e,n,r].map(bT).join(","),")+'')");function kT(t){return _(t)?"("+bT(t)+")":t}function MT(t){return AT(_(t)?t:{datum:t})}function AT(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):u("Invalid field reference: "+wt(t));return t.signal||(r=pt(r)?s(r).map(wt).join("]["):AT(r)),e+"["+r+"]"}function ET(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let u,s,l,c;for(s in s="lineBreak","text"!==e||null==i[s]||hT(s,t)||_T(o,s,i[s]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===pT?i.group:n===dT?K({},i.mark,i[e]):null,c)l=hT(s,t)||("fill"===s||"stroke"===s)&&(hT("fill",t)||hT("stroke",t)),l||_T(o,s,c[s]);for(s in $(r).forEach((e=>{const n=i.style&&i.style[e];for(const e in n)hT(e,t)||_T(o,e,n[e])})),t=K({},t),o)c=o[s],c.signal?(u=u||{})[s]=c:a[s]=c;return t.enter=K(a,t.enter),u&&(t.update=K(u,t.update)),t}(t,e,n,r,i.config);for(const n in t)a[n]=DT(t[n],e,o,i);return o}function DT(t,e,n,r){const i={},o={};for(const e in t)null!=t[e]&&(i[e]=CT((a=t[e],v(a)?function(t){let e="";return t.forEach((t=>{const n=bT(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===M(e)&&(e+="null"),e}(a):bT(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function CT(t,e,n,r){const i=HS(t,e);return i.$fields.forEach((t=>r[t]=1)),K(n,i.$params),i.$expr}const FT=["value","update","init","react","bind"];function ST(t,e){u(t+' for "outer" push: '+wt(e))}function BT(t,e){const n=t.name;if("outer"===t.push)e.signals[n]||ST("No prior signal definition",n),FT.forEach((e=>{void 0!==t[e]&&ST("Invalid property ",e)}));else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function TT(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function zT(t,e,n,r){return new TT(t,e,n,r)}function NT(t,e){return zT("operator",t,e)}function OT(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function RT(t,e){return e?{$field:t,$name:e}:{$field:t}}const LT=RT("key");function UT(t,e){return{$compare:t,$order:e}}function qT(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const PT="scope",jT="view";function IT(t){return t&&t.signal}function $T(t){if(IT(t))return!0;if(_(t))for(const e in t)if($T(t[e]))return!0;return!1}function WT(t,e){return null!=t?t:e}function HT(t){return t&&t.signal||t}const YT="timer";function VT(t,e){return(t.merge?GT:t.stream?XT:t.type?JT:u("Invalid stream specification: "+wt(t)))(t,e)}function GT(t,e){const n=ZT({merge:t.merge.map((t=>VT(t,e)))},t,e);return e.addStream(n).id}function XT(t,e){const n=ZT({stream:VT(t.stream,e)},t,e);return e.addStream(n).id}function JT(t,e){let n;t.type===YT?(n=e.event(YT,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===PT?jT:t||jT}(t.source),t.type);const r=ZT({stream:n},t,e);return 1===Object.keys(r).length?n:e.addStream(r).id}function ZT(t,e,n){let r=e.between;return r&&(2!==r.length&&u('Stream "between" parameter must have 2 entries: '+wt(e)),t.between=[VT(r[0],n),VT(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===PT&&r.push("inScope(event.item)"),r.length&&(t.filter=HS("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const QT={code:"_.$value",ast:{type:"Identifier",value:"value"}};function KT(t,e,n){const r=t.encode,i={target:n};let o=t.events,a=t.update,s=[];o||u("Signal update missing events specification."),pt(o)&&(o=function(t,e,n){return tT=e||"view",eT=n||KB,rT(t.trim()).map(iT)}(o,e.isSubscope()?PT:jT)),o=$(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[tz(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&u("Signal encode and update are mutually exclusive."),a="encode(item(),"+wt(r)+")"),i.update=pt(a)?HS(a,e):null!=a.expr?HS(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:QT,$params:{$value:e.signalRef(a.signal)}}:u("Invalid signal update specification."),t.force&&(i.options={force:!0}),s.forEach((t=>e.addUpdate(K(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):VT(t,e)}}(t,e),i))))}function tz(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const ez=t=>(e,n,r)=>zT(t,n,e||void 0,r),nz=ez("aggregate"),rz=ez("axisticks"),iz=ez("bound"),oz=ez("collect"),az=ez("compare"),uz=ez("datajoin"),sz=ez("encode"),lz=ez("expression"),cz=ez("facet"),fz=ez("field"),hz=ez("key"),dz=ez("legendentries"),pz=ez("load"),gz=ez("mark"),mz=ez("multiextent"),yz=ez("multivalues"),vz=ez("overlap"),_z=ez("params"),xz=ez("prefacet"),bz=ez("projection"),wz=ez("proxy"),kz=ez("relay"),Mz=ez("render"),Az=ez("scale"),Ez=ez("sieve"),Dz=ez("sortitems"),Cz=ez("viewlayout"),Fz=ez("values");let Sz=0;const Bz={min:"min",max:"max",count:"sum"};function Tz(t,e){const n=e.getScale(t.name).params;let r;for(r in n.domain=Rz(t.domain,t,e),null!=t.range&&(n.range=Wz(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=zz(t.type||t),null!=t.gamma&&(e.interpolateGamma=zz(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return _(t)?{interval:zz(t.interval),step:zz(t.step)}:zz(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||v(t)?Nz(t,e):e.objectProperty(t)}(t.bins,e)),t)rt(n,r)||"name"===r||(n[r]=zz(t[r],e))}function zz(t,e){return _(t)?t.signal?e.signalRef(t.signal):u("Unsupported object: "+wt(t)):t}function Nz(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>zz(t,e)))}function Oz(t){u("Can not find data set: "+wt(t))}function Rz(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(v(t)?Lz:t.fields?qz:Uz)(t,e,n);null==e.domainMin&&null==e.domainMax||u("No scale domain defined for domainMin/domainMax to override.")}function Lz(t,e,n){return t.map((t=>zz(t,n)))}function Uz(t,e,n){const r=n.getData(t.data);return r||Oz(t.data),vd(e.type)?r.valuesRef(n,t.field,jz(t.sort,!1)):wd(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function qz(t,e,n){const r=t.data,i=t.fields.reduce(((t,e)=>(e=pt(e)?{data:r,field:e}:v(e)||e.signal?function(t,e){const n="_:vega:_"+Sz++,r=oz({});if(v(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+wt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,Ez({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(vd(e.type)?Pz:wd(e.type)?Iz:$z)(t,n,i)}function Pz(t,e,n){const r=jz(t.sort,!0);let i,o;const a=n.map((t=>{const n=e.getData(t.data);return n||Oz(t.data),n.countsRef(e,t.field,r)})),u={groupby:LT,pulse:a};r&&(i=r.op||"count",o=r.field?qT(i,r.field):"count",u.ops=[Bz[i]],u.fields=[e.fieldRef(o)],u.as=[o]),i=e.add(nz(u));const s=e.add(oz({pulse:OT(i)}));return o=e.add(Fz({field:LT,sort:e.sortRef(r),pulse:OT(s)})),OT(o)}function jz(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!Bz[t.op]&&u("Multiple domain scales can not be sorted using "+t.op):u("No field provided for sort aggregate op: "+t.op):_(t)?t.field="key":t={field:"key"}),t}function Iz(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||Oz(t.data),n.domainRef(e,t.field)}));return OT(e.add(yz({values:r})))}function $z(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||Oz(t.data),n.extentRef(e,t.field)}));return OT(e.add(mz({extents:r})))}function Wz(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(pt(i)){if(r&&rt(r,i))return Wz(t=K({},t,{range:r[i]}),e,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=vd(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:u("Unrecognized scale range value: "+wt(i))}else{if(i.scheme)return n.scheme=v(i.scheme)?Nz(i.scheme,e):zz(i.scheme,e),i.extent&&(n.schemeExtent=Nz(i.extent,e)),void(i.count&&(n.schemeCount=zz(i.count,e)));if(i.step)return void(n.rangeStep=zz(i.step,e));if(vd(t.type)&&!v(i))return Rz(i,t,e);v(i)||u("Unsupported range type: "+wt(i))}return i.map((t=>(v(t)?Nz:zz)(t,e)))}function Hz(t,e,n){return v(t)?t.map((t=>Hz(t,e,n))):_(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:u("Unsupported parameter object: "+wt(t)):t}const Yz="top",Vz="left",Gz="right",Xz="bottom",Jz="center",Zz="index",Qz="label",Kz="perc",tN="value",eN="guide-label",nN="guide-title",rN="group-title",iN="group-subtitle",oN="symbol",aN="gradient",uN="discrete",sN="size",lN=[sN,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],cN={name:1,style:1,interactive:1},fN={value:0},hN={value:1},dN="group",pN="rect",gN="rule",mN="text";function yN(t){return t.type=dN,t.interactive=t.interactive||!1,t}function vN(t,e){const n=(n,r)=>WT(t[n],WT(e[n],r));return n.isVertical=n=>"vertical"===WT(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>WT(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>WT(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>WT(t.columns,WT(e.columns,+n.isVertical(!0))),n}function _N(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function xN(t,e,n){return"item.anchor === '".concat("start","' ? ").concat(t," : item.anchor === '").concat("end","' ? ").concat(e," : ").concat(n)}const bN=xN(wt(Vz),wt(Gz),wt(Jz));function wN(t,e){return e?t?_(t)?Object.assign({},t,{offset:wN(t.offset,e)}):{value:t,offset:e}:e:t}function kN(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=fT(t.encode,e,cN)):t.interactive=!1,t}function MN(t,e,n,r){const i=vN(t,n),o=i.isVertical(),a=i.gradientThickness(),u=i.gradientLength();let s,l,c,f,h;o?(l=[0,1],c=[0,0],f=a,h=u):(l=[0,0],c=[1,0],f=u,h=a);const d={enter:s={opacity:fN,x:fN,y:fN,width:sT(f),height:sT(h)},update:K({},s,{opacity:hN,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:fN}};return cT(d,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),kN({type:pN,role:"legend-gradient",encode:d},r)}function AN(t,e,n,r,i){const o=vN(t,n),a=o.isVertical(),u=o.gradientThickness(),s=o.gradientLength();let l,c,f,h,d="";a?(l="y",f="y2",c="x",h="width",d="1-"):(l="x",f="x2",c="y",h="height");const p={opacity:fN,fill:{scale:e,field:tN}};p[l]={signal:d+"datum."+Kz,mult:s},p[c]=fN,p[f]={signal:d+"datum.perc2",mult:s},p[h]=sT(u);const g={enter:p,update:K({},p,{opacity:hN}),exit:{opacity:fN}};return cT(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),kN({type:pN,role:"legend-band",key:tN,from:i,encode:g},r)}const EN="datum.".concat(Kz,'<=0?"').concat(Vz,'":datum.').concat(Kz,'>=1?"').concat(Gz,'":"').concat(Jz,'"'),DN="datum.".concat(Kz,'<=0?"').concat(Xz,'":datum.').concat(Kz,'>=1?"').concat(Yz,'":"').concat("middle",'"');function CN(t,e,n,r){const i=vN(t,e),o=i.isVertical(),a=sT(i.gradientThickness()),u=i.gradientLength();let s,l,c,f,h=i("labelOverlap"),d="";const p={enter:s={opacity:fN},update:l={opacity:hN,text:{field:Qz}},exit:{opacity:fN}};return cT(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:WT(t.labelLimit,e.gradientLabelLimit)}),o?(s.align={value:"left"},s.baseline=l.baseline={signal:DN},c="y",f="x",d="1-"):(s.align=l.align={signal:EN},s.baseline={value:"top"},c="x",f="y"),s[c]=l[c]={signal:d+"datum."+Kz,mult:u},s[f]=l[f]=a,a.offset=WT(t.labelOffset,e.gradientLabelOffset)||0,h=h?{separation:i("labelSeparation"),method:h,order:"datum.index"}:void 0,kN({type:mN,role:mT,style:eN,key:tN,from:r,encode:p,overlap:h},n)}function FN(t,e,n,r,i){const o=vN(t,e),a=n.entries,u=!(!a||!a.interactive),s=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},h="(".concat(i,") ? datum.").concat("offset"," : datum.").concat(sN),d=l?sT(l):{field:sN},p="datum.".concat(Zz),g="max(1, ".concat(i,")");let m,y,v,_,x;d.mult=.5,m={enter:y={opacity:fN,x:{signal:h,mult:.5,offset:c},y:d},update:v={opacity:hN,x:y.x,y:y.y},exit:{opacity:fN}};let b=null,w=null;t.fill||(b=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),cT(m,{fill:o("symbolFillColor",b),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),lN.forEach((e=>{t[e]&&(v[e]=y[e]={scale:t[e],field:tN})}));const k=kN({type:"symbol",role:"legend-symbol",key:tN,from:f,clip:!!l||void 0,encode:m},n.symbols),M=sT(c);M.offset=o("labelOffset"),m={enter:y={opacity:fN,x:{signal:h,offset:M},y:d},update:v={opacity:hN,text:{field:Qz},x:y.x,y:y.y},exit:{opacity:fN}},cT(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const A=kN({type:mN,role:mT,style:eN,key:tN,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:fN,height:l?sT(l):fN,opacity:fN},exit:{opacity:fN},update:v={opacity:hN,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(_="ceil(item.mark.items.length / ".concat(g,")"),v.row.signal="".concat(p,"%").concat(_),v.column.signal="floor(".concat(p," / ").concat(_,")"),x={field:["row",p]}):(v.row.signal="floor(".concat(p," / ").concat(g,")"),v.column.signal="".concat(p," % ").concat(g),x={field:p}),v.column.signal="(".concat(i,")?").concat(v.column.signal,":").concat(p),yN({role:gT,from:r={facet:{data:r,name:"value",groupby:Zz}},encode:fT(m,a,cN),marks:[k,A],name:s,interactive:u,sort:x})}const SN='item.orient === "left"',BN='item.orient === "right"',TN="(".concat(SN," || ").concat(BN,")"),zN="datum.vgrad && ".concat(TN),NN=xN('"top"','"bottom"','"middle"'),ON=xN('"right"','"left"','"center"'),RN="datum.vgrad && ".concat(BN," ? (").concat(ON,") : (").concat(TN," && !(datum.vgrad && ").concat(SN,')) ? "left" : ').concat(bN),LN="item._anchor || (".concat(TN,' ? "middle" : "start")'),UN="".concat(zN," ? (").concat(SN," ? -90 : 90) : 0"),qN="".concat(TN," ? (datum.vgrad ? (").concat(BN,' ? "bottom" : "top") : ').concat(NN,') : "top"');function PN(t,e){let n;return _(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+jN(t.path)+")":t.sphere&&(n="geoShape("+jN(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function jN(t){return _(t)&&t.signal?t.signal:wt(t)}function IN(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===dN?gT:e||dT:e}function $N(t){return{marktype:t.type,name:t.name||void 0,role:t.role||IN(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function WN(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function HN(t,e){const n=ma(t.type);n||u("Unrecognized transform type: "+wt(t.type));const r=zT(n.type.toLowerCase(),null,YN(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function YN(t,e,n){const r={},i=t.params.length;for(let o=0;o<i;++o){const i=t.params[o];r[i.name]=VN(i,e,n)}return r}function VN(t,e,n){const r=t.type,i=e[t.name];return"index"===r?function(t,e,n){pt(e.from)||u('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==i?"param"===r?function(t,e,n){const r=e[t.name];return t.array?(v(r)||u("Expected an array of sub-parameters. Instead: "+wt(r)),r.map((e=>XN(t,e,n)))):XN(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!IT(i)?i.map((e=>GN(t,e,n))):GN(t,i,n):void(t.required&&u("Missing required "+wt(e.type)+" parameter: "+wt(t.name)))}function GN(t,e,n){const r=t.type;if(IT(e))return KN(r)?u("Expression references can not be signals."):tO(r)?n.fieldRef(e):eO(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||tO(r);return i&&JN(e)?n.exprRef(e.expr,e.as):i&&ZN(e)?RT(e.field,e.as):KN(r)?HS(e,n):QN(r)?OT(n.getData(e).values):tO(r)?RT(e):eO(r)?n.compareRef(e):e}}function XN(t,e,n){const r=t.params.length;let i;for(let n=0;n<r;++n){i=t.params[n];for(const t in i.key)if(i.key[t]!==e[t]){i=null;break}if(i)break}i||u("Unsupported parameter: "+wt(e));const o=K(YN(i,e,n),i.key);return OT(n.add(_z(o)))}const JN=t=>t&&t.expr,ZN=t=>t&&t.field,QN=t=>"data"===t,KN=t=>"expr"===t,tO=t=>"field"===t,eO=t=>"compare"===t;function nO(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:OT(e.getData(t.data).output)}function rO(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function iO(t){return pt(t)?t:null}function oO(t,e,n){const r=qT(n.op,n.field);let i;if(e.ops){for(let t=0,n=e.as.length;t<n;++t)if(e.as[t]===r)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((i=n.op.signal)?t.signalRef(i):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(r))}function aO(t,e,n,r,i,o,a){const u=e[n]||(e[n]={}),s=function(t){return _(t)?("descending"===t.order?"-":"+")+qT(t.op,t.field):""}(o);let l,c,f=iO(i);if(null!=f&&(t=e.scope,f+=s?"|"+s:"",l=u[f]),!l){const n=o?{field:LT,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:OT(e.output)};s&&(n.sort=t.sortRef(o)),c=t.add(zT(r,void 0,n)),a&&(e.index[i]=c),l=OT(c),null!=f&&(u[f]=l)}return l}function uO(t,e,n){const r=t.remove,i=t.insert,o=t.toggle,a=t.modify,u=t.values,s=e.add(NT()),l=HS("if("+t.trigger+',modify("'+n+'",'+[i,r,o,a,u].map((t=>null==t?"null":t)).join(",")+"),0)",e);s.update=l.$expr,s.params=l.$params}function sO(t,e){const n=IN(t),r=t.type===dN,i=t.from&&t.from.facet,o=t.overlap;let a,s,l,c,f,h,d,p=t.layout||n===gT||n===pT;const g=n===dT||p||i,m=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||u("Only group marks can be faceted."),null!=r.field?a=s=nO(r,n):(t.data?s=OT(n.getData(t.data).aggregate):(o=HN(K({type:"aggregate",groupby:$(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=nO(r,n),a=s=OT(n.add(o))),i=n.keyRef(r.groupby,!0))):a=OT(n.add(oz(null,[{}]))),a||(a=nO(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(uz({key:m.key||(t.key?RT(t.key):void 0),pulse:m.pulse,clean:!r}));const y=OT(s);s=l=e.add(oz({pulse:y})),s=e.add(gz({markdef:$N(t),interactive:WN(t.interactive,e),clip:PN(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:OT(s)}));const v=OT(s);s=c=e.add(sz(ET(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=HN(t,e),r=n.metadata;(r.generates||r.changes)&&u("Mark transforms should not generate new data."),r.nomod||(c.params.mod=!0),n.params.pulse=OT(s),e.add(s=n)})),t.sort&&(s=e.add(Dz({sort:e.compareRef(t.sort),pulse:OT(s)})));const _=OT(s);(i||p)&&(p=e.add(Cz({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:_})),h=OT(p));const x=e.add(iz({mark:v,pulse:h||_}));d=OT(x),r&&(g&&(a=e.operators,a.pop(),p&&a.pop()),e.pushState(_,h||d,y),i?function(t,e,n){const r=t.from.facet,i=r.name,o=nO(r,e);let a;r.name||u("Facet must have a name: "+wt(r)),r.data||u("Facet must reference a data set: "+wt(r)),r.field?a=e.add(xz({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(cz({key:e.keyRef(r.groupby),group:OT(e.proxy(n.parent)),pulse:o})):u("Facet must specify groupby or field: "+wt(r));const s=e.fork(),l=s.add(oz()),c=s.add(Ez({pulse:OT(l)}));s.addData(i,new rO(s,l,l,c)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,m):g?function(t,e,n){const r=e.add(xz({pulse:n.pulse})),i=e.fork();i.add(Ez()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,m):e.parse(t),e.popState(),g&&(p&&a.push(p),a.push(x))),o&&(d=function(t,e,n){const r=t.method,i=t.bound,o=t.separation,a={separation:IT(o)?n.signalRef(o.signal):o,method:IT(r)?n.signalRef(r.signal):r,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(i){const t=i.tolerance;a.boundTolerance=IT(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return OT(n.add(vz(a)))}(o,d,e));const b=e.add(Mz({pulse:d})),w=e.add(Ez({pulse:OT(b)},void 0,e.parent()));null!=t.name&&(f=t.name,e.addData(f,new rO(e,l,b,w)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&u("Marks only support modify triggers."),uO(t,e,f)})))}function lO(t,e){const n=e.config.legend,r=t.encode||{},i=vN(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,c={};let f,h,d,p=0;lN.forEach((e=>t[e]?(c[e]=t[e],p=p||t[e]):0)),p||u("Missing valid scale for legend.");const g=function(t,e){let n=t.type||oN;t.type||1!==function(t){return lN.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=yd(e)?aN:_d(e)?uN:oN);return n!==aN?n:_d(e)?uN:aN}(t,e.scaleType(p)),m={title:null!=t.title,scales:c,type:g,vgrad:"symbol"!==g&&i.isVertical()},y=OT(e.add(oz(null,[m]))),v=OT(e.add(dz(h={type:g,scale:e.scaleRef(p),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return g===aN?(d=[MN(t,p,n,r.gradient),CN(t,n,r.labels,v)],h.count=h.count||e.signalRef("max(2,2*floor((".concat(HT(i.gradientLength()),")/100))"))):g===uN?d=[AN(t,p,n,r.gradient,v),CN(t,n,r.labels,v)]:(f=function(t,e){const n=vN(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[FN(t,n,r,v,HT(f.columns))],h.size=function(t,e,n){const r=HT(fO("size",t,n)),i=HT(fO("strokeWidth",t,n)),o=HT(function(t,e,n){return _N("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,eN));return HS("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[yN({role:"legend-entry",from:y,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:f,interactive:s})],m.title&&d.push(function(t,e,n,r){const i=vN(t,e),o={enter:{opacity:fN},update:{opacity:hN,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:fN}};return cT(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:LN},angle:{signal:UN},align:{signal:RN},baseline:{signal:qN},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),kN({type:mN,role:"legend-title",style:nN,from:r,encode:o},n)}(t,n,r.title,y)),sO(yN({role:"legend",from:y,encode:fT(cO(i,t,n),o,cN),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:l}),e)}function cO(t,e,n){const r={enter:{},update:{}};return cT(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function fO(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):_N(t,n[0].encode)}rO.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],a=null,u=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);u<n;++u)e[u].params.pulse=OT(e[u-1]),t.add(e[u]),"aggregate"===e[u].type&&(a=e[u]);return new rO(t,o,i,r,a)},rO.prototype={countsRef(t,e,n){const r=this,i=r.counts||(r.counts={}),o=iO(e);let a,u,s;return null!=o&&(t=r.scope,a=i[o]),a?n&&n.field&&oO(t,a.agg.params,n):(s={groupby:t.fieldRef(e,"key"),pulse:OT(r.output)},n&&n.field&&oO(t,s,n),u=t.add(nz(s)),a=t.add(oz({pulse:OT(u)})),a={agg:u,ref:OT(a)},null!=o&&(i[o]=a)),a.ref},tuplesRef(){return OT(this.values)},extentRef(t,e){return aO(t,this,"extent","extent",e,!1)},domainRef(t,e){return aO(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return aO(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return aO(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return aO(t,this,"indata","tupleindex",e,!0,!0)}};const hO='item.orient==="'.concat(Vz,'"?-90:item.orient==="').concat(Gz,'"?90:0');function dO(t,e){const n=vN(t=pt(t)?{text:t}:t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,u=i.style,s=[],l=OT(e.add(oz(null,[{}])));return s.push(function(t,e,n,r){const i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return cT(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),kN({type:mN,role:yT,style:rN,from:r,encode:a},n)}(t,n,function(t){const e=t.encode;return e&&e.title||K({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&s.push(function(t,e,n,r){const i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return cT(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),kN({type:mN,role:vT,style:iN,from:r,encode:a},n)}(t,n,r.subtitle,l)),sO(yN({role:"title",from:l,encode:pO(n,i),marks:s,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:u}),e)}function pO(t,e){const n={enter:{},update:{}};return cT(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:bN},angle:{signal:hO},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),fT(n,e,cN)}function gO(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(HN(t,e))})),t.on&&t.on.forEach((n=>{uO(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,u,s,l=null,c=!1,f=!1;t.values?$T(t.values)||$T(t.format)?(r.push(yO(e,t)),r.push(l=mO())):r.push(l=mO({$ingest:t.values,$format:t.format})):t.url?$T(t.url)||$T(t.format)?(r.push(yO(e,t)),r.push(l=mO())):r.push(l=mO({$request:t.url,$format:t.format})):t.source&&(l=i=$(t.source).map((t=>OT(e.getData(t).output))),r.push(null));for(o=0,a=n.length;o<a;++o)u=n[o],s=u.metadata,l||s.source||r.push(l=mO()),r.push(u),s.generates&&(f=!0),s.modifies&&!f&&(c=!0),s.source?l=u:s.changes&&(l=null);i&&(a=i.length-1,r[0]=kz({derive:c,pulse:a?i:i[0]}),(c||a)&&r.splice(1,0,mO()));l||r.push(mO());return r.push(Ez({})),r}(t,e,n))}function mO(t){const e=oz({},t);return e.metadata={source:!0},e}function yO(t,e){return pz({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}const vO=t=>t===Xz||t===Yz,_O=(t,e,n)=>IT(t)?AO(t.signal,e,n):t===Vz||t===Yz?e:n,xO=(t,e,n)=>IT(t)?kO(t.signal,e,n):vO(t)?e:n,bO=(t,e,n)=>IT(t)?MO(t.signal,e,n):vO(t)?n:e,wO=(t,e,n)=>IT(t)?EO(t.signal,e,n):t===Yz?{value:e}:{value:n},kO=(t,e,n)=>CO("".concat(t," === '").concat(Yz,"' || ").concat(t," === '").concat(Xz,"'"),e,n),MO=(t,e,n)=>CO("".concat(t," !== '").concat(Yz,"' && ").concat(t," !== '").concat(Xz,"'"),e,n),AO=(t,e,n)=>SO("".concat(t," === '").concat(Vz,"' || ").concat(t," === '").concat(Yz,"'"),e,n),EO=(t,e,n)=>SO("".concat(t," === '").concat(Yz,"'"),e,n),DO=(t,e,n)=>SO("".concat(t," === '").concat(Gz,"'"),e,n),CO=(t,e,n)=>(e=null!=e?sT(e):e,n=null!=n?sT(n):n,FO(e)&&FO(n)?(e=e?e.signal||wt(e.value):null,n=n?n.signal||wt(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[K({test:t},e)].concat(n||[])),FO=t=>null==t||1===Object.keys(t).length,SO=(t,e,n)=>({signal:"".concat(t," ? (").concat(TO(e),") : (").concat(TO(n),")")}),BO=(t,e,n,r,i)=>({signal:(null!=r?"".concat(t," === '").concat(Vz,"' ? (").concat(TO(r),") : "):"")+(null!=n?"".concat(t," === '").concat(Xz,"' ? (").concat(TO(n),") : "):"")+(null!=i?"".concat(t," === '").concat(Gz,"' ? (").concat(TO(i),") : "):"")+(null!=e?"".concat(t," === '").concat(Yz,"' ? (").concat(TO(e),") : "):"")+"(null)"}),TO=t=>IT(t)?t.signal:null==t?null:wt(t),zO=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function NO(t,e,n,r){let i;if(e&&rt(e,t))return e[t];if(rt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r["guide-title"][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r["guide-label"][i]}return null}function OO(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function RO(t,e){return{scale:t.scale,range:e}}function LO(t,e,n,r,i){const o=vN(t,e),a=t.orient,u=t.gridScale,s=_O(a,1,-1),l=function(t,e){if(1===e);else if(_(t)){let n=t=K({},t);for(;null!=n.mult;){if(!_(n.mult))return n.mult=IT(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=K({},n.mult)}n.mult=e}else t=IT(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,s);let c,f,h;const d={enter:c={opacity:fN},update:h={opacity:hN},exit:f={opacity:fN}};cT(d,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:tN,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=xO(a,{signal:"height"},{signal:"width"}),m=u?{scale:u,range:0,mult:s,offset:l}:{value:0,offset:l},y=u?{scale:u,range:1,mult:s,offset:l}:K(g,{mult:s,offset:l});return c.x=h.x=xO(a,p,m),c.y=h.y=bO(a,p,m),c.x2=h.x2=bO(a,y),c.y2=h.y2=xO(a,y),f.x=xO(a,p),f.y=bO(a,p),kN({type:gN,role:"axis-grid",key:tN,from:r,encode:d},n)}function UO(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function qO(t,e,n,r,i,o){const a=vN(t,e),u=t.orient,s=t.scale,l=_O(u,-1,1),c=HT(a("labelFlush")),f=HT(a("labelFlushOffset")),h=a("labelAlign"),d=a("labelBaseline");let p,g=0===c||!!c;const m=sT(i);m.mult=l,m.offset=sT(a("labelPadding")||0),m.offset.mult=l;const y={scale:s,field:tN,band:.5,offset:wN(o.offset,a("labelOffset"))},v=xO(u,g?UO(s,c,'"left"','"right"','"center"'):{value:"center"},((t,e,n)=>IT(t)?DO(t.signal,e,n):t===Gz?{value:e}:{value:n})(u,"left","right")),_=xO(u,wO(u,"bottom","top"),g?UO(s,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=UO(s,c,"-(".concat(f,")"),f,0);g=g&&f;const b={opacity:fN,x:xO(u,y,m),y:bO(u,y,m)},w={enter:b,update:p={opacity:hN,text:{field:Qz},x:b.x,y:b.y,align:v,baseline:_},exit:{opacity:fN,x:b.x,y:b.y}};cT(w,{dx:!h&&g?xO(u,x):null,dy:!d&&g?bO(u,x):null}),cT(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:h,baseline:d});const k=a("labelBound");let M=a("labelOverlap");return M=M||k?{separation:a("labelSeparation"),method:M,order:"datum.index",bound:k?{scale:s,orient:u,tolerance:k}:null}:void 0,p.align!==v&&(p.align=zO(p.align,v)),p.baseline!==_&&(p.baseline=zO(p.baseline,_)),kN({type:mN,role:"axis-label",style:eN,key:tN,from:r,encode:w,overlap:M},n)}function PO(t,e,n,r){const i=vN(t,e),o=t.orient,a=_O(o,-1,1);let u,s;const l={enter:u={opacity:fN,anchor:sT(i("titleAnchor",null)),align:{signal:bN}},update:s=K({},u,{opacity:hN,text:sT(t.title)}),exit:{opacity:fN}},c={signal:'lerp(range("'.concat(t.scale,'"), ').concat(xN(0,1,.5),")")};return s.x=xO(o,c),s.y=bO(o,c),u.angle=xO(o,fN,((t,e)=>0===e?0:IT(t)?{signal:"(".concat(t.signal,") * ").concat(e)}:{value:t*e})(a,90)),u.baseline=xO(o,wO(o,Xz,Yz),{value:Xz}),s.angle=u.angle,s.baseline=u.baseline,cT(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=zO(sT(t),n.update[e]),!1):!hT(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?sT(a):xO(e,sT(a),sT(o))}(i,o,l,n),l.update.align=zO(l.update.align,u.align),l.update.angle=zO(l.update.angle,u.angle),l.update.baseline=zO(l.update.baseline,u.baseline),kN({type:mN,role:"axis-title",style:nN,from:r,encode:l},n)}function jO(t,e){const n=function(t,e){var n,r,i,o=e.config,a=o.style,u=o.axis,s="band"===e.scaleType(t.scale)&&o.axisBand,l=t.orient;if(IT(l)){const t=OO([o.axisX,o.axisY]),e=OO([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},t))n[i]=xO(l,NO(i,o.axisX,u,a),NO(i,o.axisY,u,a));for(i of(r={},e))r[i]=BO(l.signal,NO(i,o.axisTop,u,a),NO(i,o.axisBottom,u,a),NO(i,o.axisLeft,u,a),NO(i,o.axisRight,u,a))}else n=l===Yz||l===Xz?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||s?K({},u,n,r,s):u}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,u=i.style,s=vN(t,n),l=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(e.signal,") === 'extent'")},_(i)||(i={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(s),c={scale:t.scale,ticks:!!s("ticks"),labels:!!s("labels"),grid:!!s("grid"),domain:!!s("domain"),title:null!=t.title},f=OT(e.add(oz({},[c]))),h=OT(e.add(rz({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),d=[];let p;return c.grid&&d.push(LO(t,n,r.grid,h,l)),c.ticks&&(p=s("tickSize"),d.push(function(t,e,n,r,i,o){const a=vN(t,e),u=t.orient,s=_O(u,-1,1);let l,c,f;const h={enter:l={opacity:fN},update:f={opacity:hN},exit:c={opacity:fN}};cT(h,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const d=sT(i);d.mult=s;const p={scale:t.scale,field:tN,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=xO(u,fN,p),f.y2=l.y2=xO(u,d),c.x=xO(u,p),f.x=l.x=bO(u,fN,p),f.x2=l.x2=bO(u,d),c.y=bO(u,p),kN({type:gN,role:"axis-tick",key:tN,from:r,encode:h},n)}(t,n,r.ticks,h,p,l))),c.labels&&(p=c.ticks?p:0,d.push(qO(t,n,r.labels,h,p,l))),c.domain&&d.push(function(t,e,n,r){const i=vN(t,e),o=t.orient;let a,u;const s={enter:a={opacity:fN},update:u={opacity:hN},exit:{opacity:fN}};cT(s,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=RO(t,0),c=RO(t,1);return a.x=u.x=xO(o,l,fN),a.x2=u.x2=xO(o,c),a.y=u.y=bO(o,l,fN),a.y2=u.y2=bO(o,c),kN({type:gN,role:"axis-domain",from:r,encode:s},n)}(t,n,r.domain,f)),c.title&&d.push(PO(t,n,r.title,f)),sO(yN({role:"axis",from:f,encode:fT(IO(s,t),i,cN),marks:d,aria:s("aria"),description:s("description"),zindex:s("zindex"),name:o,interactive:a,style:u}),e)}function IO(t,e){const n={enter:{},update:{}};return cT(n,{orient:t("orient"),offset:t("offset")||0,position:WT(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function $O(t,e,n){const r=$(t.signals),i=$(t.scales);return n||r.forEach((t=>BT(t,e))),$(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},r={};for(const n in t)"name"!==n&&(r[n]=Hz(t[n],n,e));for(const t in n)null==r[t]&&(r[t]=Hz(n[t],t,e));e.addProjection(t.name,r)}(t,e))),i.forEach((t=>function(t,e){const n=t.type||"linear";gd(n)||u("Unrecognized scale type: "+wt(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),$(t.data).forEach((t=>gO(t,e))),i.forEach((t=>Tz(t,e))),(n||r).forEach((t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?u("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=HS(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((t=>KT(t,e,n.id)))}(t,e))),$(t.axes).forEach((t=>jO(t,e))),$(t.marks).forEach((t=>sO(t,e))),$(t.legends).forEach((t=>lO(t,e))),t.title&&dO(t.title,e),e.parseLambdas(),e}function WO(t,e){const n=e.config,r=OT(e.root=e.add(NT())),i=function(t,e){const n=n=>WT(t[n],e[n]),r=[HO("background",n("background")),HO("autosize",oT(n("autosize"))),HO("padding",uT(n("padding"))),HO("width",n("width")||0),HO("height",n("height")||0)],i=r.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return $(t.signals).forEach((t=>{rt(i,t.name)?t=K(i[t.name],t):r.push(t),o[t.name]=t})),$(e.signals).forEach((t=>{rt(o,t.name)||rt(i,t.name)||r.push(t)})),r}(t,n);i.forEach((t=>BT(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(oz()),a=e.add(sz(ET((t=>fT({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t))(t.encode),dN,pT,t.style,e,{pulse:OT(o)}))),u=e.add(Cz({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:OT(a)}));e.operators.pop(),e.pushState(OT(a),OT(u),null),$O(t,e,i),e.operators.push(u);let s=e.add(iz({mark:r,pulse:OT(u)}));return s=e.add(Mz({pulse:OT(s)})),s=e.add(Ez({pulse:OT(s)})),e.addData("root",new rO(e,o,o,s)),e}function HO(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function YO(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function VO(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function GO(t){return(v(t)?XO:JO)(t)}function XO(t){const e=t.length;let n="[";for(let r=0;r<e;++r){const e=t[r];n+=(r>0?",":"")+(_(e)?e.signal||GO(e):wt(e))}return n+"]"}function JO(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+wt(e)+":"+(_(n)?n.signal||GO(n):wt(n));return r+"}"}YO.prototype=VO.prototype={parse(t){return $O(t,this)},fork(){return new VO(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof TT?OT(t):t;return this.add(wz({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(OT(this.add(Ez({pulse:t})))),this._parent.push(e),this._lookup.push(n?OT(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return M(this._parent)},encode(){return M(this._encode)},lookup(){return M(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(pt(t))return RT(t,e);t.signal||u("Unsupported field reference: "+wt(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=OT(this.add(fz(t)))}return r},compareRef(t){let e=!1;const n=t=>IT(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=$(t.field).map(n),i=$(t.order).map(n);return e?OT(this.add(az({fields:r,orders:i}))):UT(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=$(t).map((t=>IT(t)?(n=!0,OT(r[t.signal])):t)),n?OT(this.add(hz({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=qT(t.op,t.field),n=t.order||"ascending";return n.signal?OT(this.add(az({fields:e,orders:this.signalRef(n.signal)}))):UT(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return rt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&u("Duplicate signal name: "+wt(t));const n=e instanceof TT?e:this.add(NT(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||u("Unrecognized signal name: "+wt(t)),this.signals[t]},signalRef(t){return this.signals[t]?OT(this.signals[t]):(rt(this.lambdas,t)||(this.lambdas[t]=this.add(NT(null))),OT(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],r=HS(n,this),i=this.lambdas[n];i.params=r.$params,i.update=r.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&_(t)?this.signalRef(t.signal||GO(t)):t},exprRef(t,e){const n={expr:HS(t,this)};return e&&(n.expr.$name=e),OT(this.add(lz(n)))},addBinding(t,e){this.bindings||u("Nested signals do not support binding: "+wt(t)),this.bindings.push(K({signal:t},e))},addScaleProj(t,e){rt(this.scales,t)&&u("Duplicate scale or projection name: "+wt(t)),this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,Az(e))},addProjection(t,e){this.addScaleProj(t,bz(e))},getScale(t){return this.scales[t]||u("Unrecognized scale name: "+wt(t)),this.scales[t]},scaleRef(t){return OT(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){return rt(this.data,t)&&u("Duplicate data set name: "+wt(t)),this.data[t]=e},getData(t){return this.data[t]||u("Undefined data set name: "+wt(t)),this.data[t]},addDataPipeline(t,e){return rt(this.data,t)&&u("Duplicate data set name: "+wt(t)),this.addData(t,rO.fromEntries(this,e))}},K(ga,Ns,P_,yx,iA,rE,UD,yD,$D,gC,FC,UC),t.Bounds=Zp,t.CanvasHandler=Ey,t.CanvasRenderer=By,t.DATE=On,t.DAY=Rn,t.DAYOFYEAR=Ln,t.Dataflow=ha,t.Debug=4,t.Error=1,t.EventStream=Zo,t.Gradient=ip,t.GroupItem=Kp,t.HOURS=Un,t.Handler=sy,t.Info=3,t.Item=Qp,t.MILLISECONDS=jn,t.MINUTES=qn,t.MONTH=zn,t.Marks=Ym,t.MultiPulse=ua,t.None=0,t.Operator=Go,t.Parameters=Ho,t.Pulse=ra,t.QUARTER=Tn,t.RenderType=_v,t.Renderer=cy,t.ResourceLoader=tg,t.SECONDS=Pn,t.SVGHandler=zy,t.SVGRenderer=nv,t.SVGStringRenderer=mv,t.Scenegraph=ty,t.TIME_UNITS=In,t.Transform=pa,t.View=HB,t.WEEK=Nn,t.Warn=2,t.YEAR=Bn,t.accessor=e,t.accessorFields=r,t.accessorName=n,t.array=$,t.ascending=V,t.bandwidthNRD=ba,t.bin=wa,t.bootstrapCI=ka,t.boundClip=Dv,t.boundContext=bg,t.boundItem=Vm,t.boundMark=Xm,t.boundStroke=rg,t.changeset=$o,t.clampRange=W,t.compare=Y,t.constant=Z,t.cumulativeLogNormal=Ra,t.cumulativeNormal=Sa,t.cumulativeUniform=Ia,t.dayofyear=Xn,t.debounce=Q,t.defaultLocale=Do,t.definition=ma,t.densityLogNormal=Oa,t.densityNormal=Fa,t.densityUniform=ja,t.domChild=iy,t.domClear=oy,t.domCreate=ny,t.domFind=ry,t.dotbin=Ma,t.error=u,t.expressionFunction=WS,t.extend=K,t.extent=tt,t.extentIndex=et,t.falsy=g,t.fastmap=ot,t.field=l,t.flush=at,t.font=Pm,t.fontFamily=qm,t.fontSize=Nm,t.format=he,t.formatLocale=_o,t.formats=de,t.hasOwnProperty=rt,t.id=c,t.identity=f,t.inferType=Wt,t.inferTypes=Ht,t.ingest=Lo,t.inherits=ut,t.inrange=st,t.interpolate=Cd,t.interpolateColors=Ad,t.interpolateRange=Md,t.intersect=wv,t.intersectBoxLine=Tg,t.intersectPath=Cg,t.intersectPoint=Fg,t.intersectRule=Bg,t.isArray=v,t.isBoolean=lt,t.isDate=ct,t.isFunction=H,t.isIterable=ft,t.isNumber=ht,t.isObject=_,t.isRegExp=dt,t.isString=pt,t.isTuple=No,t.key=gt,t.lerp=mt,t.lineHeight=Om,t.loader=Fo,t.locale=Eo,t.logger=y,t.lruCache=yt,t.markup=Jy,t.merge=vt,t.mergeConfig=b,t.multiLineOffset=Lm,t.one=d,t.pad=xt,t.panLinear=T,t.panLog=z,t.panPow=N,t.panSymlog=O,t.parse=function(t,e,n){return _(t)||u("Input Vega specification must be an object."),WO(t,new YO(e=b(function(){const t="sans-serif",e="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:n},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:n,font:t,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:n,font:t,fontSize:10},"guide-title":{fill:n,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),e,t.config),n)).toRuntime()},t.pathCurves=ap,t.pathEqual=Fv,t.pathParse=lp,t.pathRectangle=zp,t.pathRender=xp,t.pathSymbols=Mp,t.pathTrail=Np,t.peek=M,t.point=uy,t.projection=EM,t.quantileLogNormal=La,t.quantileNormal=Ba,t.quantileUniform=$a,t.quantiles=_a,t.quantizeInterpolator=Ed,t.quarter=j,t.quartiles=xa,t.randomInteger=function(e,n){let r,i,o;null==n&&(n=e,e=0);const a={min(t){return arguments.length?(r=t||0,o=i-r,a):r},max(t){return arguments.length?(i=t||0,o=i-r,a):i},sample:()=>r+Math.floor(o*t.random()),pdf:t=>t===Math.floor(t)&&t>=r&&t<i?1/o:0,cdf(t){const e=Math.floor(t);return e<r?0:e>=i?1:(e-r+1)/o},icdf:t=>t>=0&&t<=1?r-1+Math.floor(t*o):NaN};return a.min(e).max(n)},t.randomKDE=za,t.randomLCG=function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},t.randomLogNormal=Ua,t.randomMixture=qa,t.randomNormal=Ta,t.randomUniform=Wa,t.read=Co,t.regressionExp=Za,t.regressionLinear=Xa,t.regressionLoess=nu,t.regressionLog=Ja,t.regressionPoly=tu,t.regressionPow=Qa,t.regressionQuad=Ka,t.renderModule=bv,t.repeat=_t,t.resetDefaultLocale=function(){return yo(),wo(),Do()},t.resetSVGClipId=Xp,t.resetSVGDefIds=function(){Xp(),Kd=0},t.responseType=pe,t.runtimeContext=tB,t.sampleCurve=au,t.sampleLogNormal=Na,t.sampleNormal=Ca,t.sampleUniform=Pa,t.scale=pd,t.sceneEqual=Cv,t.sceneFromJSON=Qm,t.scenePickVisit=$g,t.sceneToJSON=Zm,t.sceneVisit=Ig,t.sceneZOrder=jg,t.scheme=Td,t.serializeXML=Zy,t.setRandom=function(e){t.random=e},t.span=bt,t.splitAccessPath=s,t.stringValue=wt,t.textMetrics=Cm,t.timeBin=qr,t.timeFloor=fr,t.timeFormatLocale=Mo,t.timeInterval=yr,t.timeOffset=xr,t.timeSequence=kr,t.timeUnitSpecifier=Yn,t.timeUnits=Wn,t.toBoolean=kt,t.toDate=At,t.toNumber=A,t.toSet=Dt,t.toString=Et,t.transform=ya,t.transforms=ga,t.truncate=Ct,t.truthy=p,t.tupleid=Oo,t.typeParsers=jt,t.utcFloor=pr,t.utcInterval=vr,t.utcOffset=br,t.utcSequence=Mr,t.utcdayofyear=er,t.utcquarter=I,t.utcweek=nr,t.version="5.17.0",t.visitArray=Ft,t.week=Jn,t.writeConfig=w,t.zero=h,t.zoomLinear=L,t.zoomLog=U,t.zoomPow=q,t.zoomSymlog=P,Object.defineProperty(t,"__esModule",{value:!0})}));
+//# sourceMappingURL=vega.min.js.map
diff --git a/javascript/stylesheet.css b/javascript/stylesheet.css
--- a/javascript/stylesheet.css
+++ b/javascript/stylesheet.css
@@ -9,7 +9,8 @@
   background-color: transparent;
   color: black;
 }
-.container { width: 90%; }
+.container { width: 90%;
+             max-width: 1400px; }
 
 /* Reset milligram table styling so tooltips render correctly */
 table, caption, tbody, tfoot, thead, tr, th, td {
@@ -30,4 +31,8 @@
 
 #description{
   visibility: hidden;
+}
+/* https://github.com/gwatts/jquery.sparkline/issues/202 */
+.jqstooltip {
+  box-sizing: content-box;
 }
diff --git a/javascript/tablogic.js b/javascript/tablogic.js
--- a/javascript/tablogic.js
+++ b/javascript/tablogic.js
@@ -18,6 +18,8 @@
 
     // Add the specific color to the button used to open the tab content
     elmnt.classList.add('button-outline');
+    $.sparkline_display_visible()
+
 }
 
 // Get the element with id="defaultOpen" and click on it
diff --git a/javascript/vega-embed@6.3.2 b/javascript/vega-embed@6.3.2
deleted file mode 100644
--- a/javascript/vega-embed@6.3.2
+++ /dev/null
@@ -1,26 +0,0 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vega"),require("vega-lite")):"function"==typeof define&&define.amd?define(["vega","vega-lite"],t):(e=e||self).vegaEmbed=t(e.vega,e.vegaLite)}(this,(function(e,t){"use strict";var r="6.3.2";
-/*! *****************************************************************************
-    Copyright (c) Microsoft Corporation. All rights reserved.
-    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-    this file except in compliance with the License. You may obtain a copy of the
-    License at http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-    MERCHANTABLITY OR NON-INFRINGEMENT.
-
-    See the Apache Version 2.0 License for specific language governing permissions
-    and limitations under the License.
-    ***************************************************************************** */
-function n(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}
-/*!
-     * https://github.com/Starcounter-Jack/JSON-Patch
-     * (c) 2017 Joachim Wester
-     * MIT license
-     */var o,i=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=Object.prototype.hasOwnProperty;function s(e,t){return a.call(e,t)}function l(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)s(e,n)&&t.push(n);return t}function c(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function d(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function p(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u(e,t){var r=[e];for(var n in t){var o="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==o&&r.push(n+": "+o)}return r.join("\n")}var h=function(e){function t(t,r,n,o,i){var a=this.constructor,s=e.call(this,u(t,{name:r,index:n,operation:o,tree:i}))||this;return s.name=r,s.index=n,s.operation=o,s.tree=i,Object.setPrototypeOf(s,a.prototype),s.message=u(t,{name:r,index:n,operation:o,tree:i}),s}return i(t,e),t}(Error),v=h,g=c,m={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=b(r,this.path);n&&(n=c(n));var o=y(r,{op:"remove",path:this.from}).removed;return y(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=b(r,this.from);return y(r,{op:"add",path:this.path,value:c(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:A(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},E={add:function(e,t,r){return d(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:m.move,copy:m.copy,test:m.test,_get:m._get};function b(e,t){if(""==t)return e;var r={op:"_get",path:t};return y(e,r),r.value}function y(e,t,r,n,o,i){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===i&&(i=0),r&&("function"==typeof r?r(t,0,e,t.path):w(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=b(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=A(e,t.value),!1===a.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}n||(e=c(e));var s=(t.path||"").split("/"),l=e,p=1,u=s.length,h=void 0,g=void 0,y=void 0;for(y="function"==typeof r?r:w;;){if(g=s[p],o&&"__proto__"==g)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===h&&(void 0===l[g]?h=s.slice(0,p).join("/"):p==u-1&&(h=t.path),void 0!==h&&y(t,0,e,h)),p++,Array.isArray(l)){if("-"===g)g=l.length;else{if(r&&!d(g))throw new v("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);d(g)&&(g=~~g)}if(p>=u){if(r&&"add"===t.op&&g>l.length)throw new v("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);if(!1===(a=E[t.op].call(t,l,g,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}}else if(g&&-1!=g.indexOf("~")&&(g=f(g)),p>=u){if(!1===(a=m[t.op].call(t,l,g,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a}l=l[g]}}function O(e,t,r,n,o){if(void 0===n&&(n=!0),void 0===o&&(o=!0),r&&!Array.isArray(t))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=c(e));for(var i=new Array(t.length),a=0,s=t.length;a<s;a++)i[a]=y(e,t[a],r,!0,o,a),e=i[a].newDocument;return i.newDocument=e,i}function w(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new v("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!m[e.op])throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new v("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new v('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new v("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t){var o=l(t),i=o.length;for(r=0;r<i;r++)if(e(t[o[r]]))return!0}return!1}(e.value))throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var o=e.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new v("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new v("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=I([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new v("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function I(e,t,r){try{if(!Array.isArray(e))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)O(c(t),c(e),r||!0);else{r=r||w;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof v)return e;throw e}}function A(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,o,i=Array.isArray(e),a=Array.isArray(t);if(i&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!A(e[r],t[r]))return!1;return!0}if(i!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!A(e[o=s[r]],t[o]))return!1;return!0}return e!=e&&t!=t}var N=Object.freeze({__proto__:null,JsonPatchError:v,deepClone:g,getValueByPointer:b,applyOperation:y,applyPatch:O,applyReducer:function(e,t,r){var n=y(e,t);if(!1===n.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument},validator:w,validate:I,_areEquals:A}),R=new WeakMap,$=function(e){this.observers=new Map,this.obj=e},L=function(e,t){this.callback=e,this.observer=t};
-/*!
-     * https://github.com/Starcounter-Jack/JSON-Patch
-     * (c) 2017 Joachim Wester
-     * MIT license
-     */function T(e,t){void 0===t&&(t=!1);var r=R.get(e.object);S(r.value,e.object,e.patches,"",t),e.patches.length&&O(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function S(e,t,r,n,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=l(t),a=l(e),d=!1,f=a.length-1;f>=0;f--){var u=e[v=a[f]];if(!s(t,v)||void 0===t[v]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+p(v),value:c(u)}),r.push({op:"remove",path:n+"/"+p(v)}),d=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}));else{var h=t[v];"object"==typeof u&&null!=u&&"object"==typeof h&&null!=h?S(u,h,r,n+"/"+p(v),o):u!==h&&(o&&r.push({op:"test",path:n+"/"+p(v),value:c(u)}),r.push({op:"replace",path:n+"/"+p(v),value:c(h)}))}}if(d||i.length!=a.length)for(f=0;f<i.length;f++){var v;s(e,v=i[f])||void 0===t[v]||r.push({op:"add",path:n+"/"+p(v),value:c(t[v])})}}}var C=Object.freeze({__proto__:null,unobserve:function(e,t){t.unobserve()},observe:function(e,t){var r,n=function(e){return R.get(e)}(e);if(n){var o=function(e,t){return e.observers.get(t)}(n,t);r=o&&o.observer}else n=new $(e),R.set(e,n);if(r)return r;if(r={},n.value=c(e),t){r.callback=t,r.next=null;var i=function(){T(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(i)};"undefined"!=typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=[],r.object=e,r.unobserve=function(){T(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},n.observers.set(t,new L(t,r)),r},generate:T,compare:function(e,t,r){void 0===r&&(r=!1);var n=[];return S(e,t,n,"",r),n}});Object.assign({},N,C,{JsonPatchError:h,deepClone:c,escapePathComponent:p,unescapePathComponent:f});var x=/("(?:[^\\"]|\\.)*")|[:,]/g,D=function(e,t){var r,n,o;return t=t||{},r=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),n=""===r?1/0:void 0===t.maxLength?80:t.maxLength,o=t.replacer,function e(t,i,a){var s,l,c,d,p,f,u,h,v,g,m,E;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(m=JSON.stringify(t,o)))return m;if(u=n-i.length-a,m.length<=u&&(v=m.replace(x,(function(e,t){return t||e+" "}))).length<=u)return v;if(null!=o&&(t=JSON.parse(m),o=void 0),"object"==typeof t&&null!==t){if(h=i+r,c=[],l=0,Array.isArray(t))for(g="[",s="]",u=t.length;l<u;l++)c.push(e(t[l],h,l===u-1?0:1)||"null");else for(g="{",s="}",u=(f=Object.keys(t)).length;l<u;l++)d=f[l],p=JSON.stringify(d)+": ",void 0!==(E=e(t[d],h,p.length+(l===u-1?0:1)))&&c.push(p+E);if(c.length>0)return[g,r+c.join(",\n"+h),s].join("\n"+i)}return m}(e,"",0)};function F(e,t){return e(t={exports:{}},t.exports),t.exports}var _={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var P="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},k=F((function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=_,n=(t=e.exports={}).re=[],o=t.src=[],i=t.t={};let a=0;const s=(e,t,r)=>{const s=a++;P(s,t),i[e]=s,o[s]=t,n[s]=new RegExp(t,r?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${o[i.NUMERICIDENTIFIER]})\\.`+`(${o[i.NUMERICIDENTIFIER]})\\.`+`(${o[i.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${o[i.NUMERICIDENTIFIERLOOSE]})\\.`+`(${o[i.NUMERICIDENTIFIERLOOSE]})\\.`+`(${o[i.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${o[i.NUMERICIDENTIFIER]}|${o[i.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${o[i.NUMERICIDENTIFIERLOOSE]}|${o[i.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${o[i.PRERELEASEIDENTIFIER]}(?:\\.${o[i.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${o[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[i.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${o[i.BUILDIDENTIFIER]}(?:\\.${o[i.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${o[i.MAINVERSION]}${o[i.PRERELEASE]}?${o[i.BUILD]}?`),s("FULL",`^${o[i.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${o[i.MAINVERSIONLOOSE]}${o[i.PRERELEASELOOSE]}?${o[i.BUILD]}?`),s("LOOSE",`^${o[i.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${o[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${o[i.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${o[i.XRANGEIDENTIFIER]})`+`(?:\\.(${o[i.XRANGEIDENTIFIER]})`+`(?:\\.(${o[i.XRANGEIDENTIFIER]})`+`(?:${o[i.PRERELEASE]})?${o[i.BUILD]}?`+")?)?"),s("XRANGEPLAINLOOSE",`[v=\\s]*(${o[i.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${o[i.XRANGEIDENTIFIERLOOSE]})`+`(?:${o[i.PRERELEASELOOSE]})?${o[i.BUILD]}?`+")?)?"),s("XRANGE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${o[i.GTLT]}\\s*${o[i.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${r}})`+`(?:\\.(\\d{1,${r}}))?`+`(?:\\.(\\d{1,${r}}))?`+"(?:$|[^\\d])"),s("COERCERTL",o[i.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${o[i.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${o[i.LONETILDE]}${o[i.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${o[i.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${o[i.LONECARET]}${o[i.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${o[i.LONECARET]}${o[i.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${o[i.GTLT]}\\s*(${o[i.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${o[i.GTLT]}\\s*(${o[i.LOOSEPLAIN]}|${o[i.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${o[i.XRANGEPLAIN]})`+"\\s+-\\s+"+`(${o[i.XRANGEPLAIN]})`+"\\s*$"),s("HYPHENRANGELOOSE",`^\\s*(${o[i.XRANGEPLAINLOOSE]})`+"\\s+-\\s+"+`(${o[i.XRANGEPLAINLOOSE]})`+"\\s*$"),s("STAR","(<|>)?=?\\s*\\*")}));k.re,k.src,k.t,k.tildeTrimReplace,k.caretTrimReplace,k.comparatorTrimReplace;const j=/^[0-9]+$/,z=(e,t)=>{const r=j.test(e),n=j.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1};var M={compareIdentifiers:z,rcompareIdentifiers:(e,t)=>z(t,e)};const{MAX_LENGTH:B,MAX_SAFE_INTEGER:G}=_,{re:U,t:X}=k,{compareIdentifiers:V}=M;class W{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof W){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>B)throw new TypeError(`version is longer than ${B} characters`);P("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?U[X.LOOSE]:U[X.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>G||this.major<0)throw new TypeError("Invalid major version");if(this.minor>G||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>G||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<G)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(P("SemVer.compare",this.version,this.options,e),!(e instanceof W)){if("string"==typeof e&&e===this.version)return 0;e=new W(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof W||(e=new W(e,this.options)),V(this.major,e.major)||V(this.minor,e.minor)||V(this.patch,e.patch)}comparePre(e){if(e instanceof W||(e=new W(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(P("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return V(r,n)}while(++t)}compareBuild(e){e instanceof W||(e=new W(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(P("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return V(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var H=W;const{MAX_LENGTH:q}=_,{re:J,t:Y}=k;var Q=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof H)return e;if("string"!=typeof e)return null;if(e.length>q)return null;if(!(t.loose?J[Y.LOOSE]:J[Y.FULL]).test(e))return null;try{return new H(e,t)}catch(e){return null}};var Z=(e,t)=>{const r=Q(e,t);return r?r.version:null};var K=(e,t)=>{const r=Q(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ee=(e,t,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new H(e,r).inc(t,n).version}catch(e){return null}};var te=(e,t,r)=>new H(e,r).compare(new H(t,r));var re=(e,t,r)=>0===te(e,t,r);var ne=(e,t)=>{if(re(e,t))return null;{const r=Q(e),n=Q(t),o=r.prerelease.length||n.prerelease.length,i=o?"pre":"",a=o?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==n[e])return i+e;return a}};var oe=(e,t)=>new H(e,t).major;var ie=(e,t)=>new H(e,t).minor;var ae=(e,t)=>new H(e,t).patch;var se=(e,t)=>{const r=Q(e,t);return r&&r.prerelease.length?r.prerelease:null};var le=(e,t,r)=>te(t,e,r);var ce=(e,t)=>te(e,t,!0);var de=(e,t,r)=>{const n=new H(e,r),o=new H(t,r);return n.compare(o)||n.compareBuild(o)};var pe=(e,t)=>e.sort((e,r)=>de(e,r,t));var fe=(e,t)=>e.sort((e,r)=>de(r,e,t));var ue=(e,t,r)=>te(e,t,r)>0;var he=(e,t,r)=>te(e,t,r)<0;var ve=(e,t,r)=>0!==te(e,t,r);var ge=(e,t,r)=>te(e,t,r)>=0;var me=(e,t,r)=>te(e,t,r)<=0;var Ee=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return re(e,r,n);case"!=":return ve(e,r,n);case">":return ue(e,r,n);case">=":return ge(e,r,n);case"<":return he(e,r,n);case"<=":return me(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};const{re:be,t:ye}=k;var Oe=(e,t)=>{if(e instanceof H)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=be[ye.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),be[ye.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;be[ye.COERCERTL].lastIndex=-1}else r=e.match(be[ye.COERCE]);return null===r?null:Q(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};class we{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof we)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new we(e.raw,t);if(e instanceof Ue)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const r=t?Ae[Ne.HYPHENRANGELOOSE]:Ae[Ne.HYPHENRANGE];e=e.replace(r,ze),P("hyphen replace",e),e=e.replace(Ae[Ne.COMPARATORTRIM],Re),P("comparator trim",e,Ae[Ne.COMPARATORTRIM]),e=(e=(e=e.replace(Ae[Ne.TILDETRIM],$e)).replace(Ae[Ne.CARETTRIM],Le)).split(/\s+/).join(" ");const n=t?Ae[Ne.COMPARATORLOOSE]:Ae[Ne.COMPARATOR];return e.split(" ").map(e=>Se(e,this.options)).join(" ").split(/\s+/).filter(this.options.loose?e=>!!e.match(n):()=>!0).map(e=>new Ue(e,this.options))}intersects(e,t){if(!(e instanceof we))throw new TypeError("a Range is required");return this.set.some(r=>Te(r,t)&&e.set.some(e=>Te(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new H(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(Me(this.set[t],e,this.options))return!0;return!1}}var Ie=we;const{re:Ae,t:Ne,comparatorTrimReplace:Re,tildeTrimReplace:$e,caretTrimReplace:Le}=k,Te=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every(e=>o.intersects(e,t)),o=n.pop();return r},Se=(e,t)=>(P("comp",e,t),e=Fe(e,t),P("caret",e),e=xe(e,t),P("tildes",e),e=Pe(e,t),P("xrange",e),e=je(e,t),P("stars",e),e),Ce=e=>!e||"x"===e.toLowerCase()||"*"===e,xe=(e,t)=>e.trim().split(/\s+/).map(e=>De(e,t)).join(" "),De=(e,t)=>{const r=t.loose?Ae[Ne.TILDELOOSE]:Ae[Ne.TILDE];return e.replace(r,(t,r,n,o,i)=>{let a;return P("tilde",e,t,r,n,o,i),Ce(r)?a="":Ce(n)?a=`>=${r}.0.0 <${+r+1}.0.0`:Ce(o)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0`:i?(P("replaceTilde pr",i),a=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0`):a=`>=${r}.${n}.${o} <${r}.${+n+1}.0`,P("tilde return",a),a})},Fe=(e,t)=>e.trim().split(/\s+/).map(e=>_e(e,t)).join(" "),_e=(e,t)=>{P("caret",e,t);const r=t.loose?Ae[Ne.CARETLOOSE]:Ae[Ne.CARET];return e.replace(r,(t,r,n,o,i)=>{let a;return P("caret",e,t,r,n,o,i),Ce(r)?a="":Ce(n)?a=`>=${r}.0.0 <${+r+1}.0.0`:Ce(o)?a="0"===r?`>=${r}.${n}.0 <${r}.${+n+1}.0`:`>=${r}.${n}.0 <${+r+1}.0.0`:i?(P("replaceCaret pr",i),a="0"===r?"0"===n?`>=${r}.${n}.${o}-${i} <${r}.${n}.${+o+1}`:`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0`:`>=${r}.${n}.${o}-${i} <${+r+1}.0.0`):(P("no pr"),a="0"===r?"0"===n?`>=${r}.${n}.${o} <${r}.${n}.${+o+1}`:`>=${r}.${n}.${o} <${r}.${+n+1}.0`:`>=${r}.${n}.${o} <${+r+1}.0.0`),P("caret return",a),a})},Pe=(e,t)=>(P("replaceXRanges",e,t),e.split(/\s+/).map(e=>ke(e,t)).join(" ")),ke=(e,t)=>{e=e.trim();const r=t.loose?Ae[Ne.XRANGELOOSE]:Ae[Ne.XRANGE];return e.replace(r,(r,n,o,i,a,s)=>{P("xRange",e,r,n,o,i,a,s);const l=Ce(o),c=l||Ce(i),d=c||Ce(a),p=d;return"="===n&&p&&(n=""),s=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&p?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),r=`${n+o}.${i}.${a}${s}`):c?r=`>=${o}.0.0${s} <${+o+1}.0.0${s}`:d&&(r=`>=${o}.${i}.0${s} <${o}.${+i+1}.0${s}`),P("xRange return",r),r})},je=(e,t)=>(P("replaceStars",e,t),e.trim().replace(Ae[Ne.STAR],"")),ze=(e,t,r,n,o,i,a,s,l,c,d,p,f)=>`${t=Ce(r)?"":Ce(n)?`>=${r}.0.0`:Ce(o)?`>=${r}.${n}.0`:`>=${t}`} ${s=Ce(l)?"":Ce(c)?`<${+l+1}.0.0`:Ce(d)?`<${l}.${+c+1}.0`:p?`<=${l}.${c}.${d}-${p}`:`<=${s}`}`.trim(),Me=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(P(e[r].semver),e[r].semver!==Ue.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},Be=Symbol("SemVer ANY");class Ge{static get ANY(){return Be}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Ge){if(e.loose===!!t.loose)return e;e=e.value}P("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Be?this.value="":this.value=this.operator+this.semver.version,P("comp",this)}parse(e){const t=this.options.loose?Xe[Ve.COMPARATORLOOSE]:Xe[Ve.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new H(r[2],this.options.loose):this.semver=Be}toString(){return this.value}test(e){if(P("Comparator.test",e,this.options.loose),this.semver===Be||e===Be)return!0;if("string"==typeof e)try{e=new H(e,this.options)}catch(e){return!1}return Ee(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ge))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new Ie(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new Ie(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,i=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=Ee(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=Ee(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||o&&i||a||s}}var Ue=Ge;const{re:Xe,t:Ve}=k;var We=(e,t,r)=>{try{t=new Ie(t,r)}catch(e){return!1}return t.test(e)};var He=(e,t)=>new Ie(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "));var qe=(e,t,r)=>{let n=null,o=null,i=null;try{i=new Ie(t,r)}catch(e){return null}return e.forEach(e=>{i.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new H(n,r)))}),n};var Je=(e,t,r)=>{let n=null,o=null,i=null;try{i=new Ie(t,r)}catch(e){return null}return e.forEach(e=>{i.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new H(n,r)))}),n};var Ye=(e,t)=>{e=new Ie(e,t);let r=new H("0.0.0");if(e.test(r))return r;if(r=new H("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){e.set[t].forEach(e=>{const t=new H(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!ue(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})}return r&&e.test(r)?r:null};var Qe=(e,t)=>{try{return new Ie(e,t).range||"*"}catch(e){return null}};const{ANY:Ze}=Ue;var Ke=(e,t,r,n)=>{let o,i,a,s,l;switch(e=new H(e,n),t=new Ie(t,n),r){case">":o=ue,i=me,a=he,s=">",l=">=";break;case"<":o=he,i=ge,a=ue,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(We(e,t,n))return!1;for(let r=0;r<t.set.length;++r){const c=t.set[r];let d=null,p=null;if(c.forEach(e=>{e.semver===Ze&&(e=new Ue(">=0.0.0")),d=d||e,p=p||e,o(e.semver,d.semver,n)?d=e:a(e.semver,p.semver,n)&&(p=e)}),d.operator===s||d.operator===l)return!1;if((!p.operator||p.operator===s)&&i(e,p.semver))return!1;if(p.operator===l&&a(e,p.semver))return!1}return!0};var et=(e,t,r)=>Ke(e,t,">",r);var tt=(e,t,r)=>Ke(e,t,"<",r);var rt,nt=(e,t,r)=>(e=new Ie(e,r),t=new Ie(t,r),e.intersects(t)),ot={re:k.re,src:k.src,tokens:k.t,SEMVER_SPEC_VERSION:_.SEMVER_SPEC_VERSION,SemVer:H,compareIdentifiers:M.compareIdentifiers,rcompareIdentifiers:M.rcompareIdentifiers,parse:Q,valid:Z,clean:K,inc:ee,diff:ne,major:oe,minor:ie,patch:ae,prerelease:se,compare:te,rcompare:le,compareLoose:ce,compareBuild:de,sort:pe,rsort:fe,gt:ue,lt:he,eq:re,neq:ve,gte:ge,lte:me,cmp:Ee,coerce:Oe,Comparator:Ue,Range:Ie,satisfies:We,toComparators:He,maxSatisfying:qe,minSatisfying:Je,minVersion:Ye,validRange:Qe,outside:Ke,gtr:et,ltr:tt,intersects:nt}.satisfies,it=F((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t[0],version:t[1]}}})),at=(rt=it)&&rt.__esModule&&Object.prototype.hasOwnProperty.call(rt,"default")?rt.default:rt;const st={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},lt={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},ct={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},style:{bar:{binSpacing:2,fill:"#30a2da",stroke:null}},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},dt={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},pt="Benton Gothic Bold, sans-serif",ft={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},ut={background:"#ffffff",title:{anchor:"start",color:"#000000",font:pt,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:pt,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:pt,titleFontSize:13,titleFontWeight:"normal"},range:{category:ft["category-6"],diverging:ft["fireandice-6"],heatmap:ft["fire-7"],ordinal:ft["fire-7"],ramp:ft["fire-7"]}},ht={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},vt={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},gt={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},mt={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:"Lato"},axisX:{domain:!0,domainColor:"#000000",domainWidth:1,grid:!1,labelFontSize:12,labelFont:"Lato",labelAngle:0,tickColor:"#000000",tickSize:5,titleFontSize:12,titlePadding:10,titleFont:"Lato"},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:"Lato",labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:"Lato",titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:"Lato",symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:"Lato",orient:"right",offset:10},view:{stroke:"transparent"},range:{category:gt["six-groups-cat-1"],diverging:gt["diverging-colors"],heatmap:gt["diverging-colors"],ordinal:gt["six-groups-seq"],ramp:gt["shades-blue"]},area:{fill:"#1696d2"},rect:{fill:"#1696d2"},line:{color:"#1696d2",stroke:"#1696d2",strokeWidth:5},trail:{color:"#1696d2",stroke:"#1696d2",strokeWidth:0,size:1},path:{stroke:"#1696d2",strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:"#1696d2",fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:"#1696d2",stroke:null}},arc:{fill:"#1696d2"},shape:{stroke:"#1696d2"},symbol:{fill:"#1696d2",size:30}},Et={arc:{fill:"#3366CC"},area:{fill:"#3366CC"},path:{stroke:"#3366CC"},rect:{fill:"#3366CC"},shape:{stroke:"#3366CC"},symbol:{stroke:"#3366CC"},circle:{fill:"#3366CC"},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:"Arial, sans-serif",fontSize:12},"guide-title":{font:"Arial, sans-serif",fontSize:12},"group-title":{font:"Arial, sans-serif",fontSize:12}},title:{font:"Arial, sans-serif",fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:"#ccc",tickColor:"#ccc",domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},bt="2.7.1";var yt=Object.freeze({__proto__:null,version:bt,dark:st,excel:lt,fivethirtyeight:ct,ggplot2:dt,latimes:ut,quartz:ht,vox:vt,urbaninstitute:mt,googlecharts:Et}),Ot="#vg-tooltip-element {\n  visibility: hidden;\n  padding: 8px;\n  position: fixed;\n  z-index: 1000;\n  font-family: sans-serif;\n  font-size: 11px;\n  border-radius: 3px;\n  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n  /* The default theme is the light theme. */\n  background-color: rgba(255, 255, 255, 0.95);\n  border: 1px solid #d9d9d9;\n  color: black; }\n  #vg-tooltip-element.visible {\n    visibility: visible; }\n  #vg-tooltip-element h2 {\n    margin-top: 0;\n    margin-bottom: 10px;\n    font-size: 13px; }\n  #vg-tooltip-element table {\n    border-spacing: 0; }\n    #vg-tooltip-element table tr {\n      border: none; }\n      #vg-tooltip-element table tr td {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        padding-top: 2px;\n        padding-bottom: 2px; }\n        #vg-tooltip-element table tr td.key {\n          color: #808080;\n          max-width: 150px;\n          text-align: right;\n          padding-right: 4px; }\n        #vg-tooltip-element table tr td.value {\n          display: block;\n          max-width: 300px;\n          max-height: 7em;\n          text-align: left; }\n  #vg-tooltip-element.dark-theme {\n    background-color: rgba(32, 32, 32, 0.9);\n    border: 1px solid #f5f5f5;\n    color: white; }\n    #vg-tooltip-element.dark-theme td.key {\n      color: #bfbfbf; }\n";const wt="vg-tooltip-element",It={offsetX:10,offsetY:10,id:wt,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};function At(e,t,r){return e.fields=t||[],e.fname=r,e}function Nt(e){throw Error(e)}var Rt=Array.isArray;function $t(e){return e===Object(e)}function Lt(e){return"string"==typeof e}function Tt(e){return Rt(e)?"["+e.map(Tt)+"]":$t(e)||Lt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var St=[];(function(e,t){var r=function(e){var t,r,n,o=[],i=null,a=0,s=e.length,l="";function c(){o.push(l+e.substring(t,r)),l="",t=r+1}for(e+="",t=r=0;r<s;++r)if("\\"===(n=e[r]))l+=e.substring(t,r),l+=e.substring(++r,++r),t=r;else if(n===i)c(),i=null,a=-1;else{if(i)continue;t===a&&'"'===n?(t=r+1,i=n):t===a&&"'"===n?(t=r+1,i=n):"."!==n||a?"["===n?(r>t&&c(),a=t=r+1):"]"===n&&(a||Nt("Access path missing open bracket: "+e),a>0&&c(),a=0,t=r+1):r>t?c():t=r+1}return a&&Nt("Access path missing closing bracket: "+e),i&&Nt("Access path missing closing quote: "+e),r>t&&(r++,c()),o}(e),n="return _["+r.map(Tt).join("][")+"];";At(Function("_",n),[e=1===r.length?r[0]:e],t||e)})("id"),At((function(e){return e}),St,"identity"),At((function(){return 0}),St,"zero"),At((function(){return 1}),St,"one"),At((function(){return!0}),St,"true"),At((function(){return!1}),St,"false");function Ct(...e){return e.reduce((e,t)=>{for(var r in t)if("signals"===r)e.signals=Dt(e.signals,t.signals);else{var n="legend"===r?{layout:1}:"style"===r||null;xt(e,r,t[r],n)}return e},{})}function xt(e,t,r,n){var o,i;if($t(r)&&!Rt(r))for(o in i=$t(e[t])?e[t]:e[t]={},r)n&&(!0===n||n[o])?xt(i,o,r[o]):i[o]=r[o];else e[t]=r}function Dt(e,t){if(null==e)return t;const r={},n=[];function o(e){r[e.name]||(r[e.name]=1,n.push(e))}return t.forEach(o),e.forEach(o),n}var Ft=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};function _t(e,t){return JSON.stringify(e,function(e){const t=[];return function(r,n){if("object"!=typeof n||null===n)return n;const o=t.indexOf(this)+1;return t.length=o,t.length>e?"[Object]":t.indexOf(n)>=0?"[Circular]":(t.push(n),n)}}(t))}class Pt{constructor(e){this.options=Object.assign(Object.assign({},It),e);const t=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Ot.toString().replace(wt,e)}(t);const r=document.head;r.childNodes.length>0?r.insertBefore(e,r.childNodes[0]):r.appendChild(e)}this.el=document.getElementById(t),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",t),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}tooltipHandler(e,t,r,n){if(null==n||""===n)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=function(e,t,r){if(Rt(e))return`[${e.map(e=>t(Lt(e)?e:_t(e,r))).join(", ")}]`;if($t(e)){let n="";const o=e,{title:i}=o,a=Ft(o,["title"]);i&&(n+=`<h2>${t(i)}</h2>`);const s=Object.keys(a);if(s.length>0){n+="<table>";for(const e of s){let o=a[e];void 0!==o&&($t(o)&&(o=_t(o,r)),n+=`<tr><td class="key">${t(e)}:</td><td class="value">${t(o)}</td></tr>`)}n+="</table>"}return n||"{}"}return t(e)}(n,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:i}=function(e,t,r,n){let o=e.clientX+r;o+t.width>window.innerWidth&&(o=+e.clientX-r-t.width);let i=e.clientY+n;return i+t.height>window.innerHeight&&(i=+e.clientY-n-t.height),{x:o,y:i}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${i}px; left: ${o}px`)}}var kt,jt='.vega-embed {\n  position: relative;\n  display: inline-block; }\n  .vega-embed.has-actions {\n    padding-right: 38px; }\n  .vega-embed details:not([open]) > :not(summary) {\n    display: none !important; }\n  .vega-embed summary {\n    list-style: none;\n    position: absolute;\n    top: 0;\n    right: 0;\n    padding: 6px;\n    z-index: 1000;\n    background: white;\n    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n    color: #1b1e23;\n    border: 1px solid #aaa;\n    border-radius: 999px;\n    opacity: 0.2;\n    transition: opacity 0.4s ease-in;\n    outline: none;\n    cursor: pointer;\n    line-height: 0px; }\n    .vega-embed summary::-webkit-details-marker {\n      display: none; }\n    .vega-embed summary:active {\n      box-shadow: #aaa 0px 0px 0px 1px inset; }\n    .vega-embed summary svg {\n      width: 14px;\n      height: 14px; }\n  .vega-embed details[open] summary {\n    opacity: 0.7; }\n  .vega-embed:hover summary,\n  .vega-embed:focus summary {\n    opacity: 1 !important;\n    transition: opacity 0.2s ease; }\n  .vega-embed .vega-actions {\n    position: absolute;\n    z-index: 1001;\n    top: 35px;\n    right: -9px;\n    display: flex;\n    flex-direction: column;\n    padding-bottom: 8px;\n    padding-top: 8px;\n    border-radius: 4px;\n    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n    border: 1px solid #d9d9d9;\n    background: white;\n    animation-duration: 0.15s;\n    animation-name: scale-in;\n    animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n    text-align: left; }\n    .vega-embed .vega-actions a {\n      padding: 8px 16px;\n      font-family: sans-serif;\n      font-size: 14px;\n      font-weight: 600;\n      white-space: nowrap;\n      color: #434a56;\n      text-decoration: none; }\n      .vega-embed .vega-actions a:hover {\n        background-color: #f7f7f9;\n        color: black; }\n    .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n      content: "";\n      display: inline-block;\n      position: absolute; }\n    .vega-embed .vega-actions::before {\n      left: auto;\n      right: 14px;\n      top: -16px;\n      border: 8px solid #0000;\n      border-bottom-color: #d9d9d9; }\n    .vega-embed .vega-actions::after {\n      left: auto;\n      right: 15px;\n      top: -14px;\n      border: 7px solid #0000;\n      border-bottom-color: #fff; }\n\n.vega-embed-wrapper {\n  max-width: 100%;\n  overflow: scroll;\n  padding-right: 14px; }\n\n@keyframes scale-in {\n  from {\n    opacity: 0;\n    transform: scale(0.6); }\n  to {\n    opacity: 1;\n    transform: scale(1); } }\n';function zt(e,...t){for(const r of t)Mt(e,r);return e}function Mt(t,r){for(const n of Object.keys(r))e.writeConfig(t,n,r[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});const Bt=e;let Gt=t;const Ut="undefined"!=typeof window?window:void 0;void 0===Gt&&(null===(kt=null==Ut?void 0:Ut.vl)||void 0===kt?void 0:kt.compile)&&(Gt=Ut.vl);const Xt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Vt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Wt={vega:"Vega","vega-lite":"Vega-Lite"},Ht={vega:Bt.version,"vega-lite":Gt?Gt.version:"not available"},qt={vega:e=>e,"vega-lite":(e,t)=>Gt.compile(e,{config:t}).spec};function Jt(e,t,r,n){const o=`<html><head>${t}</head><body><pre><code class="json">`,i=`</code></pre>${r}</body></html>`,a=window.open("");a.document.write(o+e+i),a.document.title=`${Wt[n]} JSON Source`}function Yt(e,t,r={}){var o,i,a;return n(this,void 0,void 0,(function*(){const s=(l=r.loader)&&"load"in l?r.loader:Bt.loader(r.loader);var l;const c=Lt(t)?JSON.parse(yield s.load(t)):t,d=yield Qt(null!==(o=c.usermeta&&c.usermeta.embedOptions)&&void 0!==o?o:{},s),p=yield Qt(r,s),f=Object.assign(Object.assign({},zt(p,d)),{config:Ct(null!==(i=p.config)&&void 0!==i?i:{},null!==(a=d.config)&&void 0!==a?a:{})});return yield function(e,t,r={},o){var i,a,s,l,c,d;return n(this,void 0,void 0,(function*(){const p=r.theme?Ct(yt[r.theme],null!==(i=r.config)&&void 0!==i?i:{}):r.config,f="boolean"==typeof r.actions?r.actions:zt({},Xt,null!==(a=r.actions)&&void 0!==a?a:{});const u=Object.assign(Object.assign({},Vt),r.i18n),h=null!==(s=r.renderer)&&void 0!==s?s:"canvas",v=null!==(l=r.logLevel)&&void 0!==l?l:Bt.Warn,g=null!==(c=r.downloadFileName)&&void 0!==c?c:"visualization";if(!1!==r.defaultStyle){const e="vega-embed-style";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===r.defaultStyle||!0===r.defaultStyle?jt.toString():r.defaultStyle,document.head.appendChild(t)}}const m=function(e,t){var r;if(e.$schema){const n=at(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Wt[n.library]}, but mode argument sets ${null!==(r=Wt[t])&&void 0!==r?r:t}.`);const o=n.library;return ot(Ht[o],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Wt[o]} ${n.version}, but the current version of ${Wt[o]} is v${Ht[o]}.`),o}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}(t,r.mode);let E=qt[m](t,p);if("vega-lite"===m&&E.$schema){const e=at(E.$schema);ot(Ht.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${Ht.vega}.`)}const b="string"==typeof e?document.querySelector(e):e;if(!b)throw Error(`${e} does not exist`);b.classList.add("vega-embed"),f&&b.classList.add("has-actions"),b.innerHTML="";const y=r.patch;y&&(E=y instanceof Function?y(E):O(E,y,!0,!1).newDocument),r.formatLocale&&Bt.formatLocale(r.formatLocale),r.timeFormatLocale&&Bt.timeFormatLocale(r.timeFormatLocale);const w=Bt.parse(E,"vega-lite"===m?{}:p),I=new Bt.View(w,{loader:o,logLevel:v,renderer:h});if(!1!==r.tooltip){let e;e="function"==typeof r.tooltip?r.tooltip:new Pt(!0===r.tooltip?{}:r.tooltip).call,I.tooltip(e)}let A,{hover:N}=r;if(void 0===N&&(N="vega"===m),N){const{hoverSet:e,updateSet:t}="boolean"==typeof N?{}:N;I.hover(e,t)}if(r&&(r.width&&I.width(r.width),r.height&&I.height(r.height),r.padding&&I.padding(r.padding)),yield I.initialize(e).runAsync(),!1!==f){let e=b;if(!1!==r.defaultStyle){const t=document.createElement("details");t.title=u.CLICK_TO_VIEW_ACTIONS,b.append(t),e=t;const r=document.createElement("summary");r.innerHTML='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n  <circle r="2" cy="8" cx="2"></circle>\n  <circle r="2" cy="8" cx="8"></circle>\n  <circle r="2" cy="8" cx="14"></circle>\n</svg>',t.append(r),A=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",A)}const o=document.createElement("div");if(e.append(o),o.classList.add("vega-actions"),!0===f||!1!==f.export)for(const e of["svg","png"])if(!0===f||!0===f.export||f.export[e]){const t=u[`${e.toUpperCase()}_ACTION`],i=document.createElement("a");i.text=t,i.href="#",i.target="_blank",i.download=`${g}.${e}`,i.addEventListener("mousedown",(function(t){return n(this,void 0,void 0,(function*(){t.preventDefault();const n=yield I.toImageURL(e,r.scaleFactor);this.href=n}))})),o.append(i)}if(!0===f||!1!==f.source){const e=document.createElement("a");e.text=u.SOURCE_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var n,o;Jt(D(t),null!==(n=r.sourceHeader)&&void 0!==n?n:"",null!==(o=r.sourceFooter)&&void 0!==o?o:"",m),e.preventDefault()})),o.append(e)}if("vega-lite"===m&&(!0===f||!1!==f.compiled)){const e=document.createElement("a");e.text=u.COMPILED_ACTION,e.href="#",e.addEventListener("mousedown",(function(e){var t,n;Jt(D(E),null!==(t=r.sourceHeader)&&void 0!==t?t:"",null!==(n=r.sourceFooter)&&void 0!==n?n:"","vega"),e.preventDefault()})),o.append(e)}if(!0===f||!1!==f.editor){const e=null!==(d=r.editorUrl)&&void 0!==d?d:"https://vega.github.io/editor/",n=document.createElement("a");n.text=u.EDITOR_ACTION,n.href="#",n.addEventListener("mousedown",(function(r){!function(e,t,r){const n=e.open(t);let o=40;e.addEventListener("message",(function t(r){r.source===n&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(n.postMessage(r,"*"),setTimeout(e,250),o-=1)}),250)}(window,e,{config:p,mode:m,renderer:h,spec:D(t)}),r.preventDefault()})),o.append(n)}}return{view:I,spec:t,vgSpec:E,finalize:function(){A&&document.removeEventListener("click",A),I.finalize()}}}))}(e,c,f,s)}))}function Qt(e,t){var r;return n(this,void 0,void 0,(function*(){const n=Lt(e.config)?JSON.parse(yield t.load(e.config)):null!==(r=e.config)&&void 0!==r?r:{},o=Lt(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),o?{patch:o}:{}),n?{config:n}:{})}))}function Zt(e,t={}){var r;return n(this,void 0,void 0,(function*(){const n=document.createElement("div");n.classList.add("vega-embed-wrapper");const o=document.createElement("div");n.appendChild(o);const i=!0===t.actions||!1===t.actions?t.actions:Object.assign({export:!0,source:!1,compiled:!0,editor:!0},null!==(r=t.actions)&&void 0!==r?r:{}),a=yield Yt(o,e,Object.assign({actions:i},null!=t?t:{}));return n.value=a.view,n}))}const Kt=(...t)=>{return t.length>1&&(e.isString(t[0])&&!((r=t[0]).startsWith("http://")||r.startsWith("https://")||r.startsWith("//"))||t[0]instanceof HTMLElement||3===t.length)?Yt(t[0],t[1],t[2]):Zt(t[0],t[1]);var r};return Kt.vegaLite=Gt,Kt.vl=Gt,Kt.container=Zt,Kt.embed=Yt,Kt.vega=Bt,Kt.default=Yt,Kt.version=r,Kt}));
diff --git a/javascript/vega-lite@4.7.0 b/javascript/vega-lite@4.7.0
deleted file mode 100644
--- a/javascript/vega-lite@4.7.0
+++ /dev/null
@@ -1,15 +0,0 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).vegaLite={})}(this,(function(e){"use strict";var t="4.7.0";function n(e,t,n){return e.fields=t||[],e.fname=n,e}function i(e){throw Error(e)}function r(e){var t,n,r,o=[],a=null,s=0,u=e.length,c="";function l(){o.push(c+e.substring(t,n)),c="",t=n+1}for(e+="",t=n=0;n<u;++n)if("\\"===(r=e[n]))c+=e.substring(t,n),c+=e.substring(++n,++n),t=n;else if(r===a)l(),a=null,s=-1;else{if(a)continue;t===s&&'"'===r||t===s&&"'"===r?(t=n+1,a=r):"."!==r||s?"["===r?(n>t&&l(),s=t=n+1):"]"===r&&(s||i("Access path missing open bracket: "+e),s>0&&l(),s=0,t=n+1):n>t?l():t=n+1}return s&&i("Access path missing closing bracket: "+e),a&&i("Access path missing closing quote: "+e),n>t&&(n++,l()),o}var o=Array.isArray;function a(e){return e===Object(e)}function s(e){return"string"==typeof e}function u(e){return o(e)?"["+e.map(u)+"]":a(e)||s(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var c=[],l=(function(e,t){var i=r(e),o="return _["+i.map(u).join("][")+"];";n(Function("_",o),[e=1===i.length?i[0]:e],t||e)}("id"),n((function(e){return e}),c,"identity"));n((function(){return 0}),c,"zero"),n((function(){return 1}),c,"one"),n((function(){return!0}),c,"true"),n((function(){return!1}),c,"false");function f(e,t,n){var i=[t].concat([].slice.call(n));console[e].apply(console,i)}function d(...e){return e.reduce((e,t)=>{for(var n in t)if("signals"===n)e.signals=p(e.signals,t.signals);else{var i="legend"===n?{layout:1}:"style"===n||null;g(e,n,t[n],i)}return e},{})}function g(e,t,n,i){var r,s;if(a(n)&&!o(n))for(r in s=a(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[r])?g(s,r,n[r]):s[r]=n[r];else e[t]=n}function p(e,t){if(null==e)return t;const n={},i=[];function r(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(r),e.forEach(r),i}function h(e){return null!=e?o(e)?e:[e]:[]}const m=Object.prototype.hasOwnProperty;function b(e,t){return m.call(e,t)}function v(e){return"boolean"==typeof e}function y(e){return"number"==typeof e}function x(e){for(var t={},n=0,i=e.length;n<i;++n)t[e[n]]=!0;return t}
-/*! *****************************************************************************
-    Copyright (c) Microsoft Corporation. All rights reserved.
-    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-    this file except in compliance with the License. You may obtain a copy of the
-    License at http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-    MERCHANTABLITY OR NON-INFRINGEMENT.
-
-    See the Apache Version 2.0 License for specific language governing permissions
-    and limitations under the License.
-    ***************************************************************************** */function w(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}const A="log",O="continuous";function C(e,t,n){return e.fields=t||[],e.fname=n,e}function F(e){throw Error(e)}var D=Array.isArray;function j(e){return D(e)?"["+e.map(j)+"]":(t=e)===Object(t)||function(e){return"string"==typeof e}(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e;var t}var k=[];(function(e,t){var n=function(e){var t,n,i,r=[],o=null,a=0,s=e.length,u="";function c(){r.push(u+e.substring(t,n)),u="",t=n+1}for(e+="",t=n=0;n<s;++n)if("\\"===(i=e[n]))u+=e.substring(t,n),u+=e.substring(++n,++n),t=n;else if(i===o)c(),o=null,a=-1;else{if(o)continue;t===a&&'"'===i||t===a&&"'"===i?(t=n+1,o=i):"."!==i||a?"["===i?(n>t&&c(),a=t=n+1):"]"===i&&(a||F("Access path missing open bracket: "+e),a>0&&c(),a=0,t=n+1):n>t?c():t=n+1}return a&&F("Access path missing closing bracket: "+e),o&&F("Access path missing closing quote: "+e),n>t&&(n++,c()),r}(e),i="return _["+n.map(j).join("][")+"];";C(Function("_",i),[e=1===n.length?n[0]:e],t||e)})("id"),C((function(e){return e}),k,"identity"),C((function(){return 0}),k,"zero"),C((function(){return 1}),k,"one"),C((function(){return!0}),k,"true"),C((function(){return!1}),k,"false");const E=Object.prototype.hasOwnProperty;function S(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $(e){var t;return 1===e.length&&(t=e,e=function(e,n){return S(t(e),n)}),{left:function(t,n,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i<r;){var o=i+r>>>1;e(t[o],n)<0?i=o+1:r=o}return i},right:function(t,n,i,r){for(null==i&&(i=0),null==r&&(r=t.length);i<r;){var o=i+r>>>1;e(t[o],n)>0?r=o:i=o+1}return i}}}var N=$(S).right;var M=Math.sqrt(50),B=Math.sqrt(10),_=Math.sqrt(2);function T(e,t,n){var i,r,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((i=t<e)&&(r=e,e=t,t=r),0===(a=z(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(r=Math.ceil(t-e+1));++s<r;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(r=Math.ceil(e-t+1));++s<r;)o[s]=(e-s)/a;return i&&o.reverse(),o}function z(e,t,n){var i=(t-e)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r);return r>=0?(o>=M?10:o>=B?5:o>=_?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=M?10:o>=B?5:o>=_?2:1)}function U(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=M?r*=10:o>=B?r*=5:o>=_&&(r*=2),t<e?-r:r}function P(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function L(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function R(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function q(e,t,n){if(i=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(i=+i)>=i&&(yield i)}}(e,n))).length){if((t=+t)<=0||i<2)return L(e);if(t>=1)return P(e);var i,r=(i-1)*t,o=Math.floor(r),a=P(function e(t,n,i=0,r=t.length-1,o=S){for(;r>i;){if(r-i>600){const a=r-i+1,s=n-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);e(t,n,Math.max(i,Math.floor(n-s*c/a+l)),Math.min(r,Math.floor(n+(a-s)*c/a+l)),o)}const a=t[n];let s=i,u=r;for(R(t,i,n),o(t[r],a)>0&&R(t,i,r);s<u;){for(R(t,s,u),++s,--u;o(t[s],a)<0;)++s;for(;o(t[u],a)>0;)--u}0===o(t[i],a)?R(t,i,u):(++u,R(t,u,r)),u<=n&&(i=u+1),n<=u&&(r=u-1)}return t}(e,o).subarray(0,o+1));return a+(L(e.subarray(o+1))-a)*(r-o)}}function I(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function W(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const H=Symbol("implicit");function G(){var e=new Map,t=[],n=[],i=H;function r(r){var o=r+"",a=e.get(o);if(!a){if(i!==H)return i;e.set(o,a=t.push(r))}return n[(a-1)%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Map;for(const i of n){const n=i+"";e.has(n)||e.set(n,t.push(i))}return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return G(t,n).unknown(i)},I.apply(r,arguments),r}function Y(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function V(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function X(){}var J="\\s*([+-]?\\d+)\\s*",Q="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Z="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K=/^#([0-9a-f]{3,8})$/,ee=new RegExp("^rgb\\("+[J,J,J]+"\\)$"),te=new RegExp("^rgb\\("+[Z,Z,Z]+"\\)$"),ne=new RegExp("^rgba\\("+[J,J,J,Q]+"\\)$"),ie=new RegExp("^rgba\\("+[Z,Z,Z,Q]+"\\)$"),re=new RegExp("^hsl\\("+[Q,Z,Z]+"\\)$"),oe=new RegExp("^hsla\\("+[Q,Z,Z,Q]+"\\)$"),ae={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 se(){return this.rgb().formatHex()}function ue(){return this.rgb().formatRgb()}function ce(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=K.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?le(t):3===n?new pe(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?new pe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?new pe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ee.exec(e))?new pe(t[1],t[2],t[3],1):(t=te.exec(e))?new pe(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ne.exec(e))?fe(t[1],t[2],t[3],t[4]):(t=ie.exec(e))?fe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=re.exec(e))?ve(t[1],t[2]/100,t[3]/100,1):(t=oe.exec(e))?ve(t[1],t[2]/100,t[3]/100,t[4]):ae.hasOwnProperty(e)?le(ae[e]):"transparent"===e?new pe(NaN,NaN,NaN,0):null}function le(e){return new pe(e>>16&255,e>>8&255,255&e,1)}function fe(e,t,n,i){return i<=0&&(e=t=n=NaN),new pe(e,t,n,i)}function de(e){return e instanceof X||(e=ce(e)),e?new pe((e=e.rgb()).r,e.g,e.b,e.opacity):new pe}function ge(e,t,n,i){return 1===arguments.length?de(e):new pe(e,t,n,null==i?1:i)}function pe(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function he(){return"#"+be(this.r)+be(this.g)+be(this.b)}function me(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function be(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function ve(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new we(e,t,n,i)}function ye(e){if(e instanceof we)return new we(e.h,e.s,e.l,e.opacity);if(e instanceof X||(e=ce(e)),!e)return new we;if(e instanceof we)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,u=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=u<.5?o+r:2-o-r,a*=60):s=u>0&&u<1?0:a,new we(a,s,u,e.opacity)}function xe(e,t,n,i){return 1===arguments.length?ye(e):new we(e,t,n,null==i?1:i)}function we(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Ae(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Y(X,ce,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:se,formatHex:se,formatHsl:function(){return ye(this).formatHsl()},formatRgb:ue,toString:ue}),Y(pe,ge,V(X,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:he,formatHex:he,formatRgb:me,toString:me})),Y(we,xe,V(X,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new we(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new we(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new pe(Ae(e>=240?e-240:e+120,r,i),Ae(e,r,i),Ae(e<120?e+240:e-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Oe=Math.PI/180,Ce=180/Math.PI,Fe=6/29,De=3*Fe*Fe;function je(e){if(e instanceof Ee)return new Ee(e.l,e.a,e.b,e.opacity);if(e instanceof Te)return ze(e);e instanceof pe||(e=de(e));var t,n,i=Me(e.r),r=Me(e.g),o=Me(e.b),a=Se((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=Se((.4360747*i+.3850649*r+.1430804*o)/.96422),n=Se((.0139322*i+.0971045*r+.7141733*o)/.82521)),new Ee(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ke(e,t,n,i){return 1===arguments.length?je(e):new Ee(e,t,n,null==i?1:i)}function Ee(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Se(e){return e>.008856451679035631?Math.pow(e,1/3):e/De+4/29}function $e(e){return e>Fe?e*e*e:De*(e-4/29)}function Ne(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Me(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Be(e){if(e instanceof Te)return new Te(e.h,e.c,e.l,e.opacity);if(e instanceof Ee||(e=je(e)),0===e.a&&0===e.b)return new Te(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ce;return new Te(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _e(e,t,n,i){return 1===arguments.length?Be(e):new Te(e,t,n,null==i?1:i)}function Te(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function ze(e){if(isNaN(e.h))return new Ee(e.l,0,0,e.opacity);var t=e.h*Oe;return new Ee(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Y(Ee,ke,V(X,{brighter:function(e){return new Ee(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Ee(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pe(Ne(3.1338561*(t=.96422*$e(t))-1.6168667*(e=1*$e(e))-.4906146*(n=.82521*$e(n))),Ne(-.9787684*t+1.9161415*e+.033454*n),Ne(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Y(Te,_e,V(X,{brighter:function(e){return new Te(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Te(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return ze(this).rgb()}}));var Ue=-.14861,Pe=1.78277,Le=-.29227,Re=-.90649,qe=1.97294,Ie=qe*Re,We=qe*Pe,He=Pe*Le-Re*Ue;function Ge(e){if(e instanceof Ve)return new Ve(e.h,e.s,e.l,e.opacity);e instanceof pe||(e=de(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(He*i+Ie*t-We*n)/(He+Ie-We),o=i-r,a=(qe*(n-r)-Le*o)/Re,s=Math.sqrt(a*a+o*o)/(qe*r*(1-r)),u=s?Math.atan2(a,o)*Ce-120:NaN;return new Ve(u<0?u+360:u,s,r,e.opacity)}function Ye(e,t,n,i){return 1===arguments.length?Ge(e):new Ve(e,t,n,null==i?1:i)}function Ve(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Xe(e,t,n,i,r){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*i+a*r)/6}function Je(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],o=e[i+1],a=i>0?e[i-1]:2*r-o,s=i<t-1?e[i+2]:2*o-r;return Xe((n-i/t)*t,a,r,o,s)}}function Qe(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],o=e[i%t],a=e[(i+1)%t],s=e[(i+2)%t];return Xe((n-i/t)*t,r,o,a,s)}}function Ze(e){return function(){return e}}function Ke(e,t){return function(n){return e+n*t}}function et(e,t){var n=t-e;return n?Ke(e,n>180||n<-180?n-360*Math.round(n/360):n):Ze(isNaN(e)?t:e)}function tt(e){return 1==(e=+e)?nt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Ze(isNaN(t)?n:t)}}function nt(e,t){var n=t-e;return n?Ke(e,n):Ze(isNaN(e)?t:e)}Y(Ve,Ye,V(X,{brighter:function(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Ve(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ve(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*Oe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new pe(255*(t+n*(Ue*i+Pe*r)),255*(t+n*(Le*i+Re*r)),255*(t+n*(qe*i)),this.opacity)}}));var it=function e(t){var n=tt(t);function i(e,t){var i=n((e=ge(e)).r,(t=ge(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=nt(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function rt(e){return function(t){var n,i,r=t.length,o=new Array(r),a=new Array(r),s=new Array(r);for(n=0;n<r;++n)i=ge(t[n]),o[n]=i.r||0,a[n]=i.g||0,s[n]=i.b||0;return o=e(o),a=e(a),s=e(s),i.opacity=1,function(e){return i.r=o(e),i.g=a(e),i.b=s(e),i+""}}}var ot=rt(Je),at=rt(Qe);function st(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function ut(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ct(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=mt(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function lt(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function ft(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dt(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=mt(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var gt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pt=new RegExp(gt.source,"g");function ht(e,t){var n,i,r,o=gt.lastIndex=pt.lastIndex=0,a=-1,s=[],u=[];for(e+="",t+="";(n=gt.exec(e))&&(i=pt.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:ft(n,i)})),o=pt.lastIndex;return o<t.length&&(r=t.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var n,i=0;i<t;++i)s[(n=u[i]).i]=n.x(e);return s.join("")})}function mt(e,t){var n,i=typeof t;return null==t||"boolean"===i?Ze(t):("number"===i?ft:"string"===i?(n=ce(t))?(t=n,it):ht:t instanceof ce?it:t instanceof Date?lt:ut(t)?st:Array.isArray(t)?ct:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?dt:ft)(e,t)}function bt(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var vt,yt,xt,wt,At=180/Math.PI,Ot={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ct(e,t,n,i,r,o){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,u/=s),e*i<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:r,translateY:o,rotate:Math.atan2(t,e)*At,skewX:Math.atan(u)*At,scaleX:a,scaleY:s}}function Ft(e,t,n,i){function r(e){return e.length?e.pop()+" ":""}return function(o,a){var s=[],u=[];return o=e(o),a=e(a),function(e,i,r,o,a,s){if(e!==r||i!==o){var u=a.push("translate(",null,t,null,n);s.push({i:u-4,x:ft(e,r)},{i:u-2,x:ft(i,o)})}else(r||o)&&a.push("translate("+r+t+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(e,t,n,o){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ft(e,t)})):t&&n.push(r(n)+"rotate("+t+i)}(o.rotate,a.rotate,s,u),function(e,t,n,o){e!==t?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ft(e,t)}):t&&n.push(r(n)+"skewX("+t+i)}(o.skewX,a.skewX,s,u),function(e,t,n,i,o,a){if(e!==n||t!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:ft(e,n)},{i:s-2,x:ft(t,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(e){for(var t,n=-1,i=u.length;++n<i;)s[(t=u[n]).i]=t.x(e);return s.join("")}}}var Dt=Ft((function(e){return"none"===e?Ot:(vt||(vt=document.createElement("DIV"),yt=document.documentElement,xt=document.defaultView),vt.style.transform=e,e=xt.getComputedStyle(yt.appendChild(vt),null).getPropertyValue("transform"),yt.removeChild(vt),Ct(+(e=e.slice(7,-1).split(","))[0],+e[1],+e[2],+e[3],+e[4],+e[5]))}),"px, ","px)","deg)"),jt=Ft((function(e){return null==e?Ot:(wt||(wt=document.createElementNS("http://www.w3.org/2000/svg","g")),wt.setAttribute("transform",e),(e=wt.transform.baseVal.consolidate())?Ct((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Ot)}),", ",")",")"),kt=Math.SQRT2;function Et(e){return((e=Math.exp(e))+1/e)/2}function St(e){return function(t,n){var i=e((t=xe(t)).h,(n=xe(n)).h),r=nt(t.s,n.s),o=nt(t.l,n.l),a=nt(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=o(e),t.opacity=a(e),t+""}}}var $t=St(et),Nt=St(nt);function Mt(e){return function(t,n){var i=e((t=_e(t)).h,(n=_e(n)).h),r=nt(t.c,n.c),o=nt(t.l,n.l),a=nt(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=o(e),t.opacity=a(e),t+""}}}var Bt=Mt(et),_t=Mt(nt);function Tt(e){return function t(n){function i(t,i){var r=e((t=Ye(t)).h,(i=Ye(i)).h),o=nt(t.s,i.s),a=nt(t.l,i.l),s=nt(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,i.gamma=t,i}(1)}var zt=Tt(et),Ut=Tt(nt);function Pt(e,t){for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return o[t](e-t)}}var Lt=Object.freeze({__proto__:null,interpolate:mt,interpolateArray:function(e,t){return(ut(t)?st:ct)(e,t)},interpolateBasis:Je,interpolateBasisClosed:Qe,interpolateDate:lt,interpolateDiscrete:function(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}},interpolateHue:function(e,t){var n=et(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}},interpolateNumber:ft,interpolateNumberArray:st,interpolateObject:dt,interpolateRound:bt,interpolateString:ht,interpolateTransformCss:Dt,interpolateTransformSvg:jt,interpolateZoom:function(e,t){var n,i,r=e[0],o=e[1],a=e[2],s=t[0],u=t[1],c=t[2],l=s-r,f=u-o,d=l*l+f*f;if(d<1e-12)i=Math.log(c/a)/kt,n=function(e){return[r+e*l,o+e*f,a*Math.exp(kt*e*i)]};else{var g=Math.sqrt(d),p=(c*c-a*a+4*d)/(2*a*2*g),h=(c*c-a*a-4*d)/(2*c*2*g),m=Math.log(Math.sqrt(p*p+1)-p),b=Math.log(Math.sqrt(h*h+1)-h);i=(b-m)/kt,n=function(e){var t,n=e*i,s=Et(m),u=a/(2*g)*(s*(t=kt*n+m,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(m));return[r+u*l,o+u*f,a*s/Et(kt*n+m)]}}return n.duration=1e3*i,n},interpolateRgb:it,interpolateRgbBasis:ot,interpolateRgbBasisClosed:at,interpolateHsl:$t,interpolateHslLong:Nt,interpolateLab:function(e,t){var n=nt((e=ke(e)).l,(t=ke(t)).l),i=nt(e.a,t.a),r=nt(e.b,t.b),o=nt(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=o(t),e+""}},interpolateHcl:Bt,interpolateHclLong:_t,interpolateCubehelix:zt,interpolateCubehelixLong:Ut,piecewise:Pt,quantize:function(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}});function Rt(e){return+e}var qt=[0,1];function It(e){return e}function Wt(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Ht(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=Wt(r,i),o=n(a,o)):(i=Wt(i,r),o=n(o,a)),function(e){return o(i(e))}}function Gt(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Wt(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=N(e,t,1,i)-1;return o[n](r[n](t))}}function Yt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Vt(){var e,t,n,i,r,o,a=qt,s=qt,u=mt,c=It;function l(){var e,t,n,u=Math.min(a.length,s.length);return c!==It&&(e=a[0],t=a[u-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),i=u>2?Gt:Ht,r=o=null,f}function f(t){return isNaN(t=+t)?n:(r||(r=i(a.map(e),s,u)))(e(c(t)))}return f.invert=function(n){return c(t((o||(o=i(s,a.map(e),ft)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,Rt),l()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),l()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=bt,l()},f.clamp=function(e){return arguments.length?(c=!!e||It,l()):c!==It},f.interpolate=function(e){return arguments.length?(u=e,l()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,i){return e=n,t=i,l()}}function Xt(){return Vt()(It,It)}function Jt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Qt(e){return(e=Jt(Math.abs(e)))?e[1]:NaN}var Zt,Kt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function en(e){if(!(t=Kt.exec(e)))throw new Error("invalid format: "+e);var t;return new tn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function nn(e,t){var n=Jt(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}en.prototype=tn.prototype,tn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var rn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return nn(100*e,t)},r:nn,s:function(e,t){var n=Jt(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(Zt=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Jt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function on(e){return e}var an,sn,un,cn=Array.prototype.map,ln=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fn(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?on:(t=cn.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],u=0;r>0&&s>0&&(u+s+1>i&&(s=Math.max(1,i-u)),o.push(e.substring(r-=s,r+s)),!((u+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?on:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(cn.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"-":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=en(e)).fill,n=e.align,f=e.sign,d=e.symbol,g=e.zero,p=e.width,h=e.comma,m=e.precision,b=e.trim,v=e.type;"n"===v?(h=!0,v="g"):rn[v]||(void 0===m&&(m=12),b=!0,v="g"),(g||"0"===t&&"="===n)&&(g=!0,t="0",n="=");var y="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?u:"",w=rn[v],A=/[defgprs%]/.test(v);function O(e){var r,o,u,d=y,O=x;if("c"===v)O=w(e)+O,e="";else{var C=(e=+e)<0;if(e=isNaN(e)?l:w(Math.abs(e),m),b&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),C&&0==+e&&(C=!1),d=(C?"("===f?f:c:"-"===f||"("===f?"":f)+d,O=("s"===v?ln[8+Zt/3]:"")+O+(C&&"("===f?")":""),A)for(r=-1,o=e.length;++r<o;)if(48>(u=e.charCodeAt(r))||u>57){O=(46===u?a+e.slice(r+1):e.slice(r))+O,e=e.slice(0,r);break}}h&&!g&&(e=i(e,1/0));var F=d.length+e.length+O.length,D=F<p?new Array(p-F+1).join(t):"";switch(h&&g&&(e=i(D+e,D.length?p-O.length:1/0),D=""),n){case"<":e=d+e+O+D;break;case"=":e=d+D+e+O;break;case"^":e=D.slice(0,F=D.length>>1)+d+e+O+D.slice(F);break;default:e=D+d+e+O}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return e+""},O}return{format:f,formatPrefix:function(e,t){var n=f(((e=en(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Qt(t)/3))),r=Math.pow(10,-i),o=ln[8+i/3];return function(e){return n(r*e)+o}}}}function dn(e,t,n,i){var r,o=U(e,t,n);switch((i=en(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Qt(t)/3)))-Qt(Math.abs(e)))}(o,a))||(i.precision=r),un(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Qt(t)-Qt(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-Qt(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return sn(i)}function gn(e){var t=e.domain;return e.ticks=function(e){var n=t();return T(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return dn(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r=t(),o=0,a=r.length-1,s=r[o],u=r[a];return u<s&&(i=s,s=u,u=i,i=o,o=a,a=i),(i=z(s,u,n))>0?i=z(s=Math.floor(s/i)*i,u=Math.ceil(u/i)*i,n):i<0&&(i=z(s=Math.ceil(s*i)/i,u=Math.floor(u*i)/i,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(u/i)*i,t(r)):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(u*i)/i,t(r)),e},e}function pn(e,t){var n,i=0,r=(e=e.slice()).length-1,o=e[i],a=e[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),e[i]=t.floor(o),e[r]=t.ceil(a),e}function hn(e){return Math.log(e)}function mn(e){return Math.exp(e)}function bn(e){return-Math.log(-e)}function vn(e){return-Math.exp(-e)}function yn(e){return isFinite(e)?+("1e"+e):e<0?0:e}function xn(e){return function(t){return-e(-t)}}function wn(e){var t,n,i=e(hn,mn),r=i.domain,o=10;function a(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(o),n=function(e){return 10===e?yn:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(o),r()[0]<0?(t=xn(t),n=xn(n),e(bn,vn)):e(hn,mn),i}return i.base=function(e){return arguments.length?(o=+e,a()):o},i.domain=function(e){return arguments.length?(r(e),a()):r()},i.ticks=function(e){var i,a=r(),s=a[0],u=a[a.length-1];(i=u<s)&&(d=s,s=u,u=d);var c,l,f,d=t(s),g=t(u),p=null==e?10:+e,h=[];if(!(o%1)&&g-d<p){if(d=Math.floor(d),g=Math.ceil(g),s>0){for(;d<=g;++d)for(l=1,c=n(d);l<o;++l)if(!((f=c*l)<s)){if(f>u)break;h.push(f)}}else for(;d<=g;++d)for(l=o-1,c=n(d);l>=1;--l)if(!((f=c*l)<s)){if(f>u)break;h.push(f)}2*h.length<p&&(h=T(s,u,p))}else h=T(d,g,Math.min(g-d,p)).map(n);return i?h.reverse():h},i.tickFormat=function(e,r){if(null==r&&(r=10===o?".0e":","),"function"!=typeof r&&(r=sn(r)),e===1/0)return r;null==e&&(e=10);var a=Math.max(1,o*e/i.ticks().length);return function(e){var i=e/n(Math.round(t(e)));return i*o<o-.5&&(i*=o),i<=a?r(e):""}},i.nice=function(){return r(pn(r(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},i}function An(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function On(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Cn(e){var t=1,n=e(An(t),On(t));return n.constant=function(n){return arguments.length?e(An(t=+n),On(t)):t},gn(n)}function Fn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Dn(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jn(e){return e<0?-e*e:e*e}function kn(e){var t=e(It,It),n=1;function i(){return 1===n?e(It,It):.5===n?e(Dn,jn):e(Fn(n),Fn(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,i()):n},gn(t)}function En(){var e=kn(Vt());return e.copy=function(){return Yt(e,En()).exponent(e.exponent())},I.apply(e,arguments),e}an=fn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),sn=an.format,un=an.formatPrefix;var Sn=new Date,$n=new Date;function Nn(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=function(t){return e(t=new Date(+t)),t},r.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},r.round=function(e){var t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},r.range=function(n,i,o){var a,s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<i);return s},r.filter=function(n){return Nn((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,i){if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}))},n&&(r.count=function(t,i){return Sn.setTime(+t),$n.setTime(+i),e(Sn),e($n),Math.floor(n(Sn,$n))},r.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?function(t){return i(t)%e==0}:function(t){return r.count(0,t)%e==0}):r:null}),r}var Mn=Nn((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Mn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Nn((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Mn:null};var Bn=Nn((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),_n=Nn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),Tn=Nn((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),zn=Nn((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1}));function Un(e){return Nn((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var Pn=Un(0),Ln=Un(1),Rn=(Un(2),Un(3),Un(4)),qn=(Un(5),Un(6),Nn((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),In=Nn((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));In.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nn((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wn=Nn((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),Hn=Nn((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()})),Gn=Nn((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}));function Yn(e){return Nn((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var Vn=Yn(0),Xn=Yn(1),Jn=(Yn(2),Yn(3),Yn(4)),Qn=(Yn(5),Yn(6),Nn((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}))),Zn=Nn((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function Kn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ei(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ti(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Zn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nn((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var ni,ii,ri,oi={"-":"",_:" ",0:"0"},ai=/^\s*\d+/,si=/^%/,ui=/[\\^$*+?|[\]().{}]/g;function ci(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function li(e){return e.replace(ui,"\\$&")}function fi(e){return new RegExp("^(?:"+e.map(li).join("|")+")","i")}function di(e){for(var t={},n=-1,i=e.length;++n<i;)t[e[n].toLowerCase()]=n;return t}function gi(e,t,n){var i=ai.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function pi(e,t,n){var i=ai.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function hi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function mi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function bi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function vi(e,t,n){var i=ai.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function yi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function xi(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function wi(e,t,n){var i=ai.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Ai(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Oi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Ci(e,t,n){var i=ai.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Fi(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Di(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function ji(e,t,n){var i=ai.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function ki(e,t,n){var i=ai.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Ei(e,t,n){var i=ai.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Si(e,t,n){var i=si.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function $i(e,t,n){var i=ai.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Ni(e,t,n){var i=ai.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Mi(e,t){return ci(e.getDate(),t,2)}function Bi(e,t){return ci(e.getHours(),t,2)}function _i(e,t){return ci(e.getHours()%12||12,t,2)}function Ti(e,t){return ci(1+zn.count(In(e),e),t,3)}function zi(e,t){return ci(e.getMilliseconds(),t,3)}function Ui(e,t){return zi(e,t)+"000"}function Pi(e,t){return ci(e.getMonth()+1,t,2)}function Li(e,t){return ci(e.getMinutes(),t,2)}function Ri(e,t){return ci(e.getSeconds(),t,2)}function qi(e){var t=e.getDay();return 0===t?7:t}function Ii(e,t){return ci(Pn.count(In(e)-1,e),t,2)}function Wi(e,t){var n=e.getDay();return e=n>=4||0===n?Rn(e):Rn.ceil(e),ci(Rn.count(In(e),e)+(4===In(e).getDay()),t,2)}function Hi(e){return e.getDay()}function Gi(e,t){return ci(Ln.count(In(e)-1,e),t,2)}function Yi(e,t){return ci(e.getFullYear()%100,t,2)}function Vi(e,t){return ci(e.getFullYear()%1e4,t,4)}function Xi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ci(t/60|0,"0",2)+ci(t%60,"0",2)}function Ji(e,t){return ci(e.getUTCDate(),t,2)}function Qi(e,t){return ci(e.getUTCHours(),t,2)}function Zi(e,t){return ci(e.getUTCHours()%12||12,t,2)}function Ki(e,t){return ci(1+Gn.count(Zn(e),e),t,3)}function er(e,t){return ci(e.getUTCMilliseconds(),t,3)}function tr(e,t){return er(e,t)+"000"}function nr(e,t){return ci(e.getUTCMonth()+1,t,2)}function ir(e,t){return ci(e.getUTCMinutes(),t,2)}function rr(e,t){return ci(e.getUTCSeconds(),t,2)}function or(e){var t=e.getUTCDay();return 0===t?7:t}function ar(e,t){return ci(Vn.count(Zn(e)-1,e),t,2)}function sr(e,t){var n=e.getUTCDay();return e=n>=4||0===n?Jn(e):Jn.ceil(e),ci(Jn.count(Zn(e),e)+(4===Zn(e).getUTCDay()),t,2)}function ur(e){return e.getUTCDay()}function cr(e,t){return ci(Xn.count(Zn(e)-1,e),t,2)}function lr(e,t){return ci(e.getUTCFullYear()%100,t,2)}function fr(e,t){return ci(e.getUTCFullYear()%1e4,t,4)}function dr(){return"+0000"}function gr(){return"%"}function pr(e){return+e}function hr(e){return Math.floor(+e/1e3)}!function(e){ni=function(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,c=fi(r),l=di(r),f=fi(o),d=di(o),g=fi(a),p=di(a),h=fi(s),m=di(s),b=fi(u),v=di(u),y={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Mi,e:Mi,f:Ui,H:Bi,I:_i,j:Ti,L:zi,m:Pi,M:Li,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:pr,s:hr,S:Ri,u:qi,U:Ii,V:Wi,w:Hi,W:Gi,x:null,X:null,y:Yi,Y:Vi,Z:Xi,"%":gr},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ji,e:Ji,f:tr,H:Qi,I:Zi,j:Ki,L:er,m:nr,M:ir,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:pr,s:hr,S:rr,u:or,U:ar,V:sr,w:ur,W:cr,x:null,X:null,y:lr,Y:fr,Z:dr,"%":gr},w={a:function(e,t,n){var i=g.exec(t.slice(n));return i?(e.w=p[i[0].toLowerCase()],n+i[0].length):-1},A:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(e,t,n){var i=b.exec(t.slice(n));return i?(e.m=v[i[0].toLowerCase()],n+i[0].length):-1},B:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(e,n,i){return C(e,t,n,i)},d:Oi,e:Oi,f:Ei,H:Fi,I:Fi,j:Ci,L:ki,m:Ai,M:Di,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=l[i[0].toLowerCase()],n+i[0].length):-1},q:wi,Q:$i,s:Ni,S:ji,u:pi,U:hi,V:mi,w:gi,W:bi,x:function(e,t,i){return C(e,n,t,i)},X:function(e,t,n){return C(e,i,t,n)},y:yi,Y:vi,Z:xi,"%":Si};function A(e,t){return function(n){var i,r,o,a=[],s=-1,u=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(u,s)),null!=(r=oi[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),u=s+1);return a.push(e.slice(u,s)),a.join("")}}function O(e,t){return function(n){var i,r,o=ti(1900,void 0,1);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(!t||"Z"in o||(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=ei(ti(o.y,0,1))).getUTCDay(),i=r>4||0===r?Xn.ceil(i):Xn(i),i=Gn.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Kn(ti(o.y,0,1))).getDay(),i=r>4||0===r?Ln.ceil(i):Ln(i),i=zn.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?ei(ti(o.y,0,1)).getUTCDay():Kn(ti(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ei(o)):Kn(o)}}function C(e,t,n,i){for(var r,o,a=0,s=t.length,u=n.length;a<s;){if(i>=u)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=w[r in oi?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return(y.x=A(n,y),y.X=A(i,y),y.c=A(t,y),x.x=A(n,x),x.X=A(i,x),x.c=A(t,x),{format:function(e){var t=A(e+="",y);return t.toString=function(){return e},t},parse:function(e){var t=O(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=A(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=O(e+="",!0);return t.toString=function(){return e},t}})}(e),ii=ni.format,ni.parse,ri=ni.utcFormat,ni.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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 mr(e){return new Date(e)}function br(e){return e instanceof Date?+e:+new Date(+e)}function vr(e,t,n,i,r,o,a,s,u){var c=Xt(),l=c.invert,f=c.domain,d=u(".%L"),g=u(":%S"),p=u("%I:%M"),h=u("%I %p"),m=u("%a %d"),b=u("%b %d"),v=u("%B"),y=u("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,36e5],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,864e5],[i,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function w(s){return(a(s)<s?d:o(s)<s?g:r(s)<s?p:i(s)<s?h:t(s)<s?n(s)<s?m:b:e(s)<s?v:y)(s)}function A(t,n,i){if(null==t&&(t=10),"number"==typeof t){var r,o=Math.abs(i-n)/t,a=$((function(e){return e[2]})).right(x,o);return a===x.length?(r=U(n/31536e6,i/31536e6,t),t=e):a?(r=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(r=Math.max(U(n,i,t),1),t=s),t.every(r)}return t}return c.invert=function(e){return new Date(l(e))},c.domain=function(e){return arguments.length?f(Array.from(e,br)):f().map(mr)},c.ticks=function(e){var t,n=f(),i=n[0],r=n[n.length-1],o=r<i;return o&&(t=i,i=r,r=t),t=(t=A(e,i,r))?t.range(i,r+1):[],o?t.reverse():t},c.tickFormat=function(e,t){return null==t?w:u(t)},c.nice=function(e){var t=f();return(e=A(e,t[0],t[t.length-1]))?f(pn(t,e)):c},c.copy=function(){return Yt(c,vr(e,t,n,i,r,o,a,s,u))},c}function yr(){var e,t,n,i,r,o=0,a=1,s=It,u=!1;function c(t){return isNaN(t=+t)?r:s(0===n?.5:(t=(i(t)-e)*n,u?Math.max(0,Math.min(1,t)):t))}function l(e){return function(t){var n,i;return arguments.length?([n,i]=t,s=e(n,i),c):[s(0),s(1)]}}return c.domain=function(r){return arguments.length?([o,a]=r,e=i(o=+o),t=i(a=+a),n=e===t?0:1/(t-e),c):[o,a]},c.clamp=function(e){return arguments.length?(u=!!e,c):u},c.interpolator=function(e){return arguments.length?(s=e,c):s},c.range=l(mt),c.rangeRound=l(bt),c.unknown=function(e){return arguments.length?(r=e,c):r},function(r){return i=r,e=r(o),t=r(a),n=e===t?0:1/(t-e),c}}function xr(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function wr(){var e=gn(yr()(It));return e.copy=function(){return xr(e,wr())},W.apply(e,arguments)}function Ar(){var e=kn(yr());return e.copy=function(){return xr(e,Ar()).exponent(e.exponent())},W.apply(e,arguments)}function Or(){var e,t,n,i,r,o,a,s=0,u=.5,c=1,l=1,f=It,d=!1;function g(e){return isNaN(e=+e)?a:(e=.5+((e=+o(e))-t)*(l*e<l*t?i:r),f(d?Math.max(0,Math.min(1,e)):e))}function p(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,f=Pt(e,[n,i,r]),g):[f(0),f(.5),f(1)]}}return g.domain=function(a){return arguments.length?([s,u,c]=a,e=o(s=+s),t=o(u=+u),n=o(c=+c),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),l=t<e?-1:1,g):[s,u,c]},g.clamp=function(e){return arguments.length?(d=!!e,g):d},g.interpolator=function(e){return arguments.length?(f=e,g):f},g.range=p(mt),g.rangeRound=p(bt),g.unknown=function(e){return arguments.length?(a=e,g):a},function(a){return o=a,e=a(s),t=a(u),n=a(c),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),l=t<e?-1:1,g}}function Cr(){var e=kn(Or());return e.copy=function(){return xr(e,Cr()).exponent(e.exponent())},W.apply(e,arguments)}function Fr(){var e,t,n=G().unknown(void 0),i=n.domain,r=n.range,o=[0,1],a=!1,s=0,u=0,c=.5;function l(){var n=i().length,l=o[1]<o[0],f=o[l-0],d=o[1-l],g=function(e,t,n){var i=e-t+2*n;return e?i>0?i:1:0}(n,s,u);e=(d-f)/(g||1),a&&(e=Math.floor(e)),f+=(d-f-e*(n-s))*c,t=e*(1-s),a&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return f+e*t}));return r(l?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),l()):i()},n.range=function(e){return arguments.length?(o=[+e[0],+e[1]],l()):o.slice()},n.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,l()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,l()):a},n.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,l()):s},n.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),l()):s},n.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),l()):u},n.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),l()):c},n.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var n,a,s,u=+e[0],c=+e[1],l=o[1]<o[0],f=l?r().reverse():r(),d=f.length-1;if(u==u&&c==c&&(c<u&&(s=u,u=c,c=s),!(c<f[0]||u>o[1-l])))return n=Math.max(0,N(f,u)-1),a=u===c?n:N(f,c)-1,u-f[n]>t+1e-10&&++n,l&&(s=n,n=d-a,a=d-s),n>a?void 0:i().slice(n,a+1)}},n.invert=function(e){var t=n.invertRange([e,e]);return t?t[0]:t},n.copy=function(){return Fr().domain(i()).range(o).round(a).paddingInner(s).paddingOuter(u).align(c)},l()}var Dr=Array.prototype.map;function jr(e){return Dr.call(e,(function(e){return+e}))}var kr=Array.prototype.slice;const Er={};function Sr(e,t,n){const i=function(){var n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){var n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){var n,i,r,o,a=e.range(),s=t[0],u=t[1],c=-1;for(u<s&&(i=s,s=u,u=i),r=0,o=a.length;r<o;++r)a[r]>=s&&a[r]<=u&&(c<0&&(c=r),n=r);if(!(c<0))return s=e.invertExtent(a[c]),u=e.invertExtent(a[n]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=e,n};var r;return i.metadata=function(e){for(var t={},n=0,i=e.length;n<i;++n)t[e[n]]=!0;return t}(null!=(r=n)?D(r)?r:[r]:[]),i}function $r(e,t,n){return arguments.length>1?(Er[e]=Sr(e,t,n),this):Nr(e)?Er[e]:void 0}function Nr(e){return function(e,t){return E.call(e,t)}(Er,e)}function Mr(e,t,n){return Pt(function(e,t){var n=Lt[function(e){return"interpolate"+e.toLowerCase().split("-").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}(t||"rgb",n),e)}$r("identity",(function e(t){var n;function i(e){return isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,Rt),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,Rt):[0,1],gn(i)})),$r("linear",(function e(){var t=Xt();return t.copy=function(){return Yt(t,e())},I.apply(t,arguments),gn(t)}),O),$r(A,(function e(){var t=wn(Vt()).domain([1,10]);return t.copy=function(){return Yt(t,e()).base(t.base())},I.apply(t,arguments),t}),[O,A]),$r("pow",En,O),$r("sqrt",(function(){return En.apply(null,arguments).exponent(.5)}),O),$r("symlog",(function e(){var t=Cn(Vt());return t.copy=function(){return Yt(t,e()).constant(t.constant())},I.apply(t,arguments)}),O),$r("time",(function(){return I.apply(vr(In,qn,Pn,zn,Tn,_n,Bn,Mn,ii).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[O,"temporal"]),$r("utc",(function(){return I.apply(vr(Zn,Qn,Vn,Gn,Hn,Wn,Bn,Mn,ri).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[O,"temporal"]),$r("sequential",wr,[O,"interpolating"]),$r("sequential-linear",wr,[O,"interpolating"]),$r("sequential-log",(function e(){var t=wn(yr()).domain([1,10]);return t.copy=function(){return xr(t,e()).base(t.base())},W.apply(t,arguments)}),[O,"interpolating",A]),$r("sequential-pow",Ar,[O,"interpolating"]),$r("sequential-sqrt",(function(){return Ar.apply(null,arguments).exponent(.5)}),[O,"interpolating"]),$r("sequential-symlog",(function e(){var t=Cn(yr());return t.copy=function(){return xr(t,e()).constant(t.constant())},W.apply(t,arguments)}),[O,"interpolating"]),$r("diverging-linear",(function e(){var t=gn(Or()(It));return t.copy=function(){return xr(t,e())},W.apply(t,arguments)}),[O,"interpolating"]),$r("diverging-log",(function e(){var t=wn(Or()).domain([.1,1,10]);return t.copy=function(){return xr(t,e()).base(t.base())},W.apply(t,arguments)}),[O,"interpolating",A]),$r("diverging-pow",Cr,[O,"interpolating"]),$r("diverging-sqrt",(function(){return Cr.apply(null,arguments).exponent(.5)}),[O,"interpolating"]),$r("diverging-symlog",(function e(){var t=Cn(Or());return t.copy=function(){return xr(t,e()).constant(t.constant())},W.apply(t,arguments)}),[O,"interpolating"]),$r("quantile",(function e(){var t,n=[],i=[],r=[];function o(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=q(n,e/t);return a}function a(e){return isNaN(e=+e)?t:i[N(r,e)]}return a.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},a.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(S),o()},a.range=function(e){return arguments.length?(i=Array.from(e),o()):i.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return r.slice()},a.copy=function(){return e().domain(n).range(i).unknown(t)},I.apply(a,arguments)}),["discretizing","quantile"]),$r("quantize",(function e(){var t,n=0,i=1,r=1,o=[.5],a=[0,1];function s(e){return e<=e?a[N(o,e,0,r)]:t}function u(){var e=-1;for(o=new Array(r);++e<r;)o[e]=((e+1)*i-(e-r)*n)/(r+1);return s}return s.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,u()):[n,i]},s.range=function(e){return arguments.length?(r=(a=Array.from(e)).length-1,u()):a.slice()},s.invertExtent=function(e){var t=a.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,o[0]]:t>=r?[o[r-1],i]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,i]).range(a).unknown(t)},I.apply(gn(s),arguments)}),"discretizing"),$r("threshold",(function e(){var t,n=[.5],i=[0,1],r=1;function o(e){return e<=e?i[N(n,e,0,r)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),r=Math.min(n.length,i.length-1),o):n.slice()},o.range=function(e){return arguments.length?(i=Array.from(e),r=Math.min(n.length,i.length-1),o):i.slice()},o.invertExtent=function(e){var t=i.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(i).unknown(t)},I.apply(o,arguments)}),"discretizing"),$r("bin-ordinal",(function e(){var t=[],n=[];function i(e){return null==e||e!=e?void 0:n[(N(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=jr(e),i):t.slice()},i.range=function(e){return arguments.length?(n=kr.call(e),i):n.slice()},i.tickFormat=function(e,n){return dn(t[0],function(e){return e[e.length-1]}(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),["discrete","discretizing"]),$r("ordinal",G,"discrete"),$r("band",Fr,"discrete"),$r("point",(function(){return function e(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return e(n())},t}(Fr().paddingInner(1))}),"discrete");function Br(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function _r(e,t){for(let n in e)zr(n,t(e[n]))}const Tr={};function zr(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Tr[e]=t,this):Tr[e]}_r({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},Br),_r({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},e=>Mr(Br(e))),Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,(function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var Ur=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=function(){function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{i=Promise}catch(e){i=function(){}}function r(o,s,u,c,l){"object"==typeof s&&(u=s.depth,c=s.prototype,l=s.includeNonEnumerable,s=s.circular);var f=[],d=[],g="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var h,m;if("object"!=typeof u)return u;if(e(u,t))h=new t;else if(e(u,n))h=new n;else if(e(u,i))h=new i((function(e,t){u.then((function(t){e(o(t,p-1))}),(function(e){t(o(e,p-1))}))}));else if(r.__isArray(u))h=[];else if(r.__isRegExp(u))h=new RegExp(u.source,a(u)),u.lastIndex&&(h.lastIndex=u.lastIndex);else if(r.__isDate(u))h=new Date(u.getTime());else{if(g&&Buffer.isBuffer(u))return h=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(h),h;e(u,Error)?h=Object.create(u):void 0===c?(m=Object.getPrototypeOf(u),h=Object.create(m)):(h=Object.create(c),m=c)}if(s){var b=f.indexOf(u);if(-1!=b)return d[b];f.push(u),d.push(h)}for(var v in e(u,t)&&u.forEach((function(e,t){var n=o(t,p-1),i=o(e,p-1);h.set(n,i)})),e(u,n)&&u.forEach((function(e){var t=o(e,p-1);h.add(t)})),u){var y;m&&(y=Object.getOwnPropertyDescriptor(m,v)),y&&null==y.set||(h[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v<x.length;v++){var w=x[v];(!(O=Object.getOwnPropertyDescriptor(u,w))||O.enumerable||l)&&(h[w]=o(u[w],p-1),O.enumerable||Object.defineProperty(h,w,{enumerable:!1}))}}if(l){var A=Object.getOwnPropertyNames(u);for(v=0;v<A.length;v++){var O,C=A[v];(O=Object.getOwnPropertyDescriptor(u,C))&&O.enumerable||(h[C]=o(u[C],p-1),Object.defineProperty(h,C,{enumerable:!1}))}}return h}(o,u)}function o(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},r.__objToStr=o,r.__isDate=function(e){return"object"==typeof e&&"[object Date]"===o(e)},r.__isArray=function(e){return"object"==typeof e&&"[object Array]"===o(e)},r.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===o(e)},r.__getRegExpFlags=a,r}();e.exports&&(e.exports=t)})),Pr=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,i="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(n=t.cmp,function(e){return function(t,i){var r={key:t,value:e[t]},o={key:i,value:e[i]};return n(r,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;n<t.length;n++)n&&(a+=","),a+=e(t[n])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(r&&r(t));for(a="",n=0;n<u.length;n++){var c=u[n],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(e)};function Lr(e){return!!e.or}function Rr(e){return!!e.and}function qr(e){return!!e.not}function Ir(e,t){return qr(e)?{not:Ir(e.not,t)}:Rr(e)?{and:e.and.map(e=>Ir(e,t))}:Lr(e)?{or:e.or.map(e=>Ir(e,t))}:t(e)}const Wr=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;0!=r--;){var a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n},Hr=Ur;function Gr(e,t){const n={};for(const i of t)b(e,i)&&(n[i]=e[i]);return n}function Yr(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Pr(e)).join(",")})`};const Vr=Pr;function Xr(e){if(y(e))return e;const t=s(e)?e:Pr(e);if(t.length<250)return t;let n=0;for(let e=0;e<t.length;e++){n=(n<<5)-n+t.charCodeAt(e),n&=n}return n}function Jr(e){return!1===e||null===e}function Qr(e,t){return e.indexOf(t)>-1}function Zr(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function Kr(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function eo(e,t){for(const n of Object.keys(t))g(e,n,t[n],!0)}function to(e,t){const n=[],i={};let r;for(const o of e)r=t(o),r in i||(i[r]=1,n.push(o));return n}function no(e,t){for(const n of e)if(t.has(n))return!0;return!1}function io(e){const t=new Set;for(const n of e){const e=r(n).map((e,t)=>0===t?e:`[${e}]`);e.map((t,n)=>e.slice(0,n+1).join("")).forEach(e=>t.add(e))}return t}function ro(e,t){return void 0===e||void 0===t||no(io(e),io(t))}const oo=Object.keys,ao=Object.values;function so(e){return!0===e||!1===e}function uo(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function co(e,t){return qr(e)?"!("+co(e.not,t)+")":Rr(e)?"("+e.and.map(e=>co(e,t)).join(") && (")+")":Lr(e)?"("+e.or.map(e=>co(e,t)).join(") || (")+")":t(e)}function lo(e,t){if(0===t.length)return!0;const n=t.shift();return lo(e[n],t)&&delete e[n],0===oo(e).length}function fo(e){return e.charAt(0).toUpperCase()+e.substr(1)}function go(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function po(e,t="datum"){const n=r(e),i=[];for(let e=1;e<=n.length;e++){const r=`[${n.slice(0,e).map(u).join("][")}]`;i.push(`${t}${r}`)}return i.join(" && ")}function ho(e){return`${r(e).map(go).join("\\.")}`}function mo(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function bo(e){return e?r(e).length:0}function vo(...e){for(const t of e)if(void 0!==t)return t}let yo=42;function xo(e){return(e%360+360)%360}function wo(e){return!!y(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Ao={domainColor:{part:"domain",vgProp:"stroke"},labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDash"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDash"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"},titleColor:{part:"title",vgProp:"fill"},title:null};function Oo(e){return e&&e.condition}const Co=["domain","grid","labels","ticks","title"],Fo={grid:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",domain:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOpacity:"main",labelOffset:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},Do={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,translate:1,zindex:1},jo=Object.assign(Object.assign({},Do),{style:1,labelExpr:1,encoding:1});function ko(e){return!!jo[e]}function Eo(e){return Qr(["line","area","trail"],e)}function So(e){return Qr(["rect","bar","image"],e)}const $o=oo({area:1,bar:1,image:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1});function No(e){return e.type}x($o);const Mo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Bo=["filled","color","tooltip","invalid","timeUnitBandPosition","timeUnitBand"],_o={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},To={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},zo={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function Uo(e){return!!e.mark}class Po{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!Uo(e)&&(No(t=e.mark)?t.type:t)===this.name;var t}}const Lo={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Ro={count:1,min:1,max:1};function qo(e){return!!e&&!!e.argmin}function Io(e){return!!e&&!!e.argmax}function Wo(e){return s(e)&&!!Lo[e]}const Ho=["count","valid","missing","distinct"];function Go(e){return s(e)&&Qr(Ho,e)}const Yo=["count","sum","distinct","valid","missing"],Vo=x(["mean","average","median","q1","q3","min","max"]),Xo="row",Jo="x",Qo="y",Zo="x2",Ko="y2",ea="color",ta="fill",na="stroke",ia="shape",ra="size",oa="opacity",aa="fillOpacity",sa="strokeOpacity",ua="strokeWidth",ca="strokeDash";const la={longitude:1,longitude2:1,latitude:1,latitude2:1};const fa=oo(la),da=Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),la),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1});function ga(e){return"color"===e||"fill"===e||"stroke"===e}const pa={row:1,column:1,facet:1},ha=oo(pa),ma=Object.assign(Object.assign({},da),pa),ba=oo(ma),va=w(ma,["order","detail","tooltip"]),ya=w(va,["row","column","facet"]);function xa(e){return!!ma[e]}const wa=["x2","y2","latitude2","longitude2"];function Aa(e){return Oa(e)!==e}function Oa(e){switch(e){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude"}return e}function Ca(e){switch(e){case"x":return"x2";case"y":return"y2";case"latitude":return"latitude2";case"longitude":return"longitude2"}}const Fa=w(da,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),Da=oo(Fa),ja={x:1,y:1},ka=oo(ja);function Ea(e){return"x"===e?"width":"height"}function Sa(e){return"width"===e?"x":"y"}const $a=w(Fa,["text","tooltip","href","url","detail","key","order"]),Na=oo($a);const Ma=Object.assign(Object.assign({},ja),$a),Ba=oo(Ma);function _a(e){return!!Ma[e]}function Ta(e,t){return function(e){switch(e){case ea:case ta:case na:case"detail":case"key":case"tooltip":case"href":case"order":case oa:case aa:case sa:case ua:case"facet":case Xo:case"column":return za;case Jo:case Qo:case"latitude":case"longitude":return Ua;case Zo:case Ko:case"latitude2":case"longitude2":return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ra:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case ca:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case ia:return{point:"always",geoshape:"always"};case"text":return{text:"always"};case"url":return{image:"always"}}}(e)[t]}const za={area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},Ua=w(za,["geoshape"]);function Pa(e){switch(e){case Jo:case Qo:case ra:case ua:case oa:case aa:case sa:case Zo:case Ko:return;case"facet":case Xo:case"column":case ia:case ca:case"text":case"tooltip":case"href":case"url":return"discrete";case ea:case ta:case na:return"flexible";case"latitude":case"longitude":case"latitude2":case"longitude2":case"detail":case"key":case"order":return}}function La(e){const{anchor:t,frame:n,offset:i,orient:r,color:o,subtitleColor:a,subtitleFont:s,subtitleFontSize:u,subtitleFontStyle:c,subtitleFontWeight:l,subtitleLineHeight:f,subtitlePadding:d}=e,g=w(e,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]);return{mark:Object.assign(Object.assign({},g),o?{fill:o}:{}),nonMark:Object.assign(Object.assign(Object.assign(Object.assign({},t?{anchor:t}:{}),n?{frame:n}:{}),i?{offset:i}:{}),r?{orient:r}:{}),subtitle:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a?{subtitleColor:a}:{}),s?{subtitleFont:s}:{}),u?{subtitleFontSize:u}:{}),c?{subtitleFontStyle:c}:{}),l?{subtitleFontWeight:l}:{}),f?{subtitleLineHeight:f}:{}),d?{subtitlePadding:d}:{})}}function Ra(e){return s(e)||o(e)&&s(e[0])}function qa(e){return e&&!!e.signal}function Ia(e){return!!e.step}function Wa(e){return!o(e)&&("field"in e&&"data"in e)}const Ha=oo({blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1}),Ga=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Ya(e){return qa(e)?e:{value:e}}function Va(e){var t;return[].concat(e.type,null!==(t=e.style)&&void 0!==t?t:[])}function Xa(e,t,n){return vo(t[e],Ja(e,t,n))}function Ja(e,t,n,{vgChannel:i}={}){return vo(i?Qa(e,t,n.style):void 0,Qa(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Qa(e,t,n){return Za(e,Va(t),n)}function Za(e,t,n){let i;t=h(t);for(const r of t){const t=n[r];t&&void 0!==t[e]&&(i=t[e])}return i}function Ka(e,t){return h(e).reduce((e,n)=>{var i;return e.field.push(Ru(n,t)),e.order.push(null!==(i=n.sort)&&void 0!==i?i:"ascending"),e},{field:[],order:[]})}function es(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(Wr(t,e))return;n.push(e)}),n}function ts(e,t){return Wr(e,t)||!t?e:e?[...h(e),...h(t)].join(", "):t}function ns(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if(Ra(n)&&Ra(i))return{explicit:e.explicit,value:ts(n,i)};if(!Ra(n)&&!Ra(i))return{explicit:e.explicit,value:es(n,i)};throw new Error("It should never reach here")}const is=Object.freeze({__proto__:null,invalidSpec:function(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`},FIT_NON_SINGLE:'Autosize "fit" only works for single views and layered views.',containerSizeNonSingle:function(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`},containerSizeNotCompatibleWithAutosize:function(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-x".`},droppingFit:function(e){return e?`Dropping "fit-${e}" because spec has discrete ${Ea(e)}.`:'Dropping "fit" because spec has discrete size.'},cannotProjectOnChannelWithoutField:function(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`},cannotProjectAggregate:function(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`},nearestNotSupportForContinuous:function(e){return`The "nearest" transform is not supported for ${e} marks.`},selectionNotSupported:function(e){return`Selection not supported for ${e} yet.`},selectionNotFound:function(e){return`Cannot find a selection named "${e}".`},SCALE_BINDINGS_CONTINUOUS:"Scale bindings are currently only supported for scales with unbinned, continuous domains.",LEGEND_BINDINGS_PROJECT_LENGTH:"Legend bindings are only supported for selections over an individual field or encoding channel.",noSameUnitLookup:function(e){return`Cannot define and lookup the "${e}" selection in the same view. `+"Try moving the lookup into a second, layered view?"},noSuchRepeatedValue:function(e){return`Unknown repeated value "${e}".`},columnsNotSupportByRowCol:function(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`},CONCAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",REPEAT_CANNOT_SHARE_AXIS:"Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).",unrecognizedParse:function(e){return`Unrecognized parse "${e}".`},differentParse:function(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`},invalidTransformIgnored:function(e){return`Ignoring an invalid transform: ${Vr(e)}.`},NO_FIELDS_NEEDS_AS:'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.',encodingOverridden:function(e){return`Layer's shared ${e.join(",")} channel ${1===e.length?"is":"are"} overriden.`},projectionOverridden:function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Vr(t)} is overridden by a child projection ${Vr(n)}.`},primitiveChannelDef:function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Vr(n)}}.`},invalidFieldType:function(e){return`Invalid field type "${e}".`},invalidFieldTypeForCountAggregate:function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`},invalidAggregate:function(e){return`Invalid aggregation operator "${e}".`},missingFieldType:function(e,t){return`Missing type for channel "${e}", using "${t}" instead.`},droppingColor:function(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`},emptyFieldDef:function(e,t){return`Dropping ${Vr(e)} from channel "${t}" since it does not contain any data field, value, or signal.`},latLongDeprecated:function(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`},LINE_WITH_VARYING_SIZE:"Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.",incompatibleChannel:function(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`},invalidEncodingChannel:function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`},facetChannelShouldBeDiscrete:function(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`},facetChannelDropped:function(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`},discreteChannelCannotEncode:function(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`},lineWithRange:function(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`},orientOverridden:function(e,t){return`Specified orient "${e}" overridden with "${t}".`},CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:"Custom domain scale cannot be unioned with default field-based domain.",RANGE_STEP_DEPRECATED:'Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.',cannotUseScalePropertyWithNonColor:function(e){return`Cannot use the scale property "${e}" with non-color channel.`},unaggregateDomainHasNoEffectForRawField:function(e){return`Using unaggregated domain with raw field has no effect (${Vr(e)}).`},unaggregateDomainWithNonSharedDomainOp:function(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`},unaggregatedDomainWithLogScale:function(e){return`Unaggregated domain is currently unsupported for log scale (${Vr(e)}).`},cannotApplySizeToNonOrientedMark:function(e){return`Cannot apply size to non-oriented mark "${e}".`},scaleTypeNotWorkWithChannel:function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`},scaleTypeNotWorkWithFieldDef:function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`},scalePropertyNotWorkWithScaleType:function(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`},scaleTypeNotWorkWithMark:function(e,t){return`Scale type "${t}" does not work with mark "${e}".`},stepDropped:function(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`},mergeConflictingProperty:function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Vr(n)} and ${Vr(i)}). Using ${Vr(n)}.`},mergeConflictingDomainProperty:function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Vr(n)} and ${Vr(i)}). Using the union of the two domains.`},independentScaleMeansIndependentGuide:function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`},domainSortDropped:function(e){return`Dropping sort property ${Vr(e)} as unioned domains only support boolean or op "count", "min", and "max".`},UNABLE_TO_MERGE_DOMAINS:"Unable to merge domains.",MORE_THAN_ONE_SORT:"Domains that should be unioned has conflicting sort properties. Sort will be set to true.",INVALID_CHANNEL_FOR_AXIS:"Invalid channel for axis.",cannotStackRangedMark:function(e){return`Cannot stack "${e}" if there is already "${e}2".`},cannotStackNonLinearScale:function(e){return`Cannot stack non-linear scale (${e}).`},stackNonSummativeAggregate:function(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`},invalidTimeUnit:function(e,t){return`Invalid ${e}: ${Vr(t)}.`},dayReplacedWithDate:function(e){return`Time unit "${e}" is not supported. We are replacing it with ${mo(e,"day","date")}.`},droppedDay:function(e){return`Dropping day from datetime ${Vr(e)} as day cannot be combined with other units.`},errorBarCenterAndExtentAreNotNeeded:function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`},errorBarCenterIsUsedWithWrongExtent:function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`},errorBarContinuousAxisHasCustomizedAggregate:function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`},errorBarCenterIsNotNeeded:function(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`},errorBand1DNotSupport:function(e){return`1D error band does not support ${e}.`},channelRequiredForBinned:function(e){return`Channel ${e} is required for "binned" bin.`},domainRequiredForThresholdScale:function(e){return`Domain for ${e} is required for threshold scale.`}}),rs=function(e,t){var n=e||0;return{level:function(e){return arguments.length?(n=+e,this):n},error:function(){return n>=1&&f(t||"error","ERROR",arguments),this},warn:function(){return n>=2&&f(t||"warn","WARN",arguments),this},info:function(){return n>=3&&f(t||"log","INFO",arguments),this},debug:function(){return n>=4&&f(t||"log","DEBUG",arguments),this}}}(2);let os=rs;function as(...e){os.warn(...e)}function ss(e){return!!(e&&(e.year||e.quarter||e.month||e.date||e.day||e.hours||e.minutes||e.seconds||e.milliseconds))}const us=["january","february","march","april","may","june","july","august","september","october","november","december"],cs=us.map(e=>e.substr(0,3)),ls=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],fs=ls.map(e=>e.substr(0,3));function ds(e,t){const n=[];if(t&&void 0!==e.day&&oo(e).length>1&&(as(is.droppedDay(e)),delete(e=Hr(e)).day),void 0!==e.year?n.push(e.year):void 0!==e.day?n.push(2006):n.push(0),void 0!==e.month){const i=t?function(e){if(wo(e)&&(e=+e),y(e))return e-1;{const t=e.toLowerCase(),n=us.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=cs.indexOf(i);if(-1!==r)return r;throw new Error(is.invalidTimeUnit("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(wo(e)&&(e=+e),y(e))return e>4&&as(is.invalidTimeUnit("quarter",e)),e-1;throw new Error(is.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;n.push(y(i)?3*i:i+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const i=t?function(e){if(wo(e)&&(e=+e),y(e))return e%7;{const t=e.toLowerCase(),n=ls.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=fs.indexOf(i);if(-1!==r)return r;throw new Error(is.invalidTimeUnit("day",e))}}(e.day):e.day;n.push(y(i)?i+1:i+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const i=e[t];n.push(void 0===i?0:i)}return n}function gs(e){const t=ds(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}var ps;!function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(ps||(ps={}));const hs={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},ms=oo(hs);const bs={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1},vs={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},ys=Object.assign(Object.assign({},bs),vs);function xs(e){return!!ys[e]}Object.assign(Object.assign(Object.assign(Object.assign({},hs),bs),{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1}),vs);const ws={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function As(e){return ms.reduce((t,n)=>Os(e,n)?[...t,n]:t,[])}function Os(e,t){const n=e.indexOf(t);return n>-1&&(t!==ps.SECONDS||0===n||"i"!==e.charAt(n-1))}function Cs(e,t,{end:n}={end:!1}){const i=po(t),r=xs(e)?"utc":"";let o;const a=ms.reduce((t,n)=>{var a;return Os(e,n)&&(t[n]=(a=n)===ps.QUARTER?`(${r}quarter(${i})-1)`:`${r}${a}(${i})`,o=n),t},{});return n&&(a[o]+="+1"),function(e){const t=ds(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function Fs(e,t,n){if(!e)return;const i=function(e){if(!e)return;const t=As(e);return`timeUnitSpecifier(${Pr(t)}, ${Pr(ws)})`}(e);return n||xs(e)?`utcFormat(${t}, ${i})`:`timeFormat(${t}, ${i})`}function Ds(e){if(!e)return;let t;return s(e)?t={unit:js(e)}:a(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:js(e.unit)}:{})),xs(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function js(e){return"day"!==e&&e.indexOf("day")>=0?(as(is.dayReplacedWithDate(e)),mo(e,"day","date")):e}function ks(e){return e&&!!e.field&&void 0!==e.equal}function Es(e){return e&&!!e.field&&void 0!==e.lt}function Ss(e){return e&&!!e.field&&void 0!==e.lte}function $s(e){return e&&!!e.field&&void 0!==e.gt}function Ns(e){return e&&!!e.field&&void 0!==e.gte}function Ms(e){if(e&&e.field){if(o(e.range)&&2===e.range.length)return!0;if(qa(e.range))return!0}return!1}function Bs(e){return e&&!!e.field&&(o(e.oneOf)||o(e.in))}function _s(e){return Bs(e)||ks(e)||Ms(e)||Es(e)||$s(e)||Ss(e)||Ns(e)}function Ts(e,t){return oc(e,{timeUnit:t,time:!0})}function zs(e,t=!0){var n;const{field:i}=e,r=null===(n=Ds(e.timeUnit))||void 0===n?void 0:n.unit,o=r?"time("+Cs(r,i)+")":Ru(e,{expr:"datum"});if(ks(e))return o+"==="+Ts(e.equal,r);if(Es(e)){return`${o}<${Ts(e.lt,r)}`}if($s(e)){return`${o}>${Ts(e.gt,r)}`}if(Ss(e)){return`${o}<=${Ts(e.lte,r)}`}if(Ns(e)){return`${o}>=${Ts(e.gte,r)}`}if(Bs(e))return`indexof([${function(e,t){return e.map(e=>Ts(e,t))}(e.oneOf,r).join(",")}], ${o}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Us(o,e.valid);if(Ms(e)){const{range:n}=e,i=qa(n)?{signal:`${n.signal}[0]`}:n[0],a=qa(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==a&&t)return"inrange("+o+", ["+Ts(i,r)+", "+Ts(a,r)+"])";const s=[];return null!==i&&s.push(`${o} >= ${Ts(i,r)}`),null!==a&&s.push(`${o} <= ${Ts(a,r)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Us(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Ps(e){var t;return _s(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=Ds(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Ls={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1};var Rs;!function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.IDENTITY="identity",e.SEQUENTIAL="sequential",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"}(Rs||(Rs={}));const qs={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},Is=oo(qs);function Ws(e,t){const n=qs[e],i=qs[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Hs={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Gs(e){return Hs[e]}const Ys=["linear","log","pow","sqrt","symlog","time","utc"],Vs=x(Ys),Xs=x(["linear","log","pow","sqrt","symlog"]);function Js(e){return e in Xs}const Qs=x(["quantile","quantize","threshold"]),Zs=x(Ys.concat(["quantile","quantize","threshold","sequential","identity"])),Ks=x(["ordinal","bin-ordinal","point","band"]);function eu(e){return e in Ks}function tu(e){return e in Zs}function nu(e){return e in Vs}function iu(e){return e in Qs}function ru(e){return null==e?void 0:e.selection}const ou=w({type:1,domain:1,domainMid:1,align:1,range:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},["type","domain","range","scheme"]),au=oo(ou);!function(){var e;const t={};for(const n of ba)for(const i of oo(Ls))for(const r of Is){const o=fu(n,i);lu(n,r)&&cu(r,i)&&(t[o]=null!==(e=t[o])&&void 0!==e?e:[],t[o].push(r))}}();function su(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!Qr(["point","band","identity"],e);case"bins":return!Qr(["point","band","identity","ordinal"],e);case"round":return nu(e)||"band"===e||"point"===e;case"padding":return nu(e)||Qr(["point","band"],e);case"paddingOuter":case"align":return Qr(["point","band"],e);case"paddingInner":return"band"===e;case"domainMid":case"clamp":return nu(e);case"nice":return nu(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return tu(e)&&!Qr(["log","time","utc","threshold","quantile"],e)}}function uu(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return ga(e)?void 0:is.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"reverse":case"round":case"clamp":case"zero":return}}function cu(e,t){return Qr(["ordinal","nominal"],t)?void 0===e||eu(e):"temporal"===t?Qr([Rs.TIME,Rs.UTC,void 0],e):"quantitative"!==t||Qr([Rs.LOG,Rs.POW,Rs.SQRT,Rs.SYMLOG,Rs.QUANTILE,Rs.QUANTIZE,Rs.THRESHOLD,Rs.LINEAR,void 0],e)}function lu(e,t){switch(e){case Jo:case Qo:return nu(t)||Qr(["band","point"],t);case ra:case ua:case oa:case aa:case sa:return nu(t)||iu(t)||Qr(["band","point","ordinal"],t);case ea:case ta:case na:return"band"!==t;case ca:return"ordinal"===t||iu(t);case ia:return"ordinal"===t}return!1}function fu(e,t){return e+"_"+t}let du=new Set;function gu(e){return e&&"number"!==e&&"time"!==e&&du.has(e)}function pu({formatType:e,field:t,format:n}){return`${e}(${t}, ${JSON.stringify(n)})`}function hu({fieldDef:e,format:t,formatType:n,expr:i,config:r,field:o,omitNumberFormatAndEmptyTimeFormat:a,omitTimeFormatConfig:u,isUTCScale:c}){var l;o=null!=o?o:Ru(e,{expr:i}),c=null!=c?c:Uu(e)&&e.scale&&e.scale.type===Rs.UTC;const f=u?null:r.timeFormat;if(gu(n))return{signal:pu({formatType:n,format:t,field:o})};if(n&&(n=void 0),ic(e)){const n=function(e,t,n,i,r,o=!1){return!t||n?(n=s(n)?n:i)||o?`${r?"utc":"time"}Format(${e}, '${n}')`:void 0:Fs(t,e,r)}(o,null===(l=Ds(e.timeUnit))||void 0===l?void 0:l.unit,t,f,c,!a);return n?{signal:n}:void 0}if(!a){if(t=mu(e,t,r),cc(e.bin)){return{signal:yu(o,Ru(e,{expr:i,binSuffix:"end"}),t,n,r)}}return"quantitative"===e.type||t?{signal:`${bu(Ru(e,{expr:i,binSuffix:"range"}),t)}`}:{signal:`''+${Ru(e,{expr:i})}`}}}function mu(e,t,n){return s(t)?t:"quantitative"===e.type?n.numberFormat:void 0}function bu(e,t){return`format(${e}, "${t||""}")`}function vu(e,t,n,i){var r;return gu(n)?pu({formatType:n,field:e,format:t}):bu(e,null!==(r=s(t)?t:void 0)&&void 0!==r?r:i.numberFormat)}function yu(e,t,n,i,r){const o=vu(e,n,i,r),a=vu(t,n,i,r);return`${Us(e,!1)} ? "null" : ${o} + " – " + ${a}`}const xu="min",wu={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function Au(e){return!!wu[e]}function Ou(e){return!!e&&!!e.encoding}function Cu(e){return!(!e||"count"!==e.op&&!e.field)}function Fu(e){return!!e&&o(e)}function Du(e){return!!e.row||!!e.column}function ju(e){return void 0!==e.facet}function ku(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return Object.assign(Object.assign(Object.assign(Object.assign({},n?{timeUnit:n}:{}),i?{bin:i}:{}),r?{aggregate:r}:{}),{field:t})}function Eu(e){return _u(e)&&!!e.sort}function Su(e,t,n,i,r,{isMidPoint:o}={}){const{timeUnit:a,bin:s}=t;if(Qr(["x","y"],e)){if(Pu(t)&&void 0!==t.band)return t.band;if(a&&!n)return o?Ja("timeUnitBandPosition",i,r):So(i.type)?Ja("timeUnitBand",i,r):0;if(cc(s))return So(i.type)&&!o?1:.5}}function $u(e,t,n,i,r){return!!(cc(t.bin)||t.timeUnit&&_u(t)&&"temporal"===t.type)&&!!Su(e,t,n,i,r)}function Nu(e){return!!e&&!!e.condition}function Mu(e){return!!e&&!!e.condition&&!o(e.condition)&&Bu(e.condition)}function Bu(e){return!(!e||!e.field&&"count"!==e.aggregate)}function _u(e){return!!e&&(!!e.field&&!!e.type||"count"===e.aggregate)}function Tu(e){return Bu(e)&&s(e.field)}function zu(e){return e&&"value"in e&&void 0!==e.value}function Uu(e){return!(!e||!e.scale&&!e.sort)}function Pu(e){return!(!e||!e.axis&&!e.stack&&!e.impute&&void 0===e.band)}function Lu(e){return!!e&&!!e.format}function Ru(e,t={}){var n,i,o;let a=e.field;const s=t.prefix;let c=t.suffix,l="";if(function(e){return"count"===e.aggregate}(e))a=function(e){return function(e){return 0===e.indexOf("__")}(e)?e:`__${e}`}("count");else{let r;if(!t.nofn)if(function(e){return!!e.op}(e))r=e.op;else{const{bin:s,aggregate:u,timeUnit:f}=e;cc(s)?(r=uc(s),c=(null!==(n=t.binSuffix)&&void 0!==n?n:"")+(null!==(i=t.suffix)&&void 0!==i?i:"")):u?Io(u)?(l=`.${a}`,a=`argmax_${u.argmax}`):qo(u)?(l=`.${a}`,a=`argmin_${u.argmin}`):r=String(u):f&&(r=function(e){const t=Ds(e),{utc:n}=t,i=w(t,["utc"]);return i.unit?(n?"utc":"")+oo(i).map(e=>uo(`${"unit"===e?"":`_${e}_`}${i[e]}`)).join(""):(n?"utc":"")+"timeunit"+oo(i).map(e=>uo(`_${e}_${i[e]}`)).join("")}(f),c=(!Qr(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(o=t.suffix)&&void 0!==o?o:""))}r&&(a=a?`${r}_${a}`:r)}return c&&(a=`${a}_${c}`),s&&(a=`${s}_${a}`),t.forAs?a:t.expr?function(e,t="datum"){return`${t}[${u(r(e).join("."))}]`}(a,t.expr)+l:ho(a)+l}function qu(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(is.invalidFieldType(e.type))}function Iu(e){return!qu(e)}const Wu=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Io(t))return`${r} for argmax(${t.argmax})`;if(qo(t))return`${r} for argmin(${t.argmin})`;const o=Ds(i),a=t||(null==o?void 0:o.unit)||(null==o?void 0:o.maxbins)&&"timeunit"||cc(n)&&"bin";return a?a.toUpperCase()+"("+r+")":r}(e);default:return function(e,t){var n;const{field:i,bin:r,timeUnit:o,aggregate:a}=e;if("count"===a)return t.countTitle;if(cc(r))return`${i} (binned)`;if(o){const e=null===(n=Ds(o))||void 0===n?void 0:n.unit;if(e)return`${i} (${As(e).join("-")})`}else if(a)return Io(a)?`${i} for max ${a.argmax}`:qo(a)?`${i} for min ${a.argmin}`:`${fo(a)} of ${i}`;return i}(e,t)}};let Hu=Wu;function Gu(e){Hu=e}function Yu(e,t,{allowDisabling:n,includeDefault:i=!0}){var r,o;const a=(null!==(r=Vu(e))&&void 0!==r?r:{}).title,s=i?Xu(e,t):void 0;return n?vo(a,e.title,s):null!==(o=null!=a?a:e.title)&&void 0!==o?o:s}function Vu(e){return Pu(e)&&e.axis?e.axis:(t=e)&&t.legend&&e.legend?e.legend:function(e){return!!e&&!!e.header}(e)&&e.header?e.header:void 0;var t}function Xu(e,t){return Hu(e,t)}function Ju(e){var t;if(Lu(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=Vu(e))&&void 0!==t?t:{},{format:i,formatType:r}=n;return{format:i,formatType:r}}}function Qu(e){return Bu(e)?e:Mu(e)?e.condition:void 0}function Zu(e){return Bu(e)?e:Mu(e)?e.condition:void 0}function Ku(e,t){if(s(e)||y(e)||v(e)){const n=s(e)?"string":y(e)?"number":"boolean";return as(is.primitiveChannelDef(t,n,e)),{value:e}}return Bu(e)?ec(e,t):Mu(e)?Object.assign(Object.assign({},e),{condition:ec(e.condition,t)}):e}function ec(e,t){const{aggregate:n,timeUnit:i,bin:r,field:o}=e,a=Object.assign({},e);if(!n||Wo(n)||Io(n)||qo(n)||(as(is.invalidAggregate(n)),delete a.aggregate),i&&(a.timeUnit=Ds(i)),o&&(a.field=`${o}`),cc(r)&&(a.bin=tc(r,t)),lc(r)&&!Qr(ka,t)&&as(`Channel ${t} should not be used with "binned" bin.`),_u(a)){const{type:e}=a,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case"quantitative":return"quantitative";case"t":case"temporal":return"temporal";case"o":case"ordinal":return"ordinal";case"n":case"nominal":return"nominal";case"geojson":return"geojson"}}(e);e!==t&&(a.type=t),"quantitative"!==e&&Go(n)&&(as(is.invalidFieldTypeForCountAggregate(e,n)),a.type="quantitative")}else if(!Aa(t)){const e=function(e,t){if(e.timeUnit)return"temporal";if(cc(e.bin))return"quantitative";switch(Pa(t)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}(a,t);as(is.missingFieldType(t,e)),a.type=e}if(_u(a)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case"row":case"column":case"facet":return Iu(e)?{compatible:!1,warning:is.facetChannelShouldBeDiscrete(t)}:nc;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":case"url":return nc;case"longitude":case"longitude2":case"latitude":case"latitude2":return"quantitative"!==n?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:nc;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return"nominal"!==n||e.sort?nc:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case"strokeDash":return Qr(["ordinal","nominal"],e.type)?nc:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case"shape":return Qr(["ordinal","nominal","geojson"],e.type)?nc:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?nc:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(a,t);e||as(n)}if(Eu(a)&&s(a.sort)){const{sort:e}=a;if(Au(e))return Object.assign(Object.assign({},a),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&Au(t))return Object.assign(Object.assign({},a),{sort:{encoding:t,order:"descending"}})}return a}function tc(e,t){return v(e)?{maxbins:gc(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:gc(t)})}const nc={compatible:!0};function ic(e){const t=Vu(e),n=t&&t.formatType||Lu(e)&&e.formatType;return"time"===n||!n&&function(e){return"temporal"===e.type||!!e.timeUnit}(e)}function rc(e){const t=Vu(e),n=t&&t.formatType||Lu(e)&&e.formatType;return n&&gu(n)}function oc(e,{timeUnit:t,type:n,time:i,undefinedIfExprNotRequired:r}){var o;const a=null===(o=Ds(t))||void 0===o?void 0:o.unit;let u;if(qa(e)){const t=e.signal;if(i&&!a&&"temporal"!==n)return i?`isDate(${t}) ? time(${t}) : ${t}`:t;u=t}else ss(e)?u=gs(e):(s(e)||y(e))&&(a||"temporal"===n)&&(u=function(e){return!!hs[e]}(a)?gs({[a]:e}):`datetime(${JSON.stringify(e)})`);return u?i?`time(${u})`:u:r?void 0:JSON.stringify(e)}function ac(e,t){var n;const{type:i}=e,r=null===(n=Ds(e.timeUnit))||void 0===n?void 0:n.unit;return t.map(e=>{const t=oc(e,{timeUnit:r,type:i,undefinedIfExprNotRequired:!0});return void 0!==t?{signal:t}:e})}function sc(e,t){return cc(e.bin)?_a(t)&&Qr(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}function uc(e){return v(e)&&(e=tc(e,void 0)),"bin"+oo(e).map(t=>dc(e[t])?uo(`_${t}_${Object.entries(e[t])}`):uo(`_${t}_${e[t]}`)).join("")}function cc(e){return!0===e||fc(e)&&!e.binned}function lc(e){return"binned"===e||fc(e)&&!0===e.binned}function fc(e){return a(e)}function dc(e){return null==e?void 0:e.selection}function gc(e){switch(e){case Xo:case"column":case ra:case ea:case ta:case na:case ua:case oa:case aa:case sa:case ia:return 6;case ca:return 4;default:return 10}}function pc(e,t){const n=e&&e[t];return!!n&&(o(n)?Zr(n,e=>!!e.field):Bu(n)||Mu(n))}function hc(e){return Zr(ba,t=>{if(pc(e,t)){const n=e[t];if(o(n))return Zr(n,e=>!!e.aggregate);{const e=Qu(n);return e&&!!e.aggregate}}return!1})}function mc(e,t){const n=[],i=[],r=[],o=[],a={};return yc(e,(s,u)=>{if(Bu(s)){const{field:c,aggregate:l,bin:f,timeUnit:d}=s,g=w(s,["field","aggregate","bin","timeUnit"]);if(l||d||f){const e=Vu(s),p=e&&e.title;let h=Ru(s,{forAs:!0});const m=Object.assign(Object.assign(Object.assign({},p?[]:{title:Yu(s,t,{allowDisabling:!0})}),g),{field:h}),b="x"===u||"y"===u;if(l){let e;if(Io(l)?(e="argmax",h=Ru({op:"argmax",field:l.argmax},{forAs:!0}),m.field=`${h}.${c}`):qo(l)?(e="argmin",h=Ru({op:"argmin",field:l.argmin},{forAs:!0}),m.field=`${h}.${c}`):"boxplot"!==l&&"errorbar"!==l&&"errorband"!==l&&(e=l),e){const t={op:e,as:h};c&&(t.field=c),o.push(t)}}else if(n.push(h),_u(s)&&cc(f)){if(i.push({bin:f,field:c,as:h}),n.push(Ru(s,{binSuffix:"end"})),sc(s,u)&&n.push(Ru(s,{binSuffix:"range"})),b){const e={field:h+"_end"};a[u+"2"]=e}m.bin="binned",Aa(u)||(m.type="quantitative")}else if(d){r.push({timeUnit:d,field:c,as:h});const e=_u(s)&&"temporal"!==s.type&&"time";e&&("text"===u||"tooltip"===u?m.formatType=e:!function(e){return!!Fa[e]}(u)?b&&(m.axis=Object.assign({formatType:e},m.axis)):m.legend=Object.assign({formatType:e},m.legend))}a[u]=m}else n.push(c),a[u]=e[u]}else a[u]=e[u]}),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function bc(e,t){const n=t.type;return oo(e).reduce((i,r)=>{if(!xa(r))return as(is.invalidEncodingChannel(r)),i;if(!function(e,t,n){const i=Ta(t,n);if(!i)return!1;if("binned"===i){const n=e["x2"===t?"x":"y"];return!!(Bu(n)&&Bu(e[t])&&lc(n.bin))}return!0}(e,r,n))return as(is.incompatibleChannel(r,n)),i;if("size"===r&&"line"===n){const t=Zu(e[r]);if(null==t?void 0:t.aggregate)return as(is.LINE_WITH_VARYING_SIZE),i}if("color"===r&&(t.filled?"fill"in e:"stroke"in e))return as(is.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e})),i;const a=e[r];if("detail"===r||"order"===r&&!o(a)&&!zu(a)||"tooltip"===r&&o(a))a&&(i[r]=h(a).reduce((e,t)=>(Bu(t)?e.push(ec(t,r)):as(is.emptyFieldDef(t,r)),e),[]));else{if("tooltip"===r&&null===a)i[r]=null;else if(!(Bu(a)||zu(a)||Nu(a)||qa(a)))return as(is.emptyFieldDef(a,r)),i;i[r]=Ku(a,r)}return i},{})}function vc(e){const t=[];for(const n of oo(e))if(pc(e,n)){const i=h(e[n]);for(const e of i)Bu(e)?t.push(e):Mu(e)&&t.push(e.condition)}return t}function yc(e,t,n){if(e)for(const i of oo(e)){const r=e[i];if(o(r))for(const e of r)t.call(n,e,i);else t.call(n,r,i)}}function xc(e,t,n,i){return e?oo(e).reduce((n,r)=>{const a=e[r];return o(a)?a.reduce((e,n)=>t.call(i,e,n,r),n):t.call(i,n,a,r)},n):n}function wc(e,t){return oo(t).reduce((n,i)=>{switch(i){case"x":case"y":case"href":case"url":case"x2":case"y2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case"shape":case"tooltip":return n;case"order":if("line"===e||"trail"===e)return n;case"detail":case"key":{const e=t[i];return(o(e)||Bu(e))&&h(e).forEach(e=>{e.aggregate||n.push(Ru(e,{}))}),n}case"size":if("trail"===e)return n;case"color":case"fill":case"stroke":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeDash":case"strokeWidth":{const e=Zu(t[i]);return e&&!e.aggregate&&n.push(Ru(e,{})),n}}},[])}function Ac(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map(({fieldPrefix:e,titlePrefix:n})=>{const r=i?` of ${t.field}`:"";return{field:e+t.field,type:t.type,title:qa(n)?{signal:n+`"${escape(r)}"`}:n+r}}),...vc(n)]}}function Oc(e){const{axis:t,title:n,field:i}=e;return t&&void 0!==t.title?void 0:vo(n,i)}function Cc(e,t,n,i,r){const{scale:o,axis:a}=n;return({partName:u,mark:c,positionPrefix:l,endPositionPrefix:f,extraEncoding:d={}})=>{const g=Oc(n);return Fc(e,u,r,{mark:c,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:l+"_"+n.field,type:n.type},void 0!==g?{title:g}:{}),void 0!==o?{scale:o}:{}),void 0!==a?{axis:a}:{})},s(f)?{[t+"2"]:{field:f+"_"+n.field}}:{}),i),d)})}}function Fc(e,t,n,i){const{clip:r,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},i),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),r?{clip:r}:{}),o?{color:o}:{}),a?{opacity:a}:{}),No(i.mark)?i.mark:{type:i.mark}),{style:`${s}-${t}`}),v(e[t])?{}:e[t])})]:[]}function Dc(e,t,n){const{encoding:i}=e,r="vertical"===t?"y":"x",o=i[r],a=i[r+"2"],s=i[r+"Error"],u=i[r+"Error2"];return{continuousAxisChannelDef:jc(o,n),continuousAxisChannelDef2:jc(a,n),continuousAxisChannelDefError:jc(s,n),continuousAxisChannelDefError2:jc(u,n),continuousAxis:r}}function jc(e,t){if(e&&e.aggregate){const{aggregate:n}=e,i=w(e,["aggregate"]);return n!==t&&as(is.errorBarContinuousAxisHasCustomizedAggregate(n,t)),i}return e}function kc(e,t){const{mark:n,encoding:i}=e;if(Bu(i.x)&&Iu(i.x)){if(Bu(i.y)&&Iu(i.y)){if(void 0===i.x.aggregate&&i.y.aggregate===t)return"vertical";if(void 0===i.y.aggregate&&i.x.aggregate===t)return"horizontal";if(i.x.aggregate===t&&i.y.aggregate===t)throw new Error("Both x and y cannot have aggregate");return No(n)&&n.orient?n.orient:"vertical"}return"horizontal"}if(Bu(i.y)&&Iu(i.y))return"vertical";throw new Error("Need a valid continuous axis for "+t+"s")}const Ec=oo({box:1,median:1,outliers:1,rule:1,ticks:1}),Sc=new Po("boxplot",Nc);function $c(e){return y(e)?"tukey":e}function Nc(e,{config:t}){var n,i;const{mark:r,encoding:s,selection:u,projection:c}=e,l=w(e,["mark","encoding","selection","projection"]),f=No(r)?r:{type:r};u&&as(is.selectionNotSupported("boxplot"));const d=null!==(n=f.extent)&&void 0!==n?n:t.boxplot.extent,g=vo(f.size,t.boxplot.size),p=$c(d),{transform:h,continuousAxisChannelDef:m,continuousAxis:b,groupby:v,aggregate:y,encodingWithoutContinuousAxis:x,ticksOrient:A,boxOrient:O,customTooltipWithoutAggregatedField:C}=function(e,t,n){const i=kc(e,"boxplot"),{continuousAxisChannelDef:r,continuousAxis:a}=Dc(e,i,"boxplot"),s=r.field,u=$c(t),c=[...Mc(s),{op:"median",field:s,as:"mid_box_"+s},{op:"min",field:s,as:("min-max"===u?"lower_whisker_":"min_")+s},{op:"max",field:s,as:("min-max"===u?"upper_whisker_":"max_")+s}],l="min-max"===u||"tukey"===u?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:"iqr_"+s},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:"upper_whisker_"+s},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:"lower_whisker_"+s}],f=e.encoding,d=a,g=(f[d],w(f,["symbol"==typeof d?d:d+""])),{customTooltipWithoutAggregatedField:p,filteredEncoding:h}=function(e){const{tooltip:t}=e,n=w(e,["tooltip"]);if(!t)return{filteredEncoding:e};let i,r;return o(t)?(t.forEach(e=>{e.aggregate?(i||(i=[]),i.push(e)):(r||(r=[]),r.push(e))}),i&&(n.tooltip=i)):t.aggregate?n.tooltip=t:r=t,o(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(g),{bins:m,timeUnits:b,aggregate:v,groupby:y,encoding:x}=mc(h,n),A="vertical"===i?"horizontal":"vertical",O=i;return{transform:[...m,...b,{aggregate:[...v,...c],groupby:y},...l],groupby:y,aggregate:v,continuousAxisChannelDef:r,continuousAxis:a,encodingWithoutContinuousAxis:x,ticksOrient:A,boxOrient:O,customTooltipWithoutAggregatedField:p}}(e,d,t),{color:F,size:D}=x,j=w(x,["color","size"]),k=e=>Cc(f,b,m,e,t.boxplot),E=k(j),S=k(x),$=k(Object.assign(Object.assign({},j),D?{size:D}:{})),N=Ac([{fieldPrefix:"min-max"===p?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===p?"lower_whisker_":"min_",titlePrefix:"Min"}],m,x),M={type:"tick",color:"black",opacity:1,orient:A,invalid:null},B="min-max"===p?N:Ac([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,x),_=[...E({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:B}),...E({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:B}),...E({partName:"ticks",mark:M,positionPrefix:"lower_whisker",extraEncoding:B}),...E({partName:"ticks",mark:M,positionPrefix:"upper_whisker",extraEncoding:B})],T=[..."tukey"!==p?_:[],...S({partName:"box",mark:Object.assign(Object.assign({type:"bar"},g?{size:g}:{}),{orient:O,invalid:null}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:N}),...$({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},a(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),g?{size:g}:{}),{orient:A}),positionPrefix:"mid_box",extraEncoding:N})];let z;if("min-max"!==p){const e=`datum["lower_box_${m.field}"]`,n=`datum["upper_box_${m.field}"]`,i=`(${n} - ${e})`,r=`${e} - ${d} * ${i}`,o=`${n} + ${d} * ${i}`,a=`datum["${m.field}"]`,s={joinaggregate:Mc(m.field),groupby:v};let u=void 0;"tukey"===p&&(u={transform:[{filter:`(${r} <= ${a}) && (${a} <= ${o})`},{aggregate:[{op:"min",field:m.field,as:"lower_whisker_"+m.field},{op:"max",field:m.field,as:"upper_whisker_"+m.field},{op:"min",field:"lower_box_"+m.field,as:"lower_box_"+m.field},{op:"max",field:"upper_box_"+m.field,as:"upper_box_"+m.field},...y],groupby:v}],layer:_});const c=w(j,["tooltip"]),{scale:l,axis:g}=m,h=Oc(m),x=Fc(f,"outliers",t.boxplot,{transform:[{filter:`(${a} < ${r}) || (${a} > ${o})`}],mark:"point",encoding:Object.assign(Object.assign({[b]:Object.assign(Object.assign(Object.assign({field:m.field,type:m.type},void 0!==h?{title:h}:{}),void 0!==l?{scale:l}:{}),void 0!==g?{axis:g}:{})},c),C?{tooltip:C}:{})})[0];x&&u?z={transform:[s],layer:[x,u]}:x?(z=x,z.transform.unshift(s)):u&&(z=u,z.transform.unshift(s))}return z?Object.assign(Object.assign({},l),{layer:[z,{transform:h,layer:T}]}):Object.assign(Object.assign({},l),{transform:(null!==(i=l.transform)&&void 0!==i?i:[]).concat(h),layer:T})}function Mc(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}const Bc=oo({ticks:1,rule:1}),_c=new Po("errorbar",Tc);function Tc(e,{config:t}){const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:c}=Uc(e,"errorbar",t),l=Cc(s,r,i,o,t.errorbar),f={type:"tick",orient:a},d=[...l({partName:"ticks",mark:f,positionPrefix:"lower",extraEncoding:c}),...l({partName:"ticks",mark:f,positionPrefix:"upper",extraEncoding:c}),...l({partName:"rule",mark:"rule",positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return Object.assign(Object.assign(Object.assign({},u),{transform:n}),d.length>1?{layer:d}:Object.assign({},d[0]))}function zc(e,t){const{encoding:n}=e;if(function(e){return(Bu(e.x)||Bu(e.y))&&!Bu(e.x2)&&!Bu(e.y2)&&!Bu(e.xError)&&!Bu(e.xError2)&&!Bu(e.yError)&&!Bu(e.yError2)}(n))return{orient:kc(e,t),inputType:"raw"};const i=function(e){return Bu(e.x2)||Bu(e.y2)}(n),r=function(e){return Bu(e.xError)||Bu(e.xError2)||Bu(e.yError)||Bu(e.yError2)}(n),o=n.x,a=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,i=n.y2;if(Bu(e)&&Bu(i))throw new Error(`${t} cannot have both x2 and y2`);if(Bu(e)){if(Bu(o)&&Iu(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(Bu(i)){if(Bu(a)&&Iu(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,r=n.yError,s=n.yError2;if(Bu(i)&&!Bu(e))throw new Error(`${t} cannot have xError2 without xError`);if(Bu(s)&&!Bu(r))throw new Error(`${t} cannot have yError2 without yError`);if(Bu(e)&&Bu(r))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Bu(e)){if(Bu(o)&&Iu(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Bu(r)){if(Bu(a)&&Iu(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Uc(e,t,n){var i;const{mark:r,encoding:o,selection:a,projection:s}=e,u=w(e,["mark","encoding","selection","projection"]),c=No(r)?r:{type:r};a&&as(is.selectionNotSupported(t));const{orient:l,inputType:f}=zc(e,t),{continuousAxisChannelDef:d,continuousAxisChannelDef2:g,continuousAxisChannelDefError:p,continuousAxisChannelDefError2:h,continuousAxis:m}=Dc(e,l,t),{errorBarSpecificAggregate:b,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:x}=function(e,t,n,i,r,o,a,s){let u=[],c=[];const l=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&as(is.errorBarCenterIsUsedWithWrongExtent(t,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:l,as:"extent_"+l},{op:t,field:l,as:"center_"+l}],c=[{calculate:`datum["center_${l}"] + datum["extent_${l}"]`,as:"upper_"+l},{calculate:`datum["center_${l}"] - datum["extent_${l}"]`,as:"lower_"+l}],f=[{fieldPrefix:"center_",titlePrefix:fo(t)},{fieldPrefix:"upper_",titlePrefix:Pc(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:Pc(t,n,"-")}],d=!0;else{let t,i,r;e.center&&e.extent&&as(is.errorBarCenterIsNotNeeded(e.extent,a)),"ci"===n?(t="mean",i="ci0",r="ci1"):(t="median",i="q1",r="q3"),u=[{op:i,field:l,as:"lower_"+l},{op:r,field:l,as:"upper_"+l},{op:t,field:l,as:"center_"+l}],f=[{fieldPrefix:"upper_",titlePrefix:Yu({field:l,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Yu({field:l,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Yu({field:l,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&as(is.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent)),"aggregated-upper-lower"===o?(f=[],c=[{calculate:`datum["${n.field}"]`,as:"upper_"+l},{calculate:`datum["${l}"]`,as:"lower_"+l}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:l}],c=[{calculate:`datum["${l}"] + datum["${i.field}"]`,as:"upper_"+l}],r?c.push({calculate:`datum["${l}"] + datum["${r.field}"]`,as:"lower_"+l}):c.push({calculate:`datum["${l}"] - datum["${i.field}"]`,as:"lower_"+l}));for(const e of c)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:mo(mo(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}(c,d,g,p,h,f,t,n),A=o,O=m,C=(A[O],"x"===m?"x2":"y2"),F=(A[C],"x"===m?"xError":"yError"),D=(A[F],"x"===m?"xError2":"yError2"),j=(A[D],w(A,["symbol"==typeof O?O:O+"","symbol"==typeof C?C:C+"","symbol"==typeof F?F:F+"","symbol"==typeof D?D:D+""])),{bins:k,timeUnits:E,aggregate:S,groupby:$,encoding:N}=mc(j,n),M=[...S,...b],B="raw"!==f?[]:$,_=Ac(y,d,N,x);return{transform:[...null!==(i=u.transform)&&void 0!==i?i:[],...k,...E,...0===M.length?[]:[{aggregate:M,groupby:B}],...v],groupby:B,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:N,ticksOrient:"vertical"===l?"horizontal":"vertical",markDef:c,outerSpec:u,tooltipEncoding:_}}function Pc(e,t,n){return fo(e)+" "+n+" "+t}const Lc=oo({band:1,borders:1}),Rc=new Po("errorband",qc);function qc(e,{config:t}){const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=Uc(e,"errorband",t),c=a,l=Cc(c,r,i,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},g={type:f?"line":"rule"};const p=Object.assign(Object.assign({},c.interpolate?{interpolate:c.interpolate}:{}),c.tension&&c.interpolate?{tension:c.tension}:{});return f?(d=Object.assign(Object.assign({},d),p),g=Object.assign(Object.assign({},g),p)):c.interpolate?as(is.errorBand1DNotSupport("interpolate")):c.tension&&as(is.errorBand1DNotSupport("tension")),Object.assign(Object.assign({},s),{transform:n,layer:[...l({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...l({partName:"borders",mark:g,positionPrefix:"lower",extraEncoding:u}),...l({partName:"borders",mark:g,positionPrefix:"upper",extraEncoding:u})]})}const Ic={};function Wc(e,t,n){const i=new Po(e,t);Ic[e]={normalizer:i,parts:n}}Wc("boxplot",Nc,Ec),Wc("errorbar",Tc,Bc),Wc("errorband",qc,Lc);const Hc=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],Gc=oo({size:1,shape:1,fill:1,stroke:1,strokeDash:1,strokeWidth:1,opacity:1}),Yc={fillColor:{part:"legend",vgProp:"fill"},gradientStrokeColor:{part:"gradient",vgProp:"stroke"},labelColor:{part:"labels",vgProp:"fill"},strokeColor:{part:"legend",vgProp:"stroke"},symbolFillColor:{part:"symbols",vgProp:"fill"},symbolStrokeColor:{part:"symbols",vgProp:"stroke"},titleColor:{part:"title",vgProp:"fill"}},Vc={single:{on:"click",fields:["_vgsid_"],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:["_vgsid_"],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Xc(e){return!(!e||"legend"!==e&&!e.legend)}function Jc(e){return Xc(e)&&a(e)}function Qc(e){return void 0!==e.concat}function Zc(e){return void 0!==e.vconcat}function Kc(e){return void 0!==e.hconcat}function el(e){return void 0!==e.repeat}function tl(e){return a(e)&&void 0!==e.step}function nl(e){return e.view||e.width||e.height}const il=oo({align:1,bounds:1,center:1,columns:1,spacing:1});function rl(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e["width"===t?"continuousWidth":"continuousHeight"]}function ol(e,t){const n=al(e,t);return tl(n)?n.step:sl}function al(e,t){var n;return vo(null!==(n=e[t])&&void 0!==n?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const sl=20,ul={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:sl},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},area:{},bar:To,circle:{},geoshape:{},image:{},line:{},point:{},rect:zo,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},axis:{},axisX:{},axisY:{},axisLeft:{},axisRight:{},axisTop:{},axisBottom:{},axisBand:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Vc,style:{},title:{},facet:{spacing:20},repeat:{spacing:20},concat:{spacing:20}},cl=zr("tableau10"),ll={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},fl={blue:cl[0],orange:cl[1],red:cl[2],teal:cl[3],green:cl[4],yellow:cl[5],purple:cl[6],pink:cl[7],brown:cl[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function dl(e={}){const{color:t,font:n,fontSize:i}=e,r=w(e,["color","font","fontSize"]);return d({},ul,n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:a(e)?Object.assign(Object.assign({},fl),e):fl}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},i?function(e){return{signals:[{name:"fontSize",value:a(e)?Object.assign(Object.assign({},ll),e):ll}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},r||{})}const gl=["view",...$o],pl=["color","fontSize","background","padding","facet","concat","repeat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","scale","selection","overlay"],hl=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function ml(e){e=Hr(e);for(const t of pl)delete e[t];if(e.axis)for(const t in e.axis)Oo(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Hc)delete e.legend[t];if(e.mark)for(const t of Bo)delete e.mark[t];for(const t of gl){for(const n of Bo)delete e[t][n];const n=hl[t];if(n)for(const i of n)delete e[t][i];bl(e,t)}for(const t of oo(Ic))delete e[t];!function(e){const{mark:t,subtitle:n}=La(e.title),i=Object.assign(Object.assign({},e.style["group-title"]),t);oo(i).length>0&&(e.style["group-title"]=i);oo(n).length>0?e.title=n:delete e.title}(e);for(const t in e)a(e[t])&&0===oo(e[t]).length&&delete e[t];return oo(e).length>0?e:void 0}function bl(e,t,n,i){const r=i?e[t][i]:e[t];"view"===t&&(n="cell");const o=Object.assign(Object.assign({},r),e.style[null!=n?n:t]);oo(o).length>0&&(e.style[null!=n?n:t]=o),i||delete e[t]}function vl(e){return void 0!==e.layer}class yl{map(e,t){return ju(e)?this.mapFacet(e,t):el(e)?this.mapRepeat(e,t):Kc(e)?this.mapHConcat(e,t):Zc(e)?this.mapVConcat(e,t):Qc(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(vl(e))return this.mapLayer(e,t);if(Uo(e))return this.mapUnit(e,t);throw new Error(is.invalidSpec(e))}mapLayer(e,t){return Object.assign(Object.assign({},e),{layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const{concat:n}=e,i=w(e,["concat"]);return Object.assign(Object.assign({},i),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const xl={zero:1,center:1,normalize:1};const wl=["bar","area","rule","point","circle","square","line","text","tick"],Al=["bar","area"];function Ol(e,t,n={}){const i=No(e)?e.type:e;if(!Qr(wl,i))return null;const r=function(e){const t=e.x,n=e.y;if(Bu(t)&&Bu(n))if("quantitative"===t.type&&"quantitative"===n.type){if(t.stack)return"x";if(n.stack)return"y";if(!!t.aggregate!=!!n.aggregate)return t.aggregate?"x":"y"}else{if("quantitative"===t.type)return"x";if("quantitative"===n.type)return"y"}else{if(Bu(t)&&"quantitative"===t.type)return"x";if(Bu(n)&&"quantitative"===n.type)return"y"}}(t);if(!r)return null;const o=t[r],a=Tu(o)?Ru(o,{}):void 0,s="x"===r?"y":"x",u=t[s],c=Tu(u)?Ru(u,{}):void 0,l=Da.reduce((e,n)=>{if("tooltip"!==n&&pc(t,n)){h(t[n]).forEach(t=>{const i=Zu(t);if(i.aggregate)return;const r=Tu(i)?Ru(i,{}):void 0;(!r||r!==c&&r!==a)&&e.push({channel:n,fieldDef:i})})}return e},[]);let f;if(void 0!==o.stack?f=v(o.stack)?o.stack?"zero":null:o.stack:l.length>0&&Qr(Al,i)&&(f="zero"),!f||!xl[f])return null;if(hc(t)&&0===l.length)return null;if(o.scale&&o.scale.type&&o.scale.type!==Rs.LINEAR){if(n.disallowNonLinearStack)return null;as(is.cannotStackNonLinearScale(o.scale.type))}return pc(t,r===Jo?Zo:Ko)?(void 0!==o.stack&&as(is.cannotStackRangedMark(r)),null):(o.aggregate&&!Qr(Yo,o.aggregate)&&as(is.stackNonSummativeAggregate(o.aggregate)),{groupbyChannel:u?s:void 0,groupbyField:c,fieldChannel:r,impute:null!==o.impute&&Eo(i),stackBy:l,offset:f})}function Cl(e){const t=w(e,["point","line"]);return oo(t).length>1?t:t.type}function Fl(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:Yr(e[t],["point","line"])}));return e}function Dl(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?a(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?a(t.point)?t.point:{}:void 0}function jl(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class kl{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(Uo(e)){const{mark:n,encoding:i}=e,r=No(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!Dl(r,t[r.type],i);case"area":return!!Dl(r,t[r.type],i)||!!jl(r,t[r.type])}}return!1}run(e,t,n){const{config:i}=t,{selection:r,projection:o,encoding:a,mark:s}=e,u=w(e,["selection","projection","encoding","mark"]),c=No(s)?s:{type:s},l=Dl(c,i[c.type],a),f="area"===c.type&&jl(c,i[c.type]),d=[Object.assign(Object.assign({},r?{selection:r}:{}),{mark:Cl(Object.assign(Object.assign({},"area"===c.type&&void 0===c.opacity&&void 0===c.fillOpacity?{opacity:.7}:{}),c)),encoding:Yr(a,["shape"])})],g=Ol(c,a);let p=a;if(g){const{fieldChannel:e,offset:t}=g;p=Object.assign(Object.assign({},a),{[e]:Object.assign(Object.assign({},a[e]),t?{stack:t}:{})})}return f&&d.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"line"},Gr(c,["clip","interpolate","tension","tooltip"])),f),encoding:p})),l&&d.push(Object.assign(Object.assign({},o?{projection:o}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},Gr(c,["clip","tooltip"])),l),encoding:p})),n(Object.assign(Object.assign({},u),{layer:d}),Object.assign(Object.assign({},t),{config:Fl(i)}))}}class El{constructor(){this.name="RangeStep"}hasMatchingType(e){var t;if(Uo(e)&&e.encoding)for(const n of ka){const i=e.encoding[n];if(i&&Bu(i)&&(null===(t=null==i?void 0:i.scale)||void 0===t?void 0:t.rangeStep))return!0}return!1}run(e){var t;const n={};let i=Object.assign({},e.encoding);for(const e of ka){const r=Ea(e),o=i[e];if(o&&Bu(o)&&(null===(t=null==o?void 0:o.scale)||void 0===t?void 0:t.rangeStep)){const{scale:t}=o,a=w(o,["scale"]),s=w(t,["rangeStep"]);n[r]={step:t.rangeStep},as(is.RANGE_STEP_DEPRECATED),i=Object.assign(Object.assign({},i),{[e]:Object.assign(Object.assign({},a),oo(s).length>0?{scale:s}:{})})}}return Object.assign(Object.assign(Object.assign({},n),e),{encoding:i})}}class Sl{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(Uo(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of wa){const n=t[Oa(e)];if(t[e]&&Bu(n)&&!lc(n.bin))return!0}}return!1}run(e,t,n){const{encoding:i}=e;return as(is.lineWithRange(!!i.x2,!!i.y2)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}function $l(e){const{parentEncoding:t,encoding:n}=e;if(t&&n){const e=oo(t).reduce((e,t)=>(n[t]&&e.push(t),e),[]);e.length>0&&as(is.encodingOverridden(e))}const i=Object.assign(Object.assign({},null!=t?t:{}),null!=n?n:{});return oo(i).length>0?i:void 0}function Nl(e){const{parentProjection:t,projection:n}=e;return t&&n&&as(is.projectionOverridden({parentProjection:t,projection:n})),null!=n?n:t}function Ml(e,t){void 0===t&&(t=dl(e.config));const n=function(e,t={}){return Bl.map(e,{config:t})}(e,t),{width:i,height:r}=e,o=function(e,t,n){let{width:i,height:r}=t;const o=Uo(e)||vl(e),a={};o?"container"==i&&"container"==r?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==r&&(a.type="fit-y",a.contains="padding"):("container"==i&&(as(is.containerSizeNonSingle("width")),i=void 0),"container"==r&&(as(is.containerSizeNonSingle("height")),r=void 0));const s=Object.assign(Object.assign(Object.assign({type:"pad"},a),n?_l(n.autosize):{}),_l(e.autosize));"fit"!==s.type||o||(as(is.FIT_NON_SINGLE),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&as(is.containerSizeNotCompatibleWithAutosize("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&as(is.containerSizeNotCompatibleWithAutosize("height"));if(Wr(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:e.autosize},t);return Object.assign(Object.assign({},n),o?{autosize:o}:{})}const Bl=new class extends yl{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Sc,_c,Rc,new kl,new Sl,new El]}map(e,t){if(Uo(e)){const n=pc(e.encoding,Xo),i=pc(e.encoding,"column"),r=pc(e.encoding,"facet");if(n||i||r)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t;if(n||i)return this.mapUnitWithParentEncodingOrProjection(e,t);const r=this.mapLayerOrUnit.bind(this);for(const n of this.nonFacetUnitNormalizers)if(n.hasMatchingType(e,t.config))return n.run(e,t,r);return e}mapRepeat(e,t){const{repeat:n}=e;return!o(n)&&e.columns&&(e=Yr(e,["columns"]),as(is.columnsNotSupportByRowCol("repeat"))),Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapFacet(e,t){const{facet:n}=e;return Du(n)&&e.columns&&(e=Yr(e,["columns"]),as(is.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:r,parentProjection:o,config:a}=t,s=Nl({parentProjection:o,projection:i}),u=$l({parentEncoding:r,encoding:n});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),s?{projection:s}:{}),u?{encoding:u}:{}),{config:a})}mapFacetedUnit(e,t){const n=e.encoding,{row:i,column:r,facet:o}=n,a=w(n,["row","column","facet"]),{mark:s,width:u,projection:c,height:l,view:f,selection:d,encoding:g}=e,p=w(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:h,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o});return this.mapFacet(Object.assign(Object.assign(Object.assign({},p),m),{facet:h,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u?{width:u}:{}),l?{height:l}:{}),f?{view:f}:{}),c?{projection:c}:{}),{mark:s,encoding:a}),d?{selection:d}:{})}),t)}getFacetMappingAndLayout(e){var t;const{row:n,column:i,facet:r}=e;if(n||i){r&&as(is.facetChannelDropped([...n?[Xo]:[],...i?["column"]:[]]));const o={},a={};for(const n of[Xo,"column"]){const i=e[n];if(i){const e=w(i,["align","center","spacing","columns"]);o[n]=e;for(const e of["align","center","spacing"])void 0!==i[e]&&(a[e]=null!==(t=a[e])&&void 0!==t?t:{},a[e][n]=i[e])}}return{facetMapping:o,layout:a}}{const{align:e,center:t,spacing:n,columns:i}=r;return{facetMapping:w(r,["align","center","spacing","columns"]),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),t?{center:t}:{}),n?{spacing:n}:{}),i?{columns:i}:{})}}}mapLayer(e,t){var{parentEncoding:n,parentProjection:i}=t,r=w(t,["parentEncoding","parentProjection"]);const{encoding:o,projection:a}=e,s=w(e,["encoding","projection"]),u=Object.assign(Object.assign({},r),{parentEncoding:$l({parentEncoding:n,encoding:o}),parentProjection:Nl({parentProjection:i,projection:a})});return super.mapLayer(s,u)}};function _l(e){return s(e)?{type:e}:null!=e?e:{}}const Tl=["background","padding"];function zl(e){return Tl.reduce((t,n)=>(e&&void 0!==e[n]&&(t[n]=e[n]),t),{})}function Ul(e){return!!e.url}function Pl(e){return!!e.values}function Ll(e){return!(!e.name||Ul(e)||Pl(e)||Rl(e))}function Rl(e){return e&&(ql(e)||Il(e)||Wl(e))}function ql(e){return!!e.sequence}function Il(e){return!!e.sphere}function Wl(e){return!!e.graticule}const Hl="main";function Gl(e){return void 0!==e.filter}function Yl(e){return void 0!==e.lookup}function Vl(e){return void 0!==e.pivot}function Xl(e){return void 0!==e.density}function Jl(e){return void 0!==e.quantile}function Ql(e){return void 0!==e.regression}function Zl(e){return void 0!==e.loess}function Kl(e){return void 0!==e.sample}function ef(e){return void 0!==e.window}function tf(e){return void 0!==e.joinaggregate}function nf(e){return void 0!==e.flatten}function rf(e){return void 0!==e.calculate}function of(e){return!!e.bin}function af(e){return void 0!==e.impute}function sf(e){return void 0!==e.timeUnit}function uf(e){return void 0!==e.aggregate}function cf(e){return void 0!==e.stack}function lf(e){return void 0!==e.fold}function ff(e,t,n){return df=t||pf,gf=n||mf,vf(e.trim()).map(yf)}var df,gf,pf="view",hf=/[[\]{}]/,mf={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function bf(e,t,n,i,r){for(var o,a=0,s=e.length;t<s;++t){if(o=e[t],!a&&o===n)return t;r&&r.indexOf(o)>=0?--a:i&&i.indexOf(o)>=0&&++a}return t}function vf(e){for(var t=[],n=0,i=e.length,r=0;r<i;)r=bf(e,r,",","[{","]}"),t.push(e.substring(n,r).trim()),n=++r;if(0===t.length)throw"Empty event selector: "+e;return t}function yf(e){return"["===e[0]?function(e){var t,n,i=e.length,r=1;if((r=bf(e,r,"]","[","]"))===i)throw"Empty between selector: "+e;if(2!==(t=vf(e.substring(1,r))).length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+e;if(t=t.map(yf),(n=yf(e.slice(1).trim())).between)return{between:t,stream:n};n.between=t;return n}(e):function(e){var t,n,i={source:df},r=[],o=[0,0],a=0,s=0,u=e.length,c=0;if("}"===e[u-1]){if(!((c=e.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+e;try{o=function(e){var t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){var n=+t;if(n!=n)throw e;return n}))}(e.substring(c+1,u-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,c).trim(),u=e.length,c=0}if(!u)throw e;"@"===e[0]&&(a=++c);(t=bf(e,c,":"))<u&&(r.push(e.substring(s,t).trim()),s=c=++t);if((c=bf(e,c,"["))===u)r.push(e.substring(s,u).trim());else if(r.push(e.substring(s,c).trim()),n=[],(s=++c)===u)throw"Unmatched left bracket: "+e;for(;c<u;){if((c=bf(e,c,"]"))===u)throw"Unmatched left bracket: "+e;if(n.push(e.substring(s,c).trim()),c<u-1&&"["!==e[++c])throw"Expected left bracket: "+e;s=++c}if(!(u=r.length)||hf.test(r[u-1]))throw"Invalid event selector: "+e;u>1?(i.type=r[1],a?i.markname=r[0].slice(1):!function(e){return gf[e]}(r[0])?i.source=r[0]:i.marktype=r[0]):i.type=r[0];"!"===i.type.slice(-1)&&(i.consume=!0,i.type=i.type.slice(0,-1));null!=n&&(i.filter=n);o[0]&&(i.throttle=o[0]);o[1]&&(i.debounce=o[1]);return i}(e)}function xf(e,t,n,i){const r=t&&t.condition,o=i(t);if(r){return{[n]:[...h(r).map(t=>{const n=i(t),r=function(e){return e.selection}(t)?Rg(e,t.selection):Ig(e,t.test);return Object.assign({test:r},n)}),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function wf(e){const{channel:t,channelDef:n,markDef:i,scale:r}=e,o=jf(e);return Bu(n)&&!Go(n.aggregate)&&r&&nu(r.get("type"))&&!1===r.get("zero")?Af({fieldDef:n,channel:t,markDef:i,ref:o}):o}function Af({fieldDef:e,channel:t,markDef:n,ref:i}){return Eo(n.type)?i:[Of(e,t),i]}function Of(e,t){const n=Cf(e,!0),i="x"===Oa(t)?{value:0}:{field:{group:"height"}};return Object.assign({test:n},i)}function Cf(e,t=!0){return Us(s(e)?e:Ru(e,{expr:"datum"}),!t)}function Ff(e,t,n,i){const r=Object.assign(Object.assign({},t?{scale:t}:{}),{field:Ru(e,n)});if(i){const{offset:e,band:t}=i;return Object.assign(Object.assign(Object.assign({},r),e?{offset:e}:{}),t?{band:t}:{})}return r}function Df({scaleName:e,fieldDef:t,fieldDef2:n,offset:i,startSuffix:r,band:o=.5}){const a=0<o&&o<1?"datum":void 0,s=Ru(t,{expr:a,suffix:r}),u=void 0!==n?Ru(n,{expr:a}):Ru(t,{suffix:"end",expr:a});if(0===o)return Object.assign({scale:e,field:s},i?{offset:i}:{});if(1===o)return Object.assign({scale:e,field:u},i?{offset:i}:{});{const t=`${o} * ${s} + ${1-o} * ${u}`;return Object.assign({signal:`scale("${e}", ${t})`},i?{offset:i}:{})}}function jf({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:a,stack:s,offset:u,defaultRef:c}){if(t){if(Bu(t)){if(_u(t)){const a=Su(e,t,n,i,r,{isMidPoint:!0});if(cc(t.bin)||a&&t.timeUnit)return Qr([Jo,Qo],e)&&Qr(["quantitative","temporal"],t.type)?s&&s.impute?Ff(t,o,{binSuffix:"mid"},{offset:u}):Df({scaleName:o,fieldDef:t,band:a,offset:u}):Ff(t,o,sc(t,e)?{binSuffix:"range"}:{},{offset:u});if(lc(t.bin)){if(Bu(n))return Df({scaleName:o,fieldDef:t,fieldDef2:n,band:a,offset:u});{const t=e===Jo?Zo:Ko;as(is.channelRequiredForBinned(t))}}}if(a){const e=a.get("type");if(eu(e)){if("band"===e){return Ff(t,o,{binSuffix:"range"},{band:vo(Pu(t)?t.band:void 0,.5),offset:u})}return Ff(t,o,{binSuffix:"range"},{offset:u})}}return Ff(t,o,{},{offset:u})}if(zu(t)){const n=t.value,i=u?{offset:u}:{};return Object.assign(Object.assign({},kf(e,n)),i)}if(qa(t))return t}const l="function"==typeof c?Object.assign(Object.assign({},c()),u?{offset:u}:{}):c;return l?Object.assign(Object.assign({},l),u?{offset:u}:{}):l}function kf(e,t){return Qr(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:Qr(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:Ya(t)}function Ef(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:a=e}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u=null!=u?u:a===e?i[e]:vo(i[e],i[a],Ja(e,i,o,{vgChannel:a})),void 0!==u&&(s=Ya(u)));const c=r[e];return xf(t,c,a,n=>jf({channel:e,channelDef:n,markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s}))}function Sf(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,a=vo(t.filled,n.filled),s={fill:Ja("fill",n,r),stroke:Ja("stroke",n,r),color:Ja("color",n,r)},u=Qr(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,c=vo(n.fill,!0===a?n.color:void 0,s.fill,!0===a?s.color:void 0,u),l=vo(n.stroke,!1===a?n.color:void 0,s.stroke,!1===a?s.color:void 0),f=a?"fill":"stroke",d=Object.assign(Object.assign({},c?{fill:Ya(c)}:{}),l?{stroke:Ya(l)}:{});return n.color&&(a?n.fill:n.stroke)&&as(is.droppingColor("property",{fill:"fill"in n,stroke:"stroke"in n})),Object.assign(Object.assign(Object.assign(Object.assign({},d),Ef("color",e,{vgChannel:f,defaultValue:a?c:l})),Ef("fill",e,{defaultValue:i.fill?c:void 0})),Ef("stroke",e,{defaultValue:i.stroke?l:void 0}))}function $f(e,t="text"){const n=e.encoding[t];return xf(e,n,t,t=>Nf(t,e.config))}function Nf(e,t,n="datum"){if(e){if(zu(e))return{value:e.value};if(_u(e)){const{format:i,formatType:r}=Ju(e);return hu({fieldDef:e,format:i,formatType:r,expr:n,config:t})}}}function Mf(e,t={}){const{encoding:n,markDef:i,config:r}=e,u=n.tooltip;return o(u)?{tooltip:Bf({tooltip:u},r,t)}:xf(e,u,"tooltip",o=>{const u=Nf(o,e.config,t.reactiveGeom?"datum.datum":"datum");if(u)return u;if(null===o)return;let c=vo(i.tooltip,Ja("tooltip",i,r));return!0===c&&(c={content:"encoding"}),s(c)?{value:c}:a(c)?"encoding"===c.content?Bf(n,r,t):{signal:"datum"}:void 0})}function Bf(e,t,{reactiveGeom:n}={}){const i=[],r={},o={},a=n?"datum.datum":"datum",s=[];function c(n,i){const r=Oa(i),u=_u(n)?n:Object.assign(Object.assign({},n),{type:e[r].type}),c=h(Yu(u,t,{allowDisabling:!1})).join(", ");let l=Nf(u,t,a).signal;if("x"===i||"y"===i){const n="x"===i?"x2":"y2",r=Qu(e[n]);if(lc(u.bin)&&r){const e=Ru(u,{expr:a}),i=Ru(r,{expr:a}),{format:s,formatType:c}=Ju(u);l=yu(e,i,s,c,t),o[n]=!0}}s.push({channel:i,key:c,value:l})}yc(e,(e,t)=>{Bu(e)?c(e,t):Mu(e)&&c(e.condition,t)});for(const{channel:e,key:t,value:n}of s)o[e]||r[t]||(i.push(`${u(t)}: ${n}`),r[t]=!0);return i.length>0?{signal:`{${i.join(", ")}}`}:void 0}function _f(e,t){const n=t[e+"Offset"];if(n)return n}function Tf(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:a,stack:s}=t,u=r[e],c=r[e===Jo?Zo:Ko],l=t.scaleName(e),f=t.getScaleComponent(e),d=_f(e,o),g=zf({model:t,defaultPos:n,channel:e,scaleName:l,scale:f});return{[null!=i?i:e]:u||!r.latitude&&!r.longitude?function(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o}=e;if(Bu(n)&&r&&t===r.fieldChannel)return Pu(n)&&void 0!==n.band?Df({scaleName:i,fieldDef:n,startSuffix:"start",band:n.band,offset:0}):Ff(n,i,{suffix:"end"},{offset:o});return wf(e)}({channel:e,channelDef:u,channel2Def:c,markDef:o,config:a,scaleName:l,scale:f,stack:s,offset:d,defaultRef:g}):{field:t.getName(e)}}}function zf({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:a}=e;return()=>{const s=Oa(n),u=vo(o[n],Ja(n,o,a));if(void 0!==u)return kf(n,u);if("zeroOrMin"===t||"zeroOrMax"===t){if(i){const e=r.get("type");if(Qr([Rs.LOG,Rs.TIME,Rs.UTC],e));else if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}return"zeroOrMin"===t?"x"===s?{value:0}:{field:{group:"height"}}:"x"===s?{field:{group:"width"}}:{value:0}}{const t=e["x"===s?"width":"height"];return Object.assign(Object.assign({},t),{mult:.5})}}}const Uf={left:"x",center:"xc",right:"x2"},Pf={top:"y",middle:"yc",bottom:"y2"};function Lf(e,t,n){const i="x"===e?"align":"baseline",r=vo(t[i],Ja(i,t,n));return"x"===e?Uf[null!=r?r:"center"]:Pf[null!=r?r:"middle"]}function Rf(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?qf(e,t,{defaultPos:n,defaultPos2:i}):Tf(e,t,{defaultPos:n})}function qf(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,a="x"===e?"width":"height",s=function(e,t,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=e,u="x2"===n?"x":"y",c="x2"===n?"width":"height",l=i[u],f=e.scaleName(u),d=e.getScaleComponent(u),g=_f(n,e.markDef);if(!l&&(i.latitude||i.longitude))return{[n]:{field:e.getName(n)}};const p=function({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:a,stack:s,offset:u,defaultRef:c}){if(Bu(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return Ff(t,o,{suffix:"start"},{offset:u});return wf({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:i,config:r,offset:u,defaultRef:c})}({channel:n,channelDef:l,channel2Def:i[n],markDef:o,config:s,scaleName:f,scale:d,stack:a,offset:g,defaultRef:void 0});if(void 0!==p)return{[n]:p};const h=zf({model:e,defaultPos:t,channel:n,scaleName:f,scale:d})();return vo(If(n,o),If(n,{[n]:Qa(n,o,s.style),[c]:Qa(c,o,s.style)}),If(n,s[r]),If(n,s.mark),{[n]:h})}(t,i,"x"===e?"x2":"y2"),u=s[a]?Lf(e,r,o):e;return Object.assign(Object.assign({},Tf(e,t,{defaultPos:n,vgChannel:u})),s)}function If(e,t){const n="x2"===e?"width":"height";return t[e]?{[e]:kf(e,t[e])}:t[n]?{[n]:{value:t[n]}}:void 0}function Wf(e,t,n){var i,r,o,a;const{config:s,encoding:u,markDef:c}=e,l="x"===t?"x2":"y2",f="x"===t?"width":"height",d=u[t],g=u[l],p=e.getScaleComponent(t),h=p?p.get("type"):void 0,m=e.scaleName(t),b=c.orient,v=null!==(a=null!==(o=null!==(r=null!==(i=u[f])&&void 0!==i?i:u.size)&&void 0!==r?r:c[f])&&void 0!==o?o:c.size)&&void 0!==a?a:Ja("size",c,s,{vgChannel:f}),y="x"===t?"vertical"===b:"horizontal"===b;if(Bu(d)&&(cc(d.bin)||lc(d.bin)||d.timeUnit&&!g)&&!v&&!eu(h)){return function({fieldDef:e,fieldDef2:t,channel:n,band:i,scaleName:r,markDef:o,spacing:a=0,reverse:s}){const u=n===Jo?Zo:Ko;return cc(e.bin)||e.timeUnit?{[u]:Vf({channel:n,fieldDef:e,scaleName:r,markDef:o,band:(1-i)/2,offset:Yf(u,a,s)}),[n]:Vf({channel:n,fieldDef:e,scaleName:r,markDef:o,band:1-(1-i)/2,offset:Yf(n,a,s)})}:lc(e.bin)&&Bu(t)?{[u]:Ff(e,r,{},{offset:Yf(u,a,s)}),[n]:Ff(t,r,{},{offset:Yf(n,a,s)})}:void as(is.channelRequiredForBinned(u))}({fieldDef:d,fieldDef2:g,channel:t,markDef:c,scaleName:m,band:Su(t,d,void 0,c,s),spacing:vo(c.binSpacing,s[n].binSpacing),reverse:p.get("reverse")})}if((Bu(d)&&eu(h)||y)&&!g){if(Bu(d)&&h===Rs.BAND){return function(e,t,n,i){const r=n.scaleName(t),o="x"===t?"width":"height",{markDef:a,encoding:s,config:u}=n,c=Lf(t,a,u),l=_f(t,a),f={[c]:Ff(e,r,{},{band:.5,offset:l})};if(s.size||null!==a.size&&void 0!==a.size){if(a.orient){if(Zu(s.size)||zu(s.size))return Object.assign(Object.assign({},f),Ef("size",n,{vgChannel:o}));if(void 0!==a.size)return Object.assign(Object.assign({},f),{[o]:{value:a.size}})}else as(is.cannotApplySizeToNonOrientedMark(a.type))}if(void 0!==(null==i?void 0:i.value))return Object.assign(Object.assign({},f),{[o]:i});const{band:d=1}=e;return{[t]:Ff(e,r,{binSuffix:"range"},{band:(1-d)/2,offset:l}),[o]:null!=i?i:Gf(r,d)}}(d,t,e,Hf(n,c,f,m,p,s,Pu(d)?d.band:void 0))}return function(e,t,n){const i="x"===e?"xc":"yc",r="x"===e?"width":"height";return Object.assign(Object.assign({},Tf(e,t,{defaultPos:"mid",vgChannel:i})),Ef("size",t,{defaultRef:n,vgChannel:r}))}(t,e,Hf(n,c,f,m,p,s))}return qf(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Hf(e,t,n,i,r,o,a){const s=vo(t[n],t.size,Ja("size",t,o,{vgChannel:n}));if(void 0!==s)return Ya(s);if(r){const t=r.get("type");if("point"===t||"band"===t){if(void 0!==o[e].discreteBandSize)return{value:o[e].discreteBandSize};if(t===Rs.POINT){const e=r.get("range");return Ia(e)&&y(e.step)?{value:e.step-2}:{value:sl-2}}return Gf(i,a)}return{value:o[e].continuousBandSize}}const u=ol(o.view,n);return{value:vo(o[e].discreteBandSize,u-2)}}function Gf(e,t=!0){return{scale:e,band:t}}function Yf(e,t,n){if(qa(n))return"x"===e||"y2"===e?{signal:`${n.signal} ? ${t} : 0`}:{signal:`${n.signal} ? 0 : ${t}`};return{x:n?t:0,x2:n?0:t,y:n?0:t,y2:n?t:0}[e]}function Vf({channel:e,fieldDef:t,scaleName:n,markDef:i,band:r,offset:o}){return Af({fieldDef:t,channel:e,markDef:i,ref:Df({scaleName:n,fieldDef:t,band:r,offset:o})})}function Xf(e,t){const{fill:n,stroke:i}="include"===t.color?Sf(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return Ha.reduce((n,i)=>(void 0!==e[i]&&"ignore"!==t[i]&&(n[i]={value:e[i]}),n),{})}(e.markDef,t)),Jf(e,"fill",n)),Jf(e,"stroke",i)),Ef("opacity",e)),Ef("fillOpacity",e)),Ef("strokeOpacity",e)),Ef("strokeWidth",e)),Ef("strokeDash",e)),Mf(e)),$f(e,"href"))}function Jf(e,t,n){const{config:i,mark:r,markDef:o}=e;if("hide"===Xa("invalid",o,i)&&n&&!Eo(r)){const i=function(e,{invalid:t=!1,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum"});o&&tu(r)&&(t[o]=!0)}return t},{}),r=oo(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Cf(e,t)).join(` ${e} `)}return}(e,{invalid:!0,channels:Ba});if(i)return{[t]:[{test:i,value:null},...h(n)]}}return n?{[t]:n}:{}}function Qf(e){const{config:t,markDef:n}=e;if(Xa("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum"});o&&tu(r)&&(t[o]=!0)}return t},{}),r=oo(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Cf(e,t)).join(` ${e} `)}return}(e,{channels:["x","y"]});if(t)return{defined:{signal:t}}}return{}}function Zf(e,t){if(void 0!==t)return{[e]:{value:t}}}const Kf={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName("voronoi")},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(Eo(o))return as(is.nearestNotSupportForContinuous(o)),n;const a={name:e.getName("voronoi"),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},Mf(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach((t,n)=>{var i;const r=null!==(i=t.name)&&void 0!==i?i:"";r===e.component.mark[0].name?s=n:r.indexOf("voronoi")>=0&&(u=!0)}),u||n.splice(s+1,0,a),n}};class ed{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?console.warn("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class td extends ed{constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,this._source=this._name=t,!this.refCounts||this._name in this.refCounts||(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${function(e){const t=++yo;return e?String(e)+t:t}()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class nd extends ed{constructor(e,t){super(e),this.formula=t}clone(){return new nd(null,Hr(this.formula))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{const{field:r,timeUnit:o}=n,a=bm(t)?t.encoding[Ca(i)]:void 0,s=bm(t)&&$u(i,n,a,t.markDef,t.config);if(o){const t=Ru(n,{forAs:!0});e[Xr({as:t,field:r,timeUnit:o})]=Object.assign({as:t,field:r,timeUnit:o},s?{band:!0}:{})}return e},{});return 0===oo(n).length?null:new nd(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:i}=n,r=w(n,["timeUnit"]),o=Ds(i),a=Object.assign(Object.assign({},r),{timeUnit:o});return new nd(e,{[Xr(a)]:a})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(ao(this.formula).map(e=>e.as))}dependentFields(){return new Set(ao(this.formula).map(e=>e.field))}hash(){return`TimeUnit ${Xr(this.formula)}`}assemble(){const e=[];for(const t of ao(this.formula)){const{field:n,as:i,timeUnit:r}=t,o=Ds(r),{unit:a,utc:s}=o,u=w(o,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:n,type:"timeunit"},a?{units:As(a)}:{}),s?{timezone:"utc"}:{}),u),{as:[i,`${i}_end`]}))}return e}}class id{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const rd={has:e=>"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!Xc(e.bind),parse:(e,t,n,i)=>{i.on||delete t.events,i.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,a=t.init&&t.init[0],s=Kf.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((e,r)=>{var c,l;const f=uo(`${i}_${e.field}`);n.filter(e=>e.name===f).length||n.unshift(Object.assign(Object.assign({name:f},a?{init:vd(a[r])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${u(e.field)}] : null`}]:[],bind:null!==(l=null!==(c=o[e.field])&&void 0!==c?c:o[e.channel])&&void 0!==l?l:o}))}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.filter(e=>e.name===i+kd)[0],a=i+"_tuple_fields",s=r.items.map(e=>uo(`${i}_${e.field}`)),u=s.map(e=>`${e} !== null`).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},od={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+"_toggle",value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+kd,i=t.name+"_toggle";return`${i} ? null : ${n}, `+("global"===t.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${Md(e)}}, `)+`${i} ? ${n} : null`}},ad={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=s(n.clear)?ff(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>(rd.has(t)&&t.project.items.forEach(e=>{const i=n.findIndex(n=>n.name===uo(`${t.name}_${e.field}`));-1!==i&&n[i].on.push({events:t.clear,update:"null"})}),n),signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)t.project.items.forEach(e=>{const t=n.findIndex(t=>t.name===e.signals.visual);if(i(t,"[0, 0]"),-1===t){i(n.findIndex(t=>t.name===e.signals.data),"null")}});else{let e=n.findIndex(e=>e.name===t.name+kd);i(e,"null"),od.has(t)&&(e=n.findIndex(e=>e.name===t.name+"_toggle"),i(e,"false"))}return n}},sd={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!_a(r))continue;const o=e.getScaleComponent(r),a=o?o.get("type"):void 0;if(!o||!tu(a)){as(is.SCALE_BINDINGS_CONTINUOUS);continue}const s={selection:t.name,field:i.field};if(o.set("selectionExtent",s,!0),n.push(i),e.repeater&&e.repeater.row===e.repeater.column){e.getScaleComponent(r===Jo?Qo:Jo).set("selectionExtent",s,!0)}}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(e=>0===n.filter(t=>t.name===e.signals.data).length);if(!e.parent||cd(e)||0===i.length)return n;const r=n.filter(e=>e.name===t.name)[0];let o=r.update;if(o.indexOf(Sd)>=0)r.update=`{${i.map(e=>`${u(e.field)}: ${e.signals.data}`).join(", ")}}`;else{for(const e of i){const t=`${u(e.field)}: ${e.signals.data}`;o.indexOf(t)<0&&(o=`${o.substring(0,o.length-1)}, ${t}}`)}r.update=o}return n.concat(i.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!cd(e))for(const e of t.scales){const t=n.filter(t=>t.name===e.signals.data)[0];t.push="outer",delete t.value,delete t.update}return n}};function ud(e,t){return`domain(${u(e.scaleName(t))})`}function cd(e){var t;return e.parent&&wm(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:cd(e.parent.parent))}const ld={has:e=>{const t="global"===e.resolve&&e.bind&&Xc(e.bind),n=1===e.project.items.length&&"_vgsid_"!==e.project.items[0].field;return t&&!n&&as(is.LEGEND_BINDINGS_PROJECT_LENGTH),t&&n},parse:(e,t,n,i)=>{var r;if(i.on||delete t.events,i.clear||delete t.clear,i.on||i.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=h(null!==(r=n.filter)&&void 0!==r?r:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const o=Jc(t.bind)?t.bind.legend:"click",a=s(o)?ff(o,"view"):h(o);t.bind={legend:{merge:a}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Jc(t.bind)&&t.bind.legend,o=e=>t=>{const n=Hr(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a=`${uo(e.field)}_legend`,s=`${i}_${a}`;if(0===n.filter(e=>e.name===s).length){const e=r.merge.map(o(`${a}_symbols`)).concat(r.merge.map(o(`${a}_labels`))).concat(r.merge.map(o(`${a}_entries`)));n.unshift(Object.assign(Object.assign({name:s},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(e=>e.name===i+kd),a=i+"_tuple_fields",s=r.items.filter(e=>e.hasLegend).map(e=>uo(`${i}_${uo(e.field)}_legend`)),u=`${s.map(e=>`${e} !== null`).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map(e=>({signal:e})),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const c=n.find(e=>e.name===i+"_toggle"),l=Jc(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push(Object.assign(Object.assign({},c.on[0]),{events:l})):c.on[0].events=l),n}};const fd="_translate_delta",dd={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,r=sd.has(t),o=i+"_translate_anchor",{x:a,y:s}=t.project.hasChannel;let u=ff(t.translate,"scope");return r||(u=u.map(e=>(e.between[0].markname=i+wd,e))),n.push({name:o,value:{},on:[{events:u.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(r?ud(e,Jo):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(r?ud(e,Qo):`slice(${s.signals.visual})`):"")+"}"}]},{name:i+fd,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&gd(e,t,a,"width",n),void 0!==s&&gd(e,t,s,"height",n),n}};function gd(e,t,n,i,r){var o;const a=t.name,s=a+"_translate_anchor",u=a+fd,c=n.channel,l=sd.has(t),f=r.filter(e=>e.name===n.signals[l?"data":"visual"])[0],d=e.getSizeSignalRef(i).signal,g=e.getScaleComponent(c),p=g.get("type"),h=`${s}.extent_${c}`,m=`${l?"log"===p?"panLog":"pow"===p?"panPow":"panLinear":"panLinear"}(${h}, ${`${l&&c===Jo?"-":""}${u}.${c} / `+(l?`${d}`:`span(${h})`)}`+(l&&"pow"===p?`, ${null!==(o=g.get("exponent"))&&void 0!==o?o:1}`:"")+")";f.on.push({events:{signal:u},update:l?m:`clampRange(${m}, 0, ${d})`})}const pd={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=sd.has(t),o=i+"_zoom_delta",{x:a,y:s}=t.project.hasChannel,c=u(e.scaleName(Jo)),l=u(e.scaleName(Qo));let f=ff(t.zoom,"scope");return r||(f=f.map(e=>(e.markname=i+wd,e))),n.push({name:i+"_zoom_anchor",on:[{events:f,update:r?"{"+[c?`x: invert(${c}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(e=>!!e).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:f,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&hd(e,t,a,"width",n),void 0!==s&&hd(e,t,s,"height",n),n}};function hd(e,t,n,i,r){var o;const a=t.name,s=n.channel,u=sd.has(t),c=r.filter(e=>e.name===n.signals[u?"data":"visual"])[0],l=e.getSizeSignalRef(i).signal,f=e.getScaleComponent(s),d=f.get("type"),g=u?ud(e,s):c.name,p=a+"_zoom_delta",h=`${u?"log"===d?"zoomLog":"pow"===d?"zoomPow":"zoomLinear":"zoomLinear"}(${g}, ${`${a}_zoom_anchor.${s}`}, ${p}`+(u&&"pow"===d?`, ${null!==(o=f.get("exponent"))&&void 0!==o?o:1}`:"")+")";c.on.push({events:{signal:p},update:u?h:`clampRange(${h}, 0, ${l})`})}const md=[{has:()=>!0,parse:(e,t,n)=>{var i,r,o;const a=t.name,s=null!==(i=t.project)&&void 0!==i?i:t.project=new id,u={},c={},l=new Set,f=(e,t)=>{const n="visual"===t?e.channel:e.field;let i=uo(`${a}_${n}`);for(let e=1;l.has(i);e++)i=uo(`${a}_${n}_${e}`);return l.add(i),{[t]:i}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of h(n.init))for(const i of oo(e))ya[i]?(n.encodings||(n.encodings=[])).push(i):"interval"===n.type?(as('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(i);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(r=n.fields)&&void 0!==r?r:[]){const t={type:"E",field:e};t.signals=Object.assign({},f(t,"data")),s.items.push(t),s.hasField[e]=t}for(const i of null!==(o=n.encodings)&&void 0!==o?o:[]){const n=e.fieldDef(i);if(n){let r=n.field;if(n.aggregate){as(is.cannotProjectAggregate(i,n.aggregate));continue}if(!r){as(is.cannotProjectOnChannelWithoutField(i));continue}if(n.timeUnit){r=e.vgField(i);const t={timeUnit:n.timeUnit,as:r,field:n.field};c[Xr(t)]=t}if(!u[r]){let o="E";if("interval"===t.type){tu(e.getScaleComponent(i).get("type"))&&(o="R")}else n.bin&&(o="R-RE");const a={field:r,channel:i,type:o};a.signals=Object.assign(Object.assign({},f(a,"data")),f(a,"visual")),s.items.push(u[r]=a),s.hasField[r]=s.hasChannel[i]=u[r]}}else as(is.cannotProjectOnChannelWithoutField(i))}if(n.init){const e=e=>s.items.map(t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]);if("interval"===n.type)t.init=e(n.init);else{const i=h(n.init);t.init=i.map(e)}}oo(c).length>0&&(s.timeUnit=new nd(null,c))},signals:(e,t,n)=>{const i=t.name+"_tuple_fields";return n.filter(e=>e.name===i).length>0?n:n.concat({name:i,value:t.project.items.map(e=>{const t=w(e,["signals","hasLegend"]),n=Hr(t);return n.field=ho(n.field),n})})}},od,sd,ld,dd,pd,rd,Kf,ad];function bd(e,t){for(const n of md)n.has(e)&&t(n)}function vd(e,t=!0,n=l){if(o(e)){const i=e.map(e=>vd(e,t,n));return t?`[${i.join(", ")}]`:i}return ss(e)?n(t?gs(e):function(e){const t=ds(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function yd(e,t){return Nd(e,(n,i)=>{t=i.marks?i.marks(e,n,t):t,bd(n,i=>{i.marks&&(t=i.marks(e,n,t))})}),t}function xd(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}const wd="_brush",Ad={signals:(e,t)=>{const n=t.name,i=n+"_tuple_fields",r=sd.has(t),o=[],a=[],s=[];if(t.translate&&!r){const e=`!event.item || event.item.mark.name !== ${u(n+wd)}`;Od(t,(t,n)=>{var i;const r=h(null!==(i=n.between[0].filter)&&void 0!==i?i:n.between[0].filter=[]);return r.indexOf(e)<0&&r.push(e),t})}t.project.items.forEach((n,i)=>{const r=n.channel;if(r!==Jo&&r!==Qo)return void as("Interval selections only support x and y encoding channels.");const c=t.init?t.init[i]:null,l=function(e,t,n,i){const r=n.channel,o=n.signals.visual,a=n.signals.data,s=sd.has(t),c=u(e.scaleName(r)),l=e.getScaleComponent(r),f=l?l.get("type"):void 0,d=e=>`scale(${c}, ${e})`,g=e.getSizeSignalRef(r===Jo?"width":"height").signal,p=`${r}(unit)`,h=Od(t,(e,t)=>[...e,{events:t.between[0],update:`[${p}, ${p}]`},{events:t,update:`[${o}[0], clamp(${p}, 0, ${g})]`}]);return h.push({events:{signal:t.name+"_scale_trigger"},update:tu(f)?`[${d(`${a}[0]`)}, ${d(`${a}[1]`)}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},i?{init:vd(i,!0,d)}:{value:[]}),{on:h}),Object.assign(Object.assign({name:a},i?{init:vd(i)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${c}, ${o})`}]})]}(e,t,n,c),f=n.signals.data,d=n.signals.visual,g=u(e.scaleName(r)),p=tu(e.getScaleComponent(r).get("type"))?"+":"";o.push(...l),a.push(f),s.push({scaleName:e.scaleName(r),expr:`(!isArray(${f}) || `+`(${p}invert(${g}, ${d})[0] === ${p}${f}[0] && `+`${p}invert(${g}, ${d})[1] === ${p}${f}[1]))`})}),r||o.push({name:n+"_scale_trigger",value:{},on:[{events:s.map(e=>({scale:e.scaleName})),update:s.map(e=>e.expr).join(" && ")+` ? ${n+"_scale_trigger"} : {}`}]});const c=t.init,l=`unit: ${Md(e)}, fields: ${i}, values`;return o.concat(Object.assign(Object.assign({name:n+kd},c?{init:`{${l}: ${vd(c)}}`}:{}),{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+` ? {${l}: [${a}]} : null`}]}))},modifyExpr:(e,t)=>t.name+kd+", "+("global"===t.resolve?"true":`{unit: ${Md(e)}}`),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,a=r&&r.signals.visual,s=o&&o.signals.visual,c=`data(${u(t.name+jd)})`;if(sd.has(t))return n;const l={x:void 0!==r?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==r?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of oo(l))l[t]=[Object.assign({test:`${c}.length && ${c}[0].unit === ${Md(e)}`},l[t]),{value:0}];const f=t.mark,{fill:d,fillOpacity:g,cursor:p}=f,h=w(f,["fill","fillOpacity","cursor"]),m=oo(h).reduce((e,t)=>(e[t]=[{test:[void 0!==r&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(" && "),value:h[t]},{value:null}],e),{});return[{name:i+wd+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:d},fillOpacity:{value:g}},update:l}},...n,{name:i+wd,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},p?{cursor:{value:p}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),m)}}]}};function Od(e,t){return e.events.reduce((e,n)=>n.between?t(e,n):(as(`${n} is not an ordered event stream for interval selections.`),e),[])}function Cd(e,t){const n=t.name,i=n+"_tuple_fields",r=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=r.items.map(t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${o}[${u(e.vgField(t.channel,{}))}], `+`${o}[${u(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${o}[${u(t.field)}]`}).join(", "),s=`unit: ${Md(e)}, fields: ${i}, values`,c=t.events;return[{name:n+kd,on:c?[{events:c,update:`datum && item().mark.marktype !== 'group' ? {${s}: [${a}]} : null`,force:!0}]:[]}]}const Fd={signals:Cd,modifyExpr:(e,t)=>t.name+kd+", "+("global"===t.resolve?"null":`{unit: ${Md(e)}}`)},Dd={signals:Cd,modifyExpr:(e,t)=>t.name+kd+", "+("global"===t.resolve?"true":`{unit: ${Md(e)}}`)},jd="_store",kd="_tuple",Ed="_modify",Sd="vlSelectionResolve",$d={single:Dd,multi:Fd,interval:Ad};function Nd(e,t){const n=e.component.selection;if(n)for(const e of ao(n)){if(!0===t(e,$d[e.type]))break}}function Md(e,{escape:t}={escape:!0}){let n=t?u(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!vm(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of ha)e[t]&&(n+=` + '__facet_${t}_' + (facet[${u(i.vgField(t))}])`)}return n}function Bd(e){let t=!1;return Nd(e,e=>{t=t||e.project.items.some(e=>"_vgsid_"===e.field)}),t}var _d,Td,zd,Ud,Pd;function Ld(e){this.type=e}Ld.prototype.visit=function(e){var t,n,i;if(e(this))return 1;for(n=0,i=(t=function(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":var t=e.arguments.slice();return t.unshift(e.callee),t;case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this)).length;n<i;++n)if(t[n].visit(e))return 1};(_d={})[1]="Boolean",_d[2]="<end>",_d[3]="Identifier",_d[4]="Keyword",_d[5]="Null",_d[6]="Numeric",_d[7]="Punctuator",_d[8]="String",_d[9]="RegularExpression";var Rd=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),qd=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Id(e,t){if(!e)throw new Error("ASSERT: "+t)}function Wd(e){return e>=48&&e<=57}function Hd(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function Gd(e){return"01234567".indexOf(e)>=0}function Yd(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function Vd(e){return 10===e||13===e||8232===e||8233===e}function Xd(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&Rd.test(String.fromCharCode(e))}function Jd(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&qd.test(String.fromCharCode(e))}var Qd={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function Zd(){for(var e;zd<Ud&&(Yd(e=Td.charCodeAt(zd))||Vd(e));)++zd}function Kd(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)zd<Ud&&Hd(Td[zd])?(i=Td[zd++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):hg({},"Unexpected token %0","ILLEGAL");return String.fromCharCode(r)}function eg(){var e,t,n,i;for(t=0,"}"===(e=Td[zd])&&hg({},"Unexpected token %0","ILLEGAL");zd<Ud&&Hd(e=Td[zd++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&hg({},"Unexpected token %0","ILLEGAL"),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function tg(){var e,t;for(e=Td.charCodeAt(zd++),t=String.fromCharCode(e),92===e&&(117!==Td.charCodeAt(zd)&&hg({},"Unexpected token %0","ILLEGAL"),++zd,(e=Kd("u"))&&"\\"!==e&&Xd(e.charCodeAt(0))||hg({},"Unexpected token %0","ILLEGAL"),t=e);zd<Ud&&Jd(e=Td.charCodeAt(zd));)++zd,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Td.charCodeAt(zd)&&hg({},"Unexpected token %0","ILLEGAL"),++zd,(e=Kd("u"))&&"\\"!==e&&Jd(e.charCodeAt(0))||hg({},"Unexpected token %0","ILLEGAL"),t+=e);return t}function ng(){var e,t;return e=zd,{type:1===(t=92===Td.charCodeAt(zd)?tg():function(){var e,t;for(e=zd++;zd<Ud;){if(92===(t=Td.charCodeAt(zd)))return zd=e,tg();if(!Jd(t))break;++zd}return Td.slice(e,zd)}()).length?3:Qd.hasOwnProperty(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,value:t,start:e,end:zd}}function ig(){var e,t,n,i,r=zd,o=Td.charCodeAt(zd),a=Td[zd];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++zd,{type:7,value:String.fromCharCode(o),start:r,end:zd};default:if(61===(e=Td.charCodeAt(zd+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return zd+=2,{type:7,value:String.fromCharCode(o)+String.fromCharCode(e),start:r,end:zd};case 33:case 61:return zd+=2,61===Td.charCodeAt(zd)&&++zd,{type:7,value:Td.slice(r,zd),start:r,end:zd}}}return">>>="===(i=Td.substr(zd,4))?{type:7,value:i,start:r,end:zd+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:r,end:zd+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:7,value:t,start:r,end:zd+=2}:"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:r,end:++zd}:void hg({},"Unexpected token %0","ILLEGAL")}function rg(){var e,t,n;if(Id(Wd((n=Td[zd]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=zd,e="","."!==n){if(e=Td[zd++],n=Td[zd],"0"===e){if("x"===n||"X"===n)return++zd,function(e){for(var t="";zd<Ud&&Hd(Td[zd]);)t+=Td[zd++];return 0===t.length&&hg({},"Unexpected token %0","ILLEGAL"),Xd(Td.charCodeAt(zd))&&hg({},"Unexpected token %0","ILLEGAL"),{type:6,value:parseInt("0x"+t,16),start:e,end:zd}}(t);if(Gd(n))return function(e){for(var t="0"+Td[zd++];zd<Ud&&Gd(Td[zd]);)t+=Td[zd++];return(Xd(Td.charCodeAt(zd))||Wd(Td.charCodeAt(zd)))&&hg({},"Unexpected token %0","ILLEGAL"),{type:6,value:parseInt(t,8),octal:!0,start:e,end:zd}}(t);n&&Wd(n.charCodeAt(0))&&hg({},"Unexpected token %0","ILLEGAL")}for(;Wd(Td.charCodeAt(zd));)e+=Td[zd++];n=Td[zd]}if("."===n){for(e+=Td[zd++];Wd(Td.charCodeAt(zd));)e+=Td[zd++];n=Td[zd]}if("e"===n||"E"===n)if(e+=Td[zd++],"+"!==(n=Td[zd])&&"-"!==n||(e+=Td[zd++]),Wd(Td.charCodeAt(zd)))for(;Wd(Td.charCodeAt(zd));)e+=Td[zd++];else hg({},"Unexpected token %0","ILLEGAL");return Xd(Td.charCodeAt(zd))&&hg({},"Unexpected token %0","ILLEGAL"),{type:6,value:parseFloat(e),start:t,end:zd}}function og(){var e,t,n,i;return Pd=null,Zd(),e=zd,t=function(){var e,t,n,i;for(Id("/"===(e=Td[zd]),"Regular expression literal must start with a slash"),t=Td[zd++],n=!1,i=!1;zd<Ud;)if(t+=e=Td[zd++],"\\"===e)Vd((e=Td[zd++]).charCodeAt(0))&&hg({},"Invalid regular expression: missing /"),t+=e;else if(Vd(e.charCodeAt(0)))hg({},"Invalid regular expression: missing /");else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||hg({},"Invalid regular expression: missing /"),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";zd<Ud&&Jd((e=Td[zd]).charCodeAt(0));)++zd,"\\"===e&&zd<Ud?hg({},"Unexpected token %0","ILLEGAL"):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&hg({},"Invalid regular expression",n),{value:n,literal:t}}(),i=function(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(e,t){if(parseInt(t,16)<=1114111)return"x";hg({},"Invalid regular expression")})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){hg({},"Invalid regular expression")}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:zd}}function ag(){var e;return Zd(),zd>=Ud?{type:2,start:zd,end:zd}:Xd(e=Td.charCodeAt(zd))?ng():40===e||41===e||59===e?ig():39===e||34===e?function(){var e,t,n,i,r="",o=!1;for(Id("'"===(e=Td[zd])||'"'===e,"String literal must starts with a quote"),t=zd,++zd;zd<Ud;){if((n=Td[zd++])===e){e="";break}if("\\"===n)if((n=Td[zd++])&&Vd(n.charCodeAt(0)))"\r"===n&&"\n"===Td[zd]&&++zd;else switch(n){case"u":case"x":"{"===Td[zd]?(++zd,r+=eg()):r+=Kd(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:Gd(n)?(0!==(i="01234567".indexOf(n))&&(o=!0),zd<Ud&&Gd(Td[zd])&&(o=!0,i=8*i+"01234567".indexOf(Td[zd++]),"0123".indexOf(n)>=0&&zd<Ud&&Gd(Td[zd])&&(i=8*i+"01234567".indexOf(Td[zd++]))),r+=String.fromCharCode(i)):r+=n}else{if(Vd(n.charCodeAt(0)))break;r+=n}}return""!==e&&hg({},"Unexpected token %0","ILLEGAL"),{type:8,value:r,octal:o,start:t,end:zd}}():46===e?Wd(Td.charCodeAt(zd+1))?rg():ig():Wd(e)?rg():ig()}function sg(){var e;return zd=(e=Pd).end,Pd=ag(),zd=e.end,e}function ug(){var e;e=zd,Pd=ag(),zd=e}function cg(e,t,n){var i=new Ld("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return i.operator=e,i.left=t,i.right=n,i}function lg(e,t){var n=new Ld("CallExpression");return n.callee=e,n.arguments=t,n}function fg(e){var t=new Ld("Identifier");return t.name=e,t}function dg(e){var t=new Ld("Literal");return t.value=e.value,t.raw=Td.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function gg(e,t,n){var i=new Ld("MemberExpression");return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function pg(e,t,n){var i=new Ld("Property");return i.key=t,i.value=n,i.kind=e,i}function hg(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(function(e,t){return Id(t<i.length,"Message reference must be in range"),i[t]}));throw(n=new Error(r)).index=zd,n.description=r,n}function mg(e){2===e.type&&hg(e,"Unexpected end of input"),6===e.type&&hg(e,"Unexpected number"),8===e.type&&hg(e,"Unexpected string"),3===e.type&&hg(e,"Unexpected identifier"),4===e.type&&hg(e,"Unexpected reserved word"),hg(e,"Unexpected token %0",e.value)}function bg(e){var t=sg();7===t.type&&t.value===e||mg(t)}function vg(e){return 7===Pd.type&&Pd.value===e}function yg(e){return 4===Pd.type&&Pd.value===e}function xg(){var e=[];for(zd=Pd.start,bg("[");!vg("]");)vg(",")?(sg(),e.push(null)):(e.push(Ng()),vg("]")||bg(","));return sg(),function(e){var t=new Ld("ArrayExpression");return t.elements=e,t}(e)}function wg(){var e;return zd=Pd.start,8===(e=sg()).type||6===e.type?(e.octal&&hg(e,"Octal literals are not allowed in strict mode."),dg(e)):fg(e.value)}function Ag(){var e,t,n;return zd=Pd.start,3===(e=Pd).type?(n=wg(),bg(":"),pg("init",n,Ng())):2!==e.type&&7!==e.type?(t=wg(),bg(":"),pg("init",t,Ng())):void mg(e)}function Og(){var e,t,n=[],i={},r=String;for(zd=Pd.start,bg("{");!vg("}");)t="$"+("Identifier"===(e=Ag()).key.type?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?hg({},"Duplicate data property in object literal not allowed in strict mode"):i[t]=!0,n.push(e),vg("}")||bg(",");return bg("}"),function(e){var t=new Ld("ObjectExpression");return t.properties=e,t}(n)}var Cg={if:1,this:1};function Fg(){var e,t,n;if(vg("("))return function(){var e;return bg("("),e=Mg(),bg(")"),e}();if(vg("["))return xg();if(vg("{"))return Og();if(e=Pd.type,zd=Pd.start,3===e||Cg[Pd.value])n=fg(sg().value);else if(8===e||6===e)Pd.octal&&hg(Pd,"Octal literals are not allowed in strict mode."),n=dg(sg());else{if(4===e)throw new Error("Disabled.");1===e?((t=sg()).value="true"===t.value,n=dg(t)):5===e?((t=sg()).value=null,n=dg(t)):vg("/")||vg("/=")?(n=dg(og()),ug()):mg(sg())}return n}function Dg(){var e=[];if(bg("("),!vg(")"))for(;zd<Ud&&(e.push(Ng()),!vg(")"));)bg(",");return bg(")"),e}function jg(){return bg("."),zd=Pd.start,function(e){return 3===e.type||4===e.type||1===e.type||5===e.type}(e=sg())||mg(e),fg(e.value);var e}function kg(){var e;return bg("["),e=Mg(),bg("]"),e}function Eg(){var e=function(){var e;for(e=Fg();;)if(vg("."))e=gg(".",e,jg());else if(vg("("))e=lg(e,Dg());else{if(!vg("["))break;e=gg("[",e,kg())}return e}();if(7===Pd.type&&(vg("++")||vg("--")))throw new Error("Disabled.");return e}function Sg(){var e,t,n,i,r;if(7!==Pd.type&&4!==Pd.type)t=Eg();else{if(vg("++")||vg("--"))throw new Error("Disabled.");if(vg("+")||vg("-")||vg("~")||vg("!"))e=sg(),t=Sg(),n=e.value,i=t,(r=new Ld("UnaryExpression")).operator=n,r.argument=i,r.prefix=!0,t=r;else{if(yg("delete")||yg("void")||yg("typeof"))throw new Error("Disabled.");t=Eg()}}return t}function $g(e){var t=0;if(7!==e.type&&4!==e.type)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function Ng(){var e,t;return e=function(){var e,t,n,i,r,o,a,s,u,c;if(e=Pd,u=Sg(),0===(r=$g(i=Pd)))return u;for(i.prec=r,sg(),t=[e,Pd],o=[u,i,a=Sg()];(r=$g(Pd))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),t.pop(),n=cg(s,u,a),o.push(n);(i=sg()).prec=r,o.push(i),t.push(Pd),n=Sg(),o.push(n)}for(n=o[c=o.length-1],t.pop();c>1;)t.pop(),n=cg(o[c-1].value,o[c-2],n),c-=2;return n}(),vg("?")&&(sg(),t=Ng(),bg(":"),e=function(e,t,n){var i=new Ld("ConditionalExpression");return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,Ng())),e}function Mg(){var e=Ng();if(vg(","))throw new Error("Disabled.");return e}function Bg(e,t,n){return e.fields=t||[],e.fname=n,e}function _g(e){throw Error(e)}var Tg=Array.isArray;function zg(e){return Tg(e)?"["+e.map(zg)+"]":(t=e)===Object(t)||function(e){return"string"==typeof e}(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e;var t}var Ug=[];(function(e,t){var n=function(e){var t,n,i,r=[],o=null,a=0,s=e.length,u="";function c(){r.push(u+e.substring(t,n)),u="",t=n+1}for(e+="",t=n=0;n<s;++n)if("\\"===(i=e[n]))u+=e.substring(t,n),u+=e.substring(++n,++n),t=n;else if(i===o)c(),o=null,a=-1;else{if(o)continue;t===a&&'"'===i||t===a&&"'"===i?(t=n+1,o=i):"."!==i||a?"["===i?(n>t&&c(),a=t=n+1):"]"===i&&(a||_g("Access path missing open bracket: "+e),a>0&&c(),a=0,t=n+1):n>t?c():t=n+1}return a&&_g("Access path missing closing bracket: "+e),o&&_g("Access path missing closing quote: "+e),n>t&&(n++,c()),r}(e),i="return _["+n.map(zg).join("][")+"];";Bg(Function("_",i),[e=1===n.length?n[0]:e],t||e)})("id"),Bg((function(e){return e}),Ug,"identity"),Bg((function(){return 0}),Ug,"zero"),Bg((function(){return 1}),Ug,"one"),Bg((function(){return!0}),Ug,"true"),Bg((function(){return!1}),Ug,"false");function Pg(e){const t=function(e){zd=0,Ud=(Td=e).length,Pd=null,ug();var t=Mg();if(2!==Pd.type)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit(e=>{"MemberExpression"===e.type&&function e(t){return"MemberExpression"===t.object.type?e(t.object):"datum"===t.object.name}(e)&&n.add(function e(t){const n=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(n.push(...e(t.object)),n.push(...e(t.property))),n)}(e).slice(1).join("."))}),n}class Lg extends ed{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=Ig(this.model,this.filter,this),this._dependentFields=Pg(this.expr)}clone(){return new Lg(null,this.model,Hr(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Rg(e,t,n,i="datum"){const r=[];const o=co(t,(function(t){const o=uo(t),a=e.getSelectionComponent(o,t),s=u(o+jd);if(a.project.timeUnit){const t=null!=n?n:e.component.data.raw,i=a.project.timeUnit.clone();t.parent?i.insertAsParentOf(t):t.parent=i}return"none"!==a.empty&&r.push(s),`vlSelectionTest(${s}, ${i}`+("global"===a.resolve?")":`, ${u(a.resolve)})`)}));return(r.length?"!("+r.map(e=>`length(data(${e}))`).join(" || ")+") || ":"")+`(${o})`}function qg(e,t){const n=t.encoding;let i=t.field;if(n||i){if(n&&!i){const r=e.project.items.filter(e=>e.channel===n);!r.length||r.length>1?(i=e.project.items[0].field,as((r.length?"Multiple ":"No ")+`matching ${u(n)} encoding found for selection ${u(t.selection)}. `+`Using "field": ${u(i)}.`)):i=r[0].field}}else i=e.project.items[0].field,e.project.items.length>1&&as('A "field" or "encoding" must be specified when using a selection as a scale domain. '+`Using "field": ${u(i)}.`);return`${e.name}[${u(i)}]`}function Ig(e,t,n){return co(t,t=>s(t)?t:function(e){return null==e?void 0:e.selection}(t)?Rg(e,t.selection,n):zs(t))}function Wg(e,t,n,i){var r,o,a;e.encode=null!==(r=e.encode)&&void 0!==r?r:{},e.encode[t]=null!==(o=e.encode[t])&&void 0!==o?o:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=i}function Hg(e){return qa(e)?e.signal:u(e.value)}function Gg(e,t,n,i={header:!1}){var r,o;const a=e.combine(),{orient:s,scale:u,labelExpr:c,title:l,zindex:f}=a,d=w(a,["orient","scale","labelExpr","title","zindex"]);for(const e in d){const n=Fo[e],i=d[e];if(n&&n!==t&&"both"!==n)delete d[e];else if(Oo(i)){const{condition:t}=i,n=w(i,["condition"]),r=h(t),o=Ao[e];if(o){const{vgProp:t,part:i}=o;Wg(d,i,t,[...r.map(e=>{const{test:t}=e,n=w(e,["test"]);return Object.assign({test:Ig(null,t)},n)}),n]),delete d[e]}else if(null===o){const t={signal:r.map(e=>{const{test:t}=e,n=w(e,["test"]);return`${Ig(null,t)} ? ${Hg(n)} : `}).join("")+Hg(n)};d[e]=t}}else if(qa(i)){const t=Ao[e];if(t){const{vgProp:n,part:r}=t;Wg(d,r,n,i),delete d[e]}}}if("grid"===t){if(!d.grid)return;if(d.encode){const{grid:e}=d.encode;d.encode=Object.assign({},e?{grid:e}:{}),0===oo(d.encode).length&&delete d.encode}return Object.assign(Object.assign({scale:u,orient:s},d),{domain:!1,labels:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:vo(f,0)})}{if(!i.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(o=null===(r=d.encode)||void 0===r?void 0:r.labels)||void 0===o?void 0:o.update)&&qa(d.encode.labels.update.text)&&(e=mo(c,"datum.label",d.encode.labels.update.text.signal)),Wg(d,"labels","text",{signal:e})}if(d.encode){for(const t of Co)e.hasAxisPart(t)||delete d.encode[t];0===oo(d.encode).length&&delete d.encode}const t=function(e,t){if(e)return Ra(e)?e:e.map(e=>Xu(e,t)).join(", ")}(l,n);return Object.assign(Object.assign(Object.assign({scale:u,orient:s,grid:!1},t?{title:t}:{}),d),{zindex:vo(f,0)})}}function Yg(e){const{axes:t}=e.component;for(const n of ka)if(t[n])for(const i of t[n])if(!i.get("gridScale")){const t="x"===n?"height":"width";return[{name:t,update:e.getSizeSignalRef(t).signal}]}return[]}const Vg={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},Xg={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelLimit:"limit",labelOrient:"orient",labelPadding:"offset"},Jg=oo(Vg),Qg=oo(Xg);function Zg(e,t,n,i,r,o){var a,s,u;let c=Za(e,o,t.style);if(void 0!==c)return{configFrom:"style",configValue:c};const l=[..."band"===r?["axisBand","axisDiscrete"]:[],..."point"===r?["axisPoint","axisDiscrete"]:[],...Js(r)?["axisQuantitative"]:[],..."time"===r||"utc"===r?["axisTemporal"]:[]],f="x"===n?"axisX":"axisY",d=[...l.map(e=>f+e.substr(4)),...l,f,...i?["axis"+fo(i)]:[],"axis"];for(const n of d)if(void 0!==(null===(a=t[n])||void 0===a?void 0:a[e]))return{configFrom:n,configValue:t[n][e]};for(const n of d)if((null===(s=t[n])||void 0===s?void 0:s.style)&&(c=Za(e,null===(u=t[n])||void 0===u?void 0:u.style,t.style),void 0!==c))return{configFrom:"axis-config-style",configValue:c};return{}}function Kg(e,t){if(void 0!==e)return e=xo(e),"top"===t||"bottom"===t?e<=45||315<=e?"top"===t?"bottom":"top":135<=e&&e<=225?"top"===t?"top":"bottom":"middle":e<=45||315<=e||135<=e&&e<=225?"middle":45<=e&&e<=135?"left"===t?"top":"bottom":"left"===t?"bottom":"top"}function ep(e,t){if(void 0!==e)return e=xo(e),"top"===t||"bottom"===t?e%180==0?"center":0<e&&e<180?"top"===t?"right":"left":"top"===t?"left":"right":(e+90)%180==0?"center":90<=e&&e<270?"left"===t?"left":"right":"left"===t?"right":"left"}function tp(e){switch(e){case Jo:return"bottom";case Qo:return"left"}throw new Error(is.INVALID_CHANNEL_FOR_AXIS)}class np extends ed{constructor(e,t){super(e),this.transform=t,this._dependentFields=Pg(this.transform.calculate)}clone(){return new np(null,Hr(this.transform))}static parseAllForSortIndex(e,t){return t.forEachFieldDef((t,n)=>{if(Uu(t)&&Fu(t.sort)){const{field:i,timeUnit:r}=t,o=t.sort,a=o.map((e,t)=>`${zs({field:i,timeUnit:r,equal:e})} ? ${t} : `).join("")+o.length;e=new np(e,{calculate:a,as:ip(t,n,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Xr(this.transform)}`}}function ip(e,t,n){return Ru(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function rp(e,t){return Qr(["top","bottom"],t)?"column":Qr(["left","right"],t)||"row"===e?"row":"column"}function op(e,t,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return vo(t&&t.header?t.header[e]:void 0,r[e],n.header[e])}function ap(e,t,n,i){const r={};for(const o of e){const e=op(o,t,n,i);void 0!==e&&(r[o]=e)}return r}const sp=["row","column"],up=["header","footer"];function cp(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=ap(["titleAnchor","titleAngle","titleOrient"],r,i,t),u=rp(t,s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),fp(a,u)),lp(u,a,o)),vp(i,r,t,Jg,Vg))}}function lp(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=ep(t,"row"===e?"left":"top");return i?{align:i}:{}}function fp(e,t){const n=Kg(e,"row"===t?"left":"top");return n?{baseline:n}:{}}function dp(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of up)if(n[r])for(const o of n[r]){const a=hp(e,t,r,n,o);null!=a&&i.push(a)}return i}function gp(e,t){var n;const{sort:i}=e;return Cu(i)?{field:Ru(i,{expr:"datum"}),order:null!==(n=i.order)&&void 0!==n?n:"ascending"}:o(i)?{field:ip(e,t,{expr:"datum"}),order:"ascending"}:{field:Ru(e,{expr:"datum"}),order:null!=i?i:"ascending"}}function pp(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=ap(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e,n,t),c=hu({fieldDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,l=rp(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:u?mo(mo(u,"datum.label",c),"datum.value",Ru(e,{expr:"parent"})):c}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),fp(o,l)),lp(l,o,a)),vp(n,e,t,Qg,Xg))}function hp(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:a}=i,s=e.config?e.config:void 0;if(a&&r.labels){const{labelOrient:e}=ap(["labelOrient"],a,s,t);("row"===t&&!Qr(["top","bottom"],e)||"column"===t&&!Qr(["left","right"],e))&&(o=pp(a,t,s))}const u=vm(e)&&!Du(e.facet),c=r.axes,l=(null==c?void 0:c.length)>0;if(o||l){const s="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},i.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:gp(a,t)}:{}),l&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),o?{title:o}:{}),r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{}),l?{axes:c}:{})}}return null}const mp={column:{start:0,end:1},row:{start:1,end:0}};function bp(e,t){return mp[t][e]}function vp(e,t,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=op(a,t,e,n);void 0!==i&&(o[r[a]]=i)}return o}function yp(e){return[...xp(e,"width"),...xp(e,"height"),...xp(e,"childWidth"),...xp(e,"childHeight")]}function xp(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const r=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),o=t.get("range");if(eu(i)&&Ia(o)){const i=e.scaleName(n);if(vm(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[wp(i,o)]}return[wp(i,o),{name:r,update:Ap(i,t,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=r.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${rl(e.config.view,t?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function wp(e,t){return{name:e+"_step",value:t.step}}function Ap(e,t,n){const i=t.get("type"),r=t.get("padding"),o=vo(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,`bandspace(${n}, ${a}, ${o}) * ${e}_step`}function Op(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function Cp(e,t){return oo(e).reduce((n,i)=>{const r=e[i];return Object.assign(Object.assign({},n),xf(t,r,i,e=>qa(e)?e:{value:e.value}))},{})}function Fp(e,t){if(wm(t)||vm(t))return"shared";if(xm(t)||ym(t))return Qr(ka,e)?"independent":"shared";throw new Error("invalid model type for resolve")}function Dp(e,t){const n=e.scale[t],i=Qr(ka,t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&as(is.independentScaleMeansIndependentGuide(t)),"independent"):e[i][t]||"shared"}class jp{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new jp(Hr(this.explicit),Hr(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return vo(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of oo(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function kp(e){return{explicit:!0,value:e}}function Ep(e){return{explicit:!1,value:e}}function Sp(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:$p(t,n,i,r)}}function $p(e,t,n,i){return e.explicit&&t.explicit&&as(is.mergeConflictingProperty(n,i,e.value,t.value)),e}function Np(e,t,n,i,r=$p){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Wr(e.value,t.value)?e:r(e,t,n,i)}const Mp=Object.assign(Object.assign({},{clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1}),{labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),Bp=oo(Mp);class _p extends jp{}function Tp(e){const{legend:t}=e;return vo(t.type,zp(e))}function zp({channel:e,timeUnit:t,scaleType:n,alwaysReturn:i}){if(ga(e)){if(Qr(["quarter","month","day"],t))return"symbol";if(nu(n))return i?"gradient":void 0}return i?"symbol":void 0}function Up({legend:e,legendConfig:t,timeUnit:n,channel:i,scaleType:r}){const o=vo(e.orient,t.orient,"right"),a=Tp({legend:e,channel:i,timeUnit:n,scaleType:r,alwaysReturn:!0});return vo(e.direction,t[a?"gradientDirection":"symbolDirection"],function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(o,a))}function Pp(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Lp(e,t,n){const i=t.getScaleComponent(n).get("type");return vo(e.get("type"),zp({channel:n,scaleType:i,alwaysReturn:!0}))}function Rp(e){return Ip(e,(e,t)=>Math.max(e,t.value))}function qp(e){return Ip(e,(e,t)=>vo(e,t.value))}function Ip(e,t){return function(e){return!!e&&!!e.condition&&(o(e.condition)||zu(e.condition))}(e)?h(e.condition).reduce(t,e.value):zu(e)?e.value:void 0}function Wp(e,t,n){const i=t.get("selections");if(!(null==i?void 0:i.length))return;const r=u(n.field);return i.map(e=>`(!length(data(${u(uo(e)+jd)})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`).join(" || ")}var Hp=Object.freeze({__proto__:null,symbols:function(e,t,n,i,r){var a,s,u,c,l;if("symbol"!==Lp(r,n,i))return;const{markDef:f,encoding:d,config:g,mark:p}=n,h=f.filled&&"trail"!==p;let m=Object.assign(Object.assign({},function(e,t,n){for(const i of n){const n=Ja(i,t.markDef,t.config);void 0!==n&&(e[i]={value:n})}return e}({},n,Mo)),Sf(n,{filled:h}));const b=null!==(a=Rp(d.opacity))&&void 0!==a?a:f.opacity,v=Wp(n,r,e);if(m.fill)if("fill"===i||h&&i===ea)delete m.fill;else if(m.fill.field)r.get("symbolFillColor")?delete m.fill:(m.fill=Ya(null!==(s=g.legend.symbolBaseFillColor)&&void 0!==s?s:"black"),m.fillOpacity=Ya(null!=b?b:1));else if(o(m.fill)){const e=null!==(l=null!==(c=qp(null!==(u=d.fill)&&void 0!==u?u:d.color))&&void 0!==c?c:f.fill)&&void 0!==l?l:h&&f.color;e&&(m.fill=Ya(e))}if(m.stroke)if("stroke"===i||!h&&i===ea)delete m.stroke;else if(m.stroke.field)delete m.stroke;else if(o(m.stroke)){const e=vo(qp(d.stroke||d.color),f.stroke,h?f.color:void 0);e&&(m.stroke={value:e})}return i!==oa&&(v?m.opacity=[Object.assign({test:v},Ya(null!=b?b:1)),Ya(g.legend.unselectedOpacity)]:b&&(m.opacity=Ya(b))),m=Object.assign(Object.assign({},m),t),oo(m).length>0?m:void 0},gradient:function(e,t,n,i,r){if("gradient"!==Lp(r,n,i))return;let o={};const a=Rp(n.encoding.opacity)||n.markDef.opacity;return a&&(o.opacity=Ya(a)),o=Object.assign(Object.assign({},o),t),oo(o).length>0?o:void 0},labels:function(e,t,n,i,r){const o=n.legend(i),a=n.config,s=Wp(n,r,e),u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:c,formatType:l}=o,f=hu({fieldDef:e,format:c,formatType:l,field:"datum.value",config:a,isUTCScale:n.getScaleComponent(i).get("type")===Rs.UTC,omitNumberFormatAndEmptyTimeFormat:!0}),d=Object.assign(Object.assign(Object.assign({},u?{opacity:u}:{}),f?{text:f}:{}),t);return oo(d).length>0?d:void 0},entries:function(e,t,n,i,r){const o=r.get("selections");return(null==o?void 0:o.length)?{fill:{value:"transparent"}}:void 0},getFirstConditionValue:qp});function Gp(e){bm(e)?e.component.legends=function(e){const{encoding:t}=e;return[ea,ta,na,ua,ca,ra,ia,oa,aa,sa].reduce((n,i)=>{const r=t[i];return!e.legend(i)||!e.getScaleComponent(i)||Bu(r)&&i===ia&&"geojson"===r.type||(n[i]=function(e,t){var n;const i=e.fieldDef(t),r=e.legend(t),o=new _p({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}if("color"===t)return e.markDef.filled?{fill:n}:{stroke:n};return{[t]:n}}(e,t));!function(e,t,n){const i=e.fieldDef(t).field;Nd(e,e=>{var r,o;const a=null!==(r=e.project.hasField[i])&&void 0!==r?r:e.project.hasChannel[t];if(a&&ld.has(e)){const t=null!==(o=n.get("selections"))&&void 0!==o?o:[];t.push(e.name),n.set("selections",t,!1),a.hasLegend=!0}})}(e,t,o);for(const n of Bp){const a=Vp(n,r,t,e);if(void 0!==a){const t=Yp(a,n,r,i);(t||void 0===e.config.legend[n])&&o.set(n,a,t)}}const a=null!==(n=r.encoding)&&void 0!==n?n:{},s=o.get("selections"),u=["labels","legend","title","symbols","gradient","entries"].reduce((n,r)=>{var u;const c=Cp(null!==(u=a[r])&&void 0!==u?u:{},e),l=Hp[r]?Hp[r](i,c,e,t,o):c;return void 0!==l&&oo(l).length>0&&(n[r]=Object.assign(Object.assign(Object.assign({},(null==s?void 0:s.length)?{name:`${uo(i.field)}_legend_${r}`}:{}),(null==s?void 0:s.length)?{interactive:!!s}:{}),{update:l})),n},{});oo(u).length>0&&o.set("encode",u,!!r.encoding);return o}(e,i)),n},{})}(e):e.component.legends=function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children)Gp(i),oo(i.component.legends).forEach(r=>{n.legend[r]=Dp(e.component.resolve,r),"shared"===n.legend[r]&&(t[r]=Xp(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))});return oo(t).forEach(t=>{for(const i of e.children)i.component.legends[t]&&"shared"===n.legend[t]&&delete i.component.legends[t]}),t}(e)}function Yp(e,t,n,i){switch(t){case"values":return!!n.values;case"title":if("title"===t&&e===i.title)return!0}return e===n[t]}function Vp(e,t,n,i){var r;const{encoding:a,mark:s}=i,u=Zu(a[n]),c=i.config.legend,l=null===(r=Ds(u.timeUnit))||void 0===r?void 0:r.unit,f=i.getScaleComponent(n).get("type");switch(e){case"direction":return Up({legend:t,legendConfig:c,timeUnit:l,channel:n,scaleType:f});case"format":if(ic(u))return;return mu(u,t.format,i.config);case"formatType":if(ic(u))return;return t.formatType;case"gradientLength":return vo(t.gradientLength,c.gradientLength,function({legend:e,legendConfig:t,model:n,channel:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=t;if(nu(r)){if("horizontal"===Up({legend:e,legendConfig:t,channel:i,scaleType:r})){const i=vo(e.orient,t.orient);return"top"===i||"bottom"===i?Pp(n,"width",a,o):a}return Pp(n,"height",u,s)}}({model:i,legend:t,legendConfig:c,channel:n,scaleType:f}));case"labelOverlap":return vo(t.labelOverlap,function(e){if(Qr(["quantile","threshold","log"],e))return"greedy"}(f));case"symbolType":return vo(t.symbolType,function(e,t,n,i){var r;if("shape"!==t){const e=null!==(r=qp(n))&&void 0!==r?r:i;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(s,n,a.shape,i.markDef.shape));case"title":return Yu(u,i.config,{allowDisabling:!0})||void 0;case"type":return Tp({legend:t,channel:n,timeUnit:l,scaleType:f,alwaysReturn:!1});case"values":return function(e,t){const n=e.values;return o(n)?ac(t,n):qa(n)?n:void 0}(t,u)}return t[e]}function Xp(e,t){var n,i,r,o,a,s;if(!e)return t.clone();const u=e.getWithExplicit("orient"),c=t.getWithExplicit("orient");if(u.explicit&&c.explicit&&u.value!==c.value)return;let l=!1;for(const n of Bp){const i=Np(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",(e,t)=>{switch(n){case"symbolType":return Jp(e,t);case"title":return ns(e,t);case"type":return l=!0,Ep("symbol")}return $p(e,t,n,"legend")});e.setWithExplicit(n,i)}return l&&((null===(r=null===(i=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===i?void 0:i.gradient)||void 0===r||r)&&lo(e.implicit,["encode","gradient"]),(null===(s=null===(a=null===(o=e.explicit)||void 0===o?void 0:o.encode)||void 0===a?void 0:a.gradient)||void 0===s||s)&&lo(e.explicit,["encode","gradient"])),e}function Jp(e,t){return"circle"===t.value?t:e}function Qp(e,t,n,i){var r,o,a;e.encode=null!==(r=e.encode)&&void 0!==r?r:{},e.encode[t]=null!==(o=e.encode[t])&&void 0!==o?o:{},e.encode[t].update=null!==(a=e.encode[t].update)&&void 0!==a?a:{},e.encode[t].update[n]=i}function Zp(e){const t=e.component.legends,n={};for(const i of oo(t)){const r=e.getScaleComponent(i),o=Vr(r.get("domains"));if(n[o])for(const e of n[o]){Xp(e,t[i])||n[o].push(t[i])}else n[o]=[t[i].clone()]}return ao(n).flat().map(Kp)}function Kp(e){var t,n,i,r;const o=e.combine(),{labelExpr:a,selections:s}=o,u=w(o,["labelExpr","selections"]);if(null===(t=u.encode)||void 0===t?void 0:t.symbols){const e=u.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||u.stroke||(e.stroke={value:"transparent"});for(const t of Gc)u[t]&&delete e[t]}if(void 0!==a){let e=a;(null===(r=null===(i=null===(n=u.encode)||void 0===n?void 0:n.labels)||void 0===i?void 0:i.update)||void 0===r?void 0:r.text)&&qa(u.encode.labels.update.text)&&(e=mo(a,"datum.label",u.encode.labels.update.text.signal)),Qp(u,"labels","text",{signal:e})}for(const e in u){const t=u[e];if(qa(t)){const n=Yc[e];if(n){const{vgProp:i,part:r}=n;Qp(u,r,i,t),delete u[e]}}}return u}function eh(e){return wm(e)||xm(e)||ym(e)?function(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),th(e))}(e):th(e)}function th(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n,r=w(n,["name"]);if(t.data){const n={signal:`[${t.size.map(e=>e.signal).join(", ")}]`},o=t.data.reduce((t,n)=>{const i=qa(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return Qr(t,i)||t.push(i),t},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:i,size:n,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]}},r)]}return[Object.assign(Object.assign({name:i},{translate:{signal:"[width / 2, height / 2]"}}),r)]}const nh=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class ih extends jp{constructor(e,t,n,i){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function rh(e){e.component.projection=bm(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,i=!(n&&(null!=n.scale||null!=n.translate)),r=i?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,o=i?function(e){const t=[];for(const n of[["longitude","latitude"],["longitude2","latitude2"]])(e.channelHasField(n[0])||e.channelHasField(n[1]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(ia)&&"geojson"===e.fieldDef(ia).type&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(Hl));return t}(e):void 0;return new ih(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),r,o)}return}(e):function(e){if(0===e.children.length)return;let t;e.children.forEach(e=>rh(e));const n=Kr(e.children,e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=Kr(nh,n=>!b(e.explicit,n)&&!b(t.explicit,n)||!(!b(e.explicit,n)||!b(t.explicit,n)||Vr(e.get(n))!==Vr(t.get(n))));if(Vr(e.size)===Vr(t.size)){if(n)return e;if(Vr(e.explicit)===Vr({}))return t;if(Vr(t.explicit)===Vr({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0});if(t&&n){const n=e.projectionName(!0),i=new ih(n,t.specifiedProjection,t.size,Hr(t.data));return e.children.forEach(e=>{const t=e.component.projection;t&&(t.isFit&&i.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}),i}return}(e)}function oh(e,t){return`${uc(e)}_${t}`}function ah(e,t,n){var i;const r=oh(null!==(i=tc(n,void 0))&&void 0!==i?i:{},t);return e.getName(`${r}_bins`)}function sh(e,t,n){let i,r;i=function(e){return"as"in e}(e)?s(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Ru(e,{forAs:!0}),Ru(e,{binSuffix:"end",forAs:!0})];const o=Object.assign({},tc(t,void 0)),a=oh(o,e.field),{signal:u,extentSignal:c}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(dc(o.extent)){const e=o.extent,t=e.selection;r=qg(n.getSelectionComponent(uo(t),t),e),delete o.extent}return{key:a,binComponent:Object.assign(Object.assign(Object.assign({bin:o,field:e.field,as:[i]},u?{signal:u}:{}),c?{extentSignal:c}:{}),r?{span:r}:{})}}class uh extends ed{constructor(e,t){super(e),this.bins=t}clone(){return new uh(null,Hr(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{if(_u(n)&&cc(n.bin)){const{key:r,binComponent:o}=sh(n,n.bin,t);e[r]=Object.assign(Object.assign(Object.assign({},o),e[r]),function(e,t,n,i){var r,o;if(sc(t,n)){const a=bm(e)&&null!==(o=null!==(r=e.axis(n))&&void 0!==r?r:e.legend(n))&&void 0!==o?o:{},s=Ru(t,{expr:"datum"}),u=Ru(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Ru(t,{binSuffix:"range",forAs:!0}),formula:yu(s,u,a.format,a.formatType,i)}}return{}}(t,n,i,t.config))}return e},{});return 0===oo(n).length?null:new uh(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=sh(t,t.bin,n);return new uh(e,{[i]:r})}merge(e,t){for(const n of oo(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=to([...this.bins[n].as,...e.bins[n].as],Xr)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(ao(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(ao(this.bins).map(e=>e.field))}hash(){return`Bin ${Xr(this.bins)}`}assemble(){return ao(this.bins).flatMap(e=>{const t=[],[n,...i]=e.as,r=e.bin,{extent:o}=r,a=w(r,["extent"]),s=Object.assign(Object.assign(Object.assign({type:"bin",field:ho(e.field),as:n,signal:e.signal},dc(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),a);!o&&e.extentSignal&&(t.push({type:"extent",field:ho(e.field),signal:e.extentSignal}),s.extent={signal:e.extentSignal}),t.push(s);for(const e of i)for(let i=0;i<2;i++)t.push({type:"formula",expr:Ru({field:n[i]},{expr:"datum"}),as:e[i]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}class ch extends ed{constructor(e){let t;if(super(null),Rl(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},Yr(e.format,["parse"])):{}),Pl(e))this._data={values:e.values};else if(Ul(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];Qr(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else Il(e)?this._data={values:[{type:"Sphere"}]}:(Ll(e)||Rl(e))&&(this._data={});this._generator=Rl(e),e.name&&(this._name=e.name),t&&oo(t).length>0&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}function lh(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return console.error("Dataflow graph is inconsistent.",t,e),!1;if(!lh(t.children))return!1}return!0}class fh extends ed{constructor(e,t){super(e),this.params=t}clone(){return new fh(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Xr(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class dh extends ed{constructor(e,t){super(e),this.params=t}clone(){return new dh(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${Xr(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}function gh(e){return e instanceof ch||e instanceof fh||e instanceof dh}class ph{constructor(){this._mutated=!1}setMutated(){this._mutated=!0}get mutatedFlag(){return this._mutated}}class hh extends ph{constructor(){super(),this._continue=!1}setContinue(){this._continue=!0}get continueFlag(){return this._continue}get flags(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}}set flags({continueFlag:e,mutatedFlag:t}){e&&this.setContinue(),t&&this.setMutated()}reset(){}optimizeNextFromLeaves(e){if(gh(e))return!1;const t=e.parent,{continueFlag:n}=this.run(e);return n&&this.optimizeNextFromLeaves(t),this.mutatedFlag}}class mh extends ph{}function bh(e,t,n,i){const r=bm(i)?i.encoding[Ca(t)]:void 0;if(_u(n)&&bm(i)&&$u(t,n,r,i.markDef,i.config))e.add(Ru(n,{})),e.add(Ru(n,{suffix:"end"})),n.bin&&sc(n,t)&&e.add(Ru(n,{binSuffix:"range"}));else if(t in la){const n=function(e){switch(e){case"latitude":return"y";case"latitude2":return"y2";case"longitude":return"x";case"longitude2":return"x2"}}(t);e.add(i.getName(n))}else e.add(Ru(n));return e}class vh extends ed{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new vh(null,new Set(this.dimensions),Hr(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef(e=>{e.aggregate&&(n=!0)});const i={},r=new Set;return n?(t.forEachFieldDef((e,n)=>{var o,a,s,u;const{aggregate:c,field:l}=e;if(c)if("count"===c)i["*"]=null!==(o=i["*"])&&void 0!==o?o:{},i["*"].count=new Set([Ru(e,{forAs:!0})]);else{if(qo(c)||Io(c)){const e=qo(c)?"argmin":"argmax",t=c[e];i[t]=null!==(a=i[t])&&void 0!==a?a:{},i[t][e]=new Set([Ru({op:e,field:t},{forAs:!0})])}else i[l]=null!==(s=i[l])&&void 0!==s?s:{},i[l][c]=new Set([Ru(e,{forAs:!0})]);_a(n)&&"unaggregated"===t.scaleDomain(n)&&(i[l]=null!==(u=i[l])&&void 0!==u?u:{},i[l].min=new Set([Ru({field:l,aggregate:"min"},{forAs:!0})]),i[l].max=new Set([Ru({field:l,aggregate:"max"},{forAs:!0})]))}else bh(r,n,e,t)}),r.size+oo(i).length===0?null:new vh(e,r,i)):null}static makeFromTransform(e,t){var n,i,r;const o=new Set,a={};for(const e of t.aggregate){const{op:t,field:r,as:o}=e;t&&("count"===t?(a["*"]=null!==(n=a["*"])&&void 0!==n?n:{},a["*"].count=new Set([o||Ru(e,{forAs:!0})])):(a[r]=null!==(i=a[r])&&void 0!==i?i:{},a[r][t]=new Set([o||Ru(e,{forAs:!0})])))}for(const e of null!==(r=t.groupby)&&void 0!==r?r:[])o.add(e);return o.size+oo(a).length===0?null:new vh(e,o,a)}merge(e){return function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(this.dimensions,e.dimensions)?(function(e,t){var n;for(const i of oo(t)){const r=t[i];for(const t of oo(r))i in e?e[i][t]=new Set([...null!==(n=e[i][t])&&void 0!==n?n:[],...r[t]]):e[i]={[t]:r[t]}}}(this.measures,e.measures),!0):(function(...e){os.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...oo(this.measures)])}producedFields(){const e=new Set;for(const t of oo(this.measures))for(const n of oo(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add(`${n}_${t}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Xr({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const i of oo(this.measures))for(const r of oo(this.measures[i]))for(const o of this.measures[i][r])n.push(o),e.push(r),t.push("*"===i?null:ho(i));return{type:"aggregate",groupby:[...this.dimensions].map(ho),ops:e,fields:t,as:n}}}class yh extends ed{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i;for(const e of ha){const n=t.facet[e];if(n){const{bin:i,sort:r}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[Ru(n),...cc(i)?[Ru(n,{binSuffix:"end"})]:[]]},Cu(r)?{sortField:r}:o(r)?{sortIndexField:ip(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of ha)this[t]&&(e+=` ${t.charAt(0)}:${Xr(this[t])}`);return e}get fields(){var e;const t=[];for(const n of ha)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of ha)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of["x","y"]){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(eu(i)&&Ia(r)){const n=em(tm(this.childModel,t));n?e[t]=n:as(`Unknown field for ${t}. Cannot calculate view size.`)}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x"}[e],r=[],o=[],a=[];n&&n[i]&&(t?(r.push(`distinct_${n[i]}`),o.push("max")):(r.push(n[i]),o.push("distinct")),a.push(`distinct_${n[i]}`));const{sortField:s,sortIndexField:u}=this[e];if(s){const{op:e=xu,field:t}=s;r.push(t),o.push(e),a.push(Ru(s,{forAs:!0}))}else u&&(r.push(u),o.push("max"),a.push(u));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},r.length?{fields:r,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:i}=this.model.layout,{layoutHeaders:r}=this.model.component,o=[],a={};for(const e of sp){for(const i of up){const o=null!==(t=r[e]&&r[e][i])&&void 0!==t?t:[];for(const t of o)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){a[e]=!0;break}}if(a[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?i?{signal:`ceil(${t} / ${i})`}:1:i?{signal:`min(${t}, ${i})`}:{signal:t};o.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:s,column:u}=a;return(s||u)&&o.unshift(this.assembleRowColumnHeaderData("facet",null,e)),o}assemble(){var e,t;const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep(),{column:o,row:a,facet:s}=this;if(o&&a&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const o=[].concat(null!==(e=r.x)&&void 0!==e?e:[],null!==(t=r.y)&&void 0!==t?t:[]),a=o.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:a}]})}for(const e of["column",Xo])this[e]&&n.push(this.assembleRowColumnHeaderData(e,i,r));if(s){const e=this.assembleFacetHeaderData(r);e&&n.push(...e)}return n}}function xh(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function wh(e){const t={};return function e(t,n){if(qr(t))e(t.not,n);else if(Rr(t))for(const i of t.and)e(i,n);else if(Lr(t))for(const i of t.or)e(i,n);else n(t)}(e.filter,e=>{var n;if(_s(e)){let i=null;ks(e)?i=e.equal:Ms(e)?i=e.range[0]:Bs(e)&&(i=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),i&&(ss(i)?t[e.field]="date":y(i)?t[e.field]="number":s(i)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}}),t}function Ah(e){const t={};function n(e){var n;ic(e)?t[e.field]="date":"quantitative"===e.type&&(s(n=e.aggregate)&&Qr(["min","max"],n))?t[e.field]="number":bo(e.field)>1?e.field in t||(t[e.field]="flatten"):Uu(e)&&Cu(e.sort)&&bo(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((bm(e)||vm(e))&&e.forEachFieldDef((t,i)=>{if(_u(t))n(t);else{const r=Oa(i),o=e.fieldDef(r);n(Object.assign(Object.assign({},t),{type:o.type}))}}),bm(e)){const{mark:n,markDef:i,encoding:r}=e;if(Eo(n)&&!e.encoding.order){const e=r["horizontal"===i.orient?"y":"x"];!Bu(e)||"quantitative"!==e.type||e.field in t||(t[e.field]="number")}}return t}class Oh extends ed{constructor(e,t){super(e),this._parse=t}clone(){return new Oh(null,Hr(this._parse))}hash(){return`Parse ${Xr(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;return!Rl(r)&&r&&r.format&&r.format.parse&&(i=r.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const e of oo(n)){const t=i.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:as(is.differentParse(e,n[e],t.value)))}for(const e of oo(t)){const n=i.get(e);void 0!==n&&(n===t[e]?delete t[e]:as(is.differentParse(e,t[e],n)))}const r=new jp(t,n);i.copyAll(r);const o={};for(const e of oo(r.combine())){const t=r.get(e);null!==t&&(o[e]=t)}return 0===oo(o).length||i.parseNothing?null:new Oh(e,o)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of oo(this._parse)){const n=this._parse[t];1===bo(t)&&(e[t]=n)}return e}producedFields(){return new Set(oo(this._parse))}dependentFields(){return new Set(oo(this._parse))}assembleTransforms(e=!1){return oo(this._parse).filter(t=>!e||bo(t)>1).map(e=>{const t=function(e,t){const n=po(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(0===t.indexOf("date:")){return`timeParse(${n},'${xh(t.slice(5,t.length))}')`}if(0===t.indexOf("utc:")){return`utcParse(${n},'${xh(t.slice(4,t.length))}')`}return as(is.unrecognizedParse(t)),null}(e,this._parse[e]);return t?{type:"formula",expr:t,as:(n=e,`${r(n).join(".")}`)}:null;var n}).filter(e=>null!==e)}}class Ch extends ed{constructor(e,t){super(e),this.transform=t}clone(){return new Ch(null,Hr(this.transform))}addDimensions(e){this.transform.groupby=to(this.transform.groupby.concat(e),e=>e)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t=>e.add(t)),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(t=>e.add(t)),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Ru(e)}hash(){return`JoinAggregateTransform ${Xr(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);const i=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==i?{groupby:i}:{})}}class Fh extends ed{constructor(e,t){super(e),this._stack=t}clone(){return new Fh(null,Hr(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:i,as:r,offset:a="zero"}=t,u=[],c=[];if(void 0!==t.sort)for(const e of t.sort)u.push(e.field),c.push(vo(e.order,"ascending"));const l={field:u,order:c};let f;return f=function(e){return o(e)&&e.every(e=>s(e))&&e.length>1}(r)?r:s(r)?[r,r+"_end"]:[t.stack+"_start",t.stack+"_end"],new Fh(e,{stackField:n,groupby:i,offset:a,sort:l,facetby:[],as:f})}static makeFromEncoding(e,t){const n=t.stack,{encoding:i}=t;if(!n)return null;let r;if(n.groupbyChannel){r=Zu(i[n.groupbyChannel])}const a=function(e){return e.stack.stackBy.reduce((e,t)=>{const n=Ru(t.fieldDef);return n&&e.push(n),e},[])}(t),s=t.encoding.order;let u;return u=o(s)||Bu(s)?Ka(s):a.reduce((e,t)=>(e.field.push(t),e.order.push("descending"),e),{field:[],order:[]}),new Fh(e,{dimensionFieldDef:r,stackField:t.vgField(n.fieldChannel),facetby:[],stackby:a,sort:u,offset:n.offset,impute:n.impute,as:[t.vgField(n.fieldChannel,{suffix:"start",forAs:!0}),t.vgField(n.fieldChannel,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(t=>e.add(t)),this._stack.facetby.forEach(t=>e.add(t)),this._stack.sort.field.forEach(t=>e.add(t)),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Xr(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[Ru(e,{binSuffix:"mid"})]:[Ru(e,{}),Ru(e,{binSuffix:"end"})]:[Ru(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:i,stackby:r,sort:o,offset:a,impute:s,as:u}=this._stack;if(s&&n){const{band:o=.5,bin:a}=n;a&&e.push({type:"formula",expr:`${o}*`+Ru(n,{expr:"datum"})+`+${1-o}*`+Ru(n,{expr:"datum",binSuffix:"end"}),as:Ru(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[...r,...t],key:Ru(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:o,as:u,offset:a}),e}}class Dh extends ed{constructor(e,t){super(e),this.transform=t}clone(){return new Dh(null,Hr(this.transform))}addDimensions(e){this.transform.groupby=to(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(e=>n.add(e)),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach(e=>n.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(e=>n.add(e)),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Ru(e)}hash(){return`WindowTransform ${Xr(this.transform)}`}assemble(){var e;const t=[],n=[],i=[],r=[];for(const e of this.transform.window)n.push(e.op),i.push(this.getDefaultName(e)),r.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(e=>Wo(e)))return Object.assign({type:"joinaggregate",as:i,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],u=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)s.push(t.field),u.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const c={field:s,order:u},l=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:r,as:i,ops:n,fields:t,sort:c},void 0!==l?{ignorePeers:l}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}class jh extends ed{clone(){return new jh(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set(["_vgsid_"])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:"_vgsid_"}}}class kh extends hh{run(e){const t=e.parent;if(e instanceof Oh){if(gh(t))return this.flags;if(t.numChildren()>1)return this.setContinue(),this.flags;if(t instanceof Oh)this.setMutated(),t.merge(e);else{if(ro(t.producedFields(),e.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),e.swapWithParent()}}return this.setContinue(),this.flags}}class Eh extends mh{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map(e=>e.hash()),n={};for(let i=0;i<t.length;i++)void 0===n[t[i]]?n[t[i]]=[e.children[i]]:n[t[i]].push(e.children[i]);for(const t of oo(n))n[t].length>1&&(this.setMutated(),this.mergeNodes(e,n[t]));for(const t of e.children)this.run(t);return this.mutatedFlag}}class Sh extends hh{run(e){return e instanceof td||e.numChildren()>0||e instanceof yh||(this.setMutated(),e.remove()),this.flags}}class $h extends hh{constructor(){super(...arguments),this.fields=new Set,this.prev=null}run(e){if(this.setContinue(),e instanceof nd){const t=e.producedFields();no(t,this.fields)?(this.setMutated(),this.prev.remove()):this.fields=new Set([...this.fields,...t]),this.prev=e}return this.flags}reset(){this.fields.clear()}}class Nh extends hh{run(e){this.setContinue();const t=e.parent.children.filter(e=>e instanceof nd),n=t.pop();for(const e of t)this.setMutated(),n.merge(e);return this.flags}}function Mh(e){if(e instanceof yh)if(1!==e.numChildren()||e.children[0]instanceof td){const n=e.model.component.data.main;!function e(t){if(t instanceof td&&t.type===Hl&&1===t.numChildren()){const n=t.children[0];n instanceof yh||(n.swapWithParent(),e(t))}}(n);const i=(t=e,function e(n){if(!(n instanceof yh)){const i=n.clone();if(i instanceof td){const e=Lh+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof vh||i instanceof Fh||i instanceof Dh||i instanceof Ch)&&i.addDimensions(t.fields);return n.children.flatMap(e).forEach(e=>e.parent=i),[i]}return n.children.flatMap(e)}),r=e.children.map(i).flat();for(const e of r)e.parent=n}else{const t=e.children[0];(t instanceof vh||t instanceof Fh||t instanceof Dh||t instanceof Ch)&&t.addDimensions(e.fields),t.swapWithParent(),Mh(e)}else e.children.map(Mh);var t}class Bh extends mh{constructor(){super()}run(e){e instanceof td&&!e.isRequired()&&(this.setMutated(),e.remove());for(const t of e.children)this.run(t);return this.mutatedFlag}}class _h extends mh{constructor(e){super(),this.requiresSelectionId=e&&Bd(e)}run(e){e instanceof jh&&(this.requiresSelectionId&&(gh(e.parent)||e.parent instanceof vh||e.parent instanceof Oh)||(this.setMutated(),e.remove()));for(const t of e.children)this.run(t);return this.mutatedFlag}}class Th extends hh{run(e){const t=e.parent,n=[...t.children],i=t.children.filter(e=>e instanceof Oh);if(t.numChildren()>1&&i.length>=1){const e={},r=new Set;for(const t of i){const n=t.parse;for(const t of oo(n))t in e?e[t]!==n[t]&&r.add(t):e[t]=n[t]}for(const t of r)delete e[t];if(0!==oo(e).length){this.setMutated();const i=new Oh(t,e);for(const r of n){if(r instanceof Oh)for(const t of oo(e))delete r.parse[t];t.removeChild(r),r.parent=i,r instanceof Oh&&0===oo(r.parse).length&&r.remove()}}}return this.setContinue(),this.flags}}class zh extends hh{run(e){const t=e.parent,n=t.children.filter(e=>e instanceof vh),i={};for(const e of n){const t=Xr(e.groupBy);t in i||(i[t]=[]),i[t].push(e)}for(const e of oo(i)){const n=i[e];if(n.length>1){const e=n.pop();for(const i of n)e.merge(i)&&(t.removeChild(i),i.parent=e,i.remove(),this.setMutated())}}return this.setContinue(),this.flags}}class Uh extends hh{constructor(e){super(),this.model=e}run(e){const t=e.parent,n=!(gh(t)||t instanceof Lg||t instanceof Oh||t instanceof jh),i=[],r=[];for(const e of t.children)e instanceof uh&&(n&&!ro(t.producedFields(),e.dependentFields())?i.push(e):r.push(e));if(i.length>0){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated(),t instanceof uh?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated()}return this.setContinue(),this.flags}}class Ph extends hh{run(e){const t=e.parent,n=[...t.children];if(!Zr(n,e=>e instanceof td)||t.numChildren()<=1)return this.setContinue(),this.flags;const i=[];let r;for(const e of n)if(e instanceof td){let n=e;for(;1===n.numChildren();){const e=n.children[0];if(!(e instanceof td))break;n=e}i.push(...n.children),r?(t.removeChild(e),e.parent=r.parent,r.parent.removeChild(r),r.parent=n,this.setMutated()):r=n}else i.push(e);if(i.length){this.setMutated();for(const e of i)e.parent.removeChild(e),e.parent=r}return this.setContinue(),this.flags}}const Lh="scale_";function Rh(e){const t=[];return e.forEach((function e(n){0===n.numChildren()?t.push(n):n.children.forEach(e)})),t}function qh(e){return e}function Ih(e,t){return t.map(t=>{if(e instanceof hh){const n=e.optimizeNextFromLeaves(t);return e.reset(),n}return e.run(t)}).some(qh)}function Wh(e,t){let n=e.sources;const i=new Set;return i.add(Ih(new Bh,n)),i.add(Ih(new _h(t),n)),n=n.filter(e=>e.numChildren()>0),i.add(Ih(new Sh,Rh(n))),n=n.filter(e=>e.numChildren()>0),i.add(Ih(new kh,Rh(n))),i.add(Ih(new Uh(t),Rh(n))),i.add(Ih(new $h,Rh(n))),i.add(Ih(new Th,Rh(n))),i.add(Ih(new zh,Rh(n))),i.add(Ih(new Nh,Rh(n))),i.add(Ih(new Eh,n)),i.add(Ih(new Ph,Rh(n))),e.sources=n,i.has(!0)}class Hh{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Hh(()=>e(t))}}function Gh(e){bm(e)?function(e){const t=e.component.scales;for(const n of oo(t)){const i=Yh(e,n);if(t[n].setWithExplicit("domains",i),Qh(e,n),e.component.data.isFaceted){let t=e;for(;!vm(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)Wa(e)&&(e.data=Lh+e.data.replace(Lh,""))}}}(e):function(e){for(const t of e.children)Gh(t);const t=e.component.scales;for(const n of oo(t)){let i,r=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Np(i,e.getWithExplicit("domains"),"domains","scale",Kh);const t=e.get("selectionExtent");r&&t&&r.selection!==t.selection&&as("The same selection must be used to override scale domains in a layered view."),r=t}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}(e)}function Yh(e,t){const n=e.getScaleComponent(t).get("type"),i=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=Zh(t,n);if(!e)return void as(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=Zh(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.fieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]=Object.assign(Object.assign({},e.specifiedScales[t]),{domain:i})),"x"===t&&e.channelHasField("x2")?e.channelHasField("x")?Np(Xh(n,i,e,"x"),Xh(n,i,e,"x2"),"domain","scale",Kh):Xh(n,i,e,"x2"):"y"===t&&e.channelHasField("y2")?e.channelHasField("y")?Np(Xh(n,i,e,"y"),Xh(n,i,e,"y2"),"domain","scale",Kh):Xh(n,i,e,"y2"):Xh(n,i,e,t)}function Vh(e,t,n){var i;const r=null===(i=Ds(n))||void 0===i?void 0:i.unit;return"temporal"===t||r?function(e,t,n){return e.map(e=>({signal:`{data: ${oc(e,{timeUnit:n,type:t})}}`}))}(e,t,r):[e]}function Xh(e,t,n,i){const r=n.fieldDef(i),o=n.fieldDef(Oa(i));if(function(e){return e&&e.unionWith}(t)){const a=Xh(e,void 0,n,i),s=Vh(t.unionWith,o.type,r.timeUnit);return kp([...a.value,...s])}if(qa(t))return kp([t]);if(t&&"unaggregated"!==t&&!ru(t))return kp(Vh(t,o.type,r.timeUnit));const s=n.stack;if(s&&i===s.fieldChannel){if("normalize"===s.offset)return Ep([[0,1]]);const e=n.requestDataName(Hl);return Ep([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const u=_a(i)?function(e,t,n){if(!eu(n))return;const i=e.fieldDef(t),r=i.sort;if(Fu(r))return{op:"min",field:ip(i,t),order:"ascending"};const{stack:o}=e,a=o?[...o.groupbyField?[o.groupbyField]:[],...o.stackBy.map(e=>e.fieldDef.field)]:void 0;if(Cu(r)){const e=o&&!Qr(a,r.field);return Jh(r,e)}if(Ou(r)){const{encoding:t,order:n}=r,i=e.fieldDef(t),{aggregate:s,field:u}=i,c=o&&!Qr(a,u);if(qo(s)||Io(s))return Jh({field:Ru(i),order:n},c);if(Wo(s)||!s)return Jh({op:s,field:u,order:n},c)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(Qr(["ascending",void 0],r))return!0}return}(n,i,e):void 0;if("unaggregated"===t){const e=n.requestDataName(Hl),{field:t}=r;return Ep([{data:e,field:Ru({field:t,aggregate:"min"})},{data:e,field:Ru({field:t,aggregate:"max"})}])}if(cc(r.bin)){if(eu(e))return Ep("bin-ordinal"===e?[]:[{data:so(u)?n.requestDataName(Hl):n.requestDataName("raw"),field:n.vgField(i,sc(r,i)?{binSuffix:"range"}:{}),sort:!0!==u&&a(u)?u:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=r;if(cc(e)){const t=ah(n,r.field,e);return Ep([new Hh(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}return Ep([{data:n.requestDataName(Hl),field:n.vgField(i,{})}])}}if(r.timeUnit&&Qr(["time","utc"],e)&&$u(i,r,bm(n)?n.encoding[Ca(i)]:void 0,n.markDef,n.config)){const e=n.requestDataName(Hl);return Ep([{data:e,field:n.vgField(i)},{data:e,field:n.vgField(i,{suffix:"end"})}])}return Ep(u?[{data:so(u)?n.requestDataName(Hl):n.requestDataName("raw"),field:n.vgField(i),sort:u}]:[{data:n.requestDataName(Hl),field:n.vgField(i)}])}function Jh(e,t){const{op:n,field:i,order:r}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":xu},i?{field:ho(i)}:{}),r?{order:r}:{})}function Qh(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t).bin,o=ru(i)&&i,a=fc(r)&&dc(r.extent)&&r.extent;(o||a)&&n.set("selectionExtent",null!=o?o:a,!0)}function Zh(e,t){const{aggregate:n,type:i}=e;return n?s(n)&&!Vo[n]?{valid:!1,reason:is.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:is.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:is.unaggregateDomainHasNoEffectForRawField(e)}}function Kh(e,t,n,i){return e.explicit&&t.explicit&&as(is.mergeConflictingDomainProperty(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function em(e){if(Wa(e)&&s(e.field))return e.field;if(function(e){return!o(e)&&("fields"in e&&!("data"in e))}(e)){let t;for(const n of e.fields)if(Wa(n)&&s(n.field))if(t){if(t!==n.field)return as("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return as("Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect."),t}if(function(e){return!o(e)&&("fields"in e&&"data"in e)}(e)){as("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return s(t)?t:void 0}}function tm(e,t){return function(e){const t=to(e.map(e=>{if(Wa(e)){return w(e,["sort"])}return e}),Xr),n=to(e.map(e=>{if(Wa(e)){const t=e.sort;return void 0===t||so(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),Xr);if(0===t.length)return;if(1===t.length){const t=e[0];if(Wa(t)&&n.length>0){let e=n[0];if(n.length>1)as(is.MORE_THAN_ONE_SORT),e=!0;else if(a(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const i=to(n.map(e=>so(e)||!("op"in e)||e.op in Ro?e:(as(is.domainSortDropped(e)),!0)),Xr);let r;1===i.length?r=i[0]:i.length>1&&(as(is.MORE_THAN_ONE_SORT),r=!0);const o=to(e.map(e=>Wa(e)?e.data:null),e=>e);if(1===o.length&&null!==o[0]){return Object.assign({data:o[0],fields:t.map(e=>e.field)},r?{sort:r}:{})}return Object.assign({fields:t},r?{sort:r}:{})}(e.component.scales[t].get("domains").map(t=>(Wa(t)&&(t.data=e.lookupDataSource(t.data)),t)))}function nm(e){return oo(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:c,reverse:l}=r,f=w(r,["name","type","selectionExtent","domains","range","reverse"]),d=function(e,t,n){if(("x"===n||"y"===n)&&Ia(e))return{step:{signal:t+"_step"}};return e}(r.range,o,n);let g;s&&(g=function(e,t){const n=t.selection;return{signal:qg(e.getSelectionComponent(n,uo(n)),t)}}(e,s));const p=tm(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:o,type:a},p?{domain:p}:{}),g?{domainRaw:g}:{}),{range:d}),void 0!==l?{reverse:l}:{}),f)),t},[])}class im extends jp{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||Zr(this.get("domains"),e=>o(e)&&2===e.length&&e[0]<=0&&e[1]>=0)}}const rm=["range","scheme"];function om(e){return"x"===e?"width":"y"===e?"height":void 0}function am(e){const t=e.component.scales;Ba.forEach(n=>{const i=t[n];if(!i)return;const r=function(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e).get("type");for(const t of rm)if(void 0!==n[t]){const i=su(r,t),o=uu(e,t);if(i)if(o)as(o);else switch(t){case"range":return kp(n[t]);case"scheme":return kp(um(n[t]))}else as(is.scalePropertyNotWorkWithScaleType(r,t,e))}if(e===Jo||e===Qo){const t=e===Jo?"width":"height",n=i[t];if(tl(n)){if(eu(r))return kp({step:n.step});as(is.stepDropped(t))}}return Ep(function(e,t){const{size:n,config:i,mark:r}=t,a=t.getSignalName.bind(t),{type:s}=t.fieldDef(e),u=t.getScaleComponent(e).get("type"),{domain:c,domainMid:l}=t.specifiedScales[e];switch(e){case Jo:case Qo:{if(Qr(["point","band"],u))if(e!==Jo||n.width){if(e===Qo&&!n.height){const e=al(i.view,"height");if(tl(e))return e}}else{const e=al(i.view,"width");if(tl(e))return e}const r=om(e),o=t.getName(r);return e===Qo&&tu(u)?[Hh.fromName(a,o),0]:[0,Hh.fromName(a,o)]}case ra:{const a=t.component.scales[e].get("zero"),s=function e(t,n,i){if(n)return qa(n)?{signal:`${n.signal} ? 0 : ${e(t,!1,i)}`}:0;switch(t){case"bar":case"tick":return i.scale.minBandSize;case"line":case"trail":case"rule":return i.scale.minStrokeWidth;case"text":return i.scale.minFontSize;case"point":case"square":case"circle":return i.scale.minSize}throw new Error(is.incompatibleChannel("size",t))}(r,a,i),l=function(e,t,n,i){const r={x:sm(n,"x"),y:sm(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=cm(t,r,i.view);return y(e)?e-1:new Hh(()=>`${e.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const e=cm(t,r,i.view);return y(e)?Math.pow(.95*e,2):new Hh(()=>`pow(0.95 * ${e.signal}, 2)`)}}throw new Error(is.incompatibleChannel("size",e))}(r,n,t,i);return iu(u)?function(e,t,n){const i=()=>{const i=qa(t)?t.signal:t,r=qa(e)?e.signal:e,o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};return qa(t)?new Hh(i):{signal:i()}}(s,l,function(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&o(n)?n.length+1:(as(is.domainRequiredForThresholdScale(i)),3)}}(u,i,c,e)):[s,l]}case ua:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case ca:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ia:return"symbol";case ea:case ta:case na:return"ordinal"===u?"nominal"===s?"category":"ordinal":void 0!==l?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case oa:case aa:case sa:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t))}(n,e);i.setWithExplicit("range",r)})}function sm(e,t){const n=e.fieldDef(t);if(n&&n.bin&&cc(n.bin)){const i=ah(e,n.field,n.bin),r=om(t),o=e.getName(r);return new Hh(()=>{const t=e.getSignalName(i),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(o)} / (${n})`})}}function um(e){return function(e){return!s(e)&&!!e.name}(e)?Object.assign({scheme:e.name},Yr(e,["name"])):{scheme:e}}function cm(e,t,n){const i=tl(e.width)?e.width.step:ol(n,"width"),r=tl(e.height)?e.height.step:ol(n,"height");return t.x||t.y?new Hh(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function lm(e,t){bm(e)?function(e,t){const n=e.component.scales;oo(n).forEach(i=>{const r=e.specifiedScales[i],a=n[i],s=e.getScaleComponent(i),u=e.fieldDef(i),c=e.config,l=r[t],f=s.get("type"),d=su(f,t),g=uu(i,t);if(void 0!==l&&(d?g&&as(g):as(is.scalePropertyNotWorkWithScaleType(f,t,i))),d&&void 0===g)if(void 0!==l)a.copyKeyFromObject(t,r);else{const n=function(e,t,n,i,r,a,s,u,c,l){const f=l.scale,{type:d,sort:g}=i;switch(e){case"bins":return function(e,t){const n=t.bin;if(cc(n)){const i=ah(e,t.field,n);return new Hh(()=>e.getSignalName(i))}if(lc(n)&&fc(n)&&void 0!==n.step)return{step:n.step};return}(t,i);case"interpolate":return function(e,t){if(Qr([ea,ta,na],e)&&"nominal"!==t)return"hcl";return}(n,d);case"nice":return function(e,t,n){if(n.bin||Qr([Rs.TIME,Rs.UTC],e))return;return!!Qr([Jo,Qo],t)||void 0}(r,n,i);case"padding":return function(e,t,n,i,r,o){if(Qr([Jo,Qo],e)){if(nu(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=r;if("bar"===t&&!i.bin&&!i.timeUnit&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===Rs.POINT)return n.pointPadding}return}(n,r,f,i,c,l.bar);case"paddingInner":return function(e,t,n,i){if(void 0!==e)return;if(Qr([Jo,Qo],t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r}=i;return vo(e,"bar"===n?t:r)}return}(a,n,c.type,f);case"paddingOuter":return function(e,t,n,i,r,o){if(void 0!==e)return;if(Qr([Jo,Qo],t)&&n===Rs.BAND){const{bandPaddingOuter:e}=o;return vo(e,qa(r)?{signal:`${r.signal}/2`}:r/2)}return}(a,n,r,c.type,s,f);case"reverse":return function(e,t,n,i){const r=tu(e)&&"descending"===t;if("x"===n&&void 0!==i.xReverse)return r?qa(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(r)return!0;return}(r,g,n,f);case"zero":return function(e,t,n,i,r){if(n&&"unaggregated"!==n&&tu(r)){if(o(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!iu(r))return!0;if(!t.bin&&Qr([Jo,Qo],e)){const{orient:t,type:n}=i;return!Qr(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(n,i,u,c,r)}return f[e]}(t,e,i,u,s.get("type"),s.get("padding"),s.get("paddingInner"),r.domain,e.markDef,c);void 0!==n&&a.set(t,n,!1)}})}(e,t):dm(e,t)}function fm(e){bm(e)?am(e):dm(e,"range")}function dm(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?fm(n):lm(n,t);oo(n).forEach(i=>{let r;for(const n of e.children){const e=n.component.scales[i];if(e){r=Np(r,e.getWithExplicit(t),t,"scale",Sp((e,n)=>{switch(t){case"range":return e.step&&n.step?e.step-n.step:0}return 0}))}}n[i].setWithExplicit(t,r)})}function gm(e,t,n,i){const r=function(e,t,n){switch(t.type){case"nominal":case"ordinal":return ga(e)||"discrete"===Pa(e)?("shape"===e&&"ordinal"===t.type&&as(is.discreteChannelCannotEncode(e,"ordinal")),"ordinal"):Qr(["x","y"],e)&&Qr(["rect","bar","image","rule"],n)?"band":"point";case"temporal":return ga(e)?"time":"discrete"===Pa(e)?(as(is.discreteChannelCannotEncode(e,"temporal")),"ordinal"):t.timeUnit&&Ds(t.timeUnit).utc?"utc":"time";case"quantitative":return ga(e)?cc(t.bin)?"bin-ordinal":"linear":"discrete"===Pa(e)?(as(is.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(is.invalidFieldType(t.type))}(t,n,i),{type:o}=e;return _a(t)?void 0!==o?lu(t,o)?cu(o,n.type)?o:(as(is.scaleTypeNotWorkWithFieldDef(o,r)),r):(as(is.scaleTypeNotWorkWithChannel(t,o,r)),r):r:null}function pm(e){bm(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return Ba.reduce((i,r)=>{let o,a;const s=t[r];if(Bu(s)&&"geoshape"===n&&r===ia&&"geojson"===s.type)return i;if(Bu(s)?(o=s,a=s.scale):Mu(s)&&(o=s.condition,a=s.condition.scale),o&&null!==a&&!1!==a){a=null!=a?a:{};const t=gm(a,r,o,n);i[r]=new im(e.scaleName(r+"",!0),{value:t,explicit:a.type===t})}return i},{})}(e):e.component.scales=function(e){const t=e.component.scales={},n={},i=e.component.resolve;for(const t of e.children)pm(t),oo(t.component.scales).forEach(r=>{var o;if(i.scale[r]=null!==(o=i.scale[r])&&void 0!==o?o:Fp(r,e),"shared"===i.scale[r]){const e=n[r],o=t.component.scales[r].getWithExplicit("type");e?Ws(e.value,o.value)?n[r]=Np(e,o,"type","scale",hm):(i.scale[r]="independent",delete n[r]):n[r]=o}});for(const i of oo(n)){const r=e.scaleName(i,!0),o=n[i];t[i]=new im(r,o);for(const t of e.children){const e=t.component.scales[i];e&&(t.renameScale(e.get("name"),r),e.merged=!0)}}return t}(e)}const hm=Sp((e,t)=>Gs(e)-Gs(t));class mm{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function bm(e){return"unit"===(null==e?void 0:e.type)}function vm(e){return"facet"===(null==e?void 0:e.type)}function ym(e){return"repeat"===(null==e?void 0:e.type)}function xm(e){return"concat"===(null==e?void 0:e.type)}function wm(e){return"layer"===(null==e?void 0:e.type)}class Am{constructor(e,t,n,i,r,a,s,u){var c,l;this.type=t,this.parent=n,this.config=r,this.repeater=a,this.view=u,this.children=[],this.correctDataNames=e=>(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=r,this.repeater=a,this.name=null!==(c=e.name)&&void 0!==c?c:i,this.title=Ra(e.title)?{text:e.title}:e.title,this.scaleNameMap=n?n.scaleNameMap:new mm,this.projectionNameMap=n?n.projectionNameMap:new mm,this.signalNameMap=n?n.signalNameMap:new mm,this.data=e.data,this.description=e.description,this.transforms=(null!==(l=e.transform)&&void 0!==l?l:[]).map(e=>Gl(e)?{filter:Ir(e.filter,Ps)}:e),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var i,r;const a=n[t],s={},{spacing:u,columns:c}=a;void 0!==u&&(s.spacing=u),void 0!==c&&(ju(e)&&!Du(e.facet)||el(e)&&o(e.repeat)||Qc(e))&&(s.columns=c),Zc(e)&&(s.columns=1);for(const t of il)if(void 0!==e[t])if("spacing"===t){const n=e[t];s[t]=y(n)?n:{row:null!==(i=n.row)&&void 0!==i?i:u,column:null!==(r=n.column)&&void 0!==r?r:u}}else s[t]=e[t];return s}(e,t,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:ju(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new jp,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},s?Hr(s):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){pm(e),Gh(e);for(const t of au)lm(e,t);t||fm(e)}(this)}parseProjection(){rh(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Gp(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const t=w(e,["style"]),n={};for(const e of oo(t)){const i=t[e];void 0!==i&&(n[e]=Ya(i))}return n}assembleGroupEncodeEntry(e){let t=void 0;return this.view&&(t=this.assembleEncodeFromView(this.view)),e||"unit"!==this.type&&"layer"!==this.type?t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=w(e,["spacing"]),{component:i,config:r}=this,o=function(e,t){const n={};for(const i of ha){const r=e[i];if(null==r?void 0:r.facetFieldDef){const{titleAnchor:e,titleOrient:o}=ap(["titleAnchor","titleOrient"],r.facetFieldDef,t,i),a=rp(i,o),s=bp(e,a);void 0!==s&&(n[a]=s)}}return oo(n).length>0?n:void 0}(i.layoutHeaders,r);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),o?{titleBand:o}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of ha)e[n].title&&t.push(cp(this,n));for(const e of sp)t=t.concat(dp(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(e=>Gg(e,"grid",t)),...i.map(e=>Gg(e,"grid",t)),...n.map(e=>Gg(e,"main",t)),...i.map(e=>Gg(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return Zp(this)}assembleProjections(){return eh(this)}assembleTitle(){var e,t,n;const i=null!==(e=this.title)&&void 0!==e?e:{},{encoding:r}=i,o=w(i,["encoding"]),a=Object.assign(Object.assign(Object.assign({},La(this.config.title).nonMark),o),r?{encode:{update:r}}:{});if(a.text)return Qr(["unit","layer"],this.type)?Qr(["middle",void 0],a.anchor)&&(a.frame=null!==(t=a.frame)&&void 0!==t?t:"group"):a.anchor=null!==(n=a.anchor)&&void 0!==n?n:"start",oo(a).length>0?a:void 0}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||vm(this.parent)?function e(t){return wm(t)||xm(t)||ym(t)?t.children.reduce((t,n)=>t.concat(e(n)),nm(t)):nm(t)}(this):[];i.length>0&&(t.scales=i);const r=this.assembleAxes();r.length>0&&(t.axes=r);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return uo((this.name?this.name+"_":"")+e)}requestDataName(e){var t;const n=this.getName(e),i=this.component.data.outputNodeRefCounts;return i[n]=(null!==(t=i[n])&&void 0!==t?t:0)+1,n}getSizeSignalRef(e){if(vm(this.parent)){const t=Sa(Op(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(eu(e)&&Ia(i)){const e=n.get("name"),i=em(tm(this,t));if(i){return{signal:Ap(e,n,Ru({aggregate:"distinct",field:i},{expr:"datum"}))}}return as(`Unknown field for ${t}. Cannot calculate view size.`),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):xa(e)&&_a(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(is.selectionNotFound(t));return n}}class Om extends Am{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Ru(n,t)}reduceFieldDef(e,t){return xc(this.getMapping(),(t,n,i)=>{const r=Qu(n);return r?e(t,r,i):t},t)}forEachFieldDef(e,t){yc(this.getMapping(),(t,n)=>{const i=Qu(t);i&&e(i,n)},t)}}class Cm extends ed{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=Hr(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"value",null!==(r=o[1])&&void 0!==r?r:"density"]}clone(){return new Cm(null,Hr(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Xr(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=w(e,["density"]);return Object.assign({type:"kde",field:t},n)}}class Fm extends ed{constructor(e,t){super(e),this.filter=t}clone(){return new Fm(null,Object.assign({},this.filter))}static make(e,t){const{config:n,mark:i,markDef:r}=t;if("filter"!==Xa("invalid",r,n))return null;const o=t.reduceFieldDef((e,n,r)=>{const o=_a(r)&&t.getScaleComponent(r);if(o){tu(o.get("type"))&&"count"!==n.aggregate&&!Eo(i)&&(e[n.field]=n)}return e},{});return oo(o).length?new Fm(e,o):null}dependentFields(){return new Set(oo(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Xr(this.filter)}`}assemble(){const e=oo(this.filter).reduce((e,t)=>{const n=this.filter[t],i=Ru(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`):"quantitative"===n.type&&(e.push(`isValid(${i})`),e.push(`isFinite(+${i})`))),e},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class Dm extends ed{constructor(e,t){super(e),this.transform=t,this.transform=Hr(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map((e,t)=>{var n;return null!==(n=i[t])&&void 0!==n?n:e})}clone(){return new Dm(this.parent,Hr(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Xr(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class jm extends ed{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=Hr(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"key",null!==(r=o[1])&&void 0!==r?r:"value"]}clone(){return new jm(null,Hr(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Xr(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class km extends ed{constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}clone(){return new km(null,Hr(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[["longitude","latitude"],["longitude2","latitude2"]]){const r=i.map(e=>t.channelHasField(e)?t.fieldDef(e).field:zu(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0);(r[0]||r[1])&&(e=new km(e,r,null,t.getName(`geojson_${n++}`)))}if(t.channelHasField(ia)){const i=t.fieldDef(ia);"geojson"===i.type&&(e=new km(e,null,i.field,t.getName(`geojson_${n++}`)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(s);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Xr(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class Em extends ed{constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}clone(){return new Em(null,this.projection,Hr(this.fields),Hr(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[["longitude","latitude"],["longitude2","latitude2"]]){const i=n.map(e=>t.channelHasField(e)?t.fieldDef(e).field:zu(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0),r="longitude2"===n[0]?"2":"";(i[0]||i[1])&&(e=new Em(e,t.projectionName(),i,[t.getName("x"+r),t.getName("y"+r)]))}return e}dependentFields(){return new Set(this.fields.filter(s))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Xr(this.fields)} ${Xr(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Sm extends ed{constructor(e,t){super(e),this.transform=t}clone(){return new Sm(null,Hr(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e;return{signal:`sequence(${[t,n,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,t){return new Sm(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,r=n.y;if(Bu(i)&&Bu(r)){const o=i.impute?i:r.impute?r:void 0;if(void 0===o)return;const a=i.impute?r:r.impute?i:void 0,{method:s,value:u,frame:c,keyvals:l}=o.impute,f=wc(t.mark,n);return new Sm(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:a.field},s?{method:s}:{}),void 0!==u?{value:u}:{}),c?{frame:c}:{}),void 0!==l?{keyvals:l}:{}),f.length?{groupby:f}:{}))}return null}hash(){return`Impute ${Xr(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:r,value:o,frame:a=[null,null]}=this.transform,s=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(u=n,void 0!==(null==u?void 0:u.stop)?this.processSequence(n):n)}:{}),{method:"value"}),r?{groupby:r}:{}),{value:i&&"value"!==i?null:o});var u;if(i&&"value"!==i){return[s,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1},r?{groupby:r}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[s]}}class $m extends jp{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}class Nm extends ed{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=Hr(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:t.on,null!==(r=o[1])&&void 0!==r?r:t.loess]}clone(){return new Nm(null,Hr(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Xr(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,i=w(e,["loess","on"]);return Object.assign({type:"loess",x:n,y:t},i)}}class Mm extends ed{constructor(e,t,n){super(e),this.transform=t,this.secondary=n}clone(){return new Mm(null,Hr(this.transform),this.secondary)}static make(e,t,n,i){const r=t.component.data.sources,{from:o}=n;let a=null;if(function(e){return void 0!==e.data}(o)){let e=eb(o.data,r);e||(e=new ch(o.data),r.push(e));const n=t.getName(`lookup_${i}`);a=new td(e,n,"lookup",t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return void 0!==e.selection}(o)){const e=o.selection;if(n=Object.assign({as:e},n),a=t.getSelectionComponent(uo(e),e).materialized,!a)throw new Error(is.noSameUnitLookup(e))}return new Mm(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?h(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Xr({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e=Object.assign({values:this.transform.from.fields},this.transform.as?{as:h(this.transform.as)}:{});else{let t=this.transform.as;s(t)||(as(is.NO_FIELDS_NEEDS_AS),t="_lookup"),e={as:[t]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e),this.transform.default?{default:this.transform.default}:{})}}class Bm extends ed{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=Hr(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:"prob",null!==(r=o[1])&&void 0!==r?r:"value"]}clone(){return new Bm(null,Hr(this.transform))}dependentFields(){var e;return new Set([this.transform.quantile,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Xr(this.transform)}`}assemble(){const e=this.transform,{quantile:t}=e,n=w(e,["quantile"]);return Object.assign({type:"quantile",field:t},n)}}class _m extends ed{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=Hr(t);const o=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=o[0])&&void 0!==i?i:t.on,null!==(r=o[1])&&void 0!==r?r:t.regression]}clone(){return new _m(null,Hr(this.transform))}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Xr(this.transform)}`}assemble(){const e=this.transform,{regression:t,on:n}=e,i=w(e,["regression","on"]);return Object.assign({type:"regression",x:n,y:t},i)}}class Tm extends ed{constructor(e,t){super(e),this.transform=t}clone(){return new Tm(null,Hr(this.transform))}addDimensions(e){var t;this.transform.groupby=to((null!==(t=this.transform.groupby)&&void 0!==t?t:[]).concat(e),e=>e)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${Xr(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:r}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==i?{limit:i}:{}),void 0!==r?{op:r}:{}),void 0!==n?{groupby:n}:{})}}class zm extends ed{constructor(e,t){super(e),this.transform=t}clone(){return new zm(null,Hr(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Xr(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Um(e){let t=0;return function n(i,r){var o;if(i instanceof ch&&!i.isGenerator&&!Ul(i.data)){e.push(r),r={name:null,source:r.name,transform:[]}}if(i instanceof Oh&&(i.parent instanceof ch&&!r.source?(r.format=Object.assign(Object.assign({},null!==(o=r.format)&&void 0!==o?o:{}),{parse:i.assembleFormatParse()}),r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof yh)return r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,void i.assemble().forEach(t=>e.push(t));if((i instanceof fh||i instanceof dh||i instanceof Fm||i instanceof Lg||i instanceof np||i instanceof Em||i instanceof km||i instanceof vh||i instanceof Mm||i instanceof Dh||i instanceof Ch||i instanceof jm||i instanceof Dm||i instanceof Cm||i instanceof Nm||i instanceof Bm||i instanceof _m||i instanceof jh||i instanceof zm||i instanceof Tm)&&r.transform.push(i.assemble()),(i instanceof uh||i instanceof nd||i instanceof Sm||i instanceof Fh)&&r.transform.push(...i.assemble()),i instanceof td)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof td)i.setSource(r.name);else if(r.name||(r.name=`data_${t++}`),i.setSource(r.name),1===i.numChildren()){e.push(r),r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof td&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source,i.children.forEach(e=>{n(e,{name:null,source:o,transform:[]})});break}}}}function Pm(e){return"top"===e||"left"===e?"header":"footer"}function Lm(e,t){var n;if(e.channelHasField(t)){const i=e.facet[t],r=op("title",null,e.config,t);let a=Yu(i,e.config,{allowDisabling:!0,includeDefault:void 0===r||!!r});e.child.component.layoutHeaders[t].title&&(a=o(a)?a.join(", "):a,a+=" / "+e.child.component.layoutHeaders[t].title,e.child.component.layoutHeaders[t].title=null);const s=op("labelOrient",i,e.config,t),u=vo((null!==(n=i.header)&&void 0!==n?n:{}).labels,!0),c=Qr(["bottom","right"],s)?"footer":"header";e.component.layoutHeaders[t]={title:a,facetFieldDef:i,[c]:"facet"===t?[]:[Rm(e,t,u)]}}}function Rm(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function qm(e,t){var n;const{child:i}=e;if(i.component.axes[t]){const{layoutHeaders:r,resolve:o}=e.component;if(o.axis[t]=Dp(o,t),"shared"===o.axis[t]){const o="x"===t?"column":"row",a=r[o];for(const r of i.component.axes[t]){const t=Pm(r.get("orient"));a[t]=null!==(n=a[t])&&void 0!==n?n:[Rm(e,o,!1)];const i=Gg(r,"main",e.config,{header:!0});a[t][0].axes.push(i),r.mainExtracted=!0}}}}const Im=Wm;function Wm(e){Hm(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";Gm(e,t),Gm(e,n)}function Hm(e){for(const t of e.children)t.parseLayoutSize()}function Gm(e,t){const n=Op(t),i=Sa(n),r=e.component.resolve,o=e.component.layoutSize;let a;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),o=r.scale[i];if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Np(a,e,n,"")}else a=e}if(a){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Ym(e,t){const n="width"===t?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const e=r.get("type"),n=r.get("range");if(eu(e)){const e=al(i.view,t);return Ia(n)||tl(e)?"step":e}return rl(i.view,t)}if(e.hasProjection)return rl(i.view,t);{const e=al(i.view,t);return tl(e)?e.step:e}}function Vm(e,t){return function(e){return e&&!s(e)&&"repeat"in e}(e.field)?e.field.repeat in t?Object.assign(Object.assign({},e),{field:t[e.field.repeat]}):void as(is.noSuchRepeatedValue(e.field.repeat)):e}function Xm(e,t){if(void 0!==(e=Vm(e,t))){if(null===e)return null;if(Eu(e)&&Cu(e.sort)){const n=Vm(e.sort,t);e=Object.assign(Object.assign({},e),n?{sort:n}:{})}return e}}function Jm(e,t){if(!Bu(e)){if(Mu(e)){const n=Xm(e.condition,t);if(n)return Object.assign(Object.assign({},e),{condition:n});return w(e,["condition"])}return e}{const n=Xm(e,t);if(n)return n;if(Nu(e))return{condition:e.condition}}}function Qm(e,t){const n={};for(const i in e)if(b(e,i)){const r=e[i];if(o(r))n[i]=r.map(e=>Jm(e,t)).filter(e=>e);else{const e=Jm(r,t);void 0!==e&&(n[i]=e)}}return n}function Zm(e,t,n){return Ru(t,Object.assign({suffix:`by_${Ru(e)}`},null!=n?n:{}))}class Km extends Om{constructor(e,t,n,i,r){super(e,"facet",t,n,r,i,e.resolve),this.child=Db(e.spec,this,this.getName("child"),void 0,i,r),this.children=[this.child];const o=function(e,t){return Du(e)?Qm(e,t):Xm(e,t)}(e.facet,i);this.facet=this.initFacet(o)}initFacet(e){return Du(e)?xc(e,(e,t,n)=>Qr([Xo,"column"],n)?void 0===t.field?(as(is.emptyFieldDef(t,n)),e):(e[n]=Ku(t,n),e):(as(is.incompatibleChannel(n,"facet")),e),{}):{facet:Ku(e,"facet")}}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=nb(this),this.child.parseData()}parseLayoutSize(){Hm(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of ha)Lm(e,t);qm(e,"x"),qm(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){var e,t,n;const i={};for(const r of ha)for(const o of up){const a=this.component.layoutHeaders[r],s=a[o],{facetFieldDef:u}=a;if(u){const t=op("titleOrient",u,this.config,r);if(Qr(["right","bottom"],t)){const n=rp(r,t);i.titleAnchor=null!==(e=i.titleAnchor)&&void 0!==e?e:{},i.titleAnchor[n]="end"}}if(null==s?void 0:s[0]){const e="row"===r?"height":"width",s="header"===o?"headerBand":"footerBand";"facet"===r||this.child.component.layoutSize.get(e)||(i[s]=null!==(t=i[s])&&void 0!==t?t:{},i[s][r]=.5),a.title&&(i.offset=null!==(n=i.offset)&&void 0!==n?n:{},i.offset["row"===r?"rowTitle":"columnTitle"]=10)}}return i}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:i})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Km)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(e){return this.parent&&this.parent instanceof Km?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:Ru(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(e)):super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof Km){if(this.child.channelHasField("column")){const i=Ru(this.child.facet.column);e.push(i),t.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of["x","y"]){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(eu(o)&&Ia(a)){const r=em(tm(this.child,i));r?(e.push(r),t.push("distinct"),n.push(`distinct_${r}`)):as(`Unknown field for ${i}. Cannot calculate view size.`)}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:a,as:s}=this.getCardinalityAggregateForChild(),u=[];for(const e of ha){const t=this.facet[e];if(t){u.push(Ru(t));const{bin:c,sort:l}=t;if(cc(c)&&u.push(Ru(t,{binSuffix:"end"})),Cu(l)){const{field:e,op:o=xu}=l,u=Zm(t,l);n&&i?(r.push(u),a.push("max"),s.push(u)):(r.push(e),a.push(o),s.push(u))}else if(o(l)){const n=ip(t,e);r.push(n),a.push("max"),s.push(n)}}}const c=!!n&&!!i;return Object.assign({name:e,data:t,groupby:u},c||r.length>0?{aggregate:Object.assign(Object.assign({},c?{cross:c}:{}),r.length?{fields:r,ops:a,as:s}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?Cu(n.sort)?[Zm(n,n.sort,{expr:"datum"})]:o(n.sort)?[ip(n,e,{expr:"datum"})]:[Ru(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(Cu(e)?e.order:!o(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return pp(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const i of sp)if(e[i]){const r=op("labelOrient",e[i],t,i);if(Qr(n[i],r))return pp(e[i],i,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=Um(t);return e.children.forEach(t=>n(t,{source:e.name,name:null,transform:[]})),t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),r=e.assembleGroupStyle();return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},i?{title:i}:{}),r?{style:r}:{}),{from:{facet:this.assembleFacet()},sort:{field:ha.map(e=>this.facetSortFields(e)).flat(),order:ha.map(e=>this.facetSortOrder(e)).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&oo(e.component.selection).length){const n=u(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ff("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return xd(t)}(this,[])))]}getMapping(){return this.facet}}function eb(e,t){var n,i,r,o,a,s,u,c,l,f;for(const d of t){const t=d.data;if((!e.name||!d.hasName()||e.name===d.dataName)&&!((null===(n=e.format)||void 0===n?void 0:n.mesh)&&(null===(i=t.format)||void 0===i?void 0:i.feature)||((null===(r=e.format)||void 0===r?void 0:r.feature)||(null===(o=t.format)||void 0===o?void 0:o.feature))&&(null===(a=e.format)||void 0===a?void 0:a.feature)!==(null===(s=t.format)||void 0===s?void 0:s.feature)||((null===(u=e.format)||void 0===u?void 0:u.mesh)||(null===(c=t.format)||void 0===c?void 0:c.mesh))&&(null===(l=e.format)||void 0===l?void 0:l.mesh)!==(null===(f=t.format)||void 0===f?void 0:f.mesh)))if(Pl(e)&&Pl(t)){if(Wr(e.values,t.values))return d}else if(Ul(e)&&Ul(t)){if(e.url===t.url)return d}else if(Ll(e)&&e.name===d.dataName)return d}return null}function tb(e,t){if(e.data||!e.parent){if(null===e.data){const e=new ch([]);return t.push(e),e}const n=eb(e.data,t);if(n)return Rl(e.data)||(n.data.format=function(e,...t){for(const n of t)eo(e,null!=n?n:{});return e}({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new ch(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function nb(e){var t,n,i,r,o,a,s,u,c,l;let f=tb(e,e.component.data.sources);const{outputNodes:d,outputNodeRefCounts:g}=e.component.data,p=e.parent?e.parent.component.data.ancestorParse.clone():new $m,h=e.data;Rl(h)?(ql(h)?f=new dh(f,h.sequence):Wl(h)&&(f=new fh(f,h.graticule)),p.parseNothing=!0):null===(null===(t=null==h?void 0:h.format)||void 0===t?void 0:t.parse)&&(p.parseNothing=!0),f=null!==(n=Oh.makeExplicit(f,e,p))&&void 0!==n?n:f,f=new jh(f);const m=e.parent&&wm(e.parent);(bm(e)||vm(e))&&m&&(f=null!==(i=uh.makeFromEncoding(f,e))&&void 0!==i?i:f),e.transforms.length>0&&(f=function(e,t,n){var i,r;let o=0;for(const a of t.transforms){let s,u=void 0;if(rf(a))s=e=new np(e,a),u="derived";else if(Gl(a)){const r=wh(a);s=e=null!==(i=Oh.makeWithAncestors(e,{},r,n))&&void 0!==i?i:e,e=new Lg(e,t,a.filter)}else if(of(a))s=e=uh.makeFromTransform(e,a,t),u="number";else if(sf(a)){u="date",void 0===n.getWithExplicit(a.field).value&&(e=new Oh(e,{[a.field]:u}),n.set(a.field,u,!1)),s=e=nd.makeFromTransform(e,a)}else if(uf(a))s=e=vh.makeFromTransform(e,a),u="number",Bd(t)&&(e=new jh(e));else if(Yl(a))s=e=Mm.make(e,t,a,o++),u="derived";else if(ef(a))s=e=new Dh(e,a),u="number";else if(tf(a))s=e=new Ch(e,a),u="number";else if(cf(a))s=e=Fh.makeFromTransform(e,a),u="derived";else if(lf(a))s=e=new jm(e,a),u="derived";else if(nf(a))s=e=new Dm(e,a),u="derived";else if(Vl(a))s=e=new Tm(e,a),u="derived";else if(Kl(a))e=new zm(e,a);else if(af(a))s=e=Sm.makeFromTransform(e,a),u="derived";else if(Xl(a))s=e=new Cm(e,a),u="derived";else if(Jl(a))s=e=new Bm(e,a),u="derived";else if(Ql(a))s=e=new _m(e,a),u="derived";else{if(!Zl(a)){as(is.invalidTransformIgnored(a));continue}s=e=new Nm(e,a),u="derived"}if(s&&void 0!==u)for(const e of null!==(r=s.producedFields())&&void 0!==r?r:[])n.set(e,u,!1)}return e}(f,e,p));const b=function(e){const t={};if(bm(e)&&e.component.selection)for(const n of oo(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&bo(e.field)>1&&(t[e.field]="flatten")}return t}(e),v=Ah(e);f=null!==(r=Oh.makeWithAncestors(f,{},Object.assign(Object.assign({},b),v),p))&&void 0!==r?r:f,bm(e)&&(f=km.parseAll(f,e),f=Em.parseAll(f,e)),(bm(e)||vm(e))&&(m||(f=null!==(o=uh.makeFromEncoding(f,e))&&void 0!==o?o:f),f=null!==(a=nd.makeFromEncoding(f,e))&&void 0!==a?a:f,f=np.parseAllForSortIndex(f,e));const y=e.getName("raw"),x=new td(f,y,"raw",g);if(d[y]=x,f=x,bm(e)){const t=vh.makeFromEncoding(f,e);t&&(f=t,Bd(e)&&(f=new jh(f))),f=null!==(s=Sm.makeFromEncoding(f,e))&&void 0!==s?s:f,f=null!==(u=Fh.makeFromEncoding(f,e))&&void 0!==u?u:f}bm(e)&&(f=null!==(c=Fm.make(f,e))&&void 0!==c?c:f);const w=e.getName(Hl),A=new td(f,w,Hl,g);d[w]=A,f=A,bm(e)&&function(e,t){Nd(e,n=>{const i=n.name,r=e.getName(`lookup_${i}`);e.component.data.outputNodes[r]=n.materialized=new td(new Lg(t,e,{selection:i}),r,"lookup",e.component.data.outputNodeRefCounts)})}(e,A);let O=null;if(vm(e)){const t=e.getName("facet");f=null!==(l=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const r of[n,i])if(Cu(r.sort)){const{field:n,op:i=xu}=r.sort;e=t=new Ch(e,{joinaggregate:[{op:i,field:n,as:Zm(r,r.sort,{forAs:!0})}],groupby:[Ru(r)]})}return t}return null}(f,e.facet))&&void 0!==l?l:f,O=new yh(f,e,t,A.getSource()),d[t]=O,f=O}return Object.assign(Object.assign({},e.component.data),{outputNodes:d,outputNodeRefCounts:g,raw:x,main:A,facetRoot:O,ancestorParse:p})}class ib extends Am{constructor(e,t,n,i,r,o,a){super(e,t,n,i,r,o,a)}parseData(){this.component.data=nb(this),this.children.forEach(e=>{e.parseData()})}parseSelections(){this.component.selection={};for(const e of this.children)e.parseSelections(),oo(e.component.selection).forEach(t=>{this.component.selection[t]=e.component.selection[t]})}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){return this.children.reduce((e,t)=>[...e,...t.assembleLayoutSignals()],yp(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),i?{encode:{update:i}}:{}),e.assembleGroup())})}}class rb extends ib{constructor(e,t,n,i,r){var o,a,s,u;super(e,"concat",t,n,r,i,e.resolve),"shared"!==(null===(a=null===(o=e.resolve)||void 0===o?void 0:o.axis)||void 0===a?void 0:a.x)&&"shared"!==(null===(u=null===(s=e.resolve)||void 0===s?void 0:s.axis)||void 0===u?void 0:u.y)||as(is.CONCAT_CANNOT_SHARE_AXIS),this.children=this.getChildren(e).map((e,t)=>Db(e,this,this.getName("concat_"+t),void 0,i,r))}getChildren(e){return Zc(e)?e.vconcat:Kc(e)?e.hconcat:e.concat}parseLayoutSize(){Wm(this)}parseAxisGroup(){return null}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const ob=Object.assign(Object.assign({gridScale:1,scale:1},Do),{labelExpr:1,encode:1}),ab=oo(ob);class sb extends jp{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new sb(Hr(this.explicit),Hr(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}}const ub={bottom:"top",top:"bottom",left:"right",right:"left"};function cb(e,t){if(!e)return t.map(e=>e.clone());{if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t[i];if(!!n!=!!r)return;if(n&&r){const t=n.getWithExplicit("orient"),o=r.getWithExplicit("orient");if(t.explicit&&o.explicit&&t.value!==o.value)return;e[i]=lb(n,r)}}}return e}function lb(e,t){for(const n of ab){const i=Np(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(e,t)=>{switch(n){case"title":return ns(e,t);case"gridScale":return{explicit:e.explicit,value:vo(e.value,t.value)}}return $p(e,t,n,"axis")});e.setWithExplicit(n,i)}return e}function fb(e,t){const n="x"===t?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,a=r?r.title:void 0;return o&&a?ts(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}function db(e,t,n,i,r){switch(t){case"titleAngle":case"labelAngle":return e===xo(n[t]);case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===fb(i,r))return!0}return e===n[t]}const gb=["Band","Point","Discrete","Quantitative","Temporal"],pb=x([...gb.map(e=>`axisX${e}`),...gb.map(e=>`axisY${e}`)]);function hb(e,t){var n;const i=t.axis(e),r=new sb;for(const n of ab){const o=mb(n,i,e,t),{configValue:a,configFrom:s}=ko(n)?Zg(n,t.config,e,r.get("orient"),t.getScaleComponent(e).get("type"),i.style):{},u=db(o,n,i,t,e);void 0===o||!u&&void 0!==a?(Qr(["grid","orient","tickCount","labelExpr"],n)&&a||Oo(a)||qa(a)||Qr(["style","axis-config-style"],s)||Qr(["axisQuantitative","axisTemporal"],s)||s in pb)&&r.set(n,a,!1):r.set(n,o,u)}const o=null!==(n=i.encoding)&&void 0!==n?n:{},a=Co.reduce((n,i)=>{var a;if(!r.hasAxisPart(i))return n;const s=Cp(null!==(a=o[i])&&void 0!==a?a:{},t),u="labels"===i?function(e,t,n){var i;const r=null!==(i=e.fieldDef(t))&&void 0!==i?i:"x"===t?e.fieldDef("x2"):"y"===t?e.fieldDef("y2"):void 0,o=e.axis(t),{format:a,formatType:s}=o,{config:u}=e,c=hu({fieldDef:r,field:"datum.value",format:a,formatType:s,config:u,isUTCScale:e.getScaleComponent(t).get("type")===Rs.UTC,omitTimeFormatConfig:!0,omitNumberFormatAndEmptyTimeFormat:!0});let l=Object.assign(Object.assign({},c?{text:c}:{}),n);return l=Object.assign(Object.assign({},l),n),0===oo(l).length?void 0:l}(t,e,s):s;return void 0!==u&&oo(u).length>0&&(n[i]={update:u}),n},{});return oo(a).length>0&&r.set("encode",a,!!i.encoding||void 0!==i.labelAngle),r}function mb(e,t,n,i){const r=i.fieldDef(n),a=function(e,t,n,i){if(void 0!==t.labelAngle)return xo(t.labelAngle);{const{configValue:r}=Zg("labelAngle",e.config,n,tp(n),e.getScaleComponent(n).get("type"),t.style);return void 0!==r?xo(r):n===Jo&&Qr(["nominal","ordinal"],i.type)?270:void 0}}(i,t,n,r),s=vo(t.orient,tp(n)),{mark:u,config:c}=i;switch(e){case"scale":return i.scaleName(n);case"gridScale":return function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(i,n);case"format":if(ic(r)||rc(r))return;return mu(r,t.format,c);case"formatType":if(ic(r)||rc(r))return;return t.formatType;case"grid":if(lc(i.fieldDef(n).bin))return!1;{const e=i.getScaleComponent(n).get("type");return vo(t.grid,function(e,t){return!eu(e)&&!cc(t.bin)}(e,r))}case"labelAlign":return vo(t.labelAlign,ep(a,s));case"labelAngle":return a;case"labelBaseline":return vo(t.labelBaseline,Kg(a,s));case"labelFlush":return vo(t.labelFlush,function(e,t){if("x"===t&&Qr(["quantitative","temporal"],e.type))return!0}(r,n));case"labelOverlap":{const e=i.getScaleComponent(n).get("type");return vo(t.labelOverlap,function(e,t){if("nominal"!==e.type)return"log"!==t||"greedy"}(r,e))}case"orient":return s;case"tickCount":{const e=i.getScaleComponent(n).get("type"),o="x"===n?"width":"y"===n?"height":void 0,a=o?i.getSizeSignalRef(o):void 0;return vo(t.tickCount,function({fieldDef:e,scaleType:t,size:n}){var i;if(!eu(t)&&"log"!==t&&!Qr(["month","hours","day","quarter"],null===(i=Ds(e.timeUnit))||void 0===i?void 0:i.unit))return cc(e.bin)?{signal:`ceil(${n.signal}/10)`}:{signal:`ceil(${n.signal}/40)`}}({fieldDef:r,scaleType:e,size:a}))}case"title":{const e="x"===n?"x2":"y2",o=i.fieldDef(e);return vo(t.title,fb(i,n),es([ku(r)],o?[ku(o)]:[]))}case"values":return function(e,t,n){const i=e.values;return o(i)?ac(n,i):qa(i)?i:void 0}(t,0,r);case"zindex":return vo(t.zindex,function(e,t){return"rect"===e&&qu(t)?1:0}(u,r))}return ko(e)?t[e]:void 0}function bb(e,t,n,{graticule:i}){var r,o,a;const s=No(e)?Object.assign({},e):{type:e},u=null!==(r=s.orient)&&void 0!==r?r:Ja("orient",s,n);if(s.orient=function(e,t,n){switch(e){case"point":case"circle":case"square":case"text":case"rect":case"image":return}const{x:i,y:r,x2:o,y2:a}=t;switch(e){case"bar":if(Bu(i)&&(lc(i.bin)||Bu(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Bu(r)&&(lc(r.bin)||Bu(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o&&Bu(i)&&"quantitative"===i.type&&!cc(i.bin))return"horizontal";if(!a&&Bu(r)&&"quantitative"===r.type&&!cc(r.bin))return"vertical"}case"rule":if(o&&a)return;case"area":if(a)return Bu(r)&&lc(r.bin)?"horizontal":"vertical";if(o)return Bu(i)&&lc(i.bin)?"vertical":"horizontal";if("rule"===e){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case"line":case"tick":{const t=Bu(i)&&Iu(i),o=Bu(r)&&Iu(r);if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o){const t=i,o=r,a="temporal"===t.type,s="temporal"===o.type;return a&&!s?"tick"!==e?"vertical":"horizontal":!a&&s?"tick"!==e?"horizontal":"vertical":!t.aggregate&&o.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!o.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(s.type,t,u),void 0!==u&&u!==s.orient&&as(is.orientOverridden(s.orient,u)),"bar"===s.type&&s.orient){const e=null!==(o=s.cornerRadiusEnd)&&void 0!==o?o:Ja("cornerRadiusEnd",s,n);if(void 0!==e){const n="horizontal"===s.orient&&t.x2||"vertical"===s.orient&&t.y2?["cornerRadius"]:_o[s.orient];for(const t of n)s[t]=e;void 0!==s.cornerRadiusEnd&&delete s.cornerRadiusEnd}}return void 0===vo(s.opacity,Ja("opacity",s,n))&&(s.opacity=function(e,t){if(Qr(["point","tick","circle","square"],e)&&!hc(t))return.7;return}(s.type,t)),void 0===s.filled&&(s.filled=!i&&function(e,t){const n=Ja("filled",e,t),i=e.type;return vo(n,"point"!==i&&"line"!==i&&"rule"!==i)}(s,n)),void 0===(null!==(a=s.cursor)&&void 0!==a?a:Ja("cursor",s,n))&&(s.cursor=function(e,t,n){if(t.href||e.href||Ja("href",e,n))return"pointer";return e.cursor}(s,t,n)),s}function vb(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore"})),Tf("x",e,{defaultPos:"mid"})),Tf("y",e,{defaultPos:"mid"})),Ef("size",e)),function(e,t,n){if(n)return{shape:{value:n}};return Ef("shape",e)}(e,0,t))}function yb(e){const{config:t,markDef:n}=e,{orient:i}=n,r="horizontal"===i?"width":"height",o=e.getScaleComponent("horizontal"===i?"x":"y"),a=vo(n[r],n.size,Ja("size",n,t,{vgChannel:r}),t.tick.bandSize);if(void 0!==a)return a;{const e=o?o.get("range"):void 0;return e&&Ia(e)&&y(e.step)?3*e.step/4:3*ol(t.view,r)/4}}const xb={area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore"})),Rf("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),Rf("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),Qf(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),Wf(e,"x","bar")),Wf(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>vb(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&Bu(n)&&"geojson"===n.type?{field:Ru(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore"})),Wf(e,"x","image")),Wf(e,"y","image")),$f(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore"})),Tf("x",e,{defaultPos:"mid"})),Tf("y",e,{defaultPos:"mid"})),Ef("size",e,{vgChannel:"strokeWidth"})),Qf(e))},point:{vgMark:"symbol",encodeEntry:e=>vb(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),Wf(e,"x","rect")),Wf(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),Rf("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),Rf("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),Ef("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>vb(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore"})),Tf("x",e,{defaultPos:"mid"})),Tf("y",e,{defaultPos:"mid"})),$f(e)),Ef("size",e,{vgChannel:"fontSize"})),Zf("align",function(e,t,n){var i;if(void 0===(null!==(i=e.align)&&void 0!==i?i:Ja("align",e,n)))return"center";return}(e.markDef,0,t))),Zf("baseline",function(e,t,n){var i;if(void 0===(null!==(i=e.baseline)&&void 0!==i?i:Ja("baseline",e,n)))return"middle";return}(e.markDef,0,t)))}},tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore"})),Tf("x",e,{defaultPos:"mid",vgChannel:"xc"})),Tf("y",e,{defaultPos:"mid",vgChannel:"yc"})),Ef("size",e,{defaultValue:yb(e),vgChannel:r})),{[o]:{value:vo(n.thickness,t.tick.thickness)}})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xf(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore"})),Tf("x",e,{defaultPos:"mid"})),Tf("y",e,{defaultPos:"mid"})),Ef("size",e)),Qf(e))}};function wb(e){return Qr(["line","area","trail"],e.mark)?function(e){const t=wc(e.mark,e.encoding),n=Ab(e,{fromPrefix:t.length>0?"faceted_path_":""});return t.length>0?[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:"faceted_path_"+e.requestDataName(Hl),data:e.requestDataName(Hl),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:n}]:n}(e):Qr(["bar"],e.mark)?function(e){const t=Ga.some(t=>e.markDef[t]||Ja(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t){const[t]=Ab(e,{fromPrefix:"stack_group_"}),n=e.scaleName(e.stack.fieldChannel),i=(t={})=>e.vgField(e.stack.fieldChannel,t),r=(e,t)=>`${e}(${[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})].map(e=>`scale('${n}',${e})`).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o=Object.assign(Object.assign({},Gr(t.encode.update,["y","yc","y2","height",...Ga])),{x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}}),a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},Yr(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(o=Object.assign(Object.assign({},Gr(t.encode.update,["x","xc","x2","width"])),{y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}}),a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},Yr(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of Ga){const i=Ja(n,e.markDef,e.config);t.encode.update[n]?(o[n]=t.encode.update[n],delete t.encode.update[n]):i&&(o[n]={value:i}),i&&(t.encode.update[n]={value:0})}const s=e.fieldDef(e.stack.groupbyChannel),u=Ru(s)?[Ru(s)]:[];return((null==s?void 0:s.bin)||(null==s?void 0:s.timeUnit))&&u.push(Ru(s,{binSuffix:"end"})),o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((n,i)=>{if(t.encode.update[i])return Object.assign(Object.assign({},n),{[i]:t.encode.update[i]});{const t=Ja(i,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[i]:{value:t}}):n}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Hl),name:"stack_group_"+e.requestDataName(Hl),groupby:u,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}return Ab(e)}(e):Ab(e)}function Ab(e,t={fromPrefix:""}){const n=e.mark,i=vo(e.markDef.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),r=Va(e.markDef),a=e.encoding.key,s=function(e){const{encoding:t,stack:n,mark:i,markDef:r,config:a}=e,s=t.order;if(!(!o(s)&&zu(s)&&Jr(s.value)||!s&&Jr(r.order)||Jr(Ja("order",r,a)))){if((o(s)||Bu(s))&&!n)return Ka(s,{expr:"datum"});if(Eo(i)){const n="horizontal"===r.orient?"y":"x",i=t[n];if(Bu(i)){const t=i.sort;if(o(t))return{field:Ru(i,{prefix:n,suffix:"sort_index",expr:"datum"})};if(Cu(t))return{field:Ru({aggregate:hc(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})};if(Ou(t)){return{field:Ru(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}}return{field:Ru(i,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(e),u=function(e){if(!e.component.selection)return null;const t=oo(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=oo(i.component.selection).length,i=i.parent;return n?{interactive:t>0}:null}(e),c=xb[n].postEncodingTransform?xb[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:xb[n].vgMark},i?{clip:!0}:{}),r?{style:r}:{}),a?{key:a.field}:{}),s?{sort:s}:{}),u||{}),{from:{data:t.fromPrefix+e.requestDataName(Hl)},encode:{update:xb[n].encodeEntry(e)}}),c?{transform:c}:{})]}class Ob extends Om{constructor(e,t,n,i={},r,o){var a;super(e,"unit",t,n,o,r,void 0,nl(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const s=No(e.mark)?e.mark.type:e.mark,u=function(e,t){return Qm(e,t)}(null!==(a=e.encoding)&&void 0!==a?a:{},r);this.markDef=bb(e.mark,u,o,{graticule:e.data&&Wl(e.data)});const c=this.encoding=bc(u,this.markDef);this.size=function({encoding:e,size:t}){for(const n of ka){const i=Ea(n),r=Qu(e[n]);tl(t[i])&&r&&Iu(r)&&(delete t[i],as(is.stepDropped(i)))}return t}({encoding:c,size:nl(e)?Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):i}),this.stack=Ol(s,c),this.specifiedScales=this.initScales(s,c),this.specifiedAxes=this.initAxes(c),this.specifiedLegends=this.initLegend(c),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t="geoshape"===this.mark,n=e&&fa.some(t=>Bu(e[t]));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return Ba.reduce((e,n)=>{let i,r;const o=t[n];return Bu(o)?(i=o,r=o.scale):Mu(o)&&(i=o.condition,r=o.condition.scale),i&&(e[n]=null!=r?r:{}),e},{})}initAxes(e){return[Jo,Qo].reduce((t,n)=>{const i=e[n];if(Bu(i)||n===Jo&&Bu(e.x2)||n===Qo&&Bu(e.y2)){const e=Bu(i)?i.axis:null;null!==e&&(t[n]=Object.assign({},e))}return t},{})}initLegend(e){return Na.reduce((t,n)=>{const i=e[n];if(i){const e=Bu(i)?i.legend:Mu(i)?i.condition.legend:null;null!==e&&!1!==e&&function(e){switch(e){case ea:case ta:case na:case ra:case ia:case oa:case ua:case ca:return!0;case aa:case sa:return!1}}(n)&&(t[n]=Object.assign({},e))}return t},{})}parseData(){this.component.data=nb(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of ka){const r=Ea(i);if(t[r]){const e=t[r];n.layoutSize.set(r,tl(e)?"step":e,!0)}else{const t=Ym(e,r);n.layoutSize.set(r,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const i={},r=e.config.selection;for(const o of oo(null!=t?t:{})){const a=Hr(t[o]),u=w(r[a.type],["fields","encodings"]);for(const e in u)"encodings"===e&&a.fields||"fields"===e&&a.encodings||("mark"===e&&(a[e]=Object.assign(Object.assign({},u[e]),a[e])),void 0!==a[e]&&!0!==a[e]||(a[e]=null!==(n=u[e])&&void 0!==n?n:a[e]));const c=uo(o),l=i[c]=Object.assign(Object.assign({},a),{name:c,events:s(a.on)?ff(a.on,"scope"):Hr(a.on)});bd(l,n=>{n.has(l)&&n.parse&&n.parse(e,l,a,t[o])})}return i}(this,this.selection)}parseMarkGroup(){this.component.mark=wb(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,ka.reduce((t,n)=>(e.component.scales[n]&&e.axis(n)&&(t[n]=[hb(n,e)]),t),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(Nd(e,(i,r)=>{const o=i.name,a=u(o+jd);if(0===t.filter(e=>e.name===o).length){const e="global"===i.resolve?"union":i.resolve,n="multi"===i.type?", true)":")";t.push({name:i.name,update:`${Sd}(${a}, ${u(e)}${n}`})}n=!0,r.topLevelSignals&&(t=r.topLevelSignals(e,i,t)),bd(i,n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,i,t))})}),n){0===t.filter(e=>"unit"===e.name).length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return xd(t)}(this,e)}assembleSignals(){return[...Yg(this),...(e=this,t=[],Nd(e,(n,i)=>{const r=n.name;let o=i.modifyExpr(e,n);t.push(...i.signals(e,n)),bd(n,i=>{i.signals&&(t=i.signals(e,n,t)),i.modifyExpr&&(o=i.modifyExpr(e,n,o))}),t.push({name:r+Ed,on:[{events:{signal:n.name+kd},update:`modify(${u(n.name+jd)}, ${o})`}]})}),xd(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return Nd(e,t=>{const i={name:t.name+jd};if(t.init){const n=t.project.items.map(e=>w(e,["signals"])),r=t.init.map(e=>vd(e,!1));i.values="interval"===t.type?[{unit:Md(e,{escape:!1}),fields:n,values:r}]:r.map(t=>({unit:Md(e,{escape:!1}),fields:n,values:t}))}n.filter(e=>e.name===t.name+jd).length||n.push(i)}),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return yp(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&wm(this.parent)||(t=yd(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return pc(this.encoding,e)}fieldDef(e){return Zu(this.encoding[e])}}class Cb extends Am{constructor(e,t,n,i,r,o){super(e,"layer",t,n,o,r,e.resolve,e.view);const a=Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if(vl(e))return new Cb(e,this,this.getName("layer_"+t),a,r,o);if(Uo(e))return new Ob(e,this,this.getName("layer_"+t),a,r,o);throw new Error(is.invalidSpec(e))})}parseData(){this.component.data=nb(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;Hm(e=this),Gm(e,"width"),Gm(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children)e.parseSelections(),oo(e.component.selection).forEach(t=>{this.component.selection[t]=e.component.selection[t]})}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:i}=e.component,r={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const r of oo(t.component.axes))i.axis[r]=Dp(e.component.resolve,r),"shared"===i.axis[r]&&(n[r]=cb(n[r],t.component.axes[r]),n[r]||(i.axis[r]="independent",delete n[r]))}for(const o of[Jo,Qo]){for(const a of e.children)if(a.component.axes[o]){if("independent"===i.axis[o]){n[o]=(null!==(t=n[o])&&void 0!==t?t:[]).concat(a.component.axes[o]);for(const e of a.component.axes[o]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(r[t]>0&&!n){const n=ub[t];r[t]>r[n]&&e.set("orient",n,!1)}r[t]++}}delete a.component.axes[o]}if("independent"===i.axis[o]&&n[o]&&n[o].length>1)for(const e of n[o])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),Yg(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),yp(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)bm(n)&&(t=yd(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),Zp(this))}}class Fb extends ib{constructor(e,t,n,i,r){super(e,"repeat",t,n,r,i,e.resolve),e.resolve&&e.resolve.axis&&("shared"===e.resolve.axis.x||"shared"===e.resolve.axis.y)&&as(is.REPEAT_CANNOT_SHARE_AXIS),this.repeat=e.repeat,this.children=this._initChildren(e,this.repeat,i,r)}_initChildren(e,t,n,i){const r=[],a=!o(t)&&t.row||[n?n.row:null],s=!o(t)&&t.column||[n?n.column:null],u=o(t)&&t||[n?n.repeat:null];for(const t of u)for(const n of a)for(const o of s){const a=(t?`__repeat_repeat_${t}`:"")+(n?`__repeat_row_${n}`:"")+(o?`__repeat_column_${o}`:""),s={repeat:t,row:n,column:o};r.push(Db(e.spec,this,this.getName("child"+a),void 0,s,i))}return r}parseLayoutSize(){Im(this)}assembleDefaultLayout(){const{repeat:e}=this,t=o(e)?void 0:e.column?e.column.length:1;return Object.assign(Object.assign({},t?{columns:t}:{}),{bounds:"full",align:"all"})}}function Db(e,t,n,i,r,o){if(ju(e))return new Km(e,t,n,r,o);if(vl(e))return new Cb(e,t,n,i,r,o);if(Uo(e))return new Ob(e,t,n,i,r,o);if(el(e))return new Fb(e,t,n,r,o);if(function(e){return Zc(e)||Kc(e)||Qc(e)}(e))return new rb(e,t,n,r,o);throw new Error(is.invalidSpec(e))}const jb=new class extends yl{mapUnit(e,{config:t}){if(e.encoding){const{encoding:n,transform:i}=e,{bins:r,timeUnits:o,aggregate:a,groupby:s,encoding:u}=mc(n,t),c=[...i||[],...r,...o,...0===a.length?[]:[{aggregate:a,groupby:s}]];return Object.assign(Object.assign(Object.assign({},e),c.length>0?{transform:c}:{}),{encoding:u})}return e}};const kb=t;e.compile=function(e,t={}){var n;t.logger&&(n=t.logger,os=n),t.fieldTitle&&Gu(t.fieldTitle),t.formatTypes&&function(e){du=new Set(e)}(t.formatTypes);try{const n=dl(d(t.config,e.config)),i=Ml(e,n),r=Db(i,null,"",void 0,void 0,n);return r.parse(),function(e,t){lh(e.sources);let n=0,i=0;for(let i=0;i<5&&Wh(e,t);i++)n++;e.sources.map(Mh);for(let n=0;n<5&&Wh(e,t);n++)i++;lh(e.sources),5===Math.max(n,i)&&as("Maximum optimization runs(5) reached.")}(r.component.data,r),{spec:function(e,t,n={},i){const r=e.config?ml(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){var n,i;const r=[],o=Um(r);let a=0;e.sources.forEach(e=>{e.hasName()||(e.dataName=`source_${a++}`);const t=e.assemble();o(e,t)}),r.forEach(e=>{0===e.transform.length&&delete e.transform});let s=0;for(const[e,t]of r.entries())0!==(null!==(n=t.transform)&&void 0!==n?n:[]).length||t.source||r.splice(s++,0,r.splice(e,1)[0]);for(const t of r)for(const n of null!==(i=t.transform)&&void 0!==i?i:[])"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource());for(const e of r)e.name in t&&(e.values=t[e.name]);return r}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),u=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let l=e.assembleLayoutSignals();return l=l.filter(e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)),Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),t),s?{title:s}:{}),u?{style:u}:{}),c?{encode:{update:c}}:{}),{data:o}),a.length>0?{projections:a}:{}),e.assembleGroup([...l,...e.assembleSelectionTopLevelSignals([])])),r?{config:r}:{}),i?{usermeta:i}:{})}(r,function(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===t?t={type:"pad"}:s(t)&&(t={type:t});if(r&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===r&&"step"===o)as(is.droppingFit()),t.type="pad";else if("step"===r||"step"===o){const e="step"===r?"width":"height";as(is.droppingFit(Sa(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${Sa(e)}`:"fit"}(n)}var a;return Object.assign(Object.assign(Object.assign({},1===oo(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),zl(n)),zl(e))}(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&(os=rs),t.fieldTitle&&Gu(Wu)}},e.extractTransforms=function(e,t){return jb.map(e,{config:t})},e.normalize=Ml,e.version=kb,Object.defineProperty(e,"__esModule",{value:!0})}));
diff --git a/javascript/vega@5.10.0 b/javascript/vega@5.10.0
deleted file mode 100644
--- a/javascript/vega@5.10.0
+++ /dev/null
@@ -1,1 +0,0 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vega={})}(this,(function(t){"use strict";function e(t,e,n){return t.fields=e||[],t.fname=n,t}function n(t){return null==t?null:t.fname}function r(t){return null==t?null:t.fields}function i(t){throw Error(t)}function a(t){var e,n,r,a=[],u=null,o=0,s=t.length,l="";function c(){a.push(l+t.substring(e,n)),l="",e=n+1}for(t+="",e=n=0;n<s;++n)if("\\"===(r=t[n]))l+=t.substring(e,n),l+=t.substring(++n,++n),e=n;else if(r===u)c(),u=null,o=-1;else{if(u)continue;e===o&&'"'===r||e===o&&"'"===r?(e=n+1,u=r):"."!==r||o?"["===r?(n>e&&c(),o=e=n+1):"]"===r&&(o||i("Access path missing open bracket: "+t),o>0&&c(),o=0,e=n+1):n>e?c():e=n+1}return o&&i("Access path missing closing bracket: "+t),u&&i("Access path missing closing quote: "+t),n>e&&(n++,c()),a}var u=Array.isArray;function o(t){return t===Object(t)}function s(t){return"string"==typeof t}function l(t){return u(t)?"["+t.map(l)+"]":o(t)||s(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function c(t,n){var r=a(t),i="return _["+r.map(l).join("][")+"];";return e(Function("_",i),[t=1===r.length?r[0]:t],n||t)}var f=[],h=c("id"),d=e((function(t){return t}),f,"identity"),p=e((function(){return 0}),f,"zero"),g=e((function(){return 1}),f,"one"),m=e((function(){return!0}),f,"true"),v=e((function(){return!1}),f,"false");function y(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}function _(t,e){var n=t||0;return{level:function(t){return arguments.length?(n=+t,this):n},error:function(){return n>=1&&y(e||"error","ERROR",arguments),this},warn:function(){return n>=2&&y(e||"warn","WARN",arguments),this},info:function(){return n>=3&&y(e||"log","INFO",arguments),this},debug:function(){return n>=4&&y(e||"log","DEBUG",arguments),this}}}const x=t=>"__proto__"!==t;function b(...t){return t.reduce((t,e)=>{for(var n in e)if("signals"===n)t.signals=A(t.signals,e.signals);else{var r="legend"===n?{layout:1}:"style"===n||null;w(t,n,e[n],r)}return t},{})}function w(t,e,n,r){var i,a;if(x(e))if(o(n)&&!u(n))for(i in a=o(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?w(a,i,n[i]):x(i)&&(a[i]=n[i]);else t[e]=n}function A(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function k(t){return t[t.length-1]}function M(t){return null==t||""===t?null:+t}function E(t){return function(e){return t*Math.exp(e)}}function D(t){return function(e){return Math.log(t*e)}}function C(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function F(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function S(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function B(t,e,n,r){var i=n(t[0]),a=n(k(t)),u=(a-i)*e;return[r(i-u),r(a-u)]}function z(t,e){return B(t,e,M,d)}function T(t,e){var n=Math.sign(t[0]);return B(t,e,D(n),E(n))}function N(t,e,n){return B(t,e,S(n),S(1/n))}function O(t,e,n){return B(t,e,C(n),F(n))}function R(t,e,n,r,i){var a=r(t[0]),u=r(k(t)),o=null!=e?r(e):(a+u)/2;return[i(o+(a-o)*n),i(o+(u-o)*n)]}function q(t,e,n){return R(t,e,n,M,d)}function U(t,e,n){var r=Math.sign(t[0]);return R(t,e,n,D(r),E(r))}function L(t,e,n,r){return R(t,e,n,S(r),S(1/r))}function P(t,e,n,r){return R(t,e,n,C(r),F(r))}function $(t){return 1+~~(new Date(t).getMonth()/3)}function j(t){return 1+~~(new Date(t).getUTCMonth()/3)}function I(t){return null!=t?u(t)?t:[t]:[]}function H(t,e,n){var r,i=t[0],a=t[1];return a<i&&(r=a,a=i,i=r),(r=a-i)>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function W(t){return"function"==typeof t}function Y(t,n){var i,u,o,s,c,f,h,d,p,g=[],m=(t=I(t)).map((function(t,e){return null==t?null:(g.push(e),W(t)?t:a(t).map(l).join("]["))})),v=g.length-1,y=I(n),_="var u,v;return ";if(v<0)return null;for(u=0;u<=v;++u)W(o=m[i=g[u]])?(s="(u=this."+(f="f"+i)+"(a))",c="(v=this."+f+"(b))",(h=h||{})[f]=o):(s="(u=a["+o+"])",c="(v=b["+o+"])"),f="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[i]?(p=1,d=-1):(p=-1,d=1),_+="("+s+"<"+c+"||u==null)&&v!=null?"+d+":(u>v||v==null)&&u!=null?"+p+":"+f+"!==u&&v===v?"+d+":v!==v&&u===u?"+p+(i<v?":":":0");return o=Function("a","b",_+";"),h&&(o=o.bind(h)),t=t.reduce((function(t,e){return W(e)?(r(e)||[]).forEach((function(e){t[e]=1})):null!=e&&(t[e+""]=1),t}),{}),e(o,Object.keys(t))}function V(t){return W(t)?t:function(){return t}}function G(t,e){var n,r;function i(){e(r),n=r=null}return function(e){r=e,n&&clearTimeout(n),n=setTimeout(i,t)}}function X(t){for(var e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r])t[n]=e[n];return t}function J(t,e){var n,r,i,a,u=0;if(t&&(n=t.length))if(null==e){for(r=t[u];u<n&&(null==r||r!=r);r=t[++u]);for(i=a=r;u<n;++u)null!=(r=t[u])&&(r<i&&(i=r),r>a&&(a=r))}else{for(r=e(t[u]);u<n&&(null==r||r!=r);r=e(t[++u]));for(i=a=r;u<n;++u)null!=(r=e(t[u]))&&(r<i&&(i=r),r>a&&(a=r))}return[i,a]}function Z(t,e){var n,r,i,a,u,o=-1,s=t.length;if(null==e){for(;++o<s;)if(null!=(r=t[o])&&r>=r){n=i=r;break}if(o===s)return[-1,-1];for(a=u=o;++o<s;)null!=(r=t[o])&&(n>r&&(n=r,a=o),i<r&&(i=r,u=o))}else{for(;++o<s;)if(null!=(r=e(t[o],o,t))&&r>=r){n=i=r;break}if(o===s)return[-1,-1];for(a=u=o;++o<s;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r,a=o),i<r&&(i=r,u=o))}return[a,u]}const Q=Object.prototype.hasOwnProperty;function K(t,e){return Q.call(t,e)}var tt={};function et(t){var e,n,r={};function i(t){return K(r,t)&&r[t]!==tt}return e={size:0,empty:0,object:r,has:i,get:function(t){return i(t)?r[t]:void 0},set:function(t,n){return i(t)||(++e.size,r[t]===tt&&--e.empty),r[t]=n,this},delete:function(t){return i(t)&&(--e.size,++e.empty,r[t]=tt),this},clear:function(){e.size=e.empty=0,e.object=r={}},test:function(t){return arguments.length?(n=t,e):n},clean:function(){var t,i,a={},u=0;for(t in r)(i=r[t])===tt||n&&n(i)||(a[t]=i,++u);e.size=u,e.empty=0,e.object=r=a}},t&&Object.keys(t).forEach((function(n){e.set(n,t[n])})),e}function nt(t,e,n,r,i,a){if(!n&&0!==n)return a;var u,o,s=t[0],l=k(t),c=+n;return l<s&&(u=s,s=l,l=u),(u=Math.abs(e-s))<(o=Math.abs(l-e))&&u<=c?r:o<=c?i:a}function rt(t,e){var n=t.prototype=Object.create(e.prototype);return n.constructor=t,n}function it(t,e,n,r){var i,a=e[0],u=e[e.length-1];return a>u&&(i=a,a=u,u=i),r=void 0===r||r,((n=void 0===n||n)?a<=t:a<t)&&(r?t<=u:t<u)}function at(t){return"boolean"==typeof t}function ut(t){return"[object Date]"===Object.prototype.toString.call(t)}function ot(t){return"number"==typeof t}function st(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function lt(t,n){return t&&(t=n?I(t).map((function(t){return t.replace(/\\(.)/g,"$1")})):I(t)),e(t&&t.length?Function("_","return ''+"+t.map((function(t){return"_["+(n?l(t):a(t).map(l).join("]["))+"]"})).join("+'|'+")+";"):function(){return""},t,"key")}function ct(t,e){const n=t[0],r=k(t),i=+e;return i?1===i?r:n+i*(r-n):n}function ft(t){let e,n,r;t=+t||1e4;const i=()=>{e={},n={},r=0},a=(i,a)=>(++r>t&&(n=e,e={},r=1),e[i]=a);return i(),{clear:i,has:t=>K(e,t)||K(n,t),get:t=>K(e,t)?e[t]:K(n,t)?a(t,n[t]):void 0,set:(t,n)=>K(e,t)?e[t]=n:a(t,n)}}function ht(t,e,n,r){var i=e.length,a=n.length;if(!a)return e;if(!i)return n;for(var u=r||new e.constructor(i+a),o=0,s=0,l=0;o<i&&s<a;++l)u[l]=t(e[o],n[s])>0?n[s++]:e[o++];for(;o<i;++o,++l)u[l]=e[o];for(;s<a;++s,++l)u[l]=n[s];return u}function dt(t,e){for(var n="";--e>=0;)n+=t;return n}function pt(t,e,n,r){var i=n||" ",a=t+"",u=e-a.length;return u<=0?a:"left"===r?dt(i,u)+a:"center"===r?dt(i,~~(u/2))+a+dt(i,Math.ceil(u/2)):a+dt(i,u)}function gt(t){return t&&k(t)-t[0]||0}function mt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}function vt(t){return ot(t)||ut(t)?t:Date.parse(t)}function yt(t,e){return e=e||vt,null==t||""===t?null:e(t)}function _t(t){return null==t||""===t?null:t+""}function xt(t){for(var e={},n=0,r=t.length;n<r;++n)e[t[n]]=!0;return e}function bt(t,e,n,r){var i=null!=r?r:"…",a=t+"",u=a.length,o=Math.max(0,e-i.length);return u<=e?a:"left"===n?i+a.slice(u-o):"center"===n?a.slice(0,Math.ceil(o/2))+i+a.slice(u-~~(o/2)):a.slice(0,o)+i}function wt(t,e,n){if(t){var r,i=0,a=t.length;if(e)for(;i<a;++i)(r=e(t[i]))&&n(r,i,t);else t.forEach(n)}}function At(t){var e=t||d,n=[],r={};return n.add=function(t){var i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=function(t){var i,a=e(t);return r[a]&&(r[a]=0,(i=n.indexOf(t))>=0&&n.splice(i,1)),n},n}async function kt(t,e){try{await e(t)}catch(e){t.error(e)}}var Mt=Symbol("vega_id"),Et=1;function Dt(t){return!(!t||!Ct(t))}function Ct(t){return t[Mt]}function Ft(t,e){return t[Mt]=e,t}function St(t){var e=t===Object(t)?t:{data:t};return Ct(e)?e:Ft(e,Et++)}function Bt(t){return zt(t,St({}))}function zt(t,e){for(var n in t)e[n]=t[n];return e}function Tt(t,e){return Ft(e,Ct(t))}function Nt(t,e){return t?e?(n,r)=>t(n,r)||Ct(e(n))-Ct(e(r)):(e,n)=>t(e,n)||Ct(e)-Ct(n):null}function Ot(t){return t&&t.constructor===Rt}function Rt(){var t=[],e=[],n=[],r=[],i=[],a=!1;return{constructor:Rt,insert:function(e){for(var n=I(e),r=0,i=n.length;r<i;++r)t.push(n[r]);return this},remove:function(t){for(var n=W(t)?r:e,i=I(t),a=0,u=i.length;a<u;++a)n.push(i[a]);return this},modify:function(t,e,r){var a={field:e,value:V(r)};return W(t)?(a.filter=t,i.push(a)):(a.tuple=t,n.push(a)),this},encode:function(t,e){return W(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},reflow:function(){return a=!0,this},pulse:function(u,o){var s,l,c,f,h,d,p={},g={};for(s=0,l=o.length;s<l;++s)p[Ct(o[s])]=1;for(s=0,l=e.length;s<l;++s)p[Ct(h=e[s])]=-1;for(s=0,l=r.length;s<l;++s)f=r[s],o.forEach((function(t){f(t)&&(p[Ct(t)]=-1)}));for(s=0,l=t.length;s<l;++s)d=Ct(h=t[s]),p[d]?p[d]=1:u.add.push(St(t[s]));for(s=0,l=o.length;s<l;++s)h=o[s],p[Ct(h)]<0&&u.rem.push(h);function m(t,e,n){n?t[e]=n(t):u.encode=e,a||(g[Ct(t)]=t)}for(s=0,l=n.length;s<l;++s)h=(c=n[s]).tuple,f=c.field,(d=p[Ct(h)])>0&&(m(h,f,c.value),u.modifies(f));for(s=0,l=i.length;s<l;++s)c=i[s],f=c.filter,o.forEach((function(t){f(t)&&p[Ct(t)]>0&&m(t,c.field,c.value)})),u.modifies(c.field);if(a)u.mod=e.length||r.length?o.filter((function(t){return p[Ct(t)]>0})):o.slice();else for(d in g)u.mod.push(g[d]);return u}}}var qt="_:mod:_";function Ut(){Object.defineProperty(this,qt,{writable:!0,value:{}})}var Lt=Ut.prototype;Lt.set=function(t,e,n,r){var i=this,a=i[t],o=i[qt];return null!=e&&e>=0?(a[e]!==n||r)&&(a[e]=n,o[e+":"+t]=-1,o[t]=-1):(a!==n||r)&&(i[t]=n,o[t]=u(n)?1+n.length:-1),i},Lt.modified=function(t,e){var n,r=this[qt];if(!arguments.length){for(n in r)if(r[n])return!0;return!1}if(u(t)){for(n=0;n<t.length;++n)if(r[t[n]])return!0;return!1}return null!=e&&e>=0?e+1<r[t]||!!r[e+":"+t]:!!r[t]},Lt.clear=function(){return this[qt]={},this};var Pt=0,$t=new Ut;function jt(t,e,n,r){this.id=++Pt,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}var It=jt.prototype;function Ht(t){return function(e){var n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}It.targets=function(){return this._targets||(this._targets=At(h))},It.set=function(t){return this.value!==t?(this.value=t,1):0},It.skip=Ht(1),It.modified=Ht(2),It.parameters=function(t,e,n){e=!1!==e;var r,a,o,s,l=this,c=l._argval=l._argval||new Ut,f=l._argops=l._argops||[],h=[];function d(t,n,r){r instanceof jt?(r!==l&&(e&&r.targets().add(l),h.push(r)),f.push({op:r,name:t,index:n})):c.set(t,n,r)}for(r in t)if(a=t[r],"pulse"===r)I(a).forEach((function(t){t instanceof jt?t!==l&&(t.targets().add(l),h.push(t)):i("Pulse parameters must be operator instances.")})),l.source=a;else if(u(a))for(c.set(r,-1,Array(o=a.length)),s=0;s<o;++s)d(r,s,a[s]);else d(r,-1,a);return this.marshall().clear(),n&&(f.initonly=!0),h},It.marshall=function(t){var e,n,r,i,a,u=this._argval||$t,o=this._argops;if(o){for(n=0,r=o.length;n<r;++n)a=(i=(e=o[n]).op).modified()&&i.stamp===t,u.set(e.name,e.index,i.value,a);if(o.initonly){for(n=0;n<r;++n)(e=o[n]).op.targets().remove(this);this._argops=null,this._update=null}}return u},It.evaluate=function(t){var e=this._update;if(e){var n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},It.run=function(t){return t.stamp<this.stamp?t.StopPropagation:(this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t);var e};var Wt=0;function Yt(t,e,n){this.id=++Wt,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Vt(t,e,n){return new Yt(t,e,n)}var Gt=Yt.prototype;Gt._filter=m,Gt._apply=d,Gt.targets=function(){return this._targets||(this._targets=At(h))},Gt.consume=function(t){return arguments.length?(this._consume=!!t,this):!!this._consume},Gt.receive=function(t){if(this._filter(t)){for(var e=this.value=this._apply(t),n=this._targets,r=n?n.length:0,i=0;i<r;++i)n[i].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},Gt.filter=function(t){var e=Vt(t);return this.targets().add(e),e},Gt.apply=function(t){var e=Vt(null,t);return this.targets().add(e),e},Gt.merge=function(){var t=Vt();this.targets().add(t);for(var e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},Gt.throttle=function(t){var e=-1;return this.filter((function(){var n=Date.now();return n-e>t?(e=n,1):0}))},Gt.debounce=function(t){var e=Vt();return this.targets().add(Vt(null,null,G(t,(function(t){var n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},Gt.between=function(t,e){var n=!1;return t.targets().add(Vt(null,null,(function(){n=!0}))),e.targets().add(Vt(null,null,(function(){n=!1}))),this.filter((function(){return n}))};const Xt=/^([A-Za-z]+:)?\/\//,Jt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Zt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function Qt(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function Kt(t,e){e=X({},this.options,e);const n=this.fileAccess,r={href:null};let a,u,o;const s=Jt.test(t.replace(Zt,""));null!=t&&"string"==typeof t&&s||i("Sanitize failure, invalid URI: "+l(t));const c=Xt.test(t);return(o=e.baseURL)&&!c&&(t.startsWith("/")||"/"===o[o.length-1]||(t="/"+t),t=o+t),u=(a=t.startsWith("file://"))||"file"===e.mode||"http"!==e.mode&&!c&&n,a?t=t.slice("file://".length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),u=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!u}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function te(t){return t?function(e){return new Promise((function(n,r){t.readFile(e,(function(t,e){t?r(t):n(e)}))}))}:ee}async function ee(){i("No file system access.")}function ne(t){return t?async function(e,n){const r=X({},this.options.http,n),a=n&&n.response,u=await t(e,r);return u.ok?W(u[a])?u[a]():u.text():i(u.status+""+u.statusText)}:re}async function re(){i("No HTTP fetch method available.")}var ie={boolean:mt,integer:M,number:M,date:yt,string:_t,unknown:d},ae=[function(t){return"true"===t||"false"===t||!0===t||!1===t},function(t){return le(t)&&Number.isInteger(+t)},le,function(t){return!Number.isNaN(Date.parse(t))}],ue=["boolean","integer","number","date"];function oe(t,e){if(!t||!t.length)return"unknown";var n,r,i,a,u=0,o=t.length,s=ae.length,l=ae.map((function(t,e){return e+1}));for(r=0,o=t.length;r<o;++r)for(n=e?t[r][e]:t[r],i=0;i<s;++i)if(l[i]&&(null!=(a=n)&&a==a)&&!ae[i](n)&&(l[i]=0,++u===ae.length))return"string";return u=l.reduce((function(t,e){return 0===t?e:t}),0)-1,ue[u]}function se(t,e){return e.reduce((function(e,n){return e[n]=oe(t,n),e}),{})}function le(t){return!(Number.isNaN(+t)||t instanceof Date)}var ce={},fe={};function he(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function de(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function pe(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function ge(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+pe(-t,6):t>9999?"+"+pe(t,6):pe(t,4)}(t.getUTCFullYear())+"-"+pe(t.getUTCMonth()+1,2)+"-"+pe(t.getUTCDate(),2)+(i?"T"+pe(e,2)+":"+pe(n,2)+":"+pe(r,2)+"."+pe(i,3)+"Z":r?"T"+pe(e,2)+":"+pe(n,2)+":"+pe(r,2)+"Z":n||e?"T"+pe(e,2)+":"+pe(n,2)+"Z":"")}function me(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,u=0,o=0,s=a<=0,l=!1;function c(){if(s)return fe;if(l)return l=!1,ce;var e,r,i=u;if(34===t.charCodeAt(i)){for(;u++<a&&34!==t.charCodeAt(u)||34===t.charCodeAt(++u););return(e=u)>=a?s=!0:10===(r=t.charCodeAt(u++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(u)&&++u),t.slice(i+1,e-1).replace(/""/g,'"')}for(;u<a;){if(10===(r=t.charCodeAt(e=u++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(u)&&++u;else if(r!==n)continue;return t.slice(i,e)}return s=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=c())!==fe;){for(var f=[];r!==ce&&r!==fe;)f.push(r),r=c();e&&null==(f=e(f,o++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return u(e[t])})).join(t)}))}function a(e){return e.map(u).join(t)}function u(t){return null==t?"":t instanceof Date?ge(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=he(t);return function(r,i){return e(n(r),i,t)}}(t,e):he(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=de(e)),[n.map(u).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=de(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:u}}function ve(t){const e=function(e,n){const r={delimiter:t};return ye(e,n?X(n,r):r)};return e.responseType="text",e}function ye(t,e){return e.header&&(t=e.header.map(l).join(e.delimiter)+"\n"+t),me(e.delimiter).parse(t+"")}function _e(t,e){const n=e&&e.property?c(e.property):d;return!o(t)||(r=t,"function"==typeof Buffer&&W(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t));var r}function xe(t){return t}function be(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return we(t,e)}))}:we(t,e)}function we(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,a=Ae(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:a}:null==r?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function Ae(t,e){var n=function(t){if(null==t)return xe;var e,n,r=t.scale[0],i=t.scale[1],a=t.translate[0],u=t.translate[1];return function(t,o){o||(e=n=0);var s=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*r+a,c[1]=(n+=t[1])*i+u;s<l;)c[s]=t[s],++s;return c}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],a=0,u=i.length;a<u;++a)e.push(n(i[a],a));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,u)}function a(t){return n(t)}function u(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function o(t){for(var e=u(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(o)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=a(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(a);break;case"LineString":n=u(e.arcs);break;case"MultiLineString":n=e.arcs.map(u);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:r,coordinates:n}}(e)}function ke(t,e){var n={},r={},i={},a=[],u=-1;function o(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),a.push(i)}}return e.forEach((function(n,r){var i,a=t.arcs[n<0?~n:n];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++u],e[u]=n,e[r]=i)})),e.forEach((function(e){var n,a,u=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),o=u[0],s=u[1];if(n=i[o])if(delete i[n.end],n.push(e),n.end=s,a=r[s]){delete r[a.start];var l=a===n?n:n.concat(a);r[l.start=n.start]=i[l.end=a.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[s])if(delete r[n.start],n.unshift(e),n.start=o,a=i[o]){delete i[a.end];var c=a===n?n:a.concat(n);r[c.start=a.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=o]=i[n.end=s]=n})),o(i,r),o(r,i),e.forEach((function(t){n[t<0?~t:t]||a.push([t])})),a}function Me(t){return Ae(t,Ee.apply(this,arguments))}function Ee(t,e,n){var r,i,a;if(arguments.length>1)r=De(t,e,n);else for(i=0,r=new Array(a=t.arcs.length);i<a;++i)r[i]=i;return{type:"MultiLineString",arcs:ke(t,r)}}function De(t,e,n){var r,i=[],a=[];function u(t){var e=t<0?~t:t;(a[e]||(a[e]=[])).push({i:t,g:r})}function o(t){t.forEach(u)}function s(t){t.forEach(o)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":o(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(s)}(e.arcs)}}(e),a.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}ye.responseType="text",_e.responseType="json";const Ce={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function Fe(t,e){let n,r,a,u;return t=_e(t,e),e&&e.feature?(n=be,a=e.feature):e&&e.mesh?(n=Me,a=e.mesh,u=Ce[e.filter]):i("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[a])?n(t,r,u):i("Invalid TopoJSON object: "+a),r&&r.features||[r]}Fe.responseType="json";const Se={dsv:ye,csv:ve(","),tsv:ve("\t"),json:_e,topojson:Fe};function Be(t,e){return arguments.length>1?(Se[t]=e,this):K(Se,t)?Se[t]:null}function ze(t){const e=Be(t);return e&&e.responseType||"text"}var Te=new Date,Ne=new Date;function Oe(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,a){var u,o=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return o;do{o.push(u=new Date(+n)),e(n,a),t(n)}while(u<n&&n<r);return o},i.filter=function(n){return Oe((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Te.setTime(+e),Ne.setTime(+r),t(Te),t(Ne),Math.floor(n(Te,Ne))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Re=Oe((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Re.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Oe((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Re:null};var qe=Oe((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),Ue=Oe((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),Le=Oe((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),Pe=Oe((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}));function $e(t){return Oe((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var je=$e(0),Ie=$e(1),He=($e(2),$e(3),$e(4)),We=($e(5),$e(6),Oe((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),Ye=Oe((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ye.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Oe((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Ve=Oe((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),Ge=Oe((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),Xe=Oe((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}));function Je(t){return Oe((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Ze=Je(0),Qe=Je(1),Ke=(Je(2),Je(3),Je(4)),tn=(Je(5),Je(6),Oe((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),en=Oe((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));function nn(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function rn(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function an(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}en.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Oe((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var un,on,sn,ln,cn,fn={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,dn=/^%/,pn=/[\\^$*+?|[\]().{}]/g;function gn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function mn(t){return t.replace(pn,"\\$&")}function vn(t){return new RegExp("^(?:"+t.map(mn).join("|")+")","i")}function yn(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function _n(t,e,n){var r=hn.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function xn(t,e,n){var r=hn.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function bn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function wn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function An(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function kn(t,e,n){var r=hn.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Mn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function En(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Dn(t,e,n){var r=hn.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Cn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Fn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Sn(t,e,n){var r=hn.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Bn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Tn(t,e,n){var r=hn.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Nn(t,e,n){var r=hn.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function On(t,e,n){var r=hn.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Rn(t,e,n){var r=dn.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function qn(t,e,n){var r=hn.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Un(t,e,n){var r=hn.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Ln(t,e){return gn(t.getDate(),e,2)}function Pn(t,e){return gn(t.getHours(),e,2)}function $n(t,e){return gn(t.getHours()%12||12,e,2)}function jn(t,e){return gn(1+Pe.count(Ye(t),t),e,3)}function In(t,e){return gn(t.getMilliseconds(),e,3)}function Hn(t,e){return In(t,e)+"000"}function Wn(t,e){return gn(t.getMonth()+1,e,2)}function Yn(t,e){return gn(t.getMinutes(),e,2)}function Vn(t,e){return gn(t.getSeconds(),e,2)}function Gn(t){var e=t.getDay();return 0===e?7:e}function Xn(t,e){return gn(je.count(Ye(t)-1,t),e,2)}function Jn(t,e){var n=t.getDay();return t=n>=4||0===n?He(t):He.ceil(t),gn(He.count(Ye(t),t)+(4===Ye(t).getDay()),e,2)}function Zn(t){return t.getDay()}function Qn(t,e){return gn(Ie.count(Ye(t)-1,t),e,2)}function Kn(t,e){return gn(t.getFullYear()%100,e,2)}function tr(t,e){return gn(t.getFullYear()%1e4,e,4)}function er(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gn(e/60|0,"0",2)+gn(e%60,"0",2)}function nr(t,e){return gn(t.getUTCDate(),e,2)}function rr(t,e){return gn(t.getUTCHours(),e,2)}function ir(t,e){return gn(t.getUTCHours()%12||12,e,2)}function ar(t,e){return gn(1+Xe.count(en(t),t),e,3)}function ur(t,e){return gn(t.getUTCMilliseconds(),e,3)}function or(t,e){return ur(t,e)+"000"}function sr(t,e){return gn(t.getUTCMonth()+1,e,2)}function lr(t,e){return gn(t.getUTCMinutes(),e,2)}function cr(t,e){return gn(t.getUTCSeconds(),e,2)}function fr(t){var e=t.getUTCDay();return 0===e?7:e}function hr(t,e){return gn(Ze.count(en(t)-1,t),e,2)}function dr(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Ke(t):Ke.ceil(t),gn(Ke.count(en(t),t)+(4===en(t).getUTCDay()),e,2)}function pr(t){return t.getUTCDay()}function gr(t,e){return gn(Qe.count(en(t)-1,t),e,2)}function mr(t,e){return gn(t.getUTCFullYear()%100,e,2)}function vr(t,e){return gn(t.getUTCFullYear()%1e4,e,4)}function yr(){return"+0000"}function _r(){return"%"}function xr(t){return+t}function br(t){return Math.floor(+t/1e3)}function wr(t){return un=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,u=t.shortDays,o=t.months,s=t.shortMonths,l=vn(i),c=yn(i),f=vn(a),h=yn(a),d=vn(u),p=yn(u),g=vn(o),m=yn(o),v=vn(s),y=yn(s),_={a:function(t){return u[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return o[t.getMonth()]},c:null,d:Ln,e:Ln,f:Hn,H:Pn,I:$n,j:jn,L:In,m:Wn,M:Yn,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:xr,s:br,S:Vn,u:Gn,U:Xn,V:Jn,w:Zn,W:Qn,x:null,X:null,y:Kn,Y:tr,Z:er,"%":_r},x={a:function(t){return u[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return o[t.getUTCMonth()]},c:null,d:nr,e:nr,f:or,H:rr,I:ir,j:ar,L:ur,m:sr,M:lr,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:xr,s:br,S:cr,u:fr,U:hr,V:dr,w:pr,W:gr,x:null,X:null,y:mr,Y:vr,Z:yr,"%":_r},b={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return k(t,e,n,r)},d:Fn,e:Fn,f:On,H:Bn,I:Bn,j:Sn,L:Nn,m:Cn,M:zn,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Dn,Q:qn,s:Un,S:Tn,u:xn,U:bn,V:wn,w:_n,W:An,x:function(t,e,r){return k(t,n,e,r)},X:function(t,e,n){return k(t,r,e,n)},y:Mn,Y:kn,Z:En,"%":Rn};function w(t,e){return function(n){var r,i,a,u=[],o=-1,s=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++o<l;)37===t.charCodeAt(o)&&(u.push(t.slice(s,o)),null!=(i=fn[r=t.charAt(++o)])?r=t.charAt(++o):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),u.push(r),s=o+1);return u.push(t.slice(s,o)),u.join("")}}function A(t,e){return function(n){var r,i,a=an(1900,void 0,1);if(k(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!e||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=rn(an(a.y,0,1))).getUTCDay(),r=i>4||0===i?Qe.ceil(r):Qe(r),r=Xe.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=nn(an(a.y,0,1))).getDay(),r=i>4||0===i?Ie.ceil(r):Ie(r),r=Pe.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?rn(an(a.y,0,1)).getUTCDay():nn(an(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,rn(a)):nn(a)}}function k(t,e,n,r){for(var i,a,u=0,o=e.length,s=n.length;u<o;){if(r>=s)return-1;if(37===(i=e.charCodeAt(u++))){if(i=e.charAt(u++),!(a=b[i in fn?e.charAt(u++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return(_.x=w(n,_),_.X=w(r,_),_.c=w(e,_),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=A(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=A(t+="",!0);return e.toString=function(){return t},e}})}(t),on=un.format,sn=un.parse,ln=un.utcFormat,cn=un.utcParse,un}function Ar(t,e,n){const r=Be((e=e||{}).type||"json");return r||i("Unknown data format type: "+e.type),t=r(t,e),e.parse&&function(t,e,n){if(!t.length)return;n=n||sn;var r,i,a,u,o,s,l,c=t.columns||Object.keys(t[0]);"auto"===e&&(e=se(t,c));for(c=Object.keys(e),r=c.map((function(t){var r,i,a=e[t];if(a&&(0===a.indexOf("date:")||0===a.indexOf("utc:")))return("'"===(i=(r=a.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===r[0]?cn(i):n(i);if(!ie[a])throw Error("Illegal format pattern: "+t+":"+a);return ie[a]})),u=0,s=t.length,l=c.length;u<s;++u)for(i=t[u],o=0;o<l;++o)a=c[o],i[a]=r[o](i[a])}(t,e.parse,n),K(t,"columns")&&delete t.columns,t}wr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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"]});var kr=function(t,e){return function(n){return{options:n||{},sanitize:Kt,load:Qt,fileAccess:!!e,file:te(e),http:ne(t)}}}("undefined"!=typeof fetch&&fetch,null);const Mr=Ar;var Er={skip:!0};function Dr(t,e,n,r,i,a){var u,o,s=X({},a,Er);W(n)||(n=V(n)),void 0===r?u=e=>t.touch(n(e)):W(r)?(o=new jt(null,r,i,!1),u=e=>{o.evaluate(e);const r=n(e),i=o.value;Ot(i)?t.pulse(r,i,a):t.update(r,i,s)}):u=e=>t.update(n(e),r,s),e.apply(u)}function Cr(t,e,n,r,i,a){if(void 0===r)e.targets().add(n);else{const u=a||{},o=new jt(null,function(t,e){return e=W(e)?e:V(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);o.modified(u.force),o.rank=e.rank,e.targets().add(o),n&&(o.skip(!0),o.value=n.value,o.targets().add(n),t.connect(n,[o]))}}var Fr={};function Sr(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}var Br=Sr.prototype;function zr(t,e){return t?function(n,r){return t(n,r)&&e(n,r)}:e}function Tr(t,e){var n=[];return wt(t,e,(function(t){n.push(t)})),n}function Nr(t,e){var n={};return t.visit(e,(function(t){n[Ct(t)]=1})),function(t){return n[Ct(t)]?null:t}}function Or(t,e,n,r){var i,a,u,o,s,l=this,c=0;for(this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n,u=0,o=n.length;u<o;++u)if((i=n[u]).stamp===e){if(i.fields)for(s in a=l.fields||(l.fields={}),i.fields)a[s]=1;i.changed(l.ADD)&&(c|=l.ADD),i.changed(l.REM)&&(c|=l.REM),i.changed(l.MOD)&&(c|=l.MOD)}this.changes=c}Br.StopPropagation=Fr,Br.ADD=1,Br.REM=2,Br.MOD=4,Br.ADD_REM=3,Br.ADD_MOD=5,Br.ALL=7,Br.REFLOW=8,Br.SOURCE=16,Br.NO_SOURCE=32,Br.NO_FIELDS=64,Br.fork=function(t){return new Sr(this.dataflow).init(this,t)},Br.clone=function(){var t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},Br.addAll=function(){var t=this;return this.source&&this.source.length!==this.add.length?((t=new Sr(this.dataflow).init(this)).add=t.source,t):t},Br.init=function(t,e){var n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source),n},Br.runAfter=function(t){this.dataflow.runAfter(t)},Br.changed=function(t){var e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},Br.reflow=function(t){if(t)return this.fork(7).reflow();var e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,Nr(this,1))),this},Br.modifies=function(t){var e=this.fields||(this.fields={});return u(t)?t.forEach(t=>e[t]=!0):e[t]=!0,this},Br.modified=function(t,e){var n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?u(t)?t.some((function(t){return n[t]})):n[t]:!!n)},Br.filter=function(t,e){var n=this;return 1&t&&(n.addF=zr(n.addF,e)),2&t&&(n.remF=zr(n.remF,e)),4&t&&(n.modF=zr(n.modF,e)),16&t&&(n.srcF=zr(n.srcF,e)),n},Br.materialize=function(t){var e=this;return 1&(t=t||7)&&e.addF&&(e.add=Tr(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Tr(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Tr(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},Br.visit=function(t,e){var n,r,i=this,a=e;return 16&t?(wt(i.source,i.srcF,a),i):(1&t&&wt(i.add,i.addF,a),2&t&&wt(i.rem,i.remF,a),4&t&&wt(i.mod,i.modF,a),8&t&&(n=i.source)&&((r=i.add.length+i.mod.length)===n.length||wt(n,r?Nr(i,5):i.srcF,a)),i)};var Rr=rt(Or,Sr);function qr(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}Rr.fork=function(t){var e=new Sr(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(function(t){return e.add.push(t)})),t&e.REM&&this.visit(e.REM,(function(t){return e.rem.push(t)})),t&e.MOD&&this.visit(e.MOD,(function(t){return e.mod.push(t)}))),e},Rr.changed=function(t){return this.changes&t},Rr.modified=function(t){var e=this,n=e.fields;return n&&e.changes&e.MOD?u(t)?t.some((function(t){return n[t]})):n[t]:0},Rr.filter=function(){i("MultiPulse does not support filtering.")},Rr.materialize=function(){i("MultiPulse does not support materialization.")},Rr.visit=function(t,e){var n=this,r=n.pulses,i=r.length,a=0;if(t&n.SOURCE)for(;a<i;++a)r[a].visit(t,e);else for(;a<i;++a)r[a].stamp===n.stamp&&r[a].visit(t,e);return n};var Ur={skip:!1,force:!1};function Lr(t){var e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Pr(e,0,e.length-1,t)),pop:()=>{var n,r=e.pop();return e.length?(n=e[0],e[0]=r,function(t,e,n){var r,i=e,a=t.length,u=t[e],o=1+(e<<1);for(;o<a;)(r=o+1)<a&&n(t[o],t[r])>=0&&(o=r),t[e]=t[o],o=1+((e=o)<<1);t[e]=u,Pr(t,i,e,n)}(e,0,t)):n=r,n}}}function Pr(t,e,n,r){var i,a,u;for(i=t[n];n>e&&r(i,a=t[u=n-1>>1])<0;)t[n]=a,n=u;return t[n]=i}function $r(){this.logger(_()),this.logLevel(1),this._clock=0,this._rank=0;try{this._loader=kr()}catch(t){}this._touched=At(h),this._input={},this._pulse=null,this._heap=Lr((t,e)=>t.qrank-e.qrank),this._postrun=[]}var jr=$r.prototype;function Ir(t){return function(){return this._log[t].apply(this,arguments)}}function Hr(t,e){jt.call(this,t,null,e)}jr.stamp=function(){return this._clock},jr.loader=function(t){return arguments.length?(this._loader=t,this):this._loader},jr.cleanThreshold=1e4,jr.add=function(t,e,n,r){var i,a=1;return t instanceof jt?i=t:t&&t.prototype instanceof jt?i=new t:W(t)?i=new jt(null,t):(a=0,i=new jt(t,e)),this.rank(i),a&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},jr.connect=function(t,e){var n,r,i=t.rank;for(n=0,r=e.length;n<r;++n)if(i<e[n].rank)return void this.rerank(t)},jr.rank=function(t){t.rank=++this._rank},jr.rerank=function(t){for(var e,n,r,a=[t];a.length;)if(this.rank(e=a.pop()),n=e._targets)for(r=n.length;--r>=0;)a.push(e=n[r]),e===t&&i("Cycle detected in dataflow graph.")},jr.pulse=function(t,e,n){this.touch(t,n||Ur);var r=new Sr(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},jr.touch=function(t,e){var n=e||Ur;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},jr.update=function(t,e,n){var r=n||Ur;return(t.set(e)||r.force)&&this.touch(t,r),this},jr.changeset=Rt,jr.ingest=function(t,e,n){return this.pulse(t,this.changeset().insert(Mr(e,n)))},jr.parse=Mr,jr.preload=async function(t,e,n){const r=this,i=r._pending||function(t){var e,n=new Promise((function(t){e=t}));return n.requests=0,n.done=function(){0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const a=await r.request(e,n);return r.pulse(t,r.changeset().remove(m).insert(a.data||[])),i.done(),a},jr.request=async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:ze(e&&e.type)});try{r=Mr(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},jr.events=function(t,e,n,r){for(var i,a=this,u=Vt(n,r),o=function(t){t.dataflow=a;try{u.receive(t)}catch(t){a.error(t)}finally{a.run()}},s=0,l=(i="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):I(t)).length;s<l;++s)i[s].addEventListener(e,o);return u},jr.on=function(t,e,n,r,i){return(t instanceof jt?Cr:Dr)(this,t,e,n,r,i),this},jr.evaluate=async function(t,e,n){const r=this,i=r.logLevel(),a=[];if(r._pulse)return qr(r);if(r._pending&&await r._pending,e&&await kt(r,e),!r._touched.length)return r.info("Dataflow invoked, but nothing to do."),r;let u,o,s,l,c=++r._clock,f=0;r._pulse=new Sr(r,c,t),i>=3&&(s=Date.now(),r.debug("-- START PROPAGATION ("+c+") -----")),r._touched.forEach(t=>r._enqueue(t,!0)),r._touched=At(h);try{for(;r._heap.size()>0;)u=r._heap.pop(),u.rank===u.qrank?(o=u.run(r._getPulse(u,t)),o.then?o=await o:o.async&&(a.push(o.async),o=Fr),i>=4&&r.debug(u.id,o===Fr?"STOP":o,u),o!==Fr&&u._targets&&u._targets.forEach(t=>r._enqueue(t)),++f):r._enqueue(u,!0)}catch(t){r._heap.clear(),l=t}if(r._input={},r._pulse=null,i>=3&&(s=Date.now()-s,r.info("> Pulse "+c+": "+f+" operators; "+s+"ms")),l&&(r._postrun=[],r.error(l)),r._postrun.length){const t=r._postrun.sort((t,e)=>e.priority-t.priority);r._postrun=[];for(let e=0;e<t.length;++e)await kt(r,t[e].callback)}return n&&await kt(r,n),a.length&&Promise.all(a).then(t=>r.runAsync(null,()=>{t.forEach(t=>{try{t(r)}catch(t){r.error(t)}})})),r},jr.run=function(t,e,n){return this._pulse?qr(this):(this.evaluate(t,e,n),this)},jr.runAsync=async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},jr.runAfter=function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},jr._enqueue=function(t,e){var n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},jr._getPulse=function(t,e){var n=t.source,r=this._clock;return n&&u(n)?new Or(this,r,n.map(t=>t.pulse),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Fr&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)},jr.logger=function(t){return arguments.length?(this._log=t,this):this._log},jr.error=Ir("error"),jr.warn=Ir("warn"),jr.info=Ir("info"),jr.debug=Ir("debug"),jr.logLevel=Ir("level");var Wr=rt(Hr,jt);Wr.run=function(t){return t.stamp<this.stamp?t.StopPropagation:(this.skip()?this.skip(!1):e=this.evaluate(t),(e=e||t).then?e=e.then(t=>this.pulse=t):e!==t.StopPropagation&&(this.pulse=e),e);var e},Wr.evaluate=function(t){var e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},Wr.transform=function(){};var Yr={};function Vr(t){var e=Gr(t);return e&&e.Definition||null}function Gr(t){return t=t&&t.toLowerCase(),K(Yr,t)?Yr[t]:null}function Xr(t){return t&&t.length?1===t.length?t[0]:(e=t,function(t){for(var n=e.length,r=1,i=String(e[0](t));r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function Jr(t,e,n){return n||t+(e?"_"+e:"")}var Zr={values:ti({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:ti({name:"count",set:"cell.num"}),__count__:ti({name:"count",set:"this.missing + this.valid"}),missing:ti({name:"missing",set:"this.missing"}),valid:ti({name:"valid",set:"this.valid"}),sum:ti({name:"sum",init:"this.sum = 0;",add:"this.sum += +v;",rem:"this.sum -= v;",set:"this.sum"}),product:ti({name:"product",init:"this.product = 1;",add:"this.product *= v;",rem:"this.product /= v;",set:"this.valid ? this.product : undefined"}),mean:ti({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.valid ? this.mean : undefined"}),average:ti({name:"average",set:"this.valid ? this.mean : undefined",req:["mean"],idx:1}),variance:ti({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : undefined",req:["mean"],idx:1}),variancep:ti({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : undefined",req:["variance"],idx:2}),stdev:ti({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : undefined",req:["variance"],idx:2}),stdevp:ti({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : undefined",req:["variance"],idx:2}),stderr:ti({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : undefined",req:["variance"],idx:2}),distinct:ti({name:"distinct",set:"cell.data.distinct(this.get)",req:["values"],idx:3}),ci0:ti({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:ti({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:ti({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:ti({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:ti({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:ti({name:"argmin",init:"this.argmin = undefined;",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = undefined;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:ti({name:"argmax",init:"this.argmax = undefined;",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = undefined;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:ti({name:"min",init:"this.min = undefined;",add:"if (v < this.min || this.min === undefined) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (Number.isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:ti({name:"max",init:"this.max = undefined;",add:"if (v > this.max || this.max === undefined) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (Number.isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4})},Qr=Object.keys(Zr);function Kr(t,e){return Zr[t](e)}function ti(t){return function(e){var n=X({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function ei(t,e){return t.idx-e.idx}function ni(t,e){var n=e||d,r=function(t,e){var n,r=t.reduce((function t(n,r){function i(e){n[e]||t(n,n[e]=Zr[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),n}),t.reduce((function(t,e){return t[e.name]=e,t}),{})),i=[];for(n in r)i.push(r[n]);return i.sort(ei)}(t,!0),i="var cell = this.cell; this.valid = 0; this.missing = 0;",a="this.cell = cell; this.init();",u="if(v==null){++this.missing; return;} if(v!==v) return; ++this.valid;",o="if(v==null){--this.missing; return;} if(v!==v) return; --this.valid;",s="var cell = this.cell;";return r.forEach((function(t){i+=t.init,u+=t.add,o+=t.rem})),t.slice().sort(ei).forEach((function(t){s+="t["+l(t.out)+"]="+t.set+";"})),s+="return t;",(a=Function("cell",a)).prototype.init=Function(i),a.prototype.add=Function("v","t",u),a.prototype.rem=Function("v","t",o),a.prototype.set=Function("t",s),a.prototype.get=n,a.fields=t.map((function(t){return t.out})),a}function*ri(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}function ii(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ai(t){var e;return 1===t.length&&(e=t,t=function(t,n){return ii(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}var ui=ai(ii),oi=ui.right,si=ui.left;function li(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var ci=Math.sqrt(50),fi=Math.sqrt(10),hi=Math.sqrt(2);function di(t,e,n){var r,i,a,u,o=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(u=pi(t,e,n))||!isFinite(u))return[];if(u>0)for(t=Math.ceil(t/u),e=Math.floor(e/u),a=new Array(i=Math.ceil(e-t+1));++o<i;)a[o]=(t+o)*u;else for(t=Math.floor(t*u),e=Math.ceil(e*u),a=new Array(i=Math.ceil(t-e+1));++o<i;)a[o]=(t-o)/u;return r&&a.reverse(),a}function pi(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=ci?10:a>=fi?5:a>=hi?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=ci?10:a>=fi?5:a>=hi?2:1)}function gi(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=ci?i*=10:a>=fi?i*=5:a>=hi&&(i*=2),e<t?-i:i}function mi(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function vi(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function yi(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function _i(t){return null===t?NaN:+t}function xi(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return vi(t);if(e>=1)return mi(t);var r,i=(r-1)*e,a=Math.floor(i),u=mi(function t(e,n,r=0,i=e.length-1,a=ii){for(;i>r;){if(i-r>600){const u=i-r+1,o=n-r+1,s=Math.log(u),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(u-l)/u)*(o-u/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-o*l/u+c)),Math.min(i,Math.floor(n+(u-o)*l/u+c)),a)}const u=e[n];let o=r,s=i;for(yi(e,r,n),a(e[i],u)>0&&yi(e,r,i);o<s;){for(yi(e,o,s),++o,--s;a(e[o],u)<0;)++o;for(;a(e[s],u)>0;)--s}0===a(e[r],u)?yi(e,r,s):(++s,yi(e,s,i)),s<=n&&(r=s+1),n<=s&&(i=s-1)}return e}(t,a).subarray(0,a+1));return u+(vi(t.subarray(a+1))-u)*(i-a)}}function bi(t,e){return xi(t,.5,e)}function wi(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Ai(t,e,n){var r=Float64Array.from(ri(t,n));return r.sort(ii),e.map(t=>function(t,e,n=_i){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),u=+n(t[a],a,t);return u+(+n(t[a+1],a+1,t)-u)*(i-a)}}(r,t))}function ki(t,e){return Ai(t,[.25,.5,.75],e)}function Mi(t,e){var n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,a+=n*(e-i));else{let u=-1;for(let o of t)null!=(o=e(o,++u,t))&&(o=+o)>=o&&(n=o-i,i+=n/++r,a+=n*(o-i))}if(r>1)return a/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=ki(t,e),a=(i[2]-i[0])/1.34;return 1.06*(r=Math.min(r,a)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function Ei(t){var e,n,r,i,a,u,o,s,l=t.maxbins||20,c=t.base||10,f=Math.log(c),h=t.divide||[5,2],d=t.extent[0],p=t.extent[1],g=t.span||p-d||Math.abs(d)||1;if(t.step)e=t.step;else if(t.steps){for(a=g/l,u=0,o=t.steps.length;u<o&&t.steps[u]<a;++u);e=t.steps[Math.max(0,u-1)]}else{for(n=Math.ceil(Math.log(l)/f),r=t.minstep||0,e=Math.max(r,Math.pow(c,Math.round(Math.log(g)/f)-n));Math.ceil(g/e)>l;)e*=c;for(u=0,o=h.length;u<o;++u)(a=e/h[u])>=r&&g/a<=l&&(e=a)}return i=(a=Math.log(e))>=0?0:1+~~(-a/f),s=Math.pow(c,-i-1),(t.nice||void 0===t.nice)&&(d=d<(a=Math.floor(d/e+s)*e)?a-e:a,p=Math.ceil(p/e)*e),{start:d,stop:p===d?d+e:p,step:e}}function Di(e,n,r,i){if(!e.length)return[void 0,void 0];var a,u,o,s,l=Float64Array.from(ri(e,i)),c=l.length,f=n;for(o=0,s=Array(f);o<f;++o){for(a=0,u=0;u<c;++u)a+=l[~~(t.random()*c)];s[o]=a/c}return s.sort(ii),[xi(s,r/2),xi(s,1-r/2)]}function Ci(t,e,n,r){r=r||(t=>t);let i,a=0,u=1,o=t.length,s=new Float64Array(o),l=r(t[0]),c=l,f=l+e;for(;u<o;++u){if(i=r(t[u]),i>=f){for(c=(l+c)/2;a<u;++a)s[a]=c;f=i+e,l=i}c=i}for(c=(l+c)/2;a<u;++a)s[a]=c;return n?function(t,e){let n,r,i=t.length,a=0,u=1;for(;t[a]===t[u];)++u;for(;u<i;){for(n=u+1;t[u]===t[n];)++n;if(t[u]-t[u-1]<e){for(r=u+(a+n-u-u>>1);r<u;)t[r++]=t[u];for(;r>u;)t[r--]=t[a]}a=u,u=n}return t}(s,e+e/4):s}t.random=Math.random;const Fi=Math.sqrt(2*Math.PI),Si=Math.SQRT2;let Bi=NaN;function zi(e,n){e=e||0,n=null==n?1:n;let r,i,a=0,u=0;if(Bi==Bi)a=Bi,Bi=NaN;else{do{a=2*t.random()-1,u=2*t.random()-1,r=a*a+u*u}while(0===r||r>1);i=Math.sqrt(-2*Math.log(r)/r),a*=i,Bi=u*i}return e+a*n}function Ti(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Fi)}function Ni(t,e,n){let r,i=(t-(e=e||0))/(n=null==n?1:n),a=Math.abs(i);if(a>37)r=0;else{let t,e=Math.exp(-a*a/2);a<7.07106781186547?(t=.0352624965998911*a+.700383064443688,t=t*a+6.37396220353165,t=t*a+33.912866078383,t=t*a+112.079291497871,t=t*a+221.213596169931,t=t*a+220.206867912376,r=e*t,t=.0883883476483184*a+1.75566716318264,t=t*a+16.064177579207,t=t*a+86.7807322029461,t=t*a+296.564248779674,t=t*a+637.333633378831,t=t*a+793.826512519948,t=t*a+440.413735824752,r/=t):(t=a+.65,t=a+4/t,t=a+3/t,t=a+2/t,t=a+1/t,r=e/t/2.506628274631)}return i>0?1-r:r}function Oi(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*Si*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function Ri(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>zi(n,r),pdf:t=>Ti(t,n,r),cdf:t=>Ni(t,n,r),icdf:t=>Oi(t,n,r)};return i.mean(t).stdev(e)}function qi(e,n){var r=Ri(),i={},a=0;return i.data=function(t){return arguments.length?(e=t,a=t?t.length:0,i.bandwidth(n)):e},i.bandwidth=function(t){return arguments.length?(!(n=t)&&e&&(n=Mi(e)),i):n},i.sample=function(){return e[~~(t.random()*a)]+n*r.sample()},i.pdf=function(t){for(var i=0,u=0;u<a;++u)i+=r.pdf((t-e[u])/n);return i/n/a},i.cdf=function(t){for(var i=0,u=0;u<a;++u)i+=r.cdf((t-e[u])/n);return i/a},i.icdf=function(){throw Error("KDE icdf not supported.")},i.data(e)}function Ui(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+zi()*e)}function Li(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*Fi*t)}function Pi(t,e,n){return Ni(Math.log(t),e,n)}function $i(t,e,n){return Math.exp(Oi(t,e,n))}function ji(t,e){var n,r,i={mean:function(t){return arguments.length?(n=t||0,i):n},stdev:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Ui(n,r),pdf:t=>Li(t,n,r),cdf:t=>Pi(t,n,r),icdf:t=>$i(t,n,r)};return i.mean(t).stdev(e)}function Ii(e,n){var r,i={},a=0;function u(t){var e,n=[],r=0;for(e=0;e<a;++e)r+=n[e]=null==t[e]?1:+t[e];for(e=0;e<a;++e)n[e]/=r;return n}return i.weights=function(t){return arguments.length?(r=u(n=t||[]),i):n},i.distributions=function(t){return arguments.length?(t?(a=t.length,e=t):(a=0,e=[]),i.weights(n)):e},i.sample=function(){for(var n=t.random(),i=e[a-1],u=r[0],o=0;o<a-1;u+=r[++o])if(n<u){i=e[o];break}return i.sample()},i.pdf=function(t){for(var n=0,i=0;i<a;++i)n+=r[i]*e[i].pdf(t);return n},i.cdf=function(t){for(var n=0,i=0;i<a;++i)n+=r[i]*e[i].cdf(t);return n},i.icdf=function(){throw Error("Mixture icdf not supported.")},i.distributions(e).weights(n)}function Hi(e,n){return null==n&&(n=null==e?1:e,e=0),e+(n-e)*t.random()}function Wi(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Yi(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function Vi(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function Gi(t,e){var n,r,i={min:function(t){return arguments.length?(n=t||0,i):n},max:function(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Hi(n,r),pdf:t=>Wi(t,n,r),cdf:t=>Yi(t,n,r),icdf:t=>Vi(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function Xi(t,e,n,r){const i=r-t*t,a=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-a*t,a]}function Ji(t,e,n,r){t=t.filter(t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i}),r&&t.sort((t,n)=>e(t)-e(n));const i=t.length,a=new Float64Array(i),u=new Float64Array(i);let o,s,l,c=0,f=0,h=0;for(l of t)a[c]=o=+e(l),u[c]=s=+n(l),++c,f+=(o-f)/c,h+=(s-h)/c;for(c=0;c<i;++c)a[c]-=f,u[c]-=h;return[a,u,f,h]}function Zi(t,e,n,r){let i,a,u=-1;for(let o of t)i=e(o),a=n(o),null!=i&&(i=+i)>=i&&null!=a&&(a=+a)>=a&&r(i,a,++u)}function Qi(t,e,n,r,i){let a=0,u=0;return Zi(t,e,n,(t,e)=>{const n=e-i(t),o=e-r;a+=n*n,u+=o*o}),1-a/u}function Ki(t,e,n){let r=0,i=0,a=0,u=0,o=0;Zi(t,e,n,(t,e)=>{++o,r+=(t-r)/o,i+=(e-i)/o,a+=(t*e-a)/o,u+=(t*t-u)/o});const s=Xi(r,i,a,u),l=t=>s[0]+s[1]*t;return{coef:s,predict:l,rSquared:Qi(t,e,n,i,l)}}function ta(t,e,n){let r=0,i=0,a=0,u=0,o=0;Zi(t,e,n,(t,e)=>{++o,t=Math.log(t),r+=(t-r)/o,i+=(e-i)/o,a+=(t*e-a)/o,u+=(t*t-u)/o});const s=Xi(r,i,a,u),l=t=>s[0]+s[1]*Math.log(t);return{coef:s,predict:l,rSquared:Qi(t,e,n,i,l)}}function ea(t,e,n){const[r,i,a,u]=Ji(t,e,n);let o,s,l,c=0,f=0,h=0,d=0,p=0;Zi(t,e,n,(t,e)=>{o=r[p++],s=Math.log(e),l=o*e,c+=(e*s-c)/p,f+=(l-f)/p,h+=(l*s-h)/p,d+=(o*l-d)/p});const[g,m]=Xi(f/u,c/u,h/u,d/u),v=t=>Math.exp(g+m*(t-a));return{coef:[Math.exp(g-m*a),m],predict:v,rSquared:Qi(t,e,n,u,v)}}function na(t,e,n){let r=0,i=0,a=0,u=0,o=0,s=0;Zi(t,e,n,(t,e)=>{const n=Math.log(t),l=Math.log(e);++s,r+=(n-r)/s,i+=(l-i)/s,a+=(n*l-a)/s,u+=(n*n-u)/s,o+=(e-o)/s});const l=Xi(r,i,a,u),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Qi(t,e,n,o,c)}}function ra(t,e,n){const[r,i,a,u]=Ji(t,e,n),o=r.length;let s,l,c,f,h=0,d=0,p=0,g=0,m=0;for(s=0;s<o;)l=r[s],c=i[s++],f=l*l,h+=(f-h)/s,d+=(f*l-d)/s,p+=(f*f-p)/s,g+=(l*c-g)/s,m+=(f*c-m)/s;const v=p-h*h,y=h*v-d*d,_=(m*h-g*d)/y,x=(g*v-m*d)/y,b=-_*h,w=t=>_*(t-=a)*t+x*t+b+u;return{coef:[b-x*a+_*a*a+u,x-2*_*a,_],predict:w,rSquared:Qi(t,e,n,u,w)}}function ia(t,e,n,r){if(1===r)return Ki(t,e,n);if(2===r)return ra(t,e,n);const[i,a,u,o]=Ji(t,e,n),s=i.length,l=[],c=[],f=r+1;let h,d,p,g,m;for(h=0;h<f;++h){for(p=0,g=0;p<s;++p)g+=Math.pow(i[p],h)*a[p];for(l.push(g),m=new Float64Array(f),d=0;d<f;++d){for(p=0,g=0;p<s;++p)g+=Math.pow(i[p],h+d);m[d]=g}c.push(m)}c.push(l);const v=function(t){const e=t.length-1,n=[];let r,i,a,u,o;for(r=0;r<e;++r){for(u=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][u])&&(u=i);for(a=r;a<e+1;++a)o=t[a][r],t[a][r]=t[a][u],t[a][u]=o;for(i=r+1;i<e;++i)for(a=e;a>=r;a--)t[a][i]-=t[a][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(o=0,a=i+1;a<e;++a)o+=t[a][i]*n[a];n[i]=(t[e][i]-o)/t[i][i]}return n}(c),y=t=>{t-=u;let e=o+v[0]+v[1]*t+v[2]*t*t;for(h=3;h<f;++h)e+=v[h]*Math.pow(t,h);return e};return{coef:aa(f,v,-u,o),predict:y,rSquared:Qi(t,e,n,o,y)}}function aa(t,e,n,r){const i=Array(t);let a,u,o,s;for(a=0;a<t;++a)i[a]=0;for(a=t-1;a>=0;--a)for(o=e[a],s=1,i[a]+=o,u=1;u<=a;++u)s*=(a+1-u)/u,i[a-u]+=o*Math.pow(n,u)*s;return i[0]+=r,i}function ua(t,e,n,r){const[i,a,u,o]=Ji(t,e,n,!0),s=i.length,l=Math.max(2,~~(r*s)),c=new Float64Array(s),f=new Float64Array(s),h=new Float64Array(s).fill(1);for(let t=-1;++t<=2;){const e=[0,l-1];for(let t=0;t<s;++t){const n=i[t],r=e[0],u=e[1],o=n-i[r]>i[u]-n?r:u;let s=0,l=0,d=0,p=0,g=0,m=1/Math.abs(i[o]-n||1);for(let t=r;t<=u;++t){const e=i[t],r=a[t],u=oa(Math.abs(n-e)*m)*h[t],o=e*u;s+=u,l+=o,d+=r*u,p+=r*o,g+=e*o}const[v,y]=Xi(l/s,d/s,p/s,g/s);c[t]=v+y*n,f[t]=Math.abs(a[t]-c[t]),sa(i,t+1,e)}if(2===t)break;const n=bi(f);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r<s;++r)t=f[r]/(6*n),h[r]=t>=1?1e-12:(e=1-t*t)*e}return function(t,e,n,r){const i=t.length,a=[];let u,o=0,s=0,l=[];for(;o<i;++o)u=t[o]+n,l[0]===u?l[1]+=(e[o]-l[1])/++s:(s=0,l[1]+=r,l=[u,e[o]],a.push(l));return l[1]+=r,a}(i,c,u,o)}function oa(t){return(t=1-t*t*t)*t*t}function sa(t,e,n){let r=t[e],i=n[0],a=n[1]+1;if(!(a>=t.length))for(;e>i&&t[a]-r<=r-t[i];)n[0]=++i,n[1]=a,++a}const la=.1*Math.PI/180;function ca(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],a=e[0],u=e[1],o=u-a,s=o/r,l=[i(a)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(a+t/n*o));return l.push(i(u)),l}c.push(i(u));for(let t=n;--t>0;)c.push(i(a+t/n*o));let f=l[0],h=c[c.length-1];for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=s&&fa(f,t,h)>la?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}function fa(t,e,n){const r=Math.atan2(n[1]-t[1],n[0]-t[0]),i=Math.atan2(e[1]-t[1],e[0]-t[0]);return Math.abs(r-i)}function ha(t){this._key=t?c(t):Ct,this.reset()}var da=ha.prototype;function pa(t){Hr.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}da.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},da.add=function(t){this._add.push(t)},da.rem=function(t){this._rem.push(t)},da.values=function(){if(this._get=null,0===this._rem.length)return this._add;var t,e,n,r=this._add,i=this._rem,a=this._key,u=r.length,o=i.length,s=Array(u-o),l={};for(t=0;t<o;++t)l[a(i[t])]=1;for(t=0,e=0;t<u;++t)l[a(n=r[t])]?l[a(n)]=0:s[e++]=n;return this._rem=[],this._add=s},da.distinct=function(t){for(var e,n=this.values(),r=n.length,i={},a=0;--r>=0;)K(i,e=t(n[r])+"")||(i[e]=1,++a);return a},da.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=Z(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},da.argmin=function(t){return this.extent(t)[0]||{}},da.argmax=function(t){return this.extent(t)[1]||{}},da.min=function(t){var e=this.extent(t)[0];return null!=e?t(e):void 0},da.max=function(t){var e=this.extent(t)[1];return null!=e?t(e):void 0},da.quartile=function(t){return this._get===t&&this._q||(this._q=ki(this.values(),t),this._get=t),this._q},da.q1=function(t){return this.quartile(t)[0]},da.q2=function(t){return this.quartile(t)[1]},da.q3=function(t){return this.quartile(t)[2]},da.ci=function(t){return this._get===t&&this._ci||(this._ci=Di(this.values(),1e3,.05,t),this._get=t),this._ci},da.ci0=function(t){return this.ci(t)[0]},da.ci1=function(t){return this.ci(t)[1]},pa.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Qr},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};var ga=rt(pa,Hr);ga.transform=function(t,e){var n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,t=>n.add(t))):(n.value=n.value||n.init(t),e.visit(e.REM,t=>n.rem(t)),e.visit(e.ADD,t=>n.add(t))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),n.changes(r)},ga.cross=function(){var t=this,e=t.value,n=t._dnames,r=n.map((function(){return{}})),i=n.length;function a(t){var e,a,u,o;for(e in t)for(u=t[e].tuple,a=0;a<i;++a)r[a][o=u[n[a]]]=o}a(t._prev),a(e),function a(u,o,s){var l,c,f=n[s],h=r[s++];for(l in h)o[f]=h[l],c=u?u+"|"+l:l,s<i?a(c,o,s):e[c]||t.cell(c,o)}("",{},0)},ga.init=function(t){var e=this._inputs=[],a=this._outputs=[],u={};function o(t){for(var n,i=I(r(t)),a=0,o=i.length;a<o;++a)u[n=i[a]]||(u[n]=1,e.push(n))}this._dims=I(t.groupby),this._dnames=this._dims.map((function(t){var e=n(t);return o(t),a.push(e),e})),this.cellkey=t.key?t.key:Xr(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var s,l,c,f,h,d,p=t.fields||[null],g=t.ops||["count"],m=t.as||[],v=p.length,y={};for(v!==g.length&&i("Unmatched number of fields and aggregate ops."),d=0;d<v;++d)s=p[d],l=g[d],null==s&&"count"!==l&&i("Null aggregate field specified."),h=Jr(l,f=n(s),m[d]),a.push(h),"count"!==l?((c=y[f])||(o(s),(c=y[f]=[]).field=s,this._measures.push(c)),"count"!==l&&(this._countOnly=!1),c.push(Kr(l,h))):this._counts.push(h);return this._measures=this._measures.map((function(t){return ni(t,t.field)})),{}},ga.cellkey=Xr(),ga.cell=function(t,e){var n=this.value[t];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},ga.newcell=function(t,e){var n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){var r,i=this._measures,a=i.length;for(n.agg=Array(a),r=0;r<a;++r)n.agg[r]=new i[r](n)}return n.store&&(n.data=new ha),n},ga.newtuple=function(t,e){var n,r,i=this._dnames,a=this._dims,u={};for(n=0,r=a.length;n<r;++n)u[i[n]]=a[n](t);return e?Tt(e.tuple,u):St(u)},ga.add=function(t){var e,n,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num+=1,!this._countOnly)for(a.store&&a.data.add(t),n=0,r=(e=a.agg).length;n<r;++n)e[n].add(e[n].get(t),t)},ga.rem=function(t){var e,n,r,i=this.cellkey(t),a=this.cell(i,t);if(a.num-=1,!this._countOnly)for(a.store&&a.data.rem(t),n=0,r=(e=a.agg).length;n<r;++n)e[n].rem(e[n].get(t),t)},ga.celltuple=function(t){var e,n,r,i=t.tuple,a=this._counts;for(t.store&&t.data.values(),n=0,r=a.length;n<r;++n)i[a[n]]=t.num;if(!this._countOnly)for(n=0,r=(e=t.agg).length;n<r;++n)e[n].set(i);return i},ga.changes=function(t){var e,n,r,i,a=this._adds,u=this._mods,o=this._prev,s=this._drop,l=t.add,c=t.rem,f=t.mod;if(o)for(n in o)e=o[n],s&&!e.num||c.push(e.tuple);for(r=0,i=this._alen;r<i;++r)l.push(this.celltuple(a[r])),a[r]=null;for(r=0,i=this._mlen;r<i;++r)(0===(e=u[r]).num&&s?c:f).push(this.celltuple(e)),u[r]=null;return this._alen=this._mlen=0,this._prev=null,t};function ma(t){Hr.call(this,null,t)}ma.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};var va=rt(ma,Hr);function ya(t,e,n){var r=t,i=e||[],a=n||[],u={},o=0;return{add:function(t){a.push(t)},remove:function(t){u[r(t)]=++o},size:function(){return i.length},data:function(t,e){return o&&(i=i.filter((function(t){return!u[r(t)]})),u={},o=0),e&&t&&i.sort(t),a.length&&(i=t?ht(t,i,a.sort(t)):i.concat(a),a=[]),i}}}function _a(t){Hr.call(this,[],t)}function xa(t){jt.call(this,null,ba,t)}function ba(t){return this.value&&!t.modified()?this.value:Y(t.fields,t.orders)}function wa(t){Hr.call(this,null,t)}va.transform=function(t,e){var n,i=!1!==t.interval,a=this._bins(t),u=a.start,o=a.step,s=t.as||["bin0","bin1"],l=s[0],c=s[1];return n=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified(r(t.field))?e.ADD_MOD:e.ADD,e.visit(n,i?function(t){var e=a(t);t[l]=e,t[c]=null==e?null:u+o*(1+(e-u)/o)}:function(t){t[l]=a(t)}),e.modifies(i?s:l)},va._bins=function(t){if(this.value&&!t.modified())return this.value;var i,a,u=t.field,o=Ei(t),s=o.step,l=o.start,c=l+Math.ceil((o.stop-l)/s)*s;null!=(i=t.anchor)&&(a=i-(l+s*Math.floor((i-l)/s)),l+=a,c+=a);var f=function(t){var e=u(t);return null==e?null:e<l?-1/0:e>c?1/0:(e=Math.max(l,Math.min(+e,c-s)),l+s*Math.floor(1e-14+(e-l)/s))};return f.start=l,f.stop=o.stop,f.step=s,this.value=e(f,r(u),t.name||"bin_"+n(u))},_a.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},rt(_a,Hr).transform=function(t,e){var n=e.fork(e.ALL),r=ya(Ct,this.value,n.materialize(n.ADD).add),i=t.sort,a=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(a),this.value=n.source=r.data(Nt(i),a),e.source&&e.source.root&&(this.value.root=e.source.root),n},rt(xa,jt),wa.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};var Aa=rt(wa,Hr);function ka(t){Hr.call(this,null,t)}Aa.transform=function(t,e){function n(e){return function(n){for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(o(n),t.case,a)||[],s=0,l=i.length;s<l;++s)u.test(r=i[s])||e(r)}}var r=this._parameterCheck(t,e),i=this._counts,a=this._match,u=this._stop,o=t.field,s=t.as||["text","count"],l=n((function(t){i[t]=1+(i[t]||0)})),c=n((function(t){i[t]-=1}));return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,s)},Aa._parameterCheck=function(t,e){var n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},Aa._finish=function(t,e){var n,r,i,a=this._counts,u=this._tuples||(this._tuples={}),o=e[0],s=e[1],l=t.fork(t.NO_SOURCE|t.NO_FIELDS);for(n in a)r=u[n],i=a[n]||0,!r&&i?(u[n]=r=St({}),r[o]=n,r[s]=i,l.add.push(r)):0===i?(r&&l.rem.push(r),a[n]=null,u[n]=null):r[s]!==i&&(r[s]=i,l.mod.push(r));return l.modifies(e)},ka.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},rt(ka,Hr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=this.value,i=t.as||["a","b"],a=i[0],u=i[1];return!r||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter")?(r&&(n.rem=r),r=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,a,u=[],o={},s=t.length,l=0;l<s;++l)for(o[e]=a=t[l],i=0;i<s;++i)o[n]=t[i],r(o)&&(u.push(St(o)),(o={})[e]=a);return u}(r,a,u,t.filter||m)):n.mod=r,n.source=this.value,n.modifies(i)};var Ma={kde:qi,mixture:Ii,normal:Ri,lognormal:ji,uniform:Gi};function Ea(t){Hr.call(this,null,t)}var Da=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Ca={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Da},{name:"weights",type:"number",array:!0}]};function Fa(t,e){return t?t.map((function(t,r){return e[r]||n(t)})):null}function Sa(t,e,n){var r,i,a,u,o,s,l=[],c=function(t){return t(u)};if(null==e)l.push(t.map(n));else for(r={},i=0,a=t.length;i<a;++i)u=t[i],(s=r[o=e.map(c)])||(r[o]=s=[],s.dims=o,l.push(s)),s.push(n(u));return l}Ea.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Da.concat(Ca)},{name:"as",type:"string",array:!0,default:["value","density"]}]},rt(Ea,Hr).transform=function(t,e){var n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){var r=function t(e,n){var r=e.function;K(Ma,r)||i("Unknown distribution function: "+r);var a=Ma[r]();for(var u in e)"field"===u?a.data((e.from||n()).map(e[u])):"distributions"===u?a[u](e[u].map((function(e){return t(e,n)}))):"function"==typeof a[u]&&a[u](e[u]);return a}(t.distribution,function(t){return function(){return t.materialize(t.SOURCE).source}}(e)),a=t.steps||t.minsteps||25,u=t.steps||t.maxsteps||200,o=t.method||"pdf";"pdf"!==o&&"cdf"!==o&&i("Invalid density method: "+o),t.extent||r.data||i("Missing density extent parameter."),o=r[o];var s=t.as||["value","density"],l=ca(o,t.extent||J(r.data()),a,u).map(t=>{var e={};return e[s[0]]=t[0],e[s[1]]=t[1],St(e)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n};function Ba(t){Hr.call(this,null,t)}function za(t){jt.call(this,null,Ta,t),this.modified(!0)}function Ta(t){var i=t.expr;return this.value&&!t.modified("expr")?this.value:e(e=>i(e,t),r(i),n(i))}function Na(t){Hr.call(this,[void 0,void 0],t)}function Oa(t,e){jt.call(this,t),this.parent=e}Ba.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},rt(Ba,Hr).transform=function(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=Sa(e.source,t.groupby,d),i=t.smooth||!1,a=t.field,u=t.step||function(t,e){return gt(J(t,e))/30}(n,a),o=Nt((t,e)=>a(t)-a(e)),s=t.as||"bin",l=r.length;let c,f=1/0,h=-1/0,p=0;for(;p<l;++p){const t=r[p].sort(o);c=-1;for(const e of Ci(t,u,i,a))e<f&&(f=e),e>h&&(h=e),t[++c][s]=e}return this.value={start:f,stop:h,step:u},e.reflow(!0).modifies(s)},rt(za,jt),Na.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},rt(Na,Hr).transform=function(t,e){var r,i=this.value,a=t.field,u=i[0],o=i[1];if(((r=e.changed()||e.modified(a.fields)||t.modified("field"))||null==u)&&(u=1/0,o=-1/0),e.visit(r?e.SOURCE:e.ADD,(function(t){var e=a(t);null!=e&&((e=+e)<u&&(u=e),e>o&&(o=e))})),!Number.isFinite(u)||!Number.isFinite(o)){let t=n(a);t&&(t=` for field "${t}"`),e.dataflow.warn(`Infinite extent${t}: [${u}, ${o}]`),u=o=void 0}this.value=[u,o]};var Ra=rt(Oa,jt);function qa(t){Hr.call(this,{},t),this._keys=et();var e=this._targets=[];e.active=0,e.forEach=function(t){for(var n=0,r=e.active;n<r;++n)t(e[n],n,e)}}Ra.connect=function(t){return this.targets().add(t),t.source=this},Ra.add=function(t){this.value.add.push(t)},Ra.rem=function(t){this.value.rem.push(t)},Ra.mod=function(t){this.value.mod.push(t)},Ra.init=function(t){this.value.init(t,t.NO_SOURCE)},Ra.evaluate=function(){return this.value};var Ua=rt(qa,Hr);function La(t){jt.call(this,null,Pa,t)}function Pa(t){return this.value&&!t.modified()?this.value:u(t.name)?I(t.name).map((function(t){return c(t)})):c(t.name,t.as)}function $a(t){Hr.call(this,et(),t)}function ja(t){Hr.call(this,[],t)}function Ia(t){Hr.call(this,[],t)}function Ha(t){Hr.call(this,null,t)}function Wa(t){Hr.call(this,[],t)}Ua.activate=function(t){this._targets[this._targets.active++]=t},Ua.subflow=function(t,e,n,r){var i,a,u=this.value,o=K(u,t)&&u[t];return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=r||(a=this._group[t])&&a.tuple,o=(i=n.dataflow).add(new Oa(n.fork(n.NO_SOURCE),this)).connect(e(i,t,a)),u[t]=o,this.activate(o)),o},Ua.transform=function(t,e){var n=e.dataflow,r=this,i=t.key,a=t.subflow,u=this._keys,o=t.modified("key");function s(t){return r.subflow(t,a,e)}return this._group=t.group||{},this._targets.active=0,e.visit(e.REM,(function(t){var e=Ct(t),n=u.get(e);void 0!==n&&(u.delete(e),s(n).rem(t))})),e.visit(e.ADD,(function(t){var e=i(t);u.set(Ct(t),e),s(e).add(t)})),o||e.modified(i.fields)?e.visit(e.MOD,(function(t){var e=Ct(t),n=u.get(e),r=i(t);n===r?s(r).mod(t):(u.set(e,r),s(n).rem(t),s(r).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(function(t){s(u.get(Ct(t))).mod(t)})),o&&e.visit(e.REFLOW,(function(t){var e=Ct(t),n=u.get(e),r=i(t);n!==r&&(u.set(e,r),s(n).rem(t),s(r).add(t))})),u.empty>n.cleanThreshold&&n.runAfter(u.clean),e},rt(La,jt),$a.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},rt($a,Hr).transform=function(t,e){var n=e.dataflow,r=this.value,i=e.fork(),a=i.add,u=i.rem,o=i.mod,s=t.expr,l=!0;function c(e){var n=Ct(e),i=s(e,t),c=r.get(n);i&&c?(r.delete(n),a.push(e)):i||c?l&&i&&!c&&o.push(e):(r.set(n,1),u.push(e))}return e.visit(e.REM,(function(t){var e=Ct(t);r.has(e)?r.delete(e):u.push(t)})),e.visit(e.ADD,(function(e){s(e,t)?a.push(e):r.set(Ct(e),1)})),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i},ja.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},rt(ja,Hr).transform=function(t,e){var n=e.fork(e.NO_SOURCE),r=t.fields,i=Fa(r,t.as||[]),a=t.index||null,u=i.length;return n.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,o,s,l=r.map(e=>e(t)),c=l.reduce((t,e)=>Math.max(t,e.length),0),f=0;f<c;++f){for(o=Bt(t),e=0;e<u;++e)o[i[e]]=null==(s=l[e][f])?null:s;a&&(o[a]=f),n.add.push(o)}})),this.value=n.source=n.add,a&&n.modifies(a),n.modifies(i)},Ia.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},rt(Ia,Hr).transform=function(t,e){var r=e.fork(e.NO_SOURCE),i=t.fields,a=i.map(n),u=t.as||["key","value"],o=u[0],s=u[1],l=i.length;return r.rem=this.value,e.visit(e.SOURCE,(function(t){for(var e,n=0;n<l;++n)(e=Bt(t))[o]=a[n],e[s]=i[n](t),r.add.push(e)})),this.value=r.source=r.add,r.modifies(u)},Ha.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},rt(Ha,Hr).transform=function(t,e){var n=t.expr,r=t.as,i=t.modified(),a=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(a,e=>e[r]=n(e,t))},rt(Wa,Hr).transform=function(t,e){var n,r,i,a=this.value,u=e.fork(e.ALL),o=t.size-a.length,s=t.generator;if(o>0){for(n=[];--o>=0;)n.push(i=St(s(t))),a.push(i);u.add=u.add.length?u.materialize(u.ADD).add.concat(n):n}else r=a.slice(0,-o),u.rem=u.rem.length?u.materialize(u.REM).rem.concat(r):r,a=a.slice(-o);return u.source=this.value=a,u};var Ya={value:"value",median:bi,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n},min:vi,max:mi},Va=[];function Ga(t){Hr.call(this,[],t)}function Xa(t){pa.call(this,t)}Ga.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},rt(Ga,Hr).transform=function(t,e){var r,a,u,o,s,l,c,f,h,d,p=e.fork(e.ALL),g=function(t){var e,n=t.method||Ya.value;if(null!=Ya[n])return n===Ya.value?(e=void 0!==t.value?t.value:0,function(){return e}):Ya[n];i("Unrecognized imputation method: "+n)}(t),m=function(t){var e=t.field;return function(t){return t?e(t):NaN}}(t),v=n(t.field),y=n(t.key),_=(t.groupby||[]).map(n),x=function(t,e,n,r){var i,a,u,o,s,l,c,f,h=function(t){return t(f)},d=[],p=r?r.slice():[],g={},m={};for(p.forEach((function(t,e){g[t]=e+1})),o=0,c=t.length;o<c;++o)f=t[o],l=n(f),s=g[l]||(g[l]=p.push(l)),a=(i=e?e.map(h):Va)+"",(u=m[a])||(u=m[a]=[],d.push(u),u.values=i),u[s-1]=f;return d.domain=p,d}(e.source,t.groupby,t.key,t.keyvals),b=[],w=this.value,A=x.domain.length;for(s=0,f=x.length;s<f;++s)for(u=(r=x[s]).values,a=NaN,c=0;c<A;++c)if(null==r[c]){for(o=x.domain[c],d={_impute:!0},l=0,h=u.length;l<h;++l)d[_[l]]=u[l];d[y]=o,d[v]=Number.isNaN(a)?a=g(r,m):a,b.push(St(d))}return b.length&&(p.add=p.materialize(p.ADD).add.concat(b)),w.length&&(p.rem=p.materialize(p.REM).rem.concat(w)),this.value=b,p},Xa.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Qr},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var Ja=rt(Xa,pa);function Za(t){Hr.call(this,null,t)}function Qa(t){jt.call(this,null,Ka,t)}function Ka(t){return this.value&&!t.modified()?this.value:lt(t.fields,t.flat)}function tu(t){Hr.call(this,[],t),this._pending=null}function eu(t,e,n){n.forEach(St);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r}function nu(t){Hr.call(this,{},t)}function ru(t){jt.call(this,null,iu,t)}function iu(t){if(this.value&&!t.modified())return this.value;var e,n,r,i=1/0,a=-1/0,u=t.extents;for(e=0,n=u.length;e<n;++e)(r=u[e])[0]<i&&(i=r[0]),r[1]>a&&(a=r[1]);return[i,a]}function au(t){jt.call(this,null,uu,t)}function uu(t){return this.value&&!t.modified()?this.value:t.values.reduce((function(t,e){return t.concat(e)}),[])}function ou(t){Hr.call(this,null,t)}function su(t){pa.call(this,t)}Ja.transform=function(t,e){var n,r=this,i=t.modified();return r.value&&(i||e.modified(r._inputs,!0))?(n=r.value=i?r.init(t):{},e.visit(e.SOURCE,(function(t){r.add(t)}))):(n=r.value=r.value||this.init(t),e.visit(e.REM,(function(t){r.rem(t)})),e.visit(e.ADD,(function(t){r.add(t)}))),r.changes(),e.visit(e.SOURCE,(function(t){X(t,n[r.cellkey(t)].tuple)})),e.reflow(i).modifies(this._outputs)},Ja.changes=function(){var t,e,n=this._adds,r=this._mods;for(t=0,e=this._alen;t<e;++t)this.celltuple(n[t]),n[t]=null;for(t=0,e=this._mlen;t<e;++t)this.celltuple(r[t]),r[t]=null;this._alen=this._mlen=0},Za.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},rt(Za,Hr).transform=function(t,e){var r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const a=e.materialize(e.SOURCE).source,u=Sa(a,t.groupby,t.field),o=(t.groupby||[]).map(n),s=t.bandwidth,l=t.cumulative?"cdf":"pdf",c=t.as||["value","density"],f=[];let h=t.extent,d=t.steps||t.minsteps||25,p=t.steps||t.maxsteps||200;"pdf"!==l&&"cdf"!==l&&i("Invalid density method: "+l),"shared"===t.resolve&&(h||(h=J(a,t.field)),d=p=t.steps||p),u.forEach(e=>{const n=qi(e,s)[l],r=t.counts?e.length:1;ca(n,h||J(e),d,p).forEach(t=>{const n={};for(let t=0;t<o.length;++t)n[o[t]]=e.dims[t];n[c[0]]=t[0],n[c[1]]=t[1]*r,f.push(St(n))})}),this.value&&(r.rem=this.value),this.value=r.add=r.source=f}return r},rt(Qa,jt),rt(tu,Hr).transform=function(t,e){const n=e.dataflow;if(this._pending)return eu(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return eu(this,e,n.parse(t.values,t.format));if(t.async){return{async:n.request(t.url,t.format).then(t=>(this._pending=I(t.data),t=>t.touch(this)))}}return n.request(t.url,t.format).then(t=>eu(this,e,I(t.data)))},nu.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},rt(nu,Hr).transform=function(t,e){var r,a,u=e,o=t.as,s=t.fields,l=t.index,c=t.values,f=null==t.default?null:t.default,h=t.modified(),d=h?e.SOURCE:e.ADD,p=s.length;return c?(a=c.length,p>1&&!o&&i('Multi-field lookup requires explicit "as" parameter.'),o&&o.length!==p*a&&i('The "as" parameter has too few output field names.'),o=o||c.map(n),r=function(t){for(var e,n,r=0,i=0;r<p;++r)if(null==(n=l.get(s[r](t))))for(e=0;e<a;++e,++i)t[o[i]]=f;else for(e=0;e<a;++e,++i)t[o[i]]=c[e](n)}):(o||i("Missing output field names."),r=function(t){for(var e,n=0;n<p;++n)e=l.get(s[n](t)),t[o[n]]=null==e?f:e}),h?u=e.reflow(!0):d|=s.some((function(t){return e.modified(t.fields)}))?e.MOD:0,e.visit(d,r),u.modifies(o)},rt(ru,jt),rt(au,jt),rt(ou,Hr),ou.prototype.transform=function(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)},su.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Qr,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};var lu=rt(su,pa);function cu(t){qa.call(this,t)}function fu(t){Hr.call(this,null,t)}function hu(t){Hr.call(this,null,t)}function du(t){Hr.call(this,null,t)}lu._transform=lu.transform,lu.transform=function(t,n){return this._transform(function(t,n){var i=t.field,a=t.value,u=("count"===t.op?"__count__":t.op)||"sum",o=r(i).concat(r(a)),s=function(t,e,n){var r={},i=[];return n.visit(n.SOURCE,(function(e){var n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort((function(t,e){return(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0)})),e?i.slice(0,e):i}(i,t.limit||0,n);n.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:s.map((function(){return u})),fields:s.map((function(t){return function(t,n,r,i){return e((function(e){return n(e)===t?r(e):NaN}),i,t+"")}(t,i,a,o)})),as:s.map((function(t){return t+""})),modified:t.modified.bind(t)}}(t,n),n)},rt(cu,qa).transform=function(t,e){var n=this,a=t.subflow,u=t.field;return(t.modified("field")||u&&e.modified(r(u)))&&i("PreFacet does not support field modification."),this._targets.active=0,e.visit(e.MOD,(function(t){var r=n.subflow(Ct(t),a,e,t);u?u(t).forEach((function(t){r.mod(t)})):r.mod(t)})),e.visit(e.ADD,(function(t){var r=n.subflow(Ct(t),a,e,t);u?u(t).forEach((function(t){r.add(St(t))})):r.add(t)})),e.visit(e.REM,(function(t){var r=n.subflow(Ct(t),a,e,t);u?u(t).forEach((function(t){r.rem(t)})):r.rem(t)})),e},fu.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},rt(fu,Hr).transform=function(t,e){var n,r,i=t.fields,a=Fa(t.fields,t.as||[]),u=i?function(t,e){return function(t,e,n,r){for(var i=0,a=n.length;i<a;++i)e[r[i]]=n[i](t);return e}(t,e,i,a)}:zt;return this.value?r=this.value:(e=e.addAll(),r=this.value={}),n=e.fork(e.NO_SOURCE),e.visit(e.REM,(function(t){var e=Ct(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(function(t){var e=u(t,St({}));r[Ct(t)]=e,n.add.push(e)})),e.visit(e.MOD,(function(t){n.mod.push(u(t,r[Ct(t)]))})),n},rt(hu,Hr).transform=function(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation},du.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};var pu=rt(du,Hr);function gu(t){Hr.call(this,null,t)}function mu(t){Hr.call(this,[],t),this.count=0}function vu(t){Hr.call(this,null,t)}function yu(t){Hr.call(this,null,t),this.modified(!0)}pu.transform=function(t,e){var r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return r.source=this.value,r;const a=Sa(e.materialize(e.SOURCE).source,t.groupby,t.field),u=(t.groupby||[]).map(n),o=[],s=t.step||.01,l=t.probs||li(s/2,1-1e-14,s),c=l.length;return a.forEach(t=>{const e=Ai(t,l);for(let n=0;n<c;++n){const r={};for(let e=0;e<u.length;++e)r[u[e]]=t.dims[e];r[i[0]]=l[n],r[i[1]]=e[n],o.push(St(r))}}),this.value&&(r.rem=this.value),this.value=r.add=r.source=o,r},rt(gu,Hr).transform=function(t,e){var n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,t=>{var e=Ct(t);n.rem.push(r[e]),r[e]=null}),e.visit(e.ADD,t=>{var e=Bt(t);r[Ct(t)]=e,n.add.push(e)}),e.visit(e.MOD,t=>{var e,i=r[Ct(t)];for(e in t)i[e]=t[e],n.modifies(e);n.mod.push(i)})),n},mu.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},rt(mu,Hr).transform=function(e,n){var r=n.fork(n.NO_SOURCE),i=e.modified("size"),a=e.size,u=this.value,o=this.count,s=0,l=u.reduce((function(t,e){return t[Ct(e)]=1,t}),{});function c(e){var n,i;u.length<a?u.push(e):(i=~~((o+1)*t.random()))<u.length&&i>=s&&(n=u[i],l[Ct(n)]&&r.rem.push(n),u[i]=e),++o}if(n.rem.length&&(n.visit(n.REM,(function(t){var e=Ct(t);l[e]&&(l[e]=-1,r.rem.push(t)),--o})),u=u.filter((function(t){return-1!==l[Ct(t)]}))),(n.rem.length||i)&&u.length<a&&n.source&&(s=o=u.length,n.visit(n.SOURCE,(function(t){l[Ct(t)]||c(t)})),s=-1),i&&u.length>a){for(var f=0,h=u.length-a;f<h;++f)l[Ct(u[f])]=-1,r.rem.push(u[f]);u=u.slice(h)}return n.mod.length&&n.visit(n.MOD,(function(t){l[Ct(t)]&&r.mod.push(t)})),n.add.length&&n.visit(n.ADD,c),(n.add.length||s<0)&&(r.add=u.filter((function(t){return!l[Ct(t)]}))),this.count=o,this.value=r.source=u,r},vu.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},rt(vu,Hr).transform=function(t,e){if(!this.value||t.modified()){var n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=li(t.start,t.stop,t.step||1).map((function(t){var e={};return e[r]=t,St(e)})),n.add=e.add.concat(this.value),n}},rt(yu,Hr).transform=function(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation};const _u="year",xu="quarter",bu="month",wu="week",Au="date",ku="day",Mu="hours",Eu="minutes",Du="seconds",Cu="milliseconds",Fu=[_u,xu,bu,wu,Au,ku,Mu,Eu,Du,Cu].reduce((t,e,n)=>(t[e]=1+n,t),{});function Su(t){const e=I(t).slice(),n={};return e.length||i("Missing time unit."),e.forEach(t=>{K(Fu,t)?n[t]=1:i(`Invalid time unit: ${t}.`)}),(n[wu]||n[ku])&&(n[xu]||n[bu]||n[Au])&&i(`Incompatible time units: ${t}`),e.sort((t,e)=>Fu[t]-Fu[e]),e}const Bu=new Date;function zu(t,e,n,r,i){const a=e||1,u=k(t),o=(t,e,i)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[i=i||t],r[i],t===u&&a,e),s=new Date,l=xt(t),c=l[_u]?o(_u):V(2012),f=l[bu]?o(bu):l[xu]?o(xu):p,h=l[wu]&&l[ku]?o(ku,1,wu+ku):l[wu]?o(wu,1):l[ku]?o(ku,1):l[Au]?o(Au,1):g,d=l[Mu]?o(Mu):p,m=l[Eu]?o(Eu):p,v=l[Du]?o(Du):p,y=l[Cu]?o(Cu):p;return function(t){s.setTime(+t);const e=c(s);return i(e,f(s),h(s,e),d(s),m(s),v(s),y(s))}}function Tu(t,e,n){return e+7*t-(n+6)%7}const Nu={[_u]:t=>t.getFullYear(),[xu]:t=>Math.floor(t.getMonth()/3),[bu]:t=>t.getMonth(),[Au]:t=>t.getDate(),[Mu]:t=>t.getHours(),[Eu]:t=>t.getMinutes(),[Du]:t=>t.getSeconds(),[Cu]:t=>t.getMilliseconds(),[wu]:t=>qu(t),[wu+ku]:(t,e)=>Tu(qu(t),t.getDay(),Uu(e)),[ku]:(t,e)=>Tu(1,t.getDay(),Uu(e))},Ou={[xu]:t=>3*t,[wu]:(t,e)=>Tu(t,0,Uu(e))};function Ru(t){return Bu.setFullYear(t),Bu.setMonth(0),Bu.setDate(1),Bu.setHours(0,0,0,0),Bu}function qu(t){return je.count(Ru(t.getFullYear())-1,t)}function Uu(t){return Ru(t).getDay()}function Lu(t,e,n,r,i,a,u){if(0<=t&&t<100){var o=new Date(-1,e,n,r,i,a,u);return o.setFullYear(t),o}return new Date(t,e,n,r,i,a,u)}function Pu(t,e){return zu(t,e||1,Nu,Ou,Lu)}const $u={[_u]:t=>t.getUTCFullYear(),[xu]:t=>Math.floor(t.getUTCMonth()/3),[bu]:t=>t.getUTCMonth(),[Au]:t=>t.getUTCDate(),[Mu]:t=>t.getUTCHours(),[Eu]:t=>t.getUTCMinutes(),[Du]:t=>t.getUTCSeconds(),[Cu]:t=>t.getUTCMilliseconds(),[wu]:t=>Iu(t),[ku]:(t,e)=>Tu(1,t.getUTCDay(),Hu(e)),[wu+ku]:(t,e)=>Tu(Iu(t),t.getUTCDay(),Hu(e))},ju={[xu]:t=>3*t,[wu]:(t,e)=>Tu(t,0,Hu(e))};function Iu(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Ze.count(e-1,t)}function Hu(t){return Bu.setTime(Date.UTC(t,0,1)),Bu.getUTCDay()}function Wu(t,e,n,r,i,a,u){if(0<=t&&t<100){var o=new Date(Date.UTC(-1,e,n,r,i,a,u));return o.setUTCFullYear(n.y),o}return new Date(Date.UTC(t,e,n,r,i,a,u))}function Yu(t,e){return zu(t,e||1,$u,ju,Wu)}const Vu={[_u]:Ye,[xu]:We.every(3),[bu]:We,[wu]:je,[Au]:Pe,[ku]:Pe,[Mu]:Le,[Eu]:Ue,[Du]:qe,[Cu]:Re},Gu={[_u]:en,[xu]:tn.every(3),[bu]:tn,[wu]:Ze,[Au]:Xe,[ku]:Xe,[Mu]:Ge,[Eu]:Ve,[Du]:qe,[Cu]:Re};function Xu(t){return Vu[t]}function Ju(t){return Gu[t]}function Zu(t,e,n){return t?t.offset(e,n):void 0}function Qu(t,e,n){return Zu(Xu(t),e,n)}function Ku(t,e,n){return Zu(Ju(t),e,n)}function to(t,e,n,r){return t?t.range(e,n,r):void 0}function eo(t,e,n,r){return to(Xu(t),e,n,r)}function no(t,e,n,r){return to(Ju(t),e,n,r)}const ro={[_u]:"%Y ",[xu]:"Q%q ",[bu]:"%b ",[Au]:"%d ",[wu]:"W%U ",[ku]:"%a ",[Mu]:"%H:00",[Eu]:"00:%M",[Du]:":%S",[Cu]:".%L",[`${_u}-${bu}`]:"%Y-%m ",[`${_u}-${bu}-${Au}`]:"%Y-%m-%d ",[`${Mu}-${Eu}`]:"%H:%M"};function io(t,e){const n=X({},ro,e),r=Su(t),i=r.length;let a,u,o="",s=0;for(s=0;s<i;)for(a=r.length;a>s;--a)if(u=r.slice(s,a).join("-"),null!=n[u]){o+=n[u],s=a;break}return o.trim()}function ao(t){return oo(on,Xu,t)}function uo(t){return oo(ln,Ju,t)}function oo(t,e,n){return s(n)?t(n):function(t,e,n){o(n=n||{})||i(`Invalid time multi-format specifier: ${n}`);const r=e(Du),a=e(Eu),u=e(Mu),s=e(Au),l=e(wu),c=e(bu),f=e(xu),h=e(_u),d=t(n[Cu]||".%L"),p=t(n[Du]||":%S"),g=t(n[Eu]||"%I:%M"),m=t(n[Mu]||"%I %p"),v=t(n[Au]||n[ku]||"%a %d"),y=t(n[wu]||"%b %d"),_=t(n[bu]||"%B"),x=t(n[xu]||"%B"),b=t(n[_u]||"%Y");return function(t){return(r(t)<t?d:a(t)<t?p:u(t)<t?g:s(t)<t?m:c(t)<t?l(t)<t?v:y:h(t)<t?f(t)<t?_:x:b)(t)}}(t,e,n)}const so=[_u,bu,Au,Mu,Eu,Du,Cu],lo=so.slice(0,-1),co=lo.slice(0,-1),fo=co.slice(0,-1),ho=fo.slice(0,-1),po=[_u,bu],go=[_u],mo=[[lo,1,1e3],[lo,5,5e3],[lo,15,15e3],[lo,30,3e4],[co,1,6e4],[co,5,3e5],[co,15,9e5],[co,30,18e5],[fo,1,36e5],[fo,3,108e5],[fo,6,216e5],[fo,12,432e5],[ho,1,864e5],[[_u,wu],1,6048e5],[po,1,2592e6],[po,3,7776e6],[go,1,31536e6]];function vo(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(gt(e))/n;let i,a,u=ai(t=>t[2]).right(mo,r);return u===mo.length?(i=go,a=gi(e[0]/31536e6,e[1]/31536e6,n)):u?(u=mo[r/mo[u-1][2]<mo[u][2]/r?u-1:u],i=u[0],a=u[1]):(i=so,a=Math.max(gi(e[0],e[1],n),1)),{units:i,step:a}}function yo(t){Hr.call(this,null,t)}const _o=["unit0","unit1"];yo.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"string",array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:_o}]};var xo=rt(yo,Hr);function bo(t){Hr.call(this,et(),t)}function wo(t){Hr.call(this,null,t)}xo.transform=function(t,e){var n=t.field,i=!1!==t.interval,a="utc"===t.timezone,u=this._floor(t,e),o=(a?Ju:Xu)(u.unit).offset,s=t.as||_o,l=s[0],c=s[1],f=u.start||1/0,h=u.stop||-1/0,d=u.step,p=e.ADD;return(t.modified()||e.modified(r(n)))&&(p=(e=e.reflow(!0)).SOURCE,f=1/0,h=-1/0),e.visit(p,(function(t){var e,r,a=n(t);null==a?(t[l]=null,i&&(t[c]=null)):(t[l]=e=r=u(a),i&&(t[c]=r=o(e,d)),e<f&&(f=e),r>h&&(h=r))})),u.start=f,u.stop=h,e.modifies(i?s:l)},xo._floor=function(t,e){const n="utc"===t.timezone;let{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:vo({extent:t.extent||J(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins});r=Su(r);const a=this.value||{},u=(n?Yu:Pu)(r,i);return u.unit=k(r),u.units=r,u.step=i,u.start=a.start,u.stop=a.stop,this.value=u},rt(bo,Hr).transform=function(t,e){var n=e.dataflow,r=t.field,i=this.value,a=!0;function u(t){i.set(r(t),t)}return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,u)):e.changed()?(e.visit(e.REM,(function(t){i.delete(r(t))})),e.visit(e.ADD,u)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()},rt(wo,Hr).transform=function(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(Nt(t.sort)):e.source).map(t.field))};const Ao={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{let n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{let n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){let t=Ao.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{let n=e.index,r=e.data,i=e.compare;if(t<n){for(;n+1<r.length&&!i(r[n],r[n+1]);)++n;t=n}return(1+t)/r.length}}},ntile:function(t,e){(e=+e)>0||i("ntile num must be greater than zero.");let n=Ao.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{let r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{let r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||i("nth_value nth must be greater than zero."),{next:n=>{let r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e=null;return{next:n=>{let r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e=null,n=-1;return{next:r=>{let i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};var ko=Object.keys(Ao);function Mo(t){let e=this,a=I(t.ops),u=I(t.fields),o=I(t.params),s=I(t.as),l=e.outputs=[],c=e.windows=[],f={},h={},d=!0,g=[],m=[];function v(t){I(r(t)).forEach(t=>f[t]=1)}v(t.sort),a.forEach((function(t,e){let r=u[e],a=n(r),f=Jr(t,a,s[e]);if(v(r),l.push(f),K(Ao,t))c.push(function(t,e,n,r){let i=Ao[t](e,n);return{init:i.init||p,update:function(t,e){e[r]=i.next(t)}}}(t,u[e],o[e],f));else{if(null==r&&"count"!==t&&i("Null aggregate field specified."),"count"===t)return void g.push(f);d=!1;let e=h[a];e||(e=h[a]=[],e.field=r,m.push(e)),e.push(Kr(t,f))}})),(g.length||m.length)&&(e.cell=function(t,e,n){t=t.map(t=>ni(t,t.field));let r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,a=r.agg=Array(i),u=0;u<i;++u)a[u]=new t[u](r);if(r.store)var o=r.data=new ha;return r.add=function(t){if(r.num+=1,!n){o&&o.add(t);for(let e=0;e<i;++e)a[e].add(a[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){o&&o.rem(t);for(let e=0;e<i;++e)a[e].rem(a[e].get(t),t)}},r.set=function(t){let i,u;for(o&&o.values(),i=0,u=e.length;i<u;++i)t[e[i]]=r.num;if(!n)for(i=0,u=a.length;i<u;++i)a[i].set(t)},r.init=function(){r.num=0,o&&o.reset();for(let t=0;t<i;++t)a[t].init()},r}(m,g,d)),e.inputs=Object.keys(f)}const Eo=Mo.prototype;function Do(t){Hr.call(this,{},t),this._mlen=0,this._mods=[]}Eo.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()},Eo.update=function(t,e){let n,r=this.cell,i=this.windows,a=t.data,u=i&&i.length;if(r){for(n=t.p0;n<t.i0;++n)r.rem(a[n]);for(n=t.p1;n<t.i1;++n)r.add(a[n]);r.set(e)}for(n=0;n<u;++n)i[n].update(t,e)},Do.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ko.concat(Qr)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};var Co=rt(Do,Hr);function Fo(t,e,n,r){var i=r.sort,a=i&&!r.ignorePeers,u=r.frame||[null,0],o=t.data(n),s=o.length,l=0,c=a?ai(i):null,f={i0:0,i1:0,p0:0,p1:0,index:0,data:o,compare:i||V(-1)};for(e.init();l<s;++l)So(f,u,l,s),a&&Bo(f,c),e.update(f,o[l])}function So(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function Bo(t,e){var n=t.i0,r=t.i1-1,i=t.compare,a=t.data,u=a.length-1;n>0&&!i(a[n],a[n-1])&&(t.i0=e.left(a,a[n])),r<u&&!i(a[r],a[r+1])&&(t.i1=e.right(a,a[r]))}Co.transform=function(t,e){var n,r,i=this,a=i.state,u=t.modified(),o=Nt(t.sort);this.stamp=e.stamp,a&&!u||(a=i.state=new Mo(t));var s=Xr(t.groupby);function l(t){return i.group(s(t))}for(u||e.modified(a.inputs)?(i.value={},e.visit(e.SOURCE,(function(t){l(t).add(t)}))):(e.visit(e.REM,(function(t){l(t).remove(t)})),e.visit(e.ADD,(function(t){l(t).add(t)}))),n=0,r=i._mlen;n<r;++n)Fo(i._mods[n],a,o,t);return i._mlen=0,i._mods=[],e.reflow(u).modifies(a.outputs)},Co.group=function(t){var e=this.value[t];return e||((e=this.value[t]=ya(Ct)).stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e};var zo=Object.freeze({__proto__:null,aggregate:pa,bin:ma,collect:_a,compare:xa,countpattern:wa,cross:ka,density:Ea,dotbin:Ba,expression:za,extent:Na,facet:qa,field:La,filter:$a,flatten:ja,fold:Ia,formula:Ha,generate:Wa,impute:Ga,joinaggregate:Xa,kde:Za,key:Qa,load:tu,lookup:nu,multiextent:ru,multivalues:au,params:ou,pivot:su,prefacet:cu,project:fu,proxy:hu,quantile:du,relay:gu,sample:mu,sequence:vu,sieve:yu,subflow:Oa,timeunit:yo,tupleindex:bo,values:wo,window:Do});const To="top",No="left",Oo="right",Ro="end",qo="row";function Uo(t){this.clear(),t&&this.union(t)}var Lo=Uo.prototype;Lo.clone=function(){return new Uo(this)},Lo.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},Lo.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},Lo.equals=function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},Lo.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},Lo.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},Lo.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},Lo.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},Lo.scale=function(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},Lo.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},Lo.rotate=function(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},Lo.rotatedPoints=function(t,e,n){var{x1:r,y1:i,x2:a,y2:u}=this,o=Math.cos(t),s=Math.sin(t),l=e-e*o+n*s,c=n-e*s-n*o;return[o*r-s*i+l,s*r+o*i+c,o*r-s*u+l,s*r+o*u+c,o*a-s*i+l,s*a+o*i+c,o*a-s*u+l,s*a+o*u+c]},Lo.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},Lo.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},Lo.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},Lo.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},Lo.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},Lo.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},Lo.width=function(){return this.x2-this.x1},Lo.height=function(){return this.y2-this.y1};var Po=0;function $o(t){return t&&t.gradient}function jo(t,e,n){let r=t.id,i=t.gradient,a="radial"===i?"p_":"";return r||(r=t.id="gradient_"+Po++,"radial"===i?(t.x1=Io(t.x1,.5),t.y1=Io(t.y1,.5),t.r1=Io(t.r1,0),t.x2=Io(t.x2,.5),t.y2=Io(t.y2,.5),t.r2=Io(t.r2,.5),a="p_"):(t.x1=Io(t.x1,0),t.y1=Io(t.y1,0),t.x2=Io(t.x2,1),t.y2=Io(t.y2,0))),e[r]=t,"url("+(n||"")+"#"+a+r+")"}function Io(t,e){return null!=t?t:e}function Ho(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}function Wo(t){this.mark=t,this.bounds=this.bounds||new Uo}function Yo(t){Wo.call(this,t),this.items=this.items||[]}function Vo(t,e){if("undefined"!=typeof document&&document.createElement){var n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}function Go(){return"undefined"!=typeof Image?Image:null}function Xo(t){this._pending=0,this._loader=t||kr()}rt(Yo,Wo);var Jo=Xo.prototype;function Zo(t){t._pending+=1}function Qo(t){t._pending-=1}Jo.pending=function(){return this._pending},Jo.sanitizeURL=function(t){var e=this;return Zo(e),e._loader.sanitize(t,{context:"href"}).then((function(t){return Qo(e),t})).catch((function(){return Qo(e),null}))},Jo.loadImage=function(t){const e=this,n=Go();return Zo(e),e._loader.sanitize(t,{context:"image"}).then((function(t){const r=t.href;if(!r||!n)throw{url:r};const i=new n,a=K(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=a&&(i.crossOrigin=a),i.onload=()=>Qo(e),i.onerror=()=>Qo(e),i.src=r,i})).catch((function(t){return Qo(e),{complete:!1,width:0,height:0,src:t&&t.url||""}}))},Jo.ready=function(){var t=this;return new Promise((function(e){!function n(r){t.pending()?setTimeout((function(){n(!0)}),10):e(r)}(!1)}))};var Ko=Math.PI,ts=2*Ko,es=ts-1e-6;function ns(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function rs(){return new ns}function is(t){return function(){return t}}ns.prototype=rs.prototype={constructor:ns,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,u=this._y1,o=n-t,s=r-e,l=a-t,c=u-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(c*o-s*l)>1e-6&&i){var h=n-a,d=r-u,p=o*o+s*s,g=h*h+d*d,m=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((Ko-Math.acos((p+f-g)/(2*m*v)))/2),_=y/v,x=y/m;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*d)+","+(this._x1=t+x*o)+","+(this._y1=e+x*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var u=(n=+n)*Math.cos(r),o=n*Math.sin(r),s=t+u,l=e+o,c=1^a,f=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%ts+ts),f>es?this._+="A"+n+","+n+",0,1,"+c+","+(t-u)+","+(e-o)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=Ko)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var as=Math.abs,us=Math.atan2,os=Math.cos,ss=Math.max,ls=Math.min,cs=Math.sin,fs=Math.sqrt,hs=Math.PI,ds=hs/2,ps=2*hs;function gs(t){return t>1?0:t<-1?hs:Math.acos(t)}function ms(t){return t>=1?ds:t<=-1?-ds:Math.asin(t)}function vs(t){return t.innerRadius}function ys(t){return t.outerRadius}function _s(t){return t.startAngle}function xs(t){return t.endAngle}function bs(t){return t&&t.padAngle}function ws(t,e,n,r,i,a,u,o){var s=n-t,l=r-e,c=u-i,f=o-a,h=f*s-c*l;if(!(h*h<1e-12))return[t+(h=(c*(e-a)-f*(t-i))/h)*s,e+h*l]}function As(t,e,n,r,i,a,u){var o=t-n,s=e-r,l=(u?a:-a)/fs(o*o+s*s),c=l*s,f=-l*o,h=t+c,d=e+f,p=n+c,g=r+f,m=(h+p)/2,v=(d+g)/2,y=p-h,_=g-d,x=y*y+_*_,b=i-a,w=h*g-p*d,A=(_<0?-1:1)*fs(ss(0,b*b*x-w*w)),k=(w*_-y*A)/x,M=(-w*y-_*A)/x,E=(w*_+y*A)/x,D=(-w*y+_*A)/x,C=k-m,F=M-v,S=E-m,B=D-v;return C*C+F*F>S*S+B*B&&(k=E,M=D),{cx:k,cy:M,x01:-c,y01:-f,x11:k*(i/b-1),y11:M*(i/b-1)}}function ks(t){this._context=t}function Ms(t){return new ks(t)}function Es(t){return t[0]}function Ds(t){return t[1]}function Cs(){var t=Es,e=Ds,n=is(!0),r=null,i=Ms,a=null;function u(u){var o,s,l,c=u.length,f=!1;for(null==r&&(a=i(l=rs())),o=0;o<=c;++o)!(o<c&&n(s=u[o],o,u))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(s,o,u),+e(s,o,u));if(l)return a=null,l+""||null}return u.x=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),u):t},u.y=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),u):e},u.defined=function(t){return arguments.length?(n="function"==typeof t?t:is(!!t),u):n},u.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),u):i},u.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),u):r},u}function Fs(){var t=Es,e=null,n=is(0),r=Ds,i=is(!0),a=null,u=Ms,o=null;function s(s){var l,c,f,h,d,p=s.length,g=!1,m=new Array(p),v=new Array(p);for(null==a&&(o=u(d=rs())),l=0;l<=p;++l){if(!(l<p&&i(h=s[l],l,s))===g)if(g=!g)c=l,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),f=l-1;f>=c;--f)o.point(m[f],v[f]);o.lineEnd(),o.areaEnd()}g&&(m[l]=+t(h,l,s),v[l]=+n(h,l,s),o.point(e?+e(h,l,s):m[l],r?+r(h,l,s):v[l]))}if(d)return o=null,d+""||null}function l(){return Cs().defined(i).curve(u).context(a)}return s.x=function(n){return arguments.length?(t="function"==typeof n?n:is(+n),e=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),s):t},s.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:is(+t),s):e},s.y=function(t){return arguments.length?(n="function"==typeof t?t:is(+t),r=null,s):n},s.y0=function(t){return arguments.length?(n="function"==typeof t?t:is(+t),s):n},s.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:is(+t),s):r},s.lineX0=s.lineY0=function(){return l().x(t).y(n)},s.lineY1=function(){return l().x(t).y(r)},s.lineX1=function(){return l().x(e).y(n)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:is(!!t),s):i},s.curve=function(t){return arguments.length?(u=t,null!=a&&(o=u(a)),s):u},s.context=function(t){return arguments.length?(null==t?a=o=null:o=u(a=t),s):a},s}ks.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Ss={draw:function(t,e){var n=Math.sqrt(e/hs);t.moveTo(n,0),t.arc(0,0,n,0,ps)}};function Bs(){}function zs(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Ts(t){this._context=t}function Ns(t){this._context=t}function Os(t){this._context=t}function Rs(t,e){this._basis=new Ts(t),this._beta=e}Ts.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:zs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:zs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ns.prototype={areaStart:Bs,areaEnd:Bs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:zs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Os.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:zs(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Rs.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],u=t[n]-i,o=e[n]-a,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*u),this._beta*e[s]+(1-this._beta)*(a+r*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var qs=function t(e){function n(t){return 1===e?new Ts(t):new Rs(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Us(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ls(t,e){this._context=t,this._k=(1-e)/6}Ls.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Us(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Us(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ps=function t(e){function n(t){return new Ls(t,e)}return n.tension=function(e){return t(+e)},n}(0);function $s(t,e){this._context=t,this._k=(1-e)/6}$s.prototype={areaStart:Bs,areaEnd:Bs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Us(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var js=function t(e){function n(t){return new $s(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Is(t,e){this._context=t,this._k=(1-e)/6}Is.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Us(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Hs=function t(e){function n(t){return new Is(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ws(t,e,n){var r=t._x1,i=t._y1,a=t._x2,u=t._y2;if(t._l01_a>1e-12){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>1e-12){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/c,u=(u*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,a,u,t._x2,t._y2)}function Ys(t,e){this._context=t,this._alpha=e}Ys.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ws(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vs=function t(e){function n(t){return e?new Ys(t,e):new Ls(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gs(t,e){this._context=t,this._alpha=e}Gs.prototype={areaStart:Bs,areaEnd:Bs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ws(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Xs=function t(e){function n(t){return e?new Gs(t,e):new $s(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Js(t,e){this._context=t,this._alpha=e}Js.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ws(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Zs=function t(e){function n(t){return e?new Js(t,e):new Is(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Qs(t){this._context=t}function Ks(t){return t<0?-1:1}function tl(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),u=(n-t._y1)/(i||r<0&&-0),o=(a*i+u*r)/(r+i);return(Ks(a)+Ks(u))*Math.min(Math.abs(a),Math.abs(u),.5*Math.abs(o))||0}function el(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function nl(t,e,n){var r=t._x0,i=t._y0,a=t._x1,u=t._y1,o=(a-r)/3;t._context.bezierCurveTo(r+o,i+o*e,a-o,u-o*n,a,u)}function rl(t){this._context=t}function il(t){this._context=new al(t)}function al(t){this._context=t}function ul(t){this._context=t}function ol(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),u=new Array(r);for(i[0]=0,a[0]=2,u[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,u[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,u[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,u[e]-=n*u[e-1];for(i[r-1]=u[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(u[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function sl(t,e){this._context=t,this._t=e}Qs.prototype={areaStart:Bs,areaEnd:Bs,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},rl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:nl(this,this._t0,el(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,nl(this,el(this,n=tl(this,t,e)),n);break;default:nl(this,this._t0,n=tl(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(il.prototype=Object.create(rl.prototype)).point=function(t,e){rl.prototype.point.call(this,e,t)},al.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},ul.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=ol(t),i=ol(e),a=0,u=1;u<n;++a,++u)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[u],e[u]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},sl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var ll={basis:{curve:function(t){return new Ts(t)}},"basis-closed":{curve:function(t){return new Ns(t)}},"basis-open":{curve:function(t){return new Os(t)}},bundle:{curve:qs,tension:"beta",value:.85},cardinal:{curve:Ps,tension:"tension",value:0},"cardinal-open":{curve:Hs,tension:"tension",value:0},"cardinal-closed":{curve:js,tension:"tension",value:0},"catmull-rom":{curve:Vs,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Xs,tension:"alpha",value:.5},"catmull-rom-open":{curve:Zs,tension:"alpha",value:.5},linear:{curve:Ms},"linear-closed":{curve:function(t){return new Qs(t)}},monotone:{horizontal:function(t){return new il(t)},vertical:function(t){return new rl(t)}},natural:{curve:function(t){return new ul(t)}},step:{curve:function(t){return new sl(t,.5)}},"step-after":{curve:function(t){return new sl(t,1)}},"step-before":{curve:function(t){return new sl(t,0)}}};function cl(t,e,n){var r=K(ll,t)&&ll[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}var fl={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},hl=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];function dl(t){var e,n,r,i,a,u,o,s,l,c,f,h=[];for(s=0,c=(e=t.slice().replace(hl[0],"###$1").split(hl[1]).slice(1)).length;s<c;++s){for(r=(n=e[s]).slice(1).trim().replace(hl[2],"$1###$2").split(hl[3]),i=[u=n.charAt(0)],l=0,f=r.length;l<f;++l)(a=+r[l])===a&&i.push(a);if(o=fl[u.toLowerCase()],i.length-1>o)for(l=1,f=i.length;l<f;l+=o)h.push([u].concat(i.slice(l,l+o)));else h.push(i)}return h}const pl=Math.PI/180,gl=Math.PI/2,ml=2*Math.PI,vl=Math.sqrt(3)/2;var yl={},_l={},xl=[].join;function bl(t){var e=xl.call(t);if(_l[e])return _l[e];var n=t[0],r=t[1],i=t[2],a=t[3],u=t[4],o=t[5],s=t[6],l=t[7],c=l*u,f=-s*o,h=s*u,d=l*o,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),x=8/3*_*_/Math.sin(y),b=n+p-x*g,w=r+g+x*p,A=n+m,k=r+v,M=A+x*v,E=k-x*m;return _l[e]=[c*b+f*w,h*b+d*w,c*M+f*E,h*M+d*E,c*A+f*k,h*A+d*k]}var wl=["l",0,0,0,0,0,0,0];function Al(t,e,n){var r=wl[0]=t[0];if("a"===r||"A"===r)wl[1]=e*t[1],wl[2]=n*t[2],wl[3]=t[3],wl[4]=t[4],wl[5]=t[5],wl[6]=e*t[6],wl[7]=n*t[7];else if("h"===r||"H"===r)wl[1]=e*t[1];else if("v"===r||"V"===r)wl[1]=n*t[1];else for(var i=1,a=t.length;i<a;++i)wl[i]=(i%2==1?e:n)*t[i];return wl}function kl(t,e,n,r,i,a){var u,o,s,l,c,f=null,h=0,d=0,p=0,g=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==a&&(a=i),t.beginPath&&t.beginPath();for(var m=0,v=e.length;m<v;++m){switch(u=e[m],1===i&&1===a||(u=Al(u,i,a)),u[0]){case"l":h+=u[1],d+=u[2],t.lineTo(h+n,d+r);break;case"L":h=u[1],d=u[2],t.lineTo(h+n,d+r);break;case"h":h+=u[1],t.lineTo(h+n,d+r);break;case"H":h=u[1],t.lineTo(h+n,d+r);break;case"v":d+=u[1],t.lineTo(h+n,d+r);break;case"V":d=u[1],t.lineTo(h+n,d+r);break;case"m":h+=u[1],d+=u[2],t.moveTo(h+n,d+r);break;case"M":h=u[1],d=u[2],t.moveTo(h+n,d+r);break;case"c":o=h+u[5],s=d+u[6],p=h+u[3],g=d+u[4],t.bezierCurveTo(h+u[1]+n,d+u[2]+r,p+n,g+r,o+n,s+r),h=o,d=s;break;case"C":h=u[5],d=u[6],p=u[3],g=u[4],t.bezierCurveTo(u[1]+n,u[2]+r,p+n,g+r,h+n,d+r);break;case"s":o=h+u[3],s=d+u[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,h+u[1]+n,d+u[2]+r,o+n,s+r),p=h+u[1],g=d+u[2],h=o,d=s;break;case"S":o=u[3],s=u[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,u[1]+n,u[2]+r,o+n,s+r),h=o,d=s,p=u[1],g=u[2];break;case"q":o=h+u[3],s=d+u[4],p=h+u[1],g=d+u[2],t.quadraticCurveTo(p+n,g+r,o+n,s+r),h=o,d=s;break;case"Q":o=u[3],s=u[4],t.quadraticCurveTo(u[1]+n,u[2]+r,o+n,s+r),h=o,d=s,p=u[1],g=u[2];break;case"t":o=h+u[1],s=d+u[2],null===f[0].match(/[QqTt]/)?(p=h,g=d):"t"===f[0]?(p=2*h-l,g=2*d-c):"q"===f[0]&&(p=2*h-p,g=2*d-g),l=p,c=g,t.quadraticCurveTo(p+n,g+r,o+n,s+r),d=s,p=(h=o)+u[1],g=d+u[2];break;case"T":o=u[1],s=u[2],p=2*h-p,g=2*d-g,t.quadraticCurveTo(p+n,g+r,o+n,s+r),h=o,d=s;break;case"a":Ml(t,h+n,d+r,[u[1],u[2],u[3],u[4],u[5],u[6]+h+n,u[7]+d+r]),h+=u[6],d+=u[7];break;case"A":Ml(t,h+n,d+r,[u[1],u[2],u[3],u[4],u[5],u[6]+n,u[7]+r]),h=u[6],d=u[7];break;case"z":case"Z":t.closePath()}f=u}}function Ml(t,e,n,r){for(var i=function(t,e,n,r,i,a,u,o,s){var l=xl.call(arguments);if(yl[l])return yl[l];var c=u*pl,f=Math.sin(c),h=Math.cos(c),d=h*(o-t)*.5+f*(s-e)*.5,p=h*(s-e)*.5-f*(o-t)*.5,g=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(n*=g=Math.sqrt(g),r*=g);var m=h/n,v=f/n,y=-f/r,_=h/r,x=m*o+v*s,b=y*o+_*s,w=m*t+v*e,A=y*t+_*e,k=(w-x)*(w-x)+(A-b)*(A-b),M=1/k-.25;M<0&&(M=0);var E=Math.sqrt(M);a==i&&(E=-E);var D=.5*(x+w)-E*(A-b),C=.5*(b+A)+E*(w-x),F=Math.atan2(b-C,x-D),S=Math.atan2(A-C,w-D),B=S-F;B<0&&1===a?B+=ml:B>0&&0===a&&(B-=ml);for(var z=Math.ceil(Math.abs(B/(gl+.001))),T=[],N=0;N<z;++N){var O=F+N*B/z,R=F+(N+1)*B/z;T[N]=[D,C,O,R,n,r,f,h]}return yl[l]=T}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n),a=0;a<i.length;++a){var u=bl(i[a]);t.bezierCurveTo(u[0],u[1],u[2],u[3],u[4],u[5])}}var El={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,ml)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,a=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-a),t.lineTo(i,-a),t.lineTo(0,-n),t.lineTo(-i,-a),t.lineTo(-r,-a),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n,i=r-.5773502691896257*n,a=n/4;t.moveTo(0,-r-i),t.lineTo(-a,r-i),t.lineTo(a,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n,i=r-.5773502691896257*n;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=vl*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function Dl(t){return K(El,t)?El[t]:function(t){if(!K(Cl,t)){var e=dl(t);Cl[t]={draw:function(t,n){kl(t,e,0,0,Math.sqrt(n)/2)}}}return Cl[t]}(t)}var Cl={};const Fl=.448084975506;function Sl(t){return t.x}function Bl(t){return t.y}function zl(t){return t.width}function Tl(t){return t.height}function Nl(t){return"function"==typeof t?t:()=>+t}function Ol(t,e,n){return Math.max(e,Math.min(t,n))}function Rl(){var t=Sl,e=Bl,n=zl,r=Tl,i=Nl(0),a=i,u=i,o=i,s=null;function l(l,c,f){var h,d=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),v=Math.min(g,m)/2,y=Ol(+i.call(this,l),0,v),_=Ol(+a.call(this,l),0,v),x=Ol(+u.call(this,l),0,v),b=Ol(+o.call(this,l),0,v);if(s||(s=h=rs()),y<=0&&_<=0&&x<=0&&b<=0)s.rect(d,p,g,m);else{var w=d+g,A=p+m;s.moveTo(d+y,p),s.lineTo(w-_,p),s.bezierCurveTo(w-Fl*_,p,w,p+Fl*_,w,p+_),s.lineTo(w,A-b),s.bezierCurveTo(w,A-Fl*b,w-Fl*b,A,w-b,A),s.lineTo(d+x,A),s.bezierCurveTo(d+Fl*x,A,d,A-Fl*x,d,A-x),s.lineTo(d,p+y),s.bezierCurveTo(d,p+Fl*y,d+Fl*y,p,d+y,p),s.closePath()}if(h)return s=null,h+""||null}return l.x=function(e){return arguments.length?(t=Nl(e),l):t},l.y=function(t){return arguments.length?(e=Nl(t),l):e},l.width=function(t){return arguments.length?(n=Nl(t),l):n},l.height=function(t){return arguments.length?(r=Nl(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=Nl(t),a=null!=e?Nl(e):i,o=null!=n?Nl(n):i,u=null!=r?Nl(r):a,l):i},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function ql(){var t,e,n,r,i,a,u,o,s=null;function l(t,e,n){var r=n/2;if(i){var l=u-e,c=t-a;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*o,d=(c/=f)*o,p=Math.atan2(c,l);s.moveTo(a-h,u-d),s.lineTo(t-l*r,e-c*r),s.arc(t,e,r,p-Math.PI,p),s.lineTo(a+h,u+d),s.arc(a,u,o,p,p+Math.PI)}else s.arc(t,e,r,0,ml);s.closePath()}else i=1;a=t,u=e,o=r}function c(a){var u,o,c,f=a.length,h=!1;for(null==s&&(s=c=rs()),u=0;u<=f;++u)!(u<f&&r(o=a[u],u,a))===h&&(h=!h)&&(i=0),h&&l(+t(o,u,a),+e(o,u,a),+n(o,u,a));if(c)return s=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}function Ul(t,e){return null!=t?t:e}const Ll=t=>t.x||0,Pl=t=>t.y||0,$l=t=>!(!1===t.defined),jl=function(){var t=vs,e=ys,n=is(0),r=null,i=_s,a=xs,u=bs,o=null;function s(){var s,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-ds,d=a.apply(this,arguments)-ds,p=as(d-h),g=d>h;if(o||(o=s=rs()),f<c&&(l=f,f=c,c=l),f>1e-12)if(p>ps-1e-12)o.moveTo(f*os(h),f*cs(h)),o.arc(0,0,f,h,d,!g),c>1e-12&&(o.moveTo(c*os(d),c*cs(d)),o.arc(0,0,c,d,h,g));else{var m,v,y=h,_=d,x=h,b=d,w=p,A=p,k=u.apply(this,arguments)/2,M=k>1e-12&&(r?+r.apply(this,arguments):fs(c*c+f*f)),E=ls(as(f-c)/2,+n.apply(this,arguments)),D=E,C=E;if(M>1e-12){var F=ms(M/c*cs(k)),S=ms(M/f*cs(k));(w-=2*F)>1e-12?(x+=F*=g?1:-1,b-=F):(w=0,x=b=(h+d)/2),(A-=2*S)>1e-12?(y+=S*=g?1:-1,_-=S):(A=0,y=_=(h+d)/2)}var B=f*os(y),z=f*cs(y),T=c*os(b),N=c*cs(b);if(E>1e-12){var O,R=f*os(_),q=f*cs(_),U=c*os(x),L=c*cs(x);if(p<hs&&(O=ws(B,z,U,L,R,q,T,N))){var P=B-O[0],$=z-O[1],j=R-O[0],I=q-O[1],H=1/cs(gs((P*j+$*I)/(fs(P*P+$*$)*fs(j*j+I*I)))/2),W=fs(O[0]*O[0]+O[1]*O[1]);D=ls(E,(c-W)/(H-1)),C=ls(E,(f-W)/(H+1))}}A>1e-12?C>1e-12?(m=As(U,L,B,z,f,C,g),v=As(R,q,T,N,f,C,g),o.moveTo(m.cx+m.x01,m.cy+m.y01),C<E?o.arc(m.cx,m.cy,C,us(m.y01,m.x01),us(v.y01,v.x01),!g):(o.arc(m.cx,m.cy,C,us(m.y01,m.x01),us(m.y11,m.x11),!g),o.arc(0,0,f,us(m.cy+m.y11,m.cx+m.x11),us(v.cy+v.y11,v.cx+v.x11),!g),o.arc(v.cx,v.cy,C,us(v.y11,v.x11),us(v.y01,v.x01),!g))):(o.moveTo(B,z),o.arc(0,0,f,y,_,!g)):o.moveTo(B,z),c>1e-12&&w>1e-12?D>1e-12?(m=As(T,N,R,q,c,-D,g),v=As(B,z,U,L,c,-D,g),o.lineTo(m.cx+m.x01,m.cy+m.y01),D<E?o.arc(m.cx,m.cy,D,us(m.y01,m.x01),us(v.y01,v.x01),!g):(o.arc(m.cx,m.cy,D,us(m.y01,m.x01),us(m.y11,m.x11),!g),o.arc(0,0,c,us(m.cy+m.y11,m.cx+m.x11),us(v.cy+v.y11,v.cx+v.x11),g),o.arc(v.cx,v.cy,D,us(v.y11,v.x11),us(v.y01,v.x01),!g))):o.arc(0,0,c,b,x,g):o.lineTo(T,N)}else o.moveTo(0,0);if(o.closePath(),s)return o=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-hs/2;return[os(r)*n,cs(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:is(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:is(+t),s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:is(+t),s):i},s.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:is(+t),s):a},s.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:is(+t),s):u},s.context=function(t){return arguments.length?(o=null==t?null:t,s):o},s}().startAngle(t=>t.startAngle||0).endAngle(t=>t.endAngle||0).padAngle(t=>t.padAngle||0).innerRadius(t=>t.innerRadius||0).outerRadius(t=>t.outerRadius||0).cornerRadius(t=>t.cornerRadius||0),Il=Fs().x(Ll).y1(Pl).y0(t=>(t.y||0)+(t.height||0)).defined($l),Hl=Fs().y(Pl).x1(Ll).x0(t=>(t.x||0)+(t.width||0)).defined($l),Wl=Cs().x(Ll).y(Pl).defined($l),Yl=Rl().x(Ll).y(Pl).width(t=>t.width||0).height(t=>t.height||0).cornerRadius(t=>Ul(t.cornerRadiusTopLeft,t.cornerRadius)||0,t=>Ul(t.cornerRadiusTopRight,t.cornerRadius)||0,t=>Ul(t.cornerRadiusBottomRight,t.cornerRadius)||0,t=>Ul(t.cornerRadiusBottomLeft,t.cornerRadius)||0),Vl=function(){var t=is(Ss),e=is(64),n=null;function r(){var r;if(n||(n=r=rs()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:is(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type(t=>Dl(t.shape||"circle")).size(t=>Ul(t.size,64)),Gl=ql().x(Ll).y(Pl).defined($l).size(t=>t.size||1);function Xl(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Jl(t,e,n,r){return Yl.context(t)(e,n,r)}function Zl(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}var Ql,Kl,tc,ec=ml-1e-8;function nc(t){return Ql=t,nc}function rc(){}function ic(t,e){Ql.add(t,e)}function ac(t,e){ic(Kl=t,tc=e)}function uc(t){ic(t,Ql.y1)}function oc(t){ic(Ql.x1,t)}function sc(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function lc(t,e,n,r,i){const a=r-t+3*e-3*n,u=t+n-2*e,o=t-e;let s,l=0,c=0;Math.abs(a)>1e-14?(s=u*u+o*a,s>=0&&(s=Math.sqrt(s),l=(-u+s)/a,c=(-u-s)/a)):l=.5*o/u,0<l&&l<1&&i(cc(l,t,e,n,r)),0<c&&c<1&&i(cc(c,t,e,n,r))}function cc(t,e,n,r,i){const a=1-t,u=a*a,o=t*t;return u*a*e+3*u*t*n+3*a*o*r+o*t*i}nc.beginPath=rc,nc.closePath=rc,nc.moveTo=ac,nc.lineTo=ac,nc.rect=function(t,e,n,r){ic(t+n,e+r),ac(t,e)},nc.quadraticCurveTo=function(t,e,n,r){sc(Kl,t,n,uc),sc(tc,e,r,oc),ac(n,r)},nc.bezierCurveTo=function(t,e,n,r,i,a){lc(Kl,t,n,i,uc),lc(tc,e,r,a,oc),ac(i,a)},nc.arc=function(t,e,n,r,i,a){if(Kl=n*Math.cos(i)+t,tc=n*Math.sin(i)+e,Math.abs(i-r)>ec)ic(t-n,e-n),ic(t+n,e+n);else{const u=r=>ic(n*Math.cos(r)+t,n*Math.sin(r)+e);let o,s;if(u(r),u(i),i!==r)if((r%=ml)<0&&(r+=ml),(i%=ml)<0&&(i+=ml),i<r&&(a=!a,o=r,r=i,i=o),a)for(i-=ml,o=r-r%gl,s=0;s<4&&o>i;++s,o-=gl)u(o);else for(o=r-r%gl+gl,s=0;s<4&&o<i;++s,o+=gl)u(o)}};var fc=(fc=Vo(1,1))?fc.getContext("2d"):null;const hc=new Uo;function dc(t){return function(e,n){if(!fc)return!0;t(fc,e),hc.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:a,y2:u}=hc;for(let t=i;t<=u;++t)for(let e=r;e<=a;++e)if(fc.isPointInPath(e,t))return!0;return!1}}function pc(t,e){return e.contains(t.x||0,t.y||0)}function gc(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,a=t.height||0;return e.intersects(hc.set(n,r,n+i,r+a))}function mc(t,e){const n=t.x||0,r=t.y||0;return vc(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function vc(t,e,n,r,i){const{x1:a,y1:u,x2:o,y2:s}=t,l=r-e,c=i-n;let f,h,d,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-l,h=-(a-e)),1===p&&(f=l,h=o-e),2===p&&(f=-c,h=-(u-n)),3===p&&(f=c,h=s-n),Math.abs(f)<1e-10&&h<0)return!1;if(d=h/f,f<0){if(d>m)return!1;d>g&&(g=d)}else if(f>0){if(d<g)return!1;d<m&&(m=d)}}return!0}function yc(t,e){t.globalCompositeOperation=e.blend||"source-over"}function _c(t,e){return null==t?e:t}function xc(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function bc(t,e,n){return $o(n)?function(t,e,n){const r=n.width(),i=n.height();let a;if("radial"===e.gradient)a=t.createRadialGradient(n.x1+_c(e.x1,.5)*r,n.y1+_c(e.y1,.5)*i,Math.max(r,i)*_c(e.r1,0),n.x1+_c(e.x2,.5)*r,n.y1+_c(e.y2,.5)*i,Math.max(r,i)*_c(e.r2,.5));else{const u=_c(e.x1,0),o=_c(e.y1,0),s=_c(e.x2,1),l=_c(e.y2,0);if(u!==s&&o!==l&&r!==i){const n=Vo(Math.ceil(r),Math.ceil(i)),a=n.getContext("2d");return a.scale(r,i),a.fillStyle=xc(a.createLinearGradient(u,o,s,l),e.stops),a.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}a=t.createLinearGradient(n.x1+u*r,n.y1+o*i,n.x1+s*r,n.y1+l*i)}return xc(a,e.stops)}(t,n,e.bounds):n}function wc(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=bc(t,e,e.fill),!0)}var Ac=[];function kc(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=bc(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Ac),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Mc(t,e){return t.zindex-e.zindex||t.index-e.index}function Ec(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,a=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&a.push(e);return t.zdirty=!1,t.zitems=a.sort(Mc)}function Dc(t,e){var n,r,i=t.items;if(i&&i.length){var a=Ec(t);if(a&&a.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=a}for(n=0,r=i.length;n<r;++n)e(i[n])}}function Cc(t,e){var n,r,i=t.items;if(!i||!i.length)return null;var a=Ec(t);for(a&&a.length&&(i=a),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===a)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function Fc(t){return function(e,n,r){Dc(n,(function(n){r&&!r.intersects(n.bounds)||Bc(t,e,n,n)}))}}function Sc(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Bc(t,e,n.items[0],n.items)}}function Bc(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(yc(e,n),n.fill&&wc(e,n,i)&&e.fill(),n.stroke&&kc(e,n,i)&&e.stroke()))}function zc(t){return t=t||m,function(e,n,r,i,a,u){return r*=e.pixelRatio,i*=e.pixelRatio,Cc(n,(function(n){var o=n.bounds;if((!o||o.contains(a,u))&&o)return t(e,n,r,i,a,u)?n:void 0}))}}function Tc(t,e){return function(n,r,i,a){var u,o,s=Array.isArray(r)?r[0]:r,l=null==e?s.fill:e,c=s.stroke&&n.isPointInStroke;return c&&(u=s.strokeWidth,o=s.strokeCap,n.lineWidth=null!=u?u:1,n.lineCap=null!=o?o:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,a)||c&&n.isPointInStroke(i,a))}}function Nc(t){return zc(Tc(t))}function Oc(t,e){return"translate("+t+","+e+")"}function Rc(t){return"rotate("+t+")"}function qc(t){return Oc(t.x||0,t.y||0)}function Uc(t){return Oc(t.x||0,t.y||0)+(t.angle?" "+Rc(t.angle):"")+(t.scaleX||t.scaleY?" "+(e=t.scaleX||1,n=t.scaleY||1,"scale("+e+","+n+")"):"");var e,n}function Lc(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,a=n.angle||0;t.translate(r,i),a&&t.rotate(a*=pl),t.beginPath(),e(t,n),a&&t.rotate(-a),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",Uc(n)),t("d",e(null,n))},bound:function(t,n){var r=n.x||0,i=n.y||0;return e(nc(t),n),Zl(t,n).translate(r,i),n.angle&&t.rotate(n.angle*pl,r,i),t},draw:Fc(r),pick:Nc(r),isect:n||dc(r)}}var Pc=Lc("arc",(function(t,e){return jl.context(t)(e)}));function $c(t,e,n){function r(t,n){t.beginPath(),e(t,n)}var i=Tc(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(nc(t),r),Zl(t,r[0]))},draw:Sc(r),pick:function(t,e,n,r,a,u){var o=e.items,s=e.bounds;return!o||!o.length||s&&!s.contains(a,u)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,o,n,r)?o[0]:null)},isect:pc,tip:n}}var jc=$c("area",(function(t,e){var n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Hl:Il).curve(cl(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],a="horizontal"===t[0].orient?"y":"x",u=t.length,o=1/0;--u>=0;)!1!==t[u].defined&&(r=Math.abs(t[u][a]-i))<o&&(o=r,n=t[u]);return n}));function Ic(t,e){t.beginPath(),Xl(e)?Jl(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}var Hc=1;function Wc(t,e,n){var r=e.clip,i=t._defs,a=e.clip_id||(e.clip_id="clip"+Hc++),u=i.clipping[a]||(i.clipping[a]={id:a});return W(r)?u.path=r(null):Xl(n)?u.path=Jl(null,n,0,0):(u.width=n.width||0,u.height=n.height||0),"url(#"+a+")"}function Yc(t){var e=null!=(e=t.strokeWidth)?e:1;return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function Vc(t,e){var n=Yc(e);t("d",Jl(null,e,n,n))}function Gc(t,e,n,r){var i=Yc(e);t.beginPath(),Jl(t,e,(n||0)+i,(r||0)+i)}var Xc=Tc(Gc),Jc=Tc(Gc,!1);var Zc={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",qc(e))},bound:function(t,e){if(!e.clip&&e.items)for(var n=e.items,r=0,i=n.length;r<i;++r)t.union(n[r].bounds);return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),Zl(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){var r=this;Dc(e,(function(e){var i=e.x||0,a=e.y||0,u=e.strokeForeground,o=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&o&&(Gc(t,e,i,a),yc(t,e),e.fill&&wc(t,e,o)&&t.fill(),e.stroke&&!u&&kc(t,e,o)&&t.stroke()),t.save(),t.translate(i,a),e.clip&&Ic(t,e),n&&n.translate(-i,-a),Dc(e,(function(e){r.draw(t,e,n)})),n&&n.translate(i,a),t.restore(),u&&e.stroke&&o&&(Gc(t,e,i,a),yc(t,e),kc(t,e,o)&&t.stroke())}))},pick:function(t,e,n,r,i,a){if(e.bounds&&!e.bounds.contains(i,a)||!e.items)return null;var u=this,o=n*t.pixelRatio,s=r*t.pixelRatio;return Cc(e,(function(l){var c,f,h,d,p,g,m,v,y;if((!(v=l.bounds)||v.contains(i,a))&&(d=l.x||0,p=l.y||0,g=d+(l.width||0),m=p+(l.height||0),!(y=l.clip)||!(i<d||i>g||a<d||a>m)))return t.save(),t.translate(d,p),d=i-d,p=a-p,y&&Xl(l)&&!Xc(t,l,o,s)?(t.restore(),null):(f=l.strokeForeground,(h=!1!==e.interactive)&&f&&l.stroke&&Jc(t,l,o,s)?(t.restore(),l):(!(c=Cc(l,(function(t){return function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,d,p)?u.pick(t,n,r,d,p):null})))&&h&&(l.fill||!f&&l.stroke)&&Xc(t,l,o,s)&&(c=l),t.restore(),c||null))}))},isect:gc,content:function(t,e,n){t("clip-path",e.clip?Wc(n,e,e):null)},background:function(t,e){t("class","background"),Vc(t,e)},foreground:function(t,e){t("class","foreground"),e.strokeForeground?Vc(t,e):t("d","")}};function Qc(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function Kc(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function tf(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function ef(t,e){return"center"===t?e/2:"right"===t?e:0}function nf(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var rf={type:"image",tag:"image",nested:!1,attr:function(t,e,n){var r=Qc(e,n),i=e.x||0,a=e.y||0,u=Kc(e,r),o=tf(e,r),s=!1===e.aspect?"none":"xMidYMid";i-=ef(e.align,u),a-=nf(e.baseline,o),!r.src&&r.toDataURL?t("href",r.toDataURL(),"http://www.w3.org/1999/xlink","xlink:href"):t("href",r.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",Oc(i,a)),t("width",u),t("height",o),t("preserveAspectRatio",s)},bound:function(t,e){var n=e.image,r=e.x||0,i=e.y||0,a=Kc(e,n),u=tf(e,n);return r-=ef(e.align,a),i-=nf(e.baseline,u),t.set(r,i,r+a,i+u)},draw:function(t,e,n){var r=this;Dc(e,(function(e){if(!n||n.intersects(e.bounds)){var i,a,u,o,s=Qc(e,r),l=e.x||0,c=e.y||0,f=Kc(e,s),h=tf(e,s);l-=ef(e.align,f),c-=nf(e.baseline,h),!1!==e.aspect&&(a=s.width/s.height,u=e.width/e.height,a==a&&u==u&&a!==u&&(u<a?(c+=(h-(o=f/a))/2,h=o):(l+=(f-(o=h*a))/2,f=o))),(s.complete||s.toDataURL)&&(yc(t,e),t.globalAlpha=null!=(i=e.opacity)?i:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(s,l,c,f,h))}}))},pick:zc(),isect:m,get:Qc,xOffset:ef,yOffset:nf},af=$c("line",(function(t,e){var n=e[0],r=n.interpolate||"linear";return Wl.curve(cl(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),a=t.length;--a>=0;)if(!1!==t[a].defined&&(n=t[a].x-e[0])*n+(r=t[a].y-e[1])*r<i)return t[a];return null}));function uf(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,a=e.scaleX||1,u=e.scaleY||1,o=(e.angle||0)*pl,s=e.pathCache;s&&s.path===n||((e.pathCache=s=dl(n)).path=n),o&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(o),kl(t,s,0,0,a,u),t.rotate(-o),t.translate(-r,-i)):kl(t,s,r,i,a,u)}var of={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",Uc(e)),t("d",e.path)},bound:function(t,e){return uf(nc(t),e)?t.set(0,0,0,0):Zl(t,e,!0),e.angle&&t.rotate(e.angle*pl,e.x||0,e.y||0),t},draw:Fc(uf),pick:Nc(uf),isect:dc(uf)};function sf(t,e){t.beginPath(),Jl(t,e)}var lf={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Jl(null,e))},bound:function(t,e){var n,r;return Zl(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:Fc(sf),pick:Nc(sf),isect:gc};function cf(t,e,n){var r,i,a,u;return!(!e.stroke||!kc(t,e,n))&&(r=e.x||0,i=e.y||0,a=null!=e.x2?e.x2:r,u=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(a,u),!0)}var ff={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",qc(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return Zl(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){Dc(e,(function(e){if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&cf(t,e,r)&&(yc(t,e),t.stroke())}}))},pick:zc((function(t,e,n,r){return!!t.isPointInStroke&&(cf(t,e,1)&&t.isPointInStroke(n,r))})),isect:mc},hf=Lc("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),df=Lc("symbol",(function(t,e){return Vl.context(t)(e)}),pc);const pf=ft();var gf={height:bf,measureWidth:_f,estimateWidth:vf,width:vf,canvas:mf};function mf(t){gf.width=t&&fc?_f:vf}function vf(t,e){return yf(Mf(t,e),bf(t))}function yf(t,e){return~~(.8*t.length*e)}function _f(t,e){return bf(t)<=0||!(e=Mf(t,e))?0:xf(e,Df(t))}function xf(t,e){const n=`(${e}) ${t}`;let r=pf.get(n);return void 0===r&&(fc.font=e,r=fc.measureText(t).width,pf.set(n,r)),r}function bf(t){return null!=t.fontSize?+t.fontSize||0:11}function wf(t){return null!=t.lineHeight?t.lineHeight:bf(t)+2}function Af(t){return e=t.lineBreak&&t.text&&!u(t.text)?t.text.split(t.lineBreak):t.text,u(e)?e.length>1?e:e[0]:e;var e}function kf(t){const e=Af(t);return(u(e)?e.length-1:0)*wf(t)}function Mf(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(gf.width===_f){const e=Df(t);return t=>xf(t,e)}{const e=bf(t);return t=>yf(t,e)}}(t);if(r(e)<n)return e;var i,a=t.ellipsis||"…",u="rtl"===t.dir,o=0,s=e.length;if(n-=r(a),u){for(;o<s;)i=o+s>>>1,r(e.slice(i))>n?o=i+1:s=i;return a+e.slice(o)}for(;o<s;)i=1+(o+s>>>1),r(e.slice(0,i))<n?o=i:s=i-1;return e.slice(0,o)+a}(t,n):n}function Ef(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Df(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+bf(t)+"px "+Ef(t,e)}function Cf(t){var e=t.baseline,n=bf(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*wf(t):"line-bottom"===e?.29*n-.5*wf(t):0)}mf(!0);var Ff={left:"start",center:"middle",right:"end"},Sf=new Uo;function Bf(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-gl,n+=i*Math.cos(e),r+=i*Math.sin(e)),Sf.x1=n,Sf.y1=r,Sf}function zf(t,e,n){var r,i=gf.height(e),a=e.align,o=Bf(e),s=o.x1,l=o.y1,c=e.dx||0,f=(e.dy||0)+Cf(e)-Math.round(.8*i),h=Af(e);if(u(h)?(i+=wf(e)*(h.length-1),r=h.reduce((t,n)=>Math.max(t,gf.width(e,n)),0)):r=gf.width(e,h),"center"===a?c-=r/2:"right"===a&&(c-=r),t.set(c+=s,f+=l,c+r,f+i),e.angle&&!n)t.rotate(e.angle*pl,s,l);else if(2===n)return t.rotatedPoints(e.angle*pl,s,l);return t}var Tf={arc:Pc,area:jc,group:Zc,image:rf,line:af,path:of,rect:lf,rule:ff,shape:hf,symbol:df,text:{type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+Cf(e),a=Bf(e),u=a.x1,o=a.y1,s=e.angle||0;t("text-anchor",Ff[e.align]||"start"),s?(n=Oc(u,o)+" "+Rc(s),(r||i)&&(n+=" "+Oc(r,i))):n=Oc(u+r,o+i),t("transform",n)},bound:zf,draw:function(t,e,n){Dc(e,(function(e){var r,i,a,o,s,l,c,f=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===f||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Df(e),t.textAlign=e.align||"left",i=(r=Bf(e)).x1,a=r.y1,e.angle&&(t.save(),t.translate(i,a),t.rotate(e.angle*pl),i=a=0),i+=e.dx||0,a+=(e.dy||0)+Cf(e),l=Af(e),yc(t,e),u(l))for(s=wf(e),o=0;o<l.length;++o)c=Mf(e,l[o]),e.fill&&wc(t,e,f)&&t.fillText(c,i,a),e.stroke&&kc(t,e,f)&&t.strokeText(c,i,a),a+=s;else c=Mf(e,l),e.fill&&wc(t,e,f)&&t.fillText(c,i,a),e.stroke&&kc(t,e,f)&&t.strokeText(c,i,a);e.angle&&t.restore()}}))},pick:zc((function(t,e,n,r,i,a){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var u=Bf(e),o=u.x1,s=u.y1,l=zf(Sf,e,1),c=-e.angle*pl,f=Math.cos(c),h=Math.sin(c),d=f*i-h*a+(o-f*o+h*s),p=h*i+f*a+(s-h*o-f*s);return l.contains(d,p)})),isect:function(t,e){var n=zf(Sf,t,2);return vc(e,n[0],n[1],n[2],n[3])||vc(e,n[0],n[1],n[4],n[5])||vc(e,n[4],n[5],n[6],n[7])||vc(e,n[2],n[3],n[6],n[7])}},trail:$c("trail",(function(t,e){return Gl.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null}))};function Nf(t,e,n){var r=Tf[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new Uo),t,n)}var Of={mark:null};function Rf(t,e,n){var r,i,a,u,o=Tf[t.marktype],s=o.bound,l=t.items,c=l&&l.length;if(o.nested)return c?a=l[0]:(Of.mark=t,a=Of),u=Nf(a,s,n),e=e&&e.union(u)||u;if(e=e||t.bounds&&t.bounds.clear()||new Uo,c)for(r=0,i=l.length;r<i;++r)e.union(Nf(l[r],s,n));return t.bounds=e}var qf=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant"];function Uf(t,e){return JSON.stringify(t,qf,e)}function Lf(t){return function t(e){var n,r,i,a=e.marktype,u=e.items;if(u)for(r=0,i=u.length;r<i;++r)n=a?"mark":"group",u[r][n]=e,u[r].zindex&&(u[r][n].zdirty=!0),"group"===(a||n)&&t(u[r]);a&&Rf(e);return e}("string"==typeof t?JSON.parse(t):t)}function Pf(t){arguments.length?this.root=Lf(t):(this.root=jf({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Yo(this.root)])}var $f=Pf.prototype;function jf(t,e){return{bounds:new Uo,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function If(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Hf(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Wf(t,e,n,r){var i,a=t.childNodes[e];return a&&a.tagName.toLowerCase()===n.toLowerCase()||(i=a||null,a=If(t.ownerDocument,n,r),t.insertBefore(a,i)),a}function Yf(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function Vf(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Gf(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function Xf(t,e){this._active=null,this._handlers={},this._loader=t||kr(),this._tooltip=e||Jf}function Jf(t,e,n,r){t.element().setAttribute("title",r||"")}$f.toJSON=function(t){return Uf(this.root,t||0)},$f.mark=function(t,e,n){var r=jf(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r};var Zf=Xf.prototype;function Qf(t){this._el=null,this._bgcolor=null,this._loader=new Xo(t)}Zf.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Zf.element=function(){return this._el},Zf.canvas=function(){return this._el&&this._el.firstChild},Zf.origin=function(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},Zf.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Zf.on=function(){},Zf.off=function(){},Zf._handlerIndex=function(t,e,n){for(var r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},Zf.handlers=function(t){var e,n=this._handlers,r=[];if(t)r.push.apply(r,n[this.eventName(t)]);else for(e in n)r.push.apply(r,n[e]);return r},Zf.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Zf.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then((function(e){var n=new MouseEvent(t.type,t),r=If(null,"a");for(var i in e)r.setAttribute(i,e[i]);r.dispatchEvent(n)})).catch((function(){}))},Zf.handleTooltip=function(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,a,u=t&&t.mark;if(u&&(i=Tf[u.marktype]).tip){for((a=Gf(e,n))[0]-=r[0],a[1]-=r[1];t=t.mark.group;)a[0]-=t.x||0,a[1]-=t.y||0;t=i.tip(u.items,a)}return t}(e,t,this.canvas(),this._origin);var r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},Zf.getItemBoundingClientRect=function(t){if(e=this.canvas()){for(var e,n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,a=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top,o=i.width(),s=i.height();t.mark&&(t=t.mark.group);)a+=t.x||0,u+=t.y||0;return{x:a,y:u,width:o,height:s,left:a,top:u,right:a+o,bottom:u+s}}};var Kf=Qf.prototype;Kf.initialize=function(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},Kf.element=function(){return this._el},Kf.canvas=function(){return this._el&&this._el.firstChild},Kf.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},Kf.resize=function(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},Kf.dirty=function(){},Kf.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},Kf._render=function(){},Kf.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then((function(){return e})):Promise.resolve(e)},Kf._load=function(t,e){var n=this,r=n._loader[t](e);if(!n._ready){var i=n._call;n._ready=n._loader.ready().then((function(t){t&&i(),n._ready=null}))}return r},Kf.sanitizeURL=function(t){return this._load("sanitizeURL",t)},Kf.loadImage=function(t){return this._load("loadImage",t)};function th(t,e){Xf.call(this,t,e),this._down=null,this._touch=null,this._first=!0}var eh=rt(th,Xf);function nh(t,e,n){return function(r){var i=this._active,a=this.pickEvent(r);a===i||(i&&i.exit||this.fire(n,r),this._active=a,this.fire(e,r)),this.fire(t,r)}}function rh(t){return function(e){this.fire(t,e),this._active=null}}eh.initialize=function(t,e,n){var r=this._canvas=t&&Hf(t,"canvas");if(r){var i=this;this.events.forEach((function(t){r.addEventListener(t,(function(e){eh[t]?eh[t].call(i,e):i.fire(t,e)}))}))}return Xf.prototype.initialize.call(this,t,e,n)},eh.canvas=function(){return this._canvas},eh.context=function(){return this._canvas.getContext("2d")},eh.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],eh.DOMMouseScroll=function(t){this.fire("mousewheel",t)},eh.mousemove=nh("mousemove","mouseover","mouseout"),eh.dragover=nh("dragover","dragenter","dragleave"),eh.mouseout=rh("mouseout"),eh.dragleave=rh("dragleave"),eh.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},eh.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},eh.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},eh.touchmove=function(t){this.fire("touchmove",t,!0)},eh.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},eh.fire=function(t,e,n){var r,i,a=n?this._touch:this._active,u=this._handlers[t];if(e.vegaType=t,"click"===t&&a&&a.href?this.handleHref(e,a,a.href):"mousemove"!==t&&"mouseout"!==t||this.handleTooltip(e,a,"mouseout"!==t),u)for(r=0,i=u.length;r<i;++r)u[r].handler.call(this._obj,e,a)},eh.on=function(t,e){var n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(r[n]||(r[n]=[])).push({type:t,handler:e}),this},eh.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},eh.pickEvent=function(t){var e=Gf(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},eh.pick=function(t,e,n,r,i){var a=this.context();return Tf[t.marktype].pick.call(this,a,t,e,n,r,i)};var ih="undefined"!=typeof window&&window.devicePixelRatio||1;function ah(t){Qf.call(this,t),this._redraw=!1,this._dirty=new Uo}var uh=rt(ah,Qf),oh=Qf.prototype,sh=new Uo;function lh(t,e,n){return sh.set(0,0,e,n).translate(-t[0],-t[1])}function ch(t,e){Xf.call(this,t,e);var n=this;n._hrefHandler=hh(n,(function(t,e){e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=hh(n,(function(t,e){n.handleTooltip(t,e,"mouseout"!==t.type)}))}uh.initialize=function(t,e,n,r,i,a){return this._options=a,this._canvas=Vo(1,1,a&&a.type),t&&(Yf(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),oh.initialize.call(this,t,e,n,r,i)},uh.resize=function(t,e,n,r){return oh.resize.call(this,t,e,n,r),function(t,e,n,r,i,a){const u="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,o=t.getContext("2d"),s=u?ih:i;t.width=e*s,t.height=n*s;for(const t in a)o[t]=a[t];u&&1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),o.pixelRatio=s,o.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},uh.canvas=function(){return this._canvas},uh.context=function(){return this._canvas?this._canvas.getContext("2d"):null},uh.dirty=function(t){var e=function(t,e){if(null==e)return t;for(var n=sh.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}(t.bounds,t.mark.group);this._dirty.union(e)},uh._render=function(t){var e=this.context(),n=this._origin,r=this._width,i=this._height,a=this._dirty;return e.save(),this._redraw||a.empty()?(this._redraw=!1,a=lh(n,r,i).expand(1)):a=function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(lh(n,r,i)),n),this.clear(-n[0],-n[1],r,i),this.draw(e,t,a),e.restore(),this._dirty.clear(),this},uh.draw=function(t,e,n){var r=Tf[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),W(n)?(t.beginPath(),n(t),t.clip()):Ic(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},uh.clear=function(t,e,n,r){var i=this.context();i.clearRect(t,e,n,r),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(t,e,n,r))};var fh=rt(ch,Xf);function hh(t,e){return function(n){var r=n.target.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,e.call(t._obj,n,r)}}function dh(t,e,n){var r,i,a="<"+t;if(e)for(r in e)null!=(i=e[r])&&(a+=" "+r+'="'+i+'"');return n&&(a+=" "+n),a+">"}function ph(t){return"</"+t+">"}fh.initialize=function(t,e,n){var r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener("mousemove",this._tooltipHandler),r.removeEventListener("mouseout",this._tooltipHandler)),this._svg=r=t&&Hf(t,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener("mousemove",this._tooltipHandler),r.addEventListener("mouseout",this._tooltipHandler)),Xf.prototype.initialize.call(this,t,e,n)},fh.canvas=function(){return this._svg},fh.on=function(t,e){var n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){var i={type:t,handler:e,listener:hh(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},fh.off=function(t,e){var n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this};var gh={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},mh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},vh=Object.keys(mh),yh=gh.xmlns;function _h(t){Qf.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var xh=rt(_h,Qf),bh=Qf.prototype;function wh(t,e,n){var r,i,a;if("radial"===e.gradient){var u=Wf(t,n++,"pattern",yh);u.setAttribute("id","p_"+e.id),u.setAttribute("viewBox","0,0,1,1"),u.setAttribute("width","100%"),u.setAttribute("height","100%"),u.setAttribute("preserveAspectRatio","xMidYMid slice"),(u=Wf(u,0,"rect",yh)).setAttribute("width","1"),u.setAttribute("height","1"),u.setAttribute("fill","url("+Bh()+"#"+e.id+")"),(t=Wf(t,n++,"radialGradient",yh)).setAttribute("id",e.id),t.setAttribute("fx",e.x1),t.setAttribute("fy",e.y1),t.setAttribute("fr",e.r1),t.setAttribute("cx",e.x2),t.setAttribute("cy",e.y2),t.setAttribute("r",e.r2)}else(t=Wf(t,n++,"linearGradient",yh)).setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2);for(r=0,i=e.stops.length;r<i;++r)(a=Wf(t,r,"stop",yh)).setAttribute("offset",e.stops[r].offset),a.setAttribute("stop-color",e.stops[r].color);return Yf(t,r),n}function Ah(t,e,n){var r;return(t=Wf(t,n,"clipPath",yh)).setAttribute("id",e.id),e.path?(r=Wf(t,0,"path",yh)).setAttribute("d",e.path):((r=Wf(t,0,"rect",yh)).setAttribute("x",0),r.setAttribute("y",0),r.setAttribute("width",e.width),r.setAttribute("height",e.height)),Yf(t,1),n+1}function kh(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function Mh(t,e,n,r,i){var a,u=t._svg;if(!u&&(u=If(a=e.ownerDocument,r,yh),t._svg=u,t.mark&&(u.__data__=t,u.__values__={fill:"default"},"g"===r))){var o=If(a,"path",yh);u.appendChild(o),o.__data__=t;var s=If(a,"g",yh);u.appendChild(s),s.__data__=t;var l=If(a,"path",yh);u.appendChild(l),l.__data__=t,l.__values__={fill:"default"}}return(u.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(u,n))&&e.insertBefore(u,n?n.nextSibling:e.firstChild),u}xh.initialize=function(t,e,n,r){return t&&(this._svg=Wf(t,0,"svg",yh),this._svg.setAttribute("class","marks"),Yf(t,1),this._root=Wf(this._svg,0,"g",yh),Yf(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),bh.initialize.call(this,t,e,n,r)},xh.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),bh.background.apply(this,arguments)},xh.resize=function(t,e,n,r){return bh.resize.call(this,t,e,n,r),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},xh.canvas=function(){return this._svg},xh.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var e in gh)t[e]=gh[e];var n=this._bgcolor?dh("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+ph("rect"):"";return dh("svg",t)+n+this._svg.innerHTML+ph("svg")},xh._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),Yf(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},xh.updateDefs=function(){var t,e=this._svg,n=this._defs,r=n.el,i=0;for(t in n.gradient)r||(n.el=r=Wf(e,0,"defs",yh)),i=wh(r,n.gradient[t],i);for(t in n.clipping)r||(n.el=r=Wf(e,0,"defs",yh)),i=Ah(r,n.clipping[t],i);r&&(0===i?(e.removeChild(r),n.el=null):Yf(r,i))},xh._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},xh.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},xh.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},xh._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length||!this._dirtyID)return!0;var e,n,r,i,a,u,o,s=++this._dirtyID;for(a=0,u=t.length;a<u;++a)(n=(e=t[a]).mark).marktype!==r&&(r=n.marktype,i=Tf[r]),n.zdirty&&n.dirty!==s&&(this._dirtyAll=!1,kh(e,s),n.items.forEach((function(t){t.dirty=s}))),n.zdirty||(e.exit?(i.nested&&n.items.length?(o=n.items[0])._svg&&this._update(i,o._svg,o):e._svg&&(o=e._svg.parentNode)&&o.removeChild(e._svg),e._svg=null):(e=i.nested?n.items[0]:e)._update!==s&&(e._svg&&e._svg.ownerSVGElement?this._update(i,e._svg,e):(this._dirtyAll=!1,kh(e,s)),e._update=s));return!this._dirtyAll},xh.draw=function(t,e,n){if(!this.isDirty(e))return e._svg;var r,i=this,a=this._svg,u=Tf[e.marktype],o=!1===e.interactive?"none":null,s="g"===u.tag,l=null,c=0;function f(t){var e=i.isDirty(t),n=Mh(t,r,l,u.tag,a);e&&(i._update(u,n,t),s&&function(t,e,n){e=e.lastChild.previousSibling;var r,i=0;Dc(n,(function(n){r=t.draw(e,n,r),++i})),Yf(e,1+i)}(i,n,t)),l=n,++c}return(r=Mh(e,t,n,"g",a)).setAttribute("class",Vf(e)),s||r.style.setProperty("pointer-events",o),e.clip?r.setAttribute("clip-path",Wc(i,e,e.group)):r.removeAttribute("clip-path"),u.nested?e.items.length&&f(e.items[0]):Dc(e,f),Yf(r,c),r};var Eh=null,Dh=null,Ch={group:function(t,e,n){var r,i;Eh=r=e.childNodes[2],Dh=r.__values__,t.foreground(Sh,n,this),Dh=e.__values__,Eh=e.childNodes[1],t.content(Sh,n,this),Eh=i=e.childNodes[0],t.background(Sh,n,this);var a=!1===n.mark.interactive?"none":null;if(a!==Dh.events&&(r.style.setProperty("pointer-events",a),i.style.setProperty("pointer-events",a),Dh.events=a),n.strokeForeground&&n.stroke){const t=n.fill;r.style.removeProperty("display"),this.style(i,n),i.style.removeProperty("stroke"),t&&(n.fill=null),Dh=r.__values__,this.style(r,n),t&&(n.fill=t),Eh=null}else r.style.setProperty("display","none"),r.style.setProperty("fill","none")},image:function(t,e,n){!1===n.smooth?(Fh(e,"image-rendering","optimizeSpeed"),Fh(e,"image-rendering","pixelated")):Fh(e,"image-rendering",null)},text:function(t,e,n){var r,i,a,o,s=Af(n);u(s)?(r=(i=s.map(t=>Mf(n,t))).join("\n"))!==Dh.text&&(Yf(e,0),a=e.ownerDocument,o=wf(n),i.forEach((t,r)=>{const i=If(a,"tspan",yh);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",o)),e.appendChild(i)}),Dh.text=r):(i=Mf(n,s))!==Dh.text&&(e.textContent=i,Dh.text=i),Fh(e,"font-family",Ef(n)),Fh(e,"font-size",bf(n)+"px"),Fh(e,"font-style",n.fontStyle),Fh(e,"font-variant",n.fontVariant),Fh(e,"font-weight",n.fontWeight)}};function Fh(t,e,n){n!==Dh[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),Dh[e]=n)}function Sh(t,e,n){e!==Dh[t]&&(null!=e?n?Eh.setAttributeNS(n,t,e):Eh.setAttribute(t,e):n?Eh.removeAttributeNS(n,t):Eh.removeAttribute(t),Dh[t]=e)}function Bh(){var t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function zh(t){Qf.call(this,t),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}xh._update=function(t,e,n){Eh=e,Dh=e.__values__,t.attr(Sh,n,this);var r=Ch[t.type];r&&r.call(this,t,e,n),Eh&&this.style(Eh,n)},xh.style=function(t,e){var n,r,i,a,u;if(null!=e)for(n=0,r=vh.length;n<r;++n)u=e[i=vh[n]],"font"===i&&(u=Ef(e)),u!==Dh[i]&&(a=mh[i],null==u?"fill"===a?t.style.setProperty(a,"none"):t.style.removeProperty(a):($o(u)&&(u=jo(u,this._defs.gradient,Bh())),t.style.setProperty(a,u+"")),Dh[i]=u)};var Th,Nh=rt(zh,Qf),Oh=Qf.prototype;function Rh(t,e,n,r){Th[r||t]=e}function qh(t,e,n,r){if(null==t)return"";var i,a,u,o,s,l="";for("bgrect"===n&&!1===e.interactive&&(l+="pointer-events: none; "),"bgfore"===n&&(!1===e.interactive&&(l+="pointer-events: none; "),l+="display: none; "),"image"===n&&!1===t.smooth&&(l+="image-rendering: optimizeSpeed; image-rendering: pixelated; "),"text"===n&&(l+="font-family: "+Ef(t)+"; ",l+="font-size: "+bf(t)+"px; ",t.fontStyle&&(l+="font-style: "+t.fontStyle+"; "),t.fontVariant&&(l+="font-variant: "+t.fontVariant+"; "),t.fontWeight&&(l+="font-weight: "+t.fontWeight+"; ")),i=0,a=vh.length;i<a;++i)u=vh[i],o=mh[u],null==(s=t[u])?"fill"===o&&(l+="fill: none; "):"transparent"!==s||"fill"!==o&&"stroke"!==o?($o(s)&&(s=jo(s,r.gradient,"")),l+=o+": "+s+"; "):l+=o+": none; ";return l?'style="'+l.trim()+'"':null}function Uh(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}Nh.resize=function(t,e,n,r){Oh.resize.call(this,t,e,n,r);var i=this._origin,a=this._text,u={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var o in gh)u[o]=gh[o];a.head=dh("svg",u);var s=this._bgcolor;return"transparent"!==s&&"none"!==s||(s=null),a.bg=s?dh("rect",{width:this._width,height:this._height,style:"fill: "+s+";"})+ph("rect"):"",a.root=dh("g",{transform:"translate("+i+")"}),a.foot=ph("g")+ph("svg"),this},Nh.background=function(){var t=Oh.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),t},Nh.svg=function(){var t=this._text;return t.head+t.bg+t.defs+t.root+t.body+t.foot},Nh._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},Nh.buildDefs=function(){var t,e,n,r,i,a=this._defs,u="";for(e in a.gradient){for(i=(n=a.gradient[e]).stops,"radial"===n.gradient?(u+=dh(r="pattern",{id:"p_"+e,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),u+=dh("rect",{width:"1",height:"1",fill:"url(#"+e+")"})+ph("rect"),u+=ph(r),u+=dh(r="radialGradient",{id:e,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})):u+=dh(r="linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<i.length;++t)u+=dh("stop",{offset:i[t].offset,"stop-color":i[t].color})+ph("stop");u+=ph(r)}for(e in a.clipping)n=a.clipping[e],u+=dh("clipPath",{id:e}),n.path?u+=dh("path",{d:n.path})+ph("path"):u+=dh("rect",{x:0,y:0,width:n.width,height:n.height})+ph("rect"),u+=ph("clipPath");return u.length>0?dh("defs")+u+ph("defs"):""},Nh.attributes=function(t,e){return Th={},t(Rh,e,this),Th},Nh.href=function(t){var e,n=this,r=t.href;if(r){if(e=n._hrefs&&n._hrefs[r])return e;n.sanitizeURL(r).then((function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[r]=t}))}return null},Nh.mark=function(t){var e,n=this,r=Tf[t.marktype],i=r.tag,a=this._defs,o="";function s(s){var l=n.href(s);if(l&&(o+=dh("a",l)),e="g"!==i?qh(s,t,i,a):null,o+=dh(i,n.attributes(r.attr,s),e),"text"===i){const t=Af(s);if(u(t)){const e={x:0,dy:wf(s)};for(let n=0;n<t.length;++n)o+=dh("tspan",n?e:null)+Uh(Mf(s,t[n]))+ph("tspan")}else o+=Uh(Mf(s,t))}else if("g"===i){const e=s.strokeForeground,i=s.fill,u=s.stroke;e&&u&&(s.stroke=null),o+=dh("path",n.attributes(r.background,s),qh(s,t,"bgrect",a))+ph("path"),o+=dh("g",n.attributes(r.content,s))+n.markGroup(s)+ph("g"),e&&u?(i&&(s.fill=null),s.stroke=u,o+=dh("path",n.attributes(r.foreground,s),qh(s,t,"bgrect",a))+ph("path"),i&&(s.fill=i)):o+=dh("path",n.attributes(r.foreground,s),qh({},t,"bgfore",a))+ph("path")}o+=ph(i),l&&(o+=ph("a"))}return"g"!==i&&!1===t.interactive&&(e='style="pointer-events: none;"'),o+=dh("g",{class:Vf(t),"clip-path":t.clip?Wc(n,t,t.group):null},e),r.nested?t.items&&t.items.length&&s(t.items[0]):Dc(t,s),o+ph("g")},Nh.markGroup=function(t){var e=this,n="";return Dc(t,(function(t){n+=e.mark(t)})),n};var Lh={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},Ph={};function $h(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(Ph[t]=e,this):Ph[t]}function jh(t,e,n){const r=[],a=(new Uo).union(e),u=t.marktype;return u?Ih(t,a,n,r):"group"===u?Hh(t,a,n,r):i("Intersect scene must be mark node or group item.")}function Ih(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,a=t.marktype,u=i.length;let o=0;if("group"===a)for(;o<u;++o)Hh(i[o],e,n,r);else for(const t=Tf[a].isect;o<u;++o){let n=i[o];Wh(n,e,t)&&r.push(n)}}return r}function Hh(t,e,n,r){n&&n(t.mark)&&Wh(t,e,Tf.group.isect)&&r.push(t);const i=t.items,a=i&&i.length;if(a){const u=t.x||0,o=t.y||0;e.translate(-u,-o);for(let t=0;t<a;++t)Ih(i[t],e,n,r);e.translate(u,o)}return r}function Wh(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}Ph.canvas=Ph.png={renderer:ah,headless:ah,handler:th},Ph.svg={renderer:_h,headless:zh,handler:ch},Ph.none={};var Yh=new Uo;function Vh(t){var e=t.clip;if(W(e))e(nc(Yh.clear()));else{if(!e)return;Yh.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(Yh)}function Gh(t,e,n){return t===e||("path"===n?Xh(t,e):t instanceof Date&&e instanceof Date?+t==+e:ot(t)&&ot(e)?Math.abs(t-e)<=1e-9:t&&e&&(o(t)||o(e))?null!=t&&null!=e&&function(t,e){var n,r,i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(i.sort(),a.sort(),r=i.length-1;r>=0;r--)if(i[r]!=a[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!Gh(t[n],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Xh(t,e){return Gh(dl(t),dl(e))}function Jh(t){Hr.call(this,null,t)}function Zh(t,e,n){return e(t.bounds.clear(),t,n)}rt(Jh,Hr).transform=function(t,e){var n,r=e.dataflow,i=t.mark,a=i.marktype,u=Tf[a],o=u.bound,s=i.bounds;if(u.nested)i.items.length&&r.dirty(i.items[0]),s=Zh(i,o),i.items.forEach((function(t){t.bounds.clear().union(s)}));else if("group"===a||t.modified())switch(e.visit(e.MOD,(function(t){r.dirty(t)})),s.clear(),i.items.forEach((function(t){s.union(Zh(t,o))})),i.role){case"axis":case"legend":case"title":e.reflow()}else n=e.changed(e.REM),e.visit(e.ADD,(function(t){s.union(Zh(t,o))})),e.visit(e.MOD,(function(t){n=n||s.alignsWith(t.bounds),r.dirty(t),s.union(Zh(t,o))})),n&&(s.clear(),i.items.forEach((function(t){s.union(t.bounds)})));return Vh(i),e.modifies("bounds")};function Qh(t){Hr.call(this,0,t)}function Kh(t){Hr.call(this,null,t)}function td(t){Hr.call(this,null,t)}Qh.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},rt(Qh,Hr).transform=function(t,e){var n=function(t){var e=t._signals[":vega_identifier:"];e||(t._signals[":vega_identifier:"]=e=t.add(0));return e}(e.dataflow),r=n.value,i=t.as;return e.visit(e.ADD,(function(t){t[i]||(t[i]=++r)})),n.set(this.value=r),e},rt(Kh,Hr).transform=function(t,e){var n=this.value;n||((n=e.dataflow.scenegraph().mark(t.markdef,function(t){var e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index)).group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);var r="group"===n.marktype?Yo:Wo;return e.visit(e.ADD,(function(t){r.call(t,n)})),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e};var ed=rt(td,Hr),nd={parity:function(t){return t.filter((t,e)=>e%2?t.opacity=0:1)},greedy:function(t,e){var n;return t.filter((t,r)=>r&&rd(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1))}};function rd(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function id(t,e){for(var n,r=1,i=t.length,a=t[0].bounds;r<i;a=n,++r)if(rd(a,n=t[r].bounds,e))return!0}function ad(t){var e=t.bounds;return e.width()>1&&e.height()>1}function ud(t){return t.forEach(t=>t.opacity=1),t}function od(t,e){return t.reflow(e.modified()).modifies("opacity")}function sd(t){Hr.call(this,null,t)}ed.transform=function(t,e){var n,r,i,a=nd[t.method]||nd.parity,u=e.materialize(e.SOURCE).source,o=t.separation||0;if(u&&u.length){if(!t.method)return t.modified("method")&&(ud(u),e=od(e,t)),e;if(t.sort&&(u=u.slice().sort(t.sort)),n=ud(u=u.filter(ad)),e=od(e,t),n.length>=3&&id(n,o)){do{n=a(n,o)}while(n.length>=3&&id(n,o));n.length<3&&!k(u).opacity&&(n.length>1&&(k(n).opacity=0),k(u).opacity=1)}return t.boundScale&&t.boundTolerance>=0&&(r=function(t,e,n){var r=t.range(),i=new Uo;return e===To||"bottom"===e?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),t=>i.encloses(t.bounds)}(t.boundScale,t.boundOrient,+t.boundTolerance),u.forEach(t=>{r(t)||(t.opacity=0)})),i=n[0].mark.bounds.clear(),u.forEach(t=>{t.opacity&&i.union(t.bounds)}),e}},rt(sd,Hr).transform=function(t,e){var n=e.dataflow;if(e.visit(e.ALL,(function(t){n.dirty(t)})),e.fields&&e.fields.zindex){var r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}};const ld=new Uo;function cd(t,e,n){return t[e]===n?0:(t[e]=n,1)}function fd(t){var e=t.items[0].datum.orient;return e===No||e===Oo}function hd(t,e,n,r){var i,a,u=e.items[0],o=u.datum,s=o.orient,l=null!=o.translate?o.translate:.5,c=function(t){var e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(o),f=u.range,h=u.offset,d=u.position,p=u.minExtent,g=u.maxExtent,m=o.title&&u.items[c[2]].items[0],v=u.titlePadding,y=u.bounds,_=m&&kf(m),x=0,b=0;switch(ld.clear().union(y),y.clear(),(i=c[0])>-1&&y.union(u.items[i].bounds),(i=c[1])>-1&&y.union(u.items[i].bounds),s){case To:x=d||0,b=-h,a=Math.max(p,Math.min(g,-y.y1)),y.add(0,-a).add(f,0),m&&dd(t,m,a,v,_,0,-1,y);break;case No:x=-h,b=d||0,a=Math.max(p,Math.min(g,-y.x1)),y.add(-a,0).add(0,f),m&&dd(t,m,a,v,_,1,-1,y);break;case Oo:x=n+h,b=d||0,a=Math.max(p,Math.min(g,y.x2)),y.add(0,0).add(a,f),m&&dd(t,m,a,v,_,1,1,y);break;case"bottom":x=d||0,b=r+h,a=Math.max(p,Math.min(g,y.y2)),y.add(0,0).add(f,a),m&&dd(t,m,a,v,0,0,1,y);break;default:x=u.x,b=u.y}return Zl(y.translate(x,b),u),cd(u,"x",x+l)|cd(u,"y",b+l)&&(u.bounds=ld,t.dirty(u),u.bounds=y,t.dirty(u)),u.mark.bounds.clear().union(y)}function dd(t,e,n,r,i,a,u,o){const s=e.bounds;if(e.auto){const o=u*(n+i+r);let l=0,c=0;t.dirty(e),a?l=(e.x||0)-(e.x=o):c=(e.y||0)-(e.y=o),e.mark.bounds.clear().union(s.translate(-l,-c)),t.dirty(e)}o.union(s)}function pd(t){return(new Uo).set(0,0,t.width||0,t.height||0)}function gd(t){var e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function md(t,e,n){var r=o(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function vd(t){return t<0?Math.ceil(-t):0}function yd(t,e,n){var r,i,a,u,o,s,l,c,f,h,d,p=!n.nodirty,g="flush"===n.bounds?pd:gd,m=ld.set(0,0,0,0),v=md(n.align,"column"),y=md(n.align,qo),_=md(n.padding,"column"),x=md(n.padding,qo),b=n.columns||e.length,w=b<0?1:Math.ceil(e.length/b),A=e.length,k=Array(A),M=Array(b),E=0,D=Array(A),C=Array(w),F=0,S=Array(A),B=Array(A),z=Array(A);for(i=0;i<b;++i)M[i]=0;for(i=0;i<w;++i)C[i]=0;for(i=0;i<A;++i)s=e[i],o=z[i]=g(s),s.x=s.x||0,S[i]=0,s.y=s.y||0,B[i]=0,a=i%b,u=~~(i/b),E=Math.max(E,l=Math.ceil(o.x2)),F=Math.max(F,c=Math.ceil(o.y2)),M[a]=Math.max(M[a],l),C[u]=Math.max(C[u],c),k[i]=_+vd(o.x1),D[i]=x+vd(o.y1),p&&t.dirty(e[i]);for(i=0;i<A;++i)i%b==0&&(k[i]=0),i<b&&(D[i]=0);if("each"===v)for(a=1;a<b;++a){for(d=0,i=a;i<A;i+=b)d<k[i]&&(d=k[i]);for(i=a;i<A;i+=b)k[i]=d+M[a-1]}else if("all"===v){for(d=0,i=0;i<A;++i)i%b&&d<k[i]&&(d=k[i]);for(i=0;i<A;++i)i%b&&(k[i]=d+E)}else for(v=!1,a=1;a<b;++a)for(i=a;i<A;i+=b)k[i]+=M[a-1];if("each"===y)for(u=1;u<w;++u){for(d=0,r=(i=u*b)+b;i<r;++i)d<D[i]&&(d=D[i]);for(i=u*b;i<r;++i)D[i]=d+C[u-1]}else if("all"===y){for(d=0,i=b;i<A;++i)d<D[i]&&(d=D[i]);for(i=b;i<A;++i)D[i]=d+F}else for(y=!1,u=1;u<w;++u)for(r=(i=u*b)+b;i<r;++i)D[i]+=C[u-1];for(f=0,i=0;i<A;++i)f=k[i]+(i%b?f:0),S[i]+=f-e[i].x;for(a=0;a<b;++a)for(h=0,i=a;i<A;i+=b)h+=D[i],B[i]+=h-e[i].y;if(v&&md(n.center,"column")&&w>1)for(i=0;i<A;++i)(f=(o="all"===v?E:M[i%b])-z[i].x2-e[i].x-S[i])>0&&(S[i]+=f/2);if(y&&md(n.center,qo)&&1!==b)for(i=0;i<A;++i)(h=(o="all"===y?F:C[~~(i/b)])-z[i].y2-e[i].y-B[i])>0&&(B[i]+=h/2);for(i=0;i<A;++i)m.union(z[i].translate(S[i],B[i]));switch(f=md(n.anchor,"x"),h=md(n.anchor,"y"),md(n.anchor,"column")){case Ro:f-=m.width();break;case"middle":f-=m.width()/2}switch(md(n.anchor,qo)){case Ro:h-=m.height();break;case"middle":h-=m.height()/2}for(f=Math.round(f),h=Math.round(h),m.clear(),i=0;i<A;++i)e[i].mark.bounds.clear();for(i=0;i<A;++i)(s=e[i]).x+=S[i]+=f,s.y+=B[i]+=h,m.union(s.mark.bounds.union(s.bounds.translate(S[i],B[i]))),p&&t.dirty(s);return m}function _d(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function xd(t,e){return t.bounds[e]}function bd(t,e){return Math.floor(Math.min(t,e))}function wd(t,e){return Math.ceil(Math.max(t,e))}function Ad(t,e,n,r,i,a,u,o,s,l,c,f,h,d){var p,g,m,v,y,_,x,b,w,A=n.length,k=0,M=0;if(!A)return k;for(p=c;p<A;p+=f)n[p]&&(k=u(k,s(n[p],l)));if(!e.length)return k;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),k+=a,g=0,v=e.length;g<v;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=c,g=0,v=e.length;g<v;++g,p+=f){for(y=(_=e[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=h);o?(b=null==d?x.x:Math.round(x.bounds.x1+d*x.bounds.width()),w=k):(b=k,w=null==d?x.y:Math.round(x.bounds.y1+d*x.bounds.height())),y.union(_.bounds.translate(b-(_.x||0),w-(_.y||0))),_.x=b,_.y=w,t.dirty(_),M=u(M,y[l])}return M}function kd(t,e,n,r,i,a){if(e){t.dirty(e);var u=n,o=n;r?u=Math.round(i.x1+a*i.width()):o=Math.round(i.y1+a*i.height()),e.bounds.translate(u-(e.x||0),o-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=u,e.y=o,t.dirty(e)}}function Md(t,e,n,r,i,a,u){const o=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),s=function(t,e){var n=-1/0;return t.forEach(t=>{null!=t.offset&&(n=Math.max(n,t.offset))}),n>-1/0?n:e}(t,o("offset",0)),l=o("anchor","start"),c=l===Ro?1:"middle"===l?.5:0,f={align:"each",bounds:o("bounds","flush"),columns:"vertical"===o("direction")?1:t.length,padding:o("margin",8),center:o("center"),nodirty:!0};switch(e){case No:f.anchor={x:Math.floor(r.x1)-s,column:Ro,y:c*(u||r.height()+2*r.y1),row:l};break;case Oo:f.anchor={x:Math.ceil(r.x2)+s,y:c*(u||r.height()+2*r.y1),row:l};break;case To:f.anchor={y:Math.floor(i.y1)-s,row:Ro,x:c*(a||i.width()+2*i.x1),column:l};break;case"bottom":f.anchor={y:Math.ceil(i.y2)+s,x:c*(a||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:s,y:s};break;case"top-right":f.anchor={x:a-s,y:s,column:Ro};break;case"bottom-left":f.anchor={x:s,y:u-s,row:Ro};break;case"bottom-right":f.anchor={x:a-s,y:u-s,column:Ro,row:Ro}}return f}function Ed(t,e){var n,r,i,a,u=e.items[0],o=u.datum,s=u.orient,l=u.bounds,c=u.x,f=u.y;return u._bounds?u._bounds.clear().union(l):u._bounds=l.clone(),l.clear(),function(t,e,n){var r=e.padding,i=r-n.x,a=r-n.y;if(e.datum.title){var u=e.items[1].items[0],o=u.anchor,s=e.titlePadding||0,l=r-u.x,c=r-u.y;switch(u.orient){case No:i+=Math.ceil(u.bounds.width())+s;break;case Oo:case"bottom":break;default:a+=u.bounds.height()+s}switch((i||a)&&Cd(t,n,i,a),u.orient){case No:c+=Dd(e,n,u,o,1,1);break;case Oo:l+=Dd(e,n,u,Ro,0,0)+s,c+=Dd(e,n,u,o,1,1);break;case"bottom":l+=Dd(e,n,u,o,0,0),c+=Dd(e,n,u,Ro,-1,0,1)+s;break;default:l+=Dd(e,n,u,o,0,0)}(l||c)&&Cd(t,u,l,c),(l=Math.round(u.bounds.x1-r))<0&&(Cd(t,n,-l,0),Cd(t,u,-l,0))}else(i||a)&&Cd(t,n,i,a)}(t,u,u.items[0].items[0]),l=function(t,e){return t.items.forEach(t=>e.union(t.bounds)),e.x1=t.padding,e.y1=t.padding,e}(u,l),n=2*u.padding,r=2*u.padding,l.empty()||(n=Math.ceil(l.width()+n),r=Math.ceil(l.height()+r)),"symbol"===o.type&&(i=u.items[0].items[0].items[0].items,a=i.reduce((function(t,e){return t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t}),{}),i.forEach((function(t){t.width=a[t.column],t.height=t.bounds.y2-t.y}))),"none"!==s&&(u.x=c=0,u.y=f=0),u.width=n,u.height=r,Zl(l.set(c,f,c+n,f+r),u),u.mark.bounds.clear().union(l),u}function Dd(t,e,n,r,i,a,u){const o="symbol"!==t.datum.type,s=n.datum.vgrad,l=(!o||!a&&s||u?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=s&&a?l:0,f=s&&a?0:l,h=i<=0?0:kf(n);return Math.round("start"===r?c:r===Ro?f-h:.5*(l-h))}function Cd(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function Fd(t){Hr.call(this,null,t)}rt(Fd,Hr).transform=function(t,e){var n=e.dataflow;return t.mark.items.forEach((function(e){t.layout&&function(t,e,n){var r,i,a,u,o,s,l,c=function(t){for(var e,n,r=t.items,i=r.length,a=0,u={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};a<i;++a)if(n=(e=r[a]).items,"group"===e.marktype)switch(e.role){case"axis":case"legend":case"title":break;case"row-header":u.rowheaders.push(...n);break;case"row-footer":u.rowfooters.push(...n);break;case"column-header":u.colheaders.push(...n);break;case"column-footer":u.colfooters.push(...n);break;case"row-title":u.rowtitle=n[0];break;case"column-title":u.coltitle=n[0];break;default:u.marks.push(...n)}return u}(e),f=c.marks,h="flush"===n.bounds?_d:xd,d=n.offset,p=n.columns||f.length,g=p<0?1:Math.ceil(f.length/p),m=g*p;const v=yd(t,f,n);c.rowheaders&&(s=md(n.headerBand,qo,null),r=Ad(t,c.rowheaders,f,p,g,-md(d,"rowHeader"),bd,0,h,"x1",0,p,1,s)),c.colheaders&&(s=md(n.headerBand,"column",null),i=Ad(t,c.colheaders,f,p,p,-md(d,"columnHeader"),bd,1,h,"y1",0,1,p,s)),c.rowfooters&&(s=md(n.footerBand,qo,null),a=Ad(t,c.rowfooters,f,p,g,md(d,"rowFooter"),wd,0,h,"x2",p-1,p,1,s)),c.colfooters&&(s=md(n.footerBand,"column",null),u=Ad(t,c.colfooters,f,p,p,md(d,"columnFooter"),wd,1,h,"y2",m-p,1,p,s)),c.rowtitle&&(o=md(n.titleAnchor,qo),l=md(d,"rowTitle"),l=o===Ro?a+l:r-l,s=md(n.titleBand,qo,.5),kd(t,c.rowtitle,l,0,v,s)),c.coltitle&&(o=md(n.titleAnchor,"column"),l=md(d,"columnTitle"),l=o===Ro?u+l:i-l,s=md(n.titleBand,"column",.5),kd(t,c.coltitle,l,1,v,s))}(n,e,t.layout),function(t,e,n){var r,i,a,u,o,s=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),f=(new Uo).set(0,0,l,c),h=f.clone(),d=f.clone(),p=[];for(u=0,o=s.length;u<o;++u)switch((i=s[u]).role){case"axis":(fd(i)?h:d).union(hd(t,i,l,c));break;case"title":r=i;break;case"legend":p.push(Ed(t,i));break;case"frame":case"scope":case"row-header":case"row-footer":case"row-title":case"column-header":case"column-footer":case"column-title":h.union(i.bounds),d.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach(t=>{"none"!==(a=t.orient||Oo)&&(e[a]||(e[a]=[])).push(t)});for(let r in e){const i=e[r];yd(t,i,Md(i,r,n.legends,h,d,l,c))}p.forEach(e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&"fit"===n.autosize.type)switch(e.orient){case No:case Oo:f.add(r.x1,0).add(r.x2,0);break;case To:case"bottom":f.add(0,r.y1).add(0,r.y2)}else f.union(r)})}f.union(h).union(d),r&&f.union(function(t,e,n,r,i){var a,u=e.items[0],o=u.frame,s=u.orient,l=u.anchor,c=u.offset,f=u.padding,h=u.items[0].items[0],d=u.items[1]&&u.items[1].items[0],p=s===No||s===Oo?r:n,g=0,m=0,v=0,y=0,_=0;if("group"!==o?s===No?(g=i.y2,p=i.y1):s===Oo?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):s===No&&(g=r,p=0),a="start"===l?g:l===Ro?p:(g+p)/2,d&&d.text){switch(s){case To:case"bottom":_=h.bounds.height()+f;break;case No:y=h.bounds.width()+f;break;case Oo:y=-h.bounds.width()-f}ld.clear().union(d.bounds),ld.translate(y-(d.x||0),_-(d.y||0)),cd(d,"x",y)|cd(d,"y",_)&&(t.dirty(d),d.bounds.clear().union(ld),d.mark.bounds.clear().union(ld),t.dirty(d)),ld.clear().union(d.bounds)}else ld.clear();switch(ld.union(h.bounds),s){case To:m=a,v=i.y1-ld.height()-c;break;case No:m=i.x1-ld.width()-c,v=a;break;case Oo:m=i.x2+ld.width()+c,v=a;break;case"bottom":m=a,v=i.y2+c;break;default:m=u.x,v=u.y}return cd(u,"x",m)|cd(u,"y",v)&&(ld.translate(m,v),t.dirty(u),u.bounds.clear().union(ld),e.bounds.clear().union(ld),t.dirty(u)),u.bounds}(t,r,l,c,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},a=i.type;if(t._autosize<1||!a)return;let u=t._width,o=t._height,s=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,Math.ceil(n.x2-s)),f=Math.max(0,e.height||0),h=Math.max(0,Math.ceil(-n.y1)),d=Math.max(0,Math.ceil(n.y2-f));if("padding"===i.contains){const e=t.padding();u-=e.left+e.right,o-=e.top+e.bottom}"none"===a?(l=0,h=0,s=u,f=o):"fit"===a?(s=Math.max(0,u-l-c),f=Math.max(0,o-h-d)):"fit-x"===a?(s=Math.max(0,u-l-c),o=f+h+d):"fit-y"===a?(u=s+l+c,f=Math.max(0,o-h-d)):"pad"===a&&(u=s+l+c,o=f+h+d);t._resizeView(u,o,s,f,[l,h],i.resize)}(t,e,f,n)}(n,e,t)})),t.modified()&&e.reflow(),e};var Sd=Object.freeze({__proto__:null,bound:Jh,identifier:Qh,mark:Kh,overlap:td,render:sd,viewlayout:Fd});function Bd(t,e,n){var r=t-e+2*n;return t?r>0?r:1:0}const zd="log",Td="utc",Nd="continuous";function Od(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Rd(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const qd=Symbol("implicit");function Ud(){var t=new Map,e=[],n=[],r=qd;function i(i){var a=i+"",u=t.get(a);if(!u){if(r!==qd)return r;t.set(a,u=e.push(i))}return n[(u-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Ud(e,n).unknown(r)},Od.apply(i,arguments),i}function Ld(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Pd(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function $d(){}var jd="\\s*([+-]?\\d+)\\s*",Id="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hd="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wd=/^#([0-9a-f]{3,8})$/,Yd=new RegExp("^rgb\\("+[jd,jd,jd]+"\\)$"),Vd=new RegExp("^rgb\\("+[Hd,Hd,Hd]+"\\)$"),Gd=new RegExp("^rgba\\("+[jd,jd,jd,Id]+"\\)$"),Xd=new RegExp("^rgba\\("+[Hd,Hd,Hd,Id]+"\\)$"),Jd=new RegExp("^hsl\\("+[Id,Hd,Hd]+"\\)$"),Zd=new RegExp("^hsla\\("+[Id,Hd,Hd,Id]+"\\)$"),Qd={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 Kd(){return this.rgb().formatHex()}function tp(){return this.rgb().formatRgb()}function ep(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Wd.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?np(e):3===n?new up(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new up(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new up(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Yd.exec(t))?new up(e[1],e[2],e[3],1):(e=Vd.exec(t))?new up(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Gd.exec(t))?rp(e[1],e[2],e[3],e[4]):(e=Xd.exec(t))?rp(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Jd.exec(t))?cp(e[1],e[2]/100,e[3]/100,1):(e=Zd.exec(t))?cp(e[1],e[2]/100,e[3]/100,e[4]):Qd.hasOwnProperty(t)?np(Qd[t]):"transparent"===t?new up(NaN,NaN,NaN,0):null}function np(t){return new up(t>>16&255,t>>8&255,255&t,1)}function rp(t,e,n,r){return r<=0&&(t=e=n=NaN),new up(t,e,n,r)}function ip(t){return t instanceof $d||(t=ep(t)),t?new up((t=t.rgb()).r,t.g,t.b,t.opacity):new up}function ap(t,e,n,r){return 1===arguments.length?ip(t):new up(t,e,n,null==r?1:r)}function up(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function op(){return"#"+lp(this.r)+lp(this.g)+lp(this.b)}function sp(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function lp(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function cp(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new dp(t,e,n,r)}function fp(t){if(t instanceof dp)return new dp(t.h,t.s,t.l,t.opacity);if(t instanceof $d||(t=ep(t)),!t)return new dp;if(t instanceof dp)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),u=NaN,o=a-i,s=(a+i)/2;return o?(u=e===a?(n-r)/o+6*(n<r):n===a?(r-e)/o+2:(e-n)/o+4,o/=s<.5?a+i:2-a-i,u*=60):o=s>0&&s<1?0:u,new dp(u,o,s,t.opacity)}function hp(t,e,n,r){return 1===arguments.length?fp(t):new dp(t,e,n,null==r?1:r)}function dp(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function pp(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Ld($d,ep,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Kd,formatHex:Kd,formatHsl:function(){return fp(this).formatHsl()},formatRgb:tp,toString:tp}),Ld(up,ap,Pd($d,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new up(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new up(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:op,formatHex:op,formatRgb:sp,toString:sp})),Ld(dp,hp,Pd($d,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dp(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dp(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,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new up(pp(t>=240?t-240:t+120,i,r),pp(t,i,r),pp(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var gp=Math.PI/180,mp=180/Math.PI,vp=6/29*3*(6/29);function yp(t){if(t instanceof xp)return new xp(t.l,t.a,t.b,t.opacity);if(t instanceof Dp)return Cp(t);t instanceof up||(t=ip(t));var e,n,r=kp(t.r),i=kp(t.g),a=kp(t.b),u=bp((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=u:(e=bp((.4360747*r+.3850649*i+.1430804*a)/.96422),n=bp((.0139322*r+.0971045*i+.7141733*a)/.82521)),new xp(116*u-16,500*(e-u),200*(u-n),t.opacity)}function _p(t,e,n,r){return 1===arguments.length?yp(t):new xp(t,e,n,null==r?1:r)}function xp(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function bp(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/vp+4/29}function wp(t){return t>6/29?t*t*t:vp*(t-4/29)}function Ap(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function kp(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mp(t){if(t instanceof Dp)return new Dp(t.h,t.c,t.l,t.opacity);if(t instanceof xp||(t=yp(t)),0===t.a&&0===t.b)return new Dp(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*mp;return new Dp(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Ep(t,e,n,r){return 1===arguments.length?Mp(t):new Dp(t,e,n,null==r?1:r)}function Dp(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Cp(t){if(isNaN(t.h))return new xp(t.l,0,0,t.opacity);var e=t.h*gp;return new xp(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Ld(xp,_p,Pd($d,{brighter:function(t){return new xp(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new xp(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,n=isNaN(this.b)?t:t-this.b/200;return new up(Ap(3.1338561*(e=.96422*wp(e))-1.6168667*(t=1*wp(t))-.4906146*(n=.82521*wp(n))),Ap(-.9787684*e+1.9161415*t+.033454*n),Ap(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Ld(Dp,Ep,Pd($d,{brighter:function(t){return new Dp(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Dp(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Cp(this).rgb()}}));var Fp=-.14861,Sp=1.78277,Bp=-.90649,zp=1.97294,Tp=zp*Bp,Np=zp*Sp,Op=-.29227*Sp-Bp*Fp;function Rp(t){if(t instanceof Up)return new Up(t.h,t.s,t.l,t.opacity);t instanceof up||(t=ip(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Op*r+Tp*e-Np*n)/(Op+Tp-Np),a=r-i,u=(zp*(n-i)- -.29227*a)/Bp,o=Math.sqrt(u*u+a*a)/(zp*i*(1-i)),s=o?Math.atan2(u,a)*mp-120:NaN;return new Up(s<0?s+360:s,o,i,t.opacity)}function qp(t,e,n,r){return 1===arguments.length?Rp(t):new Up(t,e,n,null==r?1:r)}function Up(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Lp(t,e,n,r,i){var a=t*t,u=a*t;return((1-3*t+3*a-u)*e+(4-6*a+3*u)*n+(1+3*t+3*a-3*u)*r+u*i)/6}function Pp(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],u=r>0?t[r-1]:2*i-a,o=r<e-1?t[r+2]:2*a-i;return Lp((n-r/e)*e,u,i,a,o)}}function $p(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],u=t[(r+1)%e],o=t[(r+2)%e];return Lp((n-r/e)*e,i,a,u,o)}}function jp(t){return function(){return t}}function Ip(t,e){return function(n){return t+n*e}}function Hp(t,e){var n=e-t;return n?Ip(t,n>180||n<-180?n-360*Math.round(n/360):n):jp(isNaN(t)?e:t)}function Wp(t){return 1==(t=+t)?Yp:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):jp(isNaN(e)?n:e)}}function Yp(t,e){var n=e-t;return n?Ip(t,n):jp(isNaN(t)?e:t)}Ld(Up,qp,Pd($d,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Up(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Up(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*gp,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new up(255*(e+n*(Fp*r+Sp*i)),255*(e+n*(-.29227*r+Bp*i)),255*(e+n*(zp*r)),this.opacity)}}));var Vp=function t(e){var n=Wp(e);function r(t,e){var r=n((t=ap(t)).r,(e=ap(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),u=Yp(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=u(e),t+""}}return r.gamma=t,r}(1);function Gp(t){return function(e){var n,r,i=e.length,a=new Array(i),u=new Array(i),o=new Array(i);for(n=0;n<i;++n)r=ap(e[n]),a[n]=r.r||0,u[n]=r.g||0,o[n]=r.b||0;return a=t(a),u=t(u),o=t(o),r.opacity=1,function(t){return r.r=a(t),r.g=u(t),r.b=o(t),r+""}}}var Xp=Gp(Pp),Jp=Gp($p);function Zp(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Qp(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kp(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),u=new Array(r);for(n=0;n<i;++n)a[n]=ug(t[n],e[n]);for(;n<r;++n)u[n]=e[n];return function(t){for(n=0;n<i;++n)u[n]=a[n](t);return u}}function tg(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function eg(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ng(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=ug(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var rg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ig=new RegExp(rg.source,"g");function ag(t,e){var n,r,i,a=rg.lastIndex=ig.lastIndex=0,u=-1,o=[],s=[];for(t+="",e+="";(n=rg.exec(t))&&(r=ig.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),o[u]?o[u]+=i:o[++u]=i),(n=n[0])===(r=r[0])?o[u]?o[u]+=r:o[++u]=r:(o[++u]=null,s.push({i:u,x:eg(n,r)})),a=ig.lastIndex;return a<e.length&&(i=e.slice(a),o[u]?o[u]+=i:o[++u]=i),o.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)o[(n=s[r]).i]=n.x(t);return o.join("")})}function ug(t,e){var n,r=typeof e;return null==e||"boolean"===r?jp(e):("number"===r?eg:"string"===r?(n=ep(e))?(e=n,Vp):ag:e instanceof ep?Vp:e instanceof Date?tg:Qp(e)?Zp:Array.isArray(e)?Kp:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?ng:eg)(t,e)}function og(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var sg,lg,cg,fg,hg=180/Math.PI,dg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pg(t,e,n,r,i,a){var u,o,s;return(u=Math.sqrt(t*t+e*e))&&(t/=u,e/=u),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,s/=o),t*r<e*n&&(t=-t,e=-e,s=-s,u=-u),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*hg,skewX:Math.atan(s)*hg,scaleX:u,scaleY:o}}function gg(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,u){var o=[],s=[];return a=t(a),u=t(u),function(t,r,i,a,u,o){if(t!==i||r!==a){var s=u.push("translate(",null,e,null,n);o.push({i:s-4,x:eg(t,i)},{i:s-2,x:eg(r,a)})}else(i||a)&&u.push("translate("+i+e+a+n)}(a.translateX,a.translateY,u.translateX,u.translateY,o,s),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:eg(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,u.rotate,o,s),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:eg(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,u.skewX,o,s),function(t,e,n,r,a,u){if(t!==n||e!==r){var o=a.push(i(a)+"scale(",null,",",null,")");u.push({i:o-4,x:eg(t,n)},{i:o-2,x:eg(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,u.scaleX,u.scaleY,o,s),a=u=null,function(t){for(var e,n=-1,r=s.length;++n<r;)o[(e=s[n]).i]=e.x(t);return o.join("")}}}var mg=gg((function(t){return"none"===t?dg:(sg||(sg=document.createElement("DIV"),lg=document.documentElement,cg=document.defaultView),sg.style.transform=t,t=cg.getComputedStyle(lg.appendChild(sg),null).getPropertyValue("transform"),lg.removeChild(sg),pg(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),vg=gg((function(t){return null==t?dg:(fg||(fg=document.createElementNS("http://www.w3.org/2000/svg","g")),fg.setAttribute("transform",t),(t=fg.transform.baseVal.consolidate())?pg((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):dg)}),", ",")",")"),yg=Math.SQRT2;function _g(t){return((t=Math.exp(t))+1/t)/2}function xg(t){return function(e,n){var r=t((e=hp(e)).h,(n=hp(n)).h),i=Yp(e.s,n.s),a=Yp(e.l,n.l),u=Yp(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=u(t),e+""}}}var bg=xg(Hp),wg=xg(Yp);function Ag(t){return function(e,n){var r=t((e=Ep(e)).h,(n=Ep(n)).h),i=Yp(e.c,n.c),a=Yp(e.l,n.l),u=Yp(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=u(t),e+""}}}var kg=Ag(Hp),Mg=Ag(Yp);function Eg(t){return function e(n){function r(e,r){var i=t((e=qp(e)).h,(r=qp(r)).h),a=Yp(e.s,r.s),u=Yp(e.l,r.l),o=Yp(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=u(Math.pow(t,n)),e.opacity=o(t),e+""}}return n=+n,r.gamma=e,r}(1)}var Dg=Eg(Hp),Cg=Eg(Yp);function Fg(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return a[e](t-e)}}var Sg=Object.freeze({__proto__:null,interpolate:ug,interpolateArray:function(t,e){return(Qp(e)?Zp:Kp)(t,e)},interpolateBasis:Pp,interpolateBasisClosed:$p,interpolateDate:tg,interpolateDiscrete:function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},interpolateHue:function(t,e){var n=Hp(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},interpolateNumber:eg,interpolateNumberArray:Zp,interpolateObject:ng,interpolateRound:og,interpolateString:ag,interpolateTransformCss:mg,interpolateTransformSvg:vg,interpolateZoom:function(t,e){var n,r,i=t[0],a=t[1],u=t[2],o=e[0],s=e[1],l=e[2],c=o-i,f=s-a,h=c*c+f*f;if(h<1e-12)r=Math.log(l/u)/yg,n=function(t){return[i+t*c,a+t*f,u*Math.exp(yg*t*r)]};else{var d=Math.sqrt(h),p=(l*l-u*u+4*h)/(2*u*2*d),g=(l*l-u*u-4*h)/(2*l*2*d),m=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/yg,n=function(t){var e=t*r,n=_g(m),o=u/(2*d)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(yg*e+m)-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[i+o*c,a+o*f,u*n/_g(yg*e+m)]}}return n.duration=1e3*r,n},interpolateRgb:Vp,interpolateRgbBasis:Xp,interpolateRgbBasisClosed:Jp,interpolateHsl:bg,interpolateHslLong:wg,interpolateLab:function(t,e){var n=Yp((t=_p(t)).l,(e=_p(e)).l),r=Yp(t.a,e.a),i=Yp(t.b,e.b),a=Yp(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}},interpolateHcl:kg,interpolateHclLong:Mg,interpolateCubehelix:Dg,interpolateCubehelixLong:Cg,piecewise:Fg,quantize:function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}});function Bg(t){return+t}var zg=[0,1];function Tg(t){return t}function Ng(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Og(t,e,n){var r=t[0],i=t[1],a=e[0],u=e[1];return i<r?(r=Ng(i,r),a=n(u,a)):(r=Ng(r,i),a=n(a,u)),function(t){return a(r(t))}}function Rg(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),u=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++u<r;)i[u]=Ng(t[u],t[u+1]),a[u]=n(e[u],e[u+1]);return function(e){var n=oi(t,e,1,r)-1;return a[n](i[n](e))}}function qg(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ug(){var t,e,n,r,i,a,u=zg,o=zg,s=ug,l=Tg;function c(){var t=Math.min(u.length,o.length);return l!==Tg&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(u[0],u[t-1])),r=t>2?Rg:Og,i=a=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(u.map(t),o,s)))(t(l(e)))}return f.invert=function(n){return l(e((a||(a=r(o,u.map(t),eg)))(n)))},f.domain=function(t){return arguments.length?(u=Array.from(t,Bg),c()):u.slice()},f.range=function(t){return arguments.length?(o=Array.from(t),c()):o.slice()},f.rangeRound=function(t){return o=Array.from(t),s=og,c()},f.clamp=function(t){return arguments.length?(l=!!t||Tg,c()):l!==Tg},f.interpolate=function(t){return arguments.length?(s=t,c()):s},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function Lg(){return Ug()(Tg,Tg)}function Pg(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function $g(t){return(t=Pg(Math.abs(t)))?t[1]:NaN}var jg,Ig=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hg(t){if(!(e=Ig.exec(t)))throw new Error("invalid format: "+t);var e;return new Wg({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Wg(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Yg(t,e){var n=Pg(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Hg.prototype=Wg.prototype,Wg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Vg={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Yg(100*t,e)},r:Yg,s:function(t,e){var n=Pg(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(jg=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return a===u?r:a>u?r+new Array(a-u+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Pg(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Gg(t){return t}var Xg,Jg,Zg,Qg=Array.prototype.map,Kg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tm(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Gg:(e=Qg.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],u=0,o=e[0],s=0;i>0&&o>0&&(s+o+1>r&&(o=Math.max(1,r-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>r));)o=e[u=(u+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",u=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Gg:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Qg.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Hg(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Vg[y]||(void 0===m&&(m=12),v=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===h?a:/[%p]/.test(y)?s:"",b=Vg[y],w=/[defgprs%]/.test(y);function A(t){var i,a,s,h=_,A=x;if("c"===y)A=b(t)+A,t="";else{var k=(t=+t)<0;if(t=isNaN(t)?c:b(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),k&&0==+t&&(k=!1),h=(k?"("===f?f:l:"-"===f||"("===f?"":f)+h,A=("s"===y?Kg[8+jg/3]:"")+A+(k&&"("===f?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(s=t.charCodeAt(i))||s>57){A=(46===s?u+t.slice(i+1):t.slice(i))+A,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var M=h.length+t.length+A.length,E=M<p?new Array(p-M+1).join(e):"";switch(g&&d&&(t=r(E+t,E.length?p-A.length:1/0),E=""),n){case"<":t=h+t+A+E;break;case"=":t=h+E+t+A;break;case"^":t=E.slice(0,M=E.length>>1)+h+t+A+E.slice(M);break;default:t=E+h+t+A}return o(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),A.toString=function(){return t+""},A}return{format:f,formatPrefix:function(t,e){var n=f(((t=Hg(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor($g(e)/3))),i=Math.pow(10,-r),a=Kg[8+r/3];return function(t){return n(i*t)+a}}}}function em(t){return Xg=tm(t),Jg=Xg.format,Zg=Xg.formatPrefix,Xg}function nm(t,e,n,r){var i,a=gi(t,e,n);switch((r=Hg(null==r?",f":r)).type){case"s":var u=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor($g(e)/3)))-$g(Math.abs(t)))}(a,u))||(r.precision=i),Zg(r,u);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$g(e)-$g(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-$g(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Jg(r)}function rm(t){var e=t.domain;return t.ticks=function(t){var n=e();return di(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return nm(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,u=i.length-1,o=i[a],s=i[u];return s<o&&(r=o,o=s,s=r,r=a,a=u,u=r),(r=pi(o,s,n))>0?r=pi(o=Math.floor(o/r)*r,s=Math.ceil(s/r)*r,n):r<0&&(r=pi(o=Math.ceil(o*r)/r,s=Math.floor(s*r)/r,n)),r>0?(i[a]=Math.floor(o/r)*r,i[u]=Math.ceil(s/r)*r,e(i)):r<0&&(i[a]=Math.ceil(o*r)/r,i[u]=Math.floor(s*r)/r,e(i)),t},t}function im(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],u=t[i];return u<a&&(n=r,r=i,i=n,n=a,a=u,u=n),t[r]=e.floor(a),t[i]=e.ceil(u),t}function am(t){return Math.log(t)}function um(t){return Math.exp(t)}function om(t){return-Math.log(-t)}function sm(t){return-Math.exp(-t)}function lm(t){return isFinite(t)?+("1e"+t):t<0?0:t}function cm(t){return function(e){return-t(-e)}}function fm(t){var e,n,r=t(am,um),i=r.domain,a=10;function u(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(a),n=function(t){return 10===t?lm:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(a),i()[0]<0?(e=cm(e),n=cm(n),t(om,sm)):t(am,um),r}return r.base=function(t){return arguments.length?(a=+t,u()):a},r.domain=function(t){return arguments.length?(i(t),u()):i()},r.ticks=function(t){var r,u=i(),o=u[0],s=u[u.length-1];(r=s<o)&&(h=o,o=s,s=h);var l,c,f,h=e(o),d=e(s),p=null==t?10:+t,g=[];if(!(a%1)&&d-h<p){if(h=Math.floor(h),d=Math.ceil(d),o>0){for(;h<=d;++h)for(c=1,l=n(h);c<a;++c)if(!((f=l*c)<o)){if(f>s)break;g.push(f)}}else for(;h<=d;++h)for(c=a-1,l=n(h);c>=1;--c)if(!((f=l*c)<o)){if(f>s)break;g.push(f)}2*g.length<p&&(g=di(o,s,p))}else g=di(h,d,Math.min(d-h,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Jg(i)),t===1/0)return i;null==t&&(t=10);var u=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a<a-.5&&(r*=a),r<=u?i(t):""}},r.nice=function(){return i(im(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function hm(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function dm(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function pm(t){var e=1,n=t(hm(e),dm(e));return n.constant=function(n){return arguments.length?t(hm(e=+n),dm(e)):e},rm(n)}function gm(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function mm(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function vm(t){return t<0?-t*t:t*t}function ym(t){var e=t(Tg,Tg),n=1;function r(){return 1===n?t(Tg,Tg):.5===n?t(mm,vm):t(gm(n),gm(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},rm(e)}function _m(){var t=ym(Ug());return t.copy=function(){return qg(t,_m()).exponent(t.exponent())},Od.apply(t,arguments),t}em({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function xm(t){return new Date(t)}function bm(t){return t instanceof Date?+t:+new Date(+t)}function wm(t,e,n,r,i,a,u,o,s){var l=Lg(),c=l.invert,f=l.domain,h=s(".%L"),d=s(":%S"),p=s("%I:%M"),g=s("%I %p"),m=s("%a %d"),v=s("%b %d"),y=s("%B"),_=s("%Y"),x=[[u,1,1e3],[u,5,5e3],[u,15,15e3],[u,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function b(o){return(u(o)<o?h:a(o)<o?d:i(o)<o?p:r(o)<o?g:e(o)<o?n(o)<o?m:v:t(o)<o?y:_)(o)}function w(e,n,r){if(null==e&&(e=10),"number"==typeof e){var i,a=Math.abs(r-n)/e,u=ai((function(t){return t[2]})).right(x,a);return u===x.length?(i=gi(n/31536e6,r/31536e6,e),e=t):u?(i=(u=x[a/x[u-1][2]<x[u][2]/a?u-1:u])[1],e=u[0]):(i=Math.max(gi(n,r,e),1),e=o),e.every(i)}return e}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?f(Array.from(t,bm)):f().map(xm)},l.ticks=function(t){var e,n=f(),r=n[0],i=n[n.length-1],a=i<r;return a&&(e=r,r=i,i=e),e=(e=w(t,r,i))?e.range(r,i+1):[],a?e.reverse():e},l.tickFormat=function(t,e){return null==e?b:s(e)},l.nice=function(t){var e=f();return(t=w(t,e[0],e[e.length-1]))?f(im(e,t)):l},l.copy=function(){return qg(l,wm(t,e,n,r,i,a,u,o,s))},l}function Am(){var t,e,n,r,i,a=0,u=1,o=Tg,s=!1;function l(e){return isNaN(e=+e)?i:o(0===n?.5:(e=(r(e)-t)*n,s?Math.max(0,Math.min(1,e)):e))}function c(t){return function(e){var n,r;return arguments.length?([n,r]=e,o=t(n,r),l):[o(0),o(1)]}}return l.domain=function(i){return arguments.length?([a,u]=i,t=r(a=+a),e=r(u=+u),n=t===e?0:1/(e-t),l):[a,u]},l.clamp=function(t){return arguments.length?(s=!!t,l):s},l.interpolator=function(t){return arguments.length?(o=t,l):o},l.range=c(ug),l.rangeRound=c(og),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(a),e=i(u),n=t===e?0:1/(e-t),l}}function km(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Mm(){var t=rm(Am()(Tg));return t.copy=function(){return km(t,Mm())},Rd.apply(t,arguments)}function Em(){var t=ym(Am());return t.copy=function(){return km(t,Em()).exponent(t.exponent())},Rd.apply(t,arguments)}function Dm(){var t,e,n,r,i,a,u,o=0,s=.5,l=1,c=1,f=Tg,h=!1;function d(t){return isNaN(t=+t)?u:(t=.5+((t=+a(t))-e)*(c*t<c*e?r:i),f(h?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=Fg(t,[n,r,i]),d):[f(0),f(.5),f(1)]}}return d.domain=function(u){return arguments.length?([o,s,l]=u,t=a(o=+o),e=a(s=+s),n=a(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d):[o,s,l]},d.clamp=function(t){return arguments.length?(h=!!t,d):h},d.interpolator=function(t){return arguments.length?(f=t,d):f},d.range=p(ug),d.rangeRound=p(og),d.unknown=function(t){return arguments.length?(u=t,d):u},function(u){return a=u,t=u(o),e=u(s),n=u(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d}}function Cm(){var t=ym(Dm());return t.copy=function(){return km(t,Cm()).exponent(t.exponent())},Rd.apply(t,arguments)}function Fm(){var t,e,n=Ud().unknown(void 0),r=n.domain,i=n.range,a=[0,1],u=!1,o=0,s=0,l=.5;function c(){var n=r().length,c=a[1]<a[0],f=a[c-0],h=a[1-c],d=Bd(n,o,s);t=(h-f)/(d||1),u&&(t=Math.floor(t)),f+=(h-f-t*(n-o))*l,e=t*(1-o),u&&(f=Math.round(f),e=Math.round(e));var p=li(n).map((function(e){return f+t*e}));return i(c?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),c()):r()},n.range=function(t){return arguments.length?(a=[+t[0],+t[1]],c()):a.slice()},n.rangeRound=function(t){return a=[+t[0],+t[1]],u=!0,c()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(u=!!t,c()):u},n.padding=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),o=s,c()):o},n.paddingInner=function(t){return arguments.length?(o=Math.max(0,Math.min(1,t)),c()):o},n.paddingOuter=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},n.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},n.invertRange=function(t){if(null!=t[0]&&null!=t[1]){var n,u,o,s=+t[0],l=+t[1],c=a[1]<a[0],f=c?i().reverse():i(),h=f.length-1;if(s==s&&l==l&&(l<s&&(o=s,s=l,l=o),!(l<f[0]||s>a[1-c])))return n=Math.max(0,oi(f,s)-1),u=s===l?n:oi(f,l)-1,s-f[n]>e+1e-10&&++n,c&&(o=n,n=h-u,u=h-o),n>u?void 0:r().slice(n,u+1)}},n.invert=function(t){var e=n.invertRange([t,t]);return e?e[0]:e},n.copy=function(){return Fm().domain(r()).range(a).round(u).paddingInner(o).paddingOuter(s).align(l)},c()}var Sm=Array.prototype.map;function Bm(t){return Sm.call(t,(function(t){return+t}))}var zm=Array.prototype.slice;const Tm={};function Nm(t,e,n){const r=function(){var n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){var n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){var n,r,i,a,u=t.range(),o=e[0],s=e[1],l=-1;for(s<o&&(r=o,o=s,s=r),i=0,a=u.length;i<a;++i)u[i]>=o&&u[i]<=s&&(l<0&&(l=i),n=i);if(!(l<0))return o=t.invertExtent(u[l]),s=t.invertExtent(u[n]),[void 0===o[0]?o[1]:o[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=t,n};return r.metadata=xt(I(n)),r}function Om(t,e,n){return arguments.length>1?(Tm[t]=Nm(t,e,n),this):Rm(t)?Tm[t]:void 0}function Rm(t){return K(Tm,t)}function qm(t,e){const n=Tm[t];return n&&n.metadata[e]}function Um(t){return qm(t,Nd)}function Lm(t){return qm(t,"discrete")}function Pm(t){return qm(t,"discretizing")}function $m(t){return qm(t,zd)}function jm(t){return qm(t,"interpolating")}function Im(t){return qm(t,"quantile")}Om("identity",(function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Bg),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,Bg):[0,1],rm(r)})),Om("linear",(function t(){var e=Lg();return e.copy=function(){return qg(e,t())},Od.apply(e,arguments),rm(e)}),Nd),Om(zd,(function t(){var e=fm(Ug()).domain([1,10]);return e.copy=function(){return qg(e,t()).base(e.base())},Od.apply(e,arguments),e}),[Nd,zd]),Om("pow",_m,Nd),Om("sqrt",(function(){return _m.apply(null,arguments).exponent(.5)}),Nd),Om("symlog",(function t(){var e=pm(Ug());return e.copy=function(){return qg(e,t()).constant(e.constant())},Od.apply(e,arguments)}),Nd),Om("time",(function(){return Od.apply(wm(Ye,We,je,Pe,Le,Ue,qe,Re,on).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Nd,"temporal"]),Om(Td,(function(){return Od.apply(wm(en,tn,Ze,Xe,Ge,Ve,qe,Re,ln).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Nd,"temporal"]),Om("sequential",Mm,[Nd,"interpolating"]),Om("sequential-linear",Mm,[Nd,"interpolating"]),Om("sequential-log",(function t(){var e=fm(Am()).domain([1,10]);return e.copy=function(){return km(e,t()).base(e.base())},Rd.apply(e,arguments)}),[Nd,"interpolating",zd]),Om("sequential-pow",Em,[Nd,"interpolating"]),Om("sequential-sqrt",(function(){return Em.apply(null,arguments).exponent(.5)}),[Nd,"interpolating"]),Om("sequential-symlog",(function t(){var e=pm(Am());return e.copy=function(){return km(e,t()).constant(e.constant())},Rd.apply(e,arguments)}),[Nd,"interpolating"]),Om("diverging-linear",(function t(){var e=rm(Dm()(Tg));return e.copy=function(){return km(e,t())},Rd.apply(e,arguments)}),[Nd,"interpolating"]),Om("diverging-log",(function t(){var e=fm(Dm()).domain([.1,1,10]);return e.copy=function(){return km(e,t()).base(e.base())},Rd.apply(e,arguments)}),[Nd,"interpolating",zd]),Om("diverging-pow",Cm,[Nd,"interpolating"]),Om("diverging-sqrt",(function(){return Cm.apply(null,arguments).exponent(.5)}),[Nd,"interpolating"]),Om("diverging-symlog",(function t(){var e=pm(Dm());return e.copy=function(){return km(e,t()).constant(e.constant())},Rd.apply(e,arguments)}),[Nd,"interpolating"]),Om("quantile",(function t(){var e,n=[],r=[],i=[];function a(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=xi(n,t/e);return u}function u(t){return isNaN(t=+t)?e:r[oi(i,t)]}return u.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},u.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(ii),a()},u.range=function(t){return arguments.length?(r=Array.from(t),a()):r.slice()},u.unknown=function(t){return arguments.length?(e=t,u):e},u.quantiles=function(){return i.slice()},u.copy=function(){return t().domain(n).range(r).unknown(e)},Od.apply(u,arguments)}),["discretizing","quantile"]),Om("quantize",(function t(){var e,n=0,r=1,i=1,a=[.5],u=[0,1];function o(t){return t<=t?u[oi(a,t,0,i)]:e}function s(){var t=-1;for(a=new Array(i);++t<i;)a[t]=((t+1)*r-(t-i)*n)/(i+1);return o}return o.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,s()):[n,r]},o.range=function(t){return arguments.length?(i=(u=Array.from(t)).length-1,s()):u.slice()},o.invertExtent=function(t){var e=u.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,a[0]]:e>=i?[a[i-1],r]:[a[e-1],a[e]]},o.unknown=function(t){return arguments.length?(e=t,o):o},o.thresholds=function(){return a.slice()},o.copy=function(){return t().domain([n,r]).range(u).unknown(e)},Od.apply(rm(o),arguments)}),"discretizing"),Om("threshold",(function t(){var e,n=[.5],r=[0,1],i=1;function a(t){return t<=t?r[oi(n,t,0,i)]:e}return a.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),a):n.slice()},a.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),a):r.slice()},a.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},a.unknown=function(t){return arguments.length?(e=t,a):e},a.copy=function(){return t().domain(n).range(r).unknown(e)},Od.apply(a,arguments)}),"discretizing"),Om("bin-ordinal",(function t(){var e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(oi(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=Bm(t),r):e.slice()},r.range=function(t){return arguments.length?(n=zm.call(t),r):n.slice()},r.tickFormat=function(t,n){return nm(e[0],k(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),["discrete","discretizing"]),Om("ordinal",Ud,"discrete"),Om("band",Fm,"discrete"),Om("point",(function(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return t(n())},e}(Fm().paddingInner(1))}),"discrete");const Hm=["clamp","base","constant","exponent"];function Wm(t,e){var n=e[0],r=k(e)-n;return function(e){return t(n+e*r)}}function Ym(t,e,n){return Fg(Xm(e||"rgb",n),t)}function Vm(t,e){for(var n=new Array(e),r=e+1,i=0;i<e;)n[i]=t(++i/r);return n}function Gm(t,e,n){var r,i,a,u=n-e;return u&&Number.isFinite(u)?(r=(i=t.type).indexOf("-"),i=r<0?i:i.slice(r+1),a=Om(i)().domain([e,n]).range([0,1]),Hm.forEach(e=>t[e]?a[e](t[e]()):0),a):V(.5)}function Xm(t,e){var n=Sg[function(t){return"interpolate"+t.toLowerCase().split("-").map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function Jm(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function Zm(t,e){for(let n in t)Km(n,e(t[n]))}const Qm={};function Km(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Qm[t]=e,this):Qm[t]}function tv(t,e,n){var r;return ot(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,~~(gt(t.domain())/n)||1))),o(e)&&(r=e.step,e=e.interval),s(e)&&(e="time"===t.type?Xu(e):t.type==Td?Ju(e):i("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function ev(t,e,n){var r=t.range(),i=Math.floor(r[0]),a=Math.ceil(k(r));if(i>a&&(r=a,a=i,i=r),e=e.filter((function(e){return e=t(e),i<=e&&e<=a})),n>0&&e.length>1){for(var u=[e[0],k(e)];e.length>n&&e.length>=3;)e=e.filter((function(t,e){return!(e%2)}));e.length<3&&(e=u)}return e}function nv(t,e){return t.bins?ev(t,t.bins):t.ticks?t.ticks(e):t.domain()}function rv(t,e,n,r,i){var a,u,o=t.type,s="time"===o||"time"===r?ao(n):o===Td||r===Td?uo(n):t.tickFormat?t.tickFormat(e,n):n?Jg(n):String;if($m(o)){var l=function(t){var e=Hg(t||",");if(null==e.precision){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1}return function(t,e){return function(n){var r,i,a=t(n),u=a.indexOf(e);if(u<0)return a;for(i=(r=function(t,e){var n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if((n=t.charCodeAt(r))>=48&&n<=57)return r+1}(a,u))<a.length?a.slice(r):"";--r>u;)if("0"!==a[r]){++r;break}return a.slice(0,r)+i}}(Jg(e),Jg(".1f")(1)[1])}return Jg(e)}(n);s=i||t.bins?l:(a=s,u=l,t=>a(t)?u(t):"")}return s}function iv(t){Hr.call(this,null,t)}function av(t){Hr.call(this,null,t)}function uv(){return St({})}function ov(t){return t.exit}function sv(t){Hr.call(this,null,t)}Zm({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},Jm),Zm({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},t=>Ym(Jm(t))),rt(iv,Hr).transform=function(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,i=t.scale,a=tv(i,null==t.count?t.values?t.values.length:10:t.count,t.minstep),u=t.format||rv(i,a,t.formatSpecifier,t.formatType,!!t.values),o=t.values?ev(i,t.values,a):nv(i,a);return r&&(n.rem=r),r=o.map((function(t,e){return St({index:e/(o.length-1||1),value:t,label:u(t)})})),t.extra&&r.length&&r.push(St({index:-1,extra:{value:r[0].value},label:""})),n.source=r,n.add=r,this.value=r,n},rt(av,Hr).transform=function(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),a=t.item||uv,o=t.key||Ct,s=this.value;return u(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(o))&&i("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=et().test(ov),s.lookup=function(t){return s.get(o(t))}),e.visit(e.ADD,(function(t){var e=o(t),n=s.get(e);n?n.exit?(s.empty--,r.add.push(n)):r.mod.push(n):(s.set(e,n=a(t)),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(function(t){var e=o(t),n=s.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(function(t){var e=o(t),n=s.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++s.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),t.clean&&s.empty>n.cleanThreshold&&n.runAfter(s.clean),r},rt(sv,Hr).transform=function(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,a=e.encode;if(u(a)){if(!n.changed()&&!a.every((function(t){return i[t]})))return e.StopPropagation;a=a[0],n.encode=null}var o="enter"===a,s=i.update||v,l=i.enter||v,c=i.exit||v,f=(a&&!o?i[a]:s)||v;if(e.changed(e.ADD)&&(e.visit(e.ADD,(function(e){l(e,t),s(e,t)})),n.modifies(l.output),n.modifies(s.output),f!==v&&f!==s&&(e.visit(e.ADD,(function(e){f(e,t)})),n.modifies(f.output))),e.changed(e.REM)&&c!==v&&(e.visit(e.REM,(function(e){c(e,t)})),n.modifies(c.output)),o||f!==v){var h=e.MOD|(t.modified()?e.REFLOW:0);o?(e.visit(h,(function(e){var i=l(e,t)||r;(f(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(l.output)):e.visit(h,(function(e){(f(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(f.output)}return n.changed()?n:e.StopPropagation};const lv={quantile:"quantiles",quantize:"thresholds",threshold:"domain"},cv={quantile:"quantiles",quantize:"domain"};function fv(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=k(t),e}(t.bins):t.type===zd?function(t,e){var n=nv(t,e),r=t.base(),i=Math.log(r),a=Math.max(1,r*e/n.length);return n.filter(t=>{var e=t/Math.pow(r,Math.round(Math.log(t)/i));return e*r<r-.5&&(e*=r),e<=a})}(t,e):lv[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[lv[t.type]]()):nv(t,e)}function hv(t,e,n,r,i,a){const u=cv[t.type]&&"time"!==i&&i!==Td?function(t,e){var n,r=t[cv[t.type]](),i=r.length,a=i>1?r[1]-r[0]:r[0];for(n=1;n<i;++n)a=Math.min(a,r[n]-r[n-1]);return nm(0,a,30,e)}(t,r):rv(t,e,r,i,a);return"symbol"===n&&function(t){return lv[t.type]||t.bins}(t)?function(t){return function(e,n,r){var i=dv(r[n+1],dv(r.max,1/0)),a=pv(e,t),u=pv(i,t);return a&&u?a+" – "+u:u?"< "+u:"≥ "+a}}(u):"discrete"===n?function(t){return function(e,n){return n?t(e):null}}(u):function(t){return function(e){return t(e)}}(u)}function dv(t,e){return null!=t?t:e}function pv(t,e){return Number.isFinite(t)?e(t):null}function gv(t){Hr.call(this,[],t)}rt(gv,Hr).transform=function(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,a,u,o=e.fork(e.NO_SOURCE|e.NO_FIELDS),s=this.value,l=t.type||"symbol",c=t.scale,f=+t.limit,h=tv(c,null==t.count?5:t.count,t.minstep),d=!!t.values||"symbol"===l,p=t.format||hv(c,h,l,t.formatSpecifier,t.formatType,d),g=t.values||fv(c,h);return s&&(o.rem=s),"symbol"===l?(f&&g.length>f?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),s=g.slice(0,f-1),u=!0):s=g,W(i=t.size)?(t.values||0!==c(s[0])||(s=s.slice(1)),a=s.reduce((function(e,n){return Math.max(e,i(n,t))}),0)):i=V(a=i||8),s=s.map((function(e,n){return St({index:n,label:p(e,n,s),value:e,offset:a,size:i(e,t)})})),u&&(u=g[s.length],s.push(St({index:s.length,label:`…${g.length-s.length} entries`,value:u,offset:a,size:i(u,t)})))):"gradient"===l?(n=c.domain(),r=Gm(c,n[0],k(n)),g.length<3&&!t.values&&n[0]!==k(n)&&(g=[n[0],k(n)]),s=g.map((function(t,e){return St({index:e,label:p(t,e,g),value:t,perc:r(t)})}))):(i=g.length-1,r=function(t){var e=t.domain(),n=e.length-1,r=+e[0],i=+k(e),a=i-r;if("threshold"===t.type){var u=n?a/n:.1;a=(i+=u)-(r-=u)}return function(t){return(t-r)/a}}(c),s=g.map((function(t,e){return St({index:e,label:p(t,e,g),value:t,perc:e?r(t):0,perc2:e===i?1:r(g[e+1])})}))),o.source=s,o.add=s,this.value=s,o};var mv=et({line:wv,"line-radial":function(t,e,n,r){return wv(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},arc:Av,"arc-radial":function(t,e,n,r){return Av(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},curve:kv,"curve-radial":function(t,e,n,r){return kv(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n))},"orthogonal-horizontal":function(t,e,n,r){return"M"+t+","+e+"V"+r+"H"+n},"orthogonal-vertical":function(t,e,n,r){return"M"+t+","+e+"H"+n+"V"+r},"orthogonal-radial":function(t,e,n,r){var i=Math.cos(t),a=Math.sin(t),u=Math.cos(n),o=Math.sin(n),s=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*a+"A"+e+","+e+" 0 0,"+(s?1:0)+" "+e*u+","+e*o+"L"+r*u+","+r*o},"diagonal-horizontal":function(t,e,n,r){var i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":function(t,e,n,r){var i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":function(t,e,n,r){var i=Math.cos(t),a=Math.sin(t),u=Math.cos(n),o=Math.sin(n),s=(e+r)/2;return"M"+e*i+","+e*a+"C"+s*i+","+s*a+" "+s*u+","+s*o+" "+r*u+","+r*o}});function vv(t){return t.source.x}function yv(t){return t.source.y}function _v(t){return t.target.x}function xv(t){return t.target.y}function bv(t){Hr.call(this,{},t)}function wv(t,e,n,r){return"M"+t+","+e+"L"+n+","+r}function Av(t,e,n,r){var i=n-t,a=r-e,u=Math.sqrt(i*i+a*a)/2;return"M"+t+","+e+"A"+u+","+u+" "+180*Math.atan2(a,i)/Math.PI+" 0 1 "+n+","+r}function kv(t,e,n,r){var i=n-t,a=r-e,u=.2*(i+a),o=.2*(a-i);return"M"+t+","+e+"C"+(t+u)+","+(e+o)+" "+(n+o)+","+(r-u)+" "+n+","+r}function Mv(t){Hr.call(this,null,t)}bv.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},rt(bv,Hr).transform=function(t,e){var n=t.sourceX||vv,r=t.sourceY||yv,a=t.targetX||_v,u=t.targetY||xv,o=t.as||"path",s=t.orient||"vertical",l=t.shape||"line",c=mv.get(l+"-"+s)||mv.get(l);return c||i("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(function(t){t[o]=c(n(t),r(t),a(t),u(t))})),e.reflow(t.modified()).modifies(o)},Mv.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},rt(Mv,Hr).transform=function(t,e){var n,r,i,a=t.as||["startAngle","endAngle"],u=a[0],o=a[1],s=t.field||g,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,h=f.map(s),d=h.length,p=l,m=(c-l)/wi(h),v=li(d);for(t.sort&&v.sort((function(t,e){return h[t]-h[e]})),n=0;n<d;++n)i=h[v[n]],(r=f[v[n]])[u]=p,r[o]=p+=i*m;return this.value=h,e.reflow(t.modified()).modifies(a)};function Ev(t){return Um(t)&&"sequential"!==t}var Dv=xt(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function Cv(t){Hr.call(this,null,t),this.modified(!0)}function Fv(t,e,n){$m(t)&&(Math.abs(e.reduce((function(t,e){return t+(e<0?-1:e>0?1:0)}),0))!==e.length&&n.warn("Log scale domain includes zero: "+l(e)));return e}function Sv(t,e,n){return W(t)&&(e||n)?Wm(t,Bv(e||[0,1],n)):t}function Bv(t,e){return e?t.slice().reverse():t}function zv(t){Hr.call(this,null,t)}rt(Cv,Hr).transform=function(t,e){var n=e.dataflow,r=this.value,a=function(t){var e,n=t.type,r="";if("sequential"===n)return"sequential-linear";(function(t){const e=t.type;return Um(e)&&"time"!==e&&e!==Td&&(t.scheme||t.range&&t.range.length&&t.range.every(s))})(t)&&(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0,r=2===e?"sequential-":3===e?"diverging-":"");return(r+n||"linear").toLowerCase()}(t);for(a in r&&a===r.type||(this.value=r=Om(a)()),t)if(!Dv[a]){if("padding"===a&&Ev(r.type))continue;W(r[a])?r[a](t[a]):n.warn("Unsupported scale property: "+a)}return function(t,e,n){var r=t.type,a=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){"band"!==t&&"point"!==t&&i("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,a="point"===t?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Bd(n,a,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,a,o=e.schemeExtent;u(e.scheme)?a=Ym(e.scheme,e.interpolate,e.interpolateGamma):(r=e.scheme.toLowerCase(),(a=Km(r))||i(`Unrecognized scheme name: ${e.scheme}`));return n="threshold"===t?n+1:"bin-ordinal"===t?n-1:"quantile"===t||"quantize"===t?+e.schemeCount||5:n,jm(t)?Sv(a,o,e.reverse):W(a)?Vm(Sv(a,o),n):"ordinal"===t?a:a.slice(0,n)}(r,e,n),W(o))){if(t.interpolator)return t.interpolator(o);i(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&jm(r))return t.interpolator(Ym(Bv(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Xm(e.interpolate,e.interpolateGamma)):W(t.round)?t.round(a):W(t.rangeRound)&&t.interpolate(a?og:ug);o&&t.range(Bv(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!u(r)){let e=t.domain(),n=e[0],a=k(e),u=null==r.start?n:r.start,o=null==r.stop?a:r.stop,s=r.step;s||i("Scale bins parameter missing step property."),u<n&&(u=s*Math.ceil(n/s)),o>a&&(o=s*Math.floor(a/s)),r=li(u,o+s/2,s)}r?t.bins=r:t.bins&&delete t.bins;"bin-ordinal"===t.type&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){var r=function(t,e,n){return e?(t.domain(Fv(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,a,u=e.domain,o=t.type,s=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&("linear"===e||"pow"===e||"sqrt"===e)}(t);if(!u)return 0;Ev(o)&&e.padding&&u[0]!==k(u)&&(u=function(t,e,n,r,i,a){var u=Math.abs(k(n)-n[0]),o=u/(u-2*r),s=t===zd?U(e,null,o):"sqrt"===t?L(e,null,o,.5):"pow"===t?L(e,null,o,i||1):"symlog"===t?P(e,null,o,a||1):q(e,null,o);return(e=e.slice())[0]=s[0],e[e.length-1]=s[1],e}(o,u,e.range,e.padding,e.exponent,e.constant));(s||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(u=u.slice()).length-1||1,s&&(u[0]>0&&(u[0]=0),u[i]<0&&(u[i]=0)),null!=e.domainMin&&(u[0]=e.domainMin),null!=e.domainMax&&(u[i]=e.domainMax),null!=e.domainMid&&(((a=e.domainMid)<u[0]||a>u[i])&&n.warn("Scale domainMid exceeds domain min or max.",a),u.splice(i,0,a)));t.domain(Fv(o,u,n)),"ordinal"===o&&t.unknown(e.domainImplicit?qd:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&tv(t,e.nice)||null);return u.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)},rt(zv,Hr).transform=function(t,e){var n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(Nt(t.sort)),this.modified(n),e};var Tv=["y0","y1"];function Nv(t){Hr.call(this,null,t)}function Ov(t,e,n,r,i){for(var a,u=(e-t.sum)/2,o=t.length,s=0;s<o;++s)(a=t[s])[r]=u,a[i]=u+=Math.abs(n(a))}function Rv(t,e,n,r,i){for(var a,u=1/t.sum,o=0,s=t.length,l=0,c=0;l<s;++l)(a=t[l])[r]=o,a[i]=o=u*(c+=Math.abs(n(a)))}function qv(t,e,n,r,i){for(var a,u,o=0,s=0,l=t.length,c=0;c<l;++c)(a=+n(u=t[c]))<0?(u[r]=s,u[i]=s+=a):(u[r]=o,u[i]=o+=a)}Nv.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:Tv}]},rt(Nv,Hr).transform=function(t,e){var n,r,i,a,u=t.as||Tv,o=u[0],s=u[1],l=Nt(t.sort),c=t.field||g,f="center"===t.offset?Ov:"normalize"===t.offset?Rv:qv;for(n=function(t,e,n,r){var i,a,u,o,s,l,c,f,h,d=[],p=function(t){return t(s)};if(null==e)d.push(t.slice());else for(i={},a=0,u=t.length;a<u;++a)s=t[a],l=e.map(p),(c=i[l])||(i[l]=c=[],d.push(c)),c.push(s);for(l=0,h=0,o=d.length;l<o;++l){for(c=d[l],a=0,f=0,u=c.length;a<u;++a)f+=Math.abs(r(c[a]));c.sum=f,f>h&&(h=f),n&&c.sort(n)}return d.max=h,d}(e.source,t.groupby,l,c),r=0,i=n.length,a=n.max;r<i;++r)f(n[r],a,c,o,s);return e.reflow(t.modified()).modifies(u)};var Uv=Object.freeze({__proto__:null,axisticks:iv,datajoin:av,encode:sv,legendentries:gv,linkpath:bv,pie:Mv,scale:Cv,sortitems:zv,stack:Nv,validTicks:ev});function Lv(){}const Pv=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function $v(){var t=1,e=1,n=o;function r(t,e){return e.map(e=>a(t,e))}function a(r,i){var a=[],o=[];return function(n,r,i){var a,o,s,l,c,f,h=new Array,d=new Array;a=o=-1,l=n[0]>=r,Pv[l<<1].forEach(p);for(;++a<t-1;)s=l,l=n[a+1]>=r,Pv[s|l<<1].forEach(p);Pv[l<<0].forEach(p);for(;++o<e-1;){for(a=-1,l=n[o*t+t]>=r,c=n[o*t]>=r,Pv[l<<1|c<<2].forEach(p);++a<t-1;)s=l,l=n[o*t+t+a+1]>=r,f=c,c=n[o*t+a+1]>=r,Pv[s|l<<1|c<<2|f<<3].forEach(p);Pv[l|c<<3].forEach(p)}a=-1,c=n[o*t]>=r,Pv[c<<2].forEach(p);for(;++a<t-1;)f=c,c=n[o*t+a+1]>=r,Pv[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+o],s=[t[1][0]+a,t[1][1]+o],l=u(r),c=u(s);(e=d[l])?(n=h[c])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=c]=e):(e=h[c])?(n=d[l])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=l]=e):h[l]=d[c]={start:l,end:c,ring:[r,s]}}Pv[c<<3].forEach(p)}(r,i,(function(t){n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):o.push(t)})),o.forEach((function(t){for(var e,n=0,r=a.length;n<r;++n)if(-1!==jv((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function u(e){return 2*e[0]+e[1]*(t+1)*4}function o(n,r,i){n.forEach((function(n){var a,u=n[0],o=n[1],s=0|u,l=0|o,c=r[l*t+s];u>0&&u<t&&s===u&&(a=r[l*t+s-1],n[0]=u+(i-a)/(c-a)-.5),o>0&&o<e&&l===o&&(a=r[(l-1)*t+s],n[1]=o+(i-a)/(c-a)-.5)}))}return r.contour=a,r.size=function(n){if(!arguments.length)return[t,e];var a=Math.ceil(n[0]),u=Math.ceil(n[1]);return a>0&&u>0||i("invalid size"),t=a,e=u,r},r.smooth=function(t){return arguments.length?(n=t?o:Lv,r):n===o},r}function jv(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=Iv(t,e[r]))return n;return 0}function Iv(t,e){for(var n=e[0],r=e[1],i=-1,a=0,u=t.length,o=u-1;a<u;o=a++){var s=t[a],l=s[0],c=s[1],f=t[o],h=f[0],d=f[1];if(Hv(s,f,e))return 0;c>r!=d>r&&n<(h-l)*(r-c)/(d-c)+l&&(i=-i)}return i}function Hv(t,e,n){var r,i,a,u;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],a=n[r],u=e[r],i<=a&&a<=u||u<=a&&a<=i)}function Wv(t,e,n){return function(r){var i=J(r),a=n?Math.min(i[0],0):i[0],u=i[1],o=u-a,s=e?gi(a,u,t):o/(t+1);return li(s,u,s)}}function Yv(t){Hr.call(this,null,t)}function Vv(t,e,n,r,i){const a=t.x1||0,u=t.y1||0,o=e*n<0;function s(t){t.forEach(l)}function l(t){o&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-a)*e+r,t[1]=(t[1]-u)*n+i}return function(t){return t.coordinates.forEach(s),t}}function Gv(t,e,n){const r=t>=0?t:Mi(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function Xv(t){return W(t)?t:V(+t)}function Jv(){var t=t=>t[0],e=t=>t[1],n=g,r=[-1,-1],a=960,u=500,o=2;function s(i,s){const l=Gv(r[0],i,t)>>o,c=Gv(r[1],i,e)>>o,f=l?l+2:0,h=c?c+2:0,d=2*f+(a>>o),p=2*h+(u>>o),g=new Float32Array(d*p),m=new Float32Array(d*p);let v=g;i.forEach(r=>{const i=f+(+t(r)>>o),a=h+(+e(r)>>o);i>=0&&i<d&&a>=0&&a<p&&(g[i+a*d]+=+n(r))}),l>0&&c>0?(Zv(d,p,g,m,l),Qv(d,p,m,g,c),Zv(d,p,g,m,l),Qv(d,p,m,g,c),Zv(d,p,g,m,l),Qv(d,p,m,g,c)):l>0?(Zv(d,p,g,m,l),Zv(d,p,m,g,l),Zv(d,p,g,m,l),v=m):c>0&&(Qv(d,p,g,m,c),Qv(d,p,m,g,c),Qv(d,p,g,m,c),v=m);let y=s?Math.pow(2,-2*o):1/wi(v);for(let t=0,e=d*p;t<e;++t)v[t]*=y;return{values:v,scale:1<<o,width:d,height:p,x1:f,y1:h,x2:f+(a>>o),y2:h+(u>>o)}}return s.x=function(e){return arguments.length?(t=Xv(e),s):t},s.y=function(t){return arguments.length?(e=Xv(t),s):e},s.weight=function(t){return arguments.length?(n=Xv(t),s):n},s.size=function(t){if(!arguments.length)return[a,u];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);return e>=0||e>=0||i("invalid size"),a=e,u=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||i("invalid cell size"),o=Math.floor(Math.log(t)/Math.LN2),s):1<<o},s.bandwidth=function(t){return arguments.length?(1===(t=I(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&i("invalid bandwidth"),r=t,s):r},s}function Zv(t,e,n,r,i){const a=1+(i<<1);for(let u=0;u<e;++u)for(let e=0,o=0;e<t+i;++e)e<t&&(o+=n[e+u*t]),e>=i&&(e>=a&&(o-=n[e-a+u*t]),r[e-i+u*t]=o/Math.min(e+1,t-1+a-e,a))}function Qv(t,e,n,r,i){const a=1+(i<<1);for(let u=0;u<t;++u)for(let o=0,s=0;o<e+i;++o)o<e&&(s+=n[u+o*t]),o>=i&&(o>=a&&(s-=n[u+(o-a)*t]),r[u+(o-i)*t]=s/Math.min(o+1,e-1+a-o,a))}function Kv(t){Hr.call(this,null,t)}Yv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},rt(Yv,Hr).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||d,a=$v().smooth(!1!==t.smooth),o=t.thresholds||function(t,e,n){const r=Wv(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map(t=>mi(e(t).values)))}(r,i,t),s=null===t.as?null:t.as||"contour",l=[];return r.forEach(e=>{const n=i(e),r=a.size([n.width,n.height])(n.values,u(o)?o:o(n.values));!function(t,e,n,r){let i=r.scale||e.scale,a=r.translate||e.translate;W(i)&&(i=i(n,r));W(a)&&(a=a(n,r));if((1===i||null==i)&&!a)return;const u=(ot(i)?i:i[0])||1,o=(ot(i)?i:i[1])||1,s=a&&a[0]||0,l=a&&a[1]||0;t.forEach(Vv(e,u,o,s,l))}(r,n,e,t),r.forEach(t=>{l.push(zt(e,St(null!=s?{[s]:t}:t)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n},Kv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};var ty=rt(Kv,Hr);const ey=["x","y","weight","size","cellSize","bandwidth"];function ny(t,e){return ey.forEach(n=>null!=e[n]?t[n](e[n]):0),t}function ry(t){Hr.call(this,null,t)}ty.transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),a=function(t,e){var n,r,i,a,u,o,s=[],l=t=>t(a);if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)a=t[r],u=e.map(l),(o=n[u])||(n[u]=o=[],o.dims=u,s.push(o)),o.push(a);return s}(e.materialize(e.SOURCE).source,t.groupby),u=(t.groupby||[]).map(n),o=ny(Jv(),t),s=t.as||"grid";return r=a.map(e=>St(function(t,e){for(let n=0;n<u.length;++n)t[u[n]]=e[n];return t}({[s]:o(e,t.counts)},e.dims))),this.value&&(i.rem=this.value),this.value=i.source=i.add=r,i},ry.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},rt(ry,Hr).transform=function(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),a=$v().smooth(!1!==t.smooth),o=t.values,s=t.thresholds||Wv(t.count||10,t.nice,!!o),l=t.size;return o||(o=e.materialize(e.SOURCE).source,r=Vv(n=ny(Jv(),t)(o,!0),n.scale||1,n.scale||1,0,0),l=[n.width,n.height],o=n.values),s=u(s)?s:s(o),o=a.size(l)(o,s),r&&o.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(o||[]).map(St),i};function iy(t){Hr.call(this,null,t)}function ay(){return new uy}function uy(){this.reset()}iy.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},rt(iy,Hr).transform=function(t,e){var n,i=this._features,a=this._points,u=t.fields,o=u&&u[0],s=u&&u[1],l=t.geojson||!u&&d,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(r(l))||o&&e.modified(r(o))||s&&e.modified(r(s)),this.value&&!n||(c=e.SOURCE,this._features=i=[],this._points=a=[]),l&&e.visit(c,(function(t){i.push(l(t))})),o&&s&&(e.visit(c,(function(t){var e=o(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&a.push([e,n])})),i=i.concat({type:"Feature",geometry:{type:"MultiPoint",coordinates:a}})),this.value={type:"FeatureCollection",features:i}},uy.prototype={constructor:uy,reset:function(){this.s=this.t=0},add:function(t){sy(oy,t,this.t),sy(this,oy.s,this.s),this.s?this.t+=oy.t:this.s=oy.t},valueOf:function(){return this.s}};var oy=new uy;function sy(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var ly=Math.PI,cy=ly/2,fy=ly/4,hy=2*ly,dy=180/ly,py=ly/180,gy=Math.abs,my=Math.atan,vy=Math.atan2,yy=Math.cos,_y=Math.ceil,xy=Math.exp,by=Math.log,wy=Math.pow,Ay=Math.sin,ky=Math.sign||function(t){return t>0?1:t<0?-1:0},My=Math.sqrt,Ey=Math.tan;function Dy(t){return t>1?0:t<-1?ly:Math.acos(t)}function Cy(t){return t>1?cy:t<-1?-cy:Math.asin(t)}function Fy(){}function Sy(t,e){t&&zy.hasOwnProperty(t.type)&&zy[t.type](t,e)}var By={Feature:function(t,e){Sy(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Sy(n[r].geometry,e)}},zy={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 n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Ty(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ty(n[r],e,0)},Polygon:function(t,e){Ny(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ny(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Sy(n[r],e)}};function Ty(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Ny(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Ty(t[n],e,1);e.polygonEnd()}function Oy(t,e){t&&By.hasOwnProperty(t.type)?By[t.type](t,e):Sy(t,e)}var Ry,qy,Uy,Ly,Py,$y=ay(),jy=ay(),Iy={point:Fy,lineStart:Fy,lineEnd:Fy,polygonStart:function(){$y.reset(),Iy.lineStart=Hy,Iy.lineEnd=Wy},polygonEnd:function(){var t=+$y;jy.add(t<0?hy+t:t),this.lineStart=this.lineEnd=this.point=Fy},sphere:function(){jy.add(hy)}};function Hy(){Iy.point=Yy}function Wy(){Vy(Ry,qy)}function Yy(t,e){Iy.point=Vy,Ry=t,qy=e,Uy=t*=py,Ly=yy(e=(e*=py)/2+fy),Py=Ay(e)}function Vy(t,e){var n=(t*=py)-Uy,r=n>=0?1:-1,i=r*n,a=yy(e=(e*=py)/2+fy),u=Ay(e),o=Py*u,s=Ly*a+o*yy(i),l=o*r*Ay(i);$y.add(vy(l,s)),Uy=t,Ly=a,Py=u}function Gy(t){return[vy(t[1],t[0]),Cy(t[2])]}function Xy(t){var e=t[0],n=t[1],r=yy(n);return[r*yy(e),r*Ay(e),Ay(n)]}function Jy(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zy(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 Qy(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ky(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function t_(t){var e=My(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var e_,n_,r_,i_,a_,u_,o_,s_,l_,c_,f_,h_,d_,p_,g_,m_,v_,y_,__,x_,b_,w_,A_,k_,M_,E_,D_=ay(),C_={point:F_,lineStart:B_,lineEnd:z_,polygonStart:function(){C_.point=T_,C_.lineStart=N_,C_.lineEnd=O_,D_.reset(),Iy.polygonStart()},polygonEnd:function(){Iy.polygonEnd(),C_.point=F_,C_.lineStart=B_,C_.lineEnd=z_,$y<0?(e_=-(r_=180),n_=-(i_=90)):D_>1e-6?i_=90:D_<-1e-6&&(n_=-90),c_[0]=e_,c_[1]=r_},sphere:function(){e_=-(r_=180),n_=-(i_=90)}};function F_(t,e){l_.push(c_=[e_=t,r_=t]),e<n_&&(n_=e),e>i_&&(i_=e)}function S_(t,e){var n=Xy([t*py,e*py]);if(s_){var r=Zy(s_,n),i=Zy([r[1],-r[0],0],r);t_(i),i=Gy(i);var a,u=t-a_,o=u>0?1:-1,s=i[0]*dy*o,l=gy(u)>180;l^(o*a_<s&&s<o*t)?(a=i[1]*dy)>i_&&(i_=a):l^(o*a_<(s=(s+360)%360-180)&&s<o*t)?(a=-i[1]*dy)<n_&&(n_=a):(e<n_&&(n_=e),e>i_&&(i_=e)),l?t<a_?R_(e_,t)>R_(e_,r_)&&(r_=t):R_(t,r_)>R_(e_,r_)&&(e_=t):r_>=e_?(t<e_&&(e_=t),t>r_&&(r_=t)):t>a_?R_(e_,t)>R_(e_,r_)&&(r_=t):R_(t,r_)>R_(e_,r_)&&(e_=t)}else l_.push(c_=[e_=t,r_=t]);e<n_&&(n_=e),e>i_&&(i_=e),s_=n,a_=t}function B_(){C_.point=S_}function z_(){c_[0]=e_,c_[1]=r_,C_.point=F_,s_=null}function T_(t,e){if(s_){var n=t-a_;D_.add(gy(n)>180?n+(n>0?360:-360):n)}else u_=t,o_=e;Iy.point(t,e),S_(t,e)}function N_(){Iy.lineStart()}function O_(){T_(u_,o_),Iy.lineEnd(),gy(D_)>1e-6&&(e_=-(r_=180)),c_[0]=e_,c_[1]=r_,s_=null}function R_(t,e){return(e-=t)<0?e+360:e}function q_(t,e){return t[0]-e[0]}function U_(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var L_={sphere:Fy,point:P_,lineStart:j_,lineEnd:W_,polygonStart:function(){L_.lineStart=Y_,L_.lineEnd=V_},polygonEnd:function(){L_.lineStart=j_,L_.lineEnd=W_}};function P_(t,e){t*=py;var n=yy(e*=py);$_(n*yy(t),n*Ay(t),Ay(e))}function $_(t,e,n){++f_,d_+=(t-d_)/f_,p_+=(e-p_)/f_,g_+=(n-g_)/f_}function j_(){L_.point=I_}function I_(t,e){t*=py;var n=yy(e*=py);k_=n*yy(t),M_=n*Ay(t),E_=Ay(e),L_.point=H_,$_(k_,M_,E_)}function H_(t,e){t*=py;var n=yy(e*=py),r=n*yy(t),i=n*Ay(t),a=Ay(e),u=vy(My((u=M_*a-E_*i)*u+(u=E_*r-k_*a)*u+(u=k_*i-M_*r)*u),k_*r+M_*i+E_*a);h_+=u,m_+=u*(k_+(k_=r)),v_+=u*(M_+(M_=i)),y_+=u*(E_+(E_=a)),$_(k_,M_,E_)}function W_(){L_.point=P_}function Y_(){L_.point=G_}function V_(){X_(w_,A_),L_.point=P_}function G_(t,e){w_=t,A_=e,t*=py,e*=py,L_.point=X_;var n=yy(e);k_=n*yy(t),M_=n*Ay(t),E_=Ay(e),$_(k_,M_,E_)}function X_(t,e){t*=py;var n=yy(e*=py),r=n*yy(t),i=n*Ay(t),a=Ay(e),u=M_*a-E_*i,o=E_*r-k_*a,s=k_*i-M_*r,l=My(u*u+o*o+s*s),c=Cy(l),f=l&&-c/l;__+=f*u,x_+=f*o,b_+=f*s,h_+=c,m_+=c*(k_+(k_=r)),v_+=c*(M_+(M_=i)),y_+=c*(E_+(E_=a)),$_(k_,M_,E_)}function J_(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Z_(t,e){return[gy(t)>ly?t+Math.round(-t/hy)*hy:t,e]}function Q_(t,e,n){return(t%=hy)?e||n?J_(tx(t),ex(e,n)):tx(t):e||n?ex(e,n):Z_}function K_(t){return function(e,n){return[(e+=t)>ly?e-hy:e<-ly?e+hy:e,n]}}function tx(t){var e=K_(t);return e.invert=K_(-t),e}function ex(t,e){var n=yy(t),r=Ay(t),i=yy(e),a=Ay(e);function u(t,e){var u=yy(e),o=yy(t)*u,s=Ay(t)*u,l=Ay(e),c=l*n+o*r;return[vy(s*i-c*a,o*n-l*r),Cy(c*i+s*a)]}return u.invert=function(t,e){var u=yy(e),o=yy(t)*u,s=Ay(t)*u,l=Ay(e),c=l*i-s*a;return[vy(s*i+l*a,o*n+c*r),Cy(c*n-o*r)]},u}function nx(t,e){(e=Xy(e))[0]-=t,t_(e);var n=Dy(-e[1]);return((-e[2]<0?-n:n)+hy-1e-6)%hy}function rx(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Fy,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ix(t,e){return gy(t[0]-e[0])<1e-6&&gy(t[1]-e[1])<1e-6}function ax(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ux(t,e,n,r,i){var a,u,o=[],s=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],u=t[e];if(ix(r,u)){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);i.lineEnd()}else o.push(n=new ax(r,t,null,!0)),s.push(n.o=new ax(r,null,n,!1)),o.push(n=new ax(u,t,null,!1)),s.push(n.o=new ax(u,null,n,!0))}})),o.length){for(s.sort(e),ox(o),ox(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l,c,f=o[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,u=l.length;a<u;++a)i.point((c=l[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function ox(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}Z_.invert=Z_;var sx=ay();function lx(t){return gy(t[0])<=ly?t[0]:ky(t[0])*((gy(t[0])+ly)%hy-ly)}function cx(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}!function(t){var e;1===t.length&&(e=t,t=function(t,n){return cx(e(t),n)})}(cx);function fx(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function hx(t){for(var e,n,r,i=t.length,a=-1,u=0;++a<i;)u+=t[a].length;for(n=new Array(u);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--u]=r[e];return n}function dx(t,e,n,r){return function(i){var a,u,o,s=e(i),l=rx(),c=e(l),f=!1,h={point:d,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=y,h.lineEnd=_,u=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=m,u=hx(u);var t=function(t,e){var n=lx(e),r=e[1],i=Ay(r),a=[Ay(n),-yy(n),0],u=0,o=0;sx.reset(),1===i?r=cy+1e-6:-1===i&&(r=-cy-1e-6);for(var s=0,l=t.length;s<l;++s)if(f=(c=t[s]).length)for(var c,f,h=c[f-1],d=lx(h),p=h[1]/2+fy,g=Ay(p),m=yy(p),v=0;v<f;++v,d=_,g=b,m=w,h=y){var y=c[v],_=lx(y),x=y[1]/2+fy,b=Ay(x),w=yy(x),A=_-d,k=A>=0?1:-1,M=k*A,E=M>ly,D=g*b;if(sx.add(vy(D*k*Ay(M),m*w+D*yy(M))),u+=E?A+k*hy:A,E^d>=n^_>=n){var C=Zy(Xy(h),Xy(y));t_(C);var F=Zy(a,C);t_(F);var S=(E^A>=0?-1:1)*Cy(F[2]);(r>S||r===S&&(C[0]||C[1]))&&(o+=E^A>=0?1:-1)}}return(u<-1e-6||u<1e-6&&sx<-1e-6)^1&o}(a,r);u.length?(f||(i.polygonStart(),f=!0),ux(u,gx,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),u=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){s.point(t,e)}function g(){h.point=p,s.lineStart()}function m(){h.point=d,s.lineEnd()}function v(t,e){o.push([t,e]),c.point(t,e)}function y(){c.lineStart(),o=[]}function _(){v(o[0][0],o[0][1]),c.lineEnd();var t,e,n,r,s=c.clean(),h=l.result(),d=h.length;if(o.pop(),a.push(o),o=null,d)if(1&s){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&s&&h.push(h.pop().concat(h.shift())),u.push(h.filter(px))}return h}}function px(t){return t.length>1}function gx(t,e){return((t=t.x)[0]<0?t[1]-cy-1e-6:cy-t[1])-((e=e.x)[0]<0?e[1]-cy-1e-6:cy-e[1])}var mx=dx((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,u){var o=a>0?ly:-ly,s=gy(a-n);gy(s-ly)<1e-6?(t.point(n,r=(r+u)/2>0?cy:-cy),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),t.point(a,r),e=0):i!==o&&s>=ly&&(gy(n-i)<1e-6&&(n-=1e-6*i),gy(a-o)<1e-6&&(a-=1e-6*o),r=function(t,e,n,r){var i,a,u=Ay(t-n);return gy(u)>1e-6?my((Ay(e)*(a=yy(r))*Ay(n)-Ay(r)*(i=yy(e))*Ay(t))/(i*a*u)):(e+r)/2}(n,r,a,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(o,r),e=0),t.point(n=a,r=u),i=o},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*cy,r.point(-ly,i),r.point(0,i),r.point(ly,i),r.point(ly,0),r.point(ly,-i),r.point(0,-i),r.point(-ly,-i),r.point(-ly,0),r.point(-ly,i);else if(gy(t[0]-e[0])>1e-6){var a=t[0]<e[0]?ly:-ly;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}),[-ly,-cy]);function vx(t){var e=yy(t),n=6*py,r=e>0,i=gy(e)>1e-6;function a(t,n){return yy(t)*yy(n)>e}function u(t,n,r){var i=[1,0,0],a=Zy(Xy(t),Xy(n)),u=Jy(a,a),o=a[0],s=u-o*o;if(!s)return!r&&t;var l=e*u/s,c=-e*o/s,f=Zy(i,a),h=Ky(i,l);Qy(h,Ky(a,c));var d=f,p=Jy(h,d),g=Jy(d,d),m=p*p-g*(Jy(h,h)-1);if(!(m<0)){var v=My(m),y=Ky(d,(-p-v)/g);if(Qy(y,h),y=Gy(y),!r)return y;var _,x=t[0],b=n[0],w=t[1],A=n[1];b<x&&(_=x,x=b,b=_);var k=b-x,M=gy(k-ly)<1e-6;if(!M&&A<w&&(_=w,w=A,A=_),M||k<1e-6?M?w+A>0^y[1]<(gy(y[0]-x)<1e-6?w:A):w<=y[1]&&y[1]<=A:k>ly^(x<=y[0]&&y[0]<=b)){var E=Ky(d,(-p+v)/g);return Qy(E,h),[y,Gy(E)]}}}function o(e,n){var i=r?t:ly-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return dx(a,(function(t){var e,n,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,h){var d,p=[f,h],g=a(f,h),m=r?g?0:o(f,h):g?o(f+(f<0?ly:-ly),h):0;if(!e&&(l=s=g)&&t.lineStart(),g!==s&&(!(d=u(e,p))||ix(e,d)||ix(p,d))&&(p[0]+=1e-6,p[1]+=1e-6,g=a(p[0],p[1])),g!==s)c=0,g?(t.lineStart(),d=u(p,e),t.point(d[0],d[1])):(d=u(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&r^g){var v;m&n||!(v=u(p,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&ix(e,p)||t.point(p[0],p[1]),e=p,s=g,n=m},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return c|(l&&s)<<1}}}),(function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var u=yy(e),o=Ay(e),s=r*n;null==i?(i=e+r*hy,a=e-s/2):(i=nx(u,i),a=nx(u,a),(r>0?i<a:i>a)&&(i+=r*hy));for(var l,c=i;r>0?c>a:c<a;c-=s)l=Gy([u,-o*yy(c),-o*Ay(c)]),t.point(l[0],l[1])}}(a,t,n,i,e,r)}),r?[0,-t]:[-ly,t-ly])}function yx(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,o,l){var c=0,f=0;if(null==i||(c=u(i,o))!==(f=u(a,o))||s(i,a)<0^o>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+o+4)%4)!==f);else l.point(a[0],a[1])}function u(r,i){return gy(r[0]-t)<1e-6?i>0?0:3:gy(r[0]-n)<1e-6?i>0?2:1:gy(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var n=u(t,1),r=u(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(u){var s,l,c,f,h,d,p,g,m,v,y,_=u,x=rx(),b={point:w,lineStart:function(){b.point=A,l&&l.push(c=[]);v=!0,m=!1,p=g=NaN},lineEnd:function(){s&&(A(f,h),d&&m&&x.rejoin(),s.push(x.result()));b.point=w,m&&_.lineEnd()},polygonStart:function(){_=x,s=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,u,o=l[n],s=1,c=o.length,f=o[0],h=f[0],d=f[1];s<c;++s)a=h,u=d,f=o[s],h=f[0],d=f[1],u<=r?d>r&&(h-a)*(r-u)>(d-u)*(t-a)&&++e:d<=r&&(h-a)*(r-u)<(d-u)*(t-a)&&--e;return e}(),n=y&&e,i=(s=hx(s)).length;(n||i)&&(u.polygonStart(),n&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),i&&ux(s,o,e,a,u),u.polygonEnd());_=u,s=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function A(a,u){var o=i(a,u);if(l&&c.push([a,u]),v)f=a,h=u,d=o,v=!1,o&&(_.lineStart(),_.point(a,u));else if(o&&m)_.point(a,u);else{var s=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],x=[a=Math.max(-1e9,Math.min(1e9,a)),u=Math.max(-1e9,Math.min(1e9,u))];!function(t,e,n,r,i,a){var u,o=t[0],s=t[1],l=0,c=1,f=e[0]-o,h=e[1]-s;if(u=n-o,f||!(u>0)){if(u/=f,f<0){if(u<l)return;u<c&&(c=u)}else if(f>0){if(u>c)return;u>l&&(l=u)}if(u=i-o,f||!(u<0)){if(u/=f,f<0){if(u>c)return;u>l&&(l=u)}else if(f>0){if(u<l)return;u<c&&(c=u)}if(u=r-s,h||!(u>0)){if(u/=h,h<0){if(u<l)return;u<c&&(c=u)}else if(h>0){if(u>c)return;u>l&&(l=u)}if(u=a-s,h||!(u<0)){if(u/=h,h<0){if(u>c)return;u>l&&(l=u)}else if(h>0){if(u<l)return;u<c&&(c=u)}return l>0&&(t[0]=o+l*f,t[1]=s+l*h),c<1&&(e[0]=o+c*f,e[1]=s+c*h),!0}}}}}(s,x,t,e,n,r)?o&&(_.lineStart(),_.point(a,u),y=!1):(m||(_.lineStart(),_.point(s[0],s[1])),_.point(x[0],x[1]),o||_.lineEnd(),y=!1)}p=a,g=u,m=o}return b}}function _x(t,e,n){var r=fx(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function xx(t,e,n){var r=fx(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function bx(t){return t}var wx,Ax,kx,Mx,Ex=ay(),Dx=ay(),Cx={point:Fy,lineStart:Fy,lineEnd:Fy,polygonStart:function(){Cx.lineStart=Fx,Cx.lineEnd=zx},polygonEnd:function(){Cx.lineStart=Cx.lineEnd=Cx.point=Fy,Ex.add(gy(Dx)),Dx.reset()},result:function(){var t=Ex/2;return Ex.reset(),t}};function Fx(){Cx.point=Sx}function Sx(t,e){Cx.point=Bx,wx=kx=t,Ax=Mx=e}function Bx(t,e){Dx.add(Mx*t-kx*e),kx=t,Mx=e}function zx(){Bx(wx,Ax)}var Tx=1/0,Nx=Tx,Ox=-Tx,Rx=Ox,qx={point:function(t,e){t<Tx&&(Tx=t);t>Ox&&(Ox=t);e<Nx&&(Nx=e);e>Rx&&(Rx=e)},lineStart:Fy,lineEnd:Fy,polygonStart:Fy,polygonEnd:Fy,result:function(){var t=[[Tx,Nx],[Ox,Rx]];return Ox=Rx=-(Nx=Tx=1/0),t}};var Ux,Lx,Px,$x,jx=0,Ix=0,Hx=0,Wx=0,Yx=0,Vx=0,Gx=0,Xx=0,Jx=0,Zx={point:Qx,lineStart:Kx,lineEnd:nb,polygonStart:function(){Zx.lineStart=rb,Zx.lineEnd=ib},polygonEnd:function(){Zx.point=Qx,Zx.lineStart=Kx,Zx.lineEnd=nb},result:function(){var t=Jx?[Gx/Jx,Xx/Jx]:Vx?[Wx/Vx,Yx/Vx]:Hx?[jx/Hx,Ix/Hx]:[NaN,NaN];return jx=Ix=Hx=Wx=Yx=Vx=Gx=Xx=Jx=0,t}};function Qx(t,e){jx+=t,Ix+=e,++Hx}function Kx(){Zx.point=tb}function tb(t,e){Zx.point=eb,Qx(Px=t,$x=e)}function eb(t,e){var n=t-Px,r=e-$x,i=My(n*n+r*r);Wx+=i*(Px+t)/2,Yx+=i*($x+e)/2,Vx+=i,Qx(Px=t,$x=e)}function nb(){Zx.point=Qx}function rb(){Zx.point=ab}function ib(){ub(Ux,Lx)}function ab(t,e){Zx.point=ub,Qx(Ux=Px=t,Lx=$x=e)}function ub(t,e){var n=t-Px,r=e-$x,i=My(n*n+r*r);Wx+=i*(Px+t)/2,Yx+=i*($x+e)/2,Vx+=i,Gx+=(i=$x*t-Px*e)*(Px+t),Xx+=i*($x+e),Jx+=3*i,Qx(Px=t,$x=e)}function ob(t){this._context=t}ob.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,hy)}},result:Fy};var sb,lb,cb,fb,hb,db=ay(),pb={point:Fy,lineStart:function(){pb.point=gb},lineEnd:function(){sb&&mb(lb,cb),pb.point=Fy},polygonStart:function(){sb=!0},polygonEnd:function(){sb=null},result:function(){var t=+db;return db.reset(),t}};function gb(t,e){pb.point=mb,lb=fb=t,cb=hb=e}function mb(t,e){fb-=t,hb-=e,db.add(My(fb*fb+hb*hb)),fb=t,hb=e}function vb(){this._string=[]}function yb(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _b(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Oy(t,n(r))),r.result()}return a.area=function(t){return Oy(t,n(Cx)),Cx.result()},a.measure=function(t){return Oy(t,n(pb)),pb.result()},a.bounds=function(t){return Oy(t,n(qx)),qx.result()},a.centroid=function(t){return Oy(t,n(Zx)),Zx.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,bx):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new vb):new ob(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)}function xb(t){return function(e){var n=new bb;for(var r in t)n[r]=t[r];return n.stream=e,n}}function bb(){}function wb(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Oy(n,t.stream(qx)),e(qx.result()),null!=r&&t.clipExtent(r),t}function Ab(t,e,n){return wb(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),u=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,o=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([u,o])}),n)}function kb(t,e,n){return Ab(t,[[0,0],e],n)}function Mb(t,e,n){return wb(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,u=-i*n[0][1];t.scale(150*i).translate([a,u])}),n)}function Eb(t,e,n){return wb(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],u=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,u])}),n)}vb.prototype={_radius:4.5,_circle:yb(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=yb(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},bb.prototype={constructor:bb,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()}};var Db=yy(30*py);function Cb(t,e){return+e?function(t,e){function n(r,i,a,u,o,s,l,c,f,h,d,p,g,m){var v=l-r,y=c-i,_=v*v+y*y;if(_>4*e&&g--){var x=u+h,b=o+d,w=s+p,A=My(x*x+b*b+w*w),k=Cy(w/=A),M=gy(gy(w)-1)<1e-6||gy(a-f)<1e-6?(a+f)/2:vy(b,x),E=t(M,k),D=E[0],C=E[1],F=D-r,S=C-i,B=y*F-v*S;(B*B/_>e||gy((v*F+y*S)/_-.5)>.3||u*h+o*d+s*p<Db)&&(n(r,i,a,u,o,s,D,C,M,x/=A,b/=A,w,g,m),m.point(D,C),n(D,C,M,x,b,w,l,c,f,h,d,p,g,m))}}return function(e){var r,i,a,u,o,s,l,c,f,h,d,p,g={point:m,lineStart:v,lineEnd:_,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){c=NaN,g.point=y,e.lineStart()}function y(r,i){var a=Xy([r,i]),u=t(r,i);n(c,f,l,h,d,p,c=u[0],f=u[1],l=r,h=a[0],d=a[1],p=a[2],16,e),e.point(c,f)}function _(){g.point=m,e.lineEnd()}function x(){v(),g.point=b,g.lineEnd=w}function b(t,e){y(r=t,e),i=c,a=f,u=h,o=d,s=p,g.point=y}function w(){n(c,f,l,h,d,p,i,a,r,u,o,s,16,e),g.lineEnd=_,_()}return g}}(t,e):function(t){return xb({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Fb=xb({point:function(t,e){this.stream.point(t*py,e*py)}});function Sb(t,e,n){function r(r,i){return[e+t*r,n-t*i]}return r.invert=function(r,i){return[(r-e)/t,(n-i)/t]},r}function Bb(t,e,n,r){var i=yy(r),a=Ay(r),u=i*t,o=a*t,s=i/t,l=a/t,c=(a*n-i*e)/t,f=(a*e+i*n)/t;function h(t,r){return[u*t-o*r+e,n-o*t-u*r]}return h.invert=function(t,e){return[s*t-l*e+c,f-l*t-s*e]},h}function zb(t){return Tb((function(){return t}))()}function Tb(t){var e,n,r,i,a,u,o,s,l,c,f=150,h=480,d=250,p=0,g=0,m=0,v=0,y=0,_=0,x=null,b=mx,w=null,A=bx,k=.5;function M(t){return s(t[0]*py,t[1]*py)}function E(t){return(t=s.invert(t[0],t[1]))&&[t[0]*dy,t[1]*dy]}function D(){var t=Bb(f,0,0,_).apply(null,e(p,g)),r=(_?Bb:Sb)(f,h-t[0],d-t[1],_);return n=Q_(m,v,y),o=J_(e,r),s=J_(n,o),u=Cb(o,k),C()}function C(){return l=c=null,M}return M.stream=function(t){return l&&c===t?l:l=Fb(function(t){return xb({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(b(u(A(c=t)))))},M.preclip=function(t){return arguments.length?(b=t,x=void 0,C()):b},M.postclip=function(t){return arguments.length?(A=t,w=r=i=a=null,C()):A},M.clipAngle=function(t){return arguments.length?(b=+t?vx(x=t*py):(x=null,mx),C()):x*dy},M.clipExtent=function(t){return arguments.length?(A=null==t?(w=r=i=a=null,bx):yx(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),C()):null==w?null:[[w,r],[i,a]]},M.scale=function(t){return arguments.length?(f=+t,D()):f},M.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],D()):[h,d]},M.center=function(t){return arguments.length?(p=t[0]%360*py,g=t[1]%360*py,D()):[p*dy,g*dy]},M.rotate=function(t){return arguments.length?(m=t[0]%360*py,v=t[1]%360*py,y=t.length>2?t[2]%360*py:0,D()):[m*dy,v*dy,y*dy]},M.angle=function(t){return arguments.length?(_=t%360*py,D()):_*dy},M.precision=function(t){return arguments.length?(u=Cb(o,k=t*t),C()):My(k)},M.fitExtent=function(t,e){return Ab(M,t,e)},M.fitSize=function(t,e){return kb(M,t,e)},M.fitWidth=function(t,e){return Mb(M,t,e)},M.fitHeight=function(t,e){return Eb(M,t,e)},function(){return e=t.apply(this,arguments),M.invert=e.invert&&E,D()}}function Nb(t){var e=0,n=ly/3,r=Tb(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*py,n=t[1]*py):[e*dy,n*dy]},i}function Ob(t,e){var n=Ay(t),r=(n+Ay(e))/2;if(gy(r)<1e-6)return function(t){var e=yy(t);function n(t,n){return[t*e,Ay(n)/e]}return n.invert=function(t,n){return[t/e,Cy(n*e)]},n}(t);var i=1+n*(2*r-n),a=My(i)/r;function u(t,e){var n=My(i-2*r*Ay(e))/r;return[n*Ay(t*=r),a-n*yy(t)]}return u.invert=function(t,e){var n=a-e;return[vy(t,gy(n))/r*ky(n),Cy((i-(t*t+n*n)*r*r)/(2*r))]},u}function Rb(){return Nb(Ob).scale(155.424).center([0,33.6442])}function qb(){return Rb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ub(t){return function(e,n){var r=yy(e),i=yy(n),a=t(r*i);return[a*i*Ay(e),a*Ay(n)]}}function Lb(t){return function(e,n){var r=My(e*e+n*n),i=t(r),a=Ay(i),u=yy(i);return[vy(e*a,r*u),Cy(r&&n*a/r)]}}var Pb=Ub((function(t){return My(2/(1+t))}));Pb.invert=Lb((function(t){return 2*Cy(t/2)}));var $b=Ub((function(t){return(t=Dy(t))&&t/Ay(t)}));function jb(t,e){return[t,by(Ey((cy+e)/2))]}function Ib(t){var e,n,r,i=zb(t),a=i.center,u=i.scale,o=i.translate,s=i.clipExtent,l=null;function c(){var a=ly*u(),o=i(function(t){function e(e){return(e=t(e[0]*py,e[1]*py))[0]*=dy,e[1]*=dy,e}return t=Q_(t[0]*py,t[1]*py,t.length>2?t[2]*py:0),e.invert=function(e){return(e=t.invert(e[0]*py,e[1]*py))[0]*=dy,e[1]*=dy,e},e}(i.rotate()).invert([0,0]));return s(null==l?[[o[0]-a,o[1]-a],[o[0]+a,o[1]+a]]:t===jb?[[Math.max(o[0]-a,l),e],[Math.min(o[0]+a,n),r]]:[[l,Math.max(o[1]-a,e)],[n,Math.min(o[1]+a,r)]])}return i.scale=function(t){return arguments.length?(u(t),c()):u()},i.translate=function(t){return arguments.length?(o(t),c()):o()},i.center=function(t){return arguments.length?(a(t),c()):a()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function Hb(t){return Ey((cy+t)/2)}function Wb(t,e){var n=yy(t),r=t===e?Ay(t):by(n/yy(e))/by(Hb(e)/Hb(t)),i=n*wy(Hb(t),r)/r;if(!r)return jb;function a(t,e){i>0?e<1e-6-cy&&(e=1e-6-cy):e>cy-1e-6&&(e=cy-1e-6);var n=i/wy(Hb(e),r);return[n*Ay(r*t),i-n*yy(r*t)]}return a.invert=function(t,e){var n=i-e,a=ky(r)*My(t*t+n*n);return[vy(t,gy(n))/r*ky(n),2*my(wy(i/a,1/r))-cy]},a}function Yb(t,e){return[t,e]}function Vb(t,e){var n=yy(t),r=t===e?Ay(t):(n-yy(e))/(e-t),i=n/r+t;if(gy(r)<1e-6)return Yb;function a(t,e){var n=i-e,a=r*t;return[n*Ay(a),i-n*yy(a)]}return a.invert=function(t,e){var n=i-e;return[vy(t,gy(n))/r*ky(n),i-ky(r)*My(t*t+n*n)]},a}$b.invert=Lb((function(t){return t})),jb.invert=function(t,e){return[t,2*my(xy(e))-cy]},Yb.invert=Yb;var Gb=1.340264,Xb=-.081106,Jb=893e-6,Zb=.003796,Qb=My(3)/2;function Kb(t,e){var n=Cy(Qb*Ay(e)),r=n*n,i=r*r*r;return[t*yy(n)/(Qb*(Gb+3*Xb*r+i*(7*Jb+9*Zb*r))),n*(Gb+Xb*r+i*(Jb+Zb*r))]}function tw(t,e){var n=yy(e),r=yy(t)*n;return[n*Ay(t)/r,Ay(e)/r]}function ew(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?bx:xb({point:function(i,a){this.stream.point(i*t+n,a*e+r)}})}function nw(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function rw(t,e){return[yy(e)*Ay(t),Ay(e)]}function iw(t,e){var n=yy(e),r=1+yy(t)*n;return[n*Ay(t)/r,Ay(e)/r]}function aw(t,e){return[by(Ey((cy+e)/2)),-t]}Kb.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,u=0;u<12&&(a=(i=(r-=n=(r*(Gb+Xb*i+a*(Jb+Zb*i))-e)/(Gb+3*Xb*i+a*(7*Jb+9*Zb*i)))*r)*i*i,!(gy(n)<1e-12));++u);return[Qb*t*(Gb+3*Xb*i+a*(7*Jb+9*Zb*i))/yy(r),Cy(Ay(r)/Qb)]},tw.invert=Lb(my),nw.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,u=a*a;r-=n=(r*(1.007226+a*(.015085+u*(.028874*a-.044475-.005916*u)))-e)/(1.007226+a*(.045255+u*(.259866*a-.311325-.005916*11*u)))}while(gy(n)>1e-6&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]},rw.invert=Lb(Cy),iw.invert=Lb((function(t){return 2*my(t)})),aw.invert=function(t,e){return[-e,2*my(xy(t))-cy]};var uw=Math.abs,ow=Math.cos,sw=Math.sin,lw=Math.PI,cw=lw/2,fw=function(t){return t>0?Math.sqrt(t):0}(2);function hw(t){return t>1?cw:t<-1?-cw:Math.asin(t)}function dw(t,e){var n,r=t*sw(e),i=30;do{e-=n=(e+sw(e)-r)/(1+ow(e))}while(uw(n)>1e-6&&--i>0);return e/2}var pw=function(t,e,n){function r(r,i){return[t*r*ow(i=dw(n,i)),e*sw(i)]}return r.invert=function(r,i){return i=hw(i/e),[r/(t*ow(i)),hw((2*i+sw(2*i))/n)]},r}(fw/cw,fw,lw);var gw=_b(),mw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vw(t,e){return function n(){var r=e();return r.type=t,r.path=_b().projection(r),r.copy=r.copy||function(){var t=n();return mw.forEach((function(e){r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},r}}function yw(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(xw[t]=vw(t,e),this):xw[t]||null}function _w(t){return t&&t.path||gw}var xw={albers:qb,albersusa:function(){var t,e,n,r,i,a,u=qb(),o=Rb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Rb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){a=[t,e]}};function c(t){var e=t[0],u=t[1];return a=null,n.point(e,u),a||(r.point(e,u),a)||(i.point(e,u),a)}function f(){return t=e=null,c}return c.invert=function(t){var e=u.scale(),n=u.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:u).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[u.stream(e=n),o.stream(n),s.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},c.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),s.precision(t),f()):u.precision()},c.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),s.scale(t),c.translate(u.translate())):u.scale()},c.translate=function(t){if(!arguments.length)return u.translate();var e=u.scale(),a=+t[0],c=+t[1];return n=u.translate(t).clipExtent([[a-.455*e,c-.238*e],[a+.455*e,c+.238*e]]).stream(l),r=o.translate([a-.307*e,c+.201*e]).clipExtent([[a-.425*e+1e-6,c+.12*e+1e-6],[a-.214*e-1e-6,c+.234*e-1e-6]]).stream(l),i=s.translate([a-.205*e,c+.212*e]).clipExtent([[a-.214*e+1e-6,c+.166*e+1e-6],[a-.115*e-1e-6,c+.234*e-1e-6]]).stream(l),f()},c.fitExtent=function(t,e){return Ab(c,t,e)},c.fitSize=function(t,e){return kb(c,t,e)},c.fitWidth=function(t,e){return Mb(c,t,e)},c.fitHeight=function(t,e){return Eb(c,t,e)},c.scale(1070)},azimuthalequalarea:function(){return zb(Pb).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return zb($b).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Nb(Wb).scale(109.5).parallels([30,30])},conicequalarea:Rb,conicequidistant:function(){return Nb(Vb).scale(131.154).center([0,13.9389])},equalEarth:function(){return zb(Kb).scale(177.158)},equirectangular:function(){return zb(Yb).scale(152.63)},gnomonic:function(){return zb(tw).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,a,u=1,o=0,s=0,l=1,c=1,f=bx,h=null,d=bx;function p(){return r=i=null,a}return a={stream:function(t){return r&&i===t?r:r=f(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=e=n=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=e=n=null,bx):yx(h=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==h?null:[[h,t],[e,n]]},scale:function(t){return arguments.length?(f=ew((u=+t)*l,u*c,o,s),p()):u},translate:function(t){return arguments.length?(f=ew(u*l,u*c,o=+t[0],s=+t[1]),p()):[o,s]},reflectX:function(t){return arguments.length?(f=ew(u*(l=t?-1:1),u*c,o,s),p()):l<0},reflectY:function(t){return arguments.length?(f=ew(u*l,u*(c=t?-1:1),o,s),p()):c<0},fitExtent:function(t,e){return Ab(a,t,e)},fitSize:function(t,e){return kb(a,t,e)},fitWidth:function(t,e){return Mb(a,t,e)},fitHeight:function(t,e){return Eb(a,t,e)}}},mercator:function(){return Ib(jb).scale(961/hy)},mollweide:function(){return zb(pw).scale(169.529)},naturalEarth1:function(){return zb(nw).scale(175.295)},orthographic:function(){return zb(rw).scale(249.5).clipAngle(90+1e-6)},stereographic:function(){return zb(iw).scale(250).clipAngle(142)},transversemercator:function(){var t=Ib(aw),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(var bw in xw)yw(bw,xw[bw]);function ww(t){Hr.call(this,null,t)}function Aw(t){Hr.call(this,null,t)}function kw(t){Hr.call(this,null,t)}function Mw(t){Hr.call(this,[],t),this.generator=function(){var t,e,n,r,i,a,u,o,s,l,c,f,h=10,d=h,p=90,g=360,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return fx(_y(r/p)*p,n,p).map(c).concat(fx(_y(o/g)*g,u,g).map(f)).concat(fx(_y(e/h)*h,t,h).filter((function(t){return gy(t%p)>1e-6})).map(s)).concat(fx(_y(a/d)*d,i,d).filter((function(t){return gy(t%g)>1e-6})).map(l))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(u).slice(1),c(n).reverse().slice(1),f(o).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],o=+t[0][1],u=+t[1][1],r>n&&(t=r,r=n,n=t),o>u&&(t=o,o=u,u=t),v.precision(m)):[[r,o],[n,u]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),v.precision(m)):[[e,a],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(m=+h,s=_x(a,i,90),l=xx(e,t,m),c=_x(o,u,90),f=xx(r,n,m),v):m},v.extentMajor([[-180,1e-6-90],[180,90-1e-6]]).extentMinor([[-180,-80-1e-6],[180,80+1e-6]])}()}function Ew(t){Hr.call(this,null,t)}function Dw(t){if(!W(t))return!1;const e=xt(r(t));return e.$x||e.$y||e.$value||e.$max}function Cw(t){Hr.call(this,null,t),this.modified(!0)}function Fw(t,e,n){W(t[e])&&t[e](n)}ww.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},rt(ww,Hr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||d,a=t.as||"path",u=n.SOURCE;!r||t.modified()?(this.value=r=_w(t.projection),n.materialize().reflow()):u=i===d||e.modified(i.fields)?n.ADD_MOD:n.ADD;var o=function(t,e){var n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(u,(function(t){t[a]=r(i(t))})),r.pointRadius(o),n.modifies(a)},Aw.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},rt(Aw,Hr).transform=function(t,e){var n,r=t.projection,i=t.fields[0],a=t.fields[1],u=t.as||["x","y"],o=u[0],s=u[1];function l(t){var e=r([i(t),a(t)]);e?(t[o]=e[0],t[s]=e[1]):(t[o]=void 0,t[s]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(a.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(u)},kw.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},rt(kw,Hr).transform=function(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",a=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){var r=null==n?function(n){return t(e(n))}:function(r){var i=t.pointRadius(),a=t.pointRadius(n)(e(r));return t.pointRadius(i),a};return r.context=function(e){return t.context(e),r},r}(_w(t.projection),t.field||c("datum"),t.pointRadius),n.materialize().reflow(),a=n.SOURCE),n.visit(a,(function(t){t[i]=r})),n.modifies(i)},Mw.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},rt(Mw,Hr).transform=function(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(var a in t)W(i[a])&&i[a](t[a]);return n=i(),r.length?e.mod.push(Tt(r[0],n)):e.add.push(St(n)),r[0]=n,e},Ew.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},rt(Ew,Hr).transform=function(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||d,a=function(t,e){let n;W(t)?(n=n=>t(n,e),n.dep=Dw(t)):t?n=V(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),u=function(t,e){let n;W(t)?(n=n=>ap(t(n,e)),n.dep=Dw(t)):n=V(ap(t||"#888"));return n}(t.color,t),o=t.as||"image",s={$x:0,$y:0,$value:0,$max:r?mi(n.map(t=>mi(i(t).values))):0};return n.forEach(t=>{const e=i(t),n=X({},t,s);r||(n.$max=mi(e.values||[])),t[o]=function(t,e,n,r){const i=t.width,a=t.height,u=t.x1||0,o=t.y1||0,s=t.x2||i,l=t.y2||a,c=t.values,f=c?t=>c[t]:p,h=Vo(s-u,l-o),d=h.getContext("2d"),g=d.getImageData(0,0,s-u,l-o),m=g.data;for(let t=o,a=0;t<l;++t){e.$y=t-o;for(let o=u,l=t*i;o<s;++o,a+=4){e.$x=o-u,e.$value=f(o+l);const t=n(e);m[a+0]=t.r,m[a+1]=t.g,m[a+2]=t.b,m[a+3]=~~(255*r(e))}}return d.putImageData(g,0,0),h}(e,n,u.dep?u:V(u(n)),a.dep?a:V(a(n)))}),e.reflow(!0).modifies(o)},rt(Cw,Hr).transform=function(t,e){var n=this.value;return!n||t.modified("type")?(this.value=n=function(t){var e=yw((t||"mercator").toLowerCase());e||i("Unrecognized projection type: "+t);return e()}(t.type),mw.forEach((function(e){null!=t[e]&&Fw(n,e,t[e])}))):mw.forEach((function(e){t.modified(e)&&Fw(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){var n=function(t){return 1===(t=I(t)).length?t[0]:{type:"FeatureCollection",features:t.reduce((t,e)=>t.concat(function(t){return"FeatureCollection"===t.type?t.features:I(t).filter(t=>null!=t).map(t=>"Feature"===t.type?t:{type:"Feature",geometry:t})}(e)),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)};var Sw=Object.freeze({__proto__:null,contour:ry,geojson:iy,geopath:ww,geopoint:Aw,geoshape:kw,graticule:Mw,heatmap:Ew,isocontour:Yv,kde2d:Kv,projection:Cw});function Bw(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a,u,o,s,l,c,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(a=(g+v)/2))?g=a:v=a,(c=n>=(u=(m+y)/2))?m=u:y=u,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(o=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===o&&n===s)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),(l=e>=(a=(g+v)/2))?g=a:v=a,(c=n>=(u=(m+y)/2))?m=u:y=u}while((f=c<<1|l)==(h=(s>=u)<<1|o>=a));return i[h]=d,i[f]=p,t}function zw(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Tw(t){return t[0]}function Nw(t){return t[1]}function Ow(t,e,n){var r=new Rw(null==e?Tw:e,null==n?Nw:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Rw(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function qw(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Uw=Ow.prototype=Rw.prototype;function Lw(t){return function(){return t}}function Pw(){return 1e-6*(Math.random()-.5)}function $w(t){return t.x+t.vx}function jw(t){return t.y+t.vy}function Iw(t){return t.index}function Hw(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}Uw.copy=function(){var t,e,n=new Rw(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=qw(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=qw(e));return n},Uw.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Bw(this.cover(e,n),e,n,t)},Uw.addAll=function(t){var e,n,r,i,a=t.length,u=new Array(a),o=new Array(a),s=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(u[n]=r,o[n]=i,r<s&&(s=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),n=0;n<a;++n)Bw(this,u[n],o[n],t[n]);return this},Uw.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var u,o,s=i-n,l=this._root;n>t||t>=i||r>e||e>=a;)switch(o=(e<r)<<1|t<n,(u=new Array(4))[o]=l,l=u,s*=2,o){case 0:i=n+s,a=r+s;break;case 1:n=i-s,a=r+s;break;case 2:i=n+s,r=a-s;break;case 3:n=i-s,r=a-s}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this},Uw.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Uw.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]]},Uw.find=function(t,e,n){var r,i,a,u,o,s,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new zw(g,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(g=s.node)||(i=s.x0)>h||(a=s.y0)>d||(u=s.x1)<c||(o=s.y1)<f))if(g.length){var m=(i+u)/2,v=(a+o)/2;p.push(new zw(g[3],m,v,u,o),new zw(g[2],i,v,m,o),new zw(g[1],m,a,u,v),new zw(g[0],i,a,m,v)),(l=(e>=v)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var y=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),x=y*y+_*_;if(x<n){var b=Math.sqrt(n=x);c=t-b,f=e-b,h=t+b,d=e+b,r=g.data}}return r},Uw.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var e,n,r,i,a,u,o,s,l,c,f,h,d=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!d)return this;if(d.length)for(;;){if((l=a>=(o=(p+m)/2))?p=o:m=o,(c=u>=(s=(g+v)/2))?g=s:v=s,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.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&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},Uw.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Uw.root=function(){return this._root},Uw.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Uw.visit=function(t){var e,n,r,i,a,u,o=[],s=this._root;for(s&&o.push(new zw(s,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,a=e.x1,u=e.y1)&&s.length){var l=(r+a)/2,c=(i+u)/2;(n=s[3])&&o.push(new zw(n,l,c,a,u)),(n=s[2])&&o.push(new zw(n,r,c,l,u)),(n=s[1])&&o.push(new zw(n,l,i,a,c)),(n=s[0])&&o.push(new zw(n,r,i,l,c))}return this},Uw.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new zw(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var a,u=e.x0,o=e.y0,s=e.x1,l=e.y1,c=(u+s)/2,f=(o+l)/2;(a=i[0])&&n.push(new zw(a,u,o,c,f)),(a=i[1])&&n.push(new zw(a,c,o,s,f)),(a=i[2])&&n.push(new zw(a,u,f,c,l)),(a=i[3])&&n.push(new zw(a,c,f,s,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Uw.x=function(t){return arguments.length?(this._x=t,this):this._x},Uw.y=function(t){return arguments.length?(this._y=t,this):this._y};var Ww={value:function(){}};function Yw(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Vw(r)}function Vw(t){this._=t}function Gw(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Xw(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Jw(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ww,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Vw.prototype=Yw.prototype={constructor:Vw,on:function(t,e){var n,r=this._,i=Gw(t+"",r),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)r[n]=Jw(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Jw(r[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=Xw(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Vw(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Zw,Qw,Kw=0,tA=0,eA=0,nA=0,rA=0,iA=0,aA="object"==typeof performance&&performance.now?performance:Date,uA="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function oA(){return rA||(uA(sA),rA=aA.now()+iA)}function sA(){rA=0}function lA(){this._call=this._time=this._next=null}function cA(t,e,n){var r=new lA;return r.restart(t,e,n),r}function fA(){rA=(nA=aA.now())+iA,Kw=tA=0;try{!function(){oA(),++Kw;for(var t,e=Zw;e;)(t=rA-e._time)>=0&&e._call.call(null,t),e=e._next;--Kw}()}finally{Kw=0,function(){var t,e,n=Zw,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Zw=e);Qw=t,dA(r)}(),rA=0}}function hA(){var t=aA.now(),e=t-nA;e>1e3&&(iA-=e,nA=t)}function dA(t){Kw||(tA&&(tA=clearTimeout(tA)),t-rA>24?(t<1/0&&(tA=setTimeout(fA,t-aA.now()-iA)),eA&&(eA=clearInterval(eA))):(eA||(nA=aA.now(),eA=setInterval(hA,1e3)),Kw=1,uA(fA)))}function pA(t){return t.x}function gA(t){return t.y}lA.prototype=cA.prototype={constructor:lA,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?oA():+n)+(null==e?0:+e),this._next||Qw===this||(Qw?Qw._next=this:Zw=this,Qw=this),this._call=t,this._time=n,dA()},stop:function(){this._call&&(this._call=null,this._time=1/0,dA())}};var mA=Math.PI*(3-Math.sqrt(5));var vA={center:function(t,e){var n;function r(){var r,i,a=n.length,u=0,o=0;for(r=0;r<a;++r)u+=(i=n[r]).x,o+=i.y;for(u=u/a-t,o=o/a-e,r=0;r<a;++r)(i=n[r]).x-=u,i.y-=o}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},collide:function(t){var e,n,r=1,i=1;function a(){for(var t,a,o,s,l,c,f,h=e.length,d=0;d<i;++d)for(a=Ow(e,$w,jw).visitAfter(u),t=0;t<h;++t)o=e[t],c=n[o.index],f=c*c,s=o.x+o.vx,l=o.y+o.vy,a.visit(p);function p(t,e,n,i,a){var u=t.data,h=t.r,d=c+h;if(!u)return e>s+d||i<s-d||n>l+d||a<l-d;if(u.index>o.index){var p=s-u.x-u.vx,g=l-u.y-u.vy,m=p*p+g*g;m<d*d&&(0===p&&(m+=(p=Pw())*p),0===g&&(m+=(g=Pw())*g),m=(d-(m=Math.sqrt(m)))/m*r,o.vx+=(p*=m)*(d=(h*=h)/(f+h)),o.vy+=(g*=m)*d,u.vx-=p*(d=1-d),u.vy-=g*d)}}}function u(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 o(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r<a;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Lw(null==t?1:+t)),a.initialize=function(t){e=t,o()},a.iterations=function(t){return arguments.length?(i=+t,a):i},a.strength=function(t){return arguments.length?(r=+t,a):r},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Lw(+e),o(),a):t},a},nbody:function(){var t,e,n,r,i=Lw(-30),a=1,u=1/0,o=.81;function s(r){var i,a=t.length,u=Ow(t,pA,gA).visitAfter(c);for(n=r,i=0;i<a;++i)e=t[i],u.visit(f)}function l(){if(t){var e,n,a=t.length;for(r=new Array(a),e=0;e<a;++e)n=t[e],r[n.index]=+i(n,e,t)}}function c(t){var e,n,i,a,u,o=0,s=0;if(t.length){for(i=a=u=0;u<4;++u)(e=t[u])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,i+=n*e.x,a+=n*e.y);t.x=i/s,t.y=a/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{o+=r[e.data.index]}while(e=e.next)}t.value=o}function f(t,i,s,l){if(!t.value)return!0;var c=t.x-e.x,f=t.y-e.y,h=l-i,d=c*c+f*f;if(h*h/o<d)return d<u&&(0===c&&(d+=(c=Pw())*c),0===f&&(d+=(f=Pw())*f),d<a&&(d=Math.sqrt(a*d)),e.vx+=c*t.value*n/d,e.vy+=f*t.value*n/d),!0;if(!(t.length||d>=u)){(t.data!==e||t.next)&&(0===c&&(d+=(c=Pw())*c),0===f&&(d+=(f=Pw())*f),d<a&&(d=Math.sqrt(a*d)));do{t.data!==e&&(h=r[t.data.index]*n/d,e.vx+=c*h,e.vy+=f*h)}while(t=t.next)}}return s.initialize=function(e){t=e,l()},s.strength=function(t){return arguments.length?(i="function"==typeof t?t:Lw(+t),l(),s):i},s.distanceMin=function(t){return arguments.length?(a=t*t,s):Math.sqrt(a)},s.distanceMax=function(t){return arguments.length?(u=t*t,s):Math.sqrt(u)},s.theta=function(t){return arguments.length?(o=t*t,s):Math.sqrt(o)},s},link:function(t){var e,n,r,i,a,u=Iw,o=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},s=Lw(30),l=1;function c(r){for(var i=0,u=t.length;i<l;++i)for(var o,s,c,f,h,d,p,g=0;g<u;++g)s=(o=t[g]).source,f=(c=o.target).x+c.vx-s.x-s.vx||Pw(),h=c.y+c.vy-s.y-s.vy||Pw(),f*=d=((d=Math.sqrt(f*f+h*h))-n[g])/d*r*e[g],h*=d,c.vx-=f*(p=a[g]),c.vy-=h*p,s.vx+=f*(p=1-p),s.vy+=h*p}function f(){if(r){var o,s,l=r.length,c=t.length,f=new Map(r.map((t,e)=>[u(t,e,r),t]));for(o=0,i=new Array(l);o<c;++o)(s=t[o]).index=o,"object"!=typeof s.source&&(s.source=Hw(f,s.source)),"object"!=typeof s.target&&(s.target=Hw(f,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(o=0,a=new Array(c);o<c;++o)s=t[o],a[o]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(c),h(),n=new Array(c),d()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+o(t[n],n,t)}function d(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+s(t[e],e,t)}return null==t&&(t=[]),c.initialize=function(t){r=t,f()},c.links=function(e){return arguments.length?(t=e,f(),c):t},c.id=function(t){return arguments.length?(u=t,c):u},c.iterations=function(t){return arguments.length?(l=+t,c):l},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:Lw(+t),h(),c):o},c.distance=function(t){return arguments.length?(s="function"==typeof t?t:Lw(+t),d(),c):s},c},x:function(t){var e,n,r,i=Lw(.1);function a(t){for(var i,a=0,u=e.length;a<u;++a)(i=e[a]).vx+=(r[a]-i.x)*n[a]*t}function u(){if(e){var a,u=e.length;for(n=new Array(u),r=new Array(u),a=0;a<u;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Lw(null==t?0:+t)),a.initialize=function(t){e=t,u()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Lw(+t),u(),a):i},a.x=function(e){return arguments.length?(t="function"==typeof e?e:Lw(+e),u(),a):t},a},y:function(t){var e,n,r,i=Lw(.1);function a(t){for(var i,a=0,u=e.length;a<u;++a)(i=e[a]).vy+=(r[a]-i.y)*n[a]*t}function u(){if(e){var a,u=e.length;for(n=new Array(u),r=new Array(u),a=0;a<u;++a)n[a]=isNaN(r[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return"function"!=typeof t&&(t=Lw(null==t?0:+t)),a.initialize=function(t){e=t,u()},a.strength=function(t){return arguments.length?(i="function"==typeof t?t:Lw(+t),u(),a):i},a.y=function(e){return arguments.length?(t="function"==typeof e?e:Lw(+e),u(),a):t},a}},yA=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],_A=["static","iterations"],xA=["x","y","vx","vy"];function bA(t){Hr.call(this,null,t)}bA.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:xA}]};var wA=rt(bA,Hr);function AA(t,e,n,r){var i,a,u,o,s=I(e.forces);for(i=0,a=yA.length;i<a;++i)"forces"!==(u=yA[i])&&e.modified(u)&&t[u](e[u]);for(i=0,a=s.length;i<a;++i)o="forces"+i,(u=n||e.modified("forces",i)?MA(s[i]):r&&kA(s[i],r)?t.force(o):null)&&t.force(o,u);for(a=t.numForces||0;i<a;++i)t.force("forces"+i,null);return t.numForces=s.length,t}function kA(t,e){var n,i;for(n in t)if(W(i=t[n])&&e.modified(r(i)))return 1;return 0}function MA(t){var e,n;for(n in K(vA,t.force)||i("Unrecognized force: "+t.force),e=vA[t.force](),t)W(e[n])&&EA(e[n],t[n],t);return e}function EA(t,e,n){t(W(e)?function(t){return e(t,n)}:e)}wA.transform=function(t,e){var n,r,i=this.value,a=e.changed(e.ADD_REM),u=t.modified(yA),o=t.iterations||300;if(i?(a&&(e.modifies("index"),i.nodes(e.source)),(u||e.changed(e.MOD))&&AA(i,t,0,e)):(this.value=i=function(t,e){var n=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,u=.6,o=new Map,s=cA(c),l=Yw("tick","end");function c(){f(),l.call("tick",e),n<r&&(s.stop(),l.call("end",e))}function f(r){var s,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(a-n)*i,o.forEach((function(t){t(n)})),s=0;s<c;++s)null==(l=t[s]).fx?l.x+=l.vx*=u:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=u:(l.y=l.fy,l.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(n),a=n*mA;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t),e}return null==t&&(t=[]),h(),e={tick:f,restart:function(){return s.restart(c),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),o.forEach(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(u=1-t,e):1-u},force:function(t,n){return arguments.length>1?(null==n?o.delete(t):o.set(t,d(n)),e):o.get(t)},find:function(e,n,r){var i,a,u,o,s,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(u=(i=e-(o=t[l]).x)*i+(a=n-o.y)*a)<r&&(s=o,r=u);return s},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}(t),r=!1,i=n.stop,a=n.restart;return n.stopped=function(){return r},n.restart=function(){return r=!1,a()},n.stop=function(){return r=!0,i()},AA(n,e,!0).on("end",(function(){r=!0}))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,function(){n.touch(r).run()})),t.static||(a=!0,i.tick()),e.modifies("index")),u||a||t.modified(_A)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/o)),t.static)for(i.stop();--o>=0;)i.tick();else if(i.stopped()&&i.restart(),!a)return e.StopPropagation;return this.finish(t,e)},wA.finish=function(t,e){for(var n,r=e.dataflow,i=this._argops,a=0,u=i.length;a<u;++a)if("forces"===(n=i[a]).name&&"link"===n.op._argval.force)for(var o,s=n.op._argops,l=0,c=s.length;l<c;++l)if("links"===s[l].name&&(o=s[l].op.source)){r.pulse(o,r.changeset().reflow());break}return e.reflow(t.modified()).modifies(xA)};var DA=Object.freeze({__proto__:null,force:bA});function CA(t,e,n){var r={};return t.each((function(t){var i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t}function FA(t,e){return t.parent===e.parent?1:2}function SA(t,e){return t+e.x}function BA(t,e){return Math.max(t,e.y)}function zA(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function TA(t,e){var n,r,i,a,u,o=new qA(t),s=+t.value&&(o.value=t.value),l=[o];for(null==e&&(e=NA);n=l.pop();)if(s&&(n.value=+n.data.value),(i=e(n.data))&&(u=i.length))for(n.children=new Array(u),a=u-1;a>=0;--a)l.push(r=n.children[a]=new qA(i[a])),r.parent=n,r.depth=n.depth+1;return o.eachBefore(RA)}function NA(t){return t.children}function OA(t){t.data=t.data.data}function RA(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function qA(t){this.data=t,this.depth=this.height=0,this.parent=null}qA.prototype=TA.prototype={constructor:qA,count:function(){return this.eachAfter(zA)},each:function(t){var e,n,r,i,a=this,u=[a];do{for(e=u.reverse(),u=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r<i;++r)u.push(n[r])}while(u.length);return this},eachAfter:function(t){for(var e,n,r,i=this,a=[i],u=[];i=a.pop();)if(u.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n]);for(;i=u.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return TA(this).eachBefore(OA)}};var UA=Array.prototype.slice;function LA(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(UA.call(t))).length,a=[];r<i;)e=t[r],n&&jA(n,e)?++r:(n=HA(a=PA(a,e)),r=0);return n}function PA(t,e){var n,r;if(IA(e,t))return[e];for(n=0;n<t.length;++n)if($A(e,t[n])&&IA(WA(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if($A(WA(t[n],t[r]),e)&&$A(WA(t[n],e),t[r])&&$A(WA(t[r],e),t[n])&&IA(YA(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function $A(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function jA(t,e){var n=t.r-e.r+1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function IA(t,e){for(var n=0;n<e.length;++n)if(!jA(t,e[n]))return!1;return!0}function HA(t){switch(t.length){case 1:return{x:(e=t[0]).x,y:e.y,r:e.r};case 2:return WA(t[0],t[1]);case 3:return YA(t[0],t[1],t[2])}var e}function WA(t,e){var n=t.x,r=t.y,i=t.r,a=e.x,u=e.y,o=e.r,s=a-n,l=u-r,c=o-i,f=Math.sqrt(s*s+l*l);return{x:(n+a+s/f*c)/2,y:(r+u+l/f*c)/2,r:(f+i+o)/2}}function YA(t,e,n){var r=t.x,i=t.y,a=t.r,u=e.x,o=e.y,s=e.r,l=n.x,c=n.y,f=n.r,h=r-u,d=r-l,p=i-o,g=i-c,m=s-a,v=f-a,y=r*r+i*i-a*a,_=y-u*u-o*o+s*s,x=y-l*l-c*c+f*f,b=d*p-h*g,w=(p*x-g*_)/(2*b)-r,A=(g*m-p*v)/b,k=(d*_-h*x)/(2*b)-i,M=(h*v-d*m)/b,E=A*A+M*M-1,D=2*(a+w*A+k*M),C=w*w+k*k-a*a,F=-(E?(D+Math.sqrt(D*D-4*E*C))/(2*E):C/D);return{x:r+w+A*F,y:i+k+M*F,r:F}}function VA(t,e,n){var r,i,a,u,o=t.x-e.x,s=t.y-e.y,l=o*o+s*s;l?(i=e.r+n.r,i*=i,u=t.r+n.r,i>(u*=u)?(r=(l+u-i)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=t.x-r*o-a*s,n.y=t.y-r*s+a*o):(r=(l+i-u)/(2*l),a=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*o-a*s,n.y=e.y+r*s+a*o)):(n.x=e.x+n.r,n.y=e.y)}function GA(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function XA(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function JA(t){this._=t,this.next=null,this.previous=null}function ZA(t){return null==t?null:QA(t)}function QA(t){if("function"!=typeof t)throw new Error;return t}function KA(){return 0}function tk(t){return function(){return t}}function ek(t){return Math.sqrt(t.value)}function nk(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function rk(t,e){return function(n){if(r=n.children){var r,i,a,u=r.length,o=t(n)*e||0;if(o)for(i=0;i<u;++i)r[i].r+=o;if(a=function(t){if(!(i=t.length))return 0;var e,n,r,i,a,u,o,s,l,c,f;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;VA(n,e,r=t[2]),e=new JA(e),n=new JA(n),r=new JA(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(o=3;o<i;++o){VA(e._,n._,r=t[o]),r=new JA(r),s=n.next,l=e.previous,c=n._.r,f=e._.r;do{if(c<=f){if(GA(s._,r._)){n=s,e.next=n,n.previous=e,--o;continue t}c+=s._.r,s=s.next}else{if(GA(l._,r._)){(e=l).next=n,n.previous=e,--o;continue t}f+=l._.r,l=l.previous}}while(s!==l.next);for(r.previous=e,r.next=n,e.next=n.previous=n=r,a=XA(e);(r=r.next)!==n;)(u=XA(r))<a&&(e=r,a=u);n=e.next}for(e=[n._],r=n;(r=r.next)!==n;)e.push(r._);for(r=LA(e),o=0;o<i;++o)(e=t[o]).x-=r.x,e.y-=r.y;return r.r}(r),o)for(i=0;i<u;++i)r[i].r-=o;n.r=a+o}}}function ik(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function ak(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function uk(t,e,n,r,i){for(var a,u=t.children,o=-1,s=u.length,l=t.value&&(r-e)/t.value;++o<s;)(a=u[o]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}var ok={depth:-1},sk={};function lk(t){return t.id}function ck(t){return t.parentId}function fk(){var t=lk,e=ck;function n(n){var r,i,a,u,o,s,l,c=n.length,f=new Array(c),h={};for(i=0;i<c;++i)r=n[i],o=f[i]=new qA(r),null!=(s=t(r,i,n))&&(s+="")&&(h[l="$"+(o.id=s)]=l in h?sk:o);for(i=0;i<c;++i)if(o=f[i],null!=(s=e(n[i],i,n))&&(s+="")){if(!(u=h["$"+s]))throw new Error("missing: "+s);if(u===sk)throw new Error("ambiguous: "+s);u.children?u.children.push(o):u.children=[o],o.parent=u}else{if(a)throw new Error("multiple roots");a=o}if(!a)throw new Error("no root");if(a.parent=ok,a.eachBefore((function(t){t.depth=t.parent.depth+1,--c})).eachBefore(RA),a.parent=null,c>0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=QA(e),n):t},n.parentId=function(t){return arguments.length?(e=QA(t),n):e},n}function hk(t,e){return t.parent===e.parent?1:2}function dk(t){var e=t.children;return e?e[0]:t.t}function pk(t){var e=t.children;return e?e[e.length-1]:t.t}function gk(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function mk(t,e,n){return t.a.parent===e.parent?t.a:n}function vk(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function yk(t,e,n,r,i){for(var a,u=t.children,o=-1,s=u.length,l=t.value&&(i-n)/t.value;++o<s;)(a=u[o]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*l}vk.prototype=Object.create(qA.prototype);var _k=(1+Math.sqrt(5))/2;function xk(t,e,n,r,i,a){for(var u,o,s,l,c,f,h,d,p,g,m,v=[],y=e.children,_=0,x=0,b=y.length,w=e.value;_<b;){s=i-n,l=a-r;do{c=y[x++].value}while(!c&&x<b);for(f=h=c,m=c*c*(g=Math.max(l/s,s/l)/(w*t)),p=Math.max(h/m,m/f);x<b;++x){if(c+=o=y[x].value,o<f&&(f=o),o>h&&(h=o),m=c*c*g,(d=Math.max(h/m,m/f))>p){c-=o;break}p=d}v.push(u={value:c,dice:s<l,children:y.slice(_,x)}),u.dice?uk(u,n,r,i,w?r+=l*c/w:a):yk(u,n,r,w?n+=s*c/w:i,a),w-=c,_=x}return v}var bk=function t(e){function n(t,n,r,i,a){xk(e,t,n,r,i,a)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(_k);var wk=function t(e){function n(t,n,r,i,a){if((u=t._squarify)&&u.ratio===e)for(var u,o,s,l,c,f=-1,h=u.length,d=t.value;++f<h;){for(s=(o=u[f]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?uk(o,n,r,i,r+=(a-r)*o.value/d):yk(o,n,r,n+=(i-n)*o.value/d,a),d-=o.value}else t._squarify=u=xk(e,t,n,r,i,a),u.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(_k);function Ak(t){Hr.call(this,null,t)}function kk(t){return t.values}function Mk(){var t,e=[];return t={entries:t=>function t(n,r){if(++r>e.length)return n;var i,a=[];for(i in n)a.push({key:i,values:t(n[i],r)});return a}(function t(n,r){if(r>=e.length)return n;for(var i,a,u,o=-1,s=n.length,l=e[r++],c={},f={};++o<s;)(u=c[i=l(a=n[o])+""])?u.push(a):c[i]=[a];for(i in c)f[i]=t(c[i],r);return f}(t,0),0),key:n=>(e.push(n),t)}}function Ek(t){Hr.call(this,null,t)}function Dk(t,e){return t.parent===e.parent?1:2}Ak.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},rt(Ak,Hr).transform=function(t,e){e.source||i("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),a=e.clone(),u=this.value;return(!u||r||e.changed())&&(u&&u.each(t=>{t.children&&Dt(t.data)&&a.rem.push(t.data)}),this.value=u=TA({values:I(t.keys).reduce((t,e)=>(t.key(e),t),Mk()).entries(a.source)},kk),n&&u.each(t=>{t.children&&(t=St(t.data),a.add.push(t),a.source.push(t))}),CA(u,Ct,Ct)),a.source.root=u,a},rt(Ek,Hr).transform=function(t,e){e.source&&e.source.root||i(this.constructor.name+" transform requires a backing tree data source.");var n=this.layout(t.method),r=this.fields,a=e.source.root,u=t.as||r;t.field?a.sum(t.field):a.count(),t.sort&&a.sort(Nt(t.sort,t=>t.data)),function(t,e,n){for(var r,i=0,a=e.length;i<a;++i)(r=e[i])in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?Dk:g);try{this.value=n(a)}catch(t){i(t)}return a.each((function(t){!function(t,e,n){for(var r=t.data,i=0,a=e.length-1;i<a;++i)r[n[i]]=t[e[i]];r[n[a]]=t.children?t.children.length:0}(t,r,u)})),e.reflow(t.modified()).modifies(u).modifies("leaf")};var Ck=["x","y","r","depth","children"];function Fk(t){Ek.call(this,t)}Fk.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Ck.length,default:Ck}]};var Sk=rt(Fk,Ek);Sk.layout=function(){var t=null,e=1,n=1,r=KA;function i(i){return i.x=e/2,i.y=n/2,t?i.eachBefore(nk(t)).eachAfter(rk(r,.5)).eachBefore(ik(1)):i.eachBefore(nk(ek)).eachAfter(rk(KA,1)).eachAfter(rk(r,i.r/Math.min(e,n))).eachBefore(ik(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=ZA(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:tk(+t),i):r},i},Sk.params=["radius","size","padding"],Sk.fields=Ck;var Bk=["x0","y0","x1","y1","depth","children"];function zk(t){Ek.call(this,t)}zk.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Bk.length,default:Bk}]};var Tk=rt(zk,Ek);function Nk(t){Hr.call(this,null,t)}Tk.layout=function(){var t=1,e=1,n=0,r=!1;function i(i){var a=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(r){r.children&&uk(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,a=r.y0,u=r.x1-n,o=r.y1-n;u<i&&(i=u=(i+u)/2),o<a&&(a=o=(a+o)/2),r.x0=i,r.y0=a,r.x1=u,r.y1=o}}(e,a)),r&&i.eachBefore(ak),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},Tk.params=["size","round","padding"],Tk.fields=Bk,Nk.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},rt(Nk,Hr).transform=function(t,e){e.source||i("Stratify transform requires an upstream data source.");var n=this.value,r=t.modified(),a=e.fork(e.ALL).materialize(e.SOURCE),u=!this.value||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return a.source=a.source.slice(),u&&(n=a.source.length?CA(fk().id(t.key).parentId(t.parentKey)(a.source),t.key,m):CA(fk()([{}]),t.key,t.key)),a.source.root=this.value=n,a};var Ok={tidy:function(){var t=hk,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,a,u=new vk(t,0),o=[u];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)o.push(n=e.children[i]=new vk(r[i],i)),n.parent=e;return(u.parent=new vk(null,0)).children=[u],u}(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(u),r)i.eachBefore(o);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>c.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=l===c?1:t(l,c)/2,d=h-l.x,p=e/(c.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,u=e,o=n,s=a.parent.children[0],l=a.m,c=u.m,f=o.m,h=s.m;o=pk(o),a=dk(a),o&&a;)s=dk(s),(u=pk(u)).a=e,(i=o.z+f-a.z-l+t(o._,a._))>0&&(gk(mk(o,e,r),e,i),l+=i,c+=i),f+=o.m,l+=a.m,h+=s.m,c+=u.m;o&&!pk(u)&&(u.t=o,u.m+=f-c),a&&!dk(s)&&(s.t=a,s.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function u(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function o(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=FA,e=1,n=1,r=!1;function i(i){var a,u=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(SA,0)/t.length}(n),e.y=function(t){return 1+t.reduce(BA,0)}(n)):(e.x=a?u+=t(e,a):0,e.y=0,a=e)}));var o=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=o.x-t(o,s)/2,c=s.x+t(s,o)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},Rk=["x","y","depth","children"];function qk(t){Ek.call(this,t)}qk.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:Rk.length,default:Rk}]};var Uk=rt(qk,Ek);function Lk(t){Hr.call(this,[],t)}Uk.layout=function(t){var e=t||"tidy";if(K(Ok,e))return Ok[e]();i("Unrecognized Tree layout method: "+e)},Uk.params=["size","nodeSize"],Uk.fields=Rk,Lk.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},rt(Lk,Hr).transform=function(t,e){var n=this.value,r=e.source&&e.source.root,a=e.fork(e.NO_SOURCE),u={};return r||i("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(a.rem=n,e.visit(e.SOURCE,(function(t){u[Ct(t)]=1})),r.each((function(t){var e=t.data,n=t.parent&&t.parent.data;n&&u[Ct(e)]&&u[Ct(n)]&&a.add.push(St({source:n,target:e}))})),this.value=a.add):e.changed(e.MOD)&&(e.visit(e.MOD,(function(t){u[Ct(t)]=1})),n.forEach((function(t){(u[Ct(t.source)]||u[Ct(t.target)])&&a.mod.push(t)}))),a};var Pk={binary:function(t,e,n,r,i){var a,u,o=t.children,s=o.length,l=new Array(s+1);for(l[0]=u=a=0;a<s;++a)l[a+1]=u+=o[a].value;!function t(e,n,r,i,a,u,s){if(e>=n-1){var c=o[e];return c.x0=i,c.y0=a,c.x1=u,void(c.y1=s)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var m=l[d]-f,v=r-m;if(u-i>s-a){var y=(i*v+u*m)/r;t(e,d,m,i,a,y,s),t(d,n,v,y,a,u,s)}else{var _=(a*v+s*m)/r;t(e,d,m,i,a,u,_),t(d,n,v,i,_,u,s)}}(0,s,t.value,e,n,r,i)},dice:uk,slice:yk,slicedice:function(t,e,n,r,i){(1&t.depth?yk:uk)(t,e,n,r,i)},squarify:bk,resquarify:wk},$k=["x0","y0","x1","y1","depth","children"];function jk(t){Ek.call(this,t)}jk.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:$k.length,default:$k}]};var Ik=rt(jk,Ek);Ik.layout=function(){var t=function(){var t=bk,e=!1,n=1,r=1,i=[0],a=KA,u=KA,o=KA,s=KA,l=KA;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(ak),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=a(e)/2,r+=l(e)-n,c+=u(e)-n,(f-=o(e)-n)<r&&(r=f=(r+f)/2),(h-=s(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,f,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=QA(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:tk(+t),c):a},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:tk(+t),c):u},c.paddingRight=function(t){return arguments.length?(o="function"==typeof t?t:tk(+t),c):o},c.paddingBottom=function(t){return arguments.length?(s="function"==typeof t?t:tk(+t),c):s},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:tk(+t),c):l},c}();return t.ratio=function(e){var n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=function(e){K(Pk,e)?t.tile(Pk[e]):i("Unrecognized Treemap layout method: "+e)},t},Ik.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],Ik.fields=$k;var Hk=Object.freeze({__proto__:null,nest:Ak,pack:Fk,partition:zk,stratify:Nk,tree:qk,treelinks:Lk,treemap:jk});function Wk(t,e){var n,r,i,a,u,o,s=[],l=function(t){return t(a)};if(null==e)s.push(t);else for(n={},r=0,i=t.length;r<i;++r)a=t[r],(o=n[u=e.map(l)])||(n[u]=o=[],o.dims=u,s.push(o)),o.push(a);return s}function Yk(t){Hr.call(this,null,t)}Yk.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},rt(Yk,Hr).transform=function(t,e){var r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=Wk(e.materialize(e.SOURCE).source,t.groupby),a=(t.groupby||[]).map(n),u=a.length,o=t.as||[n(t.x),n(t.y)],s=[];i.forEach(e=>{ua(e,t.x,t.y,t.bandwidth||.3).forEach(t=>{const n={};for(let t=0;t<u;++t)n[a[t]]=e.dims[t];n[o[0]]=t[0],n[o[1]]=t[1],s.push(St(n))})}),this.value&&(r.rem=this.value),this.value=r.add=r.source=s}return r};const Vk={linear:Ki,log:ta,exp:ea,pow:na,quad:ra,poly:ia};function Gk(t){Hr.call(this,null,t)}Gk.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(Vk)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},rt(Gk,Hr).transform=function(t,e){var r=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const a=Wk(e.materialize(e.SOURCE).source,t.groupby),u=(t.groupby||[]).map(n),o=t.method||"linear",s=t.order||3,l=function(t,e){return"poly"===t?e:"quad"===t?2:1}(o,s),c=t.as||[n(t.x),n(t.y)],f=Vk[o],h=[];let d=t.extent;K(Vk,o)||i("Invalid regression method: "+o),null!=d&&"log"===o&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),a.forEach(n=>{if(n.length<=l)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=f(n,t.x,t.y,s);if(t.params)return void h.push(St({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const i=d||J(n,t.x),a=t=>{const e={};for(let t=0;t<u.length;++t)e[u[t]]=n.dims[t];e[c[0]]=t[0],e[c[1]]=t[1],h.push(St(e))};"linear"===o?i.forEach(t=>a([t,r.predict(t)])):ca(r.predict,i,25,200).forEach(a)}),this.value&&(r.rem=this.value),this.value=r.add=r.source=h}return r};var Xk=Object.freeze({__proto__:null,loess:Yk,regression:Gk});const Jk=Math.pow(2,-52),Zk=new Uint32Array(512);class Qk{static from(t,e=uM,n=oM){const r=t.length,i=new Float64Array(2*r);for(let a=0;a<r;a++){const r=t[a];i[2*a]=e(r),i[2*a+1]=n(r)}return new Qk(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=t.length>>1;let u=1/0,o=1/0,s=-1/0,l=-1/0;for(let e=0;e<a;e++){const n=t[2*e],r=t[2*e+1];n<u&&(u=n),r<o&&(o=r),n>s&&(s=n),r>l&&(l=r),this._ids[e]=e}const c=(u+s)/2,f=(o+l)/2;let h,d,p,g=1/0;for(let e=0;e<a;e++){const n=Kk(c,f,t[2*e],t[2*e+1]);n<g&&(h=e,g=n)}const m=t[2*h],v=t[2*h+1];g=1/0;for(let e=0;e<a;e++){if(e===h)continue;const n=Kk(m,v,t[2*e],t[2*e+1]);n<g&&n>0&&(d=e,g=n)}let y=t[2*d],_=t[2*d+1],x=1/0;for(let e=0;e<a;e++){if(e===h||e===d)continue;const n=rM(m,v,y,_,t[2*e],t[2*e+1]);n<x&&(p=e,x=n)}let b=t[2*p],w=t[2*p+1];if(x===1/0){for(let e=0;e<a;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];iM(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,r=-1/0;t<a;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(eM(m,v,y,_,b,w)){const t=d,e=y,n=_;d=p,y=b,_=w,p=t,b=e,w=n}const A=function(t,e,n,r,i,a){const u=n-t,o=r-e,s=i-t,l=a-e,c=u*u+o*o,f=s*s+l*l,h=.5/(u*l-o*s);return{x:t+(l*c-o*f)*h,y:e+(u*f-s*c)*h}}(m,v,y,_,b,w);this._cx=A.x,this._cy=A.y;for(let e=0;e<a;e++)this._dists[e]=Kk(t[2*e],t[2*e+1],A.x,A.y);iM(this._ids,this._dists,0,a-1),this._hullStart=h;let k=3;n[h]=e[p]=d,n[d]=e[h]=p,n[p]=e[d]=h,r[h]=0,r[d]=1,r[p]=2,i.fill(-1),i[this._hashKey(m,v)]=h,i[this._hashKey(y,_)]=d,i[this._hashKey(b,w)]=p,this.trianglesLen=0,this._addTriangle(h,d,p,-1,-1,-1);for(let a,u,o=0;o<this._ids.length;o++){const s=this._ids[o],l=t[2*s],c=t[2*s+1];if(o>0&&Math.abs(l-a)<=Jk&&Math.abs(c-u)<=Jk)continue;if(a=l,u=c,s===h||s===d||s===p)continue;let f=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(f=i[(e+t)%this._hashSize],-1===f||f===n[f]);t++);f=e[f];let g,m=f;for(;g=n[m],!eM(l,c,t[2*m],t[2*m+1],t[2*g],t[2*g+1]);)if(m=g,m===f){m=-1;break}if(-1===m)continue;let v=this._addTriangle(m,s,n[m],-1,-1,r[m]);r[s]=this._legalize(v+2),r[m]=v,k++;let y=n[m];for(;g=n[y],eM(l,c,t[2*y],t[2*y+1],t[2*g],t[2*g+1]);)v=this._addTriangle(y,s,g,r[s],-1,r[y]),r[s]=this._legalize(v+2),n[y]=y,k--,y=g;if(m===f)for(;g=e[m],eM(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1]);)v=this._addTriangle(g,s,m,-1,r[m],r[g]),this._legalize(v+2),r[g]=v,n[m]=m,k--,m=g;this._hullStart=e[s]=m,n[m]=e[y]=s,n[s]=y,i[this._hashKey(l,c)]=s,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(k);for(let t=0,e=this._hullStart;t<k;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,a=0;for(;;){const u=n[t],o=t-t%3;if(a=o+(t+2)%3,-1===u){if(0===i)break;t=Zk[--i];continue}const s=u-u%3,l=o+(t+1)%3,c=s+(u+2)%3,f=e[a],h=e[t],d=e[l],p=e[c];if(nM(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){e[t]=p,e[u]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(u,n[a]),this._link(a,c);const o=s+(u+1)%3;i<Zk.length&&(Zk[i++]=o)}else{if(0===i)break;t=Zk[--i]}}return a}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,a){const u=this.trianglesLen;return this._triangles[u]=t,this._triangles[u+1]=e,this._triangles[u+2]=n,this._link(u,r),this._link(u+1,i),this._link(u+2,a),this.trianglesLen+=3,u}}function Kk(t,e,n,r){const i=t-n,a=e-r;return i*i+a*a}function tM(t,e,n,r,i,a){const u=(r-e)*(i-t),o=(n-t)*(a-e);return Math.abs(u-o)>=33306690738754716e-32*Math.abs(u+o)?u-o:0}function eM(t,e,n,r,i,a){return(tM(i,a,t,e,n,r)||tM(t,e,n,r,i,a)||tM(n,r,i,a,t,e))<0}function nM(t,e,n,r,i,a,u,o){const s=t-u,l=e-o,c=n-u,f=r-o,h=i-u,d=a-o,p=c*c+f*f,g=h*h+d*d;return s*(f*g-p*d)-l*(c*g-p*h)+(s*s+l*l)*(c*d-f*h)<0}function rM(t,e,n,r,i,a){const u=n-t,o=r-e,s=i-t,l=a-e,c=u*u+o*o,f=s*s+l*l,h=.5/(u*l-o*s),d=(l*c-o*f)*h,p=(u*f-s*c)*h;return d*d+p*p}function iM(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],a=e[r];let u=i-1;for(;u>=n&&e[t[u]]>a;)t[u+1]=t[u--];t[u+1]=r}else{let i=n+1,a=r;aM(t,n+r>>1,i),e[t[n]]>e[t[r]]&&aM(t,n,r),e[t[i]]>e[t[r]]&&aM(t,i,r),e[t[n]]>e[t[i]]&&aM(t,n,i);const u=t[i],o=e[u];for(;;){do{i++}while(e[t[i]]<o);do{a--}while(e[t[a]]>o);if(a<i)break;aM(t,i,a)}t[n+1]=t[a],t[a]=u,r-i+1>=a-n?(iM(t,e,i,r),iM(t,e,n,a-1)):(iM(t,e,n,a-1),iM(t,e,i,r))}}function aM(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function uM(t){return t[0]}function oM(t){return t[1]}class sM{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class lM{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class cM{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,a=0,u=0,o=n.length;a<o;a+=3,u+=2){const o=2*n[a],s=2*n[a+1],l=2*n[a+2],c=t[o],f=t[o+1],h=t[s],d=t[s+1],p=t[l],g=t[l+1],m=h-c,v=d-f,y=p-c,_=g-f,x=m*m+v*v,b=y*y+_*_,w=2*(m*_-v*y);if(w)if(Math.abs(w)<1e-8)e=(c+p)/2,r=(f+g)/2;else{const t=1/w;e=c+(_*x-v*b)*t,r=f+(m*b-y*x)*t}else e=(c+p)/2-1e8*_,r=(f+g)/2+1e8*y;i[u]=e,i[u+1]=r}let a,u,o,s=e[e.length-1],l=4*s,c=t[2*s],f=t[2*s+1];r.fill(0);for(let n=0;n<e.length;++n)s=e[n],a=l,u=c,o=f,l=4*s,c=t[2*s],f=t[2*s+1],r[a+2]=r[l]=o-f,r[a+3]=r[l+1]=c-u}render(t){const e=null==t?t=new sM:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:u}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),u=2*Math.floor(r/3),o=a[i],s=a[i+1],l=a[u],c=a[u+1];this._renderSegment(o,s,l,c,t)}let o,s=i[i.length-1];for(let e=0;e<i.length;++e){o=s,s=i[e];const n=2*Math.floor(r[s]/3),l=a[n],c=a[n+1],f=4*o,h=this._project(l,c,u[f+2],u[f+3]);h&&this._renderSegment(l,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new sM:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new sM:void 0,r=this._clip(t);if(null===r)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(yield t)}}cellPolygon(t){const e=new lM;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let a;const u=this._regioncode(t,e),o=this._regioncode(n,r);0===u&&0===o?(i.moveTo(t,e),i.lineTo(n,r)):(a=this._clipSegment(t,e,n,r,u,o))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let a=0,u=t.length;a<u;a+=2)if(e[r]==t[a]&&e[r+1]==t[a+1]&&e[(r+2)%i]==t[(a+u-2)%u]&&e[(r+3)%i]==t[(a+u-1)%u]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[t];if(-1===a)return null;const u=[];let o=a;do{const n=Math.floor(o/3);if(u.push(e[2*n],e[2*n+1]),o=o%3==2?o-2:o+1,i[o]!==t)break;o=r[o]}while(o!==a&&-1!==o);return u}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,a,u,o,s=null,l=e[n-2],c=e[n-1],f=this._regioncode(l,c);for(let h=0;h<n;h+=2)if(r=l,i=c,l=e[h],c=e[h+1],a=f,f=this._regioncode(l,c),0===a&&0===f)u=o,o=0,s?s.push(l,c):s=[l,c];else{let e,n,h,d,p;if(0===a){if(null===(e=this._clipSegment(r,i,l,c,a,f)))continue;[n,h,d,p]=e}else{if(null===(e=this._clipSegment(l,c,r,i,f,a)))continue;[d,p,n,h]=e,u=o,o=this._edgecode(n,h),u&&o&&this._edge(t,u,o,s,s.length),s?s.push(n,h):s=[n,h]}u=o,o=this._edgecode(d,p),u&&o&&this._edge(t,u,o,s,s.length),s?s.push(d,p):s=[d,p]}if(s)u=o,o=this._edgecode(s[0],s[1]),u&&o&&this._edge(t,u,o,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,a){for(;;){if(0===i&&0===a)return[t,e,n,r];if(i&a)return null;let u,o,s=i||a;8&s?(u=t+(n-t)*(this.ymax-e)/(r-e),o=this.ymax):4&s?(u=t+(n-t)*(this.ymin-e)/(r-e),o=this.ymin):2&s?(o=e+(r-e)*(this.xmax-t)/(n-t),u=this.xmax):(o=e+(r-e)*(this.xmin-t)/(n-t),u=this.xmin),i?(t=u,e=o,i=this._regioncode(t,e)):(n=u,r=o,a=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,a){let u,o=Array.from(e);if((u=this._project(o[0],o[1],n,r))&&o.unshift(u[0],u[1]),(u=this._project(o[o.length-2],o[o.length-1],i,a))&&o.push(u[0],u[1]),o=this._clipFinite(t,o))for(let e,n=0,r=o.length,i=this._edgecode(o[r-2],o[r-1]);n<r;n+=2)e=i,i=this._edgecode(o[n],o[n+1]),e&&i&&(n=this._edge(t,e,i,o,n),r=o.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(t,e,n,r,i){for(;e!==n;){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin}r[i]===n&&r[i+1]===a||!this.contains(t,n,a)||(r.splice(i,0,n,a),i+=2)}if(r.length>4)for(let t=0;t<r.length;t+=2){const e=(t+2)%r.length,n=(t+4)%r.length;(r[t]===r[e]&&r[e]===r[n]||r[t+1]===r[e+1]&&r[e+1]===r[n+1])&&(r.splice(e,2),t-=2)}return i}_project(t,e,n,r){let i,a,u,o=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<o&&(u=this.ymin,a=t+(o=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<o&&(u=this.ymax,a=t+(o=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<o&&(a=this.xmax,u=e+(o=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<o&&(a=this.xmin,u=e+(o=i)*r)}return[a,u]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const fM=2*Math.PI;function hM(t){return t[0]}function dM(t){return t[1]}function pM(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class gM{static from(t,e=hM,n=dM,r){return new gM("length"in t?function(t,e,n,r){const i=t.length,a=new Float64Array(2*i);for(let u=0;u<i;++u){const i=t[u];a[2*u]=e.call(r,i,u,t),a[2*u+1]=n.call(r,i,u,t)}return a}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const a of t)yield e.call(r,a,i,t),yield n.call(r,a,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new Qk(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],a=2*e[t+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.sqrt((r[3]-r[1])**2+(r[2]-r[0])**2);for(let t=0,n=e.length/2;t<n;++t){const n=pM(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new Qk(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),u=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==a[e]||(a[e]=t)}for(let t=0,e=r.length;t<e;++t)u[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],this.triangles[1]=r[1],this.triangles[2]=r[1],a[r[0]]=1,2===r.length&&(a[r[1]]=0))}voronoi(t){return new cM(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:u}=this;if(u){const e=u.indexOf(t);return e>0&&(yield u[e-1]),void(e<u.length-1&&(yield u[e+1]))}const o=e[t];if(-1===o)return;let s=o,l=-1;do{if(yield l=a[s],s=s%3==2?s-2:s+1,a[s]!==t)return;if(s=i[s],-1===s){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(s!==o)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:a,halfedges:u,triangles:o,points:s}=this;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);let l=t,c=(e-s[2*t])**2+(n-s[2*t+1])**2;const f=r[t];let h=f;do{let r=o[h];const f=(e-s[2*r])**2+(n-s[2*r+1])**2;if(f<c&&(c=f,l=r),h=h%3==2?h-2:h+1,o[h]!==t)break;if(h=u[h],-1===h){if(h=i[(a[t]+1)%i.length],h!==r&&(e-s[2*h])**2+(n-s[2*h+1])**2<c)return h;break}}while(h!==f);return l}render(t){const e=null==t?t=new sM:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,a=r.length;e<a;++e){const a=r[e];if(a<e)continue;const u=2*i[e],o=2*i[a];t.moveTo(n[u],n[u+1]),t.lineTo(n[o],n[o+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e=2){const n=null==t?t=new sM:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],a=r[n+1];t.moveTo(i+e,a),t.arc(i,a,e,0,fM)}return n&&n.value()}renderHull(t){const e=null==t?t=new sM:void 0,{hull:n,points:r}=this,i=2*n[0],a=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<a;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new lM;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new sM:void 0,{points:r,triangles:i}=this,a=2*i[t*=3],u=2*i[t+1],o=2*i[t+2];return e.moveTo(r[a],r[a+1]),e.lineTo(r[u],r[u+1]),e.lineTo(r[o],r[o+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new lM;return this.renderTriangle(t,e),e.value()}}function mM(t){Hr.call(this,null,t)}mM.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const vM=rt(mM,Hr),yM=[-1e5,-1e5,1e5,1e5];function _M(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}vM.transform=function(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:yM;const a=this.value=gM.from(r,t.x,t.y).voronoi(i);for(let t=0,e=r.length;t<e;++t){const e=a.cellPolygon(t);r[t][n]=e?_M(e):null}return e.reflow(t.modified()).modifies(n)};var xM=Object.freeze({__proto__:null,voronoi:mM}),bM=Math.PI/180;function wM(){var t,e,n,r,i,a,u,o=[256,256],s=DM,l=[],c=Math.random,f={};function h(t,e,n){for(var r,i,a,u=e.x,l=e.y,f=Math.sqrt(o[0]*o[0]+o[1]*o[1]),h=s(o),d=c()<.5?1:-1,p=-d;(r=h(p+=d))&&(i=~~r[0],a=~~r[1],!(Math.min(Math.abs(i),Math.abs(a))>=f));)if(e.x=u+i,e.y=l+a,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>o[0]||e.y+e.y1>o[1])&&(!n||!kM(e,t,o[0]))&&(!n||EM(e,n))){for(var g,m=e.sprite,v=e.width>>5,y=o[0]>>5,_=e.x-(v<<4),x=127&_,b=32-x,w=e.y1-e.y0,A=(e.y+e.y0)*y+(_>>5),k=0;k<w;k++){g=0;for(var M=0;M<=v;M++)t[A+M]|=g<<b|(M<v?(g=m[k*v+M])>>>x:0);A+=y}return e.sprite=null,!0}return!1}return f.layout=function(){for(var s=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=2048/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Vo()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((o[0]>>5)*o[1]),d=null,p=l.length,g=-1,m=[],v=l.map((function(o){return{text:t(o),font:e(o),style:r(o),weight:i(o),rotate:a(o),size:~~(n(o)+1e-14),padding:u(o),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:o}})).sort((function(t,e){return e.size-t.size}));++g<p;){var y=v[g];y.x=o[0]*(c()+.5)>>1,y.y=o[1]*(c()+.5)>>1,AM(s,y,v,g),y.hasText&&h(f,y,d)&&(m.push(y),d?MM(d,y):d=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=o[0]>>1,y.y-=o[1]>>1)}return m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(o=[+t[0],+t[1]],f):o},f.font=function(t){return arguments.length?(e=CM(t),f):e},f.fontStyle=function(t){return arguments.length?(r=CM(t),f):r},f.fontWeight=function(t){return arguments.length?(i=CM(t),f):i},f.rotate=function(t){return arguments.length?(a=CM(t),f):a},f.text=function(e){return arguments.length?(t=CM(e),f):t},f.spiral=function(t){return arguments.length?(s=FM[t]||t,f):s},f.fontSize=function(t){return arguments.length?(n=CM(t),f):n},f.padding=function(t){return arguments.length?(u=CM(t),f):u},f.random=function(t){return arguments.length?(c=t,f):c},f}function AM(t,e,n,r){if(!e.sprite){var i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,2048/a);var u,o,s,l,c,f=0,h=0,d=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font,u=i.measureText(e.text+"m").width*a,s=e.size<<1,e.rotate){var g=Math.sin(e.rotate*bM),m=Math.cos(e.rotate*bM),v=u*m,y=u*g,_=s*m,x=s*g;u=Math.max(Math.abs(v+x),Math.abs(v-x))+31>>5<<5,s=~~Math.max(Math.abs(y+_),Math.abs(y-_))}else u=u+31>>5<<5;if(s>d&&(d=s),f+u>=2048&&(f=0,h+=d,d=0),h+s>=2048)break;i.translate((f+(u>>1))/a,(h+(s>>1))/a),e.rotate&&i.rotate(e.rotate*bM),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=u,e.height=s,e.xoff=f,e.yoff=h,e.x1=u>>1,e.y1=s>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=u}for(var b=i.getImageData(0,0,2048/a,2048/a).data,w=[];--r>=0;)if((e=n[r]).hasText){for(o=(u=e.width)>>5,s=e.y1-e.y0,l=0;l<s*o;l++)w[l]=0;if(null==(f=e.xoff))return;h=e.yoff;var A=0,k=-1;for(c=0;c<s;c++){for(l=0;l<u;l++){var M=o*c+(l>>5),E=b[2048*(h+c)+(f+l)<<2]?1<<31-l%32:0;w[M]|=E,A|=E}A?k=c:(e.y0++,s--,c--,h++)}e.y1=e.y0+k,e.sprite=w.slice(0,(e.y1-e.y0)*o)}}}function kM(t,e,n){n>>=5;for(var r,i=t.sprite,a=t.width>>5,u=t.x-(a<<4),o=127&u,s=32-o,l=t.y1-t.y0,c=(t.y+t.y0)*n+(u>>5),f=0;f<l;f++){r=0;for(var h=0;h<=a;h++)if((r<<s|(h<a?(r=i[f*a+h])>>>o:0))&e[c+h])return!0;c+=n}return!1}function MM(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function EM(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function DM(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function CM(t){return"function"==typeof t?t:function(){return t}}var FM={archimedean:DM,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}},SM=["x","y","font","fontSize","fontStyle","fontWeight","angle"],BM=["text","font","rotate","fontSize","fontStyle","fontWeight"];function zM(t){Hr.call(this,wM(),t)}zM.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:SM}]},rt(zM,Hr).transform=function(e,n){!e.size||e.size[0]&&e.size[1]||i("Wordcloud size dimensions must be non-zero.");var r=e.modified();if(r||n.changed(n.ADD_REM)||BM.some((function(t){var r=e[t];return W(r)&&n.modified(r.fields)}))){var a,u=n.materialize(n.SOURCE).source,o=this.value,s=e.as||SM,l=e.fontSize||14;if(W(l)?a=e.fontSizeRange:l=V(l),a){var c=l,f=Om("sqrt")().domain(J(u,c)).range(a);l=function(t){return f(c(t))}}u.forEach((function(t){t[s[0]]=NaN,t[s[1]]=NaN,t[s[3]]=0}));for(var h,d,p=o.words(u).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(l).random(t.random).layout(),g=o.size(),m=g[0]>>1,v=g[1]>>1,y=0,_=p.length;y<_;++y)(d=(h=p[y]).datum)[s[0]]=h.x+m,d[s[1]]=h.y+v,d[s[2]]=h.font,d[s[3]]=h.size,d[s[4]]=h.style,d[s[5]]=h.weight,d[s[6]]=h.rotate;return n.reflow(r).modifies(s)}};var TM=Object.freeze({__proto__:null,wordcloud:zM});function NM(t){return new Uint8Array(t)}function OM(t){return new Uint16Array(t)}function RM(t){return new Uint32Array(t)}function qM(t,e,n){var r=(e<257?NM:e<65537?OM:RM)(t);return n&&r.set(n),r}function UM(t,e,n){var r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd:function(t,e){var n,i=this.bisect(this.range,t.value),a=t.index,u=i[0],o=i[1],s=a.length;for(n=0;n<u;++n)e[a[n]]|=r;for(n=o;n<s;++n)e[a[n]]|=r;return this}}}function LM(){var t=RM(0),e=[],n=0;return{insert:function(r,i,a){if(!i.length)return[];var u,o,s,l=n,c=i.length,f=Array(c),h=RM(c);for(s=0;s<c;++s)f[s]=r(i[s]),h[s]=s;if(f=function(t,e){return t.sort.call(e,(function(e,n){var r=t[e],i=t[n];return r<i?-1:r>i?1:0})),function(t,e){return Array.from(e,e=>t[e])}(t,e)}(f,h),l)u=e,o=t,e=Array(l+c),t=RM(l+c),function(t,e,n,r,i,a,u,o,s){var l,c=0,f=0;for(l=0;c<r&&f<u;++l)e[c]<i[f]?(o[l]=e[c],s[l]=n[c++]):(o[l]=i[f],s[l]=a[f++]+t);for(;c<r;++c,++l)o[l]=e[c],s[l]=n[c];for(;f<u;++f,++l)o[l]=i[f],s[l]=a[f]+t}(a,u,o,l,f,h,c,e,t);else{if(a>0)for(s=0;s<c;++s)h[s]+=a;e=f,t=h}return n=l+c,{index:h,value:f}},remove:function(r,i){var a,u,o,s=n;for(u=0;!i[t[u]]&&u<s;++u);for(o=u;u<s;++u)i[a=t[u]]||(t[o]=a,e[o]=e[u],++o);n=s-r},bisect:function(t,r){var i;return r?i=r.length:(r=e,i=n),[si(r,t[0],0,i),oi(r,t[1],0,i)]},reindex:function(e){for(var r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:function(){return t},size:function(){return n}}}function PM(t){Hr.call(this,function(){var t=8,e=[],n=RM(0),r=qM(0,t),i=qM(0,t);return{data:function(){return e},seen:function(){return n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length)},add:function(t){for(var n,r=0,i=e.length,a=t.length;r<a;++r)(n=t[r])._index=i++,e.push(n)},remove:function(t,n){var a,u,o,s=e.length,l=Array(s-t),c=e;for(u=0;!n[u]&&u<s;++u)l[u]=e[u],c[u]=u;for(o=u;u<s;++u)a=e[u],n[u]?c[u]=-1:(c[u]=o,r[o]=r[u],i[o]=i[u],l[o]=a,a._index=o++),r[u]=0;return e=l,c},size:function(){return e.length},curr:function(){return r},prev:function(){return i},reset:function(t){i[t]=r[t]},all:function(){return t<257?255:t<65537?65535:4294967295},set:function(t,e){r[t]|=e},clear:function(t,e){r[t]&=~e},resize:function(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=qM(e,t,r),i=qM(e,t))}}}(),t),this._indices=null,this._dims=null}PM.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};var $M=rt(PM,Hr);function jM(t){Hr.call(this,null,t)}$M.transform=function(t,e){return this._dims?t.modified("fields")||t.fields.some((function(t){return e.modified(t.fields)}))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},$M.init=function(t,e){for(var n,r,i=t.fields,a=t.query,u=this._indices={},o=this._dims=[],s=a.length,l=0;l<s;++l)r=u[n=i[l].fname]||(u[n]=LM()),o.push(UM(r,l,a[l]));return this.eval(t,e)},$M.reinit=function(t,e){var n,r,i,a,u,o,s,l,c,f=e.materialize().fork(),h=t.fields,d=t.query,p=this._indices,g=this._dims,m=this.value,v=m.curr(),y=m.prev(),_=m.all(),x=f.rem=f.add,b=f.mod,w=d.length,A={};if(y.set(v),e.rem.length&&(u=this.remove(t,e,f)),e.add.length&&m.add(e.add),e.mod.length)for(o={},s=0,l=(a=e.mod).length;s<l;++s)o[a[s]._index]=1;for(s=0;s<w;++s)c=h[s],(!g[s]||t.modified("fields",s)||e.modified(c.fields))&&((n=A[i=c.fname])||(p[i]=r=LM(),A[i]=n=r.insert(c,e.source,0)),g[s]=UM(r,s,d[s]).onAdd(n,v));for(s=0,l=m.data().length;s<l;++s)u[s]||(y[s]!==v[s]?x.push(s):o[s]&&v[s]!==_&&b.push(s));return m.mask=(1<<w)-1,f},$M.eval=function(t,e){var n=e.materialize().fork(),r=this._dims.length,i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},$M.insert=function(t,e,n){var r,i,a,u=e.add,o=this.value,s=this._dims,l=this._indices,c=t.fields,f={},h=n.add,d=o.size(),p=d+u.length,g=s.length;o.resize(p,g),o.add(u);var m=o.curr(),v=o.prev(),y=o.all();for(r=0;r<g;++r)a=f[i=c[r].fname]||(f[i]=l[i].insert(c[r],u,d)),s[r].onAdd(a,m);for(;d<p;++d)v[d]=y,m[d]!==y&&h.push(d)},$M.modify=function(t,e){var n,r,i,a=e.mod,u=this.value,o=u.curr(),s=u.all(),l=t.mod;for(n=0,r=l.length;n<r;++n)o[i=l[n]._index]!==s&&a.push(i)},$M.remove=function(t,e,n){var r,i,a,u,o=this._indices,s=this.value,l=s.curr(),c=s.prev(),f=s.all(),h={},d=n.rem,p=e.rem;for(r=0,i=p.length;r<i;++r)h[a=p[r]._index]=1,c[a]=u=l[a],l[a]=f,u!==f&&d.push(a);for(a in o)o[a].remove(i,h);return this.reindex(e,i,h),h},$M.reindex=function(t,e,n){var r=this._indices,i=this.value;t.runAfter((function(){var t=i.remove(e,n);for(var a in r)r[a].reindex(t)}))},$M.update=function(t,e,n){var r,i,a=this._dims,u=t.query,o=e.stamp,s=a.length,l=0;for(n.filters=0,i=0;i<s;++i)t.modified("query",i)&&(r=i,++l);if(1===l)l=a[r].one,this.incrementOne(a[r],u[r],n.add,n.rem);else for(i=0,l=0;i<s;++i)t.modified("query",i)&&(l|=a[i].one,this.incrementAll(a[i],u[i],o,n.add),n.rem=n.add);return l},$M.incrementAll=function(t,e,n,r){var i,a,u,o=this.value,s=o.seen(),l=o.curr(),c=o.prev(),f=t.index(),h=t.bisect(t.range),d=t.bisect(e),p=d[0],g=d[1],m=h[0],v=h[1],y=t.one;if(p<m)for(i=p,a=Math.min(m,g);i<a;++i)s[u=f[i]]!==n&&(c[u]=l[u],s[u]=n,r.push(u)),l[u]^=y;else if(p>m)for(i=m,a=Math.min(p,v);i<a;++i)s[u=f[i]]!==n&&(c[u]=l[u],s[u]=n,r.push(u)),l[u]^=y;if(g>v)for(i=Math.max(p,v),a=g;i<a;++i)s[u=f[i]]!==n&&(c[u]=l[u],s[u]=n,r.push(u)),l[u]^=y;else if(g<v)for(i=Math.max(m,g),a=v;i<a;++i)s[u=f[i]]!==n&&(c[u]=l[u],s[u]=n,r.push(u)),l[u]^=y;t.range=e.slice()},$M.incrementOne=function(t,e,n,r){var i,a,u,o=this.value.curr(),s=t.index(),l=t.bisect(t.range),c=t.bisect(e),f=c[0],h=c[1],d=l[0],p=l[1],g=t.one;if(f<d)for(i=f,a=Math.min(d,h);i<a;++i)o[u=s[i]]^=g,n.push(u);else if(f>d)for(i=d,a=Math.min(f,p);i<a;++i)o[u=s[i]]^=g,r.push(u);if(h>p)for(i=Math.max(f,p),a=h;i<a;++i)o[u=s[i]]^=g,n.push(u);else if(h<p)for(i=Math.max(d,h),a=p;i<a;++i)o[u=s[i]]^=g,r.push(u);t.range=e.slice()},jM.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},rt(jM,Hr).transform=function(t,e){var n=~(t.ignore||0),r=t.filter,i=r.mask;if(0==(i&n))return e.StopPropagation;var a=e.fork(e.ALL),u=r.data(),o=r.curr(),s=r.prev(),l=function(t){return o[t]&n?null:u[t]};return a.filter(a.MOD,l),i&i-1?(a.filter(a.ADD,(function(t){var e=o[t]&n;return!e&&e^s[t]&n?u[t]:null})),a.filter(a.REM,(function(t){var e=o[t]&n;return e&&!(e^e^s[t]&n)?u[t]:null}))):(a.filter(a.ADD,l),a.filter(a.REM,(function(t){return(o[t]&n)===i?u[t]:null}))),a.filter(a.SOURCE,(function(t){return l(t._index)}))};var IM=Object.freeze({__proto__:null,crossfilter:PM,resolvefilter:jM});function HM(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function WM(t){var e=t._signals.cursor;e||(t._signals.cursor=e=t.add({user:"default",item:null})),t.on(t.events("view","mousemove"),e,(function(t,n){var r=e.value,i=r?s(r)?r:r.user:"default",a=n.item&&n.item.cursor||null;return r&&i===r.user&&a==r.item?r:{user:i,item:a}})),t.add(null,(function(t){var e=t.cursor,n=this.value;return s(e)||(n=e.item,e=e.user),function(t){"undefined"!=typeof document&&document.body&&(document.body.style.cursor=t)}(e&&"default"!==e?e:n||e),n}),{cursor:e})}function YM(t,e){var n=t._runtime.data;return K(n,e)||i("Unrecognized data set: "+e),n[e]}function VM(t,e){Ot(e)||i("Second argument to changes must be a changeset.");var n=YM(this,t);return n.modified=!0,this.pulse(n.input,e)}function GM(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function XM(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function JM(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function ZM(t,e,n){var r,i,a=t._renderer,u=a&&a.canvas();return u&&(i=JM(t),(r=Gf(e.changedTouches?e.changedTouches[0]:e,u))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){var r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function a(t){if(!t)return n;s(t)&&(t=i(t));for(var e=n.slice();t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:V(t),item:V(e||{}),group:i,xy:a,x:function(t){return a(t)[0]},y:function(t){return a(t)[1]}}}(t,n,r),e}const QM={trap:!1};function KM(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||o(r)&&!r[n])||(t.warn(`Blocked ${e} ${n} event listener.`),!1)}function tE(t){return t.item}function eE(t){return t.item.mark.source}function nE(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function rE(t,e,n){var r=document.createElement(t);for(var i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r}function iE(t,e,n){if(e){var r=n.param,i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:function(e){e!==t.signal(r.signal)&&t.runAsync(null,(function(){i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=G(r.debounce,i.update))),function(t,e,n,r){var i=rE("div",{class:"vega-bind"});i.appendChild(rE("span",{class:"vega-bind-name"},n.name||n.signal)),e.appendChild(i);var a=aE;switch(n.input){case"checkbox":a=uE;break;case"select":a=oE;break;case"radio":a=sE;break;case"range":a=lE}a(t,i,n,r)}(i,e,r,t.signal(r.signal)),i.active||(t.on(t._signals[r.signal],null,(function(){i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0),i}}function aE(t,e,n,r){var i=rE("input");for(var a in n)"signal"!==a&&"element"!==a&&i.setAttribute("input"===a?"type":a,n[a]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(function(){t.update(i.value)})),t.elements=[i],t.set=function(t){i.value=t}}function uE(t,e,n,r){var i={type:"checkbox",name:n.signal};r&&(i.checked=!0);var a=rE("input",i);e.appendChild(a),a.addEventListener("change",(function(){t.update(a.checked)})),t.elements=[a],t.set=function(t){a.checked=!!t||null}}function oE(t,e,n,r){var i=rE("select",{name:n.signal}),a=n.labels||[];n.options.forEach((function(t,e){var n={value:t};cE(t,r)&&(n.selected=!0),i.appendChild(rE("option",n,(a[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(function(){t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=function(t){for(var e=0,r=n.options.length;e<r;++e)if(cE(n.options[e],t))return void(i.selectedIndex=e)}}function sE(t,e,n,r){var i=rE("span",{class:"vega-bind-radio"}),a=n.labels||[];e.appendChild(i),t.elements=n.options.map((function(e,u){var o="vega-option-"+n.signal+"-"+e,s={id:o,type:"radio",name:n.signal,value:e};cE(e,r)&&(s.checked=!0);var l=rE("input",s);return l.addEventListener("change",(function(){t.update(e)})),i.appendChild(l),i.appendChild(rE("label",{for:o},(a[u]||e)+"")),l})),t.set=function(e){for(var n=t.elements,r=0,i=n.length;r<i;++r)cE(n[r].value,e)&&(n[r].checked=!0)}}function lE(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;var i=null!=n.max?n.max:Math.max(100,+r)||100,a=n.min||Math.min(0,i,+r)||0,u=n.step||gi(a,i,100),o=rE("input",{type:"range",name:n.signal,min:a,max:i,step:u});o.value=r;var s=rE("label",{},+r);function l(){s.textContent=o.value,t.update(+o.value)}e.appendChild(o),e.appendChild(s),o.addEventListener("input",l),o.addEventListener("change",l),t.elements=[o],t.set=function(t){o.value=t,s.textContent=t}}function cE(t,e){return t===e||t+""==e+""}function fE(t,e,n,r,i,a){return(e=e||new r(t.loader())).initialize(n,GM(t),XM(t),JM(t),i,a).background(t.background())}function hE(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function dE(t,e){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e)try{e.innerHTML=""}catch(n){e=null,t.error(n)}return e}const pE=t=>+t||0;function gE(t){return o(t)?{top:pE(t.top),bottom:pE(t.bottom),left:pE(t.left),right:pE(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(pE(t))}async function mE(t,e,n,r){const a=$h(e),u=a&&a.headless;return u||i("Unrecognized renderer type: "+e),await t.runAsync(),fE(t,null,null,u,n,r).renderAsync(t._scenegraph.root)}var vE,yE,_E,xE,bE;function wE(t){this.type=t}wE.prototype.visit=function(t){var e,n,r;if(t(this))return 1;for(n=0,r=(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case"CallExpression":var e=t.arguments.slice();return e.unshift(t.callee),e;case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];case"Identifier":case"Literal":case"RawCode":default:return[]}}(this)).length;n<r;++n)if(e[n].visit(t))return 1};(vE={})[1]="Boolean",vE[2]="<end>",vE[3]="Identifier",vE[4]="Keyword",vE[5]="Null",vE[6]="Numeric",vE[7]="Punctuator",vE[8]="String",vE[9]="RegularExpression";var AE="ILLEGAL",kE=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),ME=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function EE(t,e){if(!t)throw new Error("ASSERT: "+e)}function DE(t){return t>=48&&t<=57}function CE(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function FE(t){return"01234567".indexOf(t)>=0}function SE(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function BE(t){return 10===t||13===t||8232===t||8233===t}function zE(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&kE.test(String.fromCharCode(t))}function TE(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&ME.test(String.fromCharCode(t))}var NE={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function OE(){for(var t;_E<xE&&(SE(t=yE.charCodeAt(_E))||BE(t));)++_E}function RE(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)_E<xE&&CE(yE[_E])?(r=yE[_E++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):QE({},"Unexpected token %0",AE);return String.fromCharCode(i)}function qE(){var t,e,n,r;for(e=0,"}"===(t=yE[_E])&&QE({},"Unexpected token %0",AE);_E<xE&&CE(t=yE[_E++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&QE({},"Unexpected token %0",AE),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function UE(){var t,e;for(t=yE.charCodeAt(_E++),e=String.fromCharCode(t),92===t&&(117!==yE.charCodeAt(_E)&&QE({},"Unexpected token %0",AE),++_E,(t=RE("u"))&&"\\"!==t&&zE(t.charCodeAt(0))||QE({},"Unexpected token %0",AE),e=t);_E<xE&&TE(t=yE.charCodeAt(_E));)++_E,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==yE.charCodeAt(_E)&&QE({},"Unexpected token %0",AE),++_E,(t=RE("u"))&&"\\"!==t&&TE(t.charCodeAt(0))||QE({},"Unexpected token %0",AE),e+=t);return e}function LE(){var t,e;return t=_E,{type:1===(e=92===yE.charCodeAt(_E)?UE():function(){var t,e;for(t=_E++;_E<xE;){if(92===(e=yE.charCodeAt(_E)))return _E=t,UE();if(!TE(e))break;++_E}return yE.slice(t,_E)}()).length?3:NE.hasOwnProperty(e)?4:"null"===e?5:"true"===e||"false"===e?1:3,value:e,start:t,end:_E}}function PE(){var t,e,n,r,i=_E,a=yE.charCodeAt(_E),u=yE[_E];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++_E,{type:7,value:String.fromCharCode(a),start:i,end:_E};default:if(61===(t=yE.charCodeAt(_E+1)))switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return _E+=2,{type:7,value:String.fromCharCode(a)+String.fromCharCode(t),start:i,end:_E};case 33:case 61:return _E+=2,61===yE.charCodeAt(_E)&&++_E,{type:7,value:yE.slice(i,_E),start:i,end:_E}}}return">>>="===(r=yE.substr(_E,4))?{type:7,value:r,start:i,end:_E+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:_E+=3}:u===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(u)>=0||"=>"===e?{type:7,value:e,start:i,end:_E+=2}:"<>=!+-*%&|^/".indexOf(u)>=0?{type:7,value:u,start:i,end:++_E}:void QE({},"Unexpected token %0",AE)}function $E(){var t,e,n;if(EE(DE((n=yE[_E]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=_E,t="","."!==n){if(t=yE[_E++],n=yE[_E],"0"===t){if("x"===n||"X"===n)return++_E,function(t){for(var e="";_E<xE&&CE(yE[_E]);)e+=yE[_E++];return 0===e.length&&QE({},"Unexpected token %0",AE),zE(yE.charCodeAt(_E))&&QE({},"Unexpected token %0",AE),{type:6,value:parseInt("0x"+e,16),start:t,end:_E}}(e);if(FE(n))return function(t){for(var e="0"+yE[_E++];_E<xE&&FE(yE[_E]);)e+=yE[_E++];return(zE(yE.charCodeAt(_E))||DE(yE.charCodeAt(_E)))&&QE({},"Unexpected token %0",AE),{type:6,value:parseInt(e,8),octal:!0,start:t,end:_E}}(e);n&&DE(n.charCodeAt(0))&&QE({},"Unexpected token %0",AE)}for(;DE(yE.charCodeAt(_E));)t+=yE[_E++];n=yE[_E]}if("."===n){for(t+=yE[_E++];DE(yE.charCodeAt(_E));)t+=yE[_E++];n=yE[_E]}if("e"===n||"E"===n)if(t+=yE[_E++],"+"!==(n=yE[_E])&&"-"!==n||(t+=yE[_E++]),DE(yE.charCodeAt(_E)))for(;DE(yE.charCodeAt(_E));)t+=yE[_E++];else QE({},"Unexpected token %0",AE);return zE(yE.charCodeAt(_E))&&QE({},"Unexpected token %0",AE),{type:6,value:parseFloat(t),start:e,end:_E}}function jE(){var t,e,n,r;return bE=null,OE(),t=_E,e=function(){var t,e,n,r;for(EE("/"===(t=yE[_E]),"Regular expression literal must start with a slash"),e=yE[_E++],n=!1,r=!1;_E<xE;)if(e+=t=yE[_E++],"\\"===t)BE((t=yE[_E++]).charCodeAt(0))&&QE({},"Invalid regular expression: missing /"),e+=t;else if(BE(t.charCodeAt(0)))QE({},"Invalid regular expression: missing /");else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||QE({},"Invalid regular expression: missing /"),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";_E<xE&&TE((t=yE[_E]).charCodeAt(0));)++_E,"\\"===t&&_E<xE?QE({},"Unexpected token %0",AE):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&QE({},"Invalid regular expression",n),{value:n,literal:e}}(),r=function(t,e){var n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(t,e){if(parseInt(e,16)<=1114111)return"x";QE({},"Invalid regular expression")})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){QE({},"Invalid regular expression")}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:_E}}function IE(){var t;return OE(),_E>=xE?{type:2,start:_E,end:_E}:zE(t=yE.charCodeAt(_E))?LE():40===t||41===t||59===t?PE():39===t||34===t?function(){var t,e,n,r,i="",a=!1;for(EE("'"===(t=yE[_E])||'"'===t,"String literal must starts with a quote"),e=_E,++_E;_E<xE;){if((n=yE[_E++])===t){t="";break}if("\\"===n)if((n=yE[_E++])&&BE(n.charCodeAt(0)))"\r"===n&&"\n"===yE[_E]&&++_E;else switch(n){case"u":case"x":"{"===yE[_E]?(++_E,i+=qE()):i+=RE(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:FE(n)?(0!==(r="01234567".indexOf(n))&&(a=!0),_E<xE&&FE(yE[_E])&&(a=!0,r=8*r+"01234567".indexOf(yE[_E++]),"0123".indexOf(n)>=0&&_E<xE&&FE(yE[_E])&&(r=8*r+"01234567".indexOf(yE[_E++]))),i+=String.fromCharCode(r)):i+=n}else{if(BE(n.charCodeAt(0)))break;i+=n}}return""!==t&&QE({},"Unexpected token %0",AE),{type:8,value:i,octal:a,start:e,end:_E}}():46===t?DE(yE.charCodeAt(_E+1))?$E():PE():DE(t)?$E():PE()}function HE(){var t;return _E=(t=bE).end,bE=IE(),_E=t.end,t}function WE(){var t;t=_E,bE=IE(),_E=t}function YE(t,e,n){var r=new wE("||"===t||"&&"===t?"LogicalExpression":"BinaryExpression");return r.operator=t,r.left=e,r.right=n,r}function VE(t,e){var n=new wE("CallExpression");return n.callee=t,n.arguments=e,n}function GE(t){var e=new wE("Identifier");return e.name=t,e}function XE(t){var e=new wE("Literal");return e.value=t.value,e.raw=yE.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function JE(t,e,n){var r=new wE("MemberExpression");return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function ZE(t,e,n){var r=new wE("Property");return r.key=e,r.value=n,r.kind=t,r}function QE(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(function(t,e){return EE(e<r.length,"Message reference must be in range"),r[e]}));throw(n=new Error(i)).index=_E,n.description=i,n}function KE(t){2===t.type&&QE(t,"Unexpected end of input"),6===t.type&&QE(t,"Unexpected number"),8===t.type&&QE(t,"Unexpected string"),3===t.type&&QE(t,"Unexpected identifier"),4===t.type&&QE(t,"Unexpected reserved word"),QE(t,"Unexpected token %0",t.value)}function tD(t){var e=HE();7===e.type&&e.value===t||KE(e)}function eD(t){return 7===bE.type&&bE.value===t}function nD(t){return 4===bE.type&&bE.value===t}function rD(){var t=[];for(_E=bE.start,tD("[");!eD("]");)eD(",")?(HE(),t.push(null)):(t.push(gD()),eD("]")||tD(","));return HE(),function(t){var e=new wE("ArrayExpression");return e.elements=t,e}(t)}function iD(){var t;return _E=bE.start,8===(t=HE()).type||6===t.type?(t.octal&&QE(t,"Octal literals are not allowed in strict mode."),XE(t)):GE(t.value)}function aD(){var t,e,n;return _E=bE.start,3===(t=bE).type?(n=iD(),tD(":"),ZE("init",n,gD())):2!==t.type&&7!==t.type?(e=iD(),tD(":"),ZE("init",e,gD())):void KE(t)}function uD(){var t,e,n=[],r={},i=String;for(_E=bE.start,tD("{");!eD("}");)e="$"+("Identifier"===(t=aD()).key.type?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?QE({},"Duplicate data property in object literal not allowed in strict mode"):r[e]=!0,n.push(t),eD("}")||tD(",");return tD("}"),function(t){var e=new wE("ObjectExpression");return e.properties=t,e}(n)}var oD={if:1,this:1};function sD(){var t,e,n;if(eD("("))return function(){var t;return tD("("),t=mD(),tD(")"),t}();if(eD("["))return rD();if(eD("{"))return uD();if(t=bE.type,_E=bE.start,3===t||oD[bE.value])n=GE(HE().value);else if(8===t||6===t)bE.octal&&QE(bE,"Octal literals are not allowed in strict mode."),n=XE(HE());else{if(4===t)throw new Error("Disabled.");1===t?((e=HE()).value="true"===e.value,n=XE(e)):5===t?((e=HE()).value=null,n=XE(e)):eD("/")||eD("/=")?(n=XE(jE()),WE()):KE(HE())}return n}function lD(){var t=[];if(tD("("),!eD(")"))for(;_E<xE&&(t.push(gD()),!eD(")"));)tD(",");return tD(")"),t}function cD(){return tD("."),_E=bE.start,function(t){return 3===t.type||4===t.type||1===t.type||5===t.type}(t=HE())||KE(t),GE(t.value);var t}function fD(){var t;return tD("["),t=mD(),tD("]"),t}function hD(){var t=function(){var t;for(t=sD();;)if(eD("."))t=JE(".",t,cD());else if(eD("("))t=VE(t,lD());else{if(!eD("["))break;t=JE("[",t,fD())}return t}();if(7===bE.type&&(eD("++")||eD("--")))throw new Error("Disabled.");return t}function dD(){var t,e;if(7!==bE.type&&4!==bE.type)e=hD();else{if(eD("++")||eD("--"))throw new Error("Disabled.");if(eD("+")||eD("-")||eD("~")||eD("!"))t=HE(),e=dD(),e=function(t,e){var n=new wE("UnaryExpression");return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(nD("delete")||nD("void")||nD("typeof"))throw new Error("Disabled.");e=hD()}}return e}function pD(t){var e=0;if(7!==t.type&&4!==t.type)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function gD(){var t,e;return t=function(){var t,e,n,r,i,a,u,o,s,l;if(t=bE,s=dD(),0===(i=pD(r=bE)))return s;for(r.prec=i,HE(),e=[t,bE],a=[s,r,u=dD()];(i=pD(bE))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)u=a.pop(),o=a.pop().value,s=a.pop(),e.pop(),n=YE(o,s,u),a.push(n);(r=HE()).prec=i,a.push(r),e.push(bE),n=dD(),a.push(n)}for(n=a[l=a.length-1],e.pop();l>1;)e.pop(),n=YE(a[l-1].value,a[l-2],n),l-=2;return n}(),eD("?")&&(HE(),e=gD(),tD(":"),t=function(t,e,n){var r=new wE("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,gD())),t}function mD(){var t=gD();if(eD(","))throw new Error("Disabled.");return t}var vD={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function yD(t){function e(e,n,r){return function(i){return function(e,n,r,i){var a=t(n[0]);return r&&(a=r+"("+a+")",0===r.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}}var n="new Date";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&i("Missing arguments to clamp function."),e.length>3&&i("Too many arguments to clamp function.");var n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),join:e("join",null),indexof:e("indexOf",null),lastindexof:e("lastIndexOf",null),slice:e("slice",null),reverse:function(e){return"("+t(e[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase","String",0),lower:e("toLowerCase","String",0),substring:e("substring","String"),split:e("split","String"),replace:e("replace","String"),trim:e("trim","String",0),regexp:"RegExp",test:e("test","RegExp"),if:function(e){e.length<3&&i("Missing arguments to if function."),e.length>3&&i("Too many arguments to if function.");var n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function _D(t,e){for(var n,r,i=e.fields,a=e.values,o=i.length,s=0;s<o;++s)if((r=i[s]).getter=c.getter||c(r.field),ut(n=r.getter(t))&&(n=M(n)),ut(a[s])&&(a[s]=M(a[s])),ut(a[s][0])&&(a[s]=a[s].map(M)),"E"===r.type){if(u(a[s])?a[s].indexOf(n)<0:n!==a[s])return!1}else if("R"===r.type){if(!it(n,a[s]))return!1}else if("R-RE"===r.type){if(!it(n,a[s],!0,!1))return!1}else if("R-E"===r.type){if(!it(n,a[s],!1,!1))return!1}else if("R-LE"===r.type&&!it(n,a[s],!1,!0))return!1;return!0}var xD={E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((function(t){return e.indexOf(t)>=0})):e},R_union:function(t,e){var n=M(e[0]),r=M(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=M(e[0]),r=M(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};function bD(t,e,n,r){"Literal"!==e[0].type&&i("First argument to selection functions must be a string literal.");const a=e[0].value,u=":"+a;"intersect"!==(e.length>=2&&k(e).value)||K(r,"@unit")||(r["@unit"]=n.getData(a).indataRef(n,"unit")),K(r,u)||(r[u]=n.getData(a).tuplesRef())}function wD(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function AD(t){const e=ap(t);return.2126*wD(e.r)+.7152*wD(e.g)+.0722*wD(e.b)}function kD(t){const e=this.context.data[t];return e?e.values.value:[]}const MD={};function ED(t,e,n){let r=t+":"+n,i=MD[r];return i&&i[0]===e||(MD[r]=i=[e,e(n)]),i[1]}function DD(t,e){return ED("timeFormat",ao,e)(t)}var CD=new Date(2e3,0,1);function FD(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(CD.setYear(2e3),CD.setMonth(t),CD.setDate(e),DD(CD,n)):""}function SD(t,e){let n;return W(t)?t:s(t)?(n=e.scales[t])&&n.value:void 0}function BD(t,e){return function(n,r,i){if(n){const e=SD(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const zD=BD("area",(function(t){return jy.reset(),Oy(t,Iy),2*jy})),TD=BD("bounds",(function(t){var e,n,r,i,a,u,o;if(i_=r_=-(e_=n_=1/0),l_=[],Oy(t,C_),n=l_.length){for(l_.sort(q_),e=1,a=[r=l_[0]];e<n;++e)U_(r,(i=l_[e])[0])||U_(r,i[1])?(R_(r[0],i[1])>R_(r[0],r[1])&&(r[1]=i[1]),R_(i[0],r[1])>R_(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(u=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(o=R_(r[1],i[0]))>u&&(u=o,e_=i[0],r_=r[1])}return l_=c_=null,e_===1/0||n_===1/0?[[NaN,NaN],[NaN,NaN]]:[[e_,n_],[r_,i_]]})),ND=BD("centroid",(function(t){f_=h_=d_=p_=g_=m_=v_=y_=__=x_=b_=0,Oy(t,L_);var e=__,n=x_,r=b_,i=e*e+n*n+r*r;return i<1e-12&&(e=m_,n=v_,r=y_,h_<1e-6&&(e=d_,n=p_,r=g_),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[vy(n,e)*dy,Cy(r/My(i))*dy]}));function OD(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function RD(t,e){return t===e||t!=t&&e!=e||(u(t)?!(!u(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!RD(t[n],e[n]))return!1;return!0}(t,e):!(!o(t)||!o(e))&&qD(t,e))}function qD(t,e){for(let n in t)if(!RD(t[n],e[n]))return!1;return!0}function UD(t){return e=>qD(t,e)}const LD={};function PD(t){return t.data}function $D(t,e){const n=kD.call(e,t);return n.root&&n.root.lookup||LD}const jD="undefined"!=typeof window&&window||null;function ID(t,e,n,r){"Literal"!==e[0].type&&i("First argument to data functions must be a string literal.");const a=e[0].value,u=":"+a;if(!K(u,r))try{r[u]=n.getData(a).tuplesRef()}catch(t){}}function HD(t,e,n,r){if("Literal"===e[0].type)WD(n,r,e[0].value);else if("Identifier"===e[0].type)for(t in n.scales)WD(n,r,t)}function WD(t,e,n){const r="%"+n;if(!K(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}const YD={random:function(){return t.random()},cumulativeNormal:Ni,cumulativeLogNormal:Pi,cumulativeUniform:Yi,densityNormal:Ti,densityLogNormal:Li,densityUniform:Wi,quantileNormal:Oi,quantileLogNormal:$i,quantileUniform:Vi,sampleNormal:zi,sampleLogNormal:Ui,sampleUniform:Hi,isArray:u,isBoolean:at,isDate:ut,isDefined:function(t){return void 0!==t},isNumber:ot,isObject:o,isRegExp:st,isString:s,isTuple:Dt,isValid:function(t){return null!=t&&t==t},toBoolean:mt,toDate:yt,toNumber:M,toString:_t,flush:nt,lerp:ct,merge:function(){var t=[].slice.call(arguments);return t.unshift({}),X.apply(null,t)},pad:pt,peek:k,span:gt,inrange:it,truncate:bt,rgb:ap,lab:_p,hcl:Ep,hsl:hp,luminance:AD,contrast:function(t,e){const n=AD(t),r=AD(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:li,format:function(t,e){return ED("format",Jg,e)(t)},utcFormat:function(t,e){return ED("utcFormat",uo,e)(t)},utcParse:function(t,e){return ED("utcParse",cn,e)(t)},utcOffset:Ku,utcSequence:no,timeFormat:DD,timeParse:function(t,e){return ED("timeParse",sn,e)(t)},timeOffset:Qu,timeSequence:eo,timeUnitSpecifier:io,monthFormat:function(t){return FD(t,1,"%B")},monthAbbrevFormat:function(t){return FD(t,1,"%b")},dayFormat:function(t){return FD(0,2+t,"%A")},dayAbbrevFormat:function(t){return FD(0,2+t,"%a")},quarter:$,utcquarter:j,warn:function(){return OD(this.context.dataflow,"warn",arguments)},info:function(){return OD(this.context.dataflow,"info",arguments)},debug:function(){return OD(this.context.dataflow,"debug",arguments)},extent:J,inScope:function(t){let e=this.context.group,n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:function(t,e,n){if(!t)return[];const[r,i]=t,a=(new Uo).set(r[0],r[1],i[0],i[1]);return jh(n||this.context.dataflow.scenegraph().root,a,function(t){let e=null;if(t){const n=I(t.marktype),r=I(t.markname);e=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return e}(e))},clampRange:H,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){return jD?jD.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){return jD?[jD.innerWidth,jD.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return Bd(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(m).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?kl(n,e=e||dl(t)):t}},panLinear:z,panLog:T,panPow:N,panSymlog:O,zoomLinear:q,zoomLog:U,zoomPow:L,zoomSymlog:P,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,a){let o,s,l=this.context.dataflow,c=this.context.data[t],f=c.input,h=c.changes,d=l.stamp();if(!1===l._trigger||!(f.value.length||e||r))return 0;if((!h||h.stamp<d)&&(c.changes=h=l.changeset(),h.stamp=d,l.runAfter((function(){c.modified=!0,l.pulse(f,h).run()}),!0,1)),n&&(o=!0===n?m:u(n)||Dt(n)?n:UD(n),h.remove(o)),e&&h.insert(e),r&&(o=UD(r),f.value.some(o)?h.remove(o):h.insert(r)),i)for(s in a)h.modify(i,s,a[s]);return 1}},VD=["view","item","group","xy","x","y"],GD={};function XD(t,e,n){return 1===arguments.length?YD[t]:(YD[t]=e,n&&(GD[t]=n),ZD&&(ZD.functions[t]="this."+t),this)}XD("bandwidth",(function(t,e){const n=SD(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),HD),XD("copy",(function(t,e){const n=SD(t,(e||this).context);return n?n.copy():void 0}),HD),XD("domain",(function(t,e){const n=SD(t,(e||this).context);return n?n.domain():[]}),HD),XD("range",(function(t,e){const n=SD(t,(e||this).context);return n&&n.range?n.range():[]}),HD),XD("invert",(function(t,e,n){const r=SD(t,(n||this).context);return r?u(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),HD),XD("scale",(function(t,e,n){const r=SD(t,(n||this).context);return r&&void 0!==e?r(e):void 0}),HD),XD("gradient",(function(t,e,n,r,i){t=SD(t,(i||this).context);const a=Ho(e,n);let u=t.domain(),o=u[0],s=k(u),l=d;return s-o?l=Gm(t,o,s):t=(t.interpolator?Om("sequential")().interpolator(t.interpolator()):Om("linear")().interpolate(t.interpolate()).range(t.range())).domain([o=0,s=1]),t.ticks&&(u=t.ticks(+r||15),o!==u[0]&&u.unshift(o),s!==k(u)&&u.push(s)),u.forEach(e=>a.stop(l(e),t(e))),a}),HD),XD("geoArea",zD,HD),XD("geoBounds",TD,HD),XD("geoCentroid",ND,HD),XD("geoShape",(function(t,e,n){const r=SD(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),HD),XD("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){"Literal"!==e[0].type&&i("First argument to indata must be a string literal."),"Literal"!==e[1].type&&i("Second argument to indata must be a string literal.");const a=e[0].value,u=e[1].value,o="@"+u;K(o,r)||(r[o]=n.getData(a).indataRef(n,u))})),XD("data",kD,ID),XD("treePath",(function(t,e,n){const r=$D(t,this),i=r[e],a=r[n];return i&&a?i.path(a).map(PD):void 0}),ID),XD("treeAncestors",(function(t,e){const n=$D(t,this)[e];return n?n.ancestors().map(PD):void 0}),ID),XD("vlSelectionTest",(function(t,e,n){for(var r,i,a,u,o,s=this.context.data[t],l=s?s.values.value:[],c=s?s["index:unit"]&&s["index:unit"].value:void 0,f="intersect"===n,h=l.length,d=0;d<h;++d)if(r=l[d],c&&f){if(-1===(a=(i=i||{})[u=r.unit]||0))continue;if(o=_D(e,r),i[u]=o?-1:++a,o&&1===c.size)return!0;if(!o&&a===c.get(u).count)return!1}else if(f^(o=_D(e,r)))return o;return h&&f}),bD),XD("vlSelectionResolve",(function(t,e,n){for(var r,i,a,u,o,s,l,c,f,h,d,p=this.context.data[t],g=p?p.values.value:[],m={},v={},y={},_=g.length,x=0;x<_;++x){for(u=(r=g[x]).unit,i=r.fields,a=r.values,h=0,d=i.length;h<d;++h)o=i[h],l=(s=m[o.field]||(m[o.field]={}))[u]||(s[u]=[]),y[o.field]=c=o.type.charAt(0),f=xD[c+"_union"],s[u]=f(l,I(a[h]));n&&(l=v[u]||(v[u]=[])).push(I(a).reduce((t,e,n)=>(t[i[n].field]=e,t),{}))}return e=e||"union",Object.keys(m).forEach((function(t){m[t]=Object.keys(m[t]).map(e=>m[t][e]).reduce((n,r)=>void 0===n?r:xD[y[t]+"_"+e](n,r))})),g=Object.keys(v),n&&g.length&&(m.vlMulti="union"===e?{or:g.reduce((t,e)=>(t.push.apply(t,v[e]),t),[])}:{and:g.map(t=>({or:v[t]}))}),m}),bD);const JD={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function(t){return"_["+l("$"+t)+"]"},functions:function(t){const e=yD(t);VD.forEach(t=>e[t]="event.vega."+t);for(let t in YD)e[t]="this."+t;return e},constants:vD,visitors:GD};var ZD=function(t){var e=(t=t||{}).whitelist?xt(t.whitelist):{},n=t.blacklist?xt(t.blacklist):{},r=t.constants||vD,a=(t.functions||yD)(d),u=t.globalvar,o=t.fieldvar,l={},c={},f=0,h=W(u)?u:function(t){return u+'["'+t+'"]'};function d(t){if(s(t))return t;var e=p[t.type];return null==e&&i("Unsupported type: "+t.type),e(t)}var p={Literal:function(t){return t.raw},Identifier:function(t){var a=t.name;return f>0?a:K(n,a)?i("Illegal identifier: "+a):K(r,a)?r[a]:K(e,a)?a:(l[a]=1,h(a))},MemberExpression:function(t){var e=!t.computed,n=d(t.object);e&&(f+=1);var r=d(t.property);return n===o&&(c[function(t){var e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(f-=1),n+(e?"."+r:"["+r+"]")},CallExpression:function(t){"Identifier"!==t.callee.type&&i("Illegal callee type: "+t.callee.type);var e=t.callee.name,n=t.arguments,r=K(a,e)&&a[e];return r||i("Unrecognized function: "+e),W(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:function(t){return"["+t.elements.map(d).join(",")+"]"},BinaryExpression:function(t){return"("+d(t.left)+t.operator+d(t.right)+")"},UnaryExpression:function(t){return"("+t.operator+d(t.argument)+")"},ConditionalExpression:function(t){return"("+d(t.test)+"?"+d(t.consequent)+":"+d(t.alternate)+")"},LogicalExpression:function(t){return"("+d(t.left)+t.operator+d(t.right)+")"},ObjectExpression:function(t){return"{"+t.properties.map(d).join(",")+"}"},Property:function(t){f+=1;var e=d(t.key);return f-=1,e+":"+d(t.value)}};function g(t){var e={code:d(t),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},e}return g.functions=a,g.constants=r,g}(JD);function QD(t,e,n){";"!==e[e.length-1]&&(e="return("+e+");");var r=Function.apply(null,t.concat(e));return n&&n.functions?r.bind(n.functions):r}function KD(t,e){return QD(["event"],t,e)}function tC(t,e){return QD(["item","_"],t,e)}function eC(t,e,n){var r,i;for(r in n=n||{},t)i=t[r],n[r]=u(i)?i.map((function(t){return nC(t,e,n)})):nC(i,e,n);return n}function nC(t,e,n){if(!t||!o(t))return t;for(var r,i=0,a=rC.length;i<a;++i)if(K(t,(r=rC[i]).key))return r.parse(t,e,n);return t}var rC=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||i("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){var n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=lt(t.$key,t.$flat))}},{key:"$expr",parse:function(t,n,r){t.$params&&eC(t.$params,n,r);var i="e:"+t.$expr+"_"+t.$name;return n.fn[i]||(n.fn[i]=e(function(t,e){return QD(["datum","_"],t,e)}(t.$expr,n),t.$fields,t.$name))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;var n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=c(t.$field,t.$name))}},{key:"$encode",parse:function(t,n){var r,i,a=t.$encode,u={};for(r in a)i=a[r],u[r]=e(tC(i.$expr,n),i.$fields),u[r].output=i.$output;return u}},{key:"$compare",parse:function(t,e){var n="c:"+t.$compare+"_"+t.$order,r=I(t.$compare).map((function(t){return t&&t.$tupleid?Ct:t}));return e.fn[n]||(e.fn[n]=Y(r,t.$order))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){var n=t.$subflow;return function(t,r,i){var a=oC(n,e.fork()),u=a.get(n.operators[0].id),o=a.signals.parent;return o&&o.set(i),u}}},{key:"$tupleid",parse:function(){return Ct}}];function iC(t){return(t+"").toLowerCase()}function aC(t,e){!function(t){return"operator"===iC(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?function(t,e){return QD(["_"],t,e)}(t.update,e):null)}function uC(t,e){var n=o(n=t.source)?n.$ref:n,r=e.get(n),a=null,u=t.update,s=void 0;r||i("Source not defined: "+t.source),a=t.target&&t.target.$expr?KD(t.target.$expr,e):e.get(t.target),u&&u.$expr&&(u.$params&&(s=eC(u.$params,e)),u=function(t,e){return QD(["_","event"],t,e)}(u.$expr,e)),e.update(t,r,a,u,s)}function oC(t,e){var n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),n.forEach((function(t){aC(t,e)})),n.forEach((function(t){!function(t,e){if(t.params){var n=e.get(t.id);n||i("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(eC(t.params,e),t.react,t.initonly))}}(t,e)})),(t.streams||[]).forEach((function(t){!function(t,e){var n,r=null!=t.filter?KD(t.filter,e):void 0,a=null!=t.stream?e.get(t.stream):void 0;t.source?a=e.events(t.source,t.type,r):t.merge&&(a=(n=t.merge.map(e.get.bind(e)))[0].merge.apply(n[0],n.slice(1))),t.between&&(n=t.between.map(e.get.bind(e)),a=a.between(n[0],n[1])),t.filter&&(a=a.filter(r)),null!=t.throttle&&(a=a.throttle(+t.throttle)),null!=t.debounce&&(a=a.debounce(+t.debounce)),null==a&&i("Invalid stream definition: "+JSON.stringify(t)),t.consume&&a.consume(!0),e.stream(t,a)}(t,e)})),(t.updates||[]).forEach((function(t){uC(t,e)})),e.resolve()}var sC={skip:!0};function lC(t,e,n){return new cC(t,e,n)}function cC(t,e,n){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function fC(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.functions=t.functions,this.events=t.events,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}cC.prototype=fC.prototype={fork:function(){var t=new fC(this);return(this.subcontext||(this.subcontext=[])).push(t),t},get:function(t){return this.nodes[t]},set:function(t,e){return this.nodes[t]=e},add:function(t,e){var n,r=this,i=r.dataflow;if(r.set(t.id,e),function(t){return"collect"===iC(t)}(t.type)&&(n=t.value)&&(n.$ingest?i.ingest(e,n.$ingest,n.$format):n.$request?i.preload(e,n.$request,n.$format):i.pulse(e,i.changeset().insert(n))),t.root&&(r.root=e),t.parent){var a=r.get(t.parent.$ref);a?(i.connect(a,[e]),e.targets().add(a)):(r.unresolved=r.unresolved||[]).push((function(){a=r.get(t.parent.$ref),i.connect(a,[e]),e.targets().add(a)}))}if(t.signal&&(r.signals[t.signal]=e),t.scale&&(r.scales[t.scale]=e),t.data)for(var u in t.data)n=r.data[u]||(r.data[u]={}),t.data[u].forEach((function(t){n[t]=e}))},resolve:function(){return(this.unresolved||[]).forEach((function(t){t()})),delete this.unresolved,this},operator:function(t,e){this.add(t,this.dataflow.add(t.value,e))},transform:function(t,e){this.add(t,this.dataflow.add(this.transforms[iC(e)]))},stream:function(t,e){this.set(t.id,e)},update:function(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((function(n){var i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((function(n){var r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((function(e){return e.getState(t)}))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((function(t){n.update(e.signals[t],i[t],sC)})),Object.keys(r||{}).forEach((function(t){n.pulse(e.data[t].input,n.changeset().remove(m).insert(r[t]))})),(t.subcontext||[]).forEach((function(t,n){var r=e.subcontext[n];r&&r.setState(t)}))}};var hC={skip:!0};function dC(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.left+r.right:0)}function pC(t,e){var n=t.autosize(),r=t.padding();return e-(n&&"padding"===n.contains?r.top+r.bottom:0)}function gC(t,e){return e.modified&&u(e.input.value)&&t.indexOf("_:vega:_")}function mC(t,e){return!("parent"===t||e instanceof Yr.proxy)}function vC(t,e,n,r){var i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":u(t)?yC(t):o(t)&&!ut(t)?(e=t,Object.keys(e).map((function(t){var n=e[t];return t+": "+(u(n)?yC(n):_C(n))})).join("\n")):t+"";var e}(r))}function yC(t){return"["+t.map(_C).join(", ")+"]"}function _C(t){return u(t)?"[…]":o(t)&&!ut(t)?"{…}":t}function xC(t,e){e=e||{},$r.call(this),e.loader&&this.loader(e.loader),e.logger&&this.logger(e.logger),null!=e.logLevel&&this.logLevel(e.logLevel),this._el=null,this._elBind=null,this._renderType=e.renderer||Lh.Canvas,this._scenegraph=new Pf;var n=this._scenegraph.root;this._renderer=null,this._tooltip=e.tooltip||vC,this._redraw=!0,this._handler=(new th).scene(n),this._preventDefault=!1,this._timers=[],this._eventListeners=[],this._resizeListeners=[],this._eventConfig=function(t){const e=X({defaults:{}},t),n=(t,e)=>{e.forEach(e=>{u(t[e])&&(t[e]=xt(t[e]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig);var r=function(t,e,n){return oC(e,lC(t,Yr,n||YD))}(this,t,e.functions);this._runtime=r,this._signals=r.signals,this._bind=(t.bindings||[]).map((function(t){return{state:null,param:X({},t)}})),r.root&&r.root.set(n),n.source=r.data.root.input,this.pulse(r.data.root.input,this.changeset().insert(n.items)),this._width=this.width(),this._height=this.height(),this._viewWidth=dC(this,this._width),this._viewHeight=pC(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function a(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(function(e){t._width=e.size,t._viewWidth=dC(t,e.size),a()}),{size:n}),t._resizeHeight=t.add(null,(function(e){t._height=e.size,t._viewHeight=pC(t,e.size),a()}),{size:r});var u=t.add(null,a,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,u.rank=i.rank+1}(this),function(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}(this),WM(this),this.description(t.description),e.hover&&this.hover(),e.container&&this.initialize(e.container,e.bind)}var bC=rt(xC,$r);function wC(t,e){return K(t._signals,e)?t._signals[e]:i("Unrecognized signal name: "+l(e))}function AC(t,e){var n=(t._targets||[]).filter((function(t){var n=t._update;return n&&n.handler===e}));return n.length?n[0]:null}function kC(t,e,n,r){var i=AC(n,r);return i||((i=hE(this,(function(){r(e,n.value)}))).handler=r,t.on(n,null,i)),t}function MC(t,e,n){var r=AC(e,n);return r&&e._targets.remove(r),t}function EC(t){return o(t)?t:{type:t||"pad"}}bC.evaluate=async function(t,e,n){if(await $r.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=JM(t),n=GM(t),r=XM(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((function(e){try{e(n,r)}catch(e){t.error(e)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}return n&&kt(this,n),this},bC.dirty=function(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},bC.description=function(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&HM(this._el,this._desc=e),this}return this._desc},bC.container=function(){return this._el},bC.scenegraph=function(){return this._scenegraph},bC.origin=function(){return this._origin.slice()},bC.signal=function(t,e,n){var r=wC(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},bC.width=function(t){return arguments.length?this.signal("width",t):this.signal("width")},bC.height=function(t){return arguments.length?this.signal("height",t):this.signal("height")},bC.padding=function(t){return arguments.length?this.signal("padding",gE(t)):gE(this.signal("padding"))},bC.autosize=function(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},bC.background=function(t){return arguments.length?this.signal("background",t):this.signal("background")},bC.renderer=function(t){return arguments.length?($h(t)||i("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},bC.tooltip=function(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},bC.loader=function(t){return arguments.length?(t!==this._loader&&($r.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},bC.resize=function(){return this._autosize=1,this.touch(wC(this,"autosize"))},bC._resetRenderer=function(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},bC._resizeView=function(t,e,n,r,i,a){this.runAfter((function(u){var o=0;u._autosize=0,u.width()!==n&&(o=1,u.signal("width",n,hC),u._resizeWidth.skip(!0)),u.height()!==r&&(o=1,u.signal("height",r,hC),u._resizeHeight.skip(!0)),u._viewWidth!==t&&(u._resize=1,u._viewWidth=t),u._viewHeight!==e&&(u._resize=1,u._viewHeight=e),u._origin[0]===i[0]&&u._origin[1]===i[1]||(u._resize=1,u._origin=i),o&&u.run("enter"),a&&u.runAfter(t=>t.resize())}),!1,1)},bC.addEventListener=function(t,e,n){var r=e;return n&&!1===n.trap||((r=hE(this,e)).raw=e),this._handler.on(t,r),this},bC.removeEventListener=function(t,e){for(var n,r,i=this._handler.handlers(t),a=i.length;--a>=0;)if(r=i[a].type,n=i[a].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},bC.addResizeListener=function(t){var e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},bC.removeResizeListener=function(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},bC.addSignalListener=function(t,e){return kC(this,t,wC(this,t),e)},bC.removeSignalListener=function(t,e){return MC(this,wC(this,t),e)},bC.addDataListener=function(t,e){return kC(this,t,YM(this,t).values,e)},bC.removeDataListener=function(t,e){return MC(this,YM(this,t).values,e)},bC.preventDefault=function(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},bC.timer=function(t,e){this._timers.push(function(t,e,n){var r=new lA,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?oA():+n,r.restart((function a(u){u+=i,r.restart(a,i+=e,n),t(u)}),e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},bC.events=function(t,e,n){var r,i=this,a=new Yt(n),u=function(n,r){i.runAsync(null,()=>{"view"===t&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),a.receive(ZM(i,n,r))})};if("timer"===t)KM(i,"timer",e)&&i.timer(u,e);else if("view"===t)KM(i,"view",e)&&i.addEventListener(e,u,QM);else if("window"===t?KM(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&KM(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var o=0,s=r.length;o<s;++o)r[o].addEventListener(e,u);i._eventListeners.push({type:e,sources:r,handler:u})}else i.warn("Can not resolve event source: "+t);return a},bC.finalize=function(){var t,e,n,r=this._tooltip,i=this._timers,a=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=a.length;--t>=0;)for(e=(n=a[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},bC.hover=function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",tE),eE,nE(t)),this.on(this.events("view","mouseout",tE),eE,nE(e)),this},bC.data=function(t,e){return arguments.length<2?YM(this,t).values.value:VM.call(this,t,Rt().remove(m).insert(e))},bC.change=VM,bC.insert=function(t,e){return VM.call(this,t,Rt().insert(e))},bC.remove=function(t,e){return VM.call(this,t,Rt().remove(e))},bC.scale=function(t){var e=this._runtime.scales;return K(e,t)||i("Unrecognized scale or projection: "+t),e[t].value},bC.initialize=function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,a=$h(r);t=n._el=t?dE(n,t):null,function(t){const e=t.container();e&&(e.setAttribute("role","figure"),HM(e,t.description()))}(n),a||n.error("Unrecognized renderer type: "+r);const u=a.handler||th,o=t?a.renderer:a.headless;return n._renderer=o?fE(n,n._renderer,t,o):null,n._handler=function(t,e,n,r){var i=new r(t.loader(),hE(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,JM(t),t);return e&&e.handlers().forEach((function(t){i.on(t.type,t.handler)})),i}(n,n._handler,t,u),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=dE(n,e):t.appendChild(rE("div",{class:"vega-bindings"})),n._bind.forEach((function(t){t.param.element&&"container"!==i&&(t.element=dE(n,t.param.element))})),n._bind.forEach((function(t){iE(n,t.element||e,t)}))),n},bC.toImageURL=async function(t,e){t!==Lh.Canvas&&t!==Lh.SVG&&t!==Lh.PNG&&i("Unrecognized image type: "+t);const n=await mE(this,t,e);return t===Lh.SVG?function(t,e){var n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},bC.toCanvas=async function(t,e){return(await mE(this,Lh.Canvas,t,e)).canvas()},bC.toSVG=async function(t){return(await mE(this,Lh.SVG,t)).svg()},bC.getState=function(t){return this._runtime.getState(t||{data:gC,signals:mC,recurse:!0})},bC.setState=function(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},t=>{t._trigger=!0}),this};const DC=t=>+t||0;function CC(t){return o(t)?t.signal?t:{top:DC(t.top),bottom:DC(t.bottom),left:DC(t.left),right:DC(t.right)}:{top:e=DC(t),bottom:e,left:e,right:e};var e}var FC=["value","update","init","react","bind"];function SC(t,e){i(t+' for "outer" push: '+l(e))}function BC(t,e){var n=t.name;if("outer"===t.push)e.signals[n]||SC("No prior signal definition",n),FC.forEach((function(e){void 0!==t[e]&&SC("Invalid property ",e)}));else{var r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function zC(t,e,n){var r,a,u={};try{r=function(t){_E=0,xE=(yE=t).length,bE=null,WE();var e=mD();if(2!==bE.type)throw new Error("Unexpect token after expression.");return e}(t=s(t)?t:l(t)+"")}catch(e){i("Expression parse error: "+t)}return r.visit((function(t){if("CallExpression"===t.type){var n=t.callee.name,r=JD.visitors[n];r&&r(n,t.arguments,e,u)}})),(a=ZD(r)).globals.forEach((function(t){var n="$"+t;!K(u,n)&&e.getSignal(t)&&(u[n]=e.signalRef(t))})),{$expr:n?n+"return("+a.code+");":a.code,$fields:a.fields,$params:u}}function TC(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function NC(t,e,n,r){return new TC(t,e,n,r)}function OC(t,e){return NC("operator",t,e)}function RC(t){var e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function qC(t,e){return e?{$field:t,$name:e}:{$field:t}}var UC=qC("key");function LC(t,e){return{$compare:t,$order:e}}function PC(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}function $C(t){return t&&t.signal}function jC(t){if($C(t))return!0;if(o(t))for(var e in t)if(jC(t[e]))return!0;return!1}function IC(t,e){return null!=t?t:e}function HC(t){return t&&t.signal||t}function WC(t,e){return(t.merge?YC:t.stream?VC:t.type?GC:i("Invalid stream specification: "+l(t)))(t,e)}function YC(t,e){var n=XC({merge:t.merge.map(t=>WC(t,e))},t,e);return e.addStream(n).id}function VC(t,e){var n=XC({stream:WC(t.stream,e)},t,e);return e.addStream(n).id}function GC(t,e){var n,r;return"timer"===t.type?(n=e.event("timer",t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return"scope"===t?"view":t||"view"}(t.source),t.type),r=XC({stream:n},t,e),1===Object.keys(r).length?n:e.addStream(r).id}function XC(t,e,n){var r=e.between;return r&&(2!==r.length&&i('Stream "between" parameter must have 2 entries: '+l(e)),t.between=[WC(r[0],n),WC(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){var r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),"scope"===e.source&&r.push("inScope(event.item)"),r.length&&(t.filter=zC("("+r.join(")&&(")+")").$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}var JC,ZC,QC="view",KC=/[[\]{}]/,tF={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function eF(t,e,n,r,i){for(var a,u=0,o=t.length;e<o;++e){if(a=t[e],!u&&a===n)return e;i&&i.indexOf(a)>=0?--u:r&&r.indexOf(a)>=0&&++u}return e}function nF(t){for(var e=[],n=0,r=t.length,i=0;i<r;)i=eF(t,i,",","[{","]}"),e.push(t.substring(n,i).trim()),n=++i;if(0===e.length)throw"Empty event selector: "+t;return e}function rF(t){return"["===t[0]?function(t){var e,n,r=t.length,i=1;if((i=eF(t,i,"]","[","]"))===r)throw"Empty between selector: "+t;if(2!==(e=nF(t.substring(1,i))).length)throw"Between selector must have two elements: "+t;if(">"!==(t=t.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+t;if(e=e.map(rF),(n=rF(t.slice(1).trim())).between)return{between:e,stream:n};n.between=e;return n}(t):function(t){var e,n,r={source:JC},i=[],a=[0,0],u=0,o=0,s=t.length,l=0;if("}"===t[s-1]){if(!((l=t.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+t;try{a=function(t){var e=t.split(",");if(!t.length||e.length>2)throw t;return e.map((function(e){var n=+e;if(n!=n)throw t;return n}))}(t.substring(l+1,s-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,l).trim(),s=t.length,l=0}if(!s)throw t;"@"===t[0]&&(u=++l);(e=eF(t,l,":"))<s&&(i.push(t.substring(o,e).trim()),o=l=++e);if((l=eF(t,l,"["))===s)i.push(t.substring(o,s).trim());else if(i.push(t.substring(o,l).trim()),n=[],(o=++l)===s)throw"Unmatched left bracket: "+t;for(;l<s;){if((l=eF(t,l,"]"))===s)throw"Unmatched left bracket: "+t;if(n.push(t.substring(o,l).trim()),l<s-1&&"["!==t[++l])throw"Expected left bracket: "+t;o=++l}if(!(s=i.length)||KC.test(i[s-1]))throw"Invalid event selector: "+t;s>1?(r.type=i[1],u?r.markname=i[0].slice(1):!function(t){return ZC[t]}(i[0])?r.source=i[0]:r.marktype=i[0]):r.type=i[0];"!"===r.type.slice(-1)&&(r.consume=!0,r.type=r.type.slice(0,-1));null!=n&&(r.filter=n);a[0]&&(r.throttle=a[0]);a[1]&&(r.debounce=a[1]);return r}(t)}var iF="var datum=event.item&&event.item.datum;";function aF(t,e,n){var r=t.events,a=t.update,u=t.encode,o=[],c={target:n};r||i("Signal update missing events specification."),s(r)&&(r=function(t,e,n){return JC=e||QC,ZC=n||tF,nF(t.trim()).map(rF)}(r,e.isSubscope()?"scope":"view")),r=I(r).filter(t=>t.signal||t.scale?(o.push(t),0):1),o.length>1&&(o=[uF(o)]),r.length&&o.push(r.length>1?{merge:r}:r[0]),null!=u&&(a&&i("Signal encode and update are mutually exclusive."),a="encode(item(),"+l(u)+")"),c.update=s(a)?zC(a,e,iF):null!=a.expr?zC(a.expr,e,iF):null!=a.value?a.value:null!=a.signal?{$expr:"_.value",$params:{value:e.signalRef(a.signal)}}:i("Invalid signal update specification."),t.force&&(c.options={force:!0}),o.forEach((function(t){e.addUpdate(X(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):WC(t,e)}}(t,e),c))}))}function uF(t){return{signal:"["+t.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function oF(t){return function(e,n,r){return NC(t,n,e||void 0,r)}}var sF=oF("aggregate"),lF=oF("axisticks"),cF=oF("bound"),fF=oF("collect"),hF=oF("compare"),dF=oF("datajoin"),pF=oF("encode"),gF=oF("expression"),mF=oF("facet"),vF=oF("field"),yF=oF("key"),_F=oF("legendentries"),xF=oF("load"),bF=oF("mark"),wF=oF("multiextent"),AF=oF("multivalues"),kF=oF("overlap"),MF=oF("params"),EF=oF("prefacet"),DF=oF("projection"),CF=oF("proxy"),FF=oF("relay"),SF=oF("render"),BF=oF("scale"),zF=oF("sieve"),TF=oF("sortitems"),NF=oF("viewlayout"),OF=oF("values"),RF=0,qF={min:"min",max:"max",count:"sum"};function UF(t,e){var n,r=e.getScale(t.name).params;for(n in r.domain=jF(t.domain,t,e),null!=t.range&&(r.range=function t(e,n,r){var a=e.range,o=n.config.range;if(a.signal)return n.signalRef(a.signal);if(s(a)){if(o&&K(o,a))return e=X({},e,{range:o[a]}),t(e,n,r);"width"===a?a=[0,{signal:"width"}]:"height"===a?a=Lm(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:i("Unrecognized scale range value: "+l(a))}else{if(a.scheme)return r.scheme=u(a.scheme)?PF(a.scheme,n):LF(a.scheme,n),a.extent&&(r.schemeExtent=PF(a.extent,n)),void(a.count&&(r.schemeCount=LF(a.count,n)));if(a.step)return void(r.rangeStep=LF(a.step,n));if(Lm(e.type)&&!u(a))return jF(a,e,n);u(a)||i("Unsupported range type: "+l(a))}return a.map(t=>(u(t)?PF:LF)(t,n))}(t,e,r)),null!=t.interpolate&&function(t,e){e.interpolate=LF(t.type||t),null!=t.gamma&&(e.interpolateGamma=LF(t.gamma))}(t.interpolate,r),null!=t.nice&&(r.nice=function(t){return o(t)?{interval:LF(t.interval),step:LF(t.step)}:LF(t)}(t.nice)),null!=t.bins&&(r.bins=function(t,e){return t.signal||u(t)?PF(t,e):e.objectProperty(t)}(t.bins,e)),t)K(r,n)||"name"===n||(r[n]=LF(t[n],e))}function LF(t,e){return o(t)?t.signal?e.signalRef(t.signal):i("Unsupported object: "+l(t)):t}function PF(t,e){return t.signal?e.signalRef(t.signal):t.map(t=>LF(t,e))}function $F(t){i("Can not find data set: "+l(t))}function jF(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(u(t)?IF:t.fields?WF:HF)(t,e,n);null==e.domainMin&&null==e.domainMax||i("No scale domain defined for domainMin/domainMax to override.")}function IF(t,e,n){return t.map((function(t){return LF(t,n)}))}function HF(t,e,n){var r=n.getData(t.data);return r||$F(t.data),Lm(e.type)?r.valuesRef(n,t.field,VF(t.sort,!1)):Im(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function WF(t,e,n){var r=t.data,i=t.fields.reduce((function(t,e){return e=s(e)?{data:r,field:e}:u(e)||e.signal?function(t,e){var n="_:vega:_"+RF++,r=fF({});if(u(t))r.value={$ingest:t};else if(t.signal){var i="setdata("+l(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,zF({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t}),[]);return(Lm(e.type)?YF:Im(e.type)?GF:XF)(t,n,i)}function YF(t,e,n){var r,i,a,u,o,s=VF(t.sort,!0);return r=n.map((function(t){var n=e.getData(t.data);return n||$F(t.data),n.countsRef(e,t.field,s)})),i={groupby:UC,pulse:r},s&&(a=s.op||"count",o=s.field?PC(a,s.field):"count",i.ops=[qF[a]],i.fields=[e.fieldRef(o)],i.as=[o]),a=e.add(sF(i)),u=e.add(fF({pulse:RC(a)})),o=e.add(OF({field:UC,sort:e.sortRef(s),pulse:RC(u)})),RC(o)}function VF(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!qF[t.op]&&i("Multiple domain scales can not be sorted using "+t.op):i("No field provided for sort aggregate op: "+t.op):o(t)?t.field="key":t={field:"key"}),t}function GF(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||$F(t.data),n.domainRef(e,t.field)}));return RC(e.add(AF({values:r})))}function XF(t,e,n){var r=n.map((function(t){var n=e.getData(t.data);return n||$F(t.data),n.extentRef(e,t.field)}));return RC(e.add(wF({extents:r})))}function JF(t,e,n){return u(t)?t.map((function(t){return JF(t,e,n)})):o(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:i("Unsupported parameter object: "+l(t)):t}const ZF="value",QF=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],KF={name:1,style:1,interactive:1},tS={value:0},eS={value:1};var nS=xt(["rule"]),rS=xt(["group","image","rect"]);function iS(t,e,n,r){var i=zC(t,e);return i.$fields.forEach((function(t){r[t]=1})),X(n,i.$params),i.$expr}function aS(t,e,n,r){return function t(e,n,r,u){var o,c,f;if(e.signal)o="datum",f=iS(e.signal,n,r,u);else if(e.group||e.parent){for(c=Math.max(1,e.level||1),o="item";c-- >0;)o+=".mark.group";e.parent?(f=e.parent,o+=".datum"):f=e.group}else e.datum?(o="datum",f=e.datum):i("Invalid field reference: "+l(e));e.signal||(s(f)?(u[f]=1,f=a(f).map(l).join("][")):f=t(f,n,r,u));return o+"["+f+"]"}(o(t)?t:{datum:t},e,n,r)}function uS(t,e,n,r){return o(t)?"("+lS(null,t,e,n,r)+")":t}function oS(t,e,n,r,i){var a,u,o,l=sS(t.scale,n,r,i);return null!=t.range?(u=l+".range()",e=0===(a=+t.range)?u+"[0]":"($="+u+","+(1===a?"$[$.length-1]":"$[0]+"+a+"*($[$.length-1]-$[0])")+")"):(void 0!==e&&(e=l+"("+e+")"),t.band&&(o=function(t,e){if(!s(t))return-1;var n=e.scaleType(t);return"band"===n||"point"===n?1:0}(t.scale,n))&&(u=l+".bandwidth",a=t.band.signal?u+"()*"+uS(t.band,n,r,i):u+"()"+(1===(a=+t.band)?"":"*"+a),o<0&&(a="("+u+"?"+a+":0)"),e=(e?e+"+":"")+a,t.extra&&(e="(datum.extra?"+l+"(datum.extra.value):"+e+")")),null==e&&(e="0")),e}function sS(t,e,n,r){var i;if(s(t))K(n,i="%"+t)||(n[i]=e.scaleRef(t)),i=l(i);else{for(i in e.scales)n["%"+i]=e.scaleRef(i);i=l("%")+"+"+(t.signal?"("+iS(t.signal,e,n,r)+")":aS(t,e,n,r))}return"_["+i+"]"}function lS(t,e,n,r,i){if(null!=e.gradient)return function(t,e,n,r){return"this.gradient("+sS(t.gradient,e,n,r)+","+l(t.start)+","+l(t.stop)+","+l(t.count)+")"}(e,n,r,i);var a=e.signal?iS(e.signal,n,r,i):e.color?function(t,e,n,r){function i(t,i,a,u){return"this."+t+"("+[lS(null,i,e,n,r),lS(null,a,e,n,r),lS(null,u,e,n,r)].join(",")+").toString()"}return t.c?i("hcl",t.h,t.c,t.l):t.h||t.s?i("hsl",t.h,t.s,t.l):t.l||t.a?i("lab",t.l,t.a,t.b):t.r||t.g||t.b?i("rgb",t.r,t.g,t.b):null}(e.color,n,r,i):null!=e.field?aS(e.field,n,r,i):void 0!==e.value?l(e.value):void 0;return null!=e.scale&&(a=oS(e,a,n,r,i)),void 0===a&&(a=null),null!=e.exponent&&(a="Math.pow("+a+","+uS(e.exponent,n,r,i)+")"),null!=e.mult&&(a+="*"+uS(e.mult,n,r,i)),null!=e.offset&&(a+="+"+uS(e.offset,n,r,i)),e.round&&(a="Math.round("+a+")"),a}function cS(t,e,n){const r=t+"["+l(e)+"]";return`$=${n};if(${r}!==$)${r}=$,m=1;`}function fS(t,e,n,r,i){var a="";return e.forEach((function(t){var e=lS(0,t,n,r,i);a+=t.test?iS(t.test,n,r,i)+"?"+e+":":e})),":"===k(a)&&(a+="null"),cS("o",t,a)}function hS(t,e,n,r){var i,a,o={},s="var o=item,datum=o.datum,m=0,$;";for(i in t)a=t[i],u(a)?s+=fS(i,a,r,n,o):s+=cS("o",i,lS(0,a,r,n,o));return s+=function(t,e){var n="";return nS[e]||(t.x2&&(t.x?(rS[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(rS[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(t,e),{$expr:s+="return m;",$fields:Object.keys(o),$output:Object.keys(t)}}function dS(t){return o(t)&&!u(t)?X({},t):{value:t}}function pS(t,e,n,r){return null!=n?(o(n)&&!u(n)?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function gS(t,e,n){for(let n in e)pS(t,n,e[n]);for(let e in n)pS(t,e,n[e],"update")}function mS(t,e,n){for(var r in e)n&&K(n,r)||(t[r]=X(t[r]||{},e[r]));return t}function vS(t,e,n,r,i,a){var u,o;for(o in(a=a||{}).encoders={$encode:u={}},t=function(t,e,n,r,i){var a,u,o,s={},l={};u="lineBreak","text"!==e||null==i[u]||_S(u,t)||yS(s,u,i[u]);"legend"!=n&&0!==String(n).indexOf("axis")||(n=null);for(u in o="frame"===n?i.group:"mark"===n?X({},i.mark,i[e]):null)_S(u,t)||("fill"===u||"stroke"===u)&&(_S("fill",t)||_S("stroke",t))||yS(s,u,o[u]);for(u in I(r).forEach((function(e){var n=i.style&&i.style[e];for(var r in n)_S(r,t)||yS(s,r,n[r])})),t=X({},t),s)(o=s[u]).signal?(a=a||{})[u]=o:l[u]=o;t.enter=X(l,t.enter),a&&(t.update=X(a,t.update));return t}(t,e,n,r,i.config))u[o]=hS(t[o],e,a,i);return a}function yS(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}function _S(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}function xS(t,e,n,r,i,a,u){return{type:t,name:u?u.name:void 0,role:e,style:u&&u.style||n,key:r,from:i,interactive:!(!u||!u.interactive),encode:mS(a,u,KF)}}function bS(t,e){const n=(n,r)=>IC(t[n],IC(e[n],r));return n.isVertical=n=>"vertical"===IC(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>IC(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>IC(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>IC(t.columns,IC(e.columns,+n.isVertical(!0))),n}function wS(t,e){var n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function AS(t,e,n){return`item.anchor === "start" ? ${t} : item.anchor === "end" ? ${e} : ${n}`}const kS=AS(l("left"),l("right"),l("center"));function MS(t,e){return e?t?o(t)?{...t,offset:MS(t.offset,e)}:{value:t,offset:e}:e:t}function ES(t,e,n,r){var i,a,u,o,s,l,c=bS(t,n),f=c.isVertical(),h=c.gradientThickness(),d=c.gradientLength();return f?(u=[0,1],o=[0,0],s=h,l=d):(u=[0,0],o=[1,0],s=d,l=h),gS(i={enter:a={opacity:tS,x:tS,y:tS,width:dS(s),height:dS(l)},update:X({},a,{opacity:eS,fill:{gradient:e,start:u,stop:o}}),exit:{opacity:tS}},{stroke:c("gradientStrokeColor"),strokeWidth:c("gradientStrokeWidth")},{opacity:c("gradientOpacity")}),xS("rect","legend-gradient",null,void 0,void 0,i,r)}function DS(t,e,n,r,i){var a,u,o,s,l,c,f=bS(t,n),h=f.isVertical(),d=f.gradientThickness(),p=f.gradientLength(),g="";return h?(o="y",l="y2",s="x",c="width",g="1-"):(o="x",l="x2",s="y",c="height"),(u={opacity:tS,fill:{scale:e,field:ZF}})[o]={signal:g+"datum.perc",mult:p},u[s]=tS,u[l]={signal:g+"datum.perc2",mult:p},u[c]=dS(d),gS(a={enter:u,update:X({},u,{opacity:eS}),exit:{opacity:tS}},{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),xS("rect","legend-band",null,ZF,i,a,r)}function CS(t,e,n,r){var i,a,u,o,s,l=bS(t,e),c=l.isVertical(),f=dS(l.gradientThickness()),h=l.gradientLength(),d=l("labelOverlap"),p=l("labelSeparation"),g="";return gS(i={enter:a={opacity:tS},update:u={opacity:eS,text:{field:"label"}},exit:{opacity:tS}},{fill:l("labelColor"),fillOpacity:l("labelOpacity"),font:l("labelFont"),fontSize:l("labelFontSize"),fontStyle:l("labelFontStyle"),fontWeight:l("labelFontWeight"),limit:IC(t.labelLimit,e.gradientLabelLimit)}),c?(a.align={value:"left"},a.baseline=u.baseline={signal:'datum.perc<=0?"bottom":datum.perc>=1?"top":"middle"'},o="y",s="x",g="1-"):(a.align=u.align={signal:'datum.perc<=0?"left":datum.perc>=1?"right":"center"'},a.baseline={value:"top"},o="x",s="y"),a[o]=u[o]={signal:g+"datum.perc",mult:h},a[s]=u[s]=f,f.offset=IC(t.labelOffset,e.gradientLabelOffset)||0,t=xS("text","legend-label","guide-label",ZF,r,i,n),d&&(t.overlap={separation:p,method:d,order:"datum.index"}),t}function FS(t,e,n,r,i,a,u,o){return{type:"group",name:n,role:t,style:e,from:r,interactive:i||!1,encode:a,marks:u,layout:o}}function SS(t,e,n,r,i){var a,u,o,s,l,c,f,h=bS(t,e),d=n.entries,p=!(!d||!d.interactive),g=d?d.name:void 0,m=h("clipHeight"),v=h("symbolOffset"),y={data:"value"},_={},x=`(${i}) ? datum.offset : datum.size`,b=m?dS(m):{field:"size"},w="datum.index",A=`max(1, ${i})`;b.mult=.5,_={enter:a={opacity:tS,x:{signal:x,mult:.5,offset:v},y:b},update:u={opacity:eS,x:a.x,y:a.y},exit:{opacity:tS}};var k=null,M=null;return t.fill||(k=e.symbolBaseFillColor,M=e.symbolBaseStrokeColor),gS(_,{fill:h("symbolFillColor",k),shape:h("symbolType"),size:h("symbolSize"),stroke:h("symbolStrokeColor",M),strokeDash:h("symbolDash"),strokeDashOffset:h("symbolDashOffset"),strokeWidth:h("symbolStrokeWidth")},{opacity:h("symbolOpacity")}),QF.forEach((function(e){t[e]&&(u[e]=a[e]={scale:t[e],field:ZF})})),s=xS("symbol","legend-symbol",null,ZF,y,_,n.symbols),m&&(s.clip=!0),(o=dS(v)).offset=h("labelOffset"),gS(_={enter:a={opacity:tS,x:{signal:x,offset:o},y:b},update:u={opacity:eS,text:{field:"label"},x:a.x,y:a.y},exit:{opacity:tS}},{align:h("labelAlign"),baseline:h("labelBaseline"),fill:h("labelColor"),fillOpacity:h("labelOpacity"),font:h("labelFont"),fontSize:h("labelFontSize"),fontStyle:h("labelFontStyle"),fontWeight:h("labelFontWeight"),limit:h("labelLimit")}),l=xS("text","legend-label","guide-label",ZF,y,_,n.labels),_={enter:{noBound:{value:!m},width:tS,height:m?dS(m):tS,opacity:tS},exit:{opacity:tS},update:u={opacity:eS,row:{signal:null},column:{signal:null}}},h.isVertical(!0)?(c=`ceil(item.mark.items.length / ${A})`,u.row.signal=`${w}%${c}`,u.column.signal=`floor(${w} / ${c})`,f={field:["row",w]}):(u.row.signal=`floor(${w} / ${A})`,u.column.signal=`${w} % ${A}`,f={field:w}),u.column.signal=`(${i})?${u.column.signal}:${w}`,(t=FS("scope",null,g,r={facet:{data:r,name:"value",groupby:"index"}},p,mS(_,d,KF),[s,l])).sort=f,t}const BS='item.orient === "left"',zS='item.orient === "right"',TS=`(${BS} || ${zS})`,NS=`datum.vgrad && ${TS}`,OS=AS('"top"','"bottom"','"middle"'),RS=`datum.vgrad && ${zS} ? (${AS('"right"','"left"','"center"')}) : (${TS} && !(datum.vgrad && ${BS})) ? "left" : ${kS}`,qS=`item._anchor || (${TS} ? "middle" : "start")`,US=`${NS} ? (${BS} ? -90 : 90) : 0`,LS=`${TS} ? (datum.vgrad ? (${zS} ? "bottom" : "top") : ${OS}) : "top"`;function PS(t,e){var n;return o(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+$S(t.path)+")":t.sphere&&(n="geoShape("+$S(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function $S(t){return o(t)&&t.signal?t.signal:l(t)}function jS(t){var e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?"group"===t.type?"scope":e||"mark":e}function IS(t){return{marktype:t.type,name:t.name||void 0,role:t.role||jS(t),zindex:+t.zindex||void 0}}function HS(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function WS(t,e){var n=Vr(t.type);n||i("Unrecognized transform type: "+l(t.type));var r=NC(n.type.toLowerCase(),null,YS(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function YS(t,e,n){var r,i,a,u={};for(i=0,a=t.params.length;i<a;++i)u[(r=t.params[i]).name]=VS(r,e,n);return u}function VS(t,e,n){var r=t.type,a=e[t.name];return"index"===r?function(t,e,n){s(e.from)||i('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==a?"param"===r?function(t,e,n){var r=e[t.name];return t.array?(u(r)||i("Expected an array of sub-parameters. Instead: "+l(r)),r.map((function(e){return XS(t,e,n)}))):XS(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!$C(a)?a.map((function(e){return GS(t,e,n)})):GS(t,a,n):void(t.required&&i("Missing required "+l(e.type)+" parameter: "+l(t.name)))}function GS(t,e,n){var r=t.type;if($C(e))return JS(r)?i("Expression references can not be signals."):ZS(r)?n.fieldRef(e):QS(r)?n.compareRef(e):n.signalRef(e.signal);var a,u=t.expr||ZS(r);return u&&((a=e)&&a.expr)?n.exprRef(e.expr,e.as):u&&function(t){return t&&t.field}(e)?qC(e.field,e.as):JS(r)?zC(e,n):function(t){return"data"===t}(r)?RC(n.getData(e).values):ZS(r)?qC(e):QS(r)?n.compareRef(e):e}function XS(t,e,n){var r,a,u,o,s;for(o=0,s=t.params.length;o<s;++o){for(u in(a=t.params[o]).key)if(a.key[u]!==e[u]){a=null;break}if(a)break}return a||i("Unsupported parameter: "+l(e)),r=X(YS(a,e,n),a.key),RC(n.add(MF(r)))}function JS(t){return"expr"===t}function ZS(t){return"field"===t}function QS(t){return"compare"===t}function KS(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:RC(e.getData(t.data).output)}function tB(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}tB.fromEntries=function(t,e){var n=e.length,r=1,i=e[0],a=e[n-1],u=e[n-2],o=null;for(i&&"load"===i.type&&(i=e[1]),t.add(e[0]);r<n;++r)e[r].params.pulse=RC(e[r-1]),t.add(e[r]),"aggregate"===e[r].type&&(o=e[r]);return new tB(t,i,u,a,o)};var eB=tB.prototype;function nB(t){return s(t)?t:null}function rB(t,e,n){var r,i=PC(n.op,n.field);if(e.ops){for(var a=0,u=e.as.length;a<u;++a)if(e.as[a]===i)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((r=n.op.signal)?t.signalRef(r):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(i))}function iB(t,e,n,r,i,a,u){var s,l,c=e[n]||(e[n]={}),f=function(t){return o(t)?("descending"===t.order?"-":"+")+PC(t.op,t.field):""}(a),h=nB(i);if(null!=h&&(t=e.scope,s=c[h+=f?"|"+f:""]),!s){var d=a?{field:UC,pulse:e.countsRef(t,i,a)}:{field:t.fieldRef(i),pulse:RC(e.output)};f&&(d.sort=t.sortRef(a)),l=t.add(NC(r,void 0,d)),u&&(e.index[i]=l),s=RC(l),null!=h&&(c[h]=s)}return s}function aB(t,e,n){var r,i=t.remove,a=t.insert,u=t.toggle,o=t.modify,s=t.values,l=e.add(OC());r=zC("if("+t.trigger+',modify("'+n+'",'+[a,i,u,o,s].map((function(t){return null==t?"null":t})).join(",")+"),0)",e),l.update=r.$expr,l.params=r.$params}function uB(t,e){var n,r,a,u,o,s,c,f,h,d,p,g,m,v,y=jS(t),_="group"===t.type,x=t.from&&t.from.facet,b=t.layout||"scope"===y||"frame"===y,w="mark"===y||b||x,A=t.overlap;a=function(t,e,n){var r,a,u,o,s;return t?(r=t.facet)&&(e||i("Only group marks can be faceted."),null!=r.field?o=s=KS(r,n):(t.data?s=RC(n.getData(t.data).aggregate):((u=WS(X({type:"aggregate",groupby:I(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),u.params.pulse=KS(r,n),o=s=RC(n.add(u))),a=n.keyRef(r.groupby,!0))):o=RC(n.add(fF(null,[{}]))),o||(o=KS(t,n)),{key:a,pulse:o,parent:s}}(t.from,_,e),d=RC(r=e.add(dF({key:a.key||(t.key?qC(t.key):void 0),pulse:a.pulse,clean:!_}))),r=u=e.add(fF({pulse:d})),r=e.add(bF({markdef:IS(t),interactive:HS(t.interactive,e),clip:PS(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:RC(r)})),p=RC(r),(r=o=e.add(pF(vS(t.encode,t.type,y,t.style,e,{mod:!1,pulse:p})))).params.parent=e.encode(),t.transform&&t.transform.forEach((function(t){const n=WS(t,e),a=n.metadata;(a.generates||a.changes)&&i("Mark transforms should not generate new data."),a.nomod||(o.params.mod=!0),n.params.pulse=RC(r),e.add(r=n)})),t.sort&&(r=e.add(TF({sort:e.compareRef(t.sort),pulse:RC(r)}))),g=RC(r),(x||b)&&(m=RC(b=e.add(NF({layout:e.objectProperty(t.layout),legends:e.legends,mark:p,pulse:g})))),v=RC(s=e.add(cF({mark:p,pulse:m||g}))),_&&(w&&((n=e.operators).pop(),b&&n.pop()),e.pushState(g,m||v,d),x?function(t,e,n){var r,a,u,o,s=t.from.facet,c=s.name,f=KS(s,e);s.name||i("Facet must have a name: "+l(s)),s.data||i("Facet must reference a data set: "+l(s)),s.field?o=e.add(EF({field:e.fieldRef(s.field),pulse:f})):s.groupby?o=e.add(mF({key:e.keyRef(s.groupby),group:RC(e.proxy(n.parent)),pulse:f})):i("Facet must specify groupby or field: "+l(s)),a=(r=e.fork()).add(fF()),u=r.add(zF({pulse:RC(a)})),r.addData(c,new tB(r,a,a,u)),r.addSignal("parent",null),o.params.subflow={$subflow:vB(t,r).toRuntime()}}(t,e,a):w?function(t,e,n){var r=e.add(EF({pulse:n.pulse})),i=e.fork();i.add(zF()),i.addSignal("parent",null),r.params.subflow={$subflow:vB(t,i).toRuntime()}}(t,e,a):vB(t,e),e.popState(),w&&(b&&n.push(b),n.push(s))),A&&(v=function(t,e,n){var r,i=t.method,a=t.bound,u=t.separation,o={separation:$C(u)?n.signalRef(u.signal):u,method:$C(i)?n.signalRef(i.signal):i,pulse:e};t.order&&(o.sort=n.compareRef({field:t.order}));a&&(r=a.tolerance,o.boundTolerance=$C(r)?n.signalRef(r.signal):+r,o.boundScale=n.scaleRef(a.scale),o.boundOrient=a.orient);return RC(n.add(kF(o)))}(A,v,e)),c=e.add(SF({pulse:v})),f=e.add(zF({pulse:RC(c)},void 0,e.parent())),null!=t.name&&(h=t.name,e.addData(h,new tB(e,u,c,f)),t.on&&t.on.forEach((function(t){(t.insert||t.remove||t.toggle)&&i("Marks only support modify triggers."),aB(t,e,h)})))}function oB(t,e){var n,r,a,u,o,s,l,c,f,h=e.config.legend,d=t.encode||{},p=d.legend||{},g=p.name||void 0,m=p.interactive,v=p.style,y=bS(t,h),_=QF.reduce((function(e,n){return e||t[n]}),0);return _||i("Missing valid scale for legend."),o=function(t,e){var n=t.type||"symbol";t.type||1!==function(t){return QF.reduce((function(e,n){return e+(t[n]?1:0)}),0)}(t)||!t.fill&&!t.stroke||(n=Um(e)?"gradient":Pm(e)?"discrete":"symbol");return"gradient"!==n?n:Pm(e)?"discrete":"gradient"}(t,e.scaleType(_)),s={title:null!=t.title,type:o,vgrad:"symbol"!==o&&y.isVertical()},l=RC(e.add(fF(null,[s]))),p=mS(function(t,e){var n={enter:{},update:{}};return gS(n,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:e.strokeWidth,strokeDash:e.strokeDash,x:t("legendX"),y:t("legendY")}),n}(y,h),p,KF),n={enter:{x:{value:0},y:{value:0}}},c=RC(e.add(_F(a={type:o,scale:e.scaleRef(_),count:e.objectProperty(y("tickCount")),limit:e.property(y("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),"gradient"===o?(u=[ES(t,_,h,d.gradient),CS(t,h,d.labels,c)],a.count=a.count||e.signalRef(`max(2,2*floor((${HC(y.gradientLength())})/100))`)):"discrete"===o?u=[DS(t,_,h,d.gradient,c),CS(t,h,d.labels,c)]:(r=function(t,e){const n=bS(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,h),u=[SS(t,h,d,c,HC(r.columns))],a.size=function(t,e,n){var r=HC(sB("size",t,n)),i=HC(sB("strokeWidth",t,n)),a=HC(function(t,e,n){return wS("fontSize",t)||function(t,e,n){var r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,"guide-label"));return zC(`max(ceil(sqrt(${r})+${i}),${a})`,e)}(t,e,u[0].marks)),u=[FS("legend-entry",null,null,l,m,n,u,r)],s.title&&u.push(function(t,e,n,r){var i,a=bS(t,e);return gS(i={enter:{opacity:tS},update:{opacity:eS,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:tS}},{orient:a("titleOrient"),_anchor:a("titleAnchor"),anchor:{signal:qS},angle:{signal:US},align:{signal:RS},baseline:{signal:LS},text:t.title,fill:a("titleColor"),fillOpacity:a("titleOpacity"),font:a("titleFont"),fontSize:a("titleFontSize"),fontStyle:a("titleFontStyle"),fontWeight:a("titleFontWeight"),limit:a("titleLimit"),lineHeight:a("titleLineHeight")},{align:a("titleAlign"),baseline:a("titleBaseline")}),xS("text","legend-title","guide-title",null,r,i,n)}(t,h,d.title,l)),f=FS("legend",v,g,l,m,p,u),t.zindex&&(f.zindex=t.zindex),uB(f,e)}function sB(t,e,n){return e[t]?`scale("${e[t]}",datum)`:wS(t,n[0].encode)}eB.countsRef=function(t,e,n){var r,i,a,u=this.counts||(this.counts={}),o=nB(e);return null!=o&&(t=this.scope,r=u[o]),r?n&&n.field&&rB(t,r.agg.params,n):(a={groupby:t.fieldRef(e,"key"),pulse:RC(this.output)},n&&n.field&&rB(t,a,n),i=t.add(sF(a)),r=t.add(fF({pulse:RC(i)})),r={agg:i,ref:RC(r)},null!=o&&(u[o]=r)),r.ref},eB.tuplesRef=function(){return RC(this.values)},eB.extentRef=function(t,e){return iB(t,this,"extent","extent",e,!1)},eB.domainRef=function(t,e){return iB(t,this,"domain","values",e,!1)},eB.valuesRef=function(t,e,n){return iB(t,this,"vals","values",e,n||!0)},eB.lookupRef=function(t,e){return iB(t,this,"lookup","tupleindex",e,!1)},eB.indataRef=function(t,e){return iB(t,this,"indata","tupleindex",e,!0,!0)};function lB(t,e){var n,r,i=bS(t=s(t)?{text:t}:t,e.config.title),a=t.encode||{},u=a.group||{},o=u.name||void 0,l=u.interactive,c=u.style,f=[];return n=RC(e.add(fF(null,[{}]))),f.push(function(t,e,n,r){var i={value:0},a=t.text,u={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return gS(u,{text:a,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),xS("text","title-text","group-title",null,r,u,n)}(t,i,function(t){const e=t.encode;return e&&e.title||X({name:t.name,interactive:t.interactive,style:t.style},e)}(t),n)),t.subtitle&&f.push(function(t,e,n,r){var i={value:0},a=t.subtitle,u={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return gS(u,{text:a,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),xS("text","title-subtitle","group-subtitle",null,r,u,n)}(t,i,a.subtitle,n)),r=FS("title",c,o,n,l,function(t,e){var n={enter:{},update:{}};return gS(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:kS},angle:{signal:'item.orient==="left"?-90:item.orient==="right"?90:0'},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),mS(n,e,KF)}(i,u),f),t.zindex&&(r.zindex=t.zindex),uB(r,e)}function cB(t,e){var n=[];t.transform&&t.transform.forEach((function(t){n.push(WS(t,e))})),t.on&&t.on.forEach((function(n){aB(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){var r,i,a,u,o,s=[],l=null,c=!1,f=!1;t.values?jC(t.values)||jC(t.format)?(s.push(hB(e,t)),s.push(l=fB())):s.push(l=fB({$ingest:t.values,$format:t.format})):t.url?jC(t.url)||jC(t.format)?(s.push(hB(e,t)),s.push(l=fB())):s.push(l=fB({$request:t.url,$format:t.format})):t.source&&(l=r=I(t.source).map((function(t){return RC(e.getData(t).output)})),s.push(null));for(i=0,a=n.length;i<a;++i)u=n[i],o=u.metadata,l||o.source||s.push(l=fB()),s.push(u),o.generates&&(f=!0),o.modifies&&!f&&(c=!0),o.source?l=u:o.changes&&(l=null);r&&(a=r.length-1,s[0]=FF({derive:c,pulse:a?r:r[0]}),(c||a)&&s.splice(1,0,fB()));l||s.push(fB());return s.push(zF({})),s}(t,e,n))}function fB(t){var e=fF({},t);return e.metadata={source:!0},e}function hB(t,e){return xF({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}function dB(t,e){return{scale:t.scale,range:e}}function pB(t,e,n,r,i){var a,u,s,l,c,f,h,d,p,g=bS(t,e),m=t.orient,v=t.gridScale,y="left"===m||"top"===m?1:-1,_=function(t,e){if(1===e);else if(o(t)){for(var n=t=X({},t);null!=n.mult;){if(!o(n.mult))return n.mult*=e,t;n=n.mult=X({},n.mult)}n.mult=e}else t=e*(t||0);return t}(t.offset,y);return gS(a={enter:u={opacity:tS},update:l={opacity:eS},exit:s={opacity:tS}},{stroke:g("gridColor"),strokeDash:g("gridDash"),strokeDashOffset:g("gridDashOffset"),strokeOpacity:g("gridOpacity"),strokeWidth:g("gridWidth")}),c={scale:t.scale,field:ZF,band:i.band,extra:i.extra,offset:i.offset,round:g("tickRound")},"top"===m||"bottom"===m?(f="x",h="y",p="height"):(f="y",h="x",p="width"),d=h+"2",l[f]=u[f]=s[f]=c,v?(l[h]=u[h]={scale:v,range:0,mult:y,offset:_},l[d]=u[d]={scale:v,range:1,mult:y,offset:_}):(l[h]=u[h]={value:0,offset:_},l[d]=u[d]={signal:p,mult:y,offset:_}),xS("rule","axis-grid",null,ZF,r,a,n)}function gB(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function mB(t,e){var n,r,i,a,u,s,l=function(t,e){var n=e.config,r=t.orient,i="top"===r||"bottom"===r?n.axisX:n.axisY,a=n["axis"+r[0].toUpperCase()+r.slice(1)],u="band"===e.scaleType(t.scale)&&n.axisBand;return i||a||u?X({},n.axis,i,a,u):n.axis}(t,e),c=t.encode||{},f=c.axis||{},h=f.name||void 0,d=f.interactive,p=f.style,g=bS(t,l),m=function(t){let e,n,r=t("tickBand"),i=t("tickOffset");return r?r.signal?(e={signal:`(${r.signal})==='extent'?1:0.5`},n={signal:`(${r.signal})==='extent'?true:false`},o(i)||(i={signal:`(${r.signal})==='extent'?0:${i}`})):"extent"===r?(e=1,n=!0,i=0):(e=.5,n=!1):(e=t("bandPosition"),n=t("tickExtra")),{extra:n,band:e,offset:i}}(g);return n={orient:t.orient,ticks:!!g("ticks"),labels:!!g("labels"),grid:!!g("grid"),domain:!!g("domain"),title:null!=t.title,translate:g("translate")},r=RC(e.add(fF({},[n]))),f=mS({update:{offset:dS(g("offset")||0),position:dS(IC(t.position,0)),titlePadding:dS(g("titlePadding")),minExtent:dS(g("minExtent")),maxExtent:dS(g("maxExtent")),range:{signal:`abs(span(range("${t.scale}")))`}}},c.axis,KF),i=RC(e.add(lF({scale:e.scaleRef(t.scale),extra:e.property(m.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),s=[],n.grid&&s.push(pB(t,l,c.grid,i,m)),n.ticks&&(a=g("tickSize"),s.push(function(t,e,n,r,i,a){var u,o,s,l,c,f,h=bS(t,e),d=t.orient,p="left"===d||"top"===d?-1:1;return gS(u={enter:o={opacity:tS},update:l={opacity:eS},exit:s={opacity:tS}},{stroke:h("tickColor"),strokeDash:h("tickDash"),strokeDashOffset:h("tickDashOffset"),strokeOpacity:h("tickOpacity"),strokeWidth:h("tickWidth")}),(c=dS(i)).mult=p,f={scale:t.scale,field:ZF,band:a.band,extra:a.extra,offset:a.offset,round:h("tickRound")},"top"===d||"bottom"===d?(l.y=o.y=tS,l.y2=o.y2=c,l.x=o.x=s.x=f):(l.x=o.x=tS,l.x2=o.x2=c,l.y=o.y=s.y=f),xS("rule","axis-tick",null,ZF,r,u,n)}(t,l,c.ticks,i,a,m))),n.labels&&(a=n.ticks?a:0,s.push(function(t,e,n,r,i,a){var u,o,s,l,c,f,h,d,p,g,m=bS(t,e),v=t.orient,y="left"===v||"top"===v?-1:1,_="top"===v||"bottom"===v,x=t.scale,b=HC(m("labelFlush")),w=HC(m("labelFlushOffset")),A=0===b||!!b,k=m("labelAlign"),M=m("labelBaseline");return(s=dS(i)).mult=y,s.offset=dS(m("labelPadding")||0),s.offset.mult=y,l={scale:x,field:ZF,band:.5,offset:MS(a.offset,m("labelOffset"))},_?(c=k||(A?gB(x,b,'"left"','"right"','"center"'):"center"),f=M||("top"===v?"bottom":"top"),h=!k):(c=k||("right"===v?"left":"right"),f=M||(A?gB(x,b,'"top"','"bottom"','"middle"'):"middle"),h=!M),h=h&&A&&w?gB(x,b,"-("+w+")",w,0):null,gS(u={enter:o={opacity:tS,x:_?l:s,y:_?s:l},update:{opacity:eS,text:{field:"label"},x:o.x,y:o.y},exit:{opacity:tS,x:o.x,y:o.y}},{[_?"dx":"dy"]:h,align:c,baseline:f,angle:m("labelAngle"),fill:m("labelColor"),fillOpacity:m("labelOpacity"),font:m("labelFont"),fontSize:m("labelFontSize"),fontWeight:m("labelFontWeight"),fontStyle:m("labelFontStyle"),limit:m("labelLimit"),lineHeight:m("labelLineHeight")}),d=m("labelBound"),p=m("labelOverlap"),g=m("labelSeparation"),t=xS("text","axis-label","guide-label",ZF,r,u,n),(p||d)&&(t.overlap={separation:g,method:p,order:"datum.index",bound:d?{scale:x,orient:v,tolerance:d}:null}),t}(t,l,c.labels,i,a,m))),n.domain&&s.push(function(t,e,n,r){var i,a,u,o,s,l,c=bS(t,e),f=t.orient;return gS(i={enter:a={opacity:tS},update:u={opacity:eS},exit:{opacity:tS}},{stroke:c("domainColor"),strokeDash:c("domainDash"),strokeDashOffset:c("domainDashOffset"),strokeWidth:c("domainWidth"),strokeOpacity:c("domainOpacity")}),"top"===f||"bottom"===f?(o="x",l="y"):(o="y",l="x"),s=o+"2",a[l]=tS,u[o]=a[o]=dB(t,0),u[s]=a[s]=dB(t,1),xS("rule","axis-domain",null,null,r,i,n)}(t,l,c.domain,r)),n.title&&s.push(function(t,e,n,r){var i,a,u,o,s=bS(t,e),l=t.orient,c="left"===l||"top"===l?-1:1,f="top"===l||"bottom"===l;return i={enter:a={opacity:tS,anchor:dS(s("titleAnchor")),align:{signal:kS}},update:u=X({},a,{opacity:eS,text:dS(t.title)}),exit:{opacity:tS}},o={signal:`lerp(range("${t.scale}"), ${AS(0,1,.5)})`},f?(u.x=o,a.angle={value:0},a.baseline={value:"top"===l?"bottom":"top"}):(u.y=o,a.angle={value:90*c},a.baseline={value:"bottom"}),gS(i,{angle:s("titleAngle"),baseline:s("titleBaseline"),fill:s("titleColor"),fillOpacity:s("titleOpacity"),font:s("titleFont"),fontSize:s("titleFontSize"),fontStyle:s("titleFontStyle"),fontWeight:s("titleFontWeight"),limit:s("titleLimit"),lineHeight:s("titleLineHeight")},{align:s("titleAlign")}),!pS(i,"x",s("titleX"),"update")&&!f&&!_S("x",n)&&(i.enter.auto={value:!0}),!pS(i,"y",s("titleY"),"update")&&f&&!_S("y",n)&&(i.enter.auto={value:!0}),xS("text","axis-title","guide-title",null,r,i,n)}(t,l,c.title,r)),u=FS("axis",p,h,r,d,f,s),t.zindex&&(u.zindex=t.zindex),uB(u,e)}function vB(t,e,n){var r=I(t.signals),a=I(t.scales);return n||r.forEach(t=>BC(t,e)),I(t.projections).forEach(t=>function(t,e){var n=e.config.projection||{},r={};for(var i in t)"name"!==i&&(r[i]=JF(t[i],i,e));for(i in n)null==r[i]&&(r[i]=JF(n[i],i,e));e.addProjection(t.name,r)}(t,e)),a.forEach(t=>function(t,e){var n=t.type||"linear";Rm(n)||i("Unrecognized scale type: "+l(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e)),I(t.data).forEach(t=>cB(t,e)),a.forEach(t=>UF(t,e)),(n||r).forEach(t=>function(t,e){var n=e.getSignal(t.name),r=t.update;t.init&&(r?i("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=zC(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((function(t){aF(t,e,n.id)}))}(t,e)),I(t.axes).forEach(t=>mB(t,e)),I(t.marks).forEach(t=>uB(t,e)),I(t.legends).forEach(t=>oB(t,e)),t.title&&lB(t.title,e),e.parseLambdas(),e}function yB(t,e){var n,r,i,a,u,o,s=e.config;return u=RC(e.root=e.add(OC())),(o=function(t,e){const n=n=>IC(t[n],e[n]),r=[_B("background",n("background")),_B("autosize",EC(n("autosize"))),_B("padding",CC(n("padding"))),_B("width",n("width")||0),_B("height",n("height")||0)],i=r.reduce((t,e)=>(t[e.name]=e,t),{}),a={};return I(t.signals).forEach(t=>{K(i,t.name)?t=X(i[t.name],t):r.push(t),a[t.name]=t}),I(e.signals).forEach(t=>{K(a,t.name)||K(i,t.name)||r.push(t)}),r}(t,s)).forEach(t=>BC(t,e)),e.description=t.description||s.description,e.eventConfig=s.events,e.legends=e.objectProperty(s.legend&&s.legend.layout),r=e.add(fF()),i=mS({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t.encode),i=e.add(pF(vS(i,"group","frame",t.style,e,{pulse:RC(r)}))),a=e.add(NF({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:u,pulse:RC(i)})),e.operators.pop(),e.pushState(RC(i),RC(a),null),vB(t,e,o),e.operators.push(a),n=e.add(cF({mark:u,pulse:RC(a)})),n=e.add(SF({pulse:RC(n)})),n=e.add(zF({pulse:RC(n)})),e.addData("root",new tB(e,r,r,n)),e}function _B(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function xB(t){this.config=t,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function bB(t){this.config=t.config,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}var wB=xB.prototype=bB.prototype;function AB(t){return(u(t)?kB:MB)(t)}function kB(t){for(var e,n="[",r=0,i=t.length;r<i;++r)n+=(r>0?",":"")+(o(e=t[r])?e.signal||AB(e):l(e));return n+"]"}function MB(t){var e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+l(e)+":"+(o(n)?n.signal||AB(n):l(n));return r+"}"}wB.fork=function(){return new bB(this)},wB.isSubscope=function(){return this._subid>0},wB.toRuntime=function(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},wB.id=function(){return(this._subid?this._subid+":":0)+this._id++},wB.add=function(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((function(e){e.$ref=t.id})),t.refs=null),t},wB.proxy=function(t){var e=t instanceof TC?RC(t):t;return this.add(CF({value:e}))},wB.addStream=function(t){return this.streams.push(t),t.id=this.id(),t},wB.addUpdate=function(t){return this.updates.push(t),t},wB.finish=function(){var t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){var r;t&&((r=t.data||(t.data={}))[e]||(r[e]=[])).push(n)}for(t in this.data)for(var r in n((e=this.data[t]).input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values"),e.index)n(e.index[r],t,"index:"+r);return this},wB.pushState=function(t,e,n){this._encode.push(RC(this.add(zF({pulse:t})))),this._parent.push(e),this._lookup.push(n?RC(this.proxy(n)):null),this._markpath.push(-1)},wB.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},wB.parent=function(){return k(this._parent)},wB.encode=function(){return k(this._encode)},wB.lookup=function(){return k(this._lookup)},wB.markpath=function(){var t=this._markpath;return++t[t.length-1]},wB.fieldRef=function(t,e){if(s(t))return qC(t,e);t.signal||i("Unsupported field reference: "+l(t));var n,r=t.signal,a=this.field[r];return a||(n={name:this.signalRef(r)},e&&(n.as=e),this.field[r]=a=RC(this.add(vF(n)))),a},wB.compareRef=function(t){function e(t){return $C(t)?(r=!0,n.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(r=!0,n.exprRef(t.expr)):t}var n=this,r=!1,i=I(t.field).map(e),a=I(t.order).map(e);return r?RC(this.add(hF({fields:i,orders:a}))):LC(i,a)},wB.keyRef=function(t,e){var n=this.signals,r=!1;return t=I(t).map((function(t){return $C(t)?(r=!0,RC(n[t.signal])):t})),r?RC(this.add(yF({fields:t,flat:e}))):function(t,e){var n={$key:t};return e&&(n.$flat=!0),n}(t,e)},wB.sortRef=function(t){if(!t)return t;var e=PC(t.op,t.field),n=t.order||"ascending";return n.signal?RC(this.add(hF({fields:e,orders:this.signalRef(n.signal)}))):LC(e,n)},wB.event=function(t,e){var n=t+":"+e;if(!this.events[n]){var r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},wB.hasOwnSignal=function(t){return K(this.signals,t)},wB.addSignal=function(t,e){this.hasOwnSignal(t)&&i("Duplicate signal name: "+l(t));var n=e instanceof TC?e:this.add(OC(e));return this.signals[t]=n},wB.getSignal=function(t){return this.signals[t]||i("Unrecognized signal name: "+l(t)),this.signals[t]},wB.signalRef=function(t){return this.signals[t]?RC(this.signals[t]):(K(this.lambdas,t)||(this.lambdas[t]=this.add(OC(null))),RC(this.lambdas[t]))},wB.parseLambdas=function(){for(var t=Object.keys(this.lambdas),e=0,n=t.length;e<n;++e){var r=t[e],i=zC(r,this),a=this.lambdas[r];a.params=i.$params,a.update=i.$expr}},wB.property=function(t){return t&&t.signal?this.signalRef(t.signal):t},wB.objectProperty=function(t){return t&&o(t)?this.signalRef(t.signal||AB(t)):t},wB.exprRef=function(t,e){var n={expr:zC(t,this)};return e&&(n.expr.$name=e),RC(this.add(gF(n)))},wB.addBinding=function(t,e){this.bindings||i("Nested signals do not support binding: "+l(t)),this.bindings.push(X({signal:t},e))},wB.addScaleProj=function(t,e){K(this.scales,t)&&i("Duplicate scale or projection name: "+l(t)),this.scales[t]=this.add(e)},wB.addScale=function(t,e){this.addScaleProj(t,BF(e))},wB.addProjection=function(t,e){this.addScaleProj(t,DF(e))},wB.getScale=function(t){return this.scales[t]||i("Unrecognized scale name: "+l(t)),this.scales[t]},wB.projectionRef=wB.scaleRef=function(t){return RC(this.getScale(t))},wB.projectionType=wB.scaleType=function(t){return this.getScale(t).params.type},wB.addData=function(t,e){return K(this.data,t)&&i("Duplicate data set name: "+l(t)),this.data[t]=e},wB.getData=function(t){return this.data[t]||i("Undefined data set name: "+l(t)),this.data[t]},wB.addDataPipeline=function(t,e){return K(this.data,t)&&i("Duplicate data set name: "+l(t)),this.addData(t,tB.fromEntries(this,e))};X(Yr,zo,Sd,Uv,Sw,DA,Hk,Xk,xM,TM,IM),t.Bounds=Uo,t.CanvasHandler=th,t.CanvasRenderer=ah,t.Dataflow=$r,t.Debug=4,t.Error=1,t.EventStream=Yt,t.Gradient=Ho,t.GroupItem=Yo,t.Handler=Xf,t.Info=3,t.Item=Wo,t.Marks=Tf,t.MultiPulse=Or,t.None=0,t.Operator=jt,t.Parameters=Ut,t.Pulse=Sr,t.RenderType=Lh,t.Renderer=Qf,t.ResourceLoader=Xo,t.SVGHandler=ch,t.SVGRenderer=_h,t.SVGStringRenderer=zh,t.Scenegraph=Pf,t.Transform=Hr,t.View=xC,t.Warn=2,t.accessor=e,t.accessorFields=r,t.accessorName=n,t.array=I,t.bandwidthNRD=Mi,t.bin=Ei,t.bootstrapCI=Di,t.boundClip=Vh,t.boundContext=nc,t.boundItem=Nf,t.boundMark=Rf,t.boundStroke=Zl,t.changeset=Rt,t.clampRange=H,t.closeTag=ph,t.compare=Y,t.constant=V,t.cumulativeLogNormal=Pi,t.cumulativeNormal=Ni,t.cumulativeUniform=Yi,t.debounce=G,t.definition=Vr,t.densityLogNormal=Li,t.densityNormal=Ti,t.densityUniform=Wi,t.domChild=Wf,t.domClear=Yf,t.domCreate=If,t.domFind=Hf,t.dotbin=Ci,t.error=i,t.expressionFunction=XD,t.extend=X,t.extent=J,t.extentIndex=Z,t.falsy=v,t.fastmap=et,t.field=c,t.flush=nt,t.font=Df,t.fontFamily=Ef,t.fontSize=bf,t.format=Se,t.formatLocale=em,t.formats=Be,t.hasOwnProperty=K,t.id=h,t.identity=d,t.inferType=oe,t.inferTypes=se,t.ingest=St,t.inherits=rt,t.inrange=it,t.interpolate=Xm,t.interpolateColors=Ym,t.interpolateRange=Wm,t.intersect=jh,t.intersectBoxLine=vc,t.intersectPath=dc,t.intersectPoint=pc,t.intersectRule=mc,t.isArray=u,t.isBoolean=at,t.isDate=ut,t.isFunction=W,t.isNumber=ot,t.isObject=o,t.isRegExp=st,t.isString=s,t.isTuple=Dt,t.key=lt,t.lerp=ct,t.lineHeight=wf,t.loader=kr,t.logger=_,t.lruCache=ft,t.merge=ht,t.mergeConfig=b,t.multiLineOffset=kf,t.one=g,t.openTag=dh,t.pad=pt,t.panLinear=z,t.panLog=T,t.panPow=N,t.panSymlog=O,t.parse=function(t,e){return o(t)||i("Input Vega specification must be an object."),yB(t,new xB(e=b({description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:"#4c78a8"},area:{fill:"#4c78a8"},image:null,line:{stroke:"#4c78a8",strokeWidth:2},path:{stroke:"#4c78a8"},rect:{fill:"#4c78a8"},rule:{stroke:"#000"},shape:{stroke:"#4c78a8"},symbol:{fill:"#4c78a8",size:64},text:{fill:"#000",font:"sans-serif",fontSize:11},style:{"guide-label":{fill:"#000",font:"sans-serif",fontSize:10},"guide-title":{fill:"#000",font:"sans-serif",fontSize:11,fontWeight:"bold"},"group-title":{fill:"#000",font:"sans-serif",fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:"#000",font:"sans-serif",fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:"#ddd"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:"#888",grid:!1,gridWidth:1,gridColor:"#ddd",labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:"#888",tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:"#ddd",gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:"#888",titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}},e,t.config))).toRuntime()},t.pathCurves=cl,t.pathEqual=Xh,t.pathParse=dl,t.pathRectangle=Rl,t.pathRender=kl,t.pathSymbols=Dl,t.pathTrail=ql,t.peek=k,t.point=Gf,t.projection=yw,t.quantileLogNormal=$i,t.quantileNormal=Oi,t.quantileUniform=Vi,t.quantiles=Ai,t.quantizeInterpolator=Vm,t.quarter=$,t.quartiles=ki,t.randomInteger=function(e,n){null==n&&(n=e,e=0);var r,i,a,u={};return u.min=function(t){return arguments.length?(a=i-(r=t||0),u):r},u.max=function(t){return arguments.length?(a=(i=t||0)-r,u):i},u.sample=function(){return r+Math.floor(a*t.random())},u.pdf=function(t){return t===Math.floor(t)&&t>=r&&t<i?1/a:0},u.cdf=function(t){var e=Math.floor(t);return e<r?0:e>=i?1:(e-r+1)/a},u.icdf=function(t){return t>=0&&t<=1?r-1+Math.floor(t*a):NaN},u.min(e).max(n)},t.randomKDE=qi,t.randomLCG=function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},t.randomLogNormal=ji,t.randomMixture=Ii,t.randomNormal=Ri,t.randomUniform=Gi,t.read=Ar,t.regressionExp=ea,t.regressionLinear=Ki,t.regressionLoess=ua,t.regressionLog=ta,t.regressionPoly=ia,t.regressionPow=na,t.regressionQuad=ra,t.renderModule=$h,t.repeat=dt,t.resetSVGClipId=function(){Hc=1},t.responseType=ze,t.runtime=oC,t.runtimeContext=lC,t.sampleCurve=ca,t.sampleLogNormal=Ui,t.sampleNormal=zi,t.sampleUniform=Hi,t.scale=Om,t.sceneEqual=Gh,t.sceneFromJSON=Lf,t.scenePickVisit=Cc,t.sceneToJSON=Uf,t.sceneVisit=Dc,t.sceneZOrder=Ec,t.scheme=Km,t.setRandom=function(e){t.random=e},t.span=gt,t.splitAccessPath=a,t.stringValue=l,t.textMetrics=gf,t.timeBin=vo,t.timeFloor=Pu,t.timeFormat=ao,t.timeFormatLocale=wr,t.timeInterval=Xu,t.timeOffset=Qu,t.timeSequence=eo,t.timeUnitSpecifier=io,t.timeUnits=Su,t.toBoolean=mt,t.toDate=yt,t.toNumber=M,t.toSet=xt,t.toString=_t,t.transform=Gr,t.transforms=Yr,t.truncate=bt,t.truthy=m,t.tupleid=Ct,t.typeParsers=ie,t.utcFloor=Yu,t.utcFormat=uo,t.utcInterval=Ju,t.utcOffset=Ku,t.utcSequence=no,t.utcquarter=j,t.version="5.10.0",t.visitArray=wt,t.writeConfig=w,t.zero=p,t.zoomLinear=q,t.zoomLog=U,t.zoomPow=L,t.zoomSymlog=P,Object.defineProperty(t,"__esModule",{value:!0})}));
diff --git a/main/Main.hs b/main/Main.hs
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -4,6 +4,7 @@
 
 import Control.Monad
 import Data.Aeson (encodeFile)
+import GHC.IO.Encoding (setLocaleEncoding)
 import System.FilePath
 import System.Exit
 import System.IO
@@ -15,6 +16,8 @@
 
 main :: IO ()
 main = do
+  -- This fixes a problem for Windows users: https://serokell.io/blog/haskell-with-utf8
+  setLocaleEncoding utf8
   a <- args
   when (null (files a)) exitSuccess
   argsToOutput a
@@ -32,17 +35,17 @@
 
 doOneJson :: Args -> FilePath -> FilePath -> IO ()
 doOneJson a fin fout = do
-  (_, val, _) <- generateJson fin a
+  (_, val, _, _) <- generateJson fin a
   encodeFile fout val
 
 doOneHtml :: Args -> FilePath -> FilePath -> IO ()
 doOneHtml a fin fout = do
-  (header, data_json, descs) <- generateJsonValidate checkTraces fin a
-  let html = templateString header data_json descs a
+  (header, data_json, descs, closure_descs) <- generateJsonValidate checkTraces fin a
+  let html = templateString header data_json descs closure_descs a
   writeFile fout html
   where
     checkTraces :: ProfData -> IO ()
-    checkTraces (ProfData _ _ _ _ ts) =
+    checkTraces (ProfData _ _ _ _ ts _) =
       if length ts > 1000
         then hPutStrLn stderr
               "More than 1000 traces, consider reducing using -i or -x"
diff --git a/src/Eventlog/Args.hs b/src/Eventlog/Args.hs
--- a/src/Eventlog/Args.hs
+++ b/src/Eventlog/Args.hs
@@ -15,13 +15,14 @@
 import Data.Semigroup ((<>))
 import Control.Applicative (optional)
 
-data Sort = Size | StdDev | Name
+data Sort = Size | StdDev | Name | Gradient
 
 data Args = Args
   {
     sorting      :: Sort
   , reversing    :: Bool
   , nBands       :: Int
+  , detailedLimit :: Maybe Int
   , heapProfile  :: Bool
   , noIncludejs    :: Bool
   , json         :: Bool
@@ -40,7 +41,7 @@
 argParser = Args
       <$> option parseSort
           ( long "sort"
-         <> help "How to sort the bands.  One of: size (default), stddev, name."
+         <> help "How to sort the bands.  One of: size (default), stddev, name, gradient."
          <> value Size
          <> metavar "FIELD" )
       <*> switch
@@ -52,6 +53,10 @@
          <> value 15
          <> showDefault
          <> metavar "COUNT" )
+      <*> (optional $ option auto
+          (long "limit-detailed"
+          <> help "The maximum number of bands to show in the detailed view."
+          <> metavar "N"))
       <*> switch
           ( long "heap-profile"
           <> short 'p'
@@ -107,6 +112,7 @@
   "size" -> Right Size
   "stddev" -> Right StdDev
   "name" -> Right Name
+  "gradient" -> Right Gradient
   _ -> Left "expected one of: size, stddev, name"
 
 args :: IO Args
diff --git a/src/Eventlog/AssetVersions.hs b/src/Eventlog/AssetVersions.hs
new file mode 100644
--- /dev/null
+++ b/src/Eventlog/AssetVersions.hs
@@ -0,0 +1,26 @@
+-- Generated by ./update-assets.sh
+module Eventlog.AssetVersions where
+vegaVersion,vegaURL :: String
+vegaVersion = "5.17.0"
+vegaURL = "https://cdn.jsdelivr.net/npm/vega@5.17.0"
+vegaLiteVersion,vegaLiteURL :: String
+vegaLiteVersion = "4.17.0"
+vegaLiteURL = "https://cdn.jsdelivr.net/npm/vega-lite@4.17.0"
+vegaEmbedVersion,vegaEmbedURL :: String
+vegaEmbedVersion = "6.14.0"
+vegaEmbedURL = "https://cdn.jsdelivr.net/npm/vega-embed@6.14.0"
+jqueryVersion,jqueryURL :: String
+jqueryVersion = "3.3.1"
+jqueryURL = "https://code.jquery.com/jquery-3.3.1.min.js"
+bootstrapVersion,bootstrapURL :: String
+bootstrapVersion = "4.3.1"
+bootstrapURL = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
+sparklinesVersion,sparklinesURL :: String
+sparklinesVersion = "2.1.2"
+sparklinesURL = "https://cdnjs.cloudflare.com/ajax/libs/jquery-sparklines/2.1.2/jquery.sparkline.min.js"
+bootstrapCSSVersion,bootstrapCSSURL :: String
+bootstrapCSSVersion = "4.3.1"
+bootstrapCSSURL = "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
+fancyTableVersion,fancyTableURL :: String
+fancyTableVersion = ""
+fancyTableURL = "https://cdn.jsdelivr.net/npm/jquery.fancytable/dist/fancyTable.min.js"
diff --git a/src/Eventlog/Data.hs b/src/Eventlog/Data.hs
--- a/src/Eventlog/Data.hs
+++ b/src/Eventlog/Data.hs
@@ -9,31 +9,44 @@
 import Eventlog.Bands (bands)
 import qualified Eventlog.Events as E
 import qualified Eventlog.HeapProf as H
-import Eventlog.Prune (prune)
+import Eventlog.Prune
 import Eventlog.Vega
 import Eventlog.Types (Header(..), ProfData(..), HeapProfBreakdown(..))
 import Data.List
 import Data.Ord
 import Eventlog.Trie
+import Eventlog.Detailed
+import Text.Blaze.Html
 
-generateJsonValidate :: (ProfData -> IO ()) -> FilePath -> Args -> IO (Header, Value, Maybe Value)
+generateJsonValidate :: (ProfData -> IO ()) -> FilePath -> Args -> IO (Header, Value, Maybe Value, Maybe Html)
 generateJsonValidate validate file a = do
   let chunk = if heapProfile a then H.chunk else E.chunk a
-  dat@(ProfData h binfo ccMap fs traces) <- chunk file
+  dat@(ProfData h binfo ccMap fs traces _ipes) <- chunk file
   validate dat
-  let keeps = prune a binfo
+  let keeps = pruneBands a binfo
+      bs = bands h (Map.map fst keeps) fs
       combinedJson = object [
-          "samples" .= bandsToVega keeps (bands h (Map.map fst keeps) fs)
+          "samples" .= bandsToVega keeps bs
         , "traces"  .= tracesToVega traces
         ]
       mdescs =
         sortBy (flip (comparing (fst . snd))) $ Map.toList keeps
       -- Only supply the cost centre view in cost centre profiling mode.
-      descs = case hHeapProfileType h of
+      cc_descs = case hHeapProfileType h of
                 Just HeapProfBreakdownCostCentre -> Just (outputTree ccMap mdescs)
                 _ -> Nothing
-  return (h, combinedJson, descs)
 
-generateJson :: FilePath -> Args -> IO (Header, Value, Maybe Value)
+  let use_ipes = case hHeapProfileType h of
+                   --Just HeapProfBreakdownInfoTable -> Just ipes
+                   _ -> Nothing
+      desc_buckets = pruneDetailed a binfo
+      bs' = bands h (Map.map fst desc_buckets) fs
+      closure_table =
+        case detailedLimit a of
+          Just 0 ->  Nothing
+          _ -> Just (renderClosureInfo bs' use_ipes desc_buckets)
+  return (h, combinedJson, cc_descs, closure_table)
+
+generateJson :: FilePath -> Args -> IO (Header, Value, Maybe Value, Maybe Html)
 generateJson = generateJsonValidate (const (return ()))
 
diff --git a/src/Eventlog/Detailed.hs b/src/Eventlog/Detailed.hs
new file mode 100644
--- /dev/null
+++ b/src/Eventlog/Detailed.hs
@@ -0,0 +1,141 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeApplications #-}
+module Eventlog.Detailed where
+
+import qualified Data.Map as Map
+import Eventlog.Types
+import qualified Data.Text as T
+
+import Text.Blaze.Html
+import qualified Text.Blaze.Html5            as H
+import qualified Text.Blaze.Html5.Attributes as A
+import Data.Array.Unboxed (UArray, bounds)
+import qualified Data.Array.Unboxed as A
+import Data.Fixed
+import Control.Monad
+import Data.Maybe
+
+data InfoTableLocStatus = None -- None of the entries have InfoTableLoc
+                        | Missing -- This one is just missing
+                        | Here InfoTableLoc -- Here is is
+
+mkMissing :: Maybe InfoTableLoc -> InfoTableLocStatus
+mkMissing = maybe Missing Here
+
+
+mkClosureInfo :: Map.Map Bucket a
+              -> Map.Map InfoTablePtr InfoTableLoc
+              -> Map.Map Bucket (InfoTableLocStatus, a)
+mkClosureInfo b ipes =
+  Map.mapWithKey (\k v -> (mkMissing $ Map.lookup (toItblPointer k) ipes, v)) b
+
+
+renderClosureInfo :: (UArray Int Double, UArray (Int, Int) Double)
+                  -- Raw Data
+                  -> Maybe (Map.Map InfoTablePtr InfoTableLoc)
+                  -- Do we have IPE information?
+                  -> Map.Map Bucket (Int, BucketInfo)
+                  -- Buckets
+                  -> Html
+renderClosureInfo (ts, bs) mipes raw_bs = do
+  let cs = case mipes of
+             Just ipes -> mkClosureInfo raw_bs ipes
+             Nothing   -> Map.map (\v -> (None, v)) raw_bs
+
+  H.table ! A.id "closure_table" ! A.class_ "table table-striped closureTable" $ do
+    H.thead $ H.tr $ do
+      H.th "Profile"
+      numTh "n"
+      H.th "Label"
+      when (isJust mipes) $ do
+        H.th "Description"
+        H.th "CTy"
+        H.th "Type"
+        H.th "Module"
+        H.th "Loc"
+      numTh ("Integrated Size" <> H.br <> "(MiB s)")
+      numTh "Stddev (MiB) "
+      numTh "Intercept"
+      numTh "Slope"
+      numTh "Fit (R²)"
+    Map.foldrWithKey (\k a res -> renderEntry k a >> res) (mempty :: Html) cs
+  H.script $ preEscapedToHtml (initTable (isJust mipes))
+  where
+    numTh lbl = H.th ! H.dataAttribute "sortas" "numeric" $ lbl
+    trunc :: Double -> Fixed E2
+    trunc = realToFrac
+    render = showFixed True
+
+    renderInfoTableLoc :: InfoTableLoc -> Html
+    renderInfoTableLoc (InfoTableLoc table_name cd tydesc _lbl m sloc) = do
+      H.td (toHtml table_name)
+      H.td (toHtml (show @ClosureType cd))
+      H.td (toHtml tydesc)
+      H.td (toHtml m)
+      H.td (toHtml sloc)
+
+
+    renderInfoTableLocStatus :: InfoTableLocStatus -> Html
+    renderInfoTableLocStatus itls =
+      case itls of
+        Here itl -> renderInfoTableLoc itl
+        Missing  -> emptyItlColumns
+        None     -> mempty
+
+    emptyItlColumns = do
+      H.td ""
+      H.td ""
+      H.td ""
+      H.td ""
+      H.td ""
+      H.td ""
+
+    renderEntry (Bucket k) (mitl, (n, BucketInfo _ _ tot std mg)) = do
+          let (a, b, r2) =
+                case mg of
+                  Nothing -> ("", "", "")
+                  Just (ad, bd, r2d) -> (render $ trunc ad
+                                       , render $ trunc bd
+                                       , render $ trunc r2d)
+          H.tr $ do
+            H.td (renderSpark (getBandValues n (ts, bs)))
+            H.td (toHtml n)
+            H.td (toHtml k)
+            renderInfoTableLocStatus mitl
+            H.td (toHtml (render $ trunc (tot / 1e6)))
+            H.td (toHtml (render $ trunc (std / 1e6)))
+            H.td (toHtml a)
+            H.td (toHtml b)
+            H.td (toHtml r2)
+
+renderSpark :: [(Double, Double)] -> Html
+renderSpark vs = H.span ! A.class_ "linechart" $ toHtml (T.intercalate "," (map renderLine vs))
+  where
+    rdouble = T.pack . showFixed True . realToFrac @Double @(Fixed E2)
+    renderLine (x,y) = rdouble x <> ":" <> rdouble y
+
+initTable :: Bool -> T.Text
+initTable b = "$(document).ready(function() {\
+        \$(\".closureTable\").fancyTable({\
+        \    sortColumn:" <> if b then "8" else "3" <> ",\
+        \    pagination: true,\
+        \    perPage:10,\
+        \    globalSearch:false,\
+        \    globalSearchExcludes: [7,8,9,10,11,12],\
+        \    sortOrder: 'descending',\
+        \    onUpdate: function(){$.sparkline_display_visible()}\
+        \});\
+        \$.fn.sparkline.defaults.common.chartRangeMin = 0;\
+        \$.fn.sparkline.defaults.common.width = 200;\
+        \$('.linechart').sparkline()\
+\});"
+
+getBandValues :: Int
+            -> (UArray Int Double, UArray (Int, Int) Double)
+            -> [(Double, Double)]
+getBandValues k (ts, vs) =
+  let (t1, tn) = bounds ts
+      go i = flip map [t1 .. tn] $ \t -> ((ts A.! t), (vs A.! (i, t)))
+
+  in go k
+
diff --git a/src/Eventlog/Events.hs b/src/Eventlog/Events.hs
--- a/src/Eventlog/Events.hs
+++ b/src/Eventlog/Events.hs
@@ -2,11 +2,14 @@
 {-# LANGUAGE RecordWildCards #-}
 {-# LANGUAGE NamedFieldPuns #-}
 {-# LANGUAGE StrictData #-}
+{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE TypeApplications #-}
 module Eventlog.Events(chunk) where
 
 import GHC.RTS.Events hiding (Header, header)
 import Prelude hiding (init, lookup)
 import qualified Data.Text as T
+import qualified Data.Text.IO as T
 import Data.Text (Text)
 
 import Eventlog.Types
@@ -28,6 +31,7 @@
 import qualified Data.Trie.Map as Trie
 import Data.Map.Merge.Lazy
 import Data.Functor.Identity
+import GHC.Exts.Heap.ClosureTypes
 
 type PartialHeader = Int -> Header
 
@@ -38,44 +42,44 @@
 chunk :: Args -> FilePath -> IO ProfData
 chunk a f = do
   (EventLog _ e) <- either error id <$> readEventLogFromFile f
-  (ph, bucket_map, ccMap, frames, traces) <- eventsToHP a e
+  (ph, bucket_map, ccMap, frames, traces, ipes) <- eventsToHP a e
   let (counts, totals) = total frames
       -- If both keys are present, combine
-      combine = zipWithAMatched (\_ (t, mt) (tot, sd) -> Identity $ BucketInfo t mt tot sd)
+      combine = zipWithAMatched (\_ (t, mt) (tot, sd, g) -> Identity $ BucketInfo t mt tot sd g)
       -- If total is missing, something bad has happened
       combineMissingTotal :: Bucket -> (Text, Maybe [Word32]) -> Identity BucketInfo
       combineMissingTotal k = error ("Missing total for: " ++ show k)
 
       -- This case happens when we are not in CC mode
-      combineMissingDesc :: Bucket -> (Double, Double) -> Identity BucketInfo
-      combineMissingDesc (Bucket t) (tot, sd) = Identity (BucketInfo t Nothing tot sd)
+      combineMissingDesc :: Bucket -> (Double, Double, Maybe (Double, Double, Double)) -> Identity BucketInfo
+      combineMissingDesc (Bucket t) (tot, sd, g) = Identity (BucketInfo t Nothing tot sd g)
 
       binfo = merge (traverseMissing combineMissingTotal) (traverseMissing combineMissingDesc) combine bucket_map totals
-  return $ (ProfData (ph counts) binfo ccMap frames traces)
+  return $ (ProfData (ph counts) binfo ccMap frames traces ipes)
 
-checkGHCVersion :: EL -> Maybe String
+checkGHCVersion :: EL -> Maybe Text
 checkGHCVersion EL { ident = Just (version,_)}
   | version <= makeVersion [8,4,4]  =
       Just $ "Warning: The eventlog has been generated with ghc-"
-           ++ showVersion version
-           ++ ", which does not support profiling events in the eventlog."
+           <> T.pack (showVersion version)
+           <> ", which does not support profiling events in the eventlog."
 checkGHCVersion EL { pargs = Just args, ident = Just (version,_)}
   | version > makeVersion [8,4,4] &&
     version <= makeVersion [8,9,0] &&
     ("-hr" `elem` args || "-hb" `elem` args) =
      Just $ "Warning: The eventlog has been generated with ghc-"
-            ++ showVersion version
-            ++ ", which does not support biographical or retainer profiling."
+            <> T.pack (showVersion version)
+            <> ", which does not support biographical or retainer profiling."
 checkGHCVersion _ = Nothing
 
-eventsToHP :: Args -> Data -> IO (PartialHeader, BucketMap, Map.Map Word32 CostCentre, [Frame], [Trace])
+eventsToHP :: Args -> Data -> IO (PartialHeader, BucketMap, Map.Map Word32 CostCentre, [Frame], [Trace], Map.Map InfoTablePtr InfoTableLoc)
 eventsToHP a (Data es) = do
   let
       el@EL{..} = foldEvents a es
       fir = Frame (fromNano start) []
       las = Frame (fromNano end) []
-  mapM_ (hPutStrLn stderr) (checkGHCVersion el)
-  return $ (elHeader el, elBucketMap el, ccMap, fir : reverse (las: normalise frames) , traces)
+  mapM_ (T.hPutStrLn stderr) (checkGHCVersion el)
+  return $ (elHeader el, elBucketMap el, ccMap, fir : reverse (las: normalise frames) , traces, Map.fromList ipes)
 
 normalise :: [FrameEL] -> [Frame]
 normalise = map (\(FrameEL t ss) -> Frame (fromNano t) ss)
@@ -83,8 +87,9 @@
 type BucketMap = Map.Map Bucket (Text, Maybe [Word32])
 
 data EL = EL
-  { pargs :: !(Maybe [String])
-  , ident :: Maybe (Version, String)
+  { pargs :: !(Maybe [Text])
+  , programInvocation :: !(Maybe FilePath)
+  , ident :: Maybe (Version, Text)
   , samplingRate :: !(Maybe Word64)
   , heapProfileType :: !(Maybe HeapProfBreakdown)
   , ccMap :: !(Map.Map Word32 CostCentre)
@@ -96,9 +101,11 @@
   , samples :: !(Maybe FrameEL)
   , frames :: ![FrameEL]
   , traces :: ![Trace]
+  , ipes :: [(InfoTablePtr, InfoTableLoc)]
   , start :: !Word64
   , end :: !Word64 } deriving Show
 
+
 data FrameEL = FrameEL Word64 [Sample] deriving Show
 
 data CCSMap = CCSMap (Trie.TMap Word32 CCStack) Int deriving Show
@@ -137,11 +144,13 @@
   , samples = Nothing
   , frames = []
   , traces = []
+  , ipes = []
   , start = 0
   , end = 0
   , ccMap = Map.empty
   , ccsMap =  CCSMap Trie.empty 0
   , bucketMap = Map.empty
+  , programInvocation = Nothing
   }
 
 foldEvents :: Args -> [Event] -> EL
@@ -157,28 +166,39 @@
       -- Messages and UserMessages correspond to high-frequency "traceEvent" or "traceEventIO" events from Debug.Trace and
       -- are only included if "--include-trace-events" has been specified.
       -- For low-frequency events "traceMarker" or "traceMarkerIO" should be used, which generate "UserMarker" events.
-      Message s -> if traceEvents a then addTrace a (Trace (fromNano t) (T.pack s)) else id
-      UserMessage s -> if traceEvents a then addTrace a (Trace (fromNano t) (T.pack s)) else id
-      UserMarker s -> addTrace a (Trace (fromNano t) (T.pack s))
+      Message s -> if traceEvents a then addTrace a (Trace (fromNano t) s) else id
+      UserMessage s -> if traceEvents a then addTrace a (Trace (fromNano t) s) else id
+      UserMarker s -> addTrace a (Trace (fromNano t) s)
       -- Information about the program
       RtsIdentifier _ ident -> addIdent ident
       ProgramArgs _ as -> addArgs as
+      ProgramInvocation inv -> addInvocation inv
       WallClockTime _ s _ -> addClocktime s
       -- Profiling Events
       HeapProfBegin { heapProfSamplingPeriod, heapProfBreakdown } -> addHeapProfBegin heapProfSamplingPeriod heapProfBreakdown
       HeapProfCostCentre cid l m loc _  -> addCostCentre cid (CC cid l m loc)
-      HeapProfSampleBegin {} -> addFrame t
+      HeapProfSampleBegin {}
+        | t >= 1 -> addFrame t
       HeapBioProfSampleBegin { heapProfSampleTime = t' } -> addFrame t'
       HeapProfSampleCostCentre _hid r d s -> addCCSample r d s
       HeapProfSampleString _hid res k -> addSample (Sample (Bucket k) (fromIntegral res))
+      --IPE ptr name desc ty lbl smod sloc -> addInfoTableLoc (InfoTablePtr ptr,
+      --                                        InfoTableLoc name (parseClosureType desc) ty lbl smod sloc)
       _ -> id
 
+_parseClosureType :: Text -> ClosureType
+-- IPEs do not distinguish different CONSTR types, yet
+_parseClosureType "0" = CONSTR
+_parseClosureType ct = toEnum . read @Int . T.unpack $ ct
 
+_addInfoTableLoc :: (InfoTablePtr, InfoTableLoc) -> EL -> EL
+_addInfoTableLoc itl el = el { ipes = itl : ipes el }
+
 addHeapProfBegin :: Word64 -> HeapProfBreakdown -> EL -> EL
 addHeapProfBegin sr hptype el = el { samplingRate = Just sr, heapProfileType = Just hptype }
 
-addIdent :: String -> EL -> EL
-addIdent s el = el { ident = parseIdent s }
+addIdent :: Text -> EL -> EL
+addIdent s el = el { ident = fmap T.pack <$> (parseIdent (T.unpack s)) }
 
 parseIdent :: String -> Maybe (Version, String)
 parseIdent s = listToMaybe $ flip readP_to_S s $ do
@@ -205,10 +225,13 @@
 addClocktime :: Word64 -> EL -> EL
 addClocktime s el = el { clocktimeSec = s }
 
-addArgs :: [String] -> EL -> EL
+addArgs :: [Text] -> EL -> EL
 addArgs as el = el { pargs = Just as }
 
+addInvocation :: String -> EL -> EL
+addInvocation inv el = el { programInvocation = Just inv }
 
+
 -- | Decide whether to include a trace based on the "includes" and
 -- "excludes" options.
 --
@@ -264,10 +287,10 @@
 
 elHeader :: EL -> PartialHeader
 elHeader EL{..} =
-  let title = maybe "" (T.unwords . map T.pack) pargs
+  let title = maybe "" T.unwords pargs
       date = formatDate clocktimeSec
       ppSamplingRate = T.pack . maybe "<Not available>" (show . fromNano) $ samplingRate
-  in Header title date heapProfileType ppSamplingRate "" ""
+  in \v -> Header title date heapProfileType ppSamplingRate "" "" v (T.unpack . head <$> pargs)
 
 
 elBucketMap :: EL -> BucketMap
diff --git a/src/Eventlog/HeapProf.hs b/src/Eventlog/HeapProf.hs
--- a/src/Eventlog/HeapProf.hs
+++ b/src/Eventlog/HeapProf.hs
@@ -15,9 +15,9 @@
   (ph, fs) <- chunkT <$> readFile f
   let (counts, totals) = total fs
       -- Heap profiles don't contain any other information than the simple bucket name
-      binfo = Map.mapWithKey (\(Bucket k) (t,s) -> BucketInfo k Nothing t s ) totals
+      binfo = Map.mapWithKey (\(Bucket k) (t,s,g) -> BucketInfo k Nothing t s g) totals
   -- Heap profiles do not support traces
-  return (ProfData (ph counts) binfo mempty fs [])
+  return (ProfData (ph counts) binfo mempty fs [] mempty)
 
 chunkT :: Text -> (Int -> Header, [Frame])
 chunkT s =
@@ -26,8 +26,7 @@
       [job, date, smpU, valU] =
         zipWith header [sJOB, sDATE, sSAMPLE_UNIT, sVALUE_UNIT] hs
       fs = chunkSamples ss
-  in  (
-        Header job date Nothing (pack "") smpU valU
+  in  (\v -> Header job date Nothing (pack "") smpU valU v Nothing
       ,  fs
       )
 
diff --git a/src/Eventlog/HtmlTemplate.hs b/src/Eventlog/HtmlTemplate.hs
--- a/src/Eventlog/HtmlTemplate.hs
+++ b/src/Eventlog/HtmlTemplate.hs
@@ -17,7 +17,7 @@
 import Eventlog.Args
 import Eventlog.Types (Header(..), HeapProfBreakdown(..))
 import Eventlog.VegaTemplate
-import Eventlog.VegaVersions
+import Eventlog.AssetVersions
 import Paths_eventlog2html
 import Data.Version
 import Control.Monad
@@ -73,6 +73,11 @@
   where
     vidt = T.pack $ show vid
 
+jsScript :: String -> Html
+jsScript url = script ! src (fromString $ url) $ ""
+css :: AttributeValue -> Html
+css url = link ! rel "stylesheet" ! href url
+
 htmlHeader :: Value -> Maybe Value -> Args -> Html
 htmlHeader dat desc as =
     H.head $ do
@@ -86,23 +91,29 @@
         script $ preEscapedToHtml vegaLite
         script $ preEscapedToHtml vega
         script $ preEscapedToHtml vegaEmbed
-        H.style  $ preEscapedToHtml milligram
-        H.style  $ preEscapedToHtml normalizecss
+        script $ preEscapedToHtml jquery
+        H.style  $ preEscapedToHtml bootstrapCSS
+        script $ preEscapedToHtml bootstrap
+        script $ preEscapedToHtml fancytable
+        script $ preEscapedToHtml sparkline
       else do
-        script ! src (fromString $ "https://cdn.jsdelivr.net/npm/vega@" ++ vegaVersion) $ ""
-        script ! src (fromString $ "https://cdn.jsdelivr.net/npm/vega-lite@" ++ vegaLiteVersion) $ ""
-        script ! src (fromString $ "https://cdn.jsdelivr.net/npm/vega-embed@" ++ vegaEmbedVersion) $ ""
-        link ! rel "stylesheet" ! href "//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
-        link ! rel "stylesheet" ! href "//cdn.rawgit.com/necolas/normalize.css/master/normalize.css"
-        link ! rel "stylesheet" ! href "//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css"
+        jsScript vegaURL
+        jsScript vegaLiteURL
+        jsScript vegaEmbedURL
+        jsScript jqueryURL
+        css (preEscapedStringValue bootstrapCSSURL)
+        jsScript bootstrapURL
+        css "//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
+        jsScript fancyTableURL
+        jsScript sparklinesURL
     -- Include this last to overwrite some milligram styling
     H.style $ preEscapedToHtml stylesheet
 
 
-template :: Header -> Value -> Maybe Value -> Args -> Html
-template header' dat descs as = docTypeHtml $ do
+template :: Header -> Value -> Maybe Value -> Maybe Html -> Args -> Html
+template header' dat cc_descs closure_descs as = docTypeHtml $ do
   H.stringComment $ "Generated with eventlog2html-" <> showVersion version
-  htmlHeader dat descs as
+  htmlHeader dat cc_descs as
   body $ H.div ! class_ "container" $ do
     H.div ! class_ "row" $ do
       H.div ! class_ "column" $ do
@@ -135,8 +146,10 @@
         button ! class_ "tablink button-black" ! onclick "changeTab('normalizedchart', this)" $ "Normalized"
         button ! class_ "tablink button-black" ! onclick "changeTab('streamgraph', this)" $ "Streamgraph"
         button ! class_ "tablink button-black" ! onclick "changeTab('linechart', this)" $ "Linechart"
-        when (isJust descs) $ do
+        when (isJust cc_descs) $ do
           button ! class_ "tablink button-black" ! onclick "changeTab('cost-centres', this)" $ "Cost Centres"
+        when (isJust closure_descs) $ do
+          button ! class_ "tablink button-black" ! onclick "changeTab('closures', this)" $ "Detailed"
     let itd = if noTraces as then NoTraceData else TraceData
     H.div ! class_ "row" $ do
       H.div ! class_ "column" $ do
@@ -149,12 +162,16 @@
           ,(3, "streamgraph", AreaChart StreamGraph)
           ,(4, "linechart", LineChart)]
 
-        when (isJust descs) $ do
+        when (isJust cc_descs) $ do
           H.div ! A.id "cost-centres" ! class_ "tabviz" $ do
             renderChart itd False 5 treevega
+        forM_ closure_descs $ \v -> do
+          H.div ! A.id "closures" ! class_ "tabviz" $ do
+            v
     script $ preEscapedToHtml tablogic
 
 
+
 htmlConf :: Args -> ChartType -> ChartConfig
 htmlConf as ct = ChartConfig 1200 1000 (not (noTraces as)) (userColourScheme as) ct (fromIntegral <$> (fixedYAxis as))
 
@@ -172,9 +189,9 @@
     renderChart itd True k vegaSpec
 
 
-templateString :: Header -> Value -> Maybe Value -> Args -> String
-templateString header' dat descs as =
-  renderHtml $ template header' dat descs as
+templateString :: Header -> Value -> Maybe Value -> Maybe Html -> Args -> String
+templateString header' dat cc_descs closure_descs as =
+  renderHtml $ template header' dat cc_descs closure_descs as
 
 ppHeapProfileType :: HeapProfBreakdown -> Text
 ppHeapProfileType (HeapProfBreakdownCostCentre) = "Cost centre profiling (implied by -hc)"
@@ -184,3 +201,4 @@
 ppHeapProfileType (HeapProfBreakdownRetainer) = "Retainer profiling (implied by -hr)"
 ppHeapProfileType (HeapProfBreakdownBiography) = "Biographical profiling (implied by -hb)"
 ppHeapProfileType (HeapProfBreakdownClosureType) = "Basic heap profile (implied by -hT)"
+--ppHeapProfileType (HeapProfBreakdownInfoTable) = "Info table profile (implied by -hi)"
diff --git a/src/Eventlog/Javascript.hs b/src/Eventlog/Javascript.hs
--- a/src/Eventlog/Javascript.hs
+++ b/src/Eventlog/Javascript.hs
@@ -4,39 +4,51 @@
     vegaLite
   , vegaEmbed
   , vega
+  , jquery
+  , bootstrap
+  , bootstrapCSS
+  , fancytable
+  , sparkline
+
   , stylesheet
   , tablogic
-  , milligram
-  , normalizecss
   , treevega
   ) where
 
 import Data.Text
 import Data.Text.Encoding
 import Data.FileEmbed
-import Eventlog.VegaVersions
+import Eventlog.AssetVersions
 
 vegaLite :: Text
-vegaLite = decodeUtf8 $(embedFile ("javascript/vega-lite@" ++ vegaLiteVersion))
+vegaLite = decodeUtf8 $(embedFile ("javascript/generated/vega-lite@" ++ vegaLiteVersion))
 
 vegaEmbed :: Text
-vegaEmbed = decodeUtf8 $(embedFile ("javascript/vega-embed@" ++ vegaEmbedVersion))
+vegaEmbed = decodeUtf8 $(embedFile ("javascript/generated/vega-embed@" ++ vegaEmbedVersion))
 
 vega :: Text
-vega = decodeUtf8 $(embedFile ("javascript/vega@" ++ vegaVersion))
+vega = decodeUtf8 $(embedFile ("javascript/generated/vega@" ++ vegaVersion))
 
+jquery :: Text
+jquery = decodeUtf8 $(embedFile ("javascript/generated/jquery-" ++ jqueryVersion ++ ".min.js"))
+
+bootstrap :: Text
+bootstrap = decodeUtf8 $(embedFile ("javascript/generated/bootstrap.min.js"))
+
+bootstrapCSS :: Text
+bootstrapCSS = decodeUtf8 $(embedFile ("javascript/generated/bootstrap.min.css"))
+
+fancytable :: Text
+fancytable = decodeUtf8 $(embedFile ("javascript/generated/fancyTable.min.js"))
+
+sparkline :: Text
+sparkline = decodeUtf8 $(embedFile ("javascript/generated/jquery.sparkline.min.js"))
+
 stylesheet :: Text
 stylesheet = decodeUtf8 $(embedFile "javascript/stylesheet.css")
 
 tablogic :: Text
 tablogic = decodeUtf8 $(embedFile "javascript/tablogic.js")
 
-milligram :: Text
-milligram = decodeUtf8 $(embedFile "javascript/milligram.min.css")
-
-normalizecss :: Text
-normalizecss = decodeUtf8 $(embedFile "javascript/normalize.min.css")
-
 treevega :: Text
 treevega = decodeUtf8 $(embedFile "javascript/ccmap.vg")
-
diff --git a/src/Eventlog/Prune.hs b/src/Eventlog/Prune.hs
--- a/src/Eventlog/Prune.hs
+++ b/src/Eventlog/Prune.hs
@@ -1,13 +1,16 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE ViewPatterns #-}
 module Eventlog.Prune
-  ( prune
+  ( pruneBands, pruneDetailed
   ) where
 
 import Data.List (sortBy)
 import Data.Ord (comparing)
-import Data.Map.Strict (Map, toList, fromList, (!))
 import Eventlog.Types
+import Data.Map (Map, fromList, (!), toList)
 
 import Eventlog.Args (Args(..), Sort(..))
+import Data.Maybe
 
 type Compare a = a -> a -> Ordering
 
@@ -18,29 +21,41 @@
 getComparison Args { sorting = StdDev, reversing = True } = cmpStdDevAscending
 getComparison Args { sorting = Name,   reversing = True }  = cmpNameDescending
 getComparison Args { sorting = Name,   reversing = False } = cmpNameAscending
+getComparison Args { sorting = Gradient,   reversing = True }  = cmpGradientAscending
+getComparison Args { sorting = Gradient,   reversing = False } = cmpGradientDescending
 
 cmpNameAscending, cmpNameDescending,
   cmpStdDevAscending, cmpStdDevDescending,
-  cmpSizeAscending, cmpSizeDescending :: Compare (Bucket, BucketInfo)
+  cmpSizeAscending, cmpSizeDescending,
+  cmpGradientAscending, cmpGradientDescending :: Compare (Bucket, BucketInfo)
 cmpNameAscending = comparing fst
 cmpNameDescending = flip cmpNameAscending
 cmpStdDevAscending = comparing (bucketStddev . snd)
 cmpStdDevDescending = flip cmpStdDevAscending
 cmpSizeAscending = comparing (bucketTotal . snd)
 cmpSizeDescending = flip cmpSizeAscending
+cmpGradientAscending = comparing (fmap getGradient . bucketGradient . snd)
+ where
+   getGradient (_a, b, _r2) = b
+cmpGradientDescending = flip cmpGradientAscending
 
-prune :: Args -> Map Bucket BucketInfo
-              -> Map Bucket (Int, BucketInfo)
-prune args ts =
-  let ccTotals = sortBy cmpSizeDescending (toList ts)
-      sizes = map (bucketTotal . snd) ccTotals
-      limit = sum sizes
-      bigs = takeWhile (< limit) . scanl (+) 0 $ sizes
-      bands = zipWith const ccTotals $ take (bound $ nBands args) bigs
+prune :: Int
+      -> Args
+      -> Map Bucket BucketInfo
+      -> Map Bucket (Int, BucketInfo)
+prune limit args ts =
+  let ccTotals = sortBy cmpSizeDescending
+                  (toList ts)
+      bands = take limit ccTotals
       ccs = map fst (sortBy (getComparison args) bands)
       res :: [(Bucket, (Int, BucketInfo))]
       res = zipWith (\b k -> (b, (k, ts ! b))) (reverse ccs) [1..]
   in  fromList res
+
+pruneBands, pruneDetailed :: Args -> Map Bucket BucketInfo -> Map Bucket (Int, BucketInfo)
+pruneBands as = prune (bound $ nBands as) as
+pruneDetailed as = prune (fromMaybe maxBound $ detailedLimit as) as
+
 
 bound :: Int -> Int
 bound n
diff --git a/src/Eventlog/Total.hs b/src/Eventlog/Total.hs
--- a/src/Eventlog/Total.hs
+++ b/src/Eventlog/Total.hs
@@ -5,18 +5,21 @@
 import Prelude hiding (init, lookup, lines, words, drop, length, readFile)
 
 import Eventlog.Types
+import qualified Data.Vector as V
+import Statistics.LinearRegression
 
 
 data Parse =
   Parse
-  { totals    :: !(Map Bucket (Double, Double)) -- compute running totals and total of squares
+  { totals    :: !(Map Bucket (Double, Double, [(Double, Double)])) -- compute running totals and total of squares
   , count     :: !Int                         -- number of frames
+  , times     :: [Double]
   }
 
 parse0 :: Parse
-parse0 = Parse{ totals = empty, count = 0 }
+parse0 = Parse{ totals = empty, count = 0, times = [] }
 
-total :: [Frame] -> (Int, Map Bucket (Double, Double))
+total :: [Frame] -> (Int, Map Bucket (Double, Double, Maybe (Double, Double, Double)))
 total fs =
   let parse1 = flip execState parse0 . mapM_ parseFrame $ fs
   in  (
@@ -25,21 +28,38 @@
       )
 
 
-stddev :: Double -> (Double, Double) -> (Double, Double)
-stddev s0 (s1, s2) = (s1, sqrt (s0 * s2 - s1 * s1) / s0)
+stddev :: Double -> (Double, Double, [(Double, Double)]) -> (Double, Double, Maybe (Double, Double, Double))
+stddev s0 (s1, s2, samples) = (s1, sqrt (s0 * s2 - s1 * s1) / s0, slope)
+  where
+    m = maximum values
+    mt = maximum timesv
+    (timesv, values) = unzip (reverse samples)
+    yvect = V.fromList (map (/ m) values)
+    xvect = V.fromList (map (/ mt) timesv)
+    slope = -- TODO: Distinguish these cases
+            case samples of
+              [] -> Nothing
+              -- Linear regression is meaningless with 1 sample
+              [_] -> Nothing
+              _
+                -- All values are the same leads to NaN r2
+                | V.all (1 ==) yvect -> Nothing
+                | otherwise -> Just $! linearRegressionRSqr xvect yvect
 
 
+
+
 parseFrame :: Frame -> State Parse ()
-parseFrame (Frame _time ls) = do
-  mapM_ inserter ls
+parseFrame (Frame time ls) = do
+  mapM_ (inserter time) ls
   modify $ \p -> p{ count = count p + 1 }
 
-inserter :: Sample -> State Parse Double
-inserter (Sample k v) = do
+inserter :: Double -> Sample -> State Parse Double
+inserter t (Sample k v) = do
   p <- get
-  put $! p { totals = alter (accum  v) k (totals p) }
+  put $! p { totals = alter (accum t v) k (totals p) }
   return $! v
 
-accum :: Double -> Maybe (Double, Double) -> Maybe (Double, Double)
-accum x Nothing  = Just $! (((,) $! x) $! (x * x))
-accum x (Just (y, yy)) = Just $! (((,) $! (x + y)) $! (x * x + yy))
+accum :: Double -> Double -> Maybe (Double, Double, [(Double, Double)]) -> Maybe (Double, Double, [(Double, Double)])
+accum t x Nothing  = Just $! ((((,,) $! x) $! (x * x)) $! [(t, x)])
+accum t x (Just (y, yy, ys)) = Just $! ((((,,) $! (x + y)) $! (x * x + yy)) $! (t, x):ys)
diff --git a/src/Eventlog/Trie.hs b/src/Eventlog/Trie.hs
--- a/src/Eventlog/Trie.hs
+++ b/src/Eventlog/Trie.hs
@@ -2,7 +2,7 @@
 module Eventlog.Trie where
 
 import Prelude hiding (init, lookup)
-import Data.Text (Text)
+import Data.Text (Text, pack)
 
 import Eventlog.Types
 import Data.Word
@@ -11,29 +11,43 @@
 import qualified Data.Trie.Map as Trie
 import qualified Data.Trie.Map.Internal as TrieI
 import Data.Aeson
+import Control.Monad.State
 
 outputTree :: Map.Map Word32 CostCentre -> [(Bucket, (Int, BucketInfo))]
            -> Value
 outputTree ccMap mdescs =
-  let t = Trie.fromList [(k, (i, b, v)) | (Bucket b, (i, BucketInfo v (Just k) _ _)) <- mdescs ]
+  let t =
+        Trie.fromList [(k, (i, b, v)) | (Bucket b, (i, BucketInfo { shortDescription = v
+                                                                  , longDescription = (Just k) }))
+                                                                  <- mdescs ]
   in toJSON $ outputTrie ccMap t
 
 outputTrie :: Map.Map Word32 CostCentre -> Trie.TMap Word32 (Int, Text, Text) -> [Value]
 outputTrie ccMap (TrieI.TMap (TrieI.Node ni m))  =
-    mkNode 0 Nothing "MAIN" ni : outputTrieLoop ccMap 0 m
+    mkNode "TOP" Nothing "MAIN" ni : flip evalState 0 (outputTrieLoop ccMap "TOP" m)
 
+newLabel :: Word32 -> State Int Text
+newLabel n = do
+  l <- get
+  modify (+1)
+  return (pack (show l ++ "-" ++ show n))
 
+
 outputTrieLoop :: Map.Map Word32 CostCentre
-               -> Word32
+               -> Text
                -> Map.Map Word32 (Trie.TMap Word32 (Int, Text, Text))
-               -> [Value]
+               -> State Int [Value]
 outputTrieLoop ccMap p cs =
-  let go p' (TrieI.TMap (TrieI.Node mv cs')) os
-        = mkNode p' (Just p) (label $ ccMap ! p') mv :  outputTrieLoop ccMap p' cs' ++ os
-  in Map.foldrWithKey go [] cs
+  let go p' (TrieI.TMap (TrieI.Node mv cs')) rest = do
+        nid <- newLabel p'
+        let n = mkNode nid (Just p) (label $ ccMap ! p') mv
+        rs <- outputTrieLoop ccMap nid cs'
+        os <- rest
+        return (n : rs ++ os)
+  in Map.foldrWithKey go (return []) cs
 
-mkNode :: Word32 -> Maybe Word32 -> Text -> Maybe (Int, Text, Text) -> Value
-mkNode i mparent n mccs = object $ [ "id" .= i, "name" .= n
+mkNode :: Text -> Maybe Text -> Text -> Maybe (Int, Text, Text) -> Value
+mkNode id_string mparent n mccs = object $ [ "id" .= id_string, "name" .= n
                              , "ccs" .= maybe "" (\(_, v, _) -> v) mccs
                              , "c" .= maybe "OTHER" (\(_, _, c) -> c) mccs]
                              ++ ["parent" .= p | Just p <- [mparent] ]
diff --git a/src/Eventlog/Types.hs b/src/Eventlog/Types.hs
--- a/src/Eventlog/Types.hs
+++ b/src/Eventlog/Types.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE DerivingStrategies #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
-module Eventlog.Types(module Eventlog.Types, HeapProfBreakdown(..)) where
+module Eventlog.Types(module Eventlog.Types, HeapProfBreakdown(..), ClosureType) where
 
 import Data.Text (Text)
 import Data.Map (Map)
@@ -8,6 +8,9 @@
 import Data.Hashable
 import Data.Word
 import GHC.RTS.Events (HeapProfBreakdown(..))
+import GHC.Exts.Heap.ClosureTypes
+import Numeric
+import qualified Data.Text as T
 
 data Header =
   Header
@@ -18,6 +21,7 @@
   , hSampleUnit  :: Text
   , hValueUnit   :: Text
   , hCount       :: Int
+  , hProgPath    :: Maybe FilePath
   } deriving Show
 
 
@@ -31,6 +35,7 @@
                              , longDescription :: Maybe [Word32]
                              , bucketTotal :: Double
                              , bucketStddev :: Double
+                             , bucketGradient :: !(Maybe (Double, Double, Double))
                              } deriving Show
 
 data CostCentre = CC { cid :: Word32
@@ -49,4 +54,25 @@
                          , profTotals :: (Map Bucket BucketInfo)
                          , profCCMap  :: Map Word32 CostCentre
                          , profFrames :: [Frame]
-                         , profTraces :: [Trace] } deriving Show
+                         , profTraces :: [Trace]
+                         , profItl    :: Map InfoTablePtr InfoTableLoc } deriving Show
+
+data InfoTableLoc = InfoTableLoc { itlName :: !Text
+                                 , itlClosureDesc :: !ClosureType
+                                 , itlTyDesc :: !Text
+                                 , itlLbl :: !Text
+                                 , itlModule :: !Text
+                                 , itlSrcLoc :: !Text } deriving Show
+
+data InfoTablePtr = InfoTablePtr Word64 deriving (Eq, Ord)
+
+instance Show InfoTablePtr where
+  show (InfoTablePtr p) =  "0x" ++ showHex p ""
+
+toItblPointer :: Bucket -> InfoTablePtr
+toItblPointer (Bucket t) =
+    let s = drop 2 (T.unpack t)
+        w64 = case readHex s of
+                ((n, ""):_) -> n
+                _ -> error (show t)
+    in InfoTablePtr w64
diff --git a/src/Eventlog/Vega.hs b/src/Eventlog/Vega.hs
--- a/src/Eventlog/Vega.hs
+++ b/src/Eventlog/Vega.hs
@@ -30,7 +30,7 @@
 
       other_binfo = BucketInfo "OTHER" Nothing
                                -- Last two fields currently unused
-                               0 0
+                               0 0 Nothing
   in Data.Map.foldr go (go (0, other_binfo) []) ks
 
 data VegaTrace = VegaTrace { tx :: Double, desc :: Text }
diff --git a/src/Eventlog/VegaVersions.hs b/src/Eventlog/VegaVersions.hs
deleted file mode 100644
--- a/src/Eventlog/VegaVersions.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-module Eventlog.VegaVersions where
-
-vegaVersion, vegaLiteVersion, vegaEmbedVersion :: String
-vegaVersion = "5.10.0"
-vegaLiteVersion = "4.7.0"
-vegaEmbedVersion = "6.3.2"
