From 23681c9a0f22bbd6976071dbd2ac63b8a12c6420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 28 Mar 2016 04:35:19 +0200 Subject: [PATCH] chart improvements --- build.sh | 3 + esp_meas.pro.user | 2 +- html/css/app.css | 2 +- html/js/all.js | 2 +- html_src/css/app.css | 2 +- html_src/css/app.css.map | 2 +- html_src/gulpfile.js | 2 + html_src/js-src/waveform.js | 15 +- html_src/js/all.js | 5289 +-------------------- html_src/js/all.js.map | 2 +- html_src/sass/app.scss | 3 +- html_src/sass/lib/chartist/_chartist.scss | 1 + libesphttpd/core/httpd.c | 35 +- libesphttpd/html-minifier-conf.json | 2 +- web-gbuild.sh | 3 + web-gwatch.sh | 2 +- 16 files changed, 63 insertions(+), 5304 deletions(-) create mode 100755 build.sh create mode 100755 web-gbuild.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..25b732a --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +xterm -title "ESP html build" -e "source $HOME/.bashrc && make -B -j4" diff --git a/esp_meas.pro.user b/esp_meas.pro.user index d12ab14..b9d07b8 100644 --- a/esp_meas.pro.user +++ b/esp_meas.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/html/css/app.css b/html/css/app.css index 295bac7..43b187a 100644 --- a/html/css/app.css +++ b/html/css/app.css @@ -1 +1 @@ -*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.ct-axis-title,.ct-label{fill:hsla(0,0%,100%,.8)}.ct-label{color:hsla(0,0%,100%,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:hsla(0,0%,100%,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.center{text-align:center}html{font-family:Arial,sans-serif;color:#d0d0d0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:#fff;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:#fff;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;overflow-y:auto;padding:1rem}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem;border-radius:3px;background-color:hsla(0,0%,100%,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem .6180469716rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 #000;border-radius:6px}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#fefefe}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#fefefe}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#d04e51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#fefefe}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#fefefe}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px #000;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid hsla(0,0%,100%,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px #000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.4em;padding:3.5px;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:hsla(0,0%,100%,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:#fff}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #rssi-perc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #rssi-dbm:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em} \ No newline at end of file +*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;overflow-y:auto;padding:1rem}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem .6180469716rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.4em;padding:3.5px;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #rssi-perc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #rssi-dbm:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em} \ No newline at end of file diff --git a/html/js/all.js b/html/js/all.js index e81136c..0587ade 100644 --- a/html/js/all.js +++ b/html/js/all.js @@ -1,2 +1,2 @@ function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function e(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isObject(t){return"[object Object]"===Object.prototype.toString.call(t)}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function rssiPerc(t){var e=parseInt(t);return e>-50?100:-100>e?0:Math.round(2*(e+100))}!function(){"use strict";function t(){var t;for(p=!0,t=0;t=0;n-=1)t(e[n])}function i(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function r(t,e){return t.currentStyle?t.currentStyle[i(e)]:x.getComputedStyle?x.getComputedStyle(t,null).getPropertyValue(e):null}function s(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function a(t,e,n){try{t.style[i(e)]=n}catch(r){}}function o(t){t.style.display="","none"===r(t,"display")&&(t.style.display="block")}function c(t){var e,i,r,a="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(i=0;i0&&(a+="&"+s(e.name,e.value));break;case"select-multiple":for(r=0;r0?a.substring(1):""}function u(t,e,i){var r,s,a,o=!1;return t&&(r=t.split(/\s+/),n(function(t){for(a=0;a0?w[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/," "):void 0},e.setClass=function(t){return(t||""===t)&&n(function(e){e.className=t},w),e},e.addClass=function(t){return t&&n(function(e){e.className+=" "+t},w),e},e.removeClass=function(t){return u(t,"remove",w),e},e.toggleClass=function(t){return u(t,"toggle",w),e},e.hasClass=function(t){return u(t,"has",w)},e.html=function(t){return t||""===t?(n(function(e){e.innerHTML=t},w),e):w[0]?w[0].innerHTML:void 0},e.htmlBefore=function(t){return l(t,"before",w),e},e.htmlAfter=function(t){return l(t,"after",w),e},e.htmlAppend=function(t){return l(t,"append",w),e},e.htmlPrepend=function(t){return l(t,"prepend",w),e},e.attr=function(t,i){if(t){if(t=t.toLowerCase(),"undefined"!=typeof i)return n(function(e){"style"===t?e.style.cssText=i:"class"===t?e.className=i:e.setAttribute(t,i)},w),e;if(w[0])if("style"===t){if(w[0].style.cssText)return w[0].style.cssText}else if("class"===t){if(w[0].className)return w[0].className}else if(w[0].getAttribute(t))return w[0].getAttribute(t)}},e.data=function(t,n){return t?e.attr("data-"+t,n):void 0},e.val=function(t){var i,r,s;if(t||""===t)return n(function(e){switch(e.nodeName){case"SELECT":for("string"!=typeof t&&"number"!=typeof t||(t=[t]),r=0;r1?i:i[0];case"INPUT":case"TEXTAREA":case"BUTTON":return w[0].value}},e.checked=function(t){return"boolean"==typeof t?(n(function(e){"INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||(e.checked=t)},w),e):!w[0]||"INPUT"!==w[0].nodeName||"checkbox"!==w[0].type&&"radio"!==w[0].type?void 0:!!w[0].checked},e.on=function(i,r){return t!==x&&t!==v||(w=[t]),n(function(t){v.addEventListener?t.addEventListener(i,r,!1):v.attachEvent&&(t[i+r]=function(){return r.apply(t,arguments)},t.attachEvent("on"+i,t[i+r]))},w),e},e.off=function(i,r){return t!==x&&t!==v||(w=[t]),n(function(t){v.addEventListener?t.removeEventListener(i,r,!1):v.attachEvent&&(t.detachEvent("on"+i,t[i+r]),t[i+r]=null)},w),e},e.ajax=function(t,n,i,r,s){var a,o,u=c(w),l=n?n.toUpperCase():"GET",h=new RegExp("http[s]?://(.*?)/","gi"),d=h.exec(t),f="_ts="+ +new Date,p=v.getElementsByTagName("head")[0],m="chibi"+ +new Date+(g+=1);return!u||"GET"!==l&&"DELETE"!==l||(t+=-1===t.indexOf("?")?"?"+u:"&"+u,u=null),"GET"===l&&!s&&d&&x.location.host!==d[1]?(r&&(t+=-1===t.indexOf("?")?"?"+f:"&"+f),t=t.replace("=%3F","=?"),i&&-1!==t.indexOf("=?")&&(t=t.replace("=?","="+m),x[m]=function(t){try{i(t,200)}catch(e){}x[m]=void 0}),o=document.createElement("script"),o.async=!0,o.src=t,o.onload=function(){p.removeChild(o)},p.appendChild(o)):(x.XMLHttpRequest?a=new XMLHttpRequest:x.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLHTTP")),a&&(r&&(t+=-1===t.indexOf("?")?"?"+f:"&"+f),a.open(l,t,!0),a.onreadystatechange=function(){4===a.readyState&&i&&i(a.responseText,a.status)},a.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"!==l&&"PUT"!==l||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(u))),e},e.get=function(t,n,i,r){return e.ajax(t,"get",n,i,r)},e.post=function(t,n,i){return e.ajax(t,"post",n,i)},e}var d=[],f=[],p=!1,m=!1,g=0,v=document,x=window;v.addEventListener?(v.addEventListener("DOMContentLoaded",t,!1),x.addEventListener("load",e,!1)):v.attachEvent?(v.attachEvent("onreadystatechange",t),x.attachEvent("onload",e)):x.onload=e,x.$=h}(),function(t,e){t.Chartist=e()}(this,function(){var t={version:"0.9.7"};return function(t,e,n){"use strict";n.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},n.noop=function(t){return t},n.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},n.extend=function(t){t=t||{};var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(e){for(var i in e)"object"!=typeof e[i]||null===e[i]||e[i]instanceof Array?t[i]=e[i]:t[i]=n.extend({},t[i],e[i])}),t},n.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"g"),n)},n.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},n.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},n.querySelector=function(t){return t instanceof Node?t:e.querySelector(t)},n.times=function(t){return Array.apply(null,new Array(t))},n.sum=function(t,e){return t+(e?e:0)},n.mapMultiply=function(t){return function(e){return e*t}},n.mapAdd=function(t){return function(e){return e+t}},n.serialMap=function(t,e){var i=[],r=Math.max.apply(null,t.map(function(t){return t.length}));return n.times(r).forEach(function(n,r){var s=t.map(function(t){return t[r]});i[r]=e.apply(null,s)}),i},n.roundWithPrecision=function(t,e){var i=Math.pow(10,e||n.precision);return Math.round(t*i)/i},n.precision=8,n.escapingMap={"&":"&","<":"<",">":">",'"':""","'":"'"},n.serialize=function(t){return null===t||void 0===t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),Object.keys(n.escapingMap).reduce(function(t,e){return n.replaceAll(t,e,n.escapingMap[e])},t))},n.deserialize=function(t){if("string"!=typeof t)return t;t=Object.keys(n.escapingMap).reduce(function(t,e){return n.replaceAll(t,n.escapingMap[e],e)},t);try{t=JSON.parse(t),t=void 0!==t.data?t.data:t}catch(e){}return t},n.createSvg=function(t,e,i,r){var s;return e=e||"100%",i=i||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(n.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),s=new n.Svg("svg").attr({width:e,height:i}).addClass(r).attr({style:"width: "+e+"; height: "+i+";"}),t.appendChild(s._node),s},n.normalizeData=function(t){if(t=t||{series:[],labels:[]},t.series=t.series||[],t.labels=t.labels||[],t.series.length>0&&0===t.labels.length){var e,i=n.getDataArray(t);e=i.every(function(t){return t instanceof Array})?Math.max.apply(null,i.map(function(t){return t.length})):i.length,t.labels=n.times(e).map(function(){return""})}return t},n.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;es.high&&(s.high=n),o&&n0?s.low=0:(s.high=1,s.low=0)),s},n.isNum=function(t){return!isNaN(t)&&isFinite(t)},n.isFalseyButZero=function(t){return!t&&0!==t},n.getNumberOrUndefined=function(t){return isNaN(+t)?void 0:+t},n.getMultiValue=function(t,e){return n.isNum(t)?+t:t?t[e||"y"]||0:0},n.rho=function(t){function e(t,n){return t%n===0?n:e(n,t%n)}function n(t){return t*t+1}if(1===t)return t;var i,r=2,s=2;if(t%2===0)return 2;do r=n(r)%t,s=n(n(s))%t,i=e(Math.abs(r-s),t);while(1===i);return i},n.getBounds=function(t,e,i,r){var s,a,o,c=0,u={high:e.high,low:e.low};u.valueRange=u.high-u.low,u.oom=n.orderOfMagnitude(u.valueRange),u.step=Math.pow(10,u.oom),u.min=Math.floor(u.low/u.step)*u.step,u.max=Math.ceil(u.high/u.step)*u.step,u.range=u.max-u.min,u.numberOfSteps=Math.round(u.range/u.step);var l=n.projectLength(t,u.step,u),h=i>l,d=r?n.rho(u.range):0;if(r&&n.projectLength(t,1,u)>=i)u.step=1;else if(r&&d=i)u.step=d;else for(;;){if(h&&n.projectLength(t,u.step,u)<=i)u.step*=2;else{if(h||!(n.projectLength(t,u.step/2,u)>=i))break;if(u.step/=2,r&&u.step%1!==0){u.step*=2;break}}if(c++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}for(a=u.min,o=u.max;a+u.step<=u.low;)a+=u.step;for(;o-u.step>=u.high;)o-=u.step;for(u.min=a,u.max=o,u.range=u.max-u.min,u.values=[],s=u.min;s<=u.max;s+=u.step)u.values.push(n.roundWithPrecision(s));return u},n.polarToCartesian=function(t,e,n,i){var r=(i-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}},n.createChartRect=function(t,e,i){var r=!(!e.axisX&&!e.axisY),s=r?e.axisY.offset:0,a=r?e.axisX.offset:0,o=t.width()||n.quantity(e.width).value||0,c=t.height()||n.quantity(e.height).value||0,u=n.normalizePadding(e.chartPadding,i);o=Math.max(o,s+u.left+u.right),c=Math.max(c,a+u.top+u.bottom);var l={padding:u,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return r?("start"===e.axisX.position?(l.y2=u.top+a,l.y1=Math.max(c-u.bottom,l.y2+1)):(l.y2=u.top,l.y1=Math.max(c-u.bottom-a,l.y2+1)),"start"===e.axisY.position?(l.x1=u.left+s,l.x2=Math.max(o-u.right,l.x1+1)):(l.x1=u.left,l.x2=Math.max(o-u.right-s,l.x1+1))):(l.x1=u.left,l.x2=Math.max(o-u.right,l.x1+1),l.y2=u.top,l.y1=Math.max(c-u.bottom,l.y2+1)),l},n.createGrid=function(t,e,i,r,s,a,o,c){var u={};u[i.units.pos+"1"]=Math.round(t)+.5,u[i.units.pos+"2"]=Math.round(t)+.5,u[i.counterUnits.pos+"1"]=r,u[i.counterUnits.pos+"2"]=r+s;var l=a.elem("line",u,o.join(" "));c.emit("draw",n.extend({type:"grid",axis:i,index:e,group:a,element:l},u))},n.createLabel=function(t,e,i,r,s,a,o,c,u,l,h){var d,f={};f[s.units.pos]=t+o[s.units.pos],f[s.counterUnits.pos]=o[s.counterUnits.pos],f[s.units.len]=e,f[s.counterUnits.len]=a-10;var p=r[i];if(p=Math.round(100*+p)/100,l){var m=''+p+"";d=c.foreignObject(m,n.extend({style:"overflow: visible;"},f))}else d=c.elem("text",f,u.join(" ")).text(p);h.emit("draw",n.extend({type:"label",axis:s,index:i,group:c,element:d,text:p},f))},n.getSeriesOption=function(t,e,n){if(t.name&&e.series&&e.series[t.name]){var i=e.series[t.name];return i.hasOwnProperty(n)?i[n]:e[n]}return e[n]},n.optionsProvider=function(e,i,r){function s(e){var s=o;if(o=n.extend({},u),i)for(c=0;c1){var c=[];return o.forEach(function(t){c.push(a(t.pathCoordinates,t.valueData))}),n.Svg.Path.join(c)}if(t=o[0].pathCoordinates,i=o[0].valueData,t.length<=4)return n.Interpolation.none()(t,i);for(var u,l=(new n.Svg.Path).move(t[0],t[1],!1,i[0]),h=0,d=t.length;d-2*!u>h;h+=2){var f=[{x:+t[h-2],y:+t[h-1]},{x:+t[h],y:+t[h+1]},{x:+t[h+2],y:+t[h+3]},{x:+t[h+4],y:+t[h+5]}];u?h?d-4===h?f[3]={x:+t[0],y:+t[1]}:d-2===h&&(f[2]={x:+t[0],y:+t[1]},f[3]={x:+t[2],y:+t[3]}):f[0]={x:+t[d-2],y:+t[d-1]}:d-4===h?f[3]=f[2]:h||(f[0]={x:+t[h],y:+t[h+1]}),l.curve(r*(-f[0].x+6*f[1].x+f[2].x)/6+s*f[2].x,r*(-f[0].y+6*f[1].y+f[2].y)/6+s*f[2].y,r*(f[1].x+6*f[2].x-f[3].x)/6+s*f[2].x,r*(f[1].y+6*f[2].y-f[3].y)/6+s*f[2].y,f[2].x,f[2].y,!1,i[(h+2)/2])}return l}return n.Interpolation.none()([])}},n.Interpolation.step=function(t){var e={postpone:!0,fillHoles:!1};return t=n.extend({},e,t),function(e,i){for(var r,s,a,o=new n.Svg.Path,c=0;c1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).forEach(function(n){var o=c.elem("path",{d:n.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized[a],path:n.clone(),series:s,seriesIndex:a,axisX:i,axisY:r,chartRect:u,index:a,group:c,element:o})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:r.bounds,chartRect:u,axisX:i,axisY:r,svg:this.svg,options:t})}function r(t,e,i,r){n.Line["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Line=n.Base.extend({constructor:r,createChart:i})}(window,document,t),function(t,e,n){"use strict";function i(t){this.data=n.normalizeData(this.data);var e,i={raw:this.data,normalized:t.distributeSeries?n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y").map(function(t){return[t]}):n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y")};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var r=this.svg.elem("g").addClass(t.classNames.gridGroup),a=this.svg.elem("g"),o=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==i.normalized.length){var c=n.serialMap(i.normalized,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});e=n.getHighLow([c],n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y")}else e=n.getHighLow(i.normalized,n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y");e.high=+t.high||(0===t.high?0:e.high),e.low=+t.low||(0===t.low?0:e.low);var u,l,h,d,f,p=n.createChartRect(this.svg,t,s.padding);l=t.distributeSeries&&t.stackBars?i.raw.labels.slice(0,1):i.raw.labels,t.horizontalBars?(u=d=void 0===t.axisX.type?new n.AutoScaleAxis(n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})):t.axisX.type.call(n,n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})),h=f=void 0===t.axisY.type?new n.StepAxis(n.Axis.units.y,i,p,{ticks:l}):t.axisY.type.call(n,n.Axis.units.y,i,p,t.axisY)):(h=d=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,i,p,{ticks:l}):t.axisX.type.call(n,n.Axis.units.x,i,p,t.axisX),u=f=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})):t.axisY.type.call(n,n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})));var m=t.horizontalBars?p.x1+u.projectValue(0):p.y1-u.projectValue(0),g=[];h.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),u.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),i.raw.series.forEach(function(e,r){var s,o,c=r-(i.raw.series.length-1)/2;s=t.distributeSeries&&!t.stackBars?h.axisLength/i.normalized.length/2:t.distributeSeries&&t.stackBars?h.axisLength/2:h.axisLength/i.normalized[r].length/2,o=a.elem("g"),o.attr({"ct:series-name":e.name,"ct:meta":n.serialize(e.meta)}),o.addClass([t.classNames.series,e.className||t.classNames.series+"-"+n.alphaNumerate(r)].join(" ")),i.normalized[r].forEach(function(a,l){var v,x,y,w;if(w=t.distributeSeries&&!t.stackBars?r:t.distributeSeries&&t.stackBars?0:l,v=t.horizontalBars?{x:p.x1+u.projectValue(a&&a.x?a.x:0,l,i.normalized[r]),y:p.y1-h.projectValue(a&&a.y?a.y:0,w,i.normalized[r])}:{x:p.x1+h.projectValue(a&&a.x?a.x:0,w,i.normalized[r]),y:p.y1-u.projectValue(a&&a.y?a.y:0,l,i.normalized[r])},h instanceof n.StepAxis&&(h.options.stretch||(v[h.units.pos]+=s*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:c*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==a){var b={};b[h.units.pos+"1"]=v[h.units.pos],b[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(b[h.counterUnits.pos+"1"]=m,b[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(b[h.counterUnits.pos+"1"]=y,b[h.counterUnits.pos+"2"]=g[l]),b.x1=Math.min(Math.max(b.x1,p.x1),p.x2),b.x2=Math.min(Math.max(b.x2,p.x1),p.x2),b.y1=Math.min(Math.max(b.y1,p.y2),p.y1),b.y2=Math.min(Math.max(b.y2,p.y2),p.y1),x=o.elem("line",b,t.classNames.bar).attr({"ct:value":[a.x,a.y].filter(n.isNum).join(","),"ct:meta":n.getMetaData(e,l)}),this.eventEmitter.emit("draw",n.extend({type:"bar",value:a,index:l,meta:n.getMetaData(e,l),series:e,seriesIndex:r,axisX:d,axisY:f,chartRect:p,group:o,element:x},b))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:u.bounds,chartRect:p,axisX:d,axisY:f,svg:this.svg,options:t})}function r(t,e,i,r){n.Bar["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Bar=n.Base.extend({constructor:r,createChart:i})}(window,document,t),t}),function(t,e){t["Chartist.plugins.ctAxisTitle"]=e()}(this,function(){return function(t,e,n){"use strict";var i={axisTitle:"",axisClass:"ct-axis-title",offset:{x:0,y:0},textAnchor:"middle",flipText:!1},r={axisX:i,axisY:i};n.plugins=n.plugins||{},n.plugins.ctAxisTitle=function(t){return t=n.extend({},r,t),function(e){e.on("created",function(e){var i,r,s;if(t.axisX.axisTitle&&e.axisX&&(i=e.axisX.axisLength/2+e.options.axisY.offset+e.options.chartPadding.left,r=e.options.chartPadding.top,"end"===e.options.axisY.position&&(i-=e.options.axisY.offset),"end"===e.options.axisX.position&&(r+=e.axisY.axisLength),s=new n.Svg("text"),s.addClass(t.axisX.axisClass),s.text(t.axisX.axisTitle),s.attr({x:i+t.axisX.offset.x,y:r+t.axisX.offset.y,"text-anchor":t.axisX.textAnchor}),e.svg.append(s,!0)),t.axisY.axisTitle&&e.axisY){i=0,r=e.axisY.axisLength/2+e.options.chartPadding.top,"start"===e.options.axisX.position&&(r+=e.options.axisX.offset),"end"===e.options.axisY.position&&(i=e.axisX.axisLength);var a="rotate("+(t.axisY.flipText?-90:90)+", "+i+", "+r+")";s=new n.Svg("text"),s.addClass(t.axisY.axisClass),s.text(t.axisY.axisTitle),s.attr({x:i+t.axisY.offset.x,y:r+t.axisY.offset.y,transform:a,"text-anchor":t.axisY.textAnchor}),e.svg.append(s,!0)}})}}}(window,document,Chartist),Chartist.plugins.ctAxisTitle}),function(t,e){t["Chartist.plugins.zoom"]=e()}(this,function(){return function(t,e,n){"use strict";function i(t){t.attr({style:"display:none"})}function r(t){t.attr({style:"display:block"})}function s(t,e){var n=t.x,i=t.y,r=e.x-n,s=e.y-i;return 0>r&&(r=-r,n=e.x),0>s&&(s=-s,i=e.y),{x:n,y:i,width:r,height:s}}function a(t,e){return o(t.clientX,t.clientY,e)}function o(t,e,n){var i="svg"===n.tagName?n:n.ownerSVGElement,r=i.getScreenCTM(),s=i.createSVGPoint();return s.x=t,s.y=e,s=s.matrixTransform(r.inverse()),s||{x:0,y:0}}function c(t,e){var n=e.bounds.max,i=e.bounds.min;if(e.scale&&"log"===e.scale.type){var r=e.scale.base;return Math.pow(r,t*u(n/i,r)/e.axisLength)*i}return t*e.bounds.range/e.axisLength+i}function u(t,e){return Math.log(t)/Math.log(e)}var l={};n.plugins=n.plugins||{},n.plugins.zoom=function(t){return t=n.extend({},l,t),function(e){function o(t){var e=a(t,w);return e.id=t.identifier,e}function u(t){for(var e=0;e1&&(y.attr(s(O[0],O[1])),r(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(y.attr(s(O[0],O[1])),r(y),t.preventDefault())}function d(t){f(t.changedTouches)}function f(t){for(var e=0;e=0&&O.splice(n,1)}}function p(t){O.length>1&&v(s(O[0],O[1])),f(t.changedTouches),i(y)}function m(t){0===t.button&&(S=a(t,w),y.attr(s(S,S)),r(y),t.preventDefault())}function g(e){if(0===e.button){var n=s(S,a(e,w));v(n),S=null,i(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(L(),e.preventDefault())}function v(t){if(t.width>5&&t.height>5){var n=t.x-A.x1,i=n+t.width,r=A.y1-t.y,s=r-t.height;e.options.axisX.highLow={low:c(n,b),high:c(i,b)},e.options.axisY.highLow={low:c(s,E),high:c(r,E)},e.update(e.data,e.options),C&&C(e,L)}}function x(t){if(S){var e=a(t,w);y.attr(s(S,e)),t.preventDefault()}}if(e instanceof n.Line){var y,w,b,E,A,S,C=t.onZoom,O=[];e.on("draw",function(t){var e=t.type;"line"!==e&&"bar"!==e&&"area"!==e&&"point"!==e||t.element.attr({"clip-path":"url(#zoom-mask)"})}),e.on("created",function(t){b=t.axisX,E=t.axisY,A=t.chartRect,w=t.svg._node,y=t.svg.elem("rect",{x:10,y:10,width:100,height:100},"ct-zoom-rect"),i(y);var e=t.svg.querySelector("defs")||t.svg.elem("defs"),n=A.width(),r=A.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:A.x1,y:A.y2,width:n,height:r,fill:"white"}),w.addEventListener("mousedown",m),w.addEventListener("mouseup",g),w.addEventListener("mousemove",x),w.addEventListener("touchstart",l),w.addEventListener("touchmove",h),w.addEventListener("touchend",p),w.addEventListener("touchcancel",d)});var L=function(){e.options.axisX.highLow=null,e.options.axisY.highLow=null,e.update(e.data,e.options)}}}}}(window,document,Chartist),Chartist.plugins.zoom}),String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(isArray(arguments[0])||isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var i=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var r=new RegExp(regexEscape(n),"g");t=t.replace(r,e[i])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),modal.init()});var wifi=function(){function t(t,n){if(200!=n)return void i(5e3);t=JSON.parse(t);var a=!bool(t.result.inProgress)&&t.result.APs.length>0;if(i(a?15e3:1e3),a){var o=$("#ap-list");$(".AP").remove(),o.toggle(a),$("#ap-loader").toggle(!a),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var n=document.createElement("div"),i=$(n).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&i.addClass("selected");var a=document.createElement("div");$(a).addClass("inner").htmlAppend('
{0}
'.format(rssiPerc(t.rssi))).htmlAppend('
{0}
'.format(e(t.essid))).htmlAppend('
{0}
'.format(s[t.enc]));i.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),n.appendChild(a),o[0].appendChild(n)}})}}function n(){$().get("/wifi/scan.cgi",t,!0,!0)}function i(t){setTimeout(n,t)}var r={},s=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){n()},r}(),wfm=function(){function t(t,e,n){var i=[];t.forEach(function(t,e){i.push({x:e,y:t})});var r=[],s=window.matchMedia("screen and (min-width: 544px)"),a=!s.matches;a||r.push(Chartist.plugins.ctAxisTitle({axisX:{axisTitle:e,offset:{x:0,y:55}},axisY:{axisTitle:n,flipText:!0,offset:{x:0,y:15}}})),new Chartist.Line("#chart",{series:[{name:"a",data:i}]},{showPoint:!1,fullWidth:!0,chartPadding:a?{right:20,bottom:5,left:0}:{right:25,bottom:30,left:25},series:{a:{lineSmooth:Chartist.Interpolation.none()}},axisX:{type:Chartist.AutoScaleAxis,onlyInteger:!0},axisY:{type:Chartist.AutoScaleAxis},plugins:r})}function e(e,n){if(200!=n)return void alert("Request failed.");var i=JSON.parse(e);return i.success?void t(e.samples,"Sample Nr.","ADC value"):void alert("Sampling failed.")}var n={};return n.init=function(){$("#load").on("click",function(){var t=$("#count").val();$().get("/api/raw.json?n="+t,e,!0,!0)})},n}(); \ No newline at end of file +this.stepLength=this.axisLength/this.divisor}function r(t){return this.axisLength*(+n.getMultiValue(t,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}n.FixedScaleAxis=n.Axis.extend({constructor:i,projectValue:r})}(window,document,t),function(t,e,n){"use strict";function i(t,e,i,r){n.StepAxis["super"].constructor.call(this,t,i,r.ticks,r),this.stepLength=this.axisLength/(r.ticks.length-(r.stretch?1:0))}function r(t,e){return this.stepLength*e}n.StepAxis=n.Axis.extend({constructor:i,projectValue:r})}(window,document,t),function(t,e,n){"use strict";function i(t){this.data=n.normalizeData(this.data);var e={raw:this.data,normalized:n.getDataArray(this.data,t.reverseData,!0)};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart);var i,r,a=this.svg.elem("g").addClass(t.classNames.gridGroup),o=this.svg.elem("g"),c=this.svg.elem("g").addClass(t.classNames.labelGroup),u=n.createChartRect(this.svg,t,s.padding);i=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,e,u,n.extend({},t.axisX,{ticks:e.raw.labels,stretch:t.fullWidth})):t.axisX.type.call(n,n.Axis.units.x,e,u,t.axisX),r=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,e,u,n.extend({},t.axisY,{high:n.isNum(t.high)?t.high:t.axisY.high,low:n.isNum(t.low)?t.low:t.axisY.low})):t.axisY.type.call(n,n.Axis.units.y,e,u,t.axisY),i.createGridAndLabels(a,c,this.supportsForeignObject,t,this.eventEmitter),r.createGridAndLabels(a,c,this.supportsForeignObject,t,this.eventEmitter),e.raw.series.forEach(function(s,a){var c=o.elem("g");c.attr({"ct:series-name":s.name,"ct:meta":n.serialize(s.meta)}),c.addClass([t.classNames.series,s.className||t.classNames.series+"-"+n.alphaNumerate(a)].join(" "));var l=[],h=[];e.normalized[a].forEach(function(t,o){var c={x:u.x1+i.projectValue(t,o,e.normalized[a]),y:u.y1-r.projectValue(t,o,e.normalized[a])};l.push(c.x,c.y),h.push({value:t,valueIndex:o,meta:n.getMetaData(s,o)})}.bind(this));var d={lineSmooth:n.getSeriesOption(s,t,"lineSmooth"),showPoint:n.getSeriesOption(s,t,"showPoint"),showLine:n.getSeriesOption(s,t,"showLine"),showArea:n.getSeriesOption(s,t,"showArea"),areaBase:n.getSeriesOption(s,t,"areaBase")},f="function"==typeof d.lineSmooth?d.lineSmooth:d.lineSmooth?n.Interpolation.cardinal():n.Interpolation.none(),p=f(l,h);if(d.showPoint&&p.pathElements.forEach(function(e){var o=c.elem("line",{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y},t.classNames.point).attr({"ct:value":[e.data.value.x,e.data.value.y].filter(n.isNum).join(","),"ct:meta":e.data.meta});this.eventEmitter.emit("draw",{type:"point",value:e.data.value,index:e.data.valueIndex,meta:e.data.meta,series:s,seriesIndex:a,axisX:i,axisY:r,group:c,element:o,x:e.x,y:e.y})}.bind(this)),d.showLine){var m=c.elem("path",{d:p.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:e.normalized[a],path:p.clone(),chartRect:u,index:a,series:s,seriesIndex:a,axisX:i,axisY:r,group:c,element:m})}if(d.showArea&&r.range){var g=Math.max(Math.min(d.areaBase,r.range.max),r.range.min),v=u.y1-r.projectValue(g);p.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).forEach(function(n){var o=c.elem("path",{d:n.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized[a],path:n.clone(),series:s,seriesIndex:a,axisX:i,axisY:r,chartRect:u,index:a,group:c,element:o})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:r.bounds,chartRect:u,axisX:i,axisY:r,svg:this.svg,options:t})}function r(t,e,i,r){n.Line["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Line=n.Base.extend({constructor:r,createChart:i})}(window,document,t),function(t,e,n){"use strict";function i(t){this.data=n.normalizeData(this.data);var e,i={raw:this.data,normalized:t.distributeSeries?n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y").map(function(t){return[t]}):n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y")};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var r=this.svg.elem("g").addClass(t.classNames.gridGroup),a=this.svg.elem("g"),o=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==i.normalized.length){var c=n.serialMap(i.normalized,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});e=n.getHighLow([c],n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y")}else e=n.getHighLow(i.normalized,n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y");e.high=+t.high||(0===t.high?0:e.high),e.low=+t.low||(0===t.low?0:e.low);var u,l,h,d,f,p=n.createChartRect(this.svg,t,s.padding);l=t.distributeSeries&&t.stackBars?i.raw.labels.slice(0,1):i.raw.labels,t.horizontalBars?(u=d=void 0===t.axisX.type?new n.AutoScaleAxis(n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})):t.axisX.type.call(n,n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})),h=f=void 0===t.axisY.type?new n.StepAxis(n.Axis.units.y,i,p,{ticks:l}):t.axisY.type.call(n,n.Axis.units.y,i,p,t.axisY)):(h=d=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,i,p,{ticks:l}):t.axisX.type.call(n,n.Axis.units.x,i,p,t.axisX),u=f=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})):t.axisY.type.call(n,n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})));var m=t.horizontalBars?p.x1+u.projectValue(0):p.y1-u.projectValue(0),g=[];h.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),u.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),i.raw.series.forEach(function(e,r){var s,o,c=r-(i.raw.series.length-1)/2;s=t.distributeSeries&&!t.stackBars?h.axisLength/i.normalized.length/2:t.distributeSeries&&t.stackBars?h.axisLength/2:h.axisLength/i.normalized[r].length/2,o=a.elem("g"),o.attr({"ct:series-name":e.name,"ct:meta":n.serialize(e.meta)}),o.addClass([t.classNames.series,e.className||t.classNames.series+"-"+n.alphaNumerate(r)].join(" ")),i.normalized[r].forEach(function(a,l){var v,x,y,w;if(w=t.distributeSeries&&!t.stackBars?r:t.distributeSeries&&t.stackBars?0:l,v=t.horizontalBars?{x:p.x1+u.projectValue(a&&a.x?a.x:0,l,i.normalized[r]),y:p.y1-h.projectValue(a&&a.y?a.y:0,w,i.normalized[r])}:{x:p.x1+h.projectValue(a&&a.x?a.x:0,w,i.normalized[r]),y:p.y1-u.projectValue(a&&a.y?a.y:0,l,i.normalized[r])},h instanceof n.StepAxis&&(h.options.stretch||(v[h.units.pos]+=s*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:c*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==a){var b={};b[h.units.pos+"1"]=v[h.units.pos],b[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(b[h.counterUnits.pos+"1"]=m,b[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(b[h.counterUnits.pos+"1"]=y,b[h.counterUnits.pos+"2"]=g[l]),b.x1=Math.min(Math.max(b.x1,p.x1),p.x2),b.x2=Math.min(Math.max(b.x2,p.x1),p.x2),b.y1=Math.min(Math.max(b.y1,p.y2),p.y1),b.y2=Math.min(Math.max(b.y2,p.y2),p.y1),x=o.elem("line",b,t.classNames.bar).attr({"ct:value":[a.x,a.y].filter(n.isNum).join(","),"ct:meta":n.getMetaData(e,l)}),this.eventEmitter.emit("draw",n.extend({type:"bar",value:a,index:l,meta:n.getMetaData(e,l),series:e,seriesIndex:r,axisX:d,axisY:f,chartRect:p,group:o,element:x},b))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:u.bounds,chartRect:p,axisX:d,axisY:f,svg:this.svg,options:t})}function r(t,e,i,r){n.Bar["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Bar=n.Base.extend({constructor:r,createChart:i})}(window,document,t),t}),function(t,e){t["Chartist.plugins.ctAxisTitle"]=e()}(this,function(){return function(t,e,n){"use strict";var i={axisTitle:"",axisClass:"ct-axis-title",offset:{x:0,y:0},textAnchor:"middle",flipText:!1},r={axisX:i,axisY:i};n.plugins=n.plugins||{},n.plugins.ctAxisTitle=function(t){return t=n.extend({},r,t),function(e){e.on("created",function(e){var i,r,s;if(t.axisX.axisTitle&&e.axisX&&(i=e.axisX.axisLength/2+e.options.axisY.offset+e.options.chartPadding.left,r=e.options.chartPadding.top,"end"===e.options.axisY.position&&(i-=e.options.axisY.offset),"end"===e.options.axisX.position&&(r+=e.axisY.axisLength),s=new n.Svg("text"),s.addClass(t.axisX.axisClass),s.text(t.axisX.axisTitle),s.attr({x:i+t.axisX.offset.x,y:r+t.axisX.offset.y,"text-anchor":t.axisX.textAnchor}),e.svg.append(s,!0)),t.axisY.axisTitle&&e.axisY){i=0,r=e.axisY.axisLength/2+e.options.chartPadding.top,"start"===e.options.axisX.position&&(r+=e.options.axisX.offset),"end"===e.options.axisY.position&&(i=e.axisX.axisLength);var a="rotate("+(t.axisY.flipText?-90:90)+", "+i+", "+r+")";s=new n.Svg("text"),s.addClass(t.axisY.axisClass),s.text(t.axisY.axisTitle),s.attr({x:i+t.axisY.offset.x,y:r+t.axisY.offset.y,transform:a,"text-anchor":t.axisY.textAnchor}),e.svg.append(s,!0)}})}}}(window,document,Chartist),Chartist.plugins.ctAxisTitle}),function(t,e){t["Chartist.plugins.zoom"]=e()}(this,function(){return function(t,e,n){"use strict";function i(t){t.attr({style:"display:none"})}function r(t){t.attr({style:"display:block"})}function s(t,e){var n=t.x,i=t.y,r=e.x-n,s=e.y-i;return 0>r&&(r=-r,n=e.x),0>s&&(s=-s,i=e.y),{x:n,y:i,width:r,height:s}}function a(t,e){return o(t.clientX,t.clientY,e)}function o(t,e,n){var i="svg"===n.tagName?n:n.ownerSVGElement,r=i.getScreenCTM(),s=i.createSVGPoint();return s.x=t,s.y=e,s=s.matrixTransform(r.inverse()),s||{x:0,y:0}}function c(t,e){var n=e.bounds.max,i=e.bounds.min;if(e.scale&&"log"===e.scale.type){var r=e.scale.base;return Math.pow(r,t*u(n/i,r)/e.axisLength)*i}return t*e.bounds.range/e.axisLength+i}function u(t,e){return Math.log(t)/Math.log(e)}var l={};n.plugins=n.plugins||{},n.plugins.zoom=function(t){return t=n.extend({},l,t),function(e){function o(t){var e=a(t,w);return e.id=t.identifier,e}function u(t){for(var e=0;e1&&(y.attr(s(O[0],O[1])),r(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(y.attr(s(O[0],O[1])),r(y),t.preventDefault())}function d(t){f(t.changedTouches)}function f(t){for(var e=0;e=0&&O.splice(n,1)}}function p(t){O.length>1&&v(s(O[0],O[1])),f(t.changedTouches),i(y)}function m(t){0===t.button&&(S=a(t,w),y.attr(s(S,S)),r(y),t.preventDefault())}function g(e){if(0===e.button){var n=s(S,a(e,w));v(n),S=null,i(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(L(),e.preventDefault())}function v(t){if(t.width>5&&t.height>5){var n=t.x-A.x1,i=n+t.width,r=A.y1-t.y,s=r-t.height;e.options.axisX.highLow={low:c(n,b),high:c(i,b)},e.options.axisY.highLow={low:c(s,E),high:c(r,E)},e.update(e.data,e.options),C&&C(e,L)}}function x(t){if(S){var e=a(t,w);y.attr(s(S,e)),t.preventDefault()}}if(e instanceof n.Line){var y,w,b,E,A,S,C=t.onZoom,O=[];e.on("draw",function(t){var e=t.type;"line"!==e&&"bar"!==e&&"area"!==e&&"point"!==e||t.element.attr({"clip-path":"url(#zoom-mask)"})}),e.on("created",function(t){b=t.axisX,E=t.axisY,A=t.chartRect,w=t.svg._node,y=t.svg.elem("rect",{x:10,y:10,width:100,height:100},"ct-zoom-rect"),i(y);var e=t.svg.querySelector("defs")||t.svg.elem("defs"),n=A.width(),r=A.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:A.x1,y:A.y2,width:n,height:r,fill:"white"}),w.addEventListener("mousedown",m),w.addEventListener("mouseup",g),w.addEventListener("mousemove",x),w.addEventListener("touchstart",l),w.addEventListener("touchmove",h),w.addEventListener("touchend",p),w.addEventListener("touchcancel",d)});var L=function(){e.options.axisX.highLow=null,e.options.axisY.highLow=null,e.update(e.data,e.options)}}}}}(window,document,Chartist),Chartist.plugins.zoom}),String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(isArray(arguments[0])||isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var i=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var r=new RegExp(regexEscape(n),"g");t=t.replace(r,e[i])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),modal.init()});var wifi=function(){function t(t,n){if(200!=n)return void i(5e3);t=JSON.parse(t);var a=!bool(t.result.inProgress)&&t.result.APs.length>0;if(i(a?15e3:1e3),a){var o=$("#ap-list");$(".AP").remove(),o.toggle(a),$("#ap-loader").toggle(!a),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var n=document.createElement("div"),i=$(n).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&i.addClass("selected");var a=document.createElement("div");$(a).addClass("inner").htmlAppend('
{0}
'.format(rssiPerc(t.rssi))).htmlAppend('
{0}
'.format(e(t.essid))).htmlAppend('
{0}
'.format(s[t.enc]));i.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),n.appendChild(a),o[0].appendChild(n)}})}}function n(){$().get("/wifi/scan.cgi",t,!0,!0)}function i(t){setTimeout(n,t)}var r={},s=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){n()},r}(),wfm=function(){function t(t,e,n){var i=[];t.forEach(function(t,e){i.push({x:e,y:t})});var r=[],s=window.matchMedia("screen and (min-width: 544px)"),a=!s.matches;a||r.push(Chartist.plugins.ctAxisTitle({axisX:{axisTitle:e,offset:{x:0,y:55}},axisY:{axisTitle:n,flipText:!0,offset:{x:0,y:15}}})),new Chartist.Line("#chart",{series:[{name:"a",data:i}]},{showPoint:!1,fullWidth:!0,chartPadding:a?{right:20,bottom:5,left:0}:{right:25,bottom:30,left:25},series:{a:{lineSmooth:Chartist.Interpolation.none()}},axisX:{type:Chartist.AutoScaleAxis,onlyInteger:!0},axisY:{type:Chartist.AutoScaleAxis},plugins:r})}function e(e,n){if(200!=n)return void alert("Request failed.");var i=JSON.parse(e);return i.success?void t(i.samples,"Sample Nr.","ADC value"):void alert("Sampling failed.")}var n={};return n.init=function(){function t(){var t=$("#count").val();$().get("/api/raw.json?n="+t,e,!0,!0)}$("#load").on("click",t),$("#count").on("keyup",function(e){13==e.which&&t()})},n}(); \ No newline at end of file diff --git a/html_src/css/app.css b/html_src/css/app.css index 295bac7..43b187a 100644 --- a/html_src/css/app.css +++ b/html_src/css/app.css @@ -1 +1 @@ -*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.ct-axis-title,.ct-label{fill:hsla(0,0%,100%,.8)}.ct-label{color:hsla(0,0%,100%,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:hsla(0,0%,100%,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.center{text-align:center}html{font-family:Arial,sans-serif;color:#d0d0d0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:#fff;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:#fff;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;overflow-y:auto;padding:1rem}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem;border-radius:3px;background-color:hsla(0,0%,100%,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem .6180469716rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 #000;border-radius:6px}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#fefefe}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#fefefe}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#d04e51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#fefefe}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#fefefe}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px #000;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid hsla(0,0%,100%,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px #000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.4em;padding:3.5px;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:hsla(0,0%,100%,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:#fff}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #rssi-perc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #rssi-dbm:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em} \ No newline at end of file +*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}figure,nav{display:block}canvas,progress{display:inline-block;vertical-align:baseline}[hidden]{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b{font-weight:700}h1,h2{font-size:2em;margin:.67em 0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,pre{font-family:monospace;font-size:1em}button,input,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}legend{border:0;padding:0}textarea{overflow:auto}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}.ct-axis-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ct-axis-title,.ct-label{fill:rgba(255,255,255,.8)}.ct-label{color:rgba(255,255,255,.8);font-size:.75rem;line-height:1}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start;transform:translate(-4px) rotate(45deg)}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right;text-anchor:end;transform:translateY(20%)}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:flex}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(255,255,255,.3);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:4px;stroke-linecap:round}.ct-line{fill:none;stroke-width:2px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point{stroke:#f05b4f}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#f05b4f}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point{stroke:#6188e2}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#6188e2}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point{stroke:#59922b}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#59922b}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point{stroke:#eacf7d}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#eacf7d}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point{stroke:#a748ca}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#a748ca}.ct-wide{display:block;position:relative;width:100%}.ct-wide:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-wide:after{content:"";display:table;clear:both}.ct-wide>svg{display:block;position:absolute;top:0;left:0}.ct-narrow{display:block;position:relative;width:100%}.ct-narrow:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-narrow:after{content:"";display:table;clear:both}.ct-narrow>svg{display:block;position:absolute;top:0;left:0}.center{text-align:center}html{font-family:Arial,sans-serif;color:#D0D0D0;background:#131315}body,html{border:0 none;margin:0;padding:0;text-decoration:none;width:100%;height:100%;overflow:hidden}a,a:link,a:visited{color:#5abfff;text-decoration:none}a:hover{color:#5abfff;text-decoration:underline}#outer{display:flex;position:absolute;width:100%;height:100%;left:0;right:0;top:0;bottom:0;overflow:hidden;flex-direction:row}@media screen and (max-width:544px){#outer{display:block;overflow-y:scroll}}#menu{flex:0 0 15rem;background:#2bab5f}#menu>*{display:block;text-decoration:none;padding:.6180469716rem 1rem;white-space:nowrap;word-wrap:normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#menu #brand{color:white;background:#218248;font-size:120%;text-align:center;position:relative;margin-bottom:1rem}@media screen and (max-width:544px){#menu #brand{background:#2bab5f;cursor:pointer}#menu #brand:after{position:absolute;color:rgba(0,0,0,.2);right:1rem;content:'>';top:50%;font-size:120%;font-weight:700;transform:translateY(-50%) rotate(90deg)}}#menu.expanded #brand{background:#218248}@media screen and (max-width:544px){#menu.expanded #brand:after{transform:translateY(-50%) rotate(-90deg)}}#menu a{font-size:130%;color:white;transition:background-color .2s;text-shadow:0 0 5px rgba(0,0,0,.4)}#menu a.selected,#menu a:hover{background:#1bd886;text-shadow:0 0 5px rgba(0,0,0,.6)}#menu a.selected{position:relative;box-shadow:0 0 5px rgba(0,0,0,.5)}#menu a:before{content:"▸";padding-right:.5rem;position:relative;top:-.1rem}@media screen and (max-width:544px){#menu a{display:none}}#menu.expanded a{display:block}@media screen and (min-width:545px) and (max-width:1000px){#menu{flex-basis:10rem}#menu #brand{font-size:95%;margin-bottom:.6180469716rem}#menu a{font-size:105%}#menu>*{padding:.3819820591rem .6180469716rem}}#content{flex-grow:1;overflow-y:auto;padding:1rem}@media screen and (max-width:544px){#content{padding:.6180469716rem}}#content>*{margin-left:auto;margin-right:auto}#content h1{text-align:center;font-size:2.2806973457em;margin-top:0;margin-bottom:1rem}#content h2{font-size:1.423828125em;margin-bottom:.6180469716rem}#content td,#content th{padding:.3819820591rem}#content tbody th{text-align:right;width:130px;color:#fff}.Box{display:block;max-width:900px;margin-top:1rem;padding:.6180469716rem;border-radius:3px;background-color:rgba(255,255,255,.07)}@media screen and (max-width:544px){.Box{margin-top:.6180469716rem}}.Box h2,h1+.Box{margin-top:0}.Box.wide{width:initial;max-width:initial}.Box.medium{max-width:1200px}.Modal{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center;transition:opacity .5s;background:rgba(0,0,0,.65);opacity:0}.Modal.visible{opacity:1}.Modal.hidden{display:none}.Dialog{margin:.6180469716rem;padding:1rem .6180469716rem;overflow:hidden;max-width:100%;max-height:100%;flex:0 1 30rem;background:#1c1c1e;border-left:6px solid #217b3a;border-right:6px solid #217b3a;box-shadow:0 0 2px 0 #434349,0 0 6px 0 black;border-radius:6px}.button,button,input[type=button],input[type=reset],input[type=submit]{text-align:center;cursor:pointer;display:inline-block;border-radius:2px;padding:0 .6em;border:0 none;outline:0 none!important;line-height:1.8em;font-size:1.1em;margin-bottom:3px;min-width:5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-shadow:1.5px 1.5px 2px rgba(0,0,0,.8)}.button:active,button:active,input[type=button]:active,input[type=reset]:active,input[type=submit]:active{position:relative;top:2px}.button.narrow,button.narrow,input[type=button].narrow,input[type=reset].narrow,input[type=submit].narrow{min-width:initial}.btn-green,input[type=submit]{background-color:#2ca94b;box-shadow:0 3px 0 #1d7032;text-decoration:none!important}.btn-green,.btn-green:link,.btn-green:visited,input[type=submit],input[type=submit]:link,input[type=submit]:visited{color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:active,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:active,input[type=submit]:hover{background-color:#28ba5c;color:#FEFEFE}.btn-green.active,.btn-green.selected,.btn-green:hover,input[type=submit].active,input[type=submit].selected,input[type=submit]:hover{box-shadow:0 3px 0 #1a773b}.btn-green:active,input[type=submit]:active{box-shadow:0 1px 0 #1a773b}.btn-red,input[type=reset]{background-color:#D04E51;box-shadow:0 3px 0 #aa2d30;text-decoration:none!important}.btn-red,.btn-red:link,.btn-red:visited,input[type=reset],input[type=reset]:link,input[type=reset]:visited{color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:active,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:active,input[type=reset]:hover{background-color:#d4403f;color:#FEFEFE}.btn-red.active,.btn-red.selected,.btn-red:hover,input[type=reset].active,input[type=reset].selected,input[type=reset]:hover{box-shadow:0 3px 0 #9e2423}.btn-red:active,input[type=reset]:active{box-shadow:0 1px 0 #9e2423}input[type=number],input[type=password],input[type=text],select,textarea{border:0 none;border-bottom:2px solid #217b3a;background-color:#303030;color:#fff;padding:6px;line-height:1em;outline:0 none!important;-moz-outline:0 none!important;font-weight:400}input[type=number]:focus,input[type=number]:hover,input[type=password]:focus,input[type=password]:hover,input[type=text]:focus,input[type=text]:hover,select:focus,select:hover,textarea:focus,textarea:hover{border-bottom-color:#28bc65}input[type=number],input[type=password],input[type=text],textarea{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:text}textarea{font-family:monospace;line-height:1.2em;display:block}form{border:0 none;margin:0;padding:0;text-decoration:none}input[type=number],input[type=password],input[type=text],label.select-wrap,select,textarea{width:250px}form .Row{vertical-align:middle;margin:14px auto;text-align:left;display:flex;flex-direction:row}form .Row:first-child{margin-top:0}form .Row:last-child{margin-bottom:0}form .Row .spacer{width:130px}@media screen and (max-width:544px){form .Row .spacer{display:none}}form .Row.buttons .button,form .Row.buttons input{margin-right:.6180469716rem}form .Row.centered{justify-content:center}form .Row.message{font-size:1em;text-shadow:1px 1px 3px black;text-align:center}form .Row.message.error{color:crimson}form .Row.message.ok{color:#0fe851}form .Row.separator{padding-top:14px;border-top:2px solid rgba(255,255,255,.1)}form .Row textarea{display:inline-block;vertical-align:top;min-height:10rem;flex-grow:1;resize:vertical}form .Row label{font-weight:700;color:#fff;text-shadow:1px 1px 3px black;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}form .Row .checkbox-wrap,form .Row label{display:inline-block;width:130px;text-align:right;padding:8px;align-self:flex-start}form .Row .checkbox-wrap input[type=checkbox]{margin:auto;width:auto;height:auto}form .Row .checkbox-wrap+label{width:250px;padding-left:0;text-align:left;cursor:pointer}@media screen and (max-width:544px){form .Row{flex-direction:column}form .Row.buttons,form .Row.centered{flex-direction:row}form .Row.buttons{justify-content:center}form .Row.buttons :last-child{margin-right:0}form .Row label{padding-left:0;text-align:left;width:auto}form .Row .checkbox-wrap{order:1;text-align:left;padding-bottom:0;border-radius:.4px;width:auto}form .Row .checkbox-wrap+label{width:auto}form .Row input[type=number],form .Row input[type=password],form .Row input[type=text],form .Row textarea{width:100%}}form span.required{color:red}.RadioGroup{display:inline-block;line-height:1.5em;vertical-align:middle}.RadioGroup label{width:auto;text-align:left;cursor:pointer;font-weight:400}.RadioGroup input[type=radio]{vertical-align:middle;margin:0 0 0 5px}@media screen and (-webkit-min-device-pixel-ratio:0){select{padding-right:18px}}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;line-height:1.4em;padding:3.5px;padding-right:1em}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #fff}select option{background:#303030}label.select-wrap{position:relative;display:inline!important;margin:0!important;padding:0!important;width:auto!important}label.select-wrap:after{content:'<>';font-family:Consolas,monospace;font-weight:700;color:#28bc65;top:50%;transform:translateY(-50%) rotate(90deg);right:2px;position:absolute;z-index:100;pointer-events:none}#ap-list{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin:0 -.2360828548rem}@media screen and (min-width:545px) and (max-width:1000px){#ap-list{-webkit-column-count:2;-moz-column-count:2;column-count:2}}@media screen and (max-width:544px){#ap-list{-webkit-column-count:1;-moz-column-count:1;column-count:1}}#ap-loader{background:rgba(255,255,255,.1);border-radius:5px;padding:.3819820591rem;margin-bottom:.3819820591rem}#ap-box{padding-bottom:.3819820591rem}#psk-modal form{display:flex;align-items:center;margin:.3819820591rem}#psk-modal form>*{margin-left:.3819820591rem;margin-right:.3819820591rem}#psk-modal form>:first-child{margin-left:0}#psk-modal form>:last-child{margin-right:0}#psk-modal form input[type=password]{min-width:5rem}.AP{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid-column;max-width:500px;padding:.2360828548rem}.AP.selected .inner{background:#43de81!important;cursor:default;top:0!important}.AP .inner{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;border-radius:3px;color:#222;background:#afafaf;transition:background-color .5s;display:flex}.AP .inner:active{left:0;top:1px}.AP .inner:hover{background:white}.AP .inner>*{padding:.6180469716rem;white-space:nowrap;word-wrap:normal}.AP .inner .rssi{min-width:2rem;flex:0 0 15%;text-align:right}.AP .inner .rssi:after{padding-left:.090179415rem;content:'%';font-size:.8888888889em}.AP .inner .essid{flex:1 1 70%;min-width:0;text-overflow:ellipsis;overflow:hidden;font-weight:700}.AP .inner .auth{flex:0 0 15%}.page-home #rssi-perc:after{padding-left:.1459102934rem;content:'%';font-size:.8888888889em}.page-home #rssi-dbm:after{padding-left:.1459102934rem;content:'dBm';font-size:.8888888889em} \ No newline at end of file diff --git a/html_src/css/app.css.map b/html_src/css/app.css.map index aa6f630..52912ed 100644 --- a/html_src/css/app.css.map +++ b/html_src/css/app.css.map @@ -1 +1 @@ -{"version":3,"sources":["app.css","_normalize.scss","lib/chartist/_chartist.scss","lib/chartist/_chartist-settings.scss","lib/neat/grid/_box-sizing.scss","app.scss","layout/_base.scss","utils/_misc.scss","layout/_outer-wrap.scss","lib/neat/grid/_media.scss","layout/_menu.scss","utils/_pointer.scss","lib/bourbon/functions/_modular-scale.scss","layout/_content.scss","layout/_box.scss","layout/_modal.scss","form/_buttons.scss","form/_fancy_button_mixins.scss","form/_form_elements.scss","form/_select.scss","lib/bourbon/addons/_prefixer.scss","form/_form_layout.scss","pages/_wifi.scss","pages/_home.scss"],"names":[],"mappings":"AAAA,iBAAiB;ACAjB,2EAA2E;AAE3E;;;;GAIG;AAEH;EACC,uBAAuB,EACvB;;AAGD;EACE,wBAAwB;EAAE,OAAO;EACjC,2BAA2B;EAAE,OAAO;EACpC,+BAA+B;EAAE,OAAO,EACzC;;AAED;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;gFACgF;AAEhF;;;;;GAKG;AAMH;;EAUE,eAAe,EAChB;;AAED;;;GAGG;AAGH;;EAIE,sBAAsB;EAAE,OAAO;EAC/B,yBAAyB;EAAE,OAAO,EACnC;;AAED;;;GAGG;AAOH;;;GAGG;AD1BH;EC+BE,cAAc,EACf;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,8BAA8B,EAC/B;;AAED;;;GAGG;AAEH;;EAEE,WAAW,EACZ;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EAGE,kBAAkB,EACnB;;AAED;;GAEG;AAMH;;;GAGG;AAEH;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;;GAEG;AAOH;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAEE,eAAe;EACf,eAAe;EACf,mBAAmB;EACnB,yBAAyB,EAC1B;;AAED;EACE,YAAY,EACb;;AAED;EACE,gBAAgB,EACjB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,iBAAiB,EAClB;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EACE,wBAAwB;EACxB,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAKE,uBAAuB;EACvB,eAAe,EAChB;;AAED;gFACgF;AAEhF;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;EAKE,eAAe;EAAE,OAAO;EACxB,cAAc;EAAE,OAAO;EACvB,UAAU;EAAE,OAAO,EACpB;;AAED;;GAEG;AAEH;EACE,kBAAkB,EACnB;;AAED;;;;;GAKG;AAEH;;EAEE,qBAAqB,EACtB;;AAED;;;;;;GAMG;AAEH;;;EAIE,2BAA2B;EAAE,OAAO;EACpC,gBAAgB;EAAE,OAAO,EAC1B;;AAED;;GAEG;AAEH;;EAEE,gBAAgB,EACjB;;AAED;;GAEG;AAEH;;EAEE,UAAU;EACV,WAAW,EACZ;;AAED;;;GAGG;AAEH;EACE,oBAAoB,EACrB;;AAED;;;;;;GAMG;AAEH;;EAEE,uBAAuB;EAAE,OAAO;EAChC,WAAW;EAAE,OAAO,EACrB;;AAED;;;;GAIG;AAOH;;;GAGG;AAOH;;;;GAIG;AAOH;;GAEG;AAQH;;;GAGG;AAEH;EACE,UAAU;EAAE,OAAO;EACnB,WAAW;EAAE,OAAO,EACrB;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;;GAGG;AAMH;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;EAC1B,kBAAkB,EACnB;;AAED;;EAEE,WAAW,EACZ;;AClUA;EACC,+BCnG8B,EDoG9B;;AAGD;EA5EA,+BCjCyB;EDkCzB,gCClCyB;EDmCzB,mBClCqB;EDmCrB,eChCsB,EDoIrB;EA3BD;IA1FA,sBA8FoC;IA7FpC,4BA6FgD;IAzF/C,iBAAiB;IA0FhB,mBAAmB,EACnB;EANF;IA1FA,wBAmGsC;IAlGtC,4BAkGkD;IA9FjD,iBAAiB;IA+FhB,mBAAmB;IAGnB,6CAAqC,EACrC;EAdF;IA1FA,sBA2GoC;IA1GpC,0BA0G8C;IApG7C,kBAAkB;IAqGjB,iBAAiB;IAEjB,6BAAoB,EACpB;EArBF;IA1FA,sBAkHoC;IAjHpC,4BAiHgD;IA7G/C,iBAAiB;IA8GhB,mBAAmB,EACnB;;AAGF;;EAEC,cAAc,EACd;;AAID;EA9HA,sBAgIoC;EA/HpC,wBA+H4C;EAvH3C,mBAAmB;EAwHlB,mBAAmB,EACnB;;AAJF;EA9HA,wBAqIsC;EApItC,wBAoI8C;EA5H7C,mBAAmB;EA6HlB,mBAAmB,EACnB;;AATF;EA9HA,sBA2IqC;EA1IrC,4BA0IiD;EAtIhD,iBAAiB;EAuIf,mBAAmB,EACnB;;AAfH;EA9HA,wBAgJuC;EA/IvC,4BA+ImD;EA3IlD,iBAAiB;EA4If,mBAAmB,EACnB;;AApBH;EA9HA,oBAsJmC;EArJnC,0BAqJ6C;EA/I5C,kBAAkB;EAgJhB,iBAAiB,EACjB;;AA1BH;EA9HA,oBA2JmC;EA1JnC,4BA0J+C;EAtJ9C,iBAAiB;EAuJf,iBAAiB,EACjB;;AAIH;EA5IA,iCC/ByB;EDgCzB,kBC9BkB;EDiCjB,sBClCqB,ED4KrB;;AAED;EAvIA,kBCjCkB;EDkClB,sBChCqB,EDwKpB;;AAED;EAtIA,WAAW;EACX,kBCzCkB,EDgLjB;;AAED;EAjIA,aAAa;EACb,kBC5CoB,ED8KnB;;AAED;EAhIA,WAAW;EACX,mBC9CkB,ED+KjB;;AAQC;EA9HD,gBCtCO,EDuCP;;AA6HC;EA1HD,cC1CO,ED2CP;;AAyHC;EA9HD,gBCrCO,EDsCP;;AA6HC;EA1HD,cCzCO,ED0CP;;AAyHC;EA9HD,gBCpCO,EDqCP;;AA6HC;EA1HD,cCxCO,EDyCP;;AAyHC;EA9HD,gBCnCO,EDoCP;;AA6HC;EA1HD,cCvCO,EDwCP;;AAyHC;EA9HD,gBClCO,EDmCP;;AA6HC;EA1HD,cCtCO,EDuCP;;AAsIC;EApOF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAuO3C;EAFD;IA/ND,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,uBAAsB,EACtB;EAyNC;IAtND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EAmNC;IAhND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AA4MC;EApOF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAuO3C;EAFD;IA/ND,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,+BAAsB,EACtB;EAyNC;IAtND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EAmNC;IAhND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AExBA;EACE,uBAAuB,EACxB;;AAED;EAII,oBAAoB,EACrB;;ACeL;EACC,mBAAmB,EACnB;;AC7BD;EACC,+BAA+B;EAC/B,eAAe;EACf,oBAAoB,EACpB;;AAED;ECaC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB;EDdtB,YAAY;EACZ,aAAa;EACb,iBAAiB,EACjB;;AAED;EACC,eAAe;EACf,sBAAsB,EACtB;;AAED;EACC,eAAe;EACf,2BAA2B,EAC3B;;AErBD,0BAA0B;AAC1B;EACC,cAAc;EAEd,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,SAAS;EACT,OAAO;EACP,UAAU;EACV,iBAAiB;EAEjB,oBAAoB,EACpB;;ACwEG;EDrEH;IACC,eAAe;IACf,mBAAmB,EACnB,EAAA;;AEpBF;EAGC,gBAAgB;EAChB,oBAHiB,EA4FjB;EA7FD;IAOE,eAAe;IACf,sBAAsB;IACtB,8BLW6B;IEW9B,oBAAoB;IACpB,kBAAkB;IIxBlB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EDCjB;EAbF;IAgBE,aAAa;IACb,oBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAkB;IAElB,oBLF6B,EKmB7B;ID+CE;MCtFJ;QAyBG,oBAxBe;QAyBf,gBAAgB,EAajB;QAvCF;UA6BI,mBAAmB;UACnB,0BAAiB;UACjB,YLX2B;UKY3B,aAAa;UACb,SAAQ;UACR,gBAAgB;UAChB,kBAAkB;UAClB,4CAAmC,EACnC,EAAA;EArCJ;IAyCE,oBAAkB,EAKlB;IDwCE;MCtFJ;QA4Ca,6CAAmC,EAAW,EAAA;EA5C3D;IAkDE,gBAAgB;IAChB,aAAa;IAGb,kCAAkC;IAClC,wCAA+B,EAsB/B;IA7EF;MA0DG,oBALW;MAMX,wCAA+B,EAC/B;IA5DH;MA+DG,mBAAmB;MACnB,uCAA8B,EAC9B;IAjEH;MAoEG,aAAS;MACT,qBAAqB;MACrB,mBAAmB;MACnB,aAAa,EACb;IDcC;MCtFJ;QA2EG,cAAc,EAEf,EAAA;EA7EF;IA+EgB,eAAe,EAAE;EDO7B;ICtFJ;MAyFE,kBAAkB,EAInB;MA7FD;QAmFG,eAAe;QACf,+BEvBc,EFwBd;MArFH;QAuFM,gBAAgB,EAAI;MAvF1B;QA2FU,yCE9BO,EF8BuB,EAAA;;AG3FxC;EACC,aAAa;EAEb,iBAAiB;EACjB,cRgB8B,EQe9B;EJmDG;IItFJ;MAME,yBDuDe,EC1BhB,EAAA;EAnCD;IAUE,kBAAkB;IAClB,mBAAmB,EACnB;EAZF;IAeE,mBAAmB;IACnB,0BD4Be;IC3Bf,cAAc;IACd,oBRE6B,EQD7B;EAnBF;IAsBE,yBDsBe;ICrBf,+BDsCe,ECrCf;EAxBF;IA2BE,yBDkCe,ECjCf;EA5BF;IA+BE,kBAAkB;IAClB,aRvBkB;IQwBlB,aRpBqB,EQqBrB;;AClCF;EACC,eAAe;EACf,iBAAiB;EAEjB,iBTgB8B;ESf9B,yBFwDgB;EE1ChB,mBAAmB;EACnB,4CAA4B,EAU5B;ELwDG;IKtFJ;MAQE,4BFqDe,EE/BhB,EAAA;EAnBA;IACC,cAAc,EACd;EAbF;IAgBE,cAAc,EACd;EAjBF;IAuBE,eAAe;IACf,mBAAmB,EACnB;EAzBF;IA4BE,kBAAkB,EAClB;;AC7BF;EACC,gBAAgB;EAChB,YAAY;EAAE,aAAa;EAC3B,QAAQ;EAAE,OAAO;EAAE,SAAS;EAAE,UAAU;EAExC,cAAc;EACd,wBAAwB;EACxB,oBAAoB;EAEpB,wBAAwB;EACxB,gCAAsB;EACtB,WAAW,EAGX;EAdD;IAYa,WAAY,EAAE;EAZ3B;IAaY,cAAe,EAAE;;AAG7B;EACC,wBH4CgB;EG3ChB,8BH2CgB;EG1ChB,iBAAiB;EAEjB,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;EAGhB,oBAAoB;EACpB,+BVXyB;EUYzB,gCVZyB;EUazB,+CAA+C;EAE/C,mBAAmB,EACnB;;AC9BD;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;ENLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EKNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AAjGF;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;ENLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EKNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AEjGF;EACC,eAAe;EACf,iCbYyB;EaXzB,0BbSwB;EaRxB,abSsB;EaRtB,aAAa;EACb,iBAAiB;EACjB,2BAA2B;EAC3B,gCAAgC;EAChC,oBAAoB,EAKpB;EAdD;IAYE,6BbG0B,EaF1B;;AAGF;EPAC,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EAElB,aAAa,EOJb;;AAED;EACC,uBAAuB;EACvB,mBAAmB;EACnB,eAAe,EACf;;ACxBD;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EAEf,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdLqB,EcMrB;EAfF;IAkBE,oBdVuB,EcWvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edtB0B;IcwB1B,SAAS;ICUH,4CDTsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AEjDF;EdkBC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB,EcrBI;;AAE3B;EACC,ahBOmB,EgBNnB;;AAED;EACC,uBAAuB;EACvB,kBAAkB;EAClB,iBAAiB;EAEjB,cAAc;EACd,oBAAoB,EAoIpB;EA1ID;IASE,cAAc,EACd;EAVF;IAaE,iBAAiB,EACjB;EAdF;IAiBE,ahBfkB,EgBoBlB;IZyDE;MY/EJ;QAoBG,cAAc,EAEf,EAAA;EAtBF;IA0BG,8BT4Bc,ES3Bd;EA3BH;IA+BE,wBAAwB,EACxB;EAhCF;IAmCE,eAAe;IAEf,+BAA+B;IAC/B,mBAAmB,EASnB;IA/CF;MAyCG,eAAe,EACf;IA1CH;MA6CG,eAAe,EACf;EA9CH;IAkDE,kBAAkB;IAClB,+CAA0B,EAC1B;EApDF;IAuDE,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IAEb,iBAAiB,EACjB;EA7DF;IAgEE,kBAAkB;IAClB,ahB3DqB;IgB4DrB,sBAAsB;IACtB,ahBjEkB;IgBkElB,kBAAkB;IAClB,+BAA+B;IAE/B,ahBpEkB;IgBqElB,uBAAuB;IVvExB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EUsEjB;EA3EF;IA8EE,sBAAsB;IACtB,ahB7EkB;IgB8ElB,ahB7EkB;IgB8ElB,kBAAkB;IAClB,uBAAuB,EAcvB;IAhGF;MAqFG,aAAa;MACb,YAAY;MACZ,aAAa,EACb;IAxFH;MA2FG,ahBvFiB;MgBwFjB,gBAAgB;MAChB,iBAAiB;MACjB,gBAAgB,EAChB;EZhBC;IY/EJ;MAoGE,uBAAuB,EAsCxB;MA1ID;QAuGG,oBAAoB,EACpB;MAxGH;QA2GG,wBAAwB,EAMxB;QAjHH;UA+GI,gBAAe,EACf;MAhHJ;QAoHG,gBAAgB;QAChB,iBAAiB;QACjB,YAAY,EACZ;MAvHH;QA0HG,SAAS;QACT,iBAAiB;QACjB,kBAAkB;QAElB,oBAAoB;QACpB,YAAY,EAKZ;QApIH;UAkII,YAAY,EACZ;MAnIJ;QAuIG,YAAY,EACZ,EAAA;;AAKH;EACC,WAAW,EACX;;AAED;EACC,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB,EAavB;EAhBD;IAME,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB,EACpB;EAVF;IAaE,uBAAuB;IACvB,kBAAkB,EAClB;;AFrKF;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EAEf,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBdLqB,EcMrB;EAfF;IAkBE,oBdVuB,EcWvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,edtB0B;IcwB1B,SAAS;ICUH,4CDTsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AGlDF;EACC,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;EAChB,sBAAc;EAAd,mBAAc;EAAd,cAAc;EAUd,2BViDgB,EUhDhB;EbyEG;IatFJ;MAKE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAQjB,EAAA;EbyEG;IatFJ;MASE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAIjB,EAAA;;AAED;EACC,qCAAsB;EACtB,mBAAmB;EACnB,yBV2CgB;EU1ChB,+BV0CgB,EUzChB;;AAED;EACC,gCVsCgB,EUrChB;;AAGD;EACC,cAAc;EACd,oBAAoB;EACpB,wBV+BgB,EUnBhB;EAfD;IAME,6BV4Be;IU3Bf,8BV2Be,EUxBf;IAVF;MAQkB,eAAgB,EAAE;IARpC;MASiB,gBAAiB,EAAE;EATpC;IAaE,gBAAgB,EAChB;;AAGF;EAGC,mCAA2B;EAA3B,yBAA2B;EAA3B,2BAA2B;EAC3B,iBAAiB;EACjB,yBVYgB,EU6ChB;EA9DD;IAQE,+BAA+B;IAC/B,gBAAgB;IAChB,kBAAkB,EAClB;EAXF;IAeE,gBAAgB;IXnDjB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB;IWkDjB,mBAAmB;IAMnB,mBAAmB;IACnB,YAAY;IAEZ,oBAAoB;IACpB,kCAAkC;IAGlC,cAAc,EA8Bd;IA7DF;MAoBG,QAAQ;MACR,SAAS,EACT;IAtBH;MA6BY,kBAAmB,EAAE;IA7BjC;MAkCG,yBVjBc;ML9BhB,oBAAoB;MACpB,kBAAkB,EegDhB;IApCH;MAuCG,gBAAgB;MAChB,cAAc;MACd,kBAAkB,EAOlB;MAhDH;QA4CI,6BV3Ba;QU4Bb,aAAa;QACb,0BV7Ba,EU8Bb;IA/CJ;MAmDG,cAAc;MACd,aAAa;MACb,wBAAwB;MACxB,iBAAiB;MACjB,kBAAkB,EAClB;IAxDH;MA2DG,cAAc,EACd;;ACxGH;EACC,8BX4DgB;EW3DhB,aAAa;EACb,0BX0DgB,EWzDhB;;AAED;EACC,8BXsDgB;EWrDhB,eAAe;EACf,0BXoDgB,EWnDhB","file":"app.css","sourcesContent":["@charset \"UTF-8\";\n/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n*, *:before, *:after {\n box-sizing: border-box; }\n\nhtml {\n font-family: sans-serif;\n /* 1 */\n -ms-text-size-adjust: 100%;\n /* 2 */\n -webkit-text-size-adjust: 100%;\n /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n margin: 0; }\n\n/* HTML5 display definitions\n ========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\nfigure,\nnav {\n display: block; }\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\ncanvas,\nprogress {\n display: inline-block;\n /* 1 */\n vertical-align: baseline;\n /* 2 */ }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n[hidden] {\n display: none; }\n\n/* Links\n ========================================================================== */\n/**\n * Remove the gray background color from active links in IE 10.\n */\na {\n background-color: transparent; }\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\na:active,\na:hover {\n outline: 0; }\n\n/* Text-level semantics\n ========================================================================== */\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\nb {\n font-weight: bold; }\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0; }\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0; }\n\n/**\n * Address styling not present in IE 8/9.\n */\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline; }\n\nsup {\n top: -0.5em; }\n\nsub {\n bottom: -0.25em; }\n\n/* Embedded content\n ========================================================================== */\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\nimg {\n border: 0; }\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\nsvg:not(:root) {\n overflow: hidden; }\n\n/* Grouping content\n ========================================================================== */\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n box-sizing: content-box;\n height: 0; }\n\n/**\n * Contain overflow in all browsers.\n */\npre {\n overflow: auto; }\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\ncode,\npre {\n font-family: monospace;\n font-size: 1em; }\n\n/* Forms\n ========================================================================== */\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\nbutton,\ninput,\nselect,\ntextarea {\n color: inherit;\n /* 1 */\n font: inherit;\n /* 2 */\n margin: 0;\n /* 3 */ }\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\nbutton {\n overflow: visible; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\nbutton,\nselect {\n text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\nbutton,\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n /* 2 */\n cursor: pointer;\n /* 3 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled],\nhtml input[disabled] {\n cursor: default; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0; }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\ninput {\n line-height: normal; }\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n/**\n * Define consistent border, margin, and padding.\n */\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n border: 0;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\ntextarea {\n overflow: auto; }\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n/* Tables\n ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n border-collapse: collapse;\n border-spacing: 0; }\n\ntd,\nth {\n padding: 0; }\n\n.ct-axis-title {\n fill: rgba(255, 255, 255, 0.8); }\n\n.ct-label {\n fill: rgba(255, 255, 255, 0.8);\n color: rgba(255, 255, 255, 0.8);\n font-size: 0.75rem;\n line-height: 1; }\n .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start;\n transform: translate(-4px, 0%) rotate(45deg); }\n .ct-label.ct-vertical.ct-start {\n align-items: flex-end;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end;\n transform: translate(0, 20%); }\n .ct-label.ct-vertical.ct-end {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-line .ct-label,\n.ct-chart-bar .ct-label {\n display: flex; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {\n align-items: center;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {\n align-items: center;\n justify-content: flex-start;\n text-align: left;\n text-anchor: end; }\n\n.ct-grid {\n stroke: rgba(255, 255, 255, 0.3);\n stroke-width: 1px;\n stroke-dasharray: 2px; }\n\n.ct-point {\n stroke-width: 4px;\n stroke-linecap: round; }\n\n.ct-line {\n fill: none;\n stroke-width: 2px; }\n\n.ct-area {\n stroke: none;\n fill-opacity: 0.1; }\n\n.ct-bar {\n fill: none;\n stroke-width: 10px; }\n\n.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar {\n stroke: #f05b4f; }\n\n.ct-series-a .ct-slice-pie, .ct-series-a .ct-area {\n fill: #f05b4f; }\n\n.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar {\n stroke: #6188e2; }\n\n.ct-series-b .ct-slice-pie, .ct-series-b .ct-area {\n fill: #6188e2; }\n\n.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar {\n stroke: #59922b; }\n\n.ct-series-c .ct-slice-pie, .ct-series-c .ct-area {\n fill: #59922b; }\n\n.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar {\n stroke: #eacf7d; }\n\n.ct-series-d .ct-slice-pie, .ct-series-d .ct-area {\n fill: #eacf7d; }\n\n.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar {\n stroke: #a748ca; }\n\n.ct-series-e .ct-slice-pie, .ct-series-e .ct-area {\n fill: #a748ca; }\n\n.ct-wide {\n display: block;\n position: relative;\n width: 100%; }\n .ct-wide:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 56.25%; }\n .ct-wide:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-wide > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.ct-narrow {\n display: block;\n position: relative;\n width: 100%; }\n .ct-narrow:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 66.6666666667%; }\n .ct-narrow:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-narrow > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\nhtml {\n box-sizing: border-box; }\n\n*, *::after, *::before {\n box-sizing: inherit; }\n\n.center {\n text-align: center; }\n\nhtml {\n font-family: Arial, sans-serif;\n color: #D0D0D0;\n background: #131315; }\n\nhtml, body {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n\na, a:visited, a:link {\n color: #5abfff;\n text-decoration: none; }\n\na:hover {\n color: #5abfff;\n text-decoration: underline; }\n\n/* Main outer container */\n#outer {\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n flex-direction: row; }\n\n@media screen and (max-width: 544px) {\n #outer {\n display: block;\n overflow-y: scroll; } }\n\n#menu {\n flex: 0 0 15rem;\n background: #2bab5f; }\n #menu > * {\n display: block;\n text-decoration: none;\n padding: 0.6180469716rem 1rem;\n white-space: nowrap;\n word-wrap: normal;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #menu #brand {\n color: white;\n background: #218248;\n font-size: 120%;\n text-align: center;\n position: relative;\n margin-bottom: 1rem; }\n @media screen and (max-width: 544px) {\n #menu #brand {\n background: #2bab5f;\n cursor: pointer; }\n #menu #brand:after {\n position: absolute;\n color: rgba(0, 0, 0, 0.2);\n right: 1rem;\n content: '>';\n top: 50%;\n font-size: 120%;\n font-weight: bold;\n transform: translate(0, -50%) rotate(90deg); } }\n #menu.expanded #brand {\n background: #218248; }\n @media screen and (max-width: 544px) {\n #menu.expanded #brand:after {\n transform: translate(0, -50%) rotate(-90deg); } }\n #menu a {\n font-size: 130%;\n color: white;\n transition: background-color 0.2s;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); }\n #menu a:hover, #menu a.selected {\n background: #1bd886;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }\n #menu a.selected {\n position: relative;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); }\n #menu a:before {\n content: \"▸\";\n padding-right: .5rem;\n position: relative;\n top: -0.1rem; }\n @media screen and (max-width: 544px) {\n #menu a {\n display: none; } }\n #menu.expanded a {\n display: block; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #menu {\n flex-basis: 10rem; }\n #menu #brand {\n font-size: 95%;\n margin-bottom: 0.6180469716rem; }\n #menu a {\n font-size: 105%; }\n #menu > * {\n padding: 0.3819820591rem 0.6180469716rem; } }\n\n#content {\n flex-grow: 1;\n overflow-y: auto;\n padding: 1rem; }\n @media screen and (max-width: 544px) {\n #content {\n padding: 0.6180469716rem; } }\n #content > * {\n margin-left: auto;\n margin-right: auto; }\n #content h1 {\n text-align: center;\n font-size: 2.2806973457em;\n margin-top: 0;\n margin-bottom: 1rem; }\n #content h2 {\n font-size: 1.423828125em;\n margin-bottom: 0.6180469716rem; }\n #content td, #content th {\n padding: 0.3819820591rem; }\n #content tbody th {\n text-align: right;\n width: 130px;\n color: white; }\n\n.Box {\n display: block;\n max-width: 900px;\n margin-top: 1rem;\n padding: 0.6180469716rem;\n border-radius: 3px;\n background-color: rgba(255, 255, 255, 0.07); }\n @media screen and (max-width: 544px) {\n .Box {\n margin-top: 0.6180469716rem; } }\n h1 + .Box {\n margin-top: 0; }\n .Box h2 {\n margin-top: 0; }\n .Box.wide {\n width: initial;\n max-width: initial; }\n .Box.medium {\n max-width: 1200px; }\n\n.Modal {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: opacity .5s;\n background: rgba(0, 0, 0, 0.65);\n opacity: 0; }\n .Modal.visible {\n opacity: 1; }\n .Modal.hidden {\n display: none; }\n\n.Dialog {\n margin: 0.6180469716rem;\n padding: 1rem 0.6180469716rem;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n flex: 0 1 30rem;\n background: #1c1c1e;\n border-left: 6px solid #217b3a;\n border-right: 6px solid #217b3a;\n box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n border-radius: 6px; }\n\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select {\n border: 0 none;\n border-bottom: 2px solid #217b3a;\n background-color: #303030;\n color: white;\n padding: 6px;\n line-height: 1em;\n outline: 0 none !important;\n -moz-outline: 0 none !important;\n font-weight: normal; }\n input[type=\"number\"]:focus, input[type=\"number\"]:hover, input[type=\"password\"]:focus, input[type=\"password\"]:hover, input[type=\"text\"]:focus, input[type=\"text\"]:hover, textarea:focus, textarea:hover, select:focus, select:hover {\n border-bottom-color: #28bc65; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea {\n -webkit-user-select: text;\n -khtml-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: text; }\n\ntextarea {\n font-family: monospace;\n line-height: 1.2em;\n display: block; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.4em;\n padding: 3.5px;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\nform {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select, label.select-wrap {\n width: 250px; }\n\nform .Row {\n vertical-align: middle;\n margin: 14px auto;\n text-align: left;\n display: flex;\n flex-direction: row; }\n form .Row:first-child {\n margin-top: 0; }\n form .Row:last-child {\n margin-bottom: 0; }\n form .Row .spacer {\n width: 130px; }\n @media screen and (max-width: 544px) {\n form .Row .spacer {\n display: none; } }\n form .Row.buttons input, form .Row.buttons .button {\n margin-right: 0.6180469716rem; }\n form .Row.centered {\n justify-content: center; }\n form .Row.message {\n font-size: 1em;\n text-shadow: 1px 1px 3px black;\n text-align: center; }\n form .Row.message.error {\n color: crimson; }\n form .Row.message.ok {\n color: #0fe851; }\n form .Row.separator {\n padding-top: 14px;\n border-top: 2px solid rgba(255, 255, 255, 0.1); }\n form .Row textarea {\n display: inline-block;\n vertical-align: top;\n min-height: 10rem;\n flex-grow: 1;\n resize: vertical; }\n form .Row label {\n font-weight: bold;\n color: white;\n display: inline-block;\n width: 130px;\n text-align: right;\n text-shadow: 1px 1px 3px black;\n padding: 8px;\n align-self: flex-start;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n form .Row .checkbox-wrap {\n display: inline-block;\n width: 130px;\n padding: 8px;\n text-align: right;\n align-self: flex-start; }\n form .Row .checkbox-wrap input[type=checkbox] {\n margin: auto;\n width: auto;\n height: auto; }\n form .Row .checkbox-wrap + label {\n width: 250px;\n padding-left: 0;\n text-align: left;\n cursor: pointer; }\n @media screen and (max-width: 544px) {\n form .Row {\n flex-direction: column; }\n form .Row.buttons, form .Row.centered {\n flex-direction: row; }\n form .Row.buttons {\n justify-content: center; }\n form .Row.buttons :last-child {\n margin-right: 0; }\n form .Row label {\n padding-left: 0;\n text-align: left;\n width: auto; }\n form .Row .checkbox-wrap {\n order: 1;\n text-align: left;\n padding-bottom: 0;\n border-radius: .4px;\n width: auto; }\n form .Row .checkbox-wrap + label {\n width: auto; }\n form .Row input[type=\"number\"], form .Row input[type=\"password\"], form .Row input[type=\"text\"], form .Row textarea, form .Row textarea {\n width: 100%; } }\n\nform span.required {\n color: red; }\n\n.RadioGroup {\n display: inline-block;\n line-height: 1.5em;\n vertical-align: middle; }\n .RadioGroup label {\n width: auto;\n text-align: left;\n cursor: pointer;\n font-weight: normal; }\n .RadioGroup input[type=\"radio\"] {\n vertical-align: middle;\n margin: 0 0 0 5px; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.4em;\n padding: 3.5px;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\n#ap-list {\n column-count: 3;\n column-gap: 0;\n margin: 0 -0.2360828548rem; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #ap-list {\n column-count: 2; } }\n @media screen and (max-width: 544px) {\n #ap-list {\n column-count: 1; } }\n\n#ap-loader {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 5px;\n padding: 0.3819820591rem;\n margin-bottom: 0.3819820591rem; }\n\n#ap-box {\n padding-bottom: 0.3819820591rem; }\n\n#psk-modal form {\n display: flex;\n align-items: center;\n margin: 0.3819820591rem; }\n #psk-modal form > * {\n margin-left: 0.3819820591rem;\n margin-right: 0.3819820591rem; }\n #psk-modal form > *:first-child {\n margin-left: 0; }\n #psk-modal form > *:last-child {\n margin-right: 0; }\n #psk-modal form input[type=password] {\n min-width: 5rem; }\n\n.AP {\n break-inside: avoid-column;\n max-width: 500px;\n padding: 0.2360828548rem; }\n .AP.selected .inner {\n background: #43de81 !important;\n cursor: default;\n top: 0 !important; }\n .AP .inner {\n cursor: pointer;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n border-radius: 3px;\n color: #222;\n background: #afafaf;\n transition: background-color 0.5s;\n display: flex; }\n .AP .inner:active {\n left: 0;\n top: 1px; }\n .AP .inner:hover {\n background: white; }\n .AP .inner > * {\n padding: 0.6180469716rem;\n white-space: nowrap;\n word-wrap: normal; }\n .AP .inner .rssi {\n min-width: 2rem;\n flex: 0 0 15%;\n text-align: right; }\n .AP .inner .rssi:after {\n padding-left: 0.090179415rem;\n content: '%';\n font-size: 0.8888888889em; }\n .AP .inner .essid {\n flex: 1 1 70%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: bold; }\n .AP .inner .auth {\n flex: 0 0 15%; }\n\n.page-home #rssi-perc:after {\n padding-left: 0.1459102934rem;\n content: '%';\n font-size: 0.8888888889em; }\n\n.page-home #rssi-dbm:after {\n padding-left: 0.1459102934rem;\n content: 'dBm';\n font-size: 0.8888888889em; }\n","/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n\n*, *:before, *:after {\n\tbox-sizing: border-box;\n}\n\n\nhtml {\n font-family: sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n margin: 0;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\n\n//article,\n//aside,\n//details,\n//figcaption,\nfigure,\n//footer,\n//header,\n//hgroup,\n//main,\n//menu,\nnav\n//section,\n//summary\n{\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\n//audio,\ncanvas,\nprogress\n//video\n{\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n//\n//audio:not([controls]) {\n// display: none;\n// height: 0;\n//}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n\n[hidden]\n//template\n{\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\n\na:active,\na:hover {\n outline: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n\n//abbr[title] {\n// border-bottom: 1px dotted;\n//}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n\nb\n//strong\n{\n font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n//\n//dfn {\n// font-style: italic;\n//}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n//\n//mark {\n// background: #ff0;\n// color: #000;\n//}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\n\nimg {\n border: 0;\n}\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n\n//figure {\n// margin: 1em 40px;\n//}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\n//kbd,\npre\n//samp\n{\n font-family: monospace;\n font-size: 1em;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\n\nbutton,\ninput,\n//optgroup,\nselect,\ntextarea {\n color: inherit; /* 1 */\n font: inherit; /* 2 */\n margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\n\nbutton {\n overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n\nbutton,\n//html input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\n//input[type=\"number\"]::-webkit-inner-spin-button,\n//input[type=\"number\"]::-webkit-outer-spin-button {\n// height: auto;\n//}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n//\n//input[type=\"search\"] {\n// -webkit-appearance: textfield; /* 1 */\n// box-sizing: content-box; /* 2 */\n//}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n//\n//input[type=\"search\"]::-webkit-search-cancel-button,\n//input[type=\"search\"]::-webkit-search-decoration {\n// -webkit-appearance: none;\n//}\n\n/**\n * Define consistent border, margin, and padding.\n */\n//\n//fieldset {\n// border: 1px solid #c0c0c0;\n// margin: 0 2px;\n// padding: 0.35em 0.625em 0.75em;\n//}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n border: 0; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n//\n//optgroup {\n// font-weight: bold;\n//}\n\n/* Tables\n ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","@import \"chartist-settings\";\n\n@mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {\n\tdisplay: block;\n\tposition: relative;\n\twidth: $width;\n\n\t&:before {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tpadding-bottom: $ratio * 100%;\n\t}\n\n\t&:after {\n\t\tcontent: \"\";\n\t\tdisplay: table;\n\t\tclear: both;\n\t}\n\n\t> svg {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n\n@mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {\n\talign-items: $ct-text-align;\n\tjustify-content: $ct-text-justify;\n\n\t// Fallback to text-align for non-flex browsers\n\t@if ($ct-text-justify == 'flex-start') {\n\t\ttext-align: left;\n\t} @else if ($ct-text-justify == 'flex-end') {\n\t\ttext-align: right;\n\t} @else {\n\t\ttext-align: center;\n\t}\n}\n\n@mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {\n\tfill: $ct-text-color;\n\tcolor: $ct-text-color;\n\tfont-size: $ct-text-size;\n\tline-height: $ct-text-line-height;\n}\n\n@mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {\n\tstroke: $ct-grid-color;\n\tstroke-width: $ct-grid-width;\n\n\t@if ($ct-grid-dasharray) {\n\t\tstroke-dasharray: $ct-grid-dasharray;\n\t}\n}\n\n@mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {\n\tstroke-width: $ct-point-size;\n\tstroke-linecap: $ct-point-shape;\n}\n\n@mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {\n\tfill: none;\n\tstroke-width: $ct-line-width;\n\n\t@if ($ct-line-dasharray) {\n\t\tstroke-dasharray: $ct-line-dasharray;\n\t}\n}\n\n@mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {\n\tstroke: none;\n\tfill-opacity: $ct-area-opacity;\n}\n\n@mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {\n\tfill: none;\n\tstroke-width: $ct-bar-width;\n}\n\n//@mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {\n// fill: none;\n// stroke-width: $ct-donut-width;\n//}\n\n@mixin ct-chart-series-color($color) {\n\t.ct-point, .ct-line, .ct-bar /*, .ct-slice-donut*/\n\t{\n\t\tstroke: $color;\n\t}\n\n\t.ct-slice-pie, .ct-area {\n\t\tfill: $color;\n\t}\n}\n\n@mixin ct-chart(\n\t$ct-container-ratio: $ct-container-ratio,\n\t$ct-text-color: $ct-text-color,\n\t$ct-text-size: $ct-text-size,\n\t$ct-grid-color: $ct-grid-color,\n\t$ct-grid-width: $ct-grid-width,\n\t$ct-grid-dasharray: $ct-grid-dasharray,\n\t$ct-point-size: $ct-point-size,\n\t$ct-point-shape: $ct-point-shape,\n\t$ct-line-width: $ct-line-width,\n\t$ct-bar-width: $ct-bar-width,\n\t//$ct-donut-width: $ct-donut-width,\n\t$ct-series-names: $ct-series-names,\n\t$ct-series-colors: $ct-series-colors) {\n\n\n\t.ct-axis-title {\n\t\tfill: $ct-axis-label-color;\n\t}\n\n\t// --- Label ---\n\t.ct-label {\n\t\t@include ct-chart-label($ct-text-color, $ct-text-size);\n\n\t\t&.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start; // Fallback for browsers that don't support foreignObjects\n\t\t}\n\n\t\t&.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\ttext-anchor: start;\n\n\t\t\t// EDIT: added for angled horiz labels\n\t\t\ttransform: translate(-4px, 0%) rotate(45deg);\n\t\t}\n\n\t\t&.ct-vertical.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-end);\n\t\t\ttext-anchor: end;\n\n\t\t\ttransform: translate(0, 20%);\n\t\t}\n\n\t\t&.ct-vertical.ct-end {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.ct-chart-line .ct-label,\n\t.ct-chart-bar .ct-label {\n\t\tdisplay: flex;\n\t}\n\n\t// --- Bar labels ---\n\n\t.ct-chart-bar {\n\t\t.ct-label.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t.ct-label.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t&.ct-horizontal-bars .ct-label {\n\t\t\t&.ct-horizontal.ct-start {\n\t\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-horizontal.ct-end {\n\t\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-start {\n\t\t\t\t//@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);\n\t\t\t\t@include ct-align-justify(center, flex-end);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-end {\n\t\t\t\t@include ct-align-justify(center, flex-start);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\t\t}\n\t}\n\n\t.ct-grid {\n\t\t@include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);\n\t}\n\n\t.ct-point {\n\t\t@include ct-chart-point($ct-point-size, $ct-point-shape);\n\t}\n\n\t.ct-line {\n\t\t@include ct-chart-line($ct-line-width);\n\t}\n\n\t.ct-area {\n\t\t@include ct-chart-area();\n\t}\n\n\t.ct-bar {\n\t\t@include ct-chart-bar($ct-bar-width);\n\t}\n\n\t//.ct-slice-donut {\n\t// @include ct-chart-donut($ct-donut-width);\n\t//}\n\n\t@if $ct-include-colored-series {\n\t\t@for $i from 0 to length($ct-series-names) {\n\t\t\t.ct-series-#{nth($ct-series-names, $i + 1)} {\n\t\t\t\t$color: nth($ct-series-colors, $i + 1);\n\t\t\t\t@include ct-chart-series-color($color);\n\t\t\t}\n\t\t}\n\t}\n}\n\n@if $ct-include-classes {\n\t@include ct-chart();\n\n\t@if $ct-include-alternative-responsive-containers {\n\t\t@for $i from 0 to length($ct-scales-names) {\n\t\t\t.#{nth($ct-scales-names, $i + 1)} {\n\t\t\t\t@include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));\n\t\t\t}\n\t\t}\n\t}\n}\n","// Scales for responsive SVG containers\n$ct-scales_orig: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;\n$ct-scales-names_orig: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;\n\n$ct-scales: ((9/16), (2/3));\n$ct-scales-names: (ct-wide, ct-narrow);\n\n\n// Container ratio\n$ct-container-ratio: (1/1.618) !default;\n\n// Text styles for labels\n$ct-text-color: rgba(white, 0.8) !default;\n$ct-text-size: 0.75rem !default;\n$ct-text-align: flex-start !default;\n$ct-text-justify: flex-start !default;\n$ct-text-line-height: 1;\n\n$ct-axis-label-color: rgba(white, 0.8) !default;\n\n// Grid styles\n$ct-grid-color: rgba(white, 0.3) !default;\n$ct-grid-dasharray: 2px !default;\n$ct-grid-width: 1px !default;\n\n// Line chart properties\n$ct-line-width: 2px !default;\n$ct-line-dasharray: false !default;\n$ct-point-size: 4px !default;\n// Line chart point, can be either round or square\n$ct-point-shape: round !default;\n// Area fill transparency between 0 and 1\n$ct-area-opacity: 0.1 !default;\n\n// Bar chart bar width\n$ct-bar-width: 10px !default;\n\n// Donut width (If donut width is to big it can cause issues where the shape gets distorted)\n$ct-donut-width: 60px !default;\n\n// If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you\n// should set this property to false\n$ct-include-classes: true !default;\n\n// If this is set to true the CSS will contain colored series. You can extend or change the color with the\n// properties below\n$ct-include-colored-series: $ct-include-classes !default;\n\n// If set to true this will include all responsive container variations using the scales defined at the top of the script\n$ct-include-alternative-responsive-containers: $ct-include-classes !default;\n\n// Series names and colors. This can be extended or customized as desired. Just add more series and colors.\n$ct-series-names: (a, b, c, d, e) !default;\n$ct-series-colors: (\n #f05b4f,\n #6188e2,\n #59922b,\n #eacf7d,\n #a748ca\n) !default;\n","@charset \"UTF-8\";\n\n@if $border-box-sizing == true {\n html { // http://bit.ly/1qk2tVR\n box-sizing: border-box;\n }\n\n * {\n &,\n &::after,\n &::before {\n box-sizing: inherit;\n }\n }\n}\n","@import \"normalize\";\n@import \"lib/chartist/chartist\";\n@import \"lib/bourbon/bourbon\";\n\n@import \"grid-settings\";\n@import \"lib/neat/neat\";\n\n@import \"utils/index\";\n\n$form-label-w: 130px;\n$form-label-gap: 8px;\n$form-field-w: 250px;\n\n$c-form-label-fg: white;\n$c-form-field-bg: #303030;\n$c-form-field-fg: white;\n$c-form-highlight: #217b3a;\n$c-form-highlight-a: #28bc65;\n\n@function dist($x) {\n\t@return modular-scale($x, 1rem, $golden);\n}\n\n@function fsize($x) {\n\t@return modular-scale($x, 1em, $major-second);\n}\n\n.center {\n\ttext-align: center;\n}\n\n@import \"layout/index\";\n@import \"form/index\";\n\n// import all our pages\n@import \"pages/wifi\";\n@import \"pages/home\";\n","html {\n\tfont-family: Arial, sans-serif;\n\tcolor: #D0D0D0;\n\tbackground: #131315;\n}\n\nhtml, body {\n\t@include naked();\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n}\n\na, a:visited, a:link {\n\tcolor: #5abfff;\n\ttext-decoration: none;\n}\n\na:hover {\n\tcolor: #5abfff;\n\ttext-decoration: underline;\n}\n","// Add a highlight for debugging\n@mixin highlight($color) {\n\toutline: 1px solid $color;\n\tbackground: rgba($color, .05);\n\tbox-shadow: 0 0 2px 2px rgba($color, .2), inset 0 0 2px 2px rgba($color, .2);\n}\n\n// Ellipsis, but for block elements\n@mixin block-ellipsis($width: 100%) {\n\tdisplay: block;\n\tmax-width: $width;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n\n// No margins, padding, borders\n@mixin naked() {\n\tborder: 0 none;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-decoration: none;\n}\n\n@mixin translate($x, $y) {\n\t@include transform(translate($x, $y));\n}\n\n// Disallow wrapping\n@mixin nowrap() {\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n","/* Main outer container */\n#outer {\n\tdisplay: flex;\n\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tleft: 0;\n\tright: 0;\n\ttop: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\n\tflex-direction: row;\n}\n\n@include media($phone) {\n\t#outer {\n\t\tdisplay: block;\n\t\toverflow-y: scroll;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).\n///\n/// @param {List} $query\n/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.\n/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).\n///\n/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.\n///\n/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).\n///\n///\n/// @param {Number (unitless)} $total-columns [$grid-columns]\n/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.\n///\n/// @example scss - Usage\n/// .responsive-element {\n/// @include media(769px) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// .new-context-element {\n/// @include media(min-width 320px max-width 480px, 6) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// @example css - CSS Output\n/// @media screen and (min-width: 769px) {\n/// .responsive-element {\n/// display: block;\n/// float: left;\n/// margin-right: 2.35765%;\n/// width: 48.82117%;\n/// }\n///\n/// .responsive-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n///\n/// @media screen and (min-width: 320px) and (max-width: 480px) {\n/// .new-context-element {\n/// display: block;\n/// float: left;\n/// margin-right: 4.82916%;\n/// width: 100%;\n/// }\n///\n/// .new-context-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n\n@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {\n @if length($query) == 1 {\n @media screen and ($default-feature: nth($query, 1)) {\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n } @else {\n $loop-to: length($query);\n $media-query: \"screen and \";\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n\n @if is-not(is-even(length($query))) {\n $grid-columns: nth($query, $loop-to) !global;\n $loop-to: $loop-to - 1;\n }\n\n $i: 1;\n @while $i <= $loop-to {\n $media-query: $media-query + \"(\" + nth($query, $i) + \": \" + nth($query, $i + 1) + \") \";\n\n @if ($i + 1) != $loop-to {\n $media-query: $media-query + \"and \";\n }\n\n $i: $i + 2;\n }\n\n @media #{$media-query} {\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n }\n}\n","#menu {\n\t$menu-bg: #2bab5f;\n\n\tflex: 0 0 15rem;\n\tbackground: $menu-bg;\n\n\t& > * {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t\tpadding: dist(-1) dist(0);\n\n\t\t@include nowrap;\n\t\t@include noselect;\n\t}\n\n\t#brand {\n\t\tcolor: white;\n\t\tbackground: darken($menu-bg, 10%);\n\t\tfont-size: 120%;\n\t\ttext-align: center;\n\t\tposition:relative;\n\n\t\tmargin-bottom: dist(0);\n\n\t\t@include media($phone) {\n\t\t\tbackground: $menu-bg;\n\t\t\tcursor: pointer;\n\n\t\t\t&:after {\n\t\t\t\tposition: absolute;\n\t\t\t\tcolor: rgba(black, .2);\n\t\t\t\tright: dist(0);\n\t\t\t\tcontent: '>';\n\t\t\t\ttop:50%;\n\t\t\t\tfont-size: 120%;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttransform: translate(0,-50%) rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t&.expanded #brand {\n\t\tbackground: darken($menu-bg, 10%);\n\n\t\t@include media($phone) {\n\t\t\t&:after { transform: translate(0,-50%) rotate(-90deg) }\n\t\t}\n\t}\n\n\n\ta {\n\t\tfont-size: 130%;\n\t\tcolor: white;\n\n\t\t$hl: #1bd886;\n\t\ttransition: background-color 0.2s;\n\t\ttext-shadow: 0 0 5px rgba(black, .4);\n\n\t\t&:hover, &.selected {\n\t\t\tbackground: $hl;\n\t\t\ttext-shadow: 0 0 5px rgba(black, .6);\n\t\t}\n\n\t\t&.selected {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: 0 0 5px rgba(black, .5);\n\t\t}\n\n\t\t&:before {\n\t\t\tcontent: \"▸\";\n\t\t\tpadding-right: .5rem;\n\t\t\tposition: relative;\n\t\t\ttop: -0.1rem;\n\t\t}\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.expanded a { display:block }\n\n\t@include media($tablet) {\n\t\t#brand {\n\t\t\tfont-size: 95%;\n\t\t\tmargin-bottom: dist(-1);\n\t\t}\n\n\t\ta { font-size: 105%; }\n\n\t\tflex-basis: 10rem;\n\n\t\t& > * { padding: dist(-2) dist(-1);\t}\n\t}\n}\n","\n@mixin click-through() {\n\tpointer-events: none;\n}\n\n\n// Disallow text selection\n@mixin noselect() {\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n\n// Allow text selection\n@mixin can-select() {\n\t-webkit-user-select: text;\n\t-khtml-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n\n\tcursor: text;\n}\n","// Scaling Variables\n$golden: 1.618;\n$minor-second: 1.067;\n$major-second: 1.125;\n$minor-third: 1.2;\n$major-third: 1.25;\n$perfect-fourth: 1.333;\n$augmented-fourth: 1.414;\n$perfect-fifth: 1.5;\n$minor-sixth: 1.6;\n$major-sixth: 1.667;\n$minor-seventh: 1.778;\n$major-seventh: 1.875;\n$octave: 2;\n$major-tenth: 2.5;\n$major-eleventh: 2.667;\n$major-twelfth: 3;\n$double-octave: 4;\n\n$modular-scale-ratio: $perfect-fourth !default;\n$modular-scale-base: em($em-base) !default;\n\n@function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {\n $v1: nth($value, 1);\n $v2: nth($value, length($value));\n $value: $v1;\n\n // scale $v2 to just above $v1\n @while $v2 > $v1 {\n $v2: ($v2 / $ratio); // will be off-by-1\n }\n @while $v2 < $v1 {\n $v2: ($v2 * $ratio); // will fix off-by-1\n }\n\n // check AFTER scaling $v2 to prevent double-counting corner-case\n $double-stranded: $v2 > $v1;\n\n @if $increment > 0 {\n @for $i from 1 through $increment {\n @if $double-stranded and ($v1 * $ratio) > $v2 {\n $value: $v2;\n $v2: ($v2 * $ratio);\n } @else {\n $v1: ($v1 * $ratio);\n $value: $v1;\n }\n }\n }\n\n @if $increment < 0 {\n // adjust $v2 to just below $v1\n @if $double-stranded {\n $v2: ($v2 / $ratio);\n }\n\n @for $i from $increment through -1 {\n @if $double-stranded and ($v1 / $ratio) < $v2 {\n $value: $v2;\n $v2: ($v2 / $ratio);\n } @else {\n $v1: ($v1 / $ratio);\n $value: $v1;\n }\n }\n }\n\n @return $value;\n}\n","#content {\n\tflex-grow: 1;\n\n\toverflow-y: auto;\n\tpadding: dist(0);\n\t@include media($phone) {\n\t\tpadding: dist(-1);\n\t}\n\n\t& > * {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\th1 {\n\t\ttext-align: center;\n\t\tfont-size: fsize(7);\n\t\tmargin-top: 0;\n\t\tmargin-bottom: dist(0);\n\t}\n\n\th2 {\n\t\tfont-size: fsize(3);\n\t\tmargin-bottom: dist(-1);\n\t}\n\n\ttd, th {\n\t\tpadding: dist(-2);\n\t}\n\n\ttbody th {\n\t\ttext-align: right;\n\t\twidth: $form-label-w;\n\t\tcolor: $c-form-label-fg;\n\t}\n}\n",".Box {\n\tdisplay: block;\n\tmax-width: 900px;\n\n\tmargin-top: dist(0);\n\tpadding: dist(-1);\n\n\t@include media($phone) {\n\t\tmargin-top: dist(-1);\n\t}\n\n\th1 + & {\n\t\tmargin-top: 0;\n\t}\n\n\th2 {\n\t\tmargin-top: 0;\n\t}\n\n\tborder-radius: 3px;\n\tbackground-color: rgba(white, .07);\n\n\t&.wide {\n\t\twidth: initial;\n\t\tmax-width: initial;\n\t}\n\n\t&.medium {\n\t\tmax-width: 1200px;\n\t}\n}\n",".Modal {\n\tposition: fixed;\n\twidth: 100%; height: 100%;\n\tleft: 0; top: 0; right: 0; bottom: 0;\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\n\ttransition: opacity .5s;\n\tbackground: rgba(black, .65);\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n\n.Dialog {\n\tmargin: dist(-1);\n\tpadding: dist(0) dist(-1);\n\toverflow: hidden;\n\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tflex: 0 1 30rem;\n\t//min-height: 15rem;\n\n\tbackground: #1c1c1e;\n\tborder-left: 6px solid $c-form-highlight;\n\tborder-right: 6px solid $c-form-highlight;\n\tbox-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n\n\tborder-radius: 6px;\n}\n","@import \"fancy_button_mixins\";\n\n#{$all-buttons}, .button {\n\t@include fancy-btn-base();\n\n\t// fontello\n/*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n\n\t&.narrow {\n\t\tmin-width: initial;\n\t}\n\n\ttext-shadow: 1.5px 1.5px 2px rgba(black, 0.8);\n}\n\n\n\n\n$btn-gray-f: #DDDDDD;\n$btn-gray-b: #505050;\n$btn-gray-l: #343434; // line\n\n$btn-green-f: #FEFEFE;\n$btn-green-b: #2ca94b;\n$btn-green-fa: #FEFEFE;\n$btn-green-ba: #28ba5c;\n\n$btn-red-f: #FEFEFE;\n$btn-red-b: #D04E51;\n$btn-red-fa: #FEFEFE;\n$btn-red-ba: #d4403f;\n\n$btn-blue-f: #FEFEFE;\n$btn-blue-b: #3983cd;\n$btn-blue-fa: #FEFEFE;\n$btn-blue-ba: #2076C6;\n\n$btn-orange-f: #FEFEFE;\n$btn-orange-b: #dd8751;\n$btn-orange-fa: #FEFEFE;\n$btn-orange-ba: #C6733F;\n\n\ninput[type=\"submit\"], .btn-green {\n\t@include fancy-btn-colors($btn-green-f, $btn-green-b, $btn-green-fa, $btn-green-ba)\n}\n\ninput[type=\"reset\"], .btn-red {\n\t@include fancy-btn-colors($btn-red-f, $btn-red-b, $btn-red-fa, $btn-red-ba)\n}\n\n//&.blue {@include fancy-btn-colors($btn-blue-f, $btn-blue-b, $btn-blue-fa, $btn-blue-ba)}\n//&, &.orange {@include fancy-btn-colors($btn-orange-f, $btn-orange-b, $btn-orange-fa, $btn-orange-ba)}\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\n","\n// Button styling\n@mixin fancy-btn-base() {\n\ttext-align: center;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tborder-radius: 2px;\n\tpadding: 0 0.6em;\n\tborder: 0 none;\n\toutline: 0 none !important;\n\tline-height: 1.8em;\n\tfont-size: 1.1em;\n\tmargin-bottom: 3px;\n\tmin-width: 5em;\n\n\t@include noselect();\n\n\t//&[class^=\"icon-\"]::before, &[class*=\" icon-\"]::before {\n\t//\tmargin-left:0;\n\t//}\n\n\t&:active {\n\t\tposition: relative;\n\t\ttop: 2px;\n\t}\n\n\t//&, &:active, &:hover, &:visited {\n\t//\ttext-decoration: none;\n\t//}\n}\n\n@mixin fancy-btn-colors-full($text_p, $back_p, $side_p, $text_a, $back_a, $side_a) {\n\tbackground-color: $back_p;\n\tbox-shadow: 0 3px 0 $side_p;\n\ttext-decoration: none !important;\n\n\t&, &:link, &:visited {\n\t\tcolor: $text_p;\n\t}\n\n\t&:hover, &:active, &.active, &.selected {\n\t\tbackground-color: $back_a;\n\t\tcolor: $text_a;\n\t}\n\n\t&:hover, &.selected, &.active {\n\t\tbox-shadow: 0 3px 0 $side_a;\n\t}\n\n\t// thinner shadow\n\t&:active {\n\t\tbox-shadow: 0 1px 0 $side_a;\n\t}\n}\n\n@mixin fancy-btn-colors($text_p, $back_p, $text_a, $back_a) {\n\t@include fancy-btn-colors-full($text_p, $back_p, darken($back_p, 14), $text_a, $back_a, darken($back_a, 16));\n}\n","@import \"buttons\";\n\n#{$all-text-inputs}, select {\n\tborder: 0 none;\n\tborder-bottom: 2px solid $c-form-highlight;\n\tbackground-color: $c-form-field-bg;\n\tcolor: $c-form-field-fg;\n\tpadding: 6px;\n\tline-height: 1em;\n\toutline: 0 none !important;\n\t-moz-outline: 0 none !important;\n\tfont-weight: normal;\n\n\t&:focus, &:hover {\n\t\tborder-bottom-color: $c-form-highlight-a;\n\t}\n}\n\n#{$all-text-inputs} {\n\t@include can-select();\n}\n\ntextarea {\n\tfont-family: monospace;\n\tline-height: 1.2em;\n\tdisplay: block; // fixes weird bottom margin\n}\n\n@import \"select\";\n","\n// target chrome only\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n\tselect { padding-right: 18px }\n}\n\nselect {\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\tappearance: none;\n\n\tcursor: pointer;\n\tline-height: 1.4em;\n\tpadding: 3.5px;\n\n\tpadding-right: 1em;\n\n\t// hack for firefox to disable dotted outline\n\t&:-moz-focusring {\n\t\tcolor: transparent;\n\t\ttext-shadow: 0 0 0 $c-form-field-fg;\n\t}\n\n\toption {\n\t\tbackground: $c-form-field-bg;\n\t}\n}\n\nlabel.select-wrap {\n\tposition: relative;\n\tdisplay: inline !important;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\twidth: auto !important;\n\n\t&:after {\n\t\tcontent: '<>'; /* will be rotated */\n\t\tfont-family: \"Consolas\", monospace;\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-highlight-a;\n\n\t\ttop: 50%;\n\t\t@include transform(translate(0, -50%) rotate(90deg));\n\n\t\tright: 2px;\n\n\t\tposition:absolute;\n\t\tz-index: 100;\n\n\t\tpointer-events: none;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// A mixin for generating vendor prefixes on non-standardized properties.\n///\n/// @param {String} $property\n/// Property to prefix\n///\n/// @param {*} $value\n/// Value to use\n///\n/// @param {List} $prefixes\n/// Prefixes to define\n///\n/// @example scss - Usage\n/// .element {\n/// @include prefixer(border-radius, 10px, webkit ms spec);\n/// }\n///\n/// @example css - CSS Output\n/// .element {\n/// -webkit-border-radius: 10px;\n/// -moz-border-radius: 10px;\n/// border-radius: 10px;\n/// }\n///\n/// @require {variable} $prefix-for-webkit\n/// @require {variable} $prefix-for-mozilla\n/// @require {variable} $prefix-for-microsoft\n/// @require {variable} $prefix-for-opera\n/// @require {variable} $prefix-for-spec\n\n@mixin prefixer($property, $value, $prefixes) {\n @each $prefix in $prefixes {\n @if $prefix == webkit {\n @if $prefix-for-webkit {\n -webkit-#{$property}: $value;\n }\n } @else if $prefix == moz {\n @if $prefix-for-mozilla {\n -moz-#{$property}: $value;\n }\n } @else if $prefix == ms {\n @if $prefix-for-microsoft {\n -ms-#{$property}: $value;\n }\n } @else if $prefix == o {\n @if $prefix-for-opera {\n -o-#{$property}: $value;\n }\n } @else if $prefix == spec {\n @if $prefix-for-spec {\n #{$property}: $value;\n }\n } @else {\n @warn \"Unrecognized prefix: #{$prefix}\";\n }\n }\n}\n\n@mixin disable-prefix-for-all() {\n $prefix-for-webkit: false !global;\n $prefix-for-mozilla: false !global;\n $prefix-for-microsoft: false !global;\n $prefix-for-opera: false !global;\n $prefix-for-spec: false !global;\n}\n","// Unified Form wrapper\nform { @include naked(); }\n\n#{$all-text-inputs}, select, label.select-wrap {\n\twidth: $form-field-w;\n}\n\nform .Row {\n\tvertical-align: middle;\n\tmargin: 14px auto;\n\ttext-align: left;\n\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&:first-child {\n\t\tmargin-top: 0;\n\t}\n\n\t&:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.spacer {\n\t\twidth: $form-label-w;\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.buttons {\n\t\tinput, .button {\n\t\t\tmargin-right: dist(-1);\n\t\t}\n\t}\n\n\t&.centered {\n\t\tjustify-content: center;\n\t}\n\n\t&.message {\n\t\tfont-size: 1em;\n\t\t//margin-left: $label-gap + $w-labels;\n\t\ttext-shadow: 1px 1px 3px black;\n\t\ttext-align: center;\n\n\t\t&.error {\n\t\t\tcolor: crimson;\n\t\t}\n\n\t\t&.ok {\n\t\t\tcolor: #0fe851;\n\t\t}\n\t}\n\n\t&.separator {\n\t\tpadding-top: 14px;\n\t\tborder-top: 2px solid rgba(255, 255, 255, 0.1);\n\t}\n\n\ttextarea {\n\t\tdisplay: inline-block;\n\t\tvertical-align: top;\n\t\tmin-height: 10rem;\n\t\tflex-grow: 1;\n\n\t\tresize: vertical;\n\t}\n\n\tlabel {\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-label-fg;\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\ttext-align: right;\n\t\ttext-shadow: 1px 1px 3px black;\n\n\t\tpadding: $form-label-gap;\n\t\talign-self: flex-start;\n\n\t\t@include noselect;\n\t}\n\n\t.checkbox-wrap {\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\tpadding: $form-label-gap;\n\t\ttext-align: right;\n\t\talign-self: flex-start;\n\n\t\tinput[type=checkbox] {\n\t\t\tmargin: auto;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\n\t\t& + label {\n\t\t\twidth: $form-field-w;\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t// special phone style\n\t@include media($phone) {\n\t\tflex-direction: column;\n\n\t\t&.buttons, &.centered {\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\t&.buttons {\n\t\t\tjustify-content: center;\n\n\t\t\t// remove margin on lats button\n\t\t\t:last-child {\n\t\t\t\tmargin-right:0;\n\t\t\t}\n\t\t}\n\n\t\tlabel {\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\twidth: auto;\n\t\t}\n\n\t\t.checkbox-wrap {\n\t\t\torder: 1;\n\t\t\ttext-align: left;\n\t\t\tpadding-bottom: 0;\n\n\t\t\tborder-radius: .4px;\n\t\t\twidth: auto;\n\n\t\t\t& + label {\n\t\t\t\twidth: auto;\n\t\t\t}\n\t\t}\n\n\t\t#{$all-text-inputs}, textarea {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n}\n\n// red asterisk\nform span.required {\n\tcolor: red;\n}\n\n.RadioGroup {\n\tdisplay: inline-block;\n\tline-height: 1.5em;\n\tvertical-align: middle;\n\n\tlabel {\n\t\twidth: auto;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t\tfont-weight: normal;\n\t}\n\n\tinput[type=\"radio\"] {\n\t\tvertical-align: middle;\n\t\tmargin: 0 0 0 5px;\n\t}\n}\n","#ap-list {\n\tcolumn-count: 3;\n\tcolumn-gap: 0;\n\n\t@include media($tablet) {\n\t\tcolumn-count: 2;\n\t}\n\n\t@include media($phone) {\n\t\tcolumn-count: 1;\n\t}\n\n\tmargin: 0 (- dist(-3));\n}\n\n#ap-loader {\n\tbackground: rgba(white, .1);\n\tborder-radius: 5px;\n\tpadding: dist(-2);\n\tmargin-bottom: dist(-2);\n}\n\n#ap-box {\n\tpadding-bottom: dist(-2);\n}\n\n\n#psk-modal form {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: dist(-2);\n\n\t& > * {\n\t\tmargin-left: dist(-2);\n\t\tmargin-right: dist(-2);\n\t\t&:first-child { margin-left: 0 }\n\t\t&:last-child { margin-right: 0 }\n\t}\n\n\tinput[type=password] {\n\t\tmin-width: 5rem;\n\t}\n}\n\n.AP {\n\t// can't use margins inside a column\n\n\tbreak-inside: avoid-column;\n\tmax-width: 500px;\n\tpadding: dist(-3);\n\n\t&.selected .inner {//#70dfa3\n\t\tbackground: #43de81 !important; // override the hover effect\n\t\tcursor: default;\n\t\ttop: 0 !important; // no click effect\n\t}\n\n\t// the actual silver box\n\t.inner {\n\t\tcursor: pointer;\n\t\t@include noselect;\n\n\t\tposition: relative;\n\t\t&:active {\n\t\t\tleft: 0;\n\t\t\ttop: 1px;\n\t\t}\n\n\t\tborder-radius: 3px;\n\t\tcolor: #222;\n\n\t\tbackground: #afafaf;\n\t\ttransition: background-color 0.5s;\n\t\t&:hover { background: white }\n\n\t\tdisplay: flex;\n\n\t\t& > * {\n\t\t\tpadding: dist(-1);\n\t\t\t@include nowrap;\n\t\t}\n\n\t\t.rssi {\n\t\t\tmin-width: 2rem;\n\t\t\tflex: 0 0 15%;\n\t\t\ttext-align: right;\n\n\t\t\t&:after {\n\t\t\t\tpadding-left: dist(-5);\n\t\t\t\tcontent: '%';\n\t\t\t\tfont-size: fsize(-1);\n\t\t\t}\n\t\t}\n\n\t\t.essid {\n\t\t\tflex: 1 1 70%;\n\t\t\tmin-width: 0;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\t.auth {\n\t\t\tflex: 0 0 15%;\n\t\t}\n\t}\n}\n",".page-home #rssi-perc:after {\n\tpadding-left: dist(-4);\n\tcontent: '%';\n\tfont-size: fsize(-1);\n}\n\n.page-home #rssi-dbm:after {\n\tpadding-left: dist(-4);\n\tcontent: 'dBm';\n\tfont-size: fsize(-1);\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["app.css","_normalize.scss","lib/neat/grid/_box-sizing.scss","lib/chartist/_chartist.scss","lib/chartist/_chartist-settings.scss","utils/_pointer.scss","app.scss","layout/_base.scss","utils/_misc.scss","layout/_outer-wrap.scss","lib/neat/grid/_media.scss","layout/_menu.scss","lib/bourbon/functions/_modular-scale.scss","layout/_content.scss","layout/_box.scss","layout/_modal.scss","form/_buttons.scss","form/_fancy_button_mixins.scss","form/_form_elements.scss","form/_select.scss","lib/bourbon/addons/_prefixer.scss","form/_form_layout.scss","pages/_wifi.scss","pages/_home.scss"],"names":[],"mappings":"AAAA,iBAAiB;ACAjB,2EAA2E;AAE3E;;;;GAIG;AAEH;EACC,uBAAuB,EACvB;;AAGD;EACE,wBAAwB;EAAE,OAAO;EACjC,2BAA2B;EAAE,OAAO;EACpC,+BAA+B;EAAE,OAAO,EACzC;;AAED;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;gFACgF;AAEhF;;;;;GAKG;AAMH;;EAUE,eAAe,EAChB;;AAED;;;GAGG;AAGH;;EAIE,sBAAsB;EAAE,OAAO;EAC/B,yBAAyB;EAAE,OAAO,EACnC;;AAED;;;GAGG;AAOH;;;GAGG;AD1BH;EC+BE,cAAc,EACf;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,8BAA8B,EAC/B;;AAED;;;GAGG;AAEH;;EAEE,WAAW,EACZ;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EAGE,kBAAkB,EACnB;;AAED;;GAEG;AAMH;;;GAGG;AAEH;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;EACE,eAAe;EACf,iBAAiB,EAClB;;AAED;;GAEG;AAOH;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAEE,eAAe;EACf,eAAe;EACf,mBAAmB;EACnB,yBAAyB,EAC1B;;AAED;EACE,YAAY,EACb;;AAED;EACE,gBAAgB,EACjB;;AAED;gFACgF;AAEhF;;GAEG;AAEH;EACE,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,iBAAiB,EAClB;;AAED;gFACgF;AAEhF;;GAEG;AAMH;;GAEG;AAEH;EACE,wBAAwB;EACxB,UAAU,EACX;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;GAEG;AAEH;;EAKE,uBAAuB;EACvB,eAAe,EAChB;;AAED;gFACgF;AAEhF;;;GAGG;AAEH;;;;;GAKG;AAEH;;;;EAKE,eAAe;EAAE,OAAO;EACxB,cAAc;EAAE,OAAO;EACvB,UAAU;EAAE,OAAO,EACpB;;AAED;;GAEG;AAEH;EACE,kBAAkB,EACnB;;AAED;;;;;GAKG;AAEH;;EAEE,qBAAqB,EACtB;;AAED;;;;;;GAMG;AAEH;;;EAIE,2BAA2B;EAAE,OAAO;EACpC,gBAAgB;EAAE,OAAO,EAC1B;;AAED;;GAEG;AAEH;;EAEE,gBAAgB,EACjB;;AAED;;GAEG;AAEH;;EAEE,UAAU;EACV,WAAW,EACZ;;AAED;;;GAGG;AAEH;EACE,oBAAoB,EACrB;;AAED;;;;;;GAMG;AAEH;;EAEE,uBAAuB;EAAE,OAAO;EAChC,WAAW;EAAE,OAAO,EACrB;;AAED;;;;GAIG;AAOH;;;GAGG;AAOH;;;;GAIG;AAOH;;GAEG;AAQH;;;GAGG;AAEH;EACE,UAAU;EAAE,OAAO;EACnB,WAAW;EAAE,OAAO,EACrB;;AAED;;GAEG;AAEH;EACE,eAAe,EAChB;;AAED;;;GAGG;AAMH;gFACgF;AAEhF;;GAEG;AAEH;EACE,0BAA0B;EAC1B,kBAAkB,EACnB;;AAED;;EAEE,WAAW,EACZ;;ACnbC;EACE,uBAAuB,EACxB;;AAED;EAII,oBAAoB,EACrB;;ACwGJ;EACC,+BCnG8B;ECV/B,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB,EF2GjB;;AAGD;EA7EA,+BCjCyB;EDkCzB,gCClCyB;EDmCzB,mBClCqB;EDmCrB,eChCsB,EDqIrB;EA3BD;IA3FA,sBA+FoC;IA9FpC,4BA8FgD;IA1F/C,iBAAiB;IA2FhB,mBAAmB,EACnB;EANF;IA3FA,wBAoGsC;IAnGtC,4BAmGkD;IA/FjD,iBAAiB;IAgGhB,mBAAmB;IAGnB,6CAAqC,EACrC;EAdF;IA3FA,sBA4GoC;IA3GpC,0BA2G8C;IArG7C,kBAAkB;IAsGjB,iBAAiB;IAEjB,6BAAoB,EACpB;EArBF;IA3FA,sBAmHoC;IAlHpC,4BAkHgD;IA9G/C,iBAAiB;IA+GhB,mBAAmB,EACnB;;AAGF;;EAEC,cAAc,EACd;;AAID;EA/HA,sBAiIoC;EAhIpC,wBAgI4C;EAxH3C,mBAAmB;EAyHlB,mBAAmB,EACnB;;AAJF;EA/HA,wBAsIsC;EArItC,wBAqI8C;EA7H7C,mBAAmB;EA8HlB,mBAAmB,EACnB;;AATF;EA/HA,sBA4IqC;EA3IrC,4BA2IiD;EAvIhD,iBAAiB;EAwIf,mBAAmB,EACnB;;AAfH;EA/HA,wBAiJuC;EAhJvC,4BAgJmD;EA5IlD,iBAAiB;EA6If,mBAAmB,EACnB;;AApBH;EA/HA,oBAuJmC;EAtJnC,0BAsJ6C;EAhJ5C,kBAAkB;EAiJhB,iBAAiB,EACjB;;AA1BH;EA/HA,oBA4JmC;EA3JnC,4BA2J+C;EAvJ9C,iBAAiB;EAwJf,iBAAiB,EACjB;;AAIH;EA7IA,iCC/ByB;EDgCzB,kBC9BkB;EDiCjB,sBClCqB,ED6KrB;;AAED;EAxIA,kBCjCkB;EDkClB,sBChCqB,EDyKpB;;AAED;EAvIA,WAAW;EACX,kBCzCkB,EDiLjB;;AAED;EAlIA,aAAa;EACb,kBC5CoB,ED+KnB;;AAED;EAjIA,WAAW;EACX,mBC9CkB,EDgLjB;;AAQC;EA/HD,gBCtCO,EDuCP;;AA8HC;EA3HD,cC1CO,ED2CP;;AA0HC;EA/HD,gBCrCO,EDsCP;;AA8HC;EA3HD,cCzCO,ED0CP;;AA0HC;EA/HD,gBCpCO,EDqCP;;AA8HC;EA3HD,cCxCO,EDyCP;;AA0HC;EA/HD,gBCnCO,EDoCP;;AA8HC;EA3HD,cCvCO,EDwCP;;AA0HC;EA/HD,gBClCO,EDmCP;;AA8HC;EA3HD,cCtCO,EDuCP;;AAuIC;EArOF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAwO3C;EAFD;IAhOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,uBAAsB,EACtB;EA0NC;IAvND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EAoNC;IAjND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AA6MC;EArOF,eAAe;EACf,mBAAmB;EACnB,YAH8C,EAwO3C;EAFD;IAhOD,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,UAAU;IACV,+BAAsB,EACtB;EA0NC;IAvND,YAAY;IACZ,eAAe;IACf,YAAY,EACZ;EAoNC;IAjND,eAAe;IACf,mBAAmB;IACnB,OAAO;IACP,QAAQ,EACR;;AGCF;EACC,mBAAmB,EACnB;;AC9BD;EACC,+BAA+B;EAC/B,eAAe;EACf,oBAAoB,EACpB;;AAED;ECaC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB;EDdtB,YAAY;EACZ,aAAa;EACb,iBAAiB,EACjB;;AAED;EACC,eAAe;EACf,sBAAsB,EACtB;;AAED;EACC,eAAe;EACf,2BAA2B,EAC3B;;AErBD,0BAA0B;AAC1B;EACC,cAAc;EAEd,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,QAAQ;EACR,SAAS;EACT,OAAO;EACP,UAAU;EACV,iBAAiB;EAEjB,oBAAoB,EACpB;;ACwEG;EDrEH;IACC,eAAe;IACf,mBAAmB,EACnB,EAAA;;AEpBF;EAGC,gBAAgB;EAChB,oBAHiB,EA4FjB;EA7FD;IAOE,eAAe;IACf,sBAAsB;IACtB,8BLY6B;IEU9B,oBAAoB;IACpB,kBAAkB;IHxBlB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EMCjB;EAbF;IAgBE,aAAa;IACb,oBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAkB;IAElB,oBLD6B,EKkB7B;ID+CE;MCtFJ;QAyBG,oBAxBe;QAyBf,gBAAgB,EAajB;QAvCF;UA6BI,mBAAmB;UACnB,0BAAiB;UACjB,YLV2B;UKW3B,aAAa;UACb,SAAQ;UACR,gBAAgB;UAChB,kBAAkB;UAClB,4CAAmC,EACnC,EAAA;EArCJ;IAyCE,oBAAkB,EAKlB;IDwCE;MCtFJ;QA4Ca,6CAAmC,EAAW,EAAA;EA5C3D;IAkDE,gBAAgB;IAChB,aAAa;IAGb,kCAAkC;IAClC,wCAA+B,EAsB/B;IA7EF;MA0DG,oBALW;MAMX,wCAA+B,EAC/B;IA5DH;MA+DG,mBAAmB;MACnB,uCAA8B,EAC9B;IAjEH;MAoEG,aAAS;MACT,qBAAqB;MACrB,mBAAmB;MACnB,aAAa,EACb;IDcC;MCtFJ;QA2EG,cAAc,EAEf,EAAA;EA7EF;IA+EgB,eAAe,EAAE;EDO7B;ICtFJ;MAyFE,kBAAkB,EAInB;MA7FD;QAmFG,eAAe;QACf,+BCvBc,EDwBd;MArFH;QAuFM,gBAAgB,EAAI;MAvF1B;QA2FU,yCC9BO,ED8BuB,EAAA;;AE3FxC;EACC,aAAa;EAEb,iBAAiB;EACjB,cPiB8B,EOc9B;EHmDG;IGtFJ;MAME,yBDuDe,EC1BhB,EAAA;EAnCD;IAUE,kBAAkB;IAClB,mBAAmB,EACnB;EAZF;IAeE,mBAAmB;IACnB,0BD4Be;IC3Bf,cAAc;IACd,oBPG6B,EOF7B;EAnBF;IAsBE,yBDsBe;ICrBf,+BDsCe,ECrCf;EAxBF;IA2BE,yBDkCe,ECjCf;EA5BF;IA+BE,kBAAkB;IAClB,aPtBkB;IOuBlB,aPnBqB,EOoBrB;;AClCF;EACC,eAAe;EACf,iBAAiB;EAEjB,iBRiB8B;EQhB9B,yBFwDgB;EE1ChB,mBAAmB;EACnB,4CAA4B,EAU5B;EJwDG;IItFJ;MAQE,4BFqDe,EE/BhB,EAAA;EAnBA;IACC,cAAc,EACd;EAbF;IAgBE,cAAc,EACd;EAjBF;IAuBE,eAAe;IACf,mBAAmB,EACnB;EAzBF;IA4BE,kBAAkB,EAClB;;AC7BF;EACC,gBAAgB;EAChB,YAAY;EAAE,aAAa;EAC3B,QAAQ;EAAE,OAAO;EAAE,SAAS;EAAE,UAAU;EAExC,cAAc;EACd,wBAAwB;EACxB,oBAAoB;EAEpB,wBAAwB;EACxB,gCAAsB;EACtB,WAAW,EAGX;EAdD;IAYa,WAAY,EAAE;EAZ3B;IAaY,cAAe,EAAE;;AAG7B;EACC,wBH4CgB;EG3ChB,8BH2CgB;EG1ChB,iBAAiB;EAEjB,gBAAgB;EAChB,iBAAiB;EACjB,gBAAgB;EAGhB,oBAAoB;EACpB,+BTVyB;ESWzB,gCTXyB;ESYzB,+CAA+C;EAE/C,mBAAmB,EACnB;;AC9BD;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EZLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EWNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AAjGF;ECCC,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;EACf,2BAA2B;EAC3B,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;EZLf,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EWNnB;;;;;;IAMI;EAMH,gDAAuC,EACvC;EAjBD;ICoBE,mBAAmB;IACnB,SAAS,EACT;EDtBF;IAaE,mBAAmB,EACnB;;AAiCF;ECjBC,0BDHoB;ECIpB,4BAuBuD;EAtBvD,iCAAiC,EDiBjC;EAFD;ICZE,eDTqB,ECUrB;EDWF;ICRE,0BDVoB;ICWpB,eDZoB,ECapB;EDMF;ICHE,4BAU6F,EAT7F;EDEF;ICEE,4BAK6F,EAJ7F;;ADCF;ECrBC,0BDEoB;ECDpB,4BAuBuD;EAtBvD,iCAAiC,EDqBjC;EAFD;IChBE,eDJmB,ECKnB;EDeF;ICZE,0BDLkB;ICMlB,eDPkB,ECQlB;EDUF;ICPE,4BAU6F,EAT7F;EDMF;ICFE,4BAK6F,EAJ7F;;ADQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCE;AEjGF;EACC,eAAe;EACf,iCZayB;EYZzB,0BZUwB;EYTxB,aZUsB;EYTtB,aAAa;EACb,iBAAiB;EACjB,2BAA2B;EAC3B,gCAAgC;EAChC,oBAAoB,EAKpB;EAdD;IAYE,6BZI0B,EYH1B;;AAGF;EbAC,0BAA0B;EAC1B,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EAElB,aAAa,EaJb;;AAED;EACC,uBAAuB;EACvB,mBAAmB;EACnB,eAAe,EACf;;ACxBD;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EAEf,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBbJqB,EaKrB;EAfF;IAkBE,oBbTuB,EaUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,ebrB0B;IauB1B,SAAS;ICUH,4CDTsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AEjDF;EbkBC,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB,EarBI;;AAE3B;EACC,afQmB,EePnB;;AAED;EACC,uBAAuB;EACvB,kBAAkB;EAClB,iBAAiB;EAEjB,cAAc;EACd,oBAAoB,EAoIpB;EA1ID;IASE,cAAc,EACd;EAVF;IAaE,iBAAiB,EACjB;EAdF;IAiBE,afdkB,EemBlB;IXyDE;MW/EJ;QAoBG,cAAc,EAEf,EAAA;EAtBF;IA0BG,8BT4Bc,ES3Bd;EA3BH;IA+BE,wBAAwB,EACxB;EAhCF;IAmCE,eAAe;IAEf,+BAA+B;IAC/B,mBAAmB,EASnB;IA/CF;MAyCG,eAAe,EACf;IA1CH;MA6CG,eAAe,EACf;EA9CH;IAkDE,kBAAkB;IAClB,+CAA0B,EAC1B;EApDF;IAuDE,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,aAAa;IAEb,iBAAiB,EACjB;EA7DF;IAgEE,kBAAkB;IAClB,af1DqB;Ie2DrB,sBAAsB;IACtB,afhEkB;IeiElB,kBAAkB;IAClB,+BAA+B;IAE/B,afnEkB;IeoElB,uBAAuB;IhBvExB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB,EgBsEjB;EA3EF;IA8EE,sBAAsB;IACtB,af5EkB;Ie6ElB,af5EkB;Ie6ElB,kBAAkB;IAClB,uBAAuB,EAcvB;IAhGF;MAqFG,aAAa;MACb,YAAY;MACZ,aAAa,EACb;IAxFH;MA2FG,aftFiB;MeuFjB,gBAAgB;MAChB,iBAAiB;MACjB,gBAAgB,EAChB;EXhBC;IW/EJ;MAoGE,uBAAuB,EAsCxB;MA1ID;QAuGG,oBAAoB,EACpB;MAxGH;QA2GG,wBAAwB,EAMxB;QAjHH;UA+GI,gBAAe,EACf;MAhHJ;QAoHG,gBAAgB;QAChB,iBAAiB;QACjB,YAAY,EACZ;MAvHH;QA0HG,SAAS;QACT,iBAAiB;QACjB,kBAAkB;QAElB,oBAAoB;QACpB,YAAY,EAKZ;QApIH;UAkII,YAAY,EACZ;MAnIJ;QAuIG,YAAY,EACZ,EAAA;;AAKH;EACC,WAAW,EACX;;AAED;EACC,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB,EAavB;EAhBD;IAME,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB,EACpB;EAVF;IAaE,uBAAuB;IACvB,kBAAkB,EAClB;;AFrKF;EACC;IAAS,oBAAqB,EAAE,EAAA;;AAGjC;EACC,yBAAyB;EACzB,sBAAsB;EACtB,iBAAiB;EAEjB,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;EAEf,mBAAmB,EAWnB;EApBD;IAaE,mBAAmB;IACnB,yBbJqB,EaKrB;EAfF;IAkBE,oBbTuB,EaUvB;;AAGF;EACC,mBAAmB;EACnB,2BAA2B;EAC3B,qBAAqB;EACrB,sBAAsB;EACtB,uBAAuB,EAkBvB;EAvBD;IAQE,cAAc;IAAE,qBAAqB;IACrC,mCAAmC;IACnC,kBAAkB;IAClB,ebrB0B;IauB1B,SAAS;ICUH,4CDTsC;IAE5C,WAAW;IAEX,mBAAkB;IAClB,aAAa;IAEb,qBAAqB,EACrB;;AGlDF;EACC,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;EAChB,sBAAc;EAAd,mBAAc;EAAd,cAAc;EAUd,2BViDgB,EUhDhB;EZyEG;IYtFJ;MAKE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAQjB,EAAA;EZyEG;IYtFJ;MASE,wBAAgB;MAAhB,qBAAgB;MAAhB,gBAAgB,EAIjB,EAAA;;AAED;EACC,qCAAsB;EACtB,mBAAmB;EACnB,yBV2CgB;EU1ChB,+BV0CgB,EUzChB;;AAED;EACC,gCVsCgB,EUrChB;;AAGD;EACC,cAAc;EACd,oBAAoB;EACpB,wBV+BgB,EUnBhB;EAfD;IAME,6BV4Be;IU3Bf,8BV2Be,EUxBf;IAVF;MAQkB,eAAgB,EAAE;IARpC;MASiB,gBAAiB,EAAE;EATpC;IAaE,gBAAgB,EAChB;;AAGF;EAGC,mCAA2B;EAA3B,yBAA2B;EAA3B,2BAA2B;EAC3B,iBAAiB;EACjB,yBVYgB,EU6ChB;EA9DD;IAQE,+BAA+B;IAC/B,gBAAgB;IAChB,kBAAkB,EAClB;EAXF;IAeE,gBAAgB;IjBnDjB,0BAA0B;IAC1B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,kBAAkB;IiBkDjB,mBAAmB;IAMnB,mBAAmB;IACnB,YAAY;IAEZ,oBAAoB;IACpB,kCAAkC;IAGlC,cAAc,EA8Bd;IA7DF;MAoBG,QAAQ;MACR,SAAS,EACT;IAtBH;MA6BY,kBAAmB,EAAE;IA7BjC;MAkCG,yBVjBc;MJ9BhB,oBAAoB;MACpB,kBAAkB,EcgDhB;IApCH;MAuCG,gBAAgB;MAChB,cAAc;MACd,kBAAkB,EAOlB;MAhDH;QA4CI,6BV3Ba;QU4Bb,aAAa;QACb,0BV7Ba,EU8Bb;IA/CJ;MAmDG,cAAc;MACd,aAAa;MACb,wBAAwB;MACxB,iBAAiB;MACjB,kBAAkB,EAClB;IAxDH;MA2DG,cAAc,EACd;;ACxGH;EACC,8BX4DgB;EW3DhB,aAAa;EACb,0BX0DgB,EWzDhB;;AAED;EACC,8BXsDgB;EWrDhB,eAAe;EACf,0BXoDgB,EWnDhB","file":"app.css","sourcesContent":["@charset \"UTF-8\";\n/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n*, *:before, *:after {\n box-sizing: border-box; }\n\nhtml {\n font-family: sans-serif;\n /* 1 */\n -ms-text-size-adjust: 100%;\n /* 2 */\n -webkit-text-size-adjust: 100%;\n /* 2 */ }\n\n/**\n * Remove default margin.\n */\nbody {\n margin: 0; }\n\n/* HTML5 display definitions\n ========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\nfigure,\nnav {\n display: block; }\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\ncanvas,\nprogress {\n display: inline-block;\n /* 1 */\n vertical-align: baseline;\n /* 2 */ }\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n[hidden] {\n display: none; }\n\n/* Links\n ========================================================================== */\n/**\n * Remove the gray background color from active links in IE 10.\n */\na {\n background-color: transparent; }\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\na:active,\na:hover {\n outline: 0; }\n\n/* Text-level semantics\n ========================================================================== */\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\nb {\n font-weight: bold; }\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\nh1 {\n font-size: 2em;\n margin: 0.67em 0; }\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0; }\n\n/**\n * Address styling not present in IE 8/9.\n */\n/**\n * Address inconsistent and variable font size in all browsers.\n */\nsmall {\n font-size: 80%; }\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline; }\n\nsup {\n top: -0.5em; }\n\nsub {\n bottom: -0.25em; }\n\n/* Embedded content\n ========================================================================== */\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\nimg {\n border: 0; }\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\nsvg:not(:root) {\n overflow: hidden; }\n\n/* Grouping content\n ========================================================================== */\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n/**\n * Address differences between Firefox and other browsers.\n */\nhr {\n box-sizing: content-box;\n height: 0; }\n\n/**\n * Contain overflow in all browsers.\n */\npre {\n overflow: auto; }\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\ncode,\npre {\n font-family: monospace;\n font-size: 1em; }\n\n/* Forms\n ========================================================================== */\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\nbutton,\ninput,\nselect,\ntextarea {\n color: inherit;\n /* 1 */\n font: inherit;\n /* 2 */\n margin: 0;\n /* 3 */ }\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\nbutton {\n overflow: visible; }\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\nbutton,\nselect {\n text-transform: none; }\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\nbutton,\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n /* 2 */\n cursor: pointer;\n /* 3 */ }\n\n/**\n * Re-set default cursor for disabled elements.\n */\nbutton[disabled],\nhtml input[disabled] {\n cursor: default; }\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0; }\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\ninput {\n line-height: normal; }\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n/**\n * Define consistent border, margin, and padding.\n */\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\nlegend {\n border: 0;\n /* 1 */\n padding: 0;\n /* 2 */ }\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\ntextarea {\n overflow: auto; }\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n/* Tables\n ========================================================================== */\n/**\n * Remove most spacing between table cells.\n */\ntable {\n border-collapse: collapse;\n border-spacing: 0; }\n\ntd,\nth {\n padding: 0; }\n\nhtml {\n box-sizing: border-box; }\n\n*, *::after, *::before {\n box-sizing: inherit; }\n\n.ct-axis-title {\n fill: rgba(255, 255, 255, 0.8);\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n\n.ct-label {\n fill: rgba(255, 255, 255, 0.8);\n color: rgba(255, 255, 255, 0.8);\n font-size: 0.75rem;\n line-height: 1; }\n .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start;\n transform: translate(-4px, 0%) rotate(45deg); }\n .ct-label.ct-vertical.ct-start {\n align-items: flex-end;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end;\n transform: translate(0, 20%); }\n .ct-label.ct-vertical.ct-end {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-line .ct-label,\n.ct-chart-bar .ct-label {\n display: flex; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: center;\n text-align: center;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {\n align-items: flex-end;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {\n align-items: flex-start;\n justify-content: flex-start;\n text-align: left;\n text-anchor: start; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {\n align-items: center;\n justify-content: flex-end;\n text-align: right;\n text-anchor: end; }\n\n.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {\n align-items: center;\n justify-content: flex-start;\n text-align: left;\n text-anchor: end; }\n\n.ct-grid {\n stroke: rgba(255, 255, 255, 0.3);\n stroke-width: 1px;\n stroke-dasharray: 2px; }\n\n.ct-point {\n stroke-width: 4px;\n stroke-linecap: round; }\n\n.ct-line {\n fill: none;\n stroke-width: 2px; }\n\n.ct-area {\n stroke: none;\n fill-opacity: 0.1; }\n\n.ct-bar {\n fill: none;\n stroke-width: 10px; }\n\n.ct-series-a .ct-point, .ct-series-a .ct-line, .ct-series-a .ct-bar {\n stroke: #f05b4f; }\n\n.ct-series-a .ct-slice-pie, .ct-series-a .ct-area {\n fill: #f05b4f; }\n\n.ct-series-b .ct-point, .ct-series-b .ct-line, .ct-series-b .ct-bar {\n stroke: #6188e2; }\n\n.ct-series-b .ct-slice-pie, .ct-series-b .ct-area {\n fill: #6188e2; }\n\n.ct-series-c .ct-point, .ct-series-c .ct-line, .ct-series-c .ct-bar {\n stroke: #59922b; }\n\n.ct-series-c .ct-slice-pie, .ct-series-c .ct-area {\n fill: #59922b; }\n\n.ct-series-d .ct-point, .ct-series-d .ct-line, .ct-series-d .ct-bar {\n stroke: #eacf7d; }\n\n.ct-series-d .ct-slice-pie, .ct-series-d .ct-area {\n fill: #eacf7d; }\n\n.ct-series-e .ct-point, .ct-series-e .ct-line, .ct-series-e .ct-bar {\n stroke: #a748ca; }\n\n.ct-series-e .ct-slice-pie, .ct-series-e .ct-area {\n fill: #a748ca; }\n\n.ct-wide {\n display: block;\n position: relative;\n width: 100%; }\n .ct-wide:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 56.25%; }\n .ct-wide:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-wide > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.ct-narrow {\n display: block;\n position: relative;\n width: 100%; }\n .ct-narrow:before {\n display: block;\n float: left;\n content: \"\";\n width: 0;\n height: 0;\n padding-bottom: 66.6666666667%; }\n .ct-narrow:after {\n content: \"\";\n display: table;\n clear: both; }\n .ct-narrow > svg {\n display: block;\n position: absolute;\n top: 0;\n left: 0; }\n\n.center {\n text-align: center; }\n\nhtml {\n font-family: Arial, sans-serif;\n color: #D0D0D0;\n background: #131315; }\n\nhtml, body {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none;\n width: 100%;\n height: 100%;\n overflow: hidden; }\n\na, a:visited, a:link {\n color: #5abfff;\n text-decoration: none; }\n\na:hover {\n color: #5abfff;\n text-decoration: underline; }\n\n/* Main outer container */\n#outer {\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n flex-direction: row; }\n\n@media screen and (max-width: 544px) {\n #outer {\n display: block;\n overflow-y: scroll; } }\n\n#menu {\n flex: 0 0 15rem;\n background: #2bab5f; }\n #menu > * {\n display: block;\n text-decoration: none;\n padding: 0.6180469716rem 1rem;\n white-space: nowrap;\n word-wrap: normal;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n #menu #brand {\n color: white;\n background: #218248;\n font-size: 120%;\n text-align: center;\n position: relative;\n margin-bottom: 1rem; }\n @media screen and (max-width: 544px) {\n #menu #brand {\n background: #2bab5f;\n cursor: pointer; }\n #menu #brand:after {\n position: absolute;\n color: rgba(0, 0, 0, 0.2);\n right: 1rem;\n content: '>';\n top: 50%;\n font-size: 120%;\n font-weight: bold;\n transform: translate(0, -50%) rotate(90deg); } }\n #menu.expanded #brand {\n background: #218248; }\n @media screen and (max-width: 544px) {\n #menu.expanded #brand:after {\n transform: translate(0, -50%) rotate(-90deg); } }\n #menu a {\n font-size: 130%;\n color: white;\n transition: background-color 0.2s;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.4); }\n #menu a:hover, #menu a.selected {\n background: #1bd886;\n text-shadow: 0 0 5px rgba(0, 0, 0, 0.6); }\n #menu a.selected {\n position: relative;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); }\n #menu a:before {\n content: \"▸\";\n padding-right: .5rem;\n position: relative;\n top: -0.1rem; }\n @media screen and (max-width: 544px) {\n #menu a {\n display: none; } }\n #menu.expanded a {\n display: block; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #menu {\n flex-basis: 10rem; }\n #menu #brand {\n font-size: 95%;\n margin-bottom: 0.6180469716rem; }\n #menu a {\n font-size: 105%; }\n #menu > * {\n padding: 0.3819820591rem 0.6180469716rem; } }\n\n#content {\n flex-grow: 1;\n overflow-y: auto;\n padding: 1rem; }\n @media screen and (max-width: 544px) {\n #content {\n padding: 0.6180469716rem; } }\n #content > * {\n margin-left: auto;\n margin-right: auto; }\n #content h1 {\n text-align: center;\n font-size: 2.2806973457em;\n margin-top: 0;\n margin-bottom: 1rem; }\n #content h2 {\n font-size: 1.423828125em;\n margin-bottom: 0.6180469716rem; }\n #content td, #content th {\n padding: 0.3819820591rem; }\n #content tbody th {\n text-align: right;\n width: 130px;\n color: white; }\n\n.Box {\n display: block;\n max-width: 900px;\n margin-top: 1rem;\n padding: 0.6180469716rem;\n border-radius: 3px;\n background-color: rgba(255, 255, 255, 0.07); }\n @media screen and (max-width: 544px) {\n .Box {\n margin-top: 0.6180469716rem; } }\n h1 + .Box {\n margin-top: 0; }\n .Box h2 {\n margin-top: 0; }\n .Box.wide {\n width: initial;\n max-width: initial; }\n .Box.medium {\n max-width: 1200px; }\n\n.Modal {\n position: fixed;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: opacity .5s;\n background: rgba(0, 0, 0, 0.65);\n opacity: 0; }\n .Modal.visible {\n opacity: 1; }\n .Modal.hidden {\n display: none; }\n\n.Dialog {\n margin: 0.6180469716rem;\n padding: 1rem 0.6180469716rem;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n flex: 0 1 30rem;\n background: #1c1c1e;\n border-left: 6px solid #217b3a;\n border-right: 6px solid #217b3a;\n box-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n border-radius: 6px; }\n\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\nbutton, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .button {\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 2px;\n padding: 0 0.6em;\n border: 0 none;\n outline: 0 none !important;\n line-height: 1.8em;\n font-size: 1.1em;\n margin-bottom: 3px;\n min-width: 5em;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n /*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, 0.8); }\n button:active, input[type=\"button\"]:active, input[type=\"reset\"]:active, input[type=\"submit\"]:active, .button:active {\n position: relative;\n top: 2px; }\n button.narrow, input[type=\"button\"].narrow, input[type=\"reset\"].narrow, input[type=\"submit\"].narrow, .button.narrow {\n min-width: initial; }\n\ninput[type=\"submit\"], .btn-green {\n background-color: #2ca94b;\n box-shadow: 0 3px 0 #1d7032;\n text-decoration: none !important; }\n input[type=\"submit\"], input[type=\"submit\"]:link, input[type=\"submit\"]:visited, .btn-green, .btn-green:link, .btn-green:visited {\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"]:active, input[type=\"submit\"].active, input[type=\"submit\"].selected, .btn-green:hover, .btn-green:active, .btn-green.active, .btn-green.selected {\n background-color: #28ba5c;\n color: #FEFEFE; }\n input[type=\"submit\"]:hover, input[type=\"submit\"].selected, input[type=\"submit\"].active, .btn-green:hover, .btn-green.selected, .btn-green.active {\n box-shadow: 0 3px 0 #1a773b; }\n input[type=\"submit\"]:active, .btn-green:active {\n box-shadow: 0 1px 0 #1a773b; }\n\ninput[type=\"reset\"], .btn-red {\n background-color: #D04E51;\n box-shadow: 0 3px 0 #aa2d30;\n text-decoration: none !important; }\n input[type=\"reset\"], input[type=\"reset\"]:link, input[type=\"reset\"]:visited, .btn-red, .btn-red:link, .btn-red:visited {\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"]:active, input[type=\"reset\"].active, input[type=\"reset\"].selected, .btn-red:hover, .btn-red:active, .btn-red.active, .btn-red.selected {\n background-color: #d4403f;\n color: #FEFEFE; }\n input[type=\"reset\"]:hover, input[type=\"reset\"].selected, input[type=\"reset\"].active, .btn-red:hover, .btn-red.selected, .btn-red.active {\n box-shadow: 0 3px 0 #9e2423; }\n input[type=\"reset\"]:active, .btn-red:active {\n box-shadow: 0 1px 0 #9e2423; }\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select {\n border: 0 none;\n border-bottom: 2px solid #217b3a;\n background-color: #303030;\n color: white;\n padding: 6px;\n line-height: 1em;\n outline: 0 none !important;\n -moz-outline: 0 none !important;\n font-weight: normal; }\n input[type=\"number\"]:focus, input[type=\"number\"]:hover, input[type=\"password\"]:focus, input[type=\"password\"]:hover, input[type=\"text\"]:focus, input[type=\"text\"]:hover, textarea:focus, textarea:hover, select:focus, select:hover {\n border-bottom-color: #28bc65; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea {\n -webkit-user-select: text;\n -khtml-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: text; }\n\ntextarea {\n font-family: monospace;\n line-height: 1.2em;\n display: block; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.4em;\n padding: 3.5px;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\nform {\n border: 0 none;\n margin: 0;\n padding: 0;\n text-decoration: none; }\n\ninput[type=\"number\"], input[type=\"password\"], input[type=\"text\"], textarea, select, label.select-wrap {\n width: 250px; }\n\nform .Row {\n vertical-align: middle;\n margin: 14px auto;\n text-align: left;\n display: flex;\n flex-direction: row; }\n form .Row:first-child {\n margin-top: 0; }\n form .Row:last-child {\n margin-bottom: 0; }\n form .Row .spacer {\n width: 130px; }\n @media screen and (max-width: 544px) {\n form .Row .spacer {\n display: none; } }\n form .Row.buttons input, form .Row.buttons .button {\n margin-right: 0.6180469716rem; }\n form .Row.centered {\n justify-content: center; }\n form .Row.message {\n font-size: 1em;\n text-shadow: 1px 1px 3px black;\n text-align: center; }\n form .Row.message.error {\n color: crimson; }\n form .Row.message.ok {\n color: #0fe851; }\n form .Row.separator {\n padding-top: 14px;\n border-top: 2px solid rgba(255, 255, 255, 0.1); }\n form .Row textarea {\n display: inline-block;\n vertical-align: top;\n min-height: 10rem;\n flex-grow: 1;\n resize: vertical; }\n form .Row label {\n font-weight: bold;\n color: white;\n display: inline-block;\n width: 130px;\n text-align: right;\n text-shadow: 1px 1px 3px black;\n padding: 8px;\n align-self: flex-start;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none; }\n form .Row .checkbox-wrap {\n display: inline-block;\n width: 130px;\n padding: 8px;\n text-align: right;\n align-self: flex-start; }\n form .Row .checkbox-wrap input[type=checkbox] {\n margin: auto;\n width: auto;\n height: auto; }\n form .Row .checkbox-wrap + label {\n width: 250px;\n padding-left: 0;\n text-align: left;\n cursor: pointer; }\n @media screen and (max-width: 544px) {\n form .Row {\n flex-direction: column; }\n form .Row.buttons, form .Row.centered {\n flex-direction: row; }\n form .Row.buttons {\n justify-content: center; }\n form .Row.buttons :last-child {\n margin-right: 0; }\n form .Row label {\n padding-left: 0;\n text-align: left;\n width: auto; }\n form .Row .checkbox-wrap {\n order: 1;\n text-align: left;\n padding-bottom: 0;\n border-radius: .4px;\n width: auto; }\n form .Row .checkbox-wrap + label {\n width: auto; }\n form .Row input[type=\"number\"], form .Row input[type=\"password\"], form .Row input[type=\"text\"], form .Row textarea, form .Row textarea {\n width: 100%; } }\n\nform span.required {\n color: red; }\n\n.RadioGroup {\n display: inline-block;\n line-height: 1.5em;\n vertical-align: middle; }\n .RadioGroup label {\n width: auto;\n text-align: left;\n cursor: pointer;\n font-weight: normal; }\n .RadioGroup input[type=\"radio\"] {\n vertical-align: middle;\n margin: 0 0 0 5px; }\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n select {\n padding-right: 18px; } }\n\nselect {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n line-height: 1.4em;\n padding: 3.5px;\n padding-right: 1em; }\n select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 white; }\n select option {\n background: #303030; }\n\nlabel.select-wrap {\n position: relative;\n display: inline !important;\n margin: 0 !important;\n padding: 0 !important;\n width: auto !important; }\n label.select-wrap:after {\n content: '<>';\n /* will be rotated */\n font-family: \"Consolas\", monospace;\n font-weight: bold;\n color: #28bc65;\n top: 50%;\n -webkit-transform: translate(0, -50%) rotate(90deg);\n -moz-transform: translate(0, -50%) rotate(90deg);\n -ms-transform: translate(0, -50%) rotate(90deg);\n -o-transform: translate(0, -50%) rotate(90deg);\n transform: translate(0, -50%) rotate(90deg);\n right: 2px;\n position: absolute;\n z-index: 100;\n pointer-events: none; }\n\n#ap-list {\n column-count: 3;\n column-gap: 0;\n margin: 0 -0.2360828548rem; }\n @media screen and (min-width: 545px) and (max-width: 1000px) {\n #ap-list {\n column-count: 2; } }\n @media screen and (max-width: 544px) {\n #ap-list {\n column-count: 1; } }\n\n#ap-loader {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 5px;\n padding: 0.3819820591rem;\n margin-bottom: 0.3819820591rem; }\n\n#ap-box {\n padding-bottom: 0.3819820591rem; }\n\n#psk-modal form {\n display: flex;\n align-items: center;\n margin: 0.3819820591rem; }\n #psk-modal form > * {\n margin-left: 0.3819820591rem;\n margin-right: 0.3819820591rem; }\n #psk-modal form > *:first-child {\n margin-left: 0; }\n #psk-modal form > *:last-child {\n margin-right: 0; }\n #psk-modal form input[type=password] {\n min-width: 5rem; }\n\n.AP {\n break-inside: avoid-column;\n max-width: 500px;\n padding: 0.2360828548rem; }\n .AP.selected .inner {\n background: #43de81 !important;\n cursor: default;\n top: 0 !important; }\n .AP .inner {\n cursor: pointer;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n position: relative;\n border-radius: 3px;\n color: #222;\n background: #afafaf;\n transition: background-color 0.5s;\n display: flex; }\n .AP .inner:active {\n left: 0;\n top: 1px; }\n .AP .inner:hover {\n background: white; }\n .AP .inner > * {\n padding: 0.6180469716rem;\n white-space: nowrap;\n word-wrap: normal; }\n .AP .inner .rssi {\n min-width: 2rem;\n flex: 0 0 15%;\n text-align: right; }\n .AP .inner .rssi:after {\n padding-left: 0.090179415rem;\n content: '%';\n font-size: 0.8888888889em; }\n .AP .inner .essid {\n flex: 1 1 70%;\n min-width: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: bold; }\n .AP .inner .auth {\n flex: 0 0 15%; }\n\n.page-home #rssi-perc:after {\n padding-left: 0.1459102934rem;\n content: '%';\n font-size: 0.8888888889em; }\n\n.page-home #rssi-dbm:after {\n padding-left: 0.1459102934rem;\n content: 'dBm';\n font-size: 0.8888888889em; }\n","/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n */\n\n*, *:before, *:after {\n\tbox-sizing: border-box;\n}\n\n\nhtml {\n font-family: sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n margin: 0;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\n\n//article,\n//aside,\n//details,\n//figcaption,\nfigure,\n//footer,\n//header,\n//hgroup,\n//main,\n//menu,\nnav\n//section,\n//summary\n{\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\n//audio,\ncanvas,\nprogress\n//video\n{\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n//\n//audio:not([controls]) {\n// display: none;\n// height: 0;\n//}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n\n[hidden]\n//template\n{\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * Improve readability of focused elements when they are also in an\n * active/hover state.\n */\n\na:active,\na:hover {\n outline: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n\n//abbr[title] {\n// border-bottom: 1px dotted;\n//}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n\nb\n//strong\n{\n font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n//\n//dfn {\n// font-style: italic;\n//}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\nh2 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n//\n//mark {\n// background: #ff0;\n// color: #000;\n//}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\n\nimg {\n border: 0;\n}\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n\n//figure {\n// margin: 1em 40px;\n//}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\n//kbd,\npre\n//samp\n{\n font-family: monospace;\n font-size: 1em;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\n\nbutton,\ninput,\n//optgroup,\nselect,\ntextarea {\n color: inherit; /* 1 */\n font: inherit; /* 2 */\n margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\n\nbutton {\n overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n\nbutton,\n//html input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\n//input[type=\"number\"]::-webkit-inner-spin-button,\n//input[type=\"number\"]::-webkit-outer-spin-button {\n// height: auto;\n//}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n */\n//\n//input[type=\"search\"] {\n// -webkit-appearance: textfield; /* 1 */\n// box-sizing: content-box; /* 2 */\n//}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n//\n//input[type=\"search\"]::-webkit-search-cancel-button,\n//input[type=\"search\"]::-webkit-search-decoration {\n// -webkit-appearance: none;\n//}\n\n/**\n * Define consistent border, margin, and padding.\n */\n//\n//fieldset {\n// border: 1px solid #c0c0c0;\n// margin: 0 2px;\n// padding: 0.35em 0.625em 0.75em;\n//}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n border: 0; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n//\n//optgroup {\n// font-weight: bold;\n//}\n\n/* Tables\n ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","@charset \"UTF-8\";\n\n@if $border-box-sizing == true {\n html { // http://bit.ly/1qk2tVR\n box-sizing: border-box;\n }\n\n * {\n &,\n &::after,\n &::before {\n box-sizing: inherit;\n }\n }\n}\n","@import \"chartist-settings\";\n\n@mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {\n\tdisplay: block;\n\tposition: relative;\n\twidth: $width;\n\n\t&:before {\n\t\tdisplay: block;\n\t\tfloat: left;\n\t\tcontent: \"\";\n\t\twidth: 0;\n\t\theight: 0;\n\t\tpadding-bottom: $ratio * 100%;\n\t}\n\n\t&:after {\n\t\tcontent: \"\";\n\t\tdisplay: table;\n\t\tclear: both;\n\t}\n\n\t> svg {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n\n@mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {\n\talign-items: $ct-text-align;\n\tjustify-content: $ct-text-justify;\n\n\t// Fallback to text-align for non-flex browsers\n\t@if ($ct-text-justify == 'flex-start') {\n\t\ttext-align: left;\n\t} @else if ($ct-text-justify == 'flex-end') {\n\t\ttext-align: right;\n\t} @else {\n\t\ttext-align: center;\n\t}\n}\n\n@mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {\n\tfill: $ct-text-color;\n\tcolor: $ct-text-color;\n\tfont-size: $ct-text-size;\n\tline-height: $ct-text-line-height;\n}\n\n@mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {\n\tstroke: $ct-grid-color;\n\tstroke-width: $ct-grid-width;\n\n\t@if ($ct-grid-dasharray) {\n\t\tstroke-dasharray: $ct-grid-dasharray;\n\t}\n}\n\n@mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {\n\tstroke-width: $ct-point-size;\n\tstroke-linecap: $ct-point-shape;\n}\n\n@mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {\n\tfill: none;\n\tstroke-width: $ct-line-width;\n\n\t@if ($ct-line-dasharray) {\n\t\tstroke-dasharray: $ct-line-dasharray;\n\t}\n}\n\n@mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {\n\tstroke: none;\n\tfill-opacity: $ct-area-opacity;\n}\n\n@mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {\n\tfill: none;\n\tstroke-width: $ct-bar-width;\n}\n\n//@mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {\n// fill: none;\n// stroke-width: $ct-donut-width;\n//}\n\n@mixin ct-chart-series-color($color) {\n\t.ct-point, .ct-line, .ct-bar /*, .ct-slice-donut*/\n\t{\n\t\tstroke: $color;\n\t}\n\n\t.ct-slice-pie, .ct-area {\n\t\tfill: $color;\n\t}\n}\n\n@mixin ct-chart(\n\t$ct-container-ratio: $ct-container-ratio,\n\t$ct-text-color: $ct-text-color,\n\t$ct-text-size: $ct-text-size,\n\t$ct-grid-color: $ct-grid-color,\n\t$ct-grid-width: $ct-grid-width,\n\t$ct-grid-dasharray: $ct-grid-dasharray,\n\t$ct-point-size: $ct-point-size,\n\t$ct-point-shape: $ct-point-shape,\n\t$ct-line-width: $ct-line-width,\n\t$ct-bar-width: $ct-bar-width,\n\t//$ct-donut-width: $ct-donut-width,\n\t$ct-series-names: $ct-series-names,\n\t$ct-series-colors: $ct-series-colors) {\n\n\n\t.ct-axis-title {\n\t\tfill: $ct-axis-label-color;\n\t\t@include noselect;\n\t}\n\n\t// --- Label ---\n\t.ct-label {\n\t\t@include ct-chart-label($ct-text-color, $ct-text-size);\n\n\t\t&.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start; // Fallback for browsers that don't support foreignObjects\n\t\t}\n\n\t\t&.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\ttext-anchor: start;\n\n\t\t\t// EDIT: added for angled horiz labels\n\t\t\ttransform: translate(-4px, 0%) rotate(45deg);\n\t\t}\n\n\t\t&.ct-vertical.ct-start {\n\t\t\t@include ct-align-justify(flex-end, flex-end);\n\t\t\ttext-anchor: end;\n\n\t\t\ttransform: translate(0, 20%);\n\t\t}\n\n\t\t&.ct-vertical.ct-end {\n\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\ttext-anchor: start;\n\t\t}\n\t}\n\n\t.ct-chart-line .ct-label,\n\t.ct-chart-bar .ct-label {\n\t\tdisplay: flex;\n\t}\n\n\t// --- Bar labels ---\n\n\t.ct-chart-bar {\n\t\t.ct-label.ct-horizontal.ct-start {\n\t\t\t@include ct-align-justify(flex-end, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t.ct-label.ct-horizontal.ct-end {\n\t\t\t@include ct-align-justify(flex-start, center);\n\t\t\ttext-anchor: start;\n\t\t}\n\n\t\t&.ct-horizontal-bars .ct-label {\n\t\t\t&.ct-horizontal.ct-start {\n\t\t\t\t@include ct-align-justify(flex-end, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-horizontal.ct-end {\n\t\t\t\t@include ct-align-justify(flex-start, flex-start);\n\t\t\t\ttext-anchor: start;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-start {\n\t\t\t\t//@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);\n\t\t\t\t@include ct-align-justify(center, flex-end);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\n\t\t\t&.ct-vertical.ct-end {\n\t\t\t\t@include ct-align-justify(center, flex-start);\n\t\t\t\ttext-anchor: end;\n\t\t\t}\n\t\t}\n\t}\n\n\t.ct-grid {\n\t\t@include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);\n\t}\n\n\t.ct-point {\n\t\t@include ct-chart-point($ct-point-size, $ct-point-shape);\n\t}\n\n\t.ct-line {\n\t\t@include ct-chart-line($ct-line-width);\n\t}\n\n\t.ct-area {\n\t\t@include ct-chart-area();\n\t}\n\n\t.ct-bar {\n\t\t@include ct-chart-bar($ct-bar-width);\n\t}\n\n\t//.ct-slice-donut {\n\t// @include ct-chart-donut($ct-donut-width);\n\t//}\n\n\t@if $ct-include-colored-series {\n\t\t@for $i from 0 to length($ct-series-names) {\n\t\t\t.ct-series-#{nth($ct-series-names, $i + 1)} {\n\t\t\t\t$color: nth($ct-series-colors, $i + 1);\n\t\t\t\t@include ct-chart-series-color($color);\n\t\t\t}\n\t\t}\n\t}\n}\n\n@if $ct-include-classes {\n\t@include ct-chart();\n\n\t@if $ct-include-alternative-responsive-containers {\n\t\t@for $i from 0 to length($ct-scales-names) {\n\t\t\t.#{nth($ct-scales-names, $i + 1)} {\n\t\t\t\t@include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));\n\t\t\t}\n\t\t}\n\t}\n}\n","// Scales for responsive SVG containers\n$ct-scales_orig: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;\n$ct-scales-names_orig: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;\n\n$ct-scales: ((9/16), (2/3));\n$ct-scales-names: (ct-wide, ct-narrow);\n\n\n// Container ratio\n$ct-container-ratio: (1/1.618) !default;\n\n// Text styles for labels\n$ct-text-color: rgba(white, 0.8) !default;\n$ct-text-size: 0.75rem !default;\n$ct-text-align: flex-start !default;\n$ct-text-justify: flex-start !default;\n$ct-text-line-height: 1;\n\n$ct-axis-label-color: rgba(white, 0.8) !default;\n\n// Grid styles\n$ct-grid-color: rgba(white, 0.3) !default;\n$ct-grid-dasharray: 2px !default;\n$ct-grid-width: 1px !default;\n\n// Line chart properties\n$ct-line-width: 2px !default;\n$ct-line-dasharray: false !default;\n$ct-point-size: 4px !default;\n// Line chart point, can be either round or square\n$ct-point-shape: round !default;\n// Area fill transparency between 0 and 1\n$ct-area-opacity: 0.1 !default;\n\n// Bar chart bar width\n$ct-bar-width: 10px !default;\n\n// Donut width (If donut width is to big it can cause issues where the shape gets distorted)\n$ct-donut-width: 60px !default;\n\n// If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you\n// should set this property to false\n$ct-include-classes: true !default;\n\n// If this is set to true the CSS will contain colored series. You can extend or change the color with the\n// properties below\n$ct-include-colored-series: $ct-include-classes !default;\n\n// If set to true this will include all responsive container variations using the scales defined at the top of the script\n$ct-include-alternative-responsive-containers: $ct-include-classes !default;\n\n// Series names and colors. This can be extended or customized as desired. Just add more series and colors.\n$ct-series-names: (a, b, c, d, e) !default;\n$ct-series-colors: (\n #f05b4f,\n #6188e2,\n #59922b,\n #eacf7d,\n #a748ca\n) !default;\n","\n@mixin click-through() {\n\tpointer-events: none;\n}\n\n\n// Disallow text selection\n@mixin noselect() {\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n\n// Allow text selection\n@mixin can-select() {\n\t-webkit-user-select: text;\n\t-khtml-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n\n\tcursor: text;\n}\n","@import \"normalize\";\n@import \"lib/bourbon/bourbon\";\n\n@import \"grid-settings\";\n@import \"lib/neat/neat\";\n\n@import \"utils/index\";\n\n@import \"lib/chartist/chartist\";\n\n$form-label-w: 130px;\n$form-label-gap: 8px;\n$form-field-w: 250px;\n\n$c-form-label-fg: white;\n$c-form-field-bg: #303030;\n$c-form-field-fg: white;\n$c-form-highlight: #217b3a;\n$c-form-highlight-a: #28bc65;\n\n@function dist($x) {\n\t@return modular-scale($x, 1rem, $golden);\n}\n\n@function fsize($x) {\n\t@return modular-scale($x, 1em, $major-second);\n}\n\n.center {\n\ttext-align: center;\n}\n\n@import \"layout/index\";\n@import \"form/index\";\n\n// import all our pages\n@import \"pages/wifi\";\n@import \"pages/home\";\n","html {\n\tfont-family: Arial, sans-serif;\n\tcolor: #D0D0D0;\n\tbackground: #131315;\n}\n\nhtml, body {\n\t@include naked();\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n}\n\na, a:visited, a:link {\n\tcolor: #5abfff;\n\ttext-decoration: none;\n}\n\na:hover {\n\tcolor: #5abfff;\n\ttext-decoration: underline;\n}\n","// Add a highlight for debugging\n@mixin highlight($color) {\n\toutline: 1px solid $color;\n\tbackground: rgba($color, .05);\n\tbox-shadow: 0 0 2px 2px rgba($color, .2), inset 0 0 2px 2px rgba($color, .2);\n}\n\n// Ellipsis, but for block elements\n@mixin block-ellipsis($width: 100%) {\n\tdisplay: block;\n\tmax-width: $width;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n\n// No margins, padding, borders\n@mixin naked() {\n\tborder: 0 none;\n\tmargin: 0;\n\tpadding: 0;\n\ttext-decoration: none;\n}\n\n@mixin translate($x, $y) {\n\t@include transform(translate($x, $y));\n}\n\n// Disallow wrapping\n@mixin nowrap() {\n\twhite-space: nowrap;\n\tword-wrap: normal;\n}\n","/* Main outer container */\n#outer {\n\tdisplay: flex;\n\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\tleft: 0;\n\tright: 0;\n\ttop: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\n\tflex-direction: row;\n}\n\n@include media($phone) {\n\t#outer {\n\t\tdisplay: block;\n\t\toverflow-y: scroll;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).\n///\n/// @param {List} $query\n/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.\n/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).\n///\n/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.\n///\n/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).\n///\n///\n/// @param {Number (unitless)} $total-columns [$grid-columns]\n/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.\n///\n/// @example scss - Usage\n/// .responsive-element {\n/// @include media(769px) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// .new-context-element {\n/// @include media(min-width 320px max-width 480px, 6) {\n/// @include span-columns(6);\n/// }\n/// }\n///\n/// @example css - CSS Output\n/// @media screen and (min-width: 769px) {\n/// .responsive-element {\n/// display: block;\n/// float: left;\n/// margin-right: 2.35765%;\n/// width: 48.82117%;\n/// }\n///\n/// .responsive-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n///\n/// @media screen and (min-width: 320px) and (max-width: 480px) {\n/// .new-context-element {\n/// display: block;\n/// float: left;\n/// margin-right: 4.82916%;\n/// width: 100%;\n/// }\n///\n/// .new-context-element:last-child {\n/// margin-right: 0;\n/// }\n/// }\n\n@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {\n @if length($query) == 1 {\n @media screen and ($default-feature: nth($query, 1)) {\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n } @else {\n $loop-to: length($query);\n $media-query: \"screen and \";\n $default-grid-columns: $grid-columns;\n $grid-columns: $total-columns !global;\n\n @if is-not(is-even(length($query))) {\n $grid-columns: nth($query, $loop-to) !global;\n $loop-to: $loop-to - 1;\n }\n\n $i: 1;\n @while $i <= $loop-to {\n $media-query: $media-query + \"(\" + nth($query, $i) + \": \" + nth($query, $i + 1) + \") \";\n\n @if ($i + 1) != $loop-to {\n $media-query: $media-query + \"and \";\n }\n\n $i: $i + 2;\n }\n\n @media #{$media-query} {\n @content;\n $grid-columns: $default-grid-columns !global;\n }\n }\n}\n","#menu {\n\t$menu-bg: #2bab5f;\n\n\tflex: 0 0 15rem;\n\tbackground: $menu-bg;\n\n\t& > * {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t\tpadding: dist(-1) dist(0);\n\n\t\t@include nowrap;\n\t\t@include noselect;\n\t}\n\n\t#brand {\n\t\tcolor: white;\n\t\tbackground: darken($menu-bg, 10%);\n\t\tfont-size: 120%;\n\t\ttext-align: center;\n\t\tposition:relative;\n\n\t\tmargin-bottom: dist(0);\n\n\t\t@include media($phone) {\n\t\t\tbackground: $menu-bg;\n\t\t\tcursor: pointer;\n\n\t\t\t&:after {\n\t\t\t\tposition: absolute;\n\t\t\t\tcolor: rgba(black, .2);\n\t\t\t\tright: dist(0);\n\t\t\t\tcontent: '>';\n\t\t\t\ttop:50%;\n\t\t\t\tfont-size: 120%;\n\t\t\t\tfont-weight: bold;\n\t\t\t\ttransform: translate(0,-50%) rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t&.expanded #brand {\n\t\tbackground: darken($menu-bg, 10%);\n\n\t\t@include media($phone) {\n\t\t\t&:after { transform: translate(0,-50%) rotate(-90deg) }\n\t\t}\n\t}\n\n\n\ta {\n\t\tfont-size: 130%;\n\t\tcolor: white;\n\n\t\t$hl: #1bd886;\n\t\ttransition: background-color 0.2s;\n\t\ttext-shadow: 0 0 5px rgba(black, .4);\n\n\t\t&:hover, &.selected {\n\t\t\tbackground: $hl;\n\t\t\ttext-shadow: 0 0 5px rgba(black, .6);\n\t\t}\n\n\t\t&.selected {\n\t\t\tposition: relative;\n\t\t\tbox-shadow: 0 0 5px rgba(black, .5);\n\t\t}\n\n\t\t&:before {\n\t\t\tcontent: \"▸\";\n\t\t\tpadding-right: .5rem;\n\t\t\tposition: relative;\n\t\t\ttop: -0.1rem;\n\t\t}\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.expanded a { display:block }\n\n\t@include media($tablet) {\n\t\t#brand {\n\t\t\tfont-size: 95%;\n\t\t\tmargin-bottom: dist(-1);\n\t\t}\n\n\t\ta { font-size: 105%; }\n\n\t\tflex-basis: 10rem;\n\n\t\t& > * { padding: dist(-2) dist(-1);\t}\n\t}\n}\n","// Scaling Variables\n$golden: 1.618;\n$minor-second: 1.067;\n$major-second: 1.125;\n$minor-third: 1.2;\n$major-third: 1.25;\n$perfect-fourth: 1.333;\n$augmented-fourth: 1.414;\n$perfect-fifth: 1.5;\n$minor-sixth: 1.6;\n$major-sixth: 1.667;\n$minor-seventh: 1.778;\n$major-seventh: 1.875;\n$octave: 2;\n$major-tenth: 2.5;\n$major-eleventh: 2.667;\n$major-twelfth: 3;\n$double-octave: 4;\n\n$modular-scale-ratio: $perfect-fourth !default;\n$modular-scale-base: em($em-base) !default;\n\n@function modular-scale($increment, $value: $modular-scale-base, $ratio: $modular-scale-ratio) {\n $v1: nth($value, 1);\n $v2: nth($value, length($value));\n $value: $v1;\n\n // scale $v2 to just above $v1\n @while $v2 > $v1 {\n $v2: ($v2 / $ratio); // will be off-by-1\n }\n @while $v2 < $v1 {\n $v2: ($v2 * $ratio); // will fix off-by-1\n }\n\n // check AFTER scaling $v2 to prevent double-counting corner-case\n $double-stranded: $v2 > $v1;\n\n @if $increment > 0 {\n @for $i from 1 through $increment {\n @if $double-stranded and ($v1 * $ratio) > $v2 {\n $value: $v2;\n $v2: ($v2 * $ratio);\n } @else {\n $v1: ($v1 * $ratio);\n $value: $v1;\n }\n }\n }\n\n @if $increment < 0 {\n // adjust $v2 to just below $v1\n @if $double-stranded {\n $v2: ($v2 / $ratio);\n }\n\n @for $i from $increment through -1 {\n @if $double-stranded and ($v1 / $ratio) < $v2 {\n $value: $v2;\n $v2: ($v2 / $ratio);\n } @else {\n $v1: ($v1 / $ratio);\n $value: $v1;\n }\n }\n }\n\n @return $value;\n}\n","#content {\n\tflex-grow: 1;\n\n\toverflow-y: auto;\n\tpadding: dist(0);\n\t@include media($phone) {\n\t\tpadding: dist(-1);\n\t}\n\n\t& > * {\n\t\tmargin-left: auto;\n\t\tmargin-right: auto;\n\t}\n\n\th1 {\n\t\ttext-align: center;\n\t\tfont-size: fsize(7);\n\t\tmargin-top: 0;\n\t\tmargin-bottom: dist(0);\n\t}\n\n\th2 {\n\t\tfont-size: fsize(3);\n\t\tmargin-bottom: dist(-1);\n\t}\n\n\ttd, th {\n\t\tpadding: dist(-2);\n\t}\n\n\ttbody th {\n\t\ttext-align: right;\n\t\twidth: $form-label-w;\n\t\tcolor: $c-form-label-fg;\n\t}\n}\n",".Box {\n\tdisplay: block;\n\tmax-width: 900px;\n\n\tmargin-top: dist(0);\n\tpadding: dist(-1);\n\n\t@include media($phone) {\n\t\tmargin-top: dist(-1);\n\t}\n\n\th1 + & {\n\t\tmargin-top: 0;\n\t}\n\n\th2 {\n\t\tmargin-top: 0;\n\t}\n\n\tborder-radius: 3px;\n\tbackground-color: rgba(white, .07);\n\n\t&.wide {\n\t\twidth: initial;\n\t\tmax-width: initial;\n\t}\n\n\t&.medium {\n\t\tmax-width: 1200px;\n\t}\n}\n",".Modal {\n\tposition: fixed;\n\twidth: 100%; height: 100%;\n\tleft: 0; top: 0; right: 0; bottom: 0;\n\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\n\ttransition: opacity .5s;\n\tbackground: rgba(black, .65);\n\topacity: 0;\n\t&.visible { opacity: 1 }\n\t&.hidden { display: none }\n}\n\n.Dialog {\n\tmargin: dist(-1);\n\tpadding: dist(0) dist(-1);\n\toverflow: hidden;\n\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tflex: 0 1 30rem;\n\t//min-height: 15rem;\n\n\tbackground: #1c1c1e;\n\tborder-left: 6px solid $c-form-highlight;\n\tborder-right: 6px solid $c-form-highlight;\n\tbox-shadow: 0 0 2px 0 #434349, 0 0 6px 0 black;\n\n\tborder-radius: 6px;\n}\n","@import \"fancy_button_mixins\";\n\n#{$all-buttons}, .button {\n\t@include fancy-btn-base();\n\n\t// fontello\n/*\t&::before {\n\t\tmargin-right: .4em;\n\t}\n\n\t&.icononly::before {\n\t\tmargin-right: 0;\n\t}*/\n\n\t&.narrow {\n\t\tmin-width: initial;\n\t}\n\n\ttext-shadow: 1.5px 1.5px 2px rgba(black, 0.8);\n}\n\n\n\n\n$btn-gray-f: #DDDDDD;\n$btn-gray-b: #505050;\n$btn-gray-l: #343434; // line\n\n$btn-green-f: #FEFEFE;\n$btn-green-b: #2ca94b;\n$btn-green-fa: #FEFEFE;\n$btn-green-ba: #28ba5c;\n\n$btn-red-f: #FEFEFE;\n$btn-red-b: #D04E51;\n$btn-red-fa: #FEFEFE;\n$btn-red-ba: #d4403f;\n\n$btn-blue-f: #FEFEFE;\n$btn-blue-b: #3983cd;\n$btn-blue-fa: #FEFEFE;\n$btn-blue-ba: #2076C6;\n\n$btn-orange-f: #FEFEFE;\n$btn-orange-b: #dd8751;\n$btn-orange-fa: #FEFEFE;\n$btn-orange-ba: #C6733F;\n\n\ninput[type=\"submit\"], .btn-green {\n\t@include fancy-btn-colors($btn-green-f, $btn-green-b, $btn-green-fa, $btn-green-ba)\n}\n\ninput[type=\"reset\"], .btn-red {\n\t@include fancy-btn-colors($btn-red-f, $btn-red-b, $btn-red-fa, $btn-red-ba)\n}\n\n//&.blue {@include fancy-btn-colors($btn-blue-f, $btn-blue-b, $btn-blue-fa, $btn-blue-ba)}\n//&, &.orange {@include fancy-btn-colors($btn-orange-f, $btn-orange-b, $btn-orange-fa, $btn-orange-ba)}\n\n/*\n\n&[type=\"submit\"],\n&.gray-green {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-green-fa, $btn-green-ba, darken($btn-green-ba, 16)\n\t)\n}\n\n&.gray-blue {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-blue-fa, $btn-blue-ba, darken($btn-blue-ba, 16)\n\t)\n}\n\n&.gray-red {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-red-fa, $btn-red-ba, darken($btn-red-ba, 16)\n\t)\n}\n\n&.gray-orange {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-orange-fa, $btn-orange-ba, darken($btn-orange-ba, 16)\n\t)\n}\n\n// No change on hover - to be used for disabled buttons\n&.gray-gray {\n\t@include fancy-btn-colors-full(\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l,\n\t\t\t$btn-gray-f, $btn-gray-b, $btn-gray-l\n\t)\n}\n\n*/\n","\n// Button styling\n@mixin fancy-btn-base() {\n\ttext-align: center;\n\tcursor: pointer;\n\tdisplay: inline-block;\n\tborder-radius: 2px;\n\tpadding: 0 0.6em;\n\tborder: 0 none;\n\toutline: 0 none !important;\n\tline-height: 1.8em;\n\tfont-size: 1.1em;\n\tmargin-bottom: 3px;\n\tmin-width: 5em;\n\n\t@include noselect();\n\n\t//&[class^=\"icon-\"]::before, &[class*=\" icon-\"]::before {\n\t//\tmargin-left:0;\n\t//}\n\n\t&:active {\n\t\tposition: relative;\n\t\ttop: 2px;\n\t}\n\n\t//&, &:active, &:hover, &:visited {\n\t//\ttext-decoration: none;\n\t//}\n}\n\n@mixin fancy-btn-colors-full($text_p, $back_p, $side_p, $text_a, $back_a, $side_a) {\n\tbackground-color: $back_p;\n\tbox-shadow: 0 3px 0 $side_p;\n\ttext-decoration: none !important;\n\n\t&, &:link, &:visited {\n\t\tcolor: $text_p;\n\t}\n\n\t&:hover, &:active, &.active, &.selected {\n\t\tbackground-color: $back_a;\n\t\tcolor: $text_a;\n\t}\n\n\t&:hover, &.selected, &.active {\n\t\tbox-shadow: 0 3px 0 $side_a;\n\t}\n\n\t// thinner shadow\n\t&:active {\n\t\tbox-shadow: 0 1px 0 $side_a;\n\t}\n}\n\n@mixin fancy-btn-colors($text_p, $back_p, $text_a, $back_a) {\n\t@include fancy-btn-colors-full($text_p, $back_p, darken($back_p, 14), $text_a, $back_a, darken($back_a, 16));\n}\n","@import \"buttons\";\n\n#{$all-text-inputs}, select {\n\tborder: 0 none;\n\tborder-bottom: 2px solid $c-form-highlight;\n\tbackground-color: $c-form-field-bg;\n\tcolor: $c-form-field-fg;\n\tpadding: 6px;\n\tline-height: 1em;\n\toutline: 0 none !important;\n\t-moz-outline: 0 none !important;\n\tfont-weight: normal;\n\n\t&:focus, &:hover {\n\t\tborder-bottom-color: $c-form-highlight-a;\n\t}\n}\n\n#{$all-text-inputs} {\n\t@include can-select();\n}\n\ntextarea {\n\tfont-family: monospace;\n\tline-height: 1.2em;\n\tdisplay: block; // fixes weird bottom margin\n}\n\n@import \"select\";\n","\n// target chrome only\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n\tselect { padding-right: 18px }\n}\n\nselect {\n\t-webkit-appearance: none;\n\t-moz-appearance: none;\n\tappearance: none;\n\n\tcursor: pointer;\n\tline-height: 1.4em;\n\tpadding: 3.5px;\n\n\tpadding-right: 1em;\n\n\t// hack for firefox to disable dotted outline\n\t&:-moz-focusring {\n\t\tcolor: transparent;\n\t\ttext-shadow: 0 0 0 $c-form-field-fg;\n\t}\n\n\toption {\n\t\tbackground: $c-form-field-bg;\n\t}\n}\n\nlabel.select-wrap {\n\tposition: relative;\n\tdisplay: inline !important;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\twidth: auto !important;\n\n\t&:after {\n\t\tcontent: '<>'; /* will be rotated */\n\t\tfont-family: \"Consolas\", monospace;\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-highlight-a;\n\n\t\ttop: 50%;\n\t\t@include transform(translate(0, -50%) rotate(90deg));\n\n\t\tright: 2px;\n\n\t\tposition:absolute;\n\t\tz-index: 100;\n\n\t\tpointer-events: none;\n\t}\n}\n","@charset \"UTF-8\";\n\n/// A mixin for generating vendor prefixes on non-standardized properties.\n///\n/// @param {String} $property\n/// Property to prefix\n///\n/// @param {*} $value\n/// Value to use\n///\n/// @param {List} $prefixes\n/// Prefixes to define\n///\n/// @example scss - Usage\n/// .element {\n/// @include prefixer(border-radius, 10px, webkit ms spec);\n/// }\n///\n/// @example css - CSS Output\n/// .element {\n/// -webkit-border-radius: 10px;\n/// -moz-border-radius: 10px;\n/// border-radius: 10px;\n/// }\n///\n/// @require {variable} $prefix-for-webkit\n/// @require {variable} $prefix-for-mozilla\n/// @require {variable} $prefix-for-microsoft\n/// @require {variable} $prefix-for-opera\n/// @require {variable} $prefix-for-spec\n\n@mixin prefixer($property, $value, $prefixes) {\n @each $prefix in $prefixes {\n @if $prefix == webkit {\n @if $prefix-for-webkit {\n -webkit-#{$property}: $value;\n }\n } @else if $prefix == moz {\n @if $prefix-for-mozilla {\n -moz-#{$property}: $value;\n }\n } @else if $prefix == ms {\n @if $prefix-for-microsoft {\n -ms-#{$property}: $value;\n }\n } @else if $prefix == o {\n @if $prefix-for-opera {\n -o-#{$property}: $value;\n }\n } @else if $prefix == spec {\n @if $prefix-for-spec {\n #{$property}: $value;\n }\n } @else {\n @warn \"Unrecognized prefix: #{$prefix}\";\n }\n }\n}\n\n@mixin disable-prefix-for-all() {\n $prefix-for-webkit: false !global;\n $prefix-for-mozilla: false !global;\n $prefix-for-microsoft: false !global;\n $prefix-for-opera: false !global;\n $prefix-for-spec: false !global;\n}\n","// Unified Form wrapper\nform { @include naked(); }\n\n#{$all-text-inputs}, select, label.select-wrap {\n\twidth: $form-field-w;\n}\n\nform .Row {\n\tvertical-align: middle;\n\tmargin: 14px auto;\n\ttext-align: left;\n\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&:first-child {\n\t\tmargin-top: 0;\n\t}\n\n\t&:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.spacer {\n\t\twidth: $form-label-w;\n\n\t\t@include media($phone) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t&.buttons {\n\t\tinput, .button {\n\t\t\tmargin-right: dist(-1);\n\t\t}\n\t}\n\n\t&.centered {\n\t\tjustify-content: center;\n\t}\n\n\t&.message {\n\t\tfont-size: 1em;\n\t\t//margin-left: $label-gap + $w-labels;\n\t\ttext-shadow: 1px 1px 3px black;\n\t\ttext-align: center;\n\n\t\t&.error {\n\t\t\tcolor: crimson;\n\t\t}\n\n\t\t&.ok {\n\t\t\tcolor: #0fe851;\n\t\t}\n\t}\n\n\t&.separator {\n\t\tpadding-top: 14px;\n\t\tborder-top: 2px solid rgba(255, 255, 255, 0.1);\n\t}\n\n\ttextarea {\n\t\tdisplay: inline-block;\n\t\tvertical-align: top;\n\t\tmin-height: 10rem;\n\t\tflex-grow: 1;\n\n\t\tresize: vertical;\n\t}\n\n\tlabel {\n\t\tfont-weight: bold;\n\t\tcolor: $c-form-label-fg;\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\ttext-align: right;\n\t\ttext-shadow: 1px 1px 3px black;\n\n\t\tpadding: $form-label-gap;\n\t\talign-self: flex-start;\n\n\t\t@include noselect;\n\t}\n\n\t.checkbox-wrap {\n\t\tdisplay: inline-block;\n\t\twidth: $form-label-w;\n\t\tpadding: $form-label-gap;\n\t\ttext-align: right;\n\t\talign-self: flex-start;\n\n\t\tinput[type=checkbox] {\n\t\t\tmargin: auto;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\n\t\t& + label {\n\t\t\twidth: $form-field-w;\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t// special phone style\n\t@include media($phone) {\n\t\tflex-direction: column;\n\n\t\t&.buttons, &.centered {\n\t\t\tflex-direction: row;\n\t\t}\n\n\t\t&.buttons {\n\t\t\tjustify-content: center;\n\n\t\t\t// remove margin on lats button\n\t\t\t:last-child {\n\t\t\t\tmargin-right:0;\n\t\t\t}\n\t\t}\n\n\t\tlabel {\n\t\t\tpadding-left: 0;\n\t\t\ttext-align: left;\n\t\t\twidth: auto;\n\t\t}\n\n\t\t.checkbox-wrap {\n\t\t\torder: 1;\n\t\t\ttext-align: left;\n\t\t\tpadding-bottom: 0;\n\n\t\t\tborder-radius: .4px;\n\t\t\twidth: auto;\n\n\t\t\t& + label {\n\t\t\t\twidth: auto;\n\t\t\t}\n\t\t}\n\n\t\t#{$all-text-inputs}, textarea {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n}\n\n// red asterisk\nform span.required {\n\tcolor: red;\n}\n\n.RadioGroup {\n\tdisplay: inline-block;\n\tline-height: 1.5em;\n\tvertical-align: middle;\n\n\tlabel {\n\t\twidth: auto;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t\tfont-weight: normal;\n\t}\n\n\tinput[type=\"radio\"] {\n\t\tvertical-align: middle;\n\t\tmargin: 0 0 0 5px;\n\t}\n}\n","#ap-list {\n\tcolumn-count: 3;\n\tcolumn-gap: 0;\n\n\t@include media($tablet) {\n\t\tcolumn-count: 2;\n\t}\n\n\t@include media($phone) {\n\t\tcolumn-count: 1;\n\t}\n\n\tmargin: 0 (- dist(-3));\n}\n\n#ap-loader {\n\tbackground: rgba(white, .1);\n\tborder-radius: 5px;\n\tpadding: dist(-2);\n\tmargin-bottom: dist(-2);\n}\n\n#ap-box {\n\tpadding-bottom: dist(-2);\n}\n\n\n#psk-modal form {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin: dist(-2);\n\n\t& > * {\n\t\tmargin-left: dist(-2);\n\t\tmargin-right: dist(-2);\n\t\t&:first-child { margin-left: 0 }\n\t\t&:last-child { margin-right: 0 }\n\t}\n\n\tinput[type=password] {\n\t\tmin-width: 5rem;\n\t}\n}\n\n.AP {\n\t// can't use margins inside a column\n\n\tbreak-inside: avoid-column;\n\tmax-width: 500px;\n\tpadding: dist(-3);\n\n\t&.selected .inner {//#70dfa3\n\t\tbackground: #43de81 !important; // override the hover effect\n\t\tcursor: default;\n\t\ttop: 0 !important; // no click effect\n\t}\n\n\t// the actual silver box\n\t.inner {\n\t\tcursor: pointer;\n\t\t@include noselect;\n\n\t\tposition: relative;\n\t\t&:active {\n\t\t\tleft: 0;\n\t\t\ttop: 1px;\n\t\t}\n\n\t\tborder-radius: 3px;\n\t\tcolor: #222;\n\n\t\tbackground: #afafaf;\n\t\ttransition: background-color 0.5s;\n\t\t&:hover { background: white }\n\n\t\tdisplay: flex;\n\n\t\t& > * {\n\t\t\tpadding: dist(-1);\n\t\t\t@include nowrap;\n\t\t}\n\n\t\t.rssi {\n\t\t\tmin-width: 2rem;\n\t\t\tflex: 0 0 15%;\n\t\t\ttext-align: right;\n\n\t\t\t&:after {\n\t\t\t\tpadding-left: dist(-5);\n\t\t\t\tcontent: '%';\n\t\t\t\tfont-size: fsize(-1);\n\t\t\t}\n\t\t}\n\n\t\t.essid {\n\t\t\tflex: 1 1 70%;\n\t\t\tmin-width: 0;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\t.auth {\n\t\t\tflex: 0 0 15%;\n\t\t}\n\t}\n}\n",".page-home #rssi-perc:after {\n\tpadding-left: dist(-4);\n\tcontent: '%';\n\tfont-size: fsize(-1);\n}\n\n.page-home #rssi-dbm:after {\n\tpadding-left: dist(-4);\n\tcontent: 'dBm';\n\tfont-size: fsize(-1);\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/html_src/gulpfile.js b/html_src/gulpfile.js index 3977212..87648c7 100644 --- a/html_src/gulpfile.js +++ b/html_src/gulpfile.js @@ -3,6 +3,8 @@ var autoprefixer = require('autoprefixer'); elixir.config.css.autoprefix.options.browsers = ["> 2.5% in CZ"]; elixir.config.css.autoprefix.options.flexbox = "no-2009"; +elixir.config.css.cssnano.pluginOptions.discardComments = {removeAll: true}; +elixir.config.css.cssnano.pluginOptions.colormin = false; // var info = autoprefixer(elixir.config.css.autoprefix).info(); // console.log(info); diff --git a/html_src/js-src/waveform.js b/html_src/js-src/waveform.js index 5183523..8574d6c 100644 --- a/html_src/js-src/waveform.js +++ b/html_src/js-src/waveform.js @@ -77,7 +77,7 @@ var wfm = (function () { return; } - buildChart(resp.samples, 'Sample Nr.', 'ADC value'); + buildChart(json.samples, 'Sample Nr.', 'ADC value'); } wfm.init = function() { @@ -86,10 +86,19 @@ var wfm = (function () { // "success": true // }; - $('#load').on('click', function() { + function clickHdl() { var samples = $('#count').val(); - $().get('http://192.168.1.13/api/raw.json?n='+samples, onRxData, true, true); + //http://192.168.1.13 + $().get('/api/raw.json?n='+samples, onRxData, true, true); + } + + $('#load').on('click', clickHdl); + + $('#count').on('keyup', function(e) { + if (e.which == 13) { + clickHdl(); + } }); }; diff --git a/html_src/js/all.js b/html_src/js/all.js index f4aa49f..0587ade 100644 --- a/html_src/js/all.js +++ b/html_src/js/all.js @@ -1,5287 +1,2 @@ -/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */ -(function () { - 'use strict'; - - var readyfn = [], - loadedfn = [], - domready = false, - pageloaded = false, - jsonpcount = 0, - d = document, - w = window; - - // Fire any function calls on ready event - function fireReady() { - var i; - domready = true; - for (i = 0; i < readyfn.length; i += 1) { - readyfn[i](); - } - readyfn = []; - } - - // Fire any function calls on loaded event - function fireLoaded() { - var i; - pageloaded = true; - // For browsers with no DOM loaded support - if (!domready) { - fireReady(); - } - for (i = 0; i < loadedfn.length; i += 1) { - loadedfn[i](); - } - loadedfn = []; - } - - // Check DOM ready, page loaded - if (d.addEventListener) { - // Standards - d.addEventListener('DOMContentLoaded', fireReady, false); - w.addEventListener('load', fireLoaded, false); - } else if (d.attachEvent) { - // IE - d.attachEvent('onreadystatechange', fireReady); - // IE < 9 - w.attachEvent('onload', fireLoaded); - } else { - // Anything else - w.onload = fireLoaded; - } - - // Utility functions - - // Loop through node array - function nodeLoop(fn, nodes) { - var i; - // Good idea to walk up the DOM - for (i = nodes.length - 1; i >= 0; i -= 1) { - fn(nodes[i]); - } - } - - // Convert to camel case - function cssCamel(property) { - return property.replace(/-\w/g, function (result) {return result.charAt(1).toUpperCase(); }); - } - - // Get computed style - function computeStyle(elm, property) { - // IE, everything else or null - return (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null; - - } - - // Returns URI encoded query string pair - function queryPair(name, value) { - return encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+'); - } - - // Set CSS, important to wrap in try to prevent error thown on unsupported property - function setCss(elm, property, value) { - try { - elm.style[cssCamel(property)] = value; - } catch (e) {} - } - - // Show CSS - function showCss(elm) { - elm.style.display = ''; - // For elements still hidden by style block - if (computeStyle(elm, 'display') === 'none') { - elm.style.display = 'block'; - } - } - - // Serialize form & JSON values - function serializeData(nodes) { - var querystring = '', subelm, i, j; - if (nodes.constructor === Object) { // Serialize JSON data - for (subelm in nodes) { - if (nodes.hasOwnProperty(subelm)) { - if (nodes[subelm].constructor === Array) { - for (i = 0; i < nodes[subelm].length; i += 1) { - querystring += '&' + queryPair(subelm, nodes[subelm][i]); - } - } else { - querystring += '&' + queryPair(subelm, nodes[subelm]); - } - } - } - } else { // Serialize node data - nodeLoop(function (elm) { - if (elm.nodeName === 'FORM') { - for (i = 0; i < elm.elements.length; i += 1) { - subelm = elm.elements[i]; - - if (!subelm.disabled) { - switch (subelm.type) { - // Ignore buttons, unsupported XHR 1 form fields - case 'button': - case 'image': - case 'file': - case 'submit': - case 'reset': - break; - - case 'select-one': - if (subelm.length > 0) { - querystring += '&' + queryPair(subelm.name, subelm.value); - } - break; - - case 'select-multiple': - for (j = 0; j < subelm.length; j += 1) { - if (subelm[j].selected) { - querystring += '&' + queryPair(subelm.name, subelm[j].value); - } - } - break; - - case 'checkbox': - case 'radio': - if (subelm.checked) { - querystring += '&' + queryPair(subelm.name, subelm.value); - } - break; - - // Everything else including shinny new HTML5 input types - default: - querystring += '&' + queryPair(subelm.name, subelm.value); - } - } - } - } - }, nodes); - } - // Tidy up first & - return (querystring.length > 0) ? querystring.substring(1) : ''; - } - - // Class helper - function classHelper(classes, action, nodes) { - var classarray, search, i, has = false; - if (classes) { - // Trim any whitespace - classarray = classes.split(/\s+/); - nodeLoop(function (elm) { - for (i = 0; i < classarray.length; i += 1) { - search = new RegExp('\\b' + classarray[i] + '\\b', 'g'); - if (action === 'remove') { - elm.className = elm.className.replace(search, ''); - } else if (action === 'toggle') { - elm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i]; - } else if (action === 'has') { - if (elm.className.match(search)) { - has = true; - break; - } - } - } - }, nodes); - } - return has; - } - - // HTML insertion helper - function insertHtml(value, position, nodes) { - var tmpnodes, tmpnode; - if (value) { - nodeLoop(function (elm) { - // No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead - // Convert string to node. We can't innerHTML on a document fragment - tmpnodes = d.createElement('div'); - tmpnodes.innerHTML = value; - while ((tmpnode = tmpnodes.lastChild) !== null) { - // Catch error in unlikely case elm has been removed - try { - if (position === 'before') { - elm.parentNode.insertBefore(tmpnode, elm); - } else if (position === 'after') { - elm.parentNode.insertBefore(tmpnode, elm.nextSibling); - } else if (position === 'append') { - elm.appendChild(tmpnode); - } else if (position === 'prepend') { - elm.insertBefore(tmpnode, elm.firstChild); - } - } catch (e) {break; } - } - }, nodes); - } - } - - // Get nodes and return chibi - function chibi(selector) { - var cb, nodes = [], json = false, nodelist, i; - - if (selector) { - - // Element node, would prefer to use (selector instanceof HTMLElement) but no IE support - if (selector.nodeType && selector.nodeType === 1) { - nodes = [selector]; // return element as node list - } else if (typeof selector === 'object') { - // JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support - json = (typeof selector.length !== 'number'); - nodes = selector; - } else if (typeof selector === 'string') { - - // A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector) - - // IE < 8 - if (!d.querySelectorAll) { - // Polyfill querySelectorAll - d.querySelectorAll = function (selector) { - - var style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i; - - style = d.createElement('STYLE'); - style.type = 'text/css'; - - if (style.styleSheet) { - style.styleSheet.cssText = selector + ' {a:b}'; - - head.appendChild(style); - - allnodes = d.getElementsByTagName('*'); - - for (i = 0; i < allnodes.length; i += 1) { - if (computeStyle(allnodes[i], 'a') === 'b') { - selectednodes.push(allnodes[i]); - } - } - - head.removeChild(style); - } - - return selectednodes; - }; - } - - nodelist = d.querySelectorAll(selector); - - // Convert node list to array so results have full access to array methods - // Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway - for (i = 0; i < nodelist.length; i += 1) { - nodes[i] = nodelist[i]; - } - - } - } - - // Only attach nodes if not JSON - cb = json ? {} : nodes; - - // Public functions - - // Fire on DOM ready - cb.ready = function (fn) { - if (fn) { - if (domready) { - fn(); - return cb; - } else { - readyfn.push(fn); - } - } - }; - // Fire on page loaded - cb.loaded = function (fn) { - if (fn) { - if (pageloaded) { - fn(); - return cb; - } else { - loadedfn.push(fn); - } - } - }; - // Executes a function on nodes - cb.each = function (fn) { - if (typeof fn === 'function') { - nodeLoop(function (elm) { - // <= IE 8 loses scope so need to apply - return fn.apply(elm, arguments); - }, nodes); - } - return cb; - }; - // Find first - cb.first = function () { - return chibi(nodes.shift()); - }; - // Find last - cb.last = function () { - return chibi(nodes.pop()); - }; - // Find odd - cb.odd = function () { - var odds = [], i; - for (i = 0; i < nodes.length; i += 2) { - odds.push(nodes[i]); - } - return chibi(odds); - }; - // Find even - cb.even = function () { - var evens = [], i; - for (i = 1; i < nodes.length; i += 2) { - evens.push(nodes[i]); - } - return chibi(evens); - }; - // Hide node - cb.hide = function () { - nodeLoop(function (elm) { - elm.style.display = 'none'; - }, nodes); - return cb; - }; - // Show node - cb.show = function () { - nodeLoop(function (elm) { - showCss(elm); - }, nodes); - return cb; - }; - // Toggle node display - cb.toggle = function (state) { - if (typeof state != 'undefined') { // ADDED - if(state) - cb.show(); - else - cb.hide(); - } else { - nodeLoop(function (elm) { - // computeStyle instead of style.display == 'none' catches elements that are hidden via style block - if (computeStyle(elm, 'display') === 'none') { - showCss(elm); - } else { - elm.style.display = 'none'; - } - - }, nodes); - } - return cb; - }; - // Remove node - cb.remove = function () { - nodeLoop(function (elm) { - // Catch error in unlikely case elm has been removed - try { - elm.parentNode.removeChild(elm); - } catch (e) {} - }, nodes); - return chibi(); - }; - // Get/Set CSS - cb.css = function (property, value) { - if (property) { - if (value || value === '') { - nodeLoop(function (elm) { - setCss(elm, property, value); - }, nodes); - return cb; - } - if (nodes[0]) { - if (nodes[0].style[cssCamel(property)]) { - return nodes[0].style[cssCamel(property)]; - } - if (computeStyle(nodes[0], property)) { - return computeStyle(nodes[0], property); - } - } - } - }; - // Get class(es) - cb.getClass = function () { - if (nodes[0] && nodes[0].className.length > 0) { - // Weak IE trim support - return nodes[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '').replace(/\s+/,' '); - } - }; - // Set (replaces) classes - cb.setClass = function (classes) { - if (classes || classes === '') { - nodeLoop(function (elm) { - elm.className = classes; - }, nodes); - } - return cb; - }; - // Add class - cb.addClass = function (classes) { - if (classes) { - nodeLoop(function (elm) { - elm.className += ' ' + classes; - }, nodes); - } - return cb; - }; - // Remove class - cb.removeClass = function (classes) { - classHelper(classes, 'remove', nodes); - return cb; - }; - // Toggle class - cb.toggleClass = function (classes) { - classHelper(classes, 'toggle', nodes); - return cb; - }; - // Has class - cb.hasClass = function (classes) { - return classHelper(classes, 'has', nodes); - }; - // Get/set HTML - cb.html = function (value) { - if (value || value === '') { - nodeLoop(function (elm) { - elm.innerHTML = value; - }, nodes); - return cb; - } - if (nodes[0]) { - return nodes[0].innerHTML; - } - }; - // Insert HTML before selector - cb.htmlBefore = function (value) { - insertHtml(value, 'before', nodes); - return cb; - }; - // Insert HTML after selector - cb.htmlAfter = function (value) { - insertHtml(value, 'after', nodes); - return cb; - }; - // Insert HTML after selector innerHTML - cb.htmlAppend = function (value) { - insertHtml(value, 'append', nodes); - return cb; - }; - // Insert HTML before selector innerHTML - cb.htmlPrepend = function (value) { - insertHtml(value, 'prepend', nodes); - return cb; - }; - // Get/Set HTML attributes - cb.attr = function (property, value) { - if (property) { - property = property.toLowerCase(); - // IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway - if (typeof value !== 'undefined') {//FIXED BUG HERE - nodeLoop(function (elm) { - if (property === 'style') { - elm.style.cssText = value; - } else if (property === 'class') { - elm.className = value; - } else { - elm.setAttribute(property, value); - } - }, nodes); - return cb; - } - if (nodes[0]) { - if (property === 'style') { - if (nodes[0].style.cssText) { - return nodes[0].style.cssText; - } - } else if (property === 'class') { - if (nodes[0].className) { - return nodes[0].className; - } - } else { - if (nodes[0].getAttribute(property)) { - return nodes[0].getAttribute(property); - } - } - } - } - }; - // Get/Set HTML data property - cb.data = function (key, value) { - if (key) { - return cb.attr('data-'+key, value); - } - }; - // Get/Set form element values - cb.val = function (value) { - var values, i, j; - if (value || value === '') { - nodeLoop(function (elm) { - switch (elm.nodeName) { - case 'SELECT': - if (typeof value === 'string' || typeof value === 'number') { - value = [value]; - } - for (i = 0; i < elm.length; i += 1) { - // Multiple select - for (j = 0; j < value.length; j += 1) { - elm[i].selected = ''; - if (elm[i].value === value[j]) { - elm[i].selected = 'selected'; - break; - } - } - } - break; - case 'INPUT': - case 'TEXTAREA': - case 'BUTTON': - elm.value = value; - break; - } - }, nodes); - - return cb; - } - if (nodes[0]) { - switch (nodes[0].nodeName) { - case 'SELECT': - values = []; - for (i = 0; i < nodes[0].length; i += 1) { - if (nodes[0][i].selected) { - values.push(nodes[0][i].value); - } - } - return (values.length > 1) ? values : values[0]; - case 'INPUT': - case 'TEXTAREA': - case 'BUTTON': - return nodes[0].value; - } - } - }; - // Return matching checked checkbox or radios - cb.checked = function (check) { - if (typeof check === 'boolean') { - nodeLoop(function (elm) { - if (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) { - elm.checked = check; - } - }, nodes); - return cb; - } - if (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) { - return (!!nodes[0].checked); - } - }; - // Add event handler - cb.on = function (event, fn) { - if (selector === w || selector === d) { - nodes = [selector]; - } - nodeLoop(function (elm) { - if (d.addEventListener) { - elm.addEventListener(event, fn, false); - } else if (d.attachEvent) { - // <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions) - elm[event + fn] = function () { return fn.apply(elm, arguments); }; - elm.attachEvent('on' + event, elm[event + fn]); - } - }, nodes); - return cb; - }; - // Remove event handler - cb.off = function (event, fn) { - if (selector === w || selector === d) { - nodes = [selector]; - } - nodeLoop(function (elm) { - if (d.addEventListener) { - elm.removeEventListener(event, fn, false); - } else if (d.attachEvent) { - elm.detachEvent('on' + event, elm[event + fn]); - // Tidy up - elm[event + fn] = null; - } - }, nodes); - return cb; - }; - // Basic XHR 1, no file support. Shakes fist at IE - cb.ajax = function (url, method, callback, nocache, nojsonp) { - var xhr, - query = serializeData(nodes), - type = (method) ? method.toUpperCase() : 'GET', - hostsearch = new RegExp('http[s]?://(.*?)/', 'gi'), - domain = hostsearch.exec(url), - timestamp = '_ts=' + (+new Date()), - head = d.getElementsByTagName('head')[0], - jsonpcallback = 'chibi' + (+new Date()) + (jsonpcount += 1), - script; - - if (query && (type === 'GET' || type === 'DELETE')) { - url += (url.indexOf('?') === -1) ? '?' + query : '&' + query; - query = null; - } - - // JSONP if cross domain url - if (type === 'GET' && !nojsonp && domain && w.location.host !== domain[1]) { - - if (nocache) { - url += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp; - } - - // Replace possible encoded ? - url = url.replace('=%3F', '=?'); - - // Replace jsonp ? with callback - if (callback && url.indexOf('=?') !== -1) { - - url = url.replace('=?', '=' + jsonpcallback); - - w[jsonpcallback] = function (data) { - try { - callback(data, 200); - } catch (e) {} - - // Tidy up - w[jsonpcallback] = undefined; - }; - } - - // JSONP - script = document.createElement('script'); - script.async = true; - script.src = url; - - // Tidy up - script.onload = function () { - head.removeChild(script); - }; - - head.appendChild(script); - - } else { - - if (w.XMLHttpRequest) { - xhr = new XMLHttpRequest(); - } else if (w.ActiveXObject) { - xhr = new ActiveXObject('Microsoft.XMLHTTP'); // IE < 9 - } - - if (xhr) { - - if (nocache) { - url += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp; - } - - // Douglas Crockford: "Synchronous programming is disrespectful and should not be employed in applications which are used by people" - xhr.open(type, url, true); - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (callback) { - callback(xhr.responseText, xhr.status); - } - } - }; - - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - if (type === 'POST' || type === 'PUT') { - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - } - - xhr.send(query); - - } - } - return cb; - }; - // Alias to cb.ajax(url, 'get', callback, nocache, nojsonp) - cb.get = function (url, callback, nocache, nojsonp) { - return cb.ajax(url, 'get', callback, nocache, nojsonp); - }; - // Alias to cb.ajax(url, 'post', callback, nocache) - cb.post = function (url, callback, nocache) { - return cb.ajax(url, 'post', callback, nocache); - }; - - return cb; - } - - // Set Chibi's global namespace here ($) - w.$ = chibi; - -}()); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module unless amdModuleId is set - // define([], function () { - // return (root['Chartist'] = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like environments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist'] = factory(); - // } -}(this, function () { - -/* Chartist.js 0.9.7 - * Copyright © 2016 Gion Kunz - * Free to use under either the WTFPL license or the MIT license. - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT - */ -/** - * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules. - * - * @module Chartist.Core - */ -var Chartist = { - version: '0.9.7' -}; - -(function (window, document, Chartist) { - 'use strict'; - - /** - * This object contains all namespaces used within Chartist. - * - * @memberof Chartist.Core - * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}} - */ - Chartist.namespaces = { - svg: 'http://www.w3.org/2000/svg', - xmlns: 'http://www.w3.org/2000/xmlns/', - xhtml: 'http://www.w3.org/1999/xhtml', - xlink: 'http://www.w3.org/1999/xlink', - ct: 'http://gionkunz.github.com/chartist-js/ct' - }; - - /** - * Helps to simplify functional style code - * - * @memberof Chartist.Core - * @param {*} n This exact value will be returned by the noop function - * @return {*} The same value that was provided to the n parameter - */ - Chartist.noop = function (n) { - return n; - }; - - /** - * Generates a-z from a number 0 to 26 - * - * @memberof Chartist.Core - * @param {Number} n A number from 0 to 26 that will result in a letter a-z - * @return {String} A character from a-z based on the input number n - */ - Chartist.alphaNumerate = function (n) { - // Limit to a-z - return String.fromCharCode(97 + n % 26); - }; - - /** - * Simple recursive object extend - * - * @memberof Chartist.Core - * @param {Object} target Target object where the source will be merged into - * @param {Object...} sources This object (objects) will be merged into target and then target is returned - * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source - */ - Chartist.extend = function (target) { - target = target || {}; - - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function(source) { - for (var prop in source) { - if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) { - target[prop] = Chartist.extend({}, target[prop], source[prop]); - } else { - target[prop] = source[prop]; - } - } - }); - - return target; - }; - - /** - * Replaces all occurrences of subStr in str with newSubStr and returns a new string. - * - * @memberof Chartist.Core - * @param {String} str - * @param {String} subStr - * @param {String} newSubStr - * @return {String} - */ - Chartist.replaceAll = function(str, subStr, newSubStr) { - return str.replace(new RegExp(subStr, 'g'), newSubStr); - }; - - /** - * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified. - * - * @memberof Chartist.Core - * @param {Number} value - * @param {String} unit - * @return {String} Returns the passed number value with unit. - */ - Chartist.ensureUnit = function(value, unit) { - if(typeof value === 'number') { - value = value + unit; - } - - return value; - }; - - /** - * Converts a number or string to a quantity object. - * - * @memberof Chartist.Core - * @param {String|Number} input - * @return {Object} Returns an object containing the value as number and the unit as string. - */ - Chartist.quantity = function(input) { - if (typeof input === 'string') { - var match = (/^(\d+)\s*(.*)$/g).exec(input); - return { - value : +match[1], - unit: match[2] || undefined - }; - } - return { value: input }; - }; - - /** - * This is a wrapper around document.querySelector that will return the query if it's already of type Node - * - * @memberof Chartist.Core - * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly - * @return {Node} - */ - Chartist.querySelector = function(query) { - return query instanceof Node ? query : document.querySelector(query); - }; - - /** - * Functional style helper to produce array with given length initialized with undefined values - * - * @memberof Chartist.Core - * @param length - * @return {Array} - */ - Chartist.times = function(length) { - return Array.apply(null, new Array(length)); - }; - - /** - * Sum helper to be used in reduce functions - * - * @memberof Chartist.Core - * @param previous - * @param current - * @return {*} - */ - Chartist.sum = function(previous, current) { - return previous + (current ? current : 0); - }; - - /** - * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor. - * - * @memberof Chartist.Core - * @param {Number} factor - * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array - */ - Chartist.mapMultiply = function(factor) { - return function(num) { - return num * factor; - }; - }; - - /** - * Add helper to be used in `Array.map` for adding a addend to each value of an array. - * - * @memberof Chartist.Core - * @param {Number} addend - * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array - */ - Chartist.mapAdd = function(addend) { - return function(num) { - return num + addend; - }; - }; - - /** - * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values). - * - * @memberof Chartist.Core - * @param arr - * @param cb - * @return {Array} - */ - Chartist.serialMap = function(arr, cb) { - var result = [], - length = Math.max.apply(null, arr.map(function(e) { - return e.length; - })); - - Chartist.times(length).forEach(function(e, index) { - var args = arr.map(function(e) { - return e[index]; - }); - - result[index] = cb.apply(null, args); - }); - - return result; - }; - - /** - * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit. - * - * @memberof Chartist.Core - * @param {Number} value The value that should be rounded with precision - * @param {Number} [digits] The number of digits after decimal used to do the rounding - * @returns {number} Rounded value - */ - Chartist.roundWithPrecision = function(value, digits) { - var precision = Math.pow(10, digits || Chartist.precision); - return Math.round(value * precision) / precision; - }; - - /** - * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. - * - * @memberof Chartist.Core - * @type {number} - */ - Chartist.precision = 8; - - /** - * A map with characters to escape for strings to be safely used as attribute values. - * - * @memberof Chartist.Core - * @type {Object} - */ - Chartist.escapingMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' - }; - - /** - * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap. - * If called with null or undefined the function will return immediately with null or undefined. - * - * @memberof Chartist.Core - * @param {Number|String|Object} data - * @return {String} - */ - Chartist.serialize = function(data) { - if(data === null || data === undefined) { - return data; - } else if(typeof data === 'number') { - data = ''+data; - } else if(typeof data === 'object') { - data = JSON.stringify({data: data}); - } - - return Object.keys(Chartist.escapingMap).reduce(function(result, key) { - return Chartist.replaceAll(result, key, Chartist.escapingMap[key]); - }, data); - }; - - /** - * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success. - * - * @memberof Chartist.Core - * @param {String} data - * @return {String|Number|Object} - */ - Chartist.deserialize = function(data) { - if(typeof data !== 'string') { - return data; - } - - data = Object.keys(Chartist.escapingMap).reduce(function(result, key) { - return Chartist.replaceAll(result, Chartist.escapingMap[key], key); - }, data); - - try { - data = JSON.parse(data); - data = data.data !== undefined ? data.data : data; - } catch(e) {} - - return data; - }; - - /** - * Create or reinitialize the SVG element for the chart - * - * @memberof Chartist.Core - * @param {Node} container The containing DOM Node object that will be used to plant the SVG element - * @param {String} width Set the width of the SVG element. Default is 100% - * @param {String} height Set the height of the SVG element. Default is 100% - * @param {String} className Specify a class to be added to the SVG element - * @return {Object} The created/reinitialized SVG element - */ - Chartist.createSvg = function (container, width, height, className) { - var svg; - - width = width || '100%'; - height = height || '100%'; - - // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it - // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/ - Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) { - return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct'); - }).forEach(function removePreviousElement(svg) { - container.removeChild(svg); - }); - - // Create svg object with width and height or use 100% as default - svg = new Chartist.Svg('svg').attr({ - width: width, - height: height - }).addClass(className).attr({ - style: 'width: ' + width + '; height: ' + height + ';' - }); - - // Add the DOM node to our container - container.appendChild(svg._node); - - return svg; - }; - - /** - * Ensures that the data object passed as second argument to the charts is present and correctly initialized. - * - * @param {Object} data The data object that is passed as second argument to the charts - * @return {Object} The normalized data object - */ - Chartist.normalizeData = function(data) { - // Ensure data is present otherwise enforce - data = data || {series: [], labels: []}; - data.series = data.series || []; - data.labels = data.labels || []; - - // Check if we should generate some labels based on existing series data - if (data.series.length > 0 && data.labels.length === 0) { - var normalized = Chartist.getDataArray(data), - labelCount; - - // If all elements of the normalized data array are arrays we're dealing with - // data from Bar or Line charts and we need to find the largest series if they are un-even - if (normalized.every(function(value) { - return value instanceof Array; - })) { - // Getting the series with the the most elements - labelCount = Math.max.apply(null, normalized.map(function(series) { - return series.length; - })); - } else { - // We're dealing with Pie data so we just take the normalized array length - labelCount = normalized.length; - } - - // Setting labels to an array with emptry strings using our labelCount estimated above - data.labels = Chartist.times(labelCount).map(function() { - return ''; - }); - } - return data; - }; - - /** - * Reverses the series, labels and series data arrays. - * - * @memberof Chartist.Core - * @param data - */ - Chartist.reverseData = function(data) { - data.labels.reverse(); - data.series.reverse(); - for (var i = 0; i < data.series.length; i++) { - if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) { - data.series[i].data.reverse(); - } else if(data.series[i] instanceof Array) { - data.series[i].reverse(); - } - } - }; - - /** - * Convert data series into plain array - * - * @memberof Chartist.Core - * @param {Object} data The series object that contains the data to be visualized in the chart - * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too. - * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created. - * @return {Array} A plain array that contains the data to be visualized in the chart - */ - Chartist.getDataArray = function (data, reverse, multi) { - // If the data should be reversed but isn't we need to reverse it - // If it's reversed but it shouldn't we need to reverse it back - // That's required to handle data updates correctly and to reflect the responsive configurations - if(reverse && !data.reversed || !reverse && data.reversed) { - Chartist.reverseData(data); - data.reversed = !data.reversed; - } - - // Recursively walks through nested arrays and convert string values to numbers and objects with value properties - // to values. Check the tests in data core -> data normalization for a detailed specification of expected values - function recursiveConvert(value) { - if(Chartist.isFalseyButZero(value)) { - // This is a hole in data and we should return undefined - return undefined; - } else if((value.data || value) instanceof Array) { - return (value.data || value).map(recursiveConvert); - } else if(value.hasOwnProperty('value')) { - return recursiveConvert(value.value); - } else { - if(multi) { - var multiValue = {}; - - // Single series value arrays are assumed to specify the Y-Axis value - // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}] - // If multi is a string then it's assumed that it specified which dimension should be filled as default - if(typeof multi === 'string') { - multiValue[multi] = Chartist.getNumberOrUndefined(value); - } else { - multiValue.y = Chartist.getNumberOrUndefined(value); - } - - multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x; - multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y; - - return multiValue; - - } else { - return Chartist.getNumberOrUndefined(value); - } - } - } - - return data.series.map(recursiveConvert); - }; - - /** - * Converts a number into a padding object. - * - * @memberof Chartist.Core - * @param {Object|Number} padding - * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed - * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned. - */ - Chartist.normalizePadding = function(padding, fallback) { - fallback = fallback || 0; - - return typeof padding === 'number' ? { - top: padding, - right: padding, - bottom: padding, - left: padding - } : { - top: typeof padding.top === 'number' ? padding.top : fallback, - right: typeof padding.right === 'number' ? padding.right : fallback, - bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback, - left: typeof padding.left === 'number' ? padding.left : fallback - }; - }; - - Chartist.getMetaData = function(series, index) { - var value = series.data ? series.data[index] : series[index]; - return value ? Chartist.serialize(value.meta) : undefined; - }; - - /** - * Calculate the order of magnitude for the chart scale - * - * @memberof Chartist.Core - * @param {Number} value The value Range of the chart - * @return {Number} The order of magnitude - */ - Chartist.orderOfMagnitude = function (value) { - return Math.floor(Math.log(Math.abs(value)) / Math.LN10); - }; - - /** - * Project a data length into screen coordinates (pixels) - * - * @memberof Chartist.Core - * @param {Object} axisLength The svg element for the chart - * @param {Number} length Single data value from a series array - * @param {Object} bounds All the values to set the bounds of the chart - * @return {Number} The projected data length in pixels - */ - Chartist.projectLength = function (axisLength, length, bounds) { - return length / bounds.range * axisLength; - }; - - /** - * Get the height of the area in the chart for the data series - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @return {Number} The height of the area in the chart for the data series - */ - Chartist.getAvailableHeight = function (svg, options) { - return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0); - }; - - /** - * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart. - * - * @memberof Chartist.Core - * @param {Array} data The array that contains the data to be visualized in the chart - * @param {Object} options The Object that contains the chart options - * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration - * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart. - */ - Chartist.getHighLow = function (data, options, dimension) { - // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred - options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {}); - - var highLow = { - high: options.high === undefined ? -Number.MAX_VALUE : +options.high, - low: options.low === undefined ? Number.MAX_VALUE : +options.low - }; - var findHigh = options.high === undefined; - var findLow = options.low === undefined; - - // Function to recursively walk through arrays and find highest and lowest number - function recursiveHighLow(data) { - if(data === undefined) { - return undefined; - } else if(data instanceof Array) { - for (var i = 0; i < data.length; i++) { - recursiveHighLow(data[i]); - } - } else { - var value = dimension ? +data[dimension] : +data; - - if (findHigh && value > highLow.high) { - highLow.high = value; - } - - if (findLow && value < highLow.low) { - highLow.low = value; - } - } - } - - // Start to find highest and lowest number recursively - if(findHigh || findLow) { - recursiveHighLow(data); - } - - // Overrides of high / low based on reference value, it will make sure that the invisible reference value is - // used to generate the chart. This is useful when the chart always needs to contain the position of the - // invisible reference value in the view i.e. for bipolar scales. - if (options.referenceValue || options.referenceValue === 0) { - highLow.high = Math.max(options.referenceValue, highLow.high); - highLow.low = Math.min(options.referenceValue, highLow.low); - } - - // If high and low are the same because of misconfiguration or flat data (only the same value) we need - // to set the high or low to 0 depending on the polarity - if (highLow.high <= highLow.low) { - // If both values are 0 we set high to 1 - if (highLow.low === 0) { - highLow.high = 1; - } else if (highLow.low < 0) { - // If we have the same negative value for the bounds we set bounds.high to 0 - highLow.high = 0; - } else if (highLow.high > 0) { - // If we have the same positive value for the bounds we set bounds.low to 0 - highLow.low = 0; - } else { - // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors - highLow.high = 1; - highLow.low = 0; - } - } - - return highLow; - }; - - /** - * Checks if the value is a valid number or string with a number. - * - * @memberof Chartist.Core - * @param value - * @returns {Boolean} - */ - Chartist.isNum = function(value) { - return !isNaN(value) && isFinite(value); - }; - - /** - * Returns true on all falsey values except the numeric value 0. - * - * @memberof Chartist.Core - * @param value - * @returns {boolean} - */ - Chartist.isFalseyButZero = function(value) { - return !value && value !== 0; - }; - - /** - * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined. - * - * @memberof Chartist.Core - * @param value - * @returns {*} - */ - Chartist.getNumberOrUndefined = function(value) { - return isNaN(+value) ? undefined : +value; - }; - - /** - * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined. - * - * @param value - * @param dimension - * @returns {*} - */ - Chartist.getMultiValue = function(value, dimension) { - if(Chartist.isNum(value)) { - return +value; - } else if(value) { - return value[dimension || 'y'] || 0; - } else { - return 0; - } - }; - - /** - * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex. - * - * @memberof Chartist.Core - * @param {Number} num An integer number where the smallest factor should be searched for - * @returns {Number} The smallest integer factor of the parameter num. - */ - Chartist.rho = function(num) { - if(num === 1) { - return num; - } - - function gcd(p, q) { - if (p % q === 0) { - return q; - } else { - return gcd(q, p % q); - } - } - - function f(x) { - return x * x + 1; - } - - var x1 = 2, x2 = 2, divisor; - if (num % 2 === 0) { - return 2; - } - - do { - x1 = f(x1) % num; - x2 = f(f(x2)) % num; - divisor = gcd(Math.abs(x1 - x2), num); - } while (divisor === 1); - - return divisor; - }; - - /** - * Calculate and retrieve all the bounds for the chart and return them in one array - * - * @memberof Chartist.Core - * @param {Number} axisLength The length of the Axis used for - * @param {Object} highLow An object containing a high and low property indicating the value range of the chart. - * @param {Number} scaleMinSpace The minimum projected length a step should result in - * @param {Boolean} onlyInteger - * @return {Object} All the values to set the bounds of the chart - */ - Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) { - var i, - optimizationCounter = 0, - newMin, - newMax, - bounds = { - high: highLow.high, - low: highLow.low - }; - - bounds.valueRange = bounds.high - bounds.low; - bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange); - bounds.step = Math.pow(10, bounds.oom); - bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step; - bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step; - bounds.range = bounds.max - bounds.min; - bounds.numberOfSteps = Math.round(bounds.range / bounds.step); - - // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace - // If we are already below the scaleMinSpace value we will scale up - var length = Chartist.projectLength(axisLength, bounds.step, bounds); - var scaleUp = length < scaleMinSpace; - var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0; - - // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1 - if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) { - bounds.step = 1; - } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) { - // If step 1 was too small, we can try the smallest factor of range - // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor - // is larger than the scaleMinSpace we should go for it. - bounds.step = smallestFactor; - } else { - // Trying to divide or multiply by 2 and find the best step value - while (true) { - if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) { - bounds.step *= 2; - } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) { - bounds.step /= 2; - if(onlyInteger && bounds.step % 1 !== 0) { - bounds.step *= 2; - break; - } - } else { - break; - } - - if(optimizationCounter++ > 1000) { - throw new Error('Exceeded maximum number of iterations while optimizing scale step!'); - } - } - } - - // Narrow min and max based on new step - newMin = bounds.min; - newMax = bounds.max; - while(newMin + bounds.step <= bounds.low) { - newMin += bounds.step; - } - while(newMax - bounds.step >= bounds.high) { - newMax -= bounds.step; - } - bounds.min = newMin; - bounds.max = newMax; - bounds.range = bounds.max - bounds.min; - - bounds.values = []; - for (i = bounds.min; i <= bounds.max; i += bounds.step) { - bounds.values.push(Chartist.roundWithPrecision(i)); - } - - return bounds; - }; - - /** - * Calculate cartesian coordinates of polar coordinates - * - * @memberof Chartist.Core - * @param {Number} centerX X-axis coordinates of center point of circle segment - * @param {Number} centerY X-axis coordinates of center point of circle segment - * @param {Number} radius Radius of circle segment - * @param {Number} angleInDegrees Angle of circle segment in degrees - * @return {{x:Number, y:Number}} Coordinates of point on circumference - */ - Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) { - var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; - - return { - x: centerX + (radius * Math.cos(angleInRadians)), - y: centerY + (radius * Math.sin(angleInRadians)) - }; - }; - - /** - * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right - * - * @memberof Chartist.Core - * @param {Object} svg The svg element for the chart - * @param {Object} options The Object that contains all the optional values for the chart - * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used - * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements - */ - Chartist.createChartRect = function (svg, options, fallbackPadding) { - var hasAxis = !!(options.axisX || options.axisY); - var yAxisOffset = hasAxis ? options.axisY.offset : 0; - var xAxisOffset = hasAxis ? options.axisX.offset : 0; - // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0 - var width = svg.width() || Chartist.quantity(options.width).value || 0; - var height = svg.height() || Chartist.quantity(options.height).value || 0; - var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding); - - // If settings were to small to cope with offset (legacy) and padding, we'll adjust - width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right); - height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom); - - var chartRect = { - padding: normalizedPadding, - width: function () { - return this.x2 - this.x1; - }, - height: function () { - return this.y1 - this.y2; - } - }; - - if(hasAxis) { - if (options.axisX.position === 'start') { - chartRect.y2 = normalizedPadding.top + xAxisOffset; - chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); - } else { - chartRect.y2 = normalizedPadding.top; - chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1); - } - - if (options.axisY.position === 'start') { - chartRect.x1 = normalizedPadding.left + yAxisOffset; - chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); - } else { - chartRect.x1 = normalizedPadding.left; - chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1); - } - } else { - chartRect.x1 = normalizedPadding.left; - chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1); - chartRect.y2 = normalizedPadding.top; - chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1); - } - - return chartRect; - }; - - /** - * Creates a grid line based on a projected value. - * - * @memberof Chartist.Core - * @param position - * @param index - * @param axis - * @param offset - * @param length - * @param group - * @param classes - * @param eventEmitter - */ - Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) { - var positionalData = {}; - positionalData[axis.units.pos + '1'] = Math.round(position)+0.5; - positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid - positionalData[axis.counterUnits.pos + '1'] = offset; - positionalData[axis.counterUnits.pos + '2'] = offset + length; - - var gridElement = group.elem('line', positionalData, classes.join(' ')); - - // Event for grid draw - eventEmitter.emit('draw', - Chartist.extend({ - type: 'grid', - axis: axis, - index: index, - group: group, - element: gridElement - }, positionalData) - ); - }; - - /** - * Creates a label based on a projected value and an axis. - * - * @memberof Chartist.Core - * @param position - * @param length - * @param index - * @param labels - * @param axis - * @param axisOffset - * @param labelOffset - * @param group - * @param classes - * @param useForeignObject - * @param eventEmitter - */ - Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) { - var labelElement; - var positionalData = {}; - - positionalData[axis.units.pos] = position + labelOffset[axis.units.pos]; - positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos]; - positionalData[axis.units.len] = length; - positionalData[axis.counterUnits.len] = axisOffset - 10; - - var lblText = labels[index]; - //round (!! will brak for non-numeric) - lblText = Math.round(+lblText*100)/100; - - if(useForeignObject) { - // We need to set width and height explicitly to px as span will not expand with width and height being - // 100% in all browsers - var content = '' + - lblText + ''; - - labelElement = group.foreignObject(content, Chartist.extend({ - style: 'overflow: visible;' - }, positionalData)); - } else { - labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText); - } - - eventEmitter.emit('draw', Chartist.extend({ - type: 'label', - axis: axis, - index: index, - group: group, - element: labelElement, - text: lblText - }, positionalData)); - }; - - /** - * Helper to read series specific options from options object. It automatically falls back to the global option if - * there is no option in the series options. - * - * @param {Object} series Series object - * @param {Object} options Chartist options object - * @param {string} key The options key that should be used to obtain the options - * @returns {*} - */ - Chartist.getSeriesOption = function(series, options, key) { - if(series.name && options.series && options.series[series.name]) { - var seriesOptions = options.series[series.name]; - return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key]; - } else { - return options[key]; - } - }; - - /** - * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches - * - * @memberof Chartist.Core - * @param {Object} options Options set by user - * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart - * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events - * @return {Object} The consolidated options object from the defaults, base and matching responsive options - */ - Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) { - var baseOptions = Chartist.extend({}, options), - currentOptions, - mediaQueryListeners = [], - i; - - function updateCurrentOptions(preventChangedEvent) { - var previousOptions = currentOptions; - currentOptions = Chartist.extend({}, baseOptions); - - if (responsiveOptions) { - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - if (mql.matches) { - currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]); - } - } - } - - if(eventEmitter && !preventChangedEvent) { - eventEmitter.emit('optionsChanged', { - previousOptions: previousOptions, - currentOptions: currentOptions - }); - } - } - - function removeMediaQueryListeners() { - mediaQueryListeners.forEach(function(mql) { - mql.removeListener(updateCurrentOptions); - }); - } - - if (!window.matchMedia) { - throw 'window.matchMedia not found! Make sure you\'re using a polyfill.'; - } else if (responsiveOptions) { - - for (i = 0; i < responsiveOptions.length; i++) { - var mql = window.matchMedia(responsiveOptions[i][0]); - mql.addListener(updateCurrentOptions); - mediaQueryListeners.push(mql); - } - } - // Execute initially so we get the correct options - updateCurrentOptions(true); - - return { - removeMediaQueryListeners: removeMediaQueryListeners, - getCurrentOptions: function getCurrentOptions() { - return Chartist.extend({}, currentOptions); - } - }; - }; - -}(window, document, Chartist)); -;/** - * Chartist path interpolation functions. - * - * @module Chartist.Interpolation - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - Chartist.Interpolation = {}; - - /** - * This interpolation function does not smooth the path and the result is only containing lines and no curves. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.none({ - * fillHoles: false - * }) - * }); - * - * - * @memberof Chartist.Interpolation - * @return {Function} - */ - Chartist.Interpolation.none = function(options) { - var defaultOptions = { - fillHoles: false - }; - options = Chartist.extend({}, defaultOptions, options); - return function none(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - var hole = true; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var currData = valueData[i / 2]; - - if(currData.value !== undefined) { - - if(hole) { - path.move(currX, currY, false, currData); - } else { - path.line(currX, currY, false, currData); - } - - hole = false; - } else if(!options.fillHoles) { - hole = true; - } - } - - return path; - }; - }; - - /** - * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. - * - * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.simple({ - * divisor: 2, - * fillHoles: false - * }) - * }); - * - * - * @memberof Chartist.Interpolation - * @param {Object} options The options of the simple interpolation factory function. - * @return {Function} - */ - Chartist.Interpolation.simple = function(options) { - var defaultOptions = { - divisor: 2, - fillHoles: false - }; - options = Chartist.extend({}, defaultOptions, options); - - var d = 1 / Math.max(1, options.divisor); - - return function simple(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - var prevX, prevY, prevData; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var length = (currX - prevX) * d; - var currData = valueData[i / 2]; - - if(currData.value !== undefined) { - - if(prevData === undefined) { - path.move(currX, currY, false, currData); - } else { - path.curve( - prevX + length, - prevY, - currX - length, - currY, - currX, - currY, - false, - currData - ); - } - - prevX = currX; - prevY = currY; - prevData = currData; - } else if(!options.fillHoles) { - prevX = currX = prevData = undefined; - } - } - - return path; - }; - }; - - /** - * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. - * - * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.cardinal({ - * tension: 1, - * fillHoles: false - * }) - * }); - * - * @memberof Chartist.Interpolation - * @param {Object} options The options of the cardinal factory function. - * @return {Function} - */ - Chartist.Interpolation.cardinal = function(options) { - var defaultOptions = { - tension: 1, - fillHoles: false - }; - - options = Chartist.extend({}, defaultOptions, options); - - var t = Math.min(1, Math.max(0, options.tension)), - c = 1 - t; - - // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates - // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards. - // This functionality is necessary to treat "holes" in the line charts - function splitIntoSegments(pathCoordinates, valueData) { - var segments = []; - var hole = true; - - for(var i = 0; i < pathCoordinates.length; i += 2) { - // If this value is a "hole" we set the hole flag - if(valueData[i / 2].value === undefined) { - if(!options.fillHoles) { - hole = true; - } - } else { - // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment - if(hole) { - segments.push({ - pathCoordinates: [], - valueData: [] - }); - // As we have a valid value now, we are not in a "hole" anymore - hole = false; - } - - // Add to the segment pathCoordinates and valueData - segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]); - segments[segments.length - 1].valueData.push(valueData[i / 2]); - } - } - - return segments; - } - - return function cardinal(pathCoordinates, valueData) { - // First we try to split the coordinates into segments - // This is necessary to treat "holes" in line charts - var segments = splitIntoSegments(pathCoordinates, valueData); - - if(!segments.length) { - // If there were no segments return 'Chartist.Interpolation.none' - return Chartist.Interpolation.none()([]); - } else if(segments.length > 1) { - // If the split resulted in more that one segment we need to interpolate each segment individually and join them - // afterwards together into a single path. - var paths = []; - // For each segment we will recurse the cardinal function - segments.forEach(function(segment) { - paths.push(cardinal(segment.pathCoordinates, segment.valueData)); - }); - // Join the segment path data into a single path and return - return Chartist.Svg.Path.join(paths); - } else { - // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first - // segment - pathCoordinates = segments[0].pathCoordinates; - valueData = segments[0].valueData; - - // If less than two points we need to fallback to no smoothing - if(pathCoordinates.length <= 4) { - return Chartist.Interpolation.none()(pathCoordinates, valueData); - } - - var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]), - z; - - for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) { - var p = [ - {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]}, - {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}, - {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]}, - {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]} - ]; - if (z) { - if (!i) { - p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]}; - } else if (iLen - 4 === i) { - p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; - } else if (iLen - 2 === i) { - p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]}; - p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]}; - } - } else { - if (iLen - 4 === i) { - p[3] = p[2]; - } else if (!i) { - p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]}; - } - } - - path.curve( - (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x), - (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y), - (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x), - (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y), - p[2].x, - p[2].y, - false, - valueData[(i + 2) / 2] - ); - } - - return path; - } - }; - }; - - /** - * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled. - * - * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`. - * - * @example - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [[1, 2, 8, 1, 7]] - * }, { - * lineSmooth: Chartist.Interpolation.step({ - * postpone: true, - * fillHoles: false - * }) - * }); - * - * @memberof Chartist.Interpolation - * @param options - * @returns {Function} - */ - Chartist.Interpolation.step = function(options) { - var defaultOptions = { - postpone: true, - fillHoles: false - }; - - options = Chartist.extend({}, defaultOptions, options); - - return function step(pathCoordinates, valueData) { - var path = new Chartist.Svg.Path(); - - var prevX, prevY, prevData; - - for (var i = 0; i < pathCoordinates.length; i += 2) { - var currX = pathCoordinates[i]; - var currY = pathCoordinates[i + 1]; - var currData = valueData[i / 2]; - - // If the current point is also not a hole we can draw the step lines - if(currData.value !== undefined) { - if(prevData === undefined) { - path.move(currX, currY, false, currData); - } else { - if(options.postpone) { - // If postponed we should draw the step line with the value of the previous value - path.line(currX, prevY, false, prevData); - } else { - // If not postponed we should draw the step line with the value of the current value - path.line(prevX, currY, false, currData); - } - // Line to the actual point (this should only be a Y-Axis movement - path.line(currX, currY, false, currData); - } - - prevX = currX; - prevY = currY; - prevData = currData; - } else if(!options.fillHoles) { - prevX = prevY = prevData = undefined; - } - } - - return path; - }; - }; - -}(window, document, Chartist)); -;/** - * A very basic event module that helps to generate and catch events. - * - * @module Chartist.Event - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - Chartist.EventEmitter = function () { - var handlers = []; - - /** - * Add an event handler for a specific event - * - * @memberof Chartist.Event - * @param {String} event The event name - * @param {Function} handler A event handler function - */ - function addEventHandler(event, handler) { - handlers[event] = handlers[event] || []; - handlers[event].push(handler); - } - - /** - * Remove an event handler of a specific event name or remove all event handlers for a specific event. - * - * @memberof Chartist.Event - * @param {String} event The event name where a specific or all handlers should be removed - * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed. - */ - function removeEventHandler(event, handler) { - // Only do something if there are event handlers with this name existing - if(handlers[event]) { - // If handler is set we will look for a specific handler and only remove this - if(handler) { - handlers[event].splice(handlers[event].indexOf(handler), 1); - if(handlers[event].length === 0) { - delete handlers[event]; - } - } else { - // If no handler is specified we remove all handlers for this event - delete handlers[event]; - } - } - } - - /** - * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter. - * - * @memberof Chartist.Event - * @param {String} event The event name that should be triggered - * @param {*} data Arbitrary data that will be passed to the event handler callback functions - */ - function emit(event, data) { - // Only do something if there are event handlers with this name existing - if(handlers[event]) { - handlers[event].forEach(function(handler) { - handler(data); - }); - } - - // Emit event to star event handlers - if(handlers['*']) { - handlers['*'].forEach(function(starHandler) { - starHandler(event, data); - }); - } - } - - return { - addEventHandler: addEventHandler, - removeEventHandler: removeEventHandler, - emit: emit - }; - }; - -}(window, document, Chartist)); -;/** - * This module provides some basic prototype inheritance utilities. - * - * @module Chartist.Class - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - function listToArray(list) { - var arr = []; - if (list.length) { - for (var i = 0; i < list.length; i++) { - arr.push(list[i]); - } - } - return arr; - } - - /** - * Method to extend from current prototype. - * - * @memberof Chartist.Class - * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class. - * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used. - * @return {Function} Constructor function of the new class - * - * @example - * var Fruit = Class.extend({ - * color: undefined, - * sugar: undefined, - * - * constructor: function(color, sugar) { - * this.color = color; - * this.sugar = sugar; - * }, - * - * eat: function() { - * this.sugar = 0; - * return this; - * } - * }); - * - * var Banana = Fruit.extend({ - * length: undefined, - * - * constructor: function(length, sugar) { - * Banana.super.constructor.call(this, 'Yellow', sugar); - * this.length = length; - * } - * }); - * - * var banana = new Banana(20, 40); - * console.log('banana instanceof Fruit', banana instanceof Fruit); - * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana)); - * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype); - * console.log(banana.sugar); - * console.log(banana.eat().sugar); - * console.log(banana.color); - */ - function extend(properties, superProtoOverride) { - var superProto = superProtoOverride || this.prototype || Chartist.Class; - var proto = Object.create(superProto); - - Chartist.Class.cloneDefinitions(proto, properties); - - var constr = function() { - var fn = proto.constructor || function () {}, - instance; - - // If this is linked to the Chartist namespace the constructor was not called with new - // To provide a fallback we will instantiate here and return the instance - instance = this === Chartist ? Object.create(proto) : this; - fn.apply(instance, Array.prototype.slice.call(arguments, 0)); - - // If this constructor was not called with new we need to return the instance - // This will not harm when the constructor has been called with new as the returned value is ignored - return instance; - }; - - constr.prototype = proto; - constr['super'] = superProto; - constr.extend = this.extend; - - return constr; - } - - // Variable argument list clones args > 0 into args[0] and retruns modified args[0] - function cloneDefinitions() { - var args = listToArray(arguments); - var target = args[0]; - - args.splice(1, args.length - 1).forEach(function (source) { - Object.getOwnPropertyNames(source).forEach(function (propName) { - // If this property already exist in target we delete it first - delete target[propName]; - // Define the property with the descriptor from source - Object.defineProperty(target, propName, - Object.getOwnPropertyDescriptor(source, propName)); - }); - }); - - return target; - } - - Chartist.Class = { - extend: extend, - cloneDefinitions: cloneDefinitions - }; - -}(window, document, Chartist)); -;/** - * Base for all chart types. The methods in Chartist.Base are inherited to all chart types. - * - * @module Chartist.Base - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance. - // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not - // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage. - // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html - // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj - // The problem is with the label offsets that can't be converted into percentage and affecting the chart container - /** - * Updates the chart which currently does a full reconstruction of the SVG DOM - * - * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart. - * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart. - * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base - * @memberof Chartist.Base - */ - function update(data, options, override) { - if(data) { - this.data = data; - // Event for data transformation that allows to manipulate the data before it gets rendered in the charts - this.eventEmitter.emit('data', { - type: 'update', - data: this.data - }); - } - - if(options) { - this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options); - - // If chartist was not initialized yet, we just set the options and leave the rest to the initialization - // Otherwise we re-create the optionsProvider at this point - if(!this.initializeTimeoutId) { - this.optionsProvider.removeMediaQueryListeners(); - this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); - } - } - - // Only re-created the chart if it has been initialized yet - if(!this.initializeTimeoutId) { - this.createChart(this.optionsProvider.getCurrentOptions()); - } - - // Return a reference to the chart object to chain up calls - return this; - } - - /** - * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically. - * - * @memberof Chartist.Base - */ - function detach() { - // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore - // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout - if(!this.initializeTimeoutId) { - window.removeEventListener('resize', this.resizeListener); - this.optionsProvider.removeMediaQueryListeners(); - } else { - window.clearTimeout(this.initializeTimeoutId); - } - - return this; - } - - /** - * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. - * - * @memberof Chartist.Base - * @param {String} event Name of the event. Check the examples for supported events. - * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. - */ - function on(event, handler) { - this.eventEmitter.addEventHandler(event, handler); - return this; - } - - /** - * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. - * - * @memberof Chartist.Base - * @param {String} event Name of the event for which a handler should be removed - * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. - */ - function off(event, handler) { - this.eventEmitter.removeEventHandler(event, handler); - return this; - } - - function initialize() { - // Add window resize listener that re-creates the chart - window.addEventListener('resize', this.resizeListener); - - // Obtain current options based on matching media queries (if responsive options are given) - // This will also register a listener that is re-creating the chart based on media changes - this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter); - // Register options change listener that will trigger a chart update - this.eventEmitter.addEventHandler('optionsChanged', function() { - this.update(); - }.bind(this)); - - // Before the first chart creation we need to register us with all plugins that are configured - // Initialize all relevant plugins with our chart object and the plugin options specified in the config - if(this.options.plugins) { - this.options.plugins.forEach(function(plugin) { - if(plugin instanceof Array) { - plugin[0](this, plugin[1]); - } else { - plugin(this); - } - }.bind(this)); - } - - // Event for data transformation that allows to manipulate the data before it gets rendered in the charts - this.eventEmitter.emit('data', { - type: 'initial', - data: this.data - }); - - // Create the first chart - this.createChart(this.optionsProvider.getCurrentOptions()); - - // As chart is initialized from the event loop now we can reset our timeout reference - // This is important if the chart gets initialized on the same element twice - this.initializeTimeoutId = undefined; - } - - /** - * Constructor of chart base class. - * - * @param query - * @param data - * @param defaultOptions - * @param options - * @param responsiveOptions - * @constructor - */ - function Base(query, data, defaultOptions, options, responsiveOptions) { - this.container = Chartist.querySelector(query); - this.data = data; - this.defaultOptions = defaultOptions; - this.options = options; - this.responsiveOptions = responsiveOptions; - this.eventEmitter = Chartist.EventEmitter(); - this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility'); - this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute'); - this.resizeListener = function resizeListener(){ - this.update(); - }.bind(this); - - if(this.container) { - // If chartist was already initialized in this container we are detaching all event listeners first - if(this.container.__chartist__) { - this.container.__chartist__.detach(); - } - - this.container.__chartist__ = this; - } - - // Using event loop for first draw to make it possible to register event listeners in the same call stack where - // the chart was created. - this.initializeTimeoutId = setTimeout(initialize.bind(this), 0); - } - - // Creating the chart base class - Chartist.Base = Chartist.Class.extend({ - constructor: Base, - optionsProvider: undefined, - container: undefined, - svg: undefined, - eventEmitter: undefined, - createChart: function() { - throw new Error('Base chart type can\'t be instantiated!'); - }, - update: update, - detach: detach, - on: on, - off: off, - version: Chartist.version, - supportsForeignObject: false - }); - -}(window, document, Chartist)); -;/** - * Chartist SVG module for simple SVG DOM abstraction - * - * @module Chartist.Svg - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - /** - * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. - * - * @memberof Chartist.Svg - * @constructor - * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg - * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} className This class or class list will be added to the SVG element - * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child - * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - */ - function Svg(name, attributes, className, parent, insertFirst) { - // If Svg is getting called with an SVG element we just return the wrapper - if(name instanceof Element) { - this._node = name; - } else { - this._node = document.createElementNS(Chartist.namespaces.svg, name); - - // If this is an SVG element created then custom namespace - if(name === 'svg') { - this.attr({ - 'xmlns:ct': Chartist.namespaces.ct - }); - } - } - - if(attributes) { - this.attr(attributes); - } - - if(className) { - this.addClass(className); - } - - if(parent) { - if (insertFirst && parent._node.firstChild) { - parent._node.insertBefore(this._node, parent._node.firstChild); - } else { - parent._node.appendChild(this._node); - } - } - } - - /** - * Set attributes on the current SVG element of the wrapper you're currently working on. - * - * @memberof Chartist.Svg - * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value. - * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object. - * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function. - */ - function attr(attributes, ns) { - if(typeof attributes === 'string') { - if(ns) { - return this._node.getAttributeNS(ns, attributes); - } else { - return this._node.getAttribute(attributes); - } - } - - Object.keys(attributes).forEach(function(key) { - // If the attribute value is undefined we can skip this one - if(attributes[key] === undefined) { - return; - } - - if (key.indexOf(':') !== -1) { - var namespacedAttribute = key.split(':'); - this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]); - } else { - this._node.setAttribute(key, attributes[key]); - } - }.bind(this)); - - return this; - } - - /** - * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. - * - * @memberof Chartist.Svg - * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper - * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element - * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data - */ - function elem(name, attributes, className, insertFirst) { - return new Chartist.Svg(name, attributes, className, this, insertFirst); - } - - /** - * Returns the parent Chartist.SVG wrapper object - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null. - */ - function parent() { - return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null; - } - - /** - * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element - */ - function root() { - var node = this._node; - while(node.nodeName !== 'svg') { - node = node.parentNode; - } - return new Chartist.Svg(node); - } - - /** - * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. - * - * @memberof Chartist.Svg - * @param {String} selector A CSS selector that is used to query for child SVG elements - * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found - */ - function querySelector(selector) { - var foundNode = this._node.querySelector(selector); - return foundNode ? new Chartist.Svg(foundNode) : null; - } - - /** - * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. - * - * @memberof Chartist.Svg - * @param {String} selector A CSS selector that is used to query for child SVG elements - * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found - */ - function querySelectorAll(selector) { - var foundNodes = this._node.querySelectorAll(selector); - return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null; - } - - /** - * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. - * - * @memberof Chartist.Svg - * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject - * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added. - * @param {String} [className] This class or class list will be added to the SVG element - * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child - * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element - */ - function foreignObject(content, attributes, className, insertFirst) { - // If content is string then we convert it to DOM - // TODO: Handle case where content is not a string nor a DOM Node - if(typeof content === 'string') { - var container = document.createElement('div'); - container.innerHTML = content; - content = container.firstChild; - } - - // Adding namespace to content element - content.setAttribute('xmlns', Chartist.namespaces.xmlns); - - // Creating the foreignObject without required extension attribute (as described here - // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement) - var fnObj = this.elem('foreignObject', attributes, className, insertFirst); - - // Add content to foreignObjectElement - fnObj._node.appendChild(content); - - return fnObj; - } - - /** - * This method adds a new text element to the current Chartist.Svg wrapper. - * - * @memberof Chartist.Svg - * @param {String} t The text that should be added to the text element that is created - * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element - */ - function text(t) { - this._node.appendChild(document.createTextNode(t)); - return this; - } - - /** - * This method will clear all child nodes of the current wrapper object. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The same wrapper object that got emptied - */ - function empty() { - while (this._node.firstChild) { - this._node.removeChild(this._node.firstChild); - } - - return this; - } - - /** - * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The parent wrapper object of the element that got removed - */ - function remove() { - this._node.parentNode.removeChild(this._node); - return this.parent(); - } - - /** - * This method will replace the element with a new element that can be created outside of the current DOM. - * - * @memberof Chartist.Svg - * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object - * @return {Chartist.Svg} The wrapper of the new element - */ - function replace(newElement) { - this._node.parentNode.replaceChild(newElement._node, this._node); - return newElement; - } - - /** - * This method will append an element to the current element as a child. - * - * @memberof Chartist.Svg - * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child - * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child - * @return {Chartist.Svg} The wrapper of the appended object - */ - function append(element, insertFirst) { - if(insertFirst && this._node.firstChild) { - this._node.insertBefore(element._node, this._node.firstChild); - } else { - this._node.appendChild(element._node); - } - - return this; - } - - /** - * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. - * - * @memberof Chartist.Svg - * @return {Array} A list of classes or an empty array if there are no classes on the current element - */ - function classes() { - return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\s+/) : []; - } - - /** - * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @return {Chartist.Svg} The wrapper of the current element - */ - function addClass(names) { - this._node.setAttribute('class', - this.classes(this._node) - .concat(names.trim().split(/\s+/)) - .filter(function(elem, pos, self) { - return self.indexOf(elem) === pos; - }).join(' ') - ); - - return this; - } - - /** - * Removes one or a space separated list of classes from the current element. - * - * @memberof Chartist.Svg - * @param {String} names A white space separated list of class names - * @return {Chartist.Svg} The wrapper of the current element - */ - function removeClass(names) { - var removedClasses = names.trim().split(/\s+/); - - this._node.setAttribute('class', this.classes(this._node).filter(function(name) { - return removedClasses.indexOf(name) === -1; - }).join(' ')); - - return this; - } - - /** - * Removes all classes from the current element. - * - * @memberof Chartist.Svg - * @return {Chartist.Svg} The wrapper of the current element - */ - function removeAllClasses() { - this._node.setAttribute('class', ''); - - return this; - } - - /** - * Get element height using `getBoundingClientRect` - * - * @memberof Chartist.Svg - * @return {Number} The elements height in pixels - */ - function height() { - return this._node.getBoundingClientRect().height; - } - - /** - * Get element width using `getBoundingClientRect` - * - * @memberof Chartist.Core - * @return {Number} The elements width in pixels - */ - function width() { - return this._node.getBoundingClientRect().width; - } - - /** - * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve. - * **An animations object could look like this:** - * ```javascript - * element.animate({ - * opacity: { - * dur: 1000, - * from: 0, - * to: 1 - * }, - * x1: { - * dur: '1000ms', - * from: 100, - * to: 200, - * easing: 'easeOutQuart' - * }, - * y1: { - * dur: '2s', - * from: 0, - * to: 100 - * } - * }); - * ``` - * **Automatic unit conversion** - * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds. - * **Guided mode** - * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it. - * If guided mode is enabled the following behavior is added: - * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation - * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation) - * - The animate element will be forced to use `fill="freeze"` - * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately. - * - After the animation the element attribute value will be set to the `to` value of the animation - * - The animate element is deleted from the DOM - * - * @memberof Chartist.Svg - * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode. - * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated. - * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends. - * @return {Chartist.Svg} The current element where the animation was added - */ - function animate(animations, guided, eventEmitter) { - if(guided === undefined) { - guided = true; - } - - Object.keys(animations).forEach(function createAnimateForAttributes(attribute) { - - function createAnimate(animationDefinition, guided) { - var attributeProperties = {}, - animate, - timeout, - easing; - - // Check if an easing is specified in the definition object and delete it from the object as it will not - // be part of the animate element attributes. - if(animationDefinition.easing) { - // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object - easing = animationDefinition.easing instanceof Array ? - animationDefinition.easing : - Chartist.Svg.Easing[animationDefinition.easing]; - delete animationDefinition.easing; - } - - // If numeric dur or begin was provided we assume milli seconds - animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms'); - animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms'); - - if(easing) { - animationDefinition.calcMode = 'spline'; - animationDefinition.keySplines = easing.join(' '); - animationDefinition.keyTimes = '0;1'; - } - - // Adding "fill: freeze" if we are in guided mode and set initial attribute values - if(guided) { - animationDefinition.fill = 'freeze'; - // Animated property on our element should already be set to the animation from value in guided mode - attributeProperties[attribute] = animationDefinition.from; - this.attr(attributeProperties); - - // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin - // which needs to be in ms aside - timeout = Chartist.quantity(animationDefinition.begin || 0).value; - animationDefinition.begin = 'indefinite'; - } - - animate = this.elem('animate', Chartist.extend({ - attributeName: attribute - }, animationDefinition)); - - if(guided) { - // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout - setTimeout(function() { - // If beginElement fails we set the animated attribute to the end position and remove the animate element - // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in - // the browser. (Currently FF 34 does not support animate elements in foreignObjects) - try { - animate._node.beginElement(); - } catch(err) { - // Set animated attribute to current animated value - attributeProperties[attribute] = animationDefinition.to; - this.attr(attributeProperties); - // Remove the animate element as it's no longer required - animate.remove(); - } - }.bind(this), timeout); - } - - if(eventEmitter) { - animate._node.addEventListener('beginEvent', function handleBeginEvent() { - eventEmitter.emit('animationBegin', { - element: this, - animate: animate._node, - params: animationDefinition - }); - }.bind(this)); - } - - animate._node.addEventListener('endEvent', function handleEndEvent() { - if(eventEmitter) { - eventEmitter.emit('animationEnd', { - element: this, - animate: animate._node, - params: animationDefinition - }); - } - - if(guided) { - // Set animated attribute to current animated value - attributeProperties[attribute] = animationDefinition.to; - this.attr(attributeProperties); - // Remove the animate element as it's no longer required - animate.remove(); - } - }.bind(this)); - } - - // If current attribute is an array of definition objects we create an animate for each and disable guided mode - if(animations[attribute] instanceof Array) { - animations[attribute].forEach(function(animationDefinition) { - createAnimate.bind(this)(animationDefinition, false); - }.bind(this)); - } else { - createAnimate.bind(this)(animations[attribute], guided); - } - - }.bind(this)); - - return this; - } - - Chartist.Svg = Chartist.Class.extend({ - constructor: Svg, - attr: attr, - elem: elem, - parent: parent, - root: root, - querySelector: querySelector, - querySelectorAll: querySelectorAll, - foreignObject: foreignObject, - text: text, - empty: empty, - remove: remove, - replace: replace, - append: append, - classes: classes, - addClass: addClass, - removeClass: removeClass, - removeAllClasses: removeAllClasses, - height: height, - width: width, - animate: animate - }); - - /** - * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. - * - * @memberof Chartist.Svg - * @param {String} feature The SVG 1.1 feature that should be checked for support. - * @return {Boolean} True of false if the feature is supported or not - */ - Chartist.Svg.isSupported = function(feature) { - return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1'); - }; - - /** - * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions. - * - * @memberof Chartist.Svg - */ - var easingCubicBeziers = { - easeInSine: [0.47, 0, 0.745, 0.715], - easeOutSine: [0.39, 0.575, 0.565, 1], - easeInOutSine: [0.445, 0.05, 0.55, 0.95], - easeInQuad: [0.55, 0.085, 0.68, 0.53], - easeOutQuad: [0.25, 0.46, 0.45, 0.94], - easeInOutQuad: [0.455, 0.03, 0.515, 0.955], - easeInCubic: [0.55, 0.055, 0.675, 0.19], - easeOutCubic: [0.215, 0.61, 0.355, 1], - easeInOutCubic: [0.645, 0.045, 0.355, 1], - easeInQuart: [0.895, 0.03, 0.685, 0.22], - easeOutQuart: [0.165, 0.84, 0.44, 1], - easeInOutQuart: [0.77, 0, 0.175, 1], - easeInQuint: [0.755, 0.05, 0.855, 0.06], - easeOutQuint: [0.23, 1, 0.32, 1], - easeInOutQuint: [0.86, 0, 0.07, 1], - easeInExpo: [0.95, 0.05, 0.795, 0.035], - easeOutExpo: [0.19, 1, 0.22, 1], - easeInOutExpo: [1, 0, 0, 1], - easeInCirc: [0.6, 0.04, 0.98, 0.335], - easeOutCirc: [0.075, 0.82, 0.165, 1], - easeInOutCirc: [0.785, 0.135, 0.15, 0.86], - easeInBack: [0.6, -0.28, 0.735, 0.045], - easeOutBack: [0.175, 0.885, 0.32, 1.275], - easeInOutBack: [0.68, -0.55, 0.265, 1.55] - }; - - Chartist.Svg.Easing = easingCubicBeziers; - - /** - * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements. - * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`. - * - * @memberof Chartist.Svg - * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll) - * @constructor - */ - function SvgList(nodeList) { - var list = this; - - this.svgElements = []; - for(var i = 0; i < nodeList.length; i++) { - this.svgElements.push(new Chartist.Svg(nodeList[i])); - } - - // Add delegation methods for Chartist.Svg - Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) { - return ['constructor', - 'parent', - 'querySelector', - 'querySelectorAll', - 'replace', - 'append', - 'classes', - 'height', - 'width'].indexOf(prototypeProperty) === -1; - }).forEach(function(prototypeProperty) { - list[prototypeProperty] = function() { - var args = Array.prototype.slice.call(arguments, 0); - list.svgElements.forEach(function(element) { - Chartist.Svg.prototype[prototypeProperty].apply(element, args); - }); - return list; - }; - }); - } - - Chartist.Svg.List = Chartist.Class.extend({ - constructor: SvgList - }); -}(window, document, Chartist)); -;/** - * Chartist SVG path module for SVG path description creation and modification. - * - * @module Chartist.Svg.Path - */ -/* global Chartist */ -(function(window, document, Chartist) { - 'use strict'; - - /** - * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported. - * - * @memberof Chartist.Svg.Path - * @type {Object} - */ - var elementDescriptions = { - m: ['x', 'y'], - l: ['x', 'y'], - c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'], - a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y'] - }; - - /** - * Default options for newly created SVG path objects. - * - * @memberof Chartist.Svg.Path - * @type {Object} - */ - var defaultOptions = { - // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed. - accuracy: 3 - }; - - function element(command, params, pathElements, pos, relative, data) { - var pathElement = Chartist.extend({ - command: relative ? command.toLowerCase() : command.toUpperCase() - }, params, data ? { data: data } : {} ); - - pathElements.splice(pos, 0, pathElement); - } - - function forEachParam(pathElements, cb) { - pathElements.forEach(function(pathElement, pathElementIndex) { - elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) { - cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements); - }); - }); - } - - /** - * Used to construct a new path object. - * - * @memberof Chartist.Svg.Path - * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end) - * @param {Object} options Options object that overrides the default objects. See default options for more details. - * @constructor - */ - function SvgPath(close, options) { - this.pathElements = []; - this.pos = 0; - this.close = close; - this.options = Chartist.extend({}, defaultOptions, options); - } - - /** - * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor. - * - * @memberof Chartist.Svg.Path - * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array. - * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned. - */ - function position(pos) { - if(pos !== undefined) { - this.pos = Math.max(0, Math.min(this.pathElements.length, pos)); - return this; - } else { - return this.pos; - } - } - - /** - * Removes elements from the path starting at the current position. - * - * @memberof Chartist.Svg.Path - * @param {Number} count Number of path elements that should be removed from the current position. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function remove(count) { - this.pathElements.splice(this.pos, count); - return this; - } - - /** - * Use this function to add a new move SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The x coordinate for the move element. - * @param {Number} y The y coordinate for the move element. - * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function move(x, y, relative, data) { - element('M', { - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new line SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The x coordinate for the line element. - * @param {Number} y The y coordinate for the line element. - * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function line(x, y, relative, data) { - element('L', { - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new curve SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} x1 The x coordinate for the first control point of the bezier curve. - * @param {Number} y1 The y coordinate for the first control point of the bezier curve. - * @param {Number} x2 The x coordinate for the second control point of the bezier curve. - * @param {Number} y2 The y coordinate for the second control point of the bezier curve. - * @param {Number} x The x coordinate for the target point of the curve element. - * @param {Number} y The y coordinate for the target point of the curve element. - * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function curve(x1, y1, x2, y2, x, y, relative, data) { - element('C', { - x1: +x1, - y1: +y1, - x2: +x2, - y2: +y2, - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Use this function to add a new non-bezier curve SVG path element. - * - * @memberof Chartist.Svg.Path - * @param {Number} rx The radius to be used for the x-axis of the arc. - * @param {Number} ry The radius to be used for the y-axis of the arc. - * @param {Number} xAr Defines the orientation of the arc - * @param {Number} lAf Large arc flag - * @param {Number} sf Sweep flag - * @param {Number} x The x coordinate for the target point of the curve element. - * @param {Number} y The y coordinate for the target point of the curve element. - * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter) - * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) { - element('A', { - rx: +rx, - ry: +ry, - xAr: +xAr, - lAf: +lAf, - sf: +sf, - x: +x, - y: +y - }, this.pathElements, this.pos++, relative, data); - return this; - } - - /** - * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object. - * - * @memberof Chartist.Svg.Path - * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function parse(path) { - // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']] - var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2') - .replace(/([0-9])([A-Za-z])/g, '$1 $2') - .split(/[\s,]+/) - .reduce(function(result, element) { - if(element.match(/[A-Za-z]/)) { - result.push([]); - } - - result[result.length - 1].push(element); - return result; - }, []); - - // If this is a closed path we remove the Z at the end because this is determined by the close option - if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') { - chunks.pop(); - } - - // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters - // For example {command: 'M', x: '10', y: '10'} - var elements = chunks.map(function(chunk) { - var command = chunk.shift(), - description = elementDescriptions[command.toLowerCase()]; - - return Chartist.extend({ - command: command - }, description.reduce(function(result, paramName, index) { - result[paramName] = +chunk[index]; - return result; - }, {})); - }); - - // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position - var spliceArgs = [this.pos, 0]; - Array.prototype.push.apply(spliceArgs, elements); - Array.prototype.splice.apply(this.pathElements, spliceArgs); - // Increase the internal position by the element count - this.pos += elements.length; - - return this; - } - - /** - * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string. - * - * @memberof Chartist.Svg.Path - * @return {String} - */ - function stringify() { - var accuracyMultiplier = Math.pow(10, this.options.accuracy); - - return this.pathElements.reduce(function(path, pathElement) { - var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) { - return this.options.accuracy ? - (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) : - pathElement[paramName]; - }.bind(this)); - - return path + pathElement.command + params.join(','); - }.bind(this), '') + (this.close ? 'Z' : ''); - } - - /** - * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements. - * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function scale(x, y) { - forEachParam(this.pathElements, function(pathElement, paramName) { - pathElement[paramName] *= paramName[0] === 'x' ? x : y; - }); - return this; - } - - /** - * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate. - * - * @memberof Chartist.Svg.Path - * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements. - * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function translate(x, y) { - forEachParam(this.pathElements, function(pathElement, paramName) { - pathElement[paramName] += paramName[0] === 'x' ? x : y; - }); - return this; - } - - /** - * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path. - * The method signature of the callback function looks like this: - * ```javascript - * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) - * ``` - * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate. - * - * @memberof Chartist.Svg.Path - * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description. - * @return {Chartist.Svg.Path} The current path object for easy call chaining. - */ - function transform(transformFnc) { - forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) { - var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements); - if(transformed || transformed === 0) { - pathElement[paramName] = transformed; - } - }); - return this; - } - - /** - * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned. - * - * @memberof Chartist.Svg.Path - * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used. - * @return {Chartist.Svg.Path} - */ - function clone(close) { - var c = new Chartist.Svg.Path(close || this.close); - c.pos = this.pos; - c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) { - return Chartist.extend({}, pathElement); - }); - c.options = Chartist.extend({}, this.options); - return c; - } - - /** - * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings. - * - * @memberof Chartist.Svg.Path - * @param {String} command The command you'd like to use to split the path - * @return {Array} - */ - function splitByCommand(command) { - var split = [ - new Chartist.Svg.Path() - ]; - - this.pathElements.forEach(function(pathElement) { - if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) { - split.push(new Chartist.Svg.Path()); - } - - split[split.length - 1].pathElements.push(pathElement); - }); - - return split; - } - - /** - * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths. - * - * @memberof Chartist.Svg.Path - * @param {Array} paths A list of paths to be joined together. The order is important. - * @param {boolean} close If the newly created path should be a closed path - * @param {Object} options Path options for the newly created path. - * @return {Chartist.Svg.Path} - */ - - function join(paths, close, options) { - var joinedPath = new Chartist.Svg.Path(close, options); - for(var i = 0; i < paths.length; i++) { - var path = paths[i]; - for(var j = 0; j < path.pathElements.length; j++) { - joinedPath.pathElements.push(path.pathElements[j]); - } - } - return joinedPath; - } - - Chartist.Svg.Path = Chartist.Class.extend({ - constructor: SvgPath, - position: position, - remove: remove, - move: move, - line: line, - curve: curve, - arc: arc, - scale: scale, - translate: translate, - transform: transform, - parse: parse, - stringify: stringify, - clone: clone, - splitByCommand: splitByCommand - }); - - Chartist.Svg.Path.elementDescriptions = elementDescriptions; - Chartist.Svg.Path.join = join; -}(window, document, Chartist)); -;/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - var axisUnits = { - x: { - pos: 'x', - len: 'width', - dir: 'horizontal', - rectStart: 'x1', - rectEnd: 'x2', - rectOffset: 'y2' - }, - y: { - pos: 'y', - len: 'height', - dir: 'vertical', - rectStart: 'y2', - rectEnd: 'y1', - rectOffset: 'x1' - } - }; - - function Axis(units, chartRect, ticks, options) { - this.units = units; - this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x; - this.chartRect = chartRect; - this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart]; - this.gridOffset = chartRect[units.rectOffset]; - this.ticks = ticks; - this.options = options; - } - - function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) { - var axisOptions = chartOptions['axis' + this.units.pos.toUpperCase()]; - var projectedValues = this.ticks.map(this.projectValue.bind(this)); - var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc); - - var lastWidth=undefined; - projectedValues.forEach(function(projectedValue, index) { - var labelOffset = { - x: 0, - y: 0 - }; - - // TODO: Find better solution for solving this problem - // Calculate how much space we have available for the label - var labelLength=0;/* - if(projectedValues[index + 1]) { - // If we still have one label ahead, we can calculate the distance to the next tick / label - labelLength = projectedValues[index + 1] - projectedValue; - lastWidth = labelLength; - } else if (typeof lastWidth != 'undefined') { - labelLength = lastWidth; // EDIT. added the lastWidth thing - } - // else { - // // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to - // // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will - // // still be visible inside of the chart padding. - // labelLength = Math.max(this.axisLength - projectedValue, 30); - // } - */ - - // Skip grid lines and labels where interpolated label values are falsey (execpt for 0) - if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') { - return; - } - - // Transform to global coordinates using the chartRect - // We also need to set the label offset for the createLabel function - if(this.units.pos === 'x') { - projectedValue = this.chartRect.x1 + projectedValue; - labelOffset.x = chartOptions.axisX.labelOffset.x; - - // If the labels should be positioned in start position (top side for vertical axis) we need to set a - // different offset as for positioned with end (bottom) - if(chartOptions.axisX.position === 'start') { - labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); - } else { - labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20); - } - } else { - projectedValue = this.chartRect.y1 - projectedValue; - labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0); - - // If the labels should be positioned in start position (left side for horizontal axis) we need to set a - // different offset as for positioned with end (right side) - if(chartOptions.axisY.position === 'start') { - labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10; - } else { - labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10; - } - } - - if(axisOptions.showGrid) { - Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [ - chartOptions.classNames.grid, - chartOptions.classNames[this.units.dir] - ], eventEmitter); - } - - if(axisOptions.showLabel) { - Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [ - chartOptions.classNames.label, - chartOptions.classNames[this.units.dir], - chartOptions.classNames[axisOptions.position] - ], useForeignObject, eventEmitter); - } - }.bind(this)); - } - - Chartist.Axis = Chartist.Class.extend({ - constructor: Axis, - createGridAndLabels: createGridAndLabels, - projectValue: function(value, index, data) { - throw new Error('Base axis can\'t be instantiated!'); - } - }); - - Chartist.Axis.units = axisUnits; - -}(window, document, Chartist)); -;/** - * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored - * high: 100, - * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored - * low: 0, - * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel). - * scaleMinSpace: 20, - * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only. - * onlyInteger: true, - * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart. - * referenceValue: 5 - * }; - * ``` - * - * @module Chartist.AutoScaleAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function AutoScaleAxis(axisUnit, data, chartRect, options) { - // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options - var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); - this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger); - this.range = { - min: this.bounds.min, - max: this.bounds.max - }; - - Chartist.AutoScaleAxis['super'].constructor.call(this, - axisUnit, - chartRect, - this.bounds.values, - options); - } - - function projectValue(value) { - return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range; - } - - Chartist.AutoScaleAxis = Chartist.Axis.extend({ - constructor: AutoScaleAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored - * high: 100, - * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored - * low: 0, - * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1. - * divisor: 4, - * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated. - * ticks: [1, 10, 20, 30] - * }; - * ``` - * - * @module Chartist.FixedScaleAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function FixedScaleAxis(axisUnit, data, chartRect, options) { - var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos); - this.divisor = options.divisor || 1; - this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) { - return highLow.low + (highLow.high - highLow.low) / this.divisor * index; - }.bind(this)); - this.ticks.sort(function(a, b) { - return a - b; - }); - this.range = { - min: highLow.low, - max: highLow.high - }; - - Chartist.FixedScaleAxis['super'].constructor.call(this, - axisUnit, - chartRect, - this.ticks, - options); - - this.stepLength = this.axisLength / this.divisor; - } - - function projectValue(value) { - return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min); - } - - Chartist.FixedScaleAxis = Chartist.Axis.extend({ - constructor: FixedScaleAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose. - * **Options** - * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings. - * ```javascript - * var options = { - * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks. - * ticks: ['One', 'Two', 'Three'], - * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead. - * stretch: true - * }; - * ``` - * - * @module Chartist.StepAxis - */ -/* global Chartist */ -(function (window, document, Chartist) { - 'use strict'; - - function StepAxis(axisUnit, data, chartRect, options) { - Chartist.StepAxis['super'].constructor.call(this, - axisUnit, - chartRect, - options.ticks, - options); - - this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0)); - } - - function projectValue(value, index) { - return this.stepLength * index; - } - - Chartist.StepAxis = Chartist.Axis.extend({ - constructor: StepAxis, - projectValue: projectValue - }); - -}(window, document, Chartist)); -;/** - * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point. - * - * For examples on how to use the line chart please check the examples of the `Chartist.Line` method. - * - * @module Chartist.Line - */ -/* global Chartist */ -(function(window, document, Chartist){ - 'use strict'; - - /** - * Default options in line charts. Expand the code view to see a detailed list of options with comments. - * - * @memberof Chartist.Line - */ - var defaultOptions = { - // Options for X-Axis - axisX: { - // The offset of the labels to the chart area - offset: 30, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'end', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - type: undefined - }, - // Options for Y-Axis - axisY: { - // The offset of the labels to the chart area - offset: 40, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'start', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - type: undefined, - // This value specifies the minimum height in pixel of the scale steps - scaleMinSpace: 20, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - width: undefined, - // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - height: undefined, - // If the line should be drawn or not - showLine: true, - // If dots should be drawn or not - showPoint: true, - // If the line chart should draw an area - showArea: false, - // The base for the area chart that will be used to close the area shape (is normally 0) - areaBase: 0, - // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description. - lineSmooth: true, - // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - low: undefined, - // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - high: undefined, - // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - chartPadding: { - top: 15, - right: 15, - bottom: 5, - left: 10 - }, - // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler. - fullWidth: false, - // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - reverseData: false, - // Override the class names that get used to generate the SVG structure of the chart - classNames: { - chart: 'ct-chart-line', - label: 'ct-label', - labelGroup: 'ct-labels', - series: 'ct-series', - line: 'ct-line', - point: 'ct-point', - area: 'ct-area', - grid: 'ct-grid', - gridGroup: 'ct-grids', - vertical: 'ct-vertical', - horizontal: 'ct-horizontal', - start: 'ct-start', - end: 'ct-end' - } - }; - - /** - * Creates a new chart - * - */ - function createChart(options) { - this.data = Chartist.normalizeData(this.data); - var data = { - raw: this.data, - normalized: Chartist.getDataArray(this.data, options.reverseData, true) - }; - - // Create new svg object - this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart); - // Create groups for labels, grid and series - var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); - var seriesGroup = this.svg.elem('g'); - var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); - - var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); - var axisX, axisY; - - if(options.axisX.type === undefined) { - axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - ticks: data.raw.labels, - stretch: options.fullWidth - })); - } else { - axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); - } - - if(options.axisY.type === undefined) { - axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - high: Chartist.isNum(options.high) ? options.high : options.axisY.high, - low: Chartist.isNum(options.low) ? options.low : options.axisY.low - })); - } else { - axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); - } - - axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - - // Draw the series - data.raw.series.forEach(function(series, seriesIndex) { - var seriesElement = seriesGroup.elem('g'); - - // Write attributes to series group element. If series name or meta is undefined the attributes will not be written - seriesElement.attr({ - 'ct:series-name': series.name, - 'ct:meta': Chartist.serialize(series.meta) - }); - - // Use series class from series data or if not set generate one - seriesElement.addClass([ - options.classNames.series, - (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) - ].join(' ')); - - var pathCoordinates = [], - pathData = []; - - data.normalized[seriesIndex].forEach(function(value, valueIndex) { - var p = { - x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex]) - }; - pathCoordinates.push(p.x, p.y); - pathData.push({ - value: value, - valueIndex: valueIndex, - meta: Chartist.getMetaData(series, valueIndex) - }); - }.bind(this)); - - var seriesOptions = { - lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'), - showPoint: Chartist.getSeriesOption(series, options, 'showPoint'), - showLine: Chartist.getSeriesOption(series, options, 'showLine'), - showArea: Chartist.getSeriesOption(series, options, 'showArea'), - areaBase: Chartist.getSeriesOption(series, options, 'areaBase') - }; - - var smoothing = typeof seriesOptions.lineSmooth === 'function' ? - seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none()); - // Interpolating path where pathData will be used to annotate each path element so we can trace back the original - // index, value and meta data - var path = smoothing(pathCoordinates, pathData); - - // If we should show points we need to create them now to avoid secondary loop - // Points are drawn from the pathElements returned by the interpolation function - // Small offset for Firefox to render squares correctly - if (seriesOptions.showPoint) { - - path.pathElements.forEach(function(pathElement) { - var point = seriesElement.elem('line', { - x1: pathElement.x, - y1: pathElement.y, - x2: pathElement.x + 0.01, - y2: pathElement.y - }, options.classNames.point).attr({ - 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','), - 'ct:meta': pathElement.data.meta - }); - - this.eventEmitter.emit('draw', { - type: 'point', - value: pathElement.data.value, - index: pathElement.data.valueIndex, - meta: pathElement.data.meta, - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - group: seriesElement, - element: point, - x: pathElement.x, - y: pathElement.y - }); - }.bind(this)); - } - - if(seriesOptions.showLine) { - var line = seriesElement.elem('path', { - d: path.stringify() - }, options.classNames.line, true); - - this.eventEmitter.emit('draw', { - type: 'line', - values: data.normalized[seriesIndex], - path: path.clone(), - chartRect: chartRect, - index: seriesIndex, - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - group: seriesElement, - element: line - }); - } - - // Area currently only works with axes that support a range! - if(seriesOptions.showArea && axisY.range) { - // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that - // the area is not drawn outside the chart area. - var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min); - - // We project the areaBase value into screen coordinates - var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase); - - // In order to form the area we'll first split the path by move commands so we can chunk it up into segments - path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) { - // We filter only "solid" segments that contain more than one point. Otherwise there's no need for an area - return pathSegment.pathElements.length > 1; - }).map(function convertToArea(solidPathSegments) { - // Receiving the filtered solid path segments we can now convert those segments into fill areas - var firstElement = solidPathSegments.pathElements[0]; - var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1]; - - // Cloning the solid path segment with closing option and removing the first move command from the clone - // We then insert a new move that should start at the area base and draw a straight line up or down - // at the end of the path we add an additional straight line to the projected area base value - // As the closing option is set our path will be automatically closed - return solidPathSegments.clone(true) - .position(0) - .remove(1) - .move(firstElement.x, areaBaseProjected) - .line(firstElement.x, firstElement.y) - .position(solidPathSegments.pathElements.length + 1) - .line(lastElement.x, areaBaseProjected); - - }).forEach(function createArea(areaPath) { - // For each of our newly created area paths, we'll now create path elements by stringifying our path objects - // and adding the created DOM elements to the correct series group - var area = seriesElement.elem('path', { - d: areaPath.stringify() - }, options.classNames.area, true); - - // Emit an event for each area that was drawn - this.eventEmitter.emit('draw', { - type: 'area', - values: data.normalized[seriesIndex], - path: areaPath.clone(), - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - chartRect: chartRect, - index: seriesIndex, - group: seriesElement, - element: area - }); - }.bind(this)); - } - }.bind(this)); - - this.eventEmitter.emit('created', { - bounds: axisY.bounds, - chartRect: chartRect, - axisX: axisX, - axisY: axisY, - svg: this.svg, - options: options - }); - } - - /** - * This method creates a new line chart. - * - * @memberof Chartist.Line - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // Create a simple line chart - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // As options we currently only set a static size of 300x200 px - * var options = { - * width: '300px', - * height: '200px' - * }; - * - * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options - * new Chartist.Line('.ct-chart', data, options); - * - * @example - * // Use specific interpolation function with configuration from the Chartist.Interpolation module - * - * var chart = new Chartist.Line('.ct-chart', { - * labels: [1, 2, 3, 4, 5], - * series: [ - * [1, 1, 8, 1, 7] - * ] - * }, { - * lineSmooth: Chartist.Interpolation.cardinal({ - * tension: 0.2 - * }) - * }); - * - * @example - * // Create a line chart with responsive options - * - * var data = { - * // A labels array that can contain any sort of values - * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], - * // Our series array that contains series objects or in this case series data arrays - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries. - * var responsiveOptions = [ - * ['screen and (min-width: 641px) and (max-width: 1024px)', { - * showPoint: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return Mon, Tue, Wed etc. on medium screens - * return value.slice(0, 3); - * } - * } - * }], - * ['screen and (max-width: 640px)', { - * showLine: false, - * axisX: { - * labelInterpolationFnc: function(value) { - * // Will return M, T, W etc. on small screens - * return value[0]; - * } - * } - * }] - * ]; - * - * new Chartist.Line('.ct-chart', data, null, responsiveOptions); - * - */ - function Line(query, data, options, responsiveOptions) { - Chartist.Line['super'].constructor.call(this, - query, - data, - defaultOptions, - Chartist.extend({}, defaultOptions, options), - responsiveOptions); - } - - // Creating line chart type in Chartist namespace - Chartist.Line = Chartist.Base.extend({ - constructor: Line, - createChart: createChart - }); - -}(window, document, Chartist)); -;/** - * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts. - * - * @module Chartist.Bar - */ -/* global Chartist */ -(function(window, document, Chartist){ - 'use strict'; - - /** - * Default options in bar charts. Expand the code view to see a detailed list of options with comments. - * - * @memberof Chartist.Bar - */ - var defaultOptions = { - // Options for X-Axis - axisX: { - // The offset of the chart drawing area to the border of the container - offset: 30, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'end', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // This value specifies the minimum width in pixel of the scale steps - scaleMinSpace: 30, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Options for Y-Axis - axisY: { - // The offset of the chart drawing area to the border of the container - offset: 40, - // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - position: 'start', - // Allows you to correct label positioning on this axis by positive or negative x and y offset. - labelOffset: { - x: 0, - y: 0 - }, - // If labels should be shown or not - showLabel: true, - // If the axis grid should be drawn or not - showGrid: true, - // Interpolation function that allows you to intercept the value from the axis label - labelInterpolationFnc: Chartist.noop, - // This value specifies the minimum height in pixel of the scale steps - scaleMinSpace: 20, - // Use only integer values (whole numbers) for the scale steps - onlyInteger: false - }, - // Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - width: undefined, - // Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - height: undefined, - // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - high: undefined, - // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - low: undefined, - // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - chartPadding: { - top: 15, - right: 15, - bottom: 5, - left: 10 - }, - // Specify the distance in pixel of bars in a group - seriesBarDistance: 15, - // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options. - stackBars: false, - // If set to 'overlap' this property will force the stacked bars to draw from the zero line. - // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. - stackMode: 'accumulate', - // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values. - horizontalBars: false, - // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time. - distributeSeries: false, - // If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - reverseData: false, - // Override the class names that get used to generate the SVG structure of the chart - classNames: { - chart: 'ct-chart-bar', - horizontalBars: 'ct-horizontal-bars', - label: 'ct-label', - labelGroup: 'ct-labels', - series: 'ct-series', - bar: 'ct-bar', - grid: 'ct-grid', - gridGroup: 'ct-grids', - vertical: 'ct-vertical', - horizontal: 'ct-horizontal', - start: 'ct-start', - end: 'ct-end' - } - }; - - /** - * Creates a new chart - * - */ - function createChart(options) { - this.data = Chartist.normalizeData(this.data); - var data = { - raw: this.data, - normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) { - return [value]; - }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y') - }; - - var highLow; - - // Create new svg element - this.svg = Chartist.createSvg( - this.container, - options.width, - options.height, - options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '') - ); - - // Drawing groups in correct order - var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup); - var seriesGroup = this.svg.elem('g'); - var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup); - - if(options.stackBars && data.normalized.length !== 0) { - // If stacked bars we need to calculate the high low from stacked values from each series - var serialSums = Chartist.serialMap(data.normalized, function serialSums() { - return Array.prototype.slice.call(arguments).map(function(value) { - return value; - }).reduce(function(prev, curr) { - return { - x: prev.x + (curr && curr.x) || 0, - y: prev.y + (curr && curr.y) || 0 - }; - }, {x: 0, y: 0}); - }); - - highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, { - referenceValue: 0 - }), options.horizontalBars ? 'x' : 'y'); - } else { - highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, { - referenceValue: 0 - }), options.horizontalBars ? 'x' : 'y'); - } - // Overrides of high / low from settings - highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high); - highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low); - - var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding); - - var valueAxis, - labelAxisTicks, - labelAxis, - axisX, - axisY; - - // We need to set step count based on some options combinations - if(options.distributeSeries && options.stackBars) { - // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should - // use only the first label for the step axis - labelAxisTicks = data.raw.labels.slice(0, 1); - } else { - // If distributed series are enabled but stacked bars aren't, we should use the series labels - // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array - // as the bars are normalized - labelAxisTicks = data.raw.labels; - } - - // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary. - if(options.horizontalBars) { - if(options.axisX.type === undefined) { - valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - highLow: highLow, - referenceValue: 0 - })); - } else { - valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, { - highLow: highLow, - referenceValue: 0 - })); - } - - if(options.axisY.type === undefined) { - labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, { - ticks: labelAxisTicks - }); - } else { - labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY); - } - } else { - if(options.axisX.type === undefined) { - labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, { - ticks: labelAxisTicks - }); - } else { - labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX); - } - - if(options.axisY.type === undefined) { - valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - highLow: highLow, - referenceValue: 0 - })); - } else { - valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, { - highLow: highLow, - referenceValue: 0 - })); - } - } - - // Projected 0 point - var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0)); - // Used to track the screen coordinates of stacked bars - var stackedBarValues = []; - - labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter); - - // Draw the series - data.raw.series.forEach(function(series, seriesIndex) { - // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc. - var biPol = seriesIndex - (data.raw.series.length - 1) / 2; - // Half of the period width between vertical grid lines used to position bars - var periodHalfLength; - // Current series SVG element - var seriesElement; - - // We need to set periodHalfLength based on some options combinations - if(options.distributeSeries && !options.stackBars) { - // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array - // which is the series count and divide by 2 - periodHalfLength = labelAxis.axisLength / data.normalized.length / 2; - } else if(options.distributeSeries && options.stackBars) { - // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis - // length by 2 - periodHalfLength = labelAxis.axisLength / 2; - } else { - // On regular bar charts we should just use the series length - periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2; - } - - // Adding the series group to the series element - seriesElement = seriesGroup.elem('g'); - - // Write attributes to series group element. If series name or meta is undefined the attributes will not be written - seriesElement.attr({ - 'ct:series-name': series.name, - 'ct:meta': Chartist.serialize(series.meta) - }); - - // Use series class from series data or if not set generate one - seriesElement.addClass([ - options.classNames.series, - (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)) - ].join(' ')); - - data.normalized[seriesIndex].forEach(function(value, valueIndex) { - var projected, - bar, - previousStack, - labelAxisValueIndex; - - // We need to set labelAxisValueIndex based on some options combinations - if(options.distributeSeries && !options.stackBars) { - // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection - // on the step axis for label positioning - labelAxisValueIndex = seriesIndex; - } else if(options.distributeSeries && options.stackBars) { - // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use - // 0 for projection on the label step axis - labelAxisValueIndex = 0; - } else { - // On regular bar charts we just use the value index to project on the label step axis - labelAxisValueIndex = valueIndex; - } - - // We need to transform coordinates differently based on the chart layout - if(options.horizontalBars) { - projected = { - x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex]) - }; - } else { - projected = { - x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]), - y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex]) - } - } - - // If the label axis is a step based axis we will offset the bar into the middle of between two steps using - // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using - // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not - // add any automated positioning. - if(labelAxis instanceof Chartist.StepAxis) { - // Offset to center bar between grid lines, but only if the step axis is not stretched - if(!labelAxis.options.stretch) { - projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1); - } - // Using bi-polar offset for multiple series if no stacked bars or series distribution is used - projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1); - } - - // Enter value in stacked bar values used to remember previous screen value for stacking up bars - previousStack = stackedBarValues[valueIndex] || zeroPoint; - stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); - - // Skip if value is undefined - if(value === undefined) { - return; - } - - var positions = {}; - positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos]; - positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos]; - - if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) { - // Stack mode: accumulate (default) - // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line - // We want backwards compatibility, so the expected fallback without the 'stackMode' option - // to be the original behaviour (accumulate) - positions[labelAxis.counterUnits.pos + '1'] = previousStack; - positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex]; - } else { - // Draw from the zero line normally - // This is also the same code for Stack mode: overlap - positions[labelAxis.counterUnits.pos + '1'] = zeroPoint; - positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos]; - } - - // Limit x and y so that they are within the chart rect - positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2); - positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2); - positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1); - positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1); - - // Create bar element - bar = seriesElement.elem('line', positions, options.classNames.bar).attr({ - 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','), - 'ct:meta': Chartist.getMetaData(series, valueIndex) - }); - - this.eventEmitter.emit('draw', Chartist.extend({ - type: 'bar', - value: value, - index: valueIndex, - meta: Chartist.getMetaData(series, valueIndex), - series: series, - seriesIndex: seriesIndex, - axisX: axisX, - axisY: axisY, - chartRect: chartRect, - group: seriesElement, - element: bar - }, positions)); - }.bind(this)); - }.bind(this)); - - this.eventEmitter.emit('created', { - bounds: valueAxis.bounds, - chartRect: chartRect, - axisX: axisX, - axisY: axisY, - svg: this.svg, - options: options - }); - } - - /** - * This method creates a new bar chart and returns API object that you can use for later changes. - * - * @memberof Chartist.Bar - * @param {String|Node} query A selector query string or directly a DOM element - * @param {Object} data The data object that needs to consist of a labels and a series array - * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list. - * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]] - * @return {Object} An object which exposes the API for the created chart - * - * @example - * // Create a simple bar chart - * var data = { - * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], - * series: [ - * [5, 2, 4, 2, 0] - * ] - * }; - * - * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object. - * new Chartist.Bar('.ct-chart', data); - * - * @example - * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10 - * new Chartist.Bar('.ct-chart', { - * labels: [1, 2, 3, 4, 5, 6, 7], - * series: [ - * [1, 3, 2, -5, -3, 1, -6], - * [-5, -2, -4, -1, 2, -3, 1] - * ] - * }, { - * seriesBarDistance: 12, - * low: -10, - * high: 10 - * }); - * - */ - function Bar(query, data, options, responsiveOptions) { - Chartist.Bar['super'].constructor.call(this, - query, - data, - defaultOptions, - Chartist.extend({}, defaultOptions, options), - responsiveOptions); - } - - // Creating bar chart type in Chartist namespace - Chartist.Bar = Chartist.Base.extend({ - constructor: Bar, - createChart: createChart - }); - -}(window, document, Chartist)); -; -return Chartist; - -})); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module. - // define([], function () { - // return (root.returnExportsGlobal = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like enviroments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist.plugins.ctAxisTitle'] = factory(); - // } -}(this, function () { - - /** - * Chartist.js plugin to display a title for 1 or 2 axises. - * - */ - /* global Chartist */ - (function (window, document, Chartist) { - 'use strict'; - - var axisDefaults = { - axisTitle: '', - axisClass: 'ct-axis-title', - offset: { - x: 0, - y: 0 - }, - textAnchor: 'middle', - flipText: false - }; - var defaultOptions = { - axisX: axisDefaults, - axisY: axisDefaults - }; - - Chartist.plugins = Chartist.plugins || {}; - Chartist.plugins.ctAxisTitle = function (options) { - - options = Chartist.extend({}, defaultOptions, options); - - console.log(options); - - return function ctAxisTitle(chart) { - - chart.on('created', function (data) { - // - // if (!options.axisX.axisTitle && !options.axisY.axisTitle) { - // throw new Error('ctAxisTitle plugin - You must provide at least one axis title'); - // } else if (!data.axisX && !data.axisY) { - // throw new Error('ctAxisTitle plugin can only be used on charts that have at least one axis'); - // } - - var xPos; - var yPos; - var title; - - //position axis X title - if (options.axisX.axisTitle && data.axisX) { - - xPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left; - - yPos = data.options.chartPadding.top; - - if (data.options.axisY.position === 'end') { - xPos -= data.options.axisY.offset; - } - - if (data.options.axisX.position === 'end') { - yPos += data.axisY.axisLength; - } - - title = new Chartist.Svg("text"); - title.addClass(options.axisX.axisClass); - title.text(options.axisX.axisTitle); - title.attr({ - x: xPos + options.axisX.offset.x, - y: yPos + options.axisX.offset.y, - "text-anchor": options.axisX.textAnchor - }); - - data.svg.append(title, true); - - } - - //position axis Y title - if (options.axisY.axisTitle && data.axisY) { - xPos = 0; - - - yPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top; - - if (data.options.axisX.position === 'start') { - yPos += data.options.axisX.offset; - } - - if (data.options.axisY.position === 'end') { - xPos = data.axisX.axisLength; - } - - var transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')'; - - title = new Chartist.Svg("text"); - title.addClass(options.axisY.axisClass); - title.text(options.axisY.axisTitle); - title.attr({ - x: xPos + options.axisY.offset.x, - y: yPos + options.axisY.offset.y, - transform: transform, - "text-anchor": options.axisY.textAnchor - }); - - data.svg.append(title, true); - - } - - }); - }; - }; - - }(window, document, Chartist)); - - return Chartist.plugins.ctAxisTitle; - -})); - -(function (root, factory) { - // if (typeof define === 'function' && define.amd) { - // // AMD. Register as an anonymous module. - // define([], function () { - // return (root.returnExportsGlobal = factory()); - // }); - // } else if (typeof exports === 'object') { - // // Node. Does not work with strict CommonJS, but - // // only CommonJS-like enviroments that support module.exports, - // // like Node. - // module.exports = factory(); - // } else { - root['Chartist.plugins.zoom'] = factory(); - // } -}(this, function () { - - /** - * Chartist.js zoom plugin. - * - */ - (function (window, document, Chartist) { - 'use strict'; - - var defaultOptions = { - // onZoom - // resetOnRightMouseBtn - }; - - - Chartist.plugins = Chartist.plugins || {}; - Chartist.plugins.zoom = function (options) { - - options = Chartist.extend({}, defaultOptions, options); - - return function zoom(chart) { - - if (!(chart instanceof Chartist.Line)) { - return; - } - - var rect, svg, axisX, axisY, chartRect; - var downPosition; - var onZoom = options.onZoom; - var ongoingTouches = []; - - chart.on('draw', function (data) { - var type = data.type; - if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') { - data.element.attr({ - 'clip-path': 'url(#zoom-mask)' - }); - } - }); - - chart.on('created', function (data) { - axisX = data.axisX; - axisY = data.axisY; - chartRect = data.chartRect; - svg = data.svg._node; - rect = data.svg.elem('rect', { - x: 10, - y: 10, - width: 100, - height: 100, - }, 'ct-zoom-rect'); - hide(rect); - - var defs = data.svg.querySelector('defs') || data.svg.elem('defs'); - var width = chartRect.width(); - var height = chartRect.height(); - - defs - .elem('clipPath', { - id: 'zoom-mask' - }) - .elem('rect', { - x: chartRect.x1, - y: chartRect.y2, - width: width, - height: height, - fill: 'white' - }); - - svg.addEventListener('mousedown', onMouseDown); - svg.addEventListener('mouseup', onMouseUp); - svg.addEventListener('mousemove', onMouseMove); - svg.addEventListener('touchstart', onTouchStart); - svg.addEventListener('touchmove', onTouchMove); - svg.addEventListener('touchend', onTouchEnd); - svg.addEventListener('touchcancel', onTouchCancel); - }); - - function copyTouch(touch) { - var p = position(touch, svg); - p.id = touch.identifier; - return p; - } - - function ongoingTouchIndexById(idToFind) { - for (var i = 0; i < ongoingTouches.length; i++) { - var id = ongoingTouches[i].id; - if (id === idToFind) { - return i; - } - } - return -1; - } - - function onTouchStart(event) { - var touches = event.changedTouches; - for (var i = 0; i < touches.length; i++) { - ongoingTouches.push(copyTouch(touches[i])); - } - - if (ongoingTouches.length > 1) { - rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); - show(rect); - } - } - - function onTouchMove(event) { - var touches = event.changedTouches; - for (var i = 0; i < touches.length; i++) { - var idx = ongoingTouchIndexById(touches[i].identifier); - ongoingTouches.splice(idx, 1, copyTouch(touches[i])); - } - - if (ongoingTouches.length > 1) { - rect.attr(getRect(ongoingTouches[0], ongoingTouches[1])); - show(rect); - event.preventDefault(); - } - } - - function onTouchCancel(event) { - removeTouches(event.changedTouches); - } - - function removeTouches(touches) { - for (var i = 0; i < touches.length; i++) { - var idx = ongoingTouchIndexById(touches[i].identifier); - if (idx >= 0) { - ongoingTouches.splice(idx, 1); - } - } - } - - function onTouchEnd(event) { - if (ongoingTouches.length > 1) { - zoomIn(getRect(ongoingTouches[0], ongoingTouches[1])); - } - removeTouches(event.changedTouches); - hide(rect); - } - - function onMouseDown(event) { - if (event.button === 0) { - downPosition = position(event, svg); - rect.attr(getRect(downPosition, downPosition)); - show(rect); - event.preventDefault(); - } - } - - var reset = function () { - chart.options.axisX.highLow = null; - chart.options.axisY.highLow = null; - chart.update(chart.data, chart.options); - }; - - function onMouseUp(event) { - if (event.button === 0) { - var box = getRect(downPosition, position(event, svg)); - zoomIn(box); - downPosition = null; - hide(rect); - event.preventDefault(); - } - else if (options.resetOnRightMouseBtn && event.button === 2) { - reset(); - event.preventDefault(); - } - } - - function zoomIn(rect) { - if (rect.width > 5 && rect.height > 5) { - var x1 = rect.x - chartRect.x1; - var x2 = x1 + rect.width; - var y2 = chartRect.y1 - rect.y; - var y1 = y2 - rect.height; - - chart.options.axisX.highLow = { low: project(x1, axisX), high: project(x2, axisX) }; - chart.options.axisY.highLow = { low: project(y1, axisY), high: project(y2, axisY) }; - - chart.update(chart.data, chart.options); - onZoom && onZoom(chart, reset); - } - } - - function onMouseMove(event) { - if (downPosition) { - var point = position(event, svg); - rect.attr(getRect(downPosition, point)); - event.preventDefault(); - } - } - }; - - }; - - function hide(rect) { - rect.attr({ style: 'display:none' }); - } - - function show(rect) { - rect.attr({ style: 'display:block' }); - } - - function getRect(firstPoint, secondPoint) { - var x = firstPoint.x; - var y = firstPoint.y; - var width = secondPoint.x - x; - var height = secondPoint.y - y; - if (width < 0) { - width = -width; - x = secondPoint.x; - } - if (height < 0) { - height = -height; - y = secondPoint.y; - } - return { - x: x, - y: y, - width: width, - height: height - }; - } - - function position(event, svg) { - return transform(event.clientX, event.clientY, svg); - } - - function transform(x, y, svgElement) { - var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement; - var matrix = svg.getScreenCTM(); - var point = svg.createSVGPoint(); - point.x = x; - point.y = y; - point = point.matrixTransform(matrix.inverse()); - return point || { x: 0, y: 0 }; - } - - function project(value, axis) { - var max = axis.bounds.max; - var min = axis.bounds.min; - if (axis.scale && axis.scale.type === 'log') { - var base = axis.scale.base; - return Math.pow(base, - value * baseLog(max / min, base) / axis.axisLength) * min; - } - return (value * axis.bounds.range / axis.axisLength) + min; - } - - function baseLog(val, base) { - return Math.log(val) / Math.log(base); - } - - } (window, document, Chartist)); - return Chartist.plugins.zoom; - -})); - -function bool(x) { - return (x === 1 || x === '1' || x === true || x === 'true'); -} - -/** html entities */ -function e(x) { - return String(x) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); -} - -/** Returns true if argument is array [] */ -function isArray(obj) { - return Object.prototype.toString.call(obj) === '[object Array]'; -} - -/** Returns true if argument is object {} */ -function isObject(obj) { - return Object.prototype.toString.call(obj) === '[object Object]'; -} - -/** escape a string to have no special meaning in regex */ -function regexEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} - -/** Convert RSSI 0-255 to % */ -function rssiPerc(rssi) { - var r = parseInt(rssi); - if (r > -50) return 100; // 100% - if (r < -100) return 0; // 0% - return Math.round(2 * (r + 100)); // approximation -} - -/** Perform a substitution in the given string. - * - * Arguments - array or list of replacements. - * Arguments numeric keys will replace {0}, {1} etc. - * Named keys also work, ie. {foo: "bar"} -> replaces {foo} with bar. - * - * Braces are added to keys if missing. - * - * @returns {String} result - */ -String.prototype.format = function () { - var out = this; - - var repl = arguments; - - if (arguments.length == 1 && (isArray(arguments[0]) || isObject(arguments[0]))) { - repl = arguments[0]; - } - - for (var ph in repl) { - if (repl.hasOwnProperty(ph)) { - var ph_orig = ph; - - if (!ph.match(/^\{.*\}$/)) { - ph = '{' + ph + '}'; - } - - // replace all occurrences - var pattern = new RegExp(regexEscape(ph), "g"); - out = out.replace(pattern, repl[ph_orig]); - } - } - - return out; -}; - -/** Module for toggling a modal overlay */ -var modal = (function () { - var modal = {}; - - modal.show = function (sel) { - var $m = $(sel); - $m.removeClass('hidden visible'); - setTimeout(function () { - $m.addClass('visible'); - }, 1); - }; - - modal.hide = function (sel) { - var $m = $(sel); - $m.removeClass('visible'); - setTimeout(function () { - $m.addClass('hidden'); - }, 500); // transition time - }; - - modal.init = function () { - // close modal by click outside the dialog - $('.Modal').on('click', function () { - modal.hide(this); - }); - - $('.Dialog').on('click', function (e) { - e.stopImmediatePropagation(); - }); - - // Hide all modals on esc - $(window).on('keydown', function (e) { - if (e.which == 27) { - modal.hide('.Modal'); - } - }); - }; - - return modal; -})(); - -// requires other modules... - -// - utils.js -// - modal.js -// - wifi.js - -// all must be included after 3rd party libs - - -/** Global generic init */ -$().ready(function () { - - // loader dots... - setInterval(function () { - $('.anim-dots').each(function (x) { - var $x = $(x); - var dots = $x.html() + '.'; - if (dots.length == 5) dots = '.'; - $x.html(dots); - }); - }, 1000); - - modal.init(); -}); - -/** Wifi page */ -var wifi = (function () { - var wifi = {}; - var authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']; - - /** Update display for received response */ - function onScan(resp, status) { - if (status != 200) { - // bad response - rescan(5000); // wait 5sm then retry - return; - } - - resp = JSON.parse(resp); - - var done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0); - rescan(done ? 15000 : 1000); - if (!done) return; // no redraw yet - - // clear the AP list - var $list = $('#ap-list'); - // remove old APs - $('.AP').remove(); - - $list.toggle(done); - $('#ap-loader').toggle(!done); - - // scan done - resp.result.APs - .sort(function (a, b) { - return b.rssi - a.rssi - }) - .forEach(function (ap) { - ap.enc = parseInt(ap.enc); - - if (ap.enc > 4) return; // hide unsupported auths - - var item = document.createElement('div'); - - var $item = $(item) - .data('ssid', ap.essid) - .data('pwd', ap.enc != 0) - .addClass('AP'); - - // mark current SSID - if (ap.essid == wifi.current) { - $item.addClass('selected'); - } - - var inner = document.createElement('div'); - var $inner = $(inner).addClass('inner') - .htmlAppend('
{0}
'.format(rssiPerc(ap.rssi))) - .htmlAppend('
{0}
'.format(e(ap.essid))) - .htmlAppend('
{0}
'.format(authStr[ap.enc])); - - $item.on('click', function () { - var $th = $(this); - - // populate the form - $('#conn-essid').val($th.data('ssid')); - $('#conn-passwd').val(''); // clear - - if ($th.data('pwd')) { - // this AP needs a password - modal.show('#psk-modal'); - } else { - $('#conn-form').submit(); - } - }); - - - item.appendChild(inner); - $list[0].appendChild(item); - }); - } - - /** Ask the CGI what APs are visible (async) */ - function scanAPs() { - $().get('/wifi/scan.cgi', onScan, true, true); // no cache, no jsonp - } - - function rescan(time) { - setTimeout(scanAPs, time); - } - - /** Set up the WiFi page */ - wifi.init = function () { - //var ap_json = { - // "result": { - // "inProgress": "0", - // "APs": [ - // {"essid": "Chlivek", "bssid": "88:f7:c7:52:b3:99", "rssi": "204", "enc": "4", "channel": "1"}, - // {"essid": "TyNikdy", "bssid": "5c:f4:ab:0d:f1:1b", "rssi": "164", "enc": "3", "channel": "1"}, - // {"essid": "UPC5616805", "bssid": "08:95:2a:0c:84:3f", "rssi": "164", "enc": "4", "channel": "1"}, - // {"essid": "Sitovina", "bssid": "20:cf:30:98:cb:3a", "rssi": "166", "enc": "3", "channel": "1"}, - // {"essid": "Tramp", "bssid": "c4:e9:84:6f:6c:e0", "rssi": "170", "enc": "3", "channel": "2"}, - // {"essid": "KV2", "bssid": "4c:5e:0c:2c:84:9b", "rssi": "172", "enc": "3", "channel": "3"}, - // {"essid": "UPC373123", "bssid": "e8:40:f2:ae:0e:f4", "rssi": "164", "enc": "3", "channel": "1"}, - // {"essid": "www.podoli.org prazak", "bssid": "00:00:00:00:00:00", "rssi": "165", "enc": "0", "channel": "4"}, - // {"essid": "Medvjedov", "bssid": "00:00:00:00:00:00", "rssi": "181", "enc": "4", "channel": "6"}, - // {"essid": "MARIAN-PC", "bssid": "f8:d1:11:af:d7:72", "rssi": "175", "enc": "3", "channel": "6"}, - // {"essid": "UPC3226244", "bssid": "64:7c:34:9a:6f:7c", "rssi": "169", "enc": "4", "channel": "6"}, - // {"essid": "molly", "bssid": "00:00:00:00:00:00", "rssi": "168", "enc": "3", "channel": "7"}, - // {"essid": "UPC2607759", "bssid": "88:f7:c7:4e:c1:b2", "rssi": "164", "enc": "4", "channel": "8"}, - // {"essid": "blondyna", "bssid": "98:fc:11:bd:0f:b8", "rssi": "166", "enc": "4", "channel": "9"}, - // {"essid": "UPC246587811", "bssid": "80:f5:03:20:6c:85", "rssi": "171", "enc": "3", "channel": "11"}, - // {"essid": "UPC930648", "bssid": "4c:72:b9:50:6d:38", "rssi": "167", "enc": "3", "channel": "11"}, - // {"essid": "PRAHA4.NET-R21-2", "bssid": "00:00:00:00:00:00", "rssi": "173", "enc": "0", "channel": "12"}, - // {"essid": "Internet_B0", "bssid": "5c:f4:ab:11:3b:b3", "rssi": "166", "enc": "3", "channel": "13"} - // ] - // } - //}; - - //onScan(ap_json, 200); - scanAPs(); - }; - - return wifi; -})(); - -var wfm = (function () { - var wfm = {}; - - function buildChart(samples, xlabel, ylabel) { - var data = []; - samples.forEach(function (a, i) { - data.push({x: i, y: a}); - }); - - // Build the chart - var plugins = []; - var mql = window.matchMedia('screen and (min-width: 544px)'); - var isPhone = !mql.matches; - - if (!isPhone) { - // larger than phone - plugins.push( - Chartist.plugins.ctAxisTitle({ - axisX: { - axisTitle: xlabel, - offset: { - x: 0, - y: 55 - } - }, - axisY: { - axisTitle: ylabel, - flipText: true, - offset: { - x: 0, - y: 15 - } - } - }) - ); - } - - new Chartist.Line('#chart', { - series: [ - { - name: 'a', - data: data - }, - ] - }, { - showPoint: false, - // showArea: true, - fullWidth: true, - chartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}), - series: { - 'a': { - lineSmooth: Chartist.Interpolation.none() - } - }, - axisX: { - type: Chartist.AutoScaleAxis, - onlyInteger: true - }, - axisY: { - type: Chartist.AutoScaleAxis, - //onlyInteger: true - }, - plugins: plugins - }); - } - - function onRxData(resp, status) { - if (status != 200) { - // bad response - alert("Request failed."); - return; - } - - var json = JSON.parse(resp); - if (!json.success) { - alert("Sampling failed."); - return; - } - - buildChart(resp.samples, 'Sample Nr.', 'ADC value'); - } - - wfm.init = function() { - // var resp = { - // "samples": [1878, 1883, 1887, 1897, 1906, 1915, 1926, 1940, 1955, 1970, 1982, 1996, 2012, 2026, 2038, 2049], - // "success": true - // }; - - $('#load').on('click', function() { - var samples = $('#count').val(); - - $().get('http://192.168.1.13/api/raw.json?n='+samples, onRxData, true, true); - }); - }; - - return wfm; -})(); - -//# sourceMappingURL=all.js.map +function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function e(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isObject(t){return"[object Object]"===Object.prototype.toString.call(t)}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function rssiPerc(t){var e=parseInt(t);return e>-50?100:-100>e?0:Math.round(2*(e+100))}!function(){"use strict";function t(){var t;for(p=!0,t=0;t=0;n-=1)t(e[n])}function i(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function r(t,e){return t.currentStyle?t.currentStyle[i(e)]:x.getComputedStyle?x.getComputedStyle(t,null).getPropertyValue(e):null}function s(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function a(t,e,n){try{t.style[i(e)]=n}catch(r){}}function o(t){t.style.display="","none"===r(t,"display")&&(t.style.display="block")}function c(t){var e,i,r,a="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(i=0;i0&&(a+="&"+s(e.name,e.value));break;case"select-multiple":for(r=0;r0?a.substring(1):""}function u(t,e,i){var r,s,a,o=!1;return t&&(r=t.split(/\s+/),n(function(t){for(a=0;a0?w[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/," "):void 0},e.setClass=function(t){return(t||""===t)&&n(function(e){e.className=t},w),e},e.addClass=function(t){return t&&n(function(e){e.className+=" "+t},w),e},e.removeClass=function(t){return u(t,"remove",w),e},e.toggleClass=function(t){return u(t,"toggle",w),e},e.hasClass=function(t){return u(t,"has",w)},e.html=function(t){return t||""===t?(n(function(e){e.innerHTML=t},w),e):w[0]?w[0].innerHTML:void 0},e.htmlBefore=function(t){return l(t,"before",w),e},e.htmlAfter=function(t){return l(t,"after",w),e},e.htmlAppend=function(t){return l(t,"append",w),e},e.htmlPrepend=function(t){return l(t,"prepend",w),e},e.attr=function(t,i){if(t){if(t=t.toLowerCase(),"undefined"!=typeof i)return n(function(e){"style"===t?e.style.cssText=i:"class"===t?e.className=i:e.setAttribute(t,i)},w),e;if(w[0])if("style"===t){if(w[0].style.cssText)return w[0].style.cssText}else if("class"===t){if(w[0].className)return w[0].className}else if(w[0].getAttribute(t))return w[0].getAttribute(t)}},e.data=function(t,n){return t?e.attr("data-"+t,n):void 0},e.val=function(t){var i,r,s;if(t||""===t)return n(function(e){switch(e.nodeName){case"SELECT":for("string"!=typeof t&&"number"!=typeof t||(t=[t]),r=0;r1?i:i[0];case"INPUT":case"TEXTAREA":case"BUTTON":return w[0].value}},e.checked=function(t){return"boolean"==typeof t?(n(function(e){"INPUT"!==e.nodeName||"checkbox"!==e.type&&"radio"!==e.type||(e.checked=t)},w),e):!w[0]||"INPUT"!==w[0].nodeName||"checkbox"!==w[0].type&&"radio"!==w[0].type?void 0:!!w[0].checked},e.on=function(i,r){return t!==x&&t!==v||(w=[t]),n(function(t){v.addEventListener?t.addEventListener(i,r,!1):v.attachEvent&&(t[i+r]=function(){return r.apply(t,arguments)},t.attachEvent("on"+i,t[i+r]))},w),e},e.off=function(i,r){return t!==x&&t!==v||(w=[t]),n(function(t){v.addEventListener?t.removeEventListener(i,r,!1):v.attachEvent&&(t.detachEvent("on"+i,t[i+r]),t[i+r]=null)},w),e},e.ajax=function(t,n,i,r,s){var a,o,u=c(w),l=n?n.toUpperCase():"GET",h=new RegExp("http[s]?://(.*?)/","gi"),d=h.exec(t),f="_ts="+ +new Date,p=v.getElementsByTagName("head")[0],m="chibi"+ +new Date+(g+=1);return!u||"GET"!==l&&"DELETE"!==l||(t+=-1===t.indexOf("?")?"?"+u:"&"+u,u=null),"GET"===l&&!s&&d&&x.location.host!==d[1]?(r&&(t+=-1===t.indexOf("?")?"?"+f:"&"+f),t=t.replace("=%3F","=?"),i&&-1!==t.indexOf("=?")&&(t=t.replace("=?","="+m),x[m]=function(t){try{i(t,200)}catch(e){}x[m]=void 0}),o=document.createElement("script"),o.async=!0,o.src=t,o.onload=function(){p.removeChild(o)},p.appendChild(o)):(x.XMLHttpRequest?a=new XMLHttpRequest:x.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLHTTP")),a&&(r&&(t+=-1===t.indexOf("?")?"?"+f:"&"+f),a.open(l,t,!0),a.onreadystatechange=function(){4===a.readyState&&i&&i(a.responseText,a.status)},a.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"!==l&&"PUT"!==l||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(u))),e},e.get=function(t,n,i,r){return e.ajax(t,"get",n,i,r)},e.post=function(t,n,i){return e.ajax(t,"post",n,i)},e}var d=[],f=[],p=!1,m=!1,g=0,v=document,x=window;v.addEventListener?(v.addEventListener("DOMContentLoaded",t,!1),x.addEventListener("load",e,!1)):v.attachEvent?(v.attachEvent("onreadystatechange",t),x.attachEvent("onload",e)):x.onload=e,x.$=h}(),function(t,e){t.Chartist=e()}(this,function(){var t={version:"0.9.7"};return function(t,e,n){"use strict";n.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},n.noop=function(t){return t},n.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},n.extend=function(t){t=t||{};var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(e){for(var i in e)"object"!=typeof e[i]||null===e[i]||e[i]instanceof Array?t[i]=e[i]:t[i]=n.extend({},t[i],e[i])}),t},n.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"g"),n)},n.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},n.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},n.querySelector=function(t){return t instanceof Node?t:e.querySelector(t)},n.times=function(t){return Array.apply(null,new Array(t))},n.sum=function(t,e){return t+(e?e:0)},n.mapMultiply=function(t){return function(e){return e*t}},n.mapAdd=function(t){return function(e){return e+t}},n.serialMap=function(t,e){var i=[],r=Math.max.apply(null,t.map(function(t){return t.length}));return n.times(r).forEach(function(n,r){var s=t.map(function(t){return t[r]});i[r]=e.apply(null,s)}),i},n.roundWithPrecision=function(t,e){var i=Math.pow(10,e||n.precision);return Math.round(t*i)/i},n.precision=8,n.escapingMap={"&":"&","<":"<",">":">",'"':""","'":"'"},n.serialize=function(t){return null===t||void 0===t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),Object.keys(n.escapingMap).reduce(function(t,e){return n.replaceAll(t,e,n.escapingMap[e])},t))},n.deserialize=function(t){if("string"!=typeof t)return t;t=Object.keys(n.escapingMap).reduce(function(t,e){return n.replaceAll(t,n.escapingMap[e],e)},t);try{t=JSON.parse(t),t=void 0!==t.data?t.data:t}catch(e){}return t},n.createSvg=function(t,e,i,r){var s;return e=e||"100%",i=i||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(n.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),s=new n.Svg("svg").attr({width:e,height:i}).addClass(r).attr({style:"width: "+e+"; height: "+i+";"}),t.appendChild(s._node),s},n.normalizeData=function(t){if(t=t||{series:[],labels:[]},t.series=t.series||[],t.labels=t.labels||[],t.series.length>0&&0===t.labels.length){var e,i=n.getDataArray(t);e=i.every(function(t){return t instanceof Array})?Math.max.apply(null,i.map(function(t){return t.length})):i.length,t.labels=n.times(e).map(function(){return""})}return t},n.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;es.high&&(s.high=n),o&&n0?s.low=0:(s.high=1,s.low=0)),s},n.isNum=function(t){return!isNaN(t)&&isFinite(t)},n.isFalseyButZero=function(t){return!t&&0!==t},n.getNumberOrUndefined=function(t){return isNaN(+t)?void 0:+t},n.getMultiValue=function(t,e){return n.isNum(t)?+t:t?t[e||"y"]||0:0},n.rho=function(t){function e(t,n){return t%n===0?n:e(n,t%n)}function n(t){return t*t+1}if(1===t)return t;var i,r=2,s=2;if(t%2===0)return 2;do r=n(r)%t,s=n(n(s))%t,i=e(Math.abs(r-s),t);while(1===i);return i},n.getBounds=function(t,e,i,r){var s,a,o,c=0,u={high:e.high,low:e.low};u.valueRange=u.high-u.low,u.oom=n.orderOfMagnitude(u.valueRange),u.step=Math.pow(10,u.oom),u.min=Math.floor(u.low/u.step)*u.step,u.max=Math.ceil(u.high/u.step)*u.step,u.range=u.max-u.min,u.numberOfSteps=Math.round(u.range/u.step);var l=n.projectLength(t,u.step,u),h=i>l,d=r?n.rho(u.range):0;if(r&&n.projectLength(t,1,u)>=i)u.step=1;else if(r&&d=i)u.step=d;else for(;;){if(h&&n.projectLength(t,u.step,u)<=i)u.step*=2;else{if(h||!(n.projectLength(t,u.step/2,u)>=i))break;if(u.step/=2,r&&u.step%1!==0){u.step*=2;break}}if(c++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}for(a=u.min,o=u.max;a+u.step<=u.low;)a+=u.step;for(;o-u.step>=u.high;)o-=u.step;for(u.min=a,u.max=o,u.range=u.max-u.min,u.values=[],s=u.min;s<=u.max;s+=u.step)u.values.push(n.roundWithPrecision(s));return u},n.polarToCartesian=function(t,e,n,i){var r=(i-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}},n.createChartRect=function(t,e,i){var r=!(!e.axisX&&!e.axisY),s=r?e.axisY.offset:0,a=r?e.axisX.offset:0,o=t.width()||n.quantity(e.width).value||0,c=t.height()||n.quantity(e.height).value||0,u=n.normalizePadding(e.chartPadding,i);o=Math.max(o,s+u.left+u.right),c=Math.max(c,a+u.top+u.bottom);var l={padding:u,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return r?("start"===e.axisX.position?(l.y2=u.top+a,l.y1=Math.max(c-u.bottom,l.y2+1)):(l.y2=u.top,l.y1=Math.max(c-u.bottom-a,l.y2+1)),"start"===e.axisY.position?(l.x1=u.left+s,l.x2=Math.max(o-u.right,l.x1+1)):(l.x1=u.left,l.x2=Math.max(o-u.right-s,l.x1+1))):(l.x1=u.left,l.x2=Math.max(o-u.right,l.x1+1),l.y2=u.top,l.y1=Math.max(c-u.bottom,l.y2+1)),l},n.createGrid=function(t,e,i,r,s,a,o,c){var u={};u[i.units.pos+"1"]=Math.round(t)+.5,u[i.units.pos+"2"]=Math.round(t)+.5,u[i.counterUnits.pos+"1"]=r,u[i.counterUnits.pos+"2"]=r+s;var l=a.elem("line",u,o.join(" "));c.emit("draw",n.extend({type:"grid",axis:i,index:e,group:a,element:l},u))},n.createLabel=function(t,e,i,r,s,a,o,c,u,l,h){var d,f={};f[s.units.pos]=t+o[s.units.pos],f[s.counterUnits.pos]=o[s.counterUnits.pos],f[s.units.len]=e,f[s.counterUnits.len]=a-10;var p=r[i];if(p=Math.round(100*+p)/100,l){var m=''+p+"";d=c.foreignObject(m,n.extend({style:"overflow: visible;"},f))}else d=c.elem("text",f,u.join(" ")).text(p);h.emit("draw",n.extend({type:"label",axis:s,index:i,group:c,element:d,text:p},f))},n.getSeriesOption=function(t,e,n){if(t.name&&e.series&&e.series[t.name]){var i=e.series[t.name];return i.hasOwnProperty(n)?i[n]:e[n]}return e[n]},n.optionsProvider=function(e,i,r){function s(e){var s=o;if(o=n.extend({},u),i)for(c=0;c1){var c=[];return o.forEach(function(t){c.push(a(t.pathCoordinates,t.valueData))}),n.Svg.Path.join(c)}if(t=o[0].pathCoordinates,i=o[0].valueData,t.length<=4)return n.Interpolation.none()(t,i);for(var u,l=(new n.Svg.Path).move(t[0],t[1],!1,i[0]),h=0,d=t.length;d-2*!u>h;h+=2){var f=[{x:+t[h-2],y:+t[h-1]},{x:+t[h],y:+t[h+1]},{x:+t[h+2],y:+t[h+3]},{x:+t[h+4],y:+t[h+5]}];u?h?d-4===h?f[3]={x:+t[0],y:+t[1]}:d-2===h&&(f[2]={x:+t[0],y:+t[1]},f[3]={x:+t[2],y:+t[3]}):f[0]={x:+t[d-2],y:+t[d-1]}:d-4===h?f[3]=f[2]:h||(f[0]={x:+t[h],y:+t[h+1]}),l.curve(r*(-f[0].x+6*f[1].x+f[2].x)/6+s*f[2].x,r*(-f[0].y+6*f[1].y+f[2].y)/6+s*f[2].y,r*(f[1].x+6*f[2].x-f[3].x)/6+s*f[2].x,r*(f[1].y+6*f[2].y-f[3].y)/6+s*f[2].y,f[2].x,f[2].y,!1,i[(h+2)/2])}return l}return n.Interpolation.none()([])}},n.Interpolation.step=function(t){var e={postpone:!0,fillHoles:!1};return t=n.extend({},e,t),function(e,i){for(var r,s,a,o=new n.Svg.Path,c=0;c1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).forEach(function(n){var o=c.elem("path",{d:n.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized[a],path:n.clone(),series:s,seriesIndex:a,axisX:i,axisY:r,chartRect:u,index:a,group:c,element:o})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:r.bounds,chartRect:u,axisX:i,axisY:r,svg:this.svg,options:t})}function r(t,e,i,r){n.Line["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Line=n.Base.extend({constructor:r,createChart:i})}(window,document,t),function(t,e,n){"use strict";function i(t){this.data=n.normalizeData(this.data);var e,i={raw:this.data,normalized:t.distributeSeries?n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y").map(function(t){return[t]}):n.getDataArray(this.data,t.reverseData,t.horizontalBars?"x":"y")};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var r=this.svg.elem("g").addClass(t.classNames.gridGroup),a=this.svg.elem("g"),o=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==i.normalized.length){var c=n.serialMap(i.normalized,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});e=n.getHighLow([c],n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y")}else e=n.getHighLow(i.normalized,n.extend({},t,{referenceValue:0}),t.horizontalBars?"x":"y");e.high=+t.high||(0===t.high?0:e.high),e.low=+t.low||(0===t.low?0:e.low);var u,l,h,d,f,p=n.createChartRect(this.svg,t,s.padding);l=t.distributeSeries&&t.stackBars?i.raw.labels.slice(0,1):i.raw.labels,t.horizontalBars?(u=d=void 0===t.axisX.type?new n.AutoScaleAxis(n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})):t.axisX.type.call(n,n.Axis.units.x,i,p,n.extend({},t.axisX,{highLow:e,referenceValue:0})),h=f=void 0===t.axisY.type?new n.StepAxis(n.Axis.units.y,i,p,{ticks:l}):t.axisY.type.call(n,n.Axis.units.y,i,p,t.axisY)):(h=d=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,i,p,{ticks:l}):t.axisX.type.call(n,n.Axis.units.x,i,p,t.axisX),u=f=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})):t.axisY.type.call(n,n.Axis.units.y,i,p,n.extend({},t.axisY,{highLow:e,referenceValue:0})));var m=t.horizontalBars?p.x1+u.projectValue(0):p.y1-u.projectValue(0),g=[];h.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),u.createGridAndLabels(r,o,this.supportsForeignObject,t,this.eventEmitter),i.raw.series.forEach(function(e,r){var s,o,c=r-(i.raw.series.length-1)/2;s=t.distributeSeries&&!t.stackBars?h.axisLength/i.normalized.length/2:t.distributeSeries&&t.stackBars?h.axisLength/2:h.axisLength/i.normalized[r].length/2,o=a.elem("g"),o.attr({"ct:series-name":e.name,"ct:meta":n.serialize(e.meta)}),o.addClass([t.classNames.series,e.className||t.classNames.series+"-"+n.alphaNumerate(r)].join(" ")),i.normalized[r].forEach(function(a,l){var v,x,y,w;if(w=t.distributeSeries&&!t.stackBars?r:t.distributeSeries&&t.stackBars?0:l,v=t.horizontalBars?{x:p.x1+u.projectValue(a&&a.x?a.x:0,l,i.normalized[r]),y:p.y1-h.projectValue(a&&a.y?a.y:0,w,i.normalized[r])}:{x:p.x1+h.projectValue(a&&a.x?a.x:0,w,i.normalized[r]),y:p.y1-u.projectValue(a&&a.y?a.y:0,l,i.normalized[r])},h instanceof n.StepAxis&&(h.options.stretch||(v[h.units.pos]+=s*(t.horizontalBars?-1:1)),v[h.units.pos]+=t.stackBars||t.distributeSeries?0:c*t.seriesBarDistance*(t.horizontalBars?-1:1)),y=g[l]||m,g[l]=y-(m-v[h.counterUnits.pos]),void 0!==a){var b={};b[h.units.pos+"1"]=v[h.units.pos],b[h.units.pos+"2"]=v[h.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(b[h.counterUnits.pos+"1"]=m,b[h.counterUnits.pos+"2"]=v[h.counterUnits.pos]):(b[h.counterUnits.pos+"1"]=y,b[h.counterUnits.pos+"2"]=g[l]),b.x1=Math.min(Math.max(b.x1,p.x1),p.x2),b.x2=Math.min(Math.max(b.x2,p.x1),p.x2),b.y1=Math.min(Math.max(b.y1,p.y2),p.y1),b.y2=Math.min(Math.max(b.y2,p.y2),p.y1),x=o.elem("line",b,t.classNames.bar).attr({"ct:value":[a.x,a.y].filter(n.isNum).join(","),"ct:meta":n.getMetaData(e,l)}),this.eventEmitter.emit("draw",n.extend({type:"bar",value:a,index:l,meta:n.getMetaData(e,l),series:e,seriesIndex:r,axisX:d,axisY:f,chartRect:p,group:o,element:x},b))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:u.bounds,chartRect:p,axisX:d,axisY:f,svg:this.svg,options:t})}function r(t,e,i,r){n.Bar["super"].constructor.call(this,t,e,s,n.extend({},s,i),r)}var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};n.Bar=n.Base.extend({constructor:r,createChart:i})}(window,document,t),t}),function(t,e){t["Chartist.plugins.ctAxisTitle"]=e()}(this,function(){return function(t,e,n){"use strict";var i={axisTitle:"",axisClass:"ct-axis-title",offset:{x:0,y:0},textAnchor:"middle",flipText:!1},r={axisX:i,axisY:i};n.plugins=n.plugins||{},n.plugins.ctAxisTitle=function(t){return t=n.extend({},r,t),function(e){e.on("created",function(e){var i,r,s;if(t.axisX.axisTitle&&e.axisX&&(i=e.axisX.axisLength/2+e.options.axisY.offset+e.options.chartPadding.left,r=e.options.chartPadding.top,"end"===e.options.axisY.position&&(i-=e.options.axisY.offset),"end"===e.options.axisX.position&&(r+=e.axisY.axisLength),s=new n.Svg("text"),s.addClass(t.axisX.axisClass),s.text(t.axisX.axisTitle),s.attr({x:i+t.axisX.offset.x,y:r+t.axisX.offset.y,"text-anchor":t.axisX.textAnchor}),e.svg.append(s,!0)),t.axisY.axisTitle&&e.axisY){i=0,r=e.axisY.axisLength/2+e.options.chartPadding.top,"start"===e.options.axisX.position&&(r+=e.options.axisX.offset),"end"===e.options.axisY.position&&(i=e.axisX.axisLength);var a="rotate("+(t.axisY.flipText?-90:90)+", "+i+", "+r+")";s=new n.Svg("text"),s.addClass(t.axisY.axisClass),s.text(t.axisY.axisTitle),s.attr({x:i+t.axisY.offset.x,y:r+t.axisY.offset.y,transform:a,"text-anchor":t.axisY.textAnchor}),e.svg.append(s,!0)}})}}}(window,document,Chartist),Chartist.plugins.ctAxisTitle}),function(t,e){t["Chartist.plugins.zoom"]=e()}(this,function(){return function(t,e,n){"use strict";function i(t){t.attr({style:"display:none"})}function r(t){t.attr({style:"display:block"})}function s(t,e){var n=t.x,i=t.y,r=e.x-n,s=e.y-i;return 0>r&&(r=-r,n=e.x),0>s&&(s=-s,i=e.y),{x:n,y:i,width:r,height:s}}function a(t,e){return o(t.clientX,t.clientY,e)}function o(t,e,n){var i="svg"===n.tagName?n:n.ownerSVGElement,r=i.getScreenCTM(),s=i.createSVGPoint();return s.x=t,s.y=e,s=s.matrixTransform(r.inverse()),s||{x:0,y:0}}function c(t,e){var n=e.bounds.max,i=e.bounds.min;if(e.scale&&"log"===e.scale.type){var r=e.scale.base;return Math.pow(r,t*u(n/i,r)/e.axisLength)*i}return t*e.bounds.range/e.axisLength+i}function u(t,e){return Math.log(t)/Math.log(e)}var l={};n.plugins=n.plugins||{},n.plugins.zoom=function(t){return t=n.extend({},l,t),function(e){function o(t){var e=a(t,w);return e.id=t.identifier,e}function u(t){for(var e=0;e1&&(y.attr(s(O[0],O[1])),r(y))}function h(t){for(var e=t.changedTouches,n=0;n1&&(y.attr(s(O[0],O[1])),r(y),t.preventDefault())}function d(t){f(t.changedTouches)}function f(t){for(var e=0;e=0&&O.splice(n,1)}}function p(t){O.length>1&&v(s(O[0],O[1])),f(t.changedTouches),i(y)}function m(t){0===t.button&&(S=a(t,w),y.attr(s(S,S)),r(y),t.preventDefault())}function g(e){if(0===e.button){var n=s(S,a(e,w));v(n),S=null,i(y),e.preventDefault()}else t.resetOnRightMouseBtn&&2===e.button&&(L(),e.preventDefault())}function v(t){if(t.width>5&&t.height>5){var n=t.x-A.x1,i=n+t.width,r=A.y1-t.y,s=r-t.height;e.options.axisX.highLow={low:c(n,b),high:c(i,b)},e.options.axisY.highLow={low:c(s,E),high:c(r,E)},e.update(e.data,e.options),C&&C(e,L)}}function x(t){if(S){var e=a(t,w);y.attr(s(S,e)),t.preventDefault()}}if(e instanceof n.Line){var y,w,b,E,A,S,C=t.onZoom,O=[];e.on("draw",function(t){var e=t.type;"line"!==e&&"bar"!==e&&"area"!==e&&"point"!==e||t.element.attr({"clip-path":"url(#zoom-mask)"})}),e.on("created",function(t){b=t.axisX,E=t.axisY,A=t.chartRect,w=t.svg._node,y=t.svg.elem("rect",{x:10,y:10,width:100,height:100},"ct-zoom-rect"),i(y);var e=t.svg.querySelector("defs")||t.svg.elem("defs"),n=A.width(),r=A.height();e.elem("clipPath",{id:"zoom-mask"}).elem("rect",{x:A.x1,y:A.y2,width:n,height:r,fill:"white"}),w.addEventListener("mousedown",m),w.addEventListener("mouseup",g),w.addEventListener("mousemove",x),w.addEventListener("touchstart",l),w.addEventListener("touchmove",h),w.addEventListener("touchend",p),w.addEventListener("touchcancel",d)});var L=function(){e.options.axisX.highLow=null,e.options.axisY.highLow=null,e.update(e.data,e.options)}}}}}(window,document,Chartist),Chartist.plugins.zoom}),String.prototype.format=function(){var t=this,e=arguments;1==arguments.length&&(isArray(arguments[0])||isObject(arguments[0]))&&(e=arguments[0]);for(var n in e)if(e.hasOwnProperty(n)){var i=n;n.match(/^\{.*\}$/)||(n="{"+n+"}");var r=new RegExp(regexEscape(n),"g");t=t.replace(r,e[i])}return t};var modal=function(){var t={};return t.show=function(t){var e=$(t);e.removeClass("hidden visible"),setTimeout(function(){e.addClass("visible")},1)},t.hide=function(t){var e=$(t);e.removeClass("visible"),setTimeout(function(){e.addClass("hidden")},500)},t.init=function(){$(".Modal").on("click",function(){t.hide(this)}),$(".Dialog").on("click",function(t){t.stopImmediatePropagation()}),$(window).on("keydown",function(e){27==e.which&&t.hide(".Modal")})},t}();$().ready(function(){setInterval(function(){$(".anim-dots").each(function(t){var e=$(t),n=e.html()+".";5==n.length&&(n="."),e.html(n)})},1e3),modal.init()});var wifi=function(){function t(t,n){if(200!=n)return void i(5e3);t=JSON.parse(t);var a=!bool(t.result.inProgress)&&t.result.APs.length>0;if(i(a?15e3:1e3),a){var o=$("#ap-list");$(".AP").remove(),o.toggle(a),$("#ap-loader").toggle(!a),t.result.APs.sort(function(t,e){return e.rssi-t.rssi}).forEach(function(t){if(t.enc=parseInt(t.enc),!(t.enc>4)){var n=document.createElement("div"),i=$(n).data("ssid",t.essid).data("pwd",0!=t.enc).addClass("AP");t.essid==r.current&&i.addClass("selected");var a=document.createElement("div");$(a).addClass("inner").htmlAppend('
{0}
'.format(rssiPerc(t.rssi))).htmlAppend('
{0}
'.format(e(t.essid))).htmlAppend('
{0}
'.format(s[t.enc]));i.on("click",function(){var t=$(this);$("#conn-essid").val(t.data("ssid")),$("#conn-passwd").val(""),t.data("pwd")?modal.show("#psk-modal"):$("#conn-form").submit()}),n.appendChild(a),o[0].appendChild(n)}})}}function n(){$().get("/wifi/scan.cgi",t,!0,!0)}function i(t){setTimeout(n,t)}var r={},s=["Open","WEP","WPA","WPA2","WPA/WPA2"];return r.init=function(){n()},r}(),wfm=function(){function t(t,e,n){var i=[];t.forEach(function(t,e){i.push({x:e,y:t})});var r=[],s=window.matchMedia("screen and (min-width: 544px)"),a=!s.matches;a||r.push(Chartist.plugins.ctAxisTitle({axisX:{axisTitle:e,offset:{x:0,y:55}},axisY:{axisTitle:n,flipText:!0,offset:{x:0,y:15}}})),new Chartist.Line("#chart",{series:[{name:"a",data:i}]},{showPoint:!1,fullWidth:!0,chartPadding:a?{right:20,bottom:5,left:0}:{right:25,bottom:30,left:25},series:{a:{lineSmooth:Chartist.Interpolation.none()}},axisX:{type:Chartist.AutoScaleAxis,onlyInteger:!0},axisY:{type:Chartist.AutoScaleAxis},plugins:r})}function e(e,n){if(200!=n)return void alert("Request failed.");var i=JSON.parse(e);return i.success?void t(i.samples,"Sample Nr.","ADC value"):void alert("Sampling failed.")}var n={};return n.init=function(){function t(){var t=$("#count").val();$().get("/api/raw.json?n="+t,e,!0,!0)}$("#load").on("click",t),$("#count").on("keyup",function(e){13==e.which&&t()})},n}(); \ No newline at end of file diff --git a/html_src/js/all.js.map b/html_src/js/all.js.map index 795dbb1..58d20b3 100644 --- a/html_src/js/all.js.map +++ b/html_src/js/all.js.map @@ -1 +1 @@ -{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","utils.js","modal.js","app.js","wifi.js","waveform.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3uHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\tjsonpcount = 0,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {return result.charAt(1).toUpperCase(); });\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {break; }\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif(state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/,' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-'+key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\tcase 'SELECT':\n\t\t\t\t\tvalues = [];\n\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\tcase 'INPUT':\n\t\t\t\tcase 'TEXTAREA':\n\t\t\t\tcase 'BUTTON':\n\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () { return fn.apply(elm, arguments); };\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, nocache, nojsonp) {\n\t\t\tvar xhr,\n\t\t\t\tquery = serializeData(nodes),\n\t\t\t\ttype = (method) ? method.toUpperCase() : 'GET',\n\t\t\t\thostsearch = new RegExp('http[s]?://(.*?)/', 'gi'),\n\t\t\t\tdomain = hostsearch.exec(url),\n\t\t\t\ttimestamp = '_ts=' + (+new Date()),\n\t\t\t\thead = d.getElementsByTagName('head')[0],\n\t\t\t\tjsonpcallback = 'chibi' + (+new Date()) + (jsonpcount += 1),\n\t\t\t\tscript;\n\n\t\t\tif (query && (type === 'GET' || type === 'DELETE')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// JSONP if cross domain url\n\t\t\tif (type === 'GET' && !nojsonp && domain && w.location.host !== domain[1]) {\n\n\t\t\t\tif (nocache) {\n\t\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp;\n\t\t\t\t}\n\n\t\t\t\t// Replace possible encoded ?\n\t\t\t\turl = url.replace('=%3F', '=?');\n\n\t\t\t\t// Replace jsonp ? with callback\n\t\t\t\tif (callback && url.indexOf('=?') !== -1) {\n\n\t\t\t\t\turl = url.replace('=?', '=' + jsonpcallback);\n\n\t\t\t\t\tw[jsonpcallback] = function (data) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcallback(data, 200);\n\t\t\t\t\t\t} catch (e) {}\n\n\t\t\t\t\t\t// Tidy up\n\t\t\t\t\t\tw[jsonpcallback] = undefined;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// JSONP\n\t\t\t\tscript = document.createElement('script');\n\t\t\t\tscript.async = true;\n\t\t\t\tscript.src = url;\n\n\t\t\t\t// Tidy up\n\t\t\t\tscript.onload = function () {\n\t\t\t\t\thead.removeChild(script);\n\t\t\t\t};\n\n\t\t\t\thead.appendChild(script);\n\n\t\t\t} else {\n\n\t\t\t\tif (w.XMLHttpRequest) {\n\t\t\t\t\txhr = new XMLHttpRequest();\n\t\t\t\t} else if (w.ActiveXObject) {\n\t\t\t\t\txhr = new ActiveXObject('Microsoft.XMLHTTP'); // IE < 9\n\t\t\t\t}\n\n\t\t\t\tif (xhr) {\n\n\t\t\t\t\tif (nocache) {\n\t\t\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\tif (callback) {\n\t\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\t\tif (type === 'POST' || type === 'PUT') {\n\t\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t\t}\n\n\t\t\t\t\txhr.send(query);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback, nocache, nojsonp)\n\t\tcb.get = function (url, callback, nocache, nojsonp) {\n\t\t\treturn cb.ajax(url, 'get', callback, nocache, nojsonp);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback, nocache)\n\t\tcb.post = function (url, callback, nocache) {\n\t\t\treturn cb.ajax(url, 'post', callback, nocache);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n Chartist.escapingMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n }, data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n /**\n * Calculate cartesian coordinates of polar coordinates\n *\n * @memberof Chartist.Core\n * @param {Number} centerX X-axis coordinates of center point of circle segment\n * @param {Number} centerY X-axis coordinates of center point of circle segment\n * @param {Number} radius Radius of circle segment\n * @param {Number} angleInDegrees Angle of circle segment in degrees\n * @return {{x:Number, y:Number}} Coordinates of point on circumference\n */\n Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n\n return {\n x: centerX + (radius * Math.cos(angleInRadians)),\n y: centerY + (radius * Math.sin(angleInRadians))\n };\n };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\t//round (!! will brak for non-numeric)\n\tlblText = Math.round(+lblText*100)/100;\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n *\n * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 1,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the cardinal factory function.\n * @return {Function}\n */\n Chartist.Interpolation.cardinal = function(options) {\n var defaultOptions = {\n tension: 1,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n var t = Math.min(1, Math.max(0, options.tension)),\n c = 1 - t;\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function cardinal(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the cardinal function\n segments.forEach(function(segment) {\n paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than two points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n z;\n\n for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n var p = [\n {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n ];\n if (z) {\n if (!i) {\n p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n } else if (iLen - 4 === i) {\n p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n } else if (iLen - 2 === i) {\n p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n }\n } else {\n if (iLen - 4 === i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n }\n }\n\n path.curve(\n (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n p[2].x,\n p[2].y,\n false,\n valueData[(i + 2) / 2]\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var axisOptions = chartOptions['axis' + this.units.pos.toUpperCase()];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n var labelLength=0;/*\n if(projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n\t\t lastWidth = labelLength;\n } else if (typeof lastWidth != 'undefined') {\n\t\t labelLength = lastWidth; // EDIT. added the lastWidth thing\n\t }\n\t // else {\n // // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // // still be visible inside of the chart padding.\n // labelLength = Math.max(this.axisLength - projectedValue, 30);\n // }\n\t\t*/\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\tconsole.log(options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module.\n // define([], function () {\n // return (root.returnExportsGlobal = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like enviroments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist.plugins.zoom'] = factory();\n // }\n}(this, function () {\n\n /**\n * Chartist.js zoom plugin.\n *\n */\n (function (window, document, Chartist) {\n 'use strict';\n\n var defaultOptions = {\n // onZoom\n // resetOnRightMouseBtn\n };\n\n\n Chartist.plugins = Chartist.plugins || {};\n Chartist.plugins.zoom = function (options) {\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function zoom(chart) {\n\n if (!(chart instanceof Chartist.Line)) {\n return;\n }\n\n var rect, svg, axisX, axisY, chartRect;\n var downPosition;\n var onZoom = options.onZoom;\n var ongoingTouches = [];\n\n chart.on('draw', function (data) {\n var type = data.type;\n if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n data.element.attr({\n 'clip-path': 'url(#zoom-mask)'\n });\n }\n });\n\n chart.on('created', function (data) {\n axisX = data.axisX;\n axisY = data.axisY;\n chartRect = data.chartRect;\n svg = data.svg._node;\n rect = data.svg.elem('rect', {\n x: 10,\n y: 10,\n width: 100,\n height: 100,\n }, 'ct-zoom-rect');\n hide(rect);\n\n var defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n var width = chartRect.width();\n var height = chartRect.height();\n\n defs\n .elem('clipPath', {\n id: 'zoom-mask'\n })\n .elem('rect', {\n x: chartRect.x1,\n y: chartRect.y2,\n width: width,\n height: height,\n fill: 'white'\n });\n\n svg.addEventListener('mousedown', onMouseDown);\n svg.addEventListener('mouseup', onMouseUp);\n svg.addEventListener('mousemove', onMouseMove);\n svg.addEventListener('touchstart', onTouchStart);\n svg.addEventListener('touchmove', onTouchMove);\n svg.addEventListener('touchend', onTouchEnd);\n svg.addEventListener('touchcancel', onTouchCancel);\n });\n\n function copyTouch(touch) {\n var p = position(touch, svg);\n p.id = touch.identifier;\n return p;\n }\n\n function ongoingTouchIndexById(idToFind) {\n for (var i = 0; i < ongoingTouches.length; i++) {\n var id = ongoingTouches[i].id;\n if (id === idToFind) {\n return i;\n }\n }\n return -1;\n }\n\n function onTouchStart(event) {\n var touches = event.changedTouches;\n for (var i = 0; i < touches.length; i++) {\n ongoingTouches.push(copyTouch(touches[i]));\n }\n\n if (ongoingTouches.length > 1) {\n rect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n show(rect);\n }\n }\n\n function onTouchMove(event) {\n var touches = event.changedTouches;\n for (var i = 0; i < touches.length; i++) {\n var idx = ongoingTouchIndexById(touches[i].identifier);\n ongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n }\n\n if (ongoingTouches.length > 1) {\n rect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n show(rect);\n event.preventDefault();\n }\n }\n\n function onTouchCancel(event) {\n removeTouches(event.changedTouches);\n }\n\n function removeTouches(touches) {\n for (var i = 0; i < touches.length; i++) {\n var idx = ongoingTouchIndexById(touches[i].identifier);\n if (idx >= 0) {\n ongoingTouches.splice(idx, 1);\n }\n }\n }\n\n function onTouchEnd(event) {\n if (ongoingTouches.length > 1) {\n zoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n }\n removeTouches(event.changedTouches);\n hide(rect);\n }\n\n function onMouseDown(event) {\n if (event.button === 0) {\n downPosition = position(event, svg);\n rect.attr(getRect(downPosition, downPosition));\n show(rect);\n event.preventDefault();\n }\n }\n\n var reset = function () {\n chart.options.axisX.highLow = null;\n chart.options.axisY.highLow = null;\n chart.update(chart.data, chart.options);\n };\n\n function onMouseUp(event) {\n if (event.button === 0) {\n var box = getRect(downPosition, position(event, svg));\n zoomIn(box);\n downPosition = null;\n hide(rect);\n event.preventDefault();\n }\n else if (options.resetOnRightMouseBtn && event.button === 2) {\n reset();\n event.preventDefault();\n }\n }\n\n function zoomIn(rect) {\n if (rect.width > 5 && rect.height > 5) {\n var x1 = rect.x - chartRect.x1;\n var x2 = x1 + rect.width;\n var y2 = chartRect.y1 - rect.y;\n var y1 = y2 - rect.height;\n\n chart.options.axisX.highLow = { low: project(x1, axisX), high: project(x2, axisX) };\n chart.options.axisY.highLow = { low: project(y1, axisY), high: project(y2, axisY) };\n\n chart.update(chart.data, chart.options);\n onZoom && onZoom(chart, reset);\n }\n }\n\n function onMouseMove(event) {\n if (downPosition) {\n var point = position(event, svg);\n rect.attr(getRect(downPosition, point));\n event.preventDefault();\n }\n }\n };\n\n };\n\n function hide(rect) {\n rect.attr({ style: 'display:none' });\n }\n\n function show(rect) {\n rect.attr({ style: 'display:block' });\n }\n\n function getRect(firstPoint, secondPoint) {\n var x = firstPoint.x;\n var y = firstPoint.y;\n var width = secondPoint.x - x;\n var height = secondPoint.y - y;\n if (width < 0) {\n width = -width;\n x = secondPoint.x;\n }\n if (height < 0) {\n height = -height;\n y = secondPoint.y;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n }\n\n function position(event, svg) {\n return transform(event.clientX, event.clientY, svg);\n }\n\n function transform(x, y, svgElement) {\n var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n var matrix = svg.getScreenCTM();\n var point = svg.createSVGPoint();\n point.x = x;\n point.y = y;\n point = point.matrixTransform(matrix.inverse());\n return point || { x: 0, y: 0 };\n }\n\n function project(value, axis) {\n var max = axis.bounds.max;\n var min = axis.bounds.min;\n if (axis.scale && axis.scale.type === 'log') {\n var base = axis.scale.base;\n return Math.pow(base,\n value * baseLog(max / min, base) / axis.axisLength) * min;\n }\n return (value * axis.bounds.range / axis.axisLength) + min;\n }\n\n function baseLog(val, base) {\n return Math.log(val) / Math.log(base);\n }\n\n } (window, document, Chartist));\n return Chartist.plugins.zoom;\n\n}));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\n/** html entities */\nfunction e(x) {\n\treturn String(x)\n\t\t.replace(/&/g, '&')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''')\n\t\t.replace(//g, '>');\n}\n\n/** Returns true if argument is array [] */\nfunction isArray(obj) {\n\treturn Object.prototype.toString.call(obj) === '[object Array]';\n}\n\n/** Returns true if argument is object {} */\nfunction isObject(obj) {\n\treturn Object.prototype.toString.call(obj) === '[object Object]';\n}\n\n/** escape a string to have no special meaning in regex */\nfunction regexEscape(s) {\n\treturn s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\n/** Convert RSSI 0-255 to % */\nfunction rssiPerc(rssi) {\n\tvar r = parseInt(rssi);\n\tif (r > -50) return 100; // 100%\n\tif (r < -100) return 0; // 0%\n\treturn Math.round(2 * (r + 100)); // approximation\n}\n\n/** Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (isArray(arguments[0]) || isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(regexEscape(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\tmodal.init();\n});\n","/** Wifi page */\nvar wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(rssiPerc(ap.rssi)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(e(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get('/wifi/scan.cgi', onScan, true, true); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"UPC5616805\", \"bssid\": \"08:95:2a:0c:84:3f\", \"rssi\": \"164\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"Sitovina\", \"bssid\": \"20:cf:30:98:cb:3a\", \"rssi\": \"166\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"Tramp\", \"bssid\": \"c4:e9:84:6f:6c:e0\", \"rssi\": \"170\", \"enc\": \"3\", \"channel\": \"2\"},\n\t\t//\t\t\t{\"essid\": \"KV2\", \"bssid\": \"4c:5e:0c:2c:84:9b\", \"rssi\": \"172\", \"enc\": \"3\", \"channel\": \"3\"},\n\t\t//\t\t\t{\"essid\": \"UPC373123\", \"bssid\": \"e8:40:f2:ae:0e:f4\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"www.podoli.org prazak\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"165\", \"enc\": \"0\", \"channel\": \"4\"},\n\t\t//\t\t\t{\"essid\": \"Medvjedov\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"181\", \"enc\": \"4\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"MARIAN-PC\", \"bssid\": \"f8:d1:11:af:d7:72\", \"rssi\": \"175\", \"enc\": \"3\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"UPC3226244\", \"bssid\": \"64:7c:34:9a:6f:7c\", \"rssi\": \"169\", \"enc\": \"4\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"molly\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"168\", \"enc\": \"3\", \"channel\": \"7\"},\n\t\t//\t\t\t{\"essid\": \"UPC2607759\", \"bssid\": \"88:f7:c7:4e:c1:b2\", \"rssi\": \"164\", \"enc\": \"4\", \"channel\": \"8\"},\n\t\t//\t\t\t{\"essid\": \"blondyna\", \"bssid\": \"98:fc:11:bd:0f:b8\", \"rssi\": \"166\", \"enc\": \"4\", \"channel\": \"9\"},\n\t\t//\t\t\t{\"essid\": \"UPC246587811\", \"bssid\": \"80:f5:03:20:6c:85\", \"rssi\": \"171\", \"enc\": \"3\", \"channel\": \"11\"},\n\t\t//\t\t\t{\"essid\": \"UPC930648\", \"bssid\": \"4c:72:b9:50:6d:38\", \"rssi\": \"167\", \"enc\": \"3\", \"channel\": \"11\"},\n\t\t//\t\t\t{\"essid\": \"PRAHA4.NET-R21-2\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"173\", \"enc\": \"0\", \"channel\": \"12\"},\n\t\t//\t\t\t{\"essid\": \"Internet_B0\", \"bssid\": \"5c:f4:ab:11:3b:b3\", \"rssi\": \"166\", \"enc\": \"3\", \"channel\": \"13\"}\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\t//onScan(ap_json, 200);\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var wfm = (function () {\n\tvar wfm = {};\n\n\tfunction buildChart(samples, xlabel, ylabel) {\n\t\tvar data = [];\n\t\tsamples.forEach(function (a, i) {\n\t\t\tdata.push({x: i, y: a});\n\t\t});\n\n\t\t// Build the chart\n\t\tvar plugins = [];\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tif (!isPhone) {\n\t\t\t// larger than phone\n\t\t\tplugins.push(\n\t\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\t\taxisX: {\n\t\t\t\t\t\taxisTitle: xlabel,\n\t\t\t\t\t\toffset: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 55\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\taxisY: {\n\t\t\t\t\t\taxisTitle: ylabel,\n\t\t\t\t\t\tflipText: true,\n\t\t\t\t\t\toffset: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 15\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: data\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\t// showArea: true,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.none()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\tonlyInteger: true\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\talert(\"Request failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar json = JSON.parse(resp);\n\t\tif (!json.success) {\n\t\t\talert(\"Sampling failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tbuildChart(resp.samples, 'Sample Nr.', 'ADC value');\n\t}\n\n\twfm.init = function() {\n\t\t//\tvar resp = {\n\t\t//\t\t\"samples\": [1878, 1883, 1887, 1897, 1906, 1915, 1926, 1940, 1955, 1970, 1982, 1996, 2012, 2026, 2038, 2049],\n\t\t//\t\t\"success\": true\n\t\t//\t};\n\n\t\t$('#load').on('click', function() {\n\t\t\tvar samples = $('#count').val();\n\n\t\t\t$().get('http://192.168.1.13/api/raw.json?n='+samples, onRxData, true, true);\n\t\t});\n\t};\n\n\treturn wfm;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["chibi.js","chartist.js","chartist.axis-title.js","chartist.zoom.js","utils.js","modal.js","app.js","wifi.js","waveform.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3uHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"all.js","sourcesContent":["/*!chibi 3.0.7, Copyright 2012-2016 Kyle Barrow, released under MIT license */\n(function () {\n\t'use strict';\n\n\tvar readyfn = [],\n\t\tloadedfn = [],\n\t\tdomready = false,\n\t\tpageloaded = false,\n\t\tjsonpcount = 0,\n\t\td = document,\n\t\tw = window;\n\n\t// Fire any function calls on ready event\n\tfunction fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}\n\n\t// Fire any function calls on loaded event\n\tfunction fireLoaded() {\n\t\tvar i;\n\t\tpageloaded = true;\n\t\t// For browsers with no DOM loaded support\n\t\tif (!domready) {\n\t\t\tfireReady();\n\t\t}\n\t\tfor (i = 0; i < loadedfn.length; i += 1) {\n\t\t\tloadedfn[i]();\n\t\t}\n\t\tloadedfn = [];\n\t}\n\n\t// Check DOM ready, page loaded\n\tif (d.addEventListener) {\n\t\t// Standards\n\t\td.addEventListener('DOMContentLoaded', fireReady, false);\n\t\tw.addEventListener('load', fireLoaded, false);\n\t} else if (d.attachEvent) {\n\t\t// IE\n\t\td.attachEvent('onreadystatechange', fireReady);\n\t\t// IE < 9\n\t\tw.attachEvent('onload', fireLoaded);\n\t} else {\n\t\t// Anything else\n\t\tw.onload = fireLoaded;\n\t}\n\n\t// Utility functions\n\n\t// Loop through node array\n\tfunction nodeLoop(fn, nodes) {\n\t\tvar i;\n\t\t// Good idea to walk up the DOM\n\t\tfor (i = nodes.length - 1; i >= 0; i -= 1) {\n\t\t\tfn(nodes[i]);\n\t\t}\n\t}\n\n\t// Convert to camel case\n\tfunction cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {return result.charAt(1).toUpperCase(); });\n\t}\n\n\t// Get computed style\n\tfunction computeStyle(elm, property) {\n\t\t// IE, everything else or null\n\t\treturn (elm.currentStyle) ? elm.currentStyle[cssCamel(property)] : (w.getComputedStyle) ? w.getComputedStyle(elm, null).getPropertyValue(property) : null;\n\n\t}\n\n\t// Returns URI encoded query string pair\n\tfunction queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}\n\n\t// Set CSS, important to wrap in try to prevent error thown on unsupported property\n\tfunction setCss(elm, property, value) {\n\t\ttry {\n\t\t\telm.style[cssCamel(property)] = value;\n\t\t} catch (e) {}\n\t}\n\n\t// Show CSS\n\tfunction showCss(elm) {\n\t\telm.style.display = '';\n\t\t// For elements still hidden by style block\n\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\telm.style.display = 'block';\n\t\t}\n\t}\n\n\t// Serialize form & JSON values\n\tfunction serializeData(nodes) {\n\t\tvar querystring = '', subelm, i, j;\n\t\tif (nodes.constructor === Object) { // Serialize JSON data\n\t\t\tfor (subelm in nodes) {\n\t\t\t\tif (nodes.hasOwnProperty(subelm)) {\n\t\t\t\t\tif (nodes[subelm].constructor === Array) {\n\t\t\t\t\t\tfor (i = 0; i < nodes[subelm].length; i += 1) {\n\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm][i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tquerystring += '&' + queryPair(subelm, nodes[subelm]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // Serialize node data\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (elm.nodeName === 'FORM') {\n\t\t\t\t\tfor (i = 0; i < elm.elements.length; i += 1) {\n\t\t\t\t\t\tsubelm = elm.elements[i];\n\n\t\t\t\t\t\tif (!subelm.disabled) {\n\t\t\t\t\t\t\tswitch (subelm.type) {\n\t\t\t\t\t\t\t// Ignore buttons, unsupported XHR 1 form fields\n\t\t\t\t\t\t\tcase 'button':\n\t\t\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\tcase 'reset':\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'select-one':\n\t\t\t\t\t\t\t\tif (subelm.length > 0) {\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'select-multiple':\n\t\t\t\t\t\t\t\tfor (j = 0; j < subelm.length; j += 1) {\n\t\t\t\t\t\t\t\t\tif (subelm[j].selected) {\n\t\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm[j].value);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tif (subelm.checked) {\n\t\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t// Everything else including shinny new HTML5 input types\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tquerystring += '&' + queryPair(subelm.name, subelm.value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\t// Tidy up first &\n\t\treturn (querystring.length > 0) ? querystring.substring(1) : '';\n\t}\n\n\t// Class helper\n\tfunction classHelper(classes, action, nodes) {\n\t\tvar classarray, search, i, has = false;\n\t\tif (classes) {\n\t\t\t// Trim any whitespace\n\t\t\tclassarray = classes.split(/\\s+/);\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tfor (i = 0; i < classarray.length; i += 1) {\n\t\t\t\t\tsearch = new RegExp('\\\\b' + classarray[i] + '\\\\b', 'g');\n\t\t\t\t\tif (action === 'remove') {\n\t\t\t\t\t\telm.className = elm.className.replace(search, '');\n\t\t\t\t\t} else if (action === 'toggle') {\n\t\t\t\t\t\telm.className = (elm.className.match(search)) ? elm.className.replace(search, '') : elm.className + ' ' + classarray[i];\n\t\t\t\t\t} else if (action === 'has') {\n\t\t\t\t\t\tif (elm.className.match(search)) {\n\t\t\t\t\t\t\thas = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t\treturn has;\n\t}\n\n\t// HTML insertion helper\n\tfunction insertHtml(value, position, nodes) {\n\t\tvar tmpnodes, tmpnode;\n\t\tif (value) {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// No insertAdjacentHTML support for FF < 8 and IE doesn't allow insertAdjacentHTML table manipulation, so use this instead\n\t\t\t\t// Convert string to node. We can't innerHTML on a document fragment\n\t\t\t\ttmpnodes = d.createElement('div');\n\t\t\t\ttmpnodes.innerHTML = value;\n\t\t\t\twhile ((tmpnode = tmpnodes.lastChild) !== null) {\n\t\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (position === 'before') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm);\n\t\t\t\t\t\t} else if (position === 'after') {\n\t\t\t\t\t\t\telm.parentNode.insertBefore(tmpnode, elm.nextSibling);\n\t\t\t\t\t\t} else if (position === 'append') {\n\t\t\t\t\t\t\telm.appendChild(tmpnode);\n\t\t\t\t\t\t} else if (position === 'prepend') {\n\t\t\t\t\t\t\telm.insertBefore(tmpnode, elm.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {break; }\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t}\n\t}\n\n\t// Get nodes and return chibi\n\tfunction chibi(selector) {\n\t\tvar cb, nodes = [], json = false, nodelist, i;\n\n\t\tif (selector) {\n\n\t\t\t// Element node, would prefer to use (selector instanceof HTMLElement) but no IE support\n\t\t\tif (selector.nodeType && selector.nodeType === 1) {\n\t\t\t\tnodes = [selector]; // return element as node list\n\t\t\t} else if (typeof selector === 'object') {\n\t\t\t\t// JSON, document object or node list, would prefer to use (selector instanceof NodeList) but no IE support\n\t\t\t\tjson = (typeof selector.length !== 'number');\n\t\t\t\tnodes = selector;\n\t\t\t} else if (typeof selector === 'string') {\n\n\t\t\t\t// A very light querySelectorAll polyfill for IE < 8. It suits my needs but is restricted to IE CSS support, is no speed demon, and does leave older mobile browsers in the cold (that support neither querySelectorAll nor currentStyle/getComputedStyle). If you want to use a fuller featured selector engine like Qwery, Sizzle et al, just return results to the nodes array: nodes = altselectorengine(selector)\n\n\t\t\t\t// IE < 8\n\t\t\t\tif (!d.querySelectorAll) {\n\t\t\t\t\t// Polyfill querySelectorAll\n\t\t\t\t\td.querySelectorAll = function (selector) {\n\n\t\t\t\t\t\tvar style, head = d.getElementsByTagName('head')[0], allnodes, selectednodes = [], i;\n\n\t\t\t\t\t\tstyle = d.createElement('STYLE');\n\t\t\t\t\t\tstyle.type = 'text/css';\n\n\t\t\t\t\t\tif (style.styleSheet) {\n\t\t\t\t\t\t\tstyle.styleSheet.cssText = selector + ' {a:b}';\n\n\t\t\t\t\t\t\thead.appendChild(style);\n\n\t\t\t\t\t\t\tallnodes = d.getElementsByTagName('*');\n\n\t\t\t\t\t\t\tfor (i = 0; i < allnodes.length; i += 1) {\n\t\t\t\t\t\t\t\tif (computeStyle(allnodes[i], 'a') === 'b') {\n\t\t\t\t\t\t\t\t\tselectednodes.push(allnodes[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\thead.removeChild(style);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn selectednodes;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnodelist = d.querySelectorAll(selector);\n\n\t\t\t\t// Convert node list to array so results have full access to array methods\n\t\t\t\t// Array.prototype.slice.call not supported in IE < 9 and often slower than loop anyway\n\t\t\t\tfor (i = 0; i < nodelist.length; i += 1) {\n\t\t\t\t\tnodes[i] = nodelist[i];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Only attach nodes if not JSON\n\t\tcb = json ? {} : nodes;\n\n\t\t// Public functions\n\n\t\t// Fire on DOM ready\n\t\tcb.ready = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (domready) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\treadyfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Fire on page loaded\n\t\tcb.loaded = function (fn) {\n\t\t\tif (fn) {\n\t\t\t\tif (pageloaded) {\n\t\t\t\t\tfn();\n\t\t\t\t\treturn cb;\n\t\t\t\t} else {\n\t\t\t\t\tloadedfn.push(fn);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Executes a function on nodes\n\t\tcb.each = function (fn) {\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply\n\t\t\t\t\treturn fn.apply(elm, arguments);\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Find first\n\t\tcb.first = function () {\n\t\t\treturn chibi(nodes.shift());\n\t\t};\n\t\t// Find last\n\t\tcb.last = function () {\n\t\t\treturn chibi(nodes.pop());\n\t\t};\n\t\t// Find odd\n\t\tcb.odd = function () {\n\t\t\tvar odds = [], i;\n\t\t\tfor (i = 0; i < nodes.length; i += 2) {\n\t\t\t\todds.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(odds);\n\t\t};\n\t\t// Find even\n\t\tcb.even = function () {\n\t\t\tvar evens = [], i;\n\t\t\tfor (i = 1; i < nodes.length; i += 2) {\n\t\t\t\tevens.push(nodes[i]);\n\t\t\t}\n\t\t\treturn chibi(evens);\n\t\t};\n\t\t// Hide node\n\t\tcb.hide = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\telm.style.display = 'none';\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Show node\n\t\tcb.show = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tshowCss(elm);\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle node display\n\t\tcb.toggle = function (state) {\n\t\t\tif (typeof state != 'undefined') { // ADDED\n\t\t\t\tif(state)\n\t\t\t\t\tcb.show();\n\t\t\t\telse\n\t\t\t\t\tcb.hide();\n\t\t\t} else {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t// computeStyle instead of style.display == 'none' catches elements that are hidden via style block\n\t\t\t\t\tif (computeStyle(elm, 'display') === 'none') {\n\t\t\t\t\t\tshowCss(elm);\n\t\t\t\t\t} else {\n\t\t\t\t\t\telm.style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove node\n\t\tcb.remove = function () {\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\t// Catch error in unlikely case elm has been removed\n\t\t\t\ttry {\n\t\t\t\t\telm.parentNode.removeChild(elm);\n\t\t\t\t} catch (e) {}\n\t\t\t}, nodes);\n\t\t\treturn chibi();\n\t\t};\n\t\t// Get/Set CSS\n\t\tcb.css = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tif (value || value === '') {\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tsetCss(elm, property, value);\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (nodes[0].style[cssCamel(property)]) {\n\t\t\t\t\t\treturn nodes[0].style[cssCamel(property)];\n\t\t\t\t\t}\n\t\t\t\t\tif (computeStyle(nodes[0], property)) {\n\t\t\t\t\t\treturn computeStyle(nodes[0], property);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get class(es)\n\t\tcb.getClass = function () {\n\t\t\tif (nodes[0] && nodes[0].className.length > 0) {\n\t\t\t\t// Weak IE trim support\n\t\t\t\treturn nodes[0].className.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '').replace(/\\s+/,' ');\n\t\t\t}\n\t\t};\n\t\t// Set (replaces) classes\n\t\tcb.setClass = function (classes) {\n\t\t\tif (classes || classes === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className = classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Add class\n\t\tcb.addClass = function (classes) {\n\t\t\tif (classes) {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.className += ' ' + classes;\n\t\t\t\t}, nodes);\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove class\n\t\tcb.removeClass = function (classes) {\n\t\t\tclassHelper(classes, 'remove', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Toggle class\n\t\tcb.toggleClass = function (classes) {\n\t\t\tclassHelper(classes, 'toggle', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Has class\n\t\tcb.hasClass = function (classes) {\n\t\t\treturn classHelper(classes, 'has', nodes);\n\t\t};\n\t\t// Get/set HTML\n\t\tcb.html = function (value) {\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\telm.innerHTML = value;\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\treturn nodes[0].innerHTML;\n\t\t\t}\n\t\t};\n\t\t// Insert HTML before selector\n\t\tcb.htmlBefore = function (value) {\n\t\t\tinsertHtml(value, 'before', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector\n\t\tcb.htmlAfter = function (value) {\n\t\t\tinsertHtml(value, 'after', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML after selector innerHTML\n\t\tcb.htmlAppend = function (value) {\n\t\t\tinsertHtml(value, 'append', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Insert HTML before selector innerHTML\n\t\tcb.htmlPrepend = function (value) {\n\t\t\tinsertHtml(value, 'prepend', nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Get/Set HTML attributes\n\t\tcb.attr = function (property, value) {\n\t\t\tif (property) {\n\t\t\t\tproperty = property.toLowerCase();\n\t\t\t\t// IE < 9 doesn't allow style or class via get/setAttribute so switch. cssText returns prettier CSS anyway\n\t\t\t\tif (typeof value !== 'undefined') {//FIXED BUG HERE\n\t\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\t\telm.style.cssText = value;\n\t\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\t\telm.className = value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telm.setAttribute(property, value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, nodes);\n\t\t\t\t\treturn cb;\n\t\t\t\t}\n\t\t\t\tif (nodes[0]) {\n\t\t\t\t\tif (property === 'style') {\n\t\t\t\t\t\tif (nodes[0].style.cssText) {\n\t\t\t\t\t\t\treturn nodes[0].style.cssText;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (property === 'class') {\n\t\t\t\t\t\tif (nodes[0].className) {\n\t\t\t\t\t\t\treturn nodes[0].className;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodes[0].getAttribute(property)) {\n\t\t\t\t\t\t\treturn nodes[0].getAttribute(property);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Get/Set HTML data property\n\t\tcb.data = function (key, value) {\n\t\t\tif (key) {\n\t\t\t\treturn cb.attr('data-'+key, value);\n\t\t\t}\n\t\t};\n\t\t// Get/Set form element values\n\t\tcb.val = function (value) {\n\t\t\tvar values, i, j;\n\t\t\tif (value || value === '') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tswitch (elm.nodeName) {\n\t\t\t\t\tcase 'SELECT':\n\t\t\t\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t\t\t\tvalue = [value];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (i = 0; i < elm.length; i += 1) {\n\t\t\t\t\t\t\t// Multiple select\n\t\t\t\t\t\t\tfor (j = 0; j < value.length; j += 1) {\n\t\t\t\t\t\t\t\telm[i].selected = '';\n\t\t\t\t\t\t\t\tif (elm[i].value === value[j]) {\n\t\t\t\t\t\t\t\t\telm[i].selected = 'selected';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INPUT':\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'BUTTON':\n\t\t\t\t\t\telm.value = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0]) {\n\t\t\t\tswitch (nodes[0].nodeName) {\n\t\t\t\tcase 'SELECT':\n\t\t\t\t\tvalues = [];\n\t\t\t\t\tfor (i = 0; i < nodes[0].length; i += 1) {\n\t\t\t\t\t\tif (nodes[0][i].selected) {\n\t\t\t\t\t\t\tvalues.push(nodes[0][i].value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn (values.length > 1) ? values : values[0];\n\t\t\t\tcase 'INPUT':\n\t\t\t\tcase 'TEXTAREA':\n\t\t\t\tcase 'BUTTON':\n\t\t\t\t\treturn nodes[0].value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Return matching checked checkbox or radios\n\t\tcb.checked = function (check) {\n\t\t\tif (typeof check === 'boolean') {\n\t\t\t\tnodeLoop(function (elm) {\n\t\t\t\t\tif (elm.nodeName === 'INPUT' && (elm.type === 'checkbox' || elm.type === 'radio')) {\n\t\t\t\t\t\telm.checked = check;\n\t\t\t\t\t}\n\t\t\t\t}, nodes);\n\t\t\t\treturn cb;\n\t\t\t}\n\t\t\tif (nodes[0] && nodes[0].nodeName === 'INPUT' && (nodes[0].type === 'checkbox' || nodes[0].type === 'radio')) {\n\t\t\t\treturn (!!nodes[0].checked);\n\t\t\t}\n\t\t};\n\t\t// Add event handler\n\t\tcb.on = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.addEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\t// <= IE 8 loses scope so need to apply, we add this to object so we can detach later (can't detach anonymous functions)\n\t\t\t\t\telm[event + fn] = function () { return fn.apply(elm, arguments); };\n\t\t\t\t\telm.attachEvent('on' + event, elm[event + fn]);\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Remove event handler\n\t\tcb.off = function (event, fn) {\n\t\t\tif (selector === w || selector === d) {\n\t\t\t\tnodes = [selector];\n\t\t\t}\n\t\t\tnodeLoop(function (elm) {\n\t\t\t\tif (d.addEventListener) {\n\t\t\t\t\telm.removeEventListener(event, fn, false);\n\t\t\t\t} else if (d.attachEvent) {\n\t\t\t\t\telm.detachEvent('on' + event, elm[event + fn]);\n\t\t\t\t\t// Tidy up\n\t\t\t\t\telm[event + fn] = null;\n\t\t\t\t}\n\t\t\t}, nodes);\n\t\t\treturn cb;\n\t\t};\n\t\t// Basic XHR 1, no file support. Shakes fist at IE\n\t\tcb.ajax = function (url, method, callback, nocache, nojsonp) {\n\t\t\tvar xhr,\n\t\t\t\tquery = serializeData(nodes),\n\t\t\t\ttype = (method) ? method.toUpperCase() : 'GET',\n\t\t\t\thostsearch = new RegExp('http[s]?://(.*?)/', 'gi'),\n\t\t\t\tdomain = hostsearch.exec(url),\n\t\t\t\ttimestamp = '_ts=' + (+new Date()),\n\t\t\t\thead = d.getElementsByTagName('head')[0],\n\t\t\t\tjsonpcallback = 'chibi' + (+new Date()) + (jsonpcount += 1),\n\t\t\t\tscript;\n\n\t\t\tif (query && (type === 'GET' || type === 'DELETE')) {\n\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + query : '&' + query;\n\t\t\t\tquery = null;\n\t\t\t}\n\n\t\t\t// JSONP if cross domain url\n\t\t\tif (type === 'GET' && !nojsonp && domain && w.location.host !== domain[1]) {\n\n\t\t\t\tif (nocache) {\n\t\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp;\n\t\t\t\t}\n\n\t\t\t\t// Replace possible encoded ?\n\t\t\t\turl = url.replace('=%3F', '=?');\n\n\t\t\t\t// Replace jsonp ? with callback\n\t\t\t\tif (callback && url.indexOf('=?') !== -1) {\n\n\t\t\t\t\turl = url.replace('=?', '=' + jsonpcallback);\n\n\t\t\t\t\tw[jsonpcallback] = function (data) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcallback(data, 200);\n\t\t\t\t\t\t} catch (e) {}\n\n\t\t\t\t\t\t// Tidy up\n\t\t\t\t\t\tw[jsonpcallback] = undefined;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// JSONP\n\t\t\t\tscript = document.createElement('script');\n\t\t\t\tscript.async = true;\n\t\t\t\tscript.src = url;\n\n\t\t\t\t// Tidy up\n\t\t\t\tscript.onload = function () {\n\t\t\t\t\thead.removeChild(script);\n\t\t\t\t};\n\n\t\t\t\thead.appendChild(script);\n\n\t\t\t} else {\n\n\t\t\t\tif (w.XMLHttpRequest) {\n\t\t\t\t\txhr = new XMLHttpRequest();\n\t\t\t\t} else if (w.ActiveXObject) {\n\t\t\t\t\txhr = new ActiveXObject('Microsoft.XMLHTTP'); // IE < 9\n\t\t\t\t}\n\n\t\t\t\tif (xhr) {\n\n\t\t\t\t\tif (nocache) {\n\t\t\t\t\t\turl += (url.indexOf('?') === -1) ? '?' + timestamp : '&' + timestamp;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Douglas Crockford: \"Synchronous programming is disrespectful and should not be employed in applications which are used by people\"\n\t\t\t\t\txhr.open(type, url, true);\n\n\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\tif (callback) {\n\t\t\t\t\t\t\t\tcallback(xhr.responseText, xhr.status);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t\t\t\tif (type === 'POST' || type === 'PUT') {\n\t\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\t\t\t\t\t}\n\n\t\t\t\t\txhr.send(query);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn cb;\n\t\t};\n\t\t// Alias to cb.ajax(url, 'get', callback, nocache, nojsonp)\n\t\tcb.get = function (url, callback, nocache, nojsonp) {\n\t\t\treturn cb.ajax(url, 'get', callback, nocache, nojsonp);\n\t\t};\n\t\t// Alias to cb.ajax(url, 'post', callback, nocache)\n\t\tcb.post = function (url, callback, nocache) {\n\t\t\treturn cb.ajax(url, 'post', callback, nocache);\n\t\t};\n\n\t\treturn cb;\n\t}\n\n\t// Set Chibi's global namespace here ($)\n\tw.$ = chibi;\n\n}());\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module unless amdModuleId is set\n // define([], function () {\n // return (root['Chartist'] = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like environments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist'] = factory();\n // }\n}(this, function () {\n\n/* Chartist.js 0.9.7\n * Copyright © 2016 Gion Kunz\n * Free to use under either the WTFPL license or the MIT license.\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL\n * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT\n */\n/**\n * The core module of Chartist that is mainly providing static functions and higher level functions for chart modules.\n *\n * @module Chartist.Core\n */\nvar Chartist = {\n version: '0.9.7'\n};\n\n(function (window, document, Chartist) {\n 'use strict';\n\n /**\n * This object contains all namespaces used within Chartist.\n *\n * @memberof Chartist.Core\n * @type {{svg: string, xmlns: string, xhtml: string, xlink: string, ct: string}}\n */\n Chartist.namespaces = {\n svg: 'http://www.w3.org/2000/svg',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n xhtml: 'http://www.w3.org/1999/xhtml',\n xlink: 'http://www.w3.org/1999/xlink',\n ct: 'http://gionkunz.github.com/chartist-js/ct'\n };\n\n /**\n * Helps to simplify functional style code\n *\n * @memberof Chartist.Core\n * @param {*} n This exact value will be returned by the noop function\n * @return {*} The same value that was provided to the n parameter\n */\n Chartist.noop = function (n) {\n return n;\n };\n\n /**\n * Generates a-z from a number 0 to 26\n *\n * @memberof Chartist.Core\n * @param {Number} n A number from 0 to 26 that will result in a letter a-z\n * @return {String} A character from a-z based on the input number n\n */\n Chartist.alphaNumerate = function (n) {\n // Limit to a-z\n return String.fromCharCode(97 + n % 26);\n };\n\n /**\n * Simple recursive object extend\n *\n * @memberof Chartist.Core\n * @param {Object} target Target object where the source will be merged into\n * @param {Object...} sources This object (objects) will be merged into target and then target is returned\n * @return {Object} An object that has the same reference as target but is extended and merged with the properties of source\n */\n Chartist.extend = function (target) {\n target = target || {};\n\n var sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n for (var prop in source) {\n if (typeof source[prop] === 'object' && source[prop] !== null && !(source[prop] instanceof Array)) {\n target[prop] = Chartist.extend({}, target[prop], source[prop]);\n } else {\n target[prop] = source[prop];\n }\n }\n });\n\n return target;\n };\n\n /**\n * Replaces all occurrences of subStr in str with newSubStr and returns a new string.\n *\n * @memberof Chartist.Core\n * @param {String} str\n * @param {String} subStr\n * @param {String} newSubStr\n * @return {String}\n */\n Chartist.replaceAll = function(str, subStr, newSubStr) {\n return str.replace(new RegExp(subStr, 'g'), newSubStr);\n };\n\n /**\n * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.\n *\n * @memberof Chartist.Core\n * @param {Number} value\n * @param {String} unit\n * @return {String} Returns the passed number value with unit.\n */\n Chartist.ensureUnit = function(value, unit) {\n if(typeof value === 'number') {\n value = value + unit;\n }\n\n return value;\n };\n\n /**\n * Converts a number or string to a quantity object.\n *\n * @memberof Chartist.Core\n * @param {String|Number} input\n * @return {Object} Returns an object containing the value as number and the unit as string.\n */\n Chartist.quantity = function(input) {\n if (typeof input === 'string') {\n var match = (/^(\\d+)\\s*(.*)$/g).exec(input);\n return {\n value : +match[1],\n unit: match[2] || undefined\n };\n }\n return { value: input };\n };\n\n /**\n * This is a wrapper around document.querySelector that will return the query if it's already of type Node\n *\n * @memberof Chartist.Core\n * @param {String|Node} query The query to use for selecting a Node or a DOM node that will be returned directly\n * @return {Node}\n */\n Chartist.querySelector = function(query) {\n return query instanceof Node ? query : document.querySelector(query);\n };\n\n /**\n * Functional style helper to produce array with given length initialized with undefined values\n *\n * @memberof Chartist.Core\n * @param length\n * @return {Array}\n */\n Chartist.times = function(length) {\n return Array.apply(null, new Array(length));\n };\n\n /**\n * Sum helper to be used in reduce functions\n *\n * @memberof Chartist.Core\n * @param previous\n * @param current\n * @return {*}\n */\n Chartist.sum = function(previous, current) {\n return previous + (current ? current : 0);\n };\n\n /**\n * Multiply helper to be used in `Array.map` for multiplying each value of an array with a factor.\n *\n * @memberof Chartist.Core\n * @param {Number} factor\n * @returns {Function} Function that can be used in `Array.map` to multiply each value in an array\n */\n Chartist.mapMultiply = function(factor) {\n return function(num) {\n return num * factor;\n };\n };\n\n /**\n * Add helper to be used in `Array.map` for adding a addend to each value of an array.\n *\n * @memberof Chartist.Core\n * @param {Number} addend\n * @returns {Function} Function that can be used in `Array.map` to add a addend to each value in an array\n */\n Chartist.mapAdd = function(addend) {\n return function(num) {\n return num + addend;\n };\n };\n\n /**\n * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).\n *\n * @memberof Chartist.Core\n * @param arr\n * @param cb\n * @return {Array}\n */\n Chartist.serialMap = function(arr, cb) {\n var result = [],\n length = Math.max.apply(null, arr.map(function(e) {\n return e.length;\n }));\n\n Chartist.times(length).forEach(function(e, index) {\n var args = arr.map(function(e) {\n return e[index];\n });\n\n result[index] = cb.apply(null, args);\n });\n\n return result;\n };\n\n /**\n * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.\n *\n * @memberof Chartist.Core\n * @param {Number} value The value that should be rounded with precision\n * @param {Number} [digits] The number of digits after decimal used to do the rounding\n * @returns {number} Rounded value\n */\n Chartist.roundWithPrecision = function(value, digits) {\n var precision = Math.pow(10, digits || Chartist.precision);\n return Math.round(value * precision) / precision;\n };\n\n /**\n * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.\n *\n * @memberof Chartist.Core\n * @type {number}\n */\n Chartist.precision = 8;\n\n /**\n * A map with characters to escape for strings to be safely used as attribute values.\n *\n * @memberof Chartist.Core\n * @type {Object}\n */\n Chartist.escapingMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n };\n\n /**\n * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.\n * If called with null or undefined the function will return immediately with null or undefined.\n *\n * @memberof Chartist.Core\n * @param {Number|String|Object} data\n * @return {String}\n */\n Chartist.serialize = function(data) {\n if(data === null || data === undefined) {\n return data;\n } else if(typeof data === 'number') {\n data = ''+data;\n } else if(typeof data === 'object') {\n data = JSON.stringify({data: data});\n }\n\n return Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n return Chartist.replaceAll(result, key, Chartist.escapingMap[key]);\n }, data);\n };\n\n /**\n * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.\n *\n * @memberof Chartist.Core\n * @param {String} data\n * @return {String|Number|Object}\n */\n Chartist.deserialize = function(data) {\n if(typeof data !== 'string') {\n return data;\n }\n\n data = Object.keys(Chartist.escapingMap).reduce(function(result, key) {\n return Chartist.replaceAll(result, Chartist.escapingMap[key], key);\n }, data);\n\n try {\n data = JSON.parse(data);\n data = data.data !== undefined ? data.data : data;\n } catch(e) {}\n\n return data;\n };\n\n /**\n * Create or reinitialize the SVG element for the chart\n *\n * @memberof Chartist.Core\n * @param {Node} container The containing DOM Node object that will be used to plant the SVG element\n * @param {String} width Set the width of the SVG element. Default is 100%\n * @param {String} height Set the height of the SVG element. Default is 100%\n * @param {String} className Specify a class to be added to the SVG element\n * @return {Object} The created/reinitialized SVG element\n */\n Chartist.createSvg = function (container, width, height, className) {\n var svg;\n\n width = width || '100%';\n height = height || '100%';\n\n // Check if there is a previous SVG element in the container that contains the Chartist XML namespace and remove it\n // Since the DOM API does not support namespaces we need to manually search the returned list http://www.w3.org/TR/selectors-api/\n Array.prototype.slice.call(container.querySelectorAll('svg')).filter(function filterChartistSvgObjects(svg) {\n return svg.getAttributeNS(Chartist.namespaces.xmlns, 'ct');\n }).forEach(function removePreviousElement(svg) {\n container.removeChild(svg);\n });\n\n // Create svg object with width and height or use 100% as default\n svg = new Chartist.Svg('svg').attr({\n width: width,\n height: height\n }).addClass(className).attr({\n style: 'width: ' + width + '; height: ' + height + ';'\n });\n\n // Add the DOM node to our container\n container.appendChild(svg._node);\n\n return svg;\n };\n\n /**\n * Ensures that the data object passed as second argument to the charts is present and correctly initialized.\n *\n * @param {Object} data The data object that is passed as second argument to the charts\n * @return {Object} The normalized data object\n */\n Chartist.normalizeData = function(data) {\n // Ensure data is present otherwise enforce\n data = data || {series: [], labels: []};\n data.series = data.series || [];\n data.labels = data.labels || [];\n\n // Check if we should generate some labels based on existing series data\n if (data.series.length > 0 && data.labels.length === 0) {\n var normalized = Chartist.getDataArray(data),\n labelCount;\n\n // If all elements of the normalized data array are arrays we're dealing with\n // data from Bar or Line charts and we need to find the largest series if they are un-even\n if (normalized.every(function(value) {\n return value instanceof Array;\n })) {\n // Getting the series with the the most elements\n labelCount = Math.max.apply(null, normalized.map(function(series) {\n return series.length;\n }));\n } else {\n // We're dealing with Pie data so we just take the normalized array length\n labelCount = normalized.length;\n }\n\n // Setting labels to an array with emptry strings using our labelCount estimated above\n data.labels = Chartist.times(labelCount).map(function() {\n return '';\n });\n }\n return data;\n };\n\n /**\n * Reverses the series, labels and series data arrays.\n *\n * @memberof Chartist.Core\n * @param data\n */\n Chartist.reverseData = function(data) {\n data.labels.reverse();\n data.series.reverse();\n for (var i = 0; i < data.series.length; i++) {\n if(typeof(data.series[i]) === 'object' && data.series[i].data !== undefined) {\n data.series[i].data.reverse();\n } else if(data.series[i] instanceof Array) {\n data.series[i].reverse();\n }\n }\n };\n\n /**\n * Convert data series into plain array\n *\n * @memberof Chartist.Core\n * @param {Object} data The series object that contains the data to be visualized in the chart\n * @param {Boolean} reverse If true the whole data is reversed by the getDataArray call. This will modify the data object passed as first parameter. The labels as well as the series order is reversed. The whole series data arrays are reversed too.\n * @param {Boolean} multi Create a multi dimensional array from a series data array where a value object with `x` and `y` values will be created.\n * @return {Array} A plain array that contains the data to be visualized in the chart\n */\n Chartist.getDataArray = function (data, reverse, multi) {\n // If the data should be reversed but isn't we need to reverse it\n // If it's reversed but it shouldn't we need to reverse it back\n // That's required to handle data updates correctly and to reflect the responsive configurations\n if(reverse && !data.reversed || !reverse && data.reversed) {\n Chartist.reverseData(data);\n data.reversed = !data.reversed;\n }\n\n // Recursively walks through nested arrays and convert string values to numbers and objects with value properties\n // to values. Check the tests in data core -> data normalization for a detailed specification of expected values\n function recursiveConvert(value) {\n if(Chartist.isFalseyButZero(value)) {\n // This is a hole in data and we should return undefined\n return undefined;\n } else if((value.data || value) instanceof Array) {\n return (value.data || value).map(recursiveConvert);\n } else if(value.hasOwnProperty('value')) {\n return recursiveConvert(value.value);\n } else {\n if(multi) {\n var multiValue = {};\n\n // Single series value arrays are assumed to specify the Y-Axis value\n // For example: [1, 2] => [{x: undefined, y: 1}, {x: undefined, y: 2}]\n // If multi is a string then it's assumed that it specified which dimension should be filled as default\n if(typeof multi === 'string') {\n multiValue[multi] = Chartist.getNumberOrUndefined(value);\n } else {\n multiValue.y = Chartist.getNumberOrUndefined(value);\n }\n\n multiValue.x = value.hasOwnProperty('x') ? Chartist.getNumberOrUndefined(value.x) : multiValue.x;\n multiValue.y = value.hasOwnProperty('y') ? Chartist.getNumberOrUndefined(value.y) : multiValue.y;\n\n return multiValue;\n\n } else {\n return Chartist.getNumberOrUndefined(value);\n }\n }\n }\n\n return data.series.map(recursiveConvert);\n };\n\n /**\n * Converts a number into a padding object.\n *\n * @memberof Chartist.Core\n * @param {Object|Number} padding\n * @param {Number} [fallback] This value is used to fill missing values if a incomplete padding object was passed\n * @returns {Object} Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.\n */\n Chartist.normalizePadding = function(padding, fallback) {\n fallback = fallback || 0;\n\n return typeof padding === 'number' ? {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n } : {\n top: typeof padding.top === 'number' ? padding.top : fallback,\n right: typeof padding.right === 'number' ? padding.right : fallback,\n bottom: typeof padding.bottom === 'number' ? padding.bottom : fallback,\n left: typeof padding.left === 'number' ? padding.left : fallback\n };\n };\n\n Chartist.getMetaData = function(series, index) {\n var value = series.data ? series.data[index] : series[index];\n return value ? Chartist.serialize(value.meta) : undefined;\n };\n\n /**\n * Calculate the order of magnitude for the chart scale\n *\n * @memberof Chartist.Core\n * @param {Number} value The value Range of the chart\n * @return {Number} The order of magnitude\n */\n Chartist.orderOfMagnitude = function (value) {\n return Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n };\n\n /**\n * Project a data length into screen coordinates (pixels)\n *\n * @memberof Chartist.Core\n * @param {Object} axisLength The svg element for the chart\n * @param {Number} length Single data value from a series array\n * @param {Object} bounds All the values to set the bounds of the chart\n * @return {Number} The projected data length in pixels\n */\n Chartist.projectLength = function (axisLength, length, bounds) {\n return length / bounds.range * axisLength;\n };\n\n /**\n * Get the height of the area in the chart for the data series\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @return {Number} The height of the area in the chart for the data series\n */\n Chartist.getAvailableHeight = function (svg, options) {\n return Math.max((Chartist.quantity(options.height).value || svg.height()) - (options.chartPadding.top + options.chartPadding.bottom) - options.axisX.offset, 0);\n };\n\n /**\n * Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.\n *\n * @memberof Chartist.Core\n * @param {Array} data The array that contains the data to be visualized in the chart\n * @param {Object} options The Object that contains the chart options\n * @param {String} dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration\n * @return {Object} An object that contains the highest and lowest value that will be visualized on the chart.\n */\n Chartist.getHighLow = function (data, options, dimension) {\n // TODO: Remove workaround for deprecated global high / low config. Axis high / low configuration is preferred\n options = Chartist.extend({}, options, dimension ? options['axis' + dimension.toUpperCase()] : {});\n\n var highLow = {\n high: options.high === undefined ? -Number.MAX_VALUE : +options.high,\n low: options.low === undefined ? Number.MAX_VALUE : +options.low\n };\n var findHigh = options.high === undefined;\n var findLow = options.low === undefined;\n\n // Function to recursively walk through arrays and find highest and lowest number\n function recursiveHighLow(data) {\n if(data === undefined) {\n return undefined;\n } else if(data instanceof Array) {\n for (var i = 0; i < data.length; i++) {\n recursiveHighLow(data[i]);\n }\n } else {\n var value = dimension ? +data[dimension] : +data;\n\n if (findHigh && value > highLow.high) {\n highLow.high = value;\n }\n\n if (findLow && value < highLow.low) {\n highLow.low = value;\n }\n }\n }\n\n // Start to find highest and lowest number recursively\n if(findHigh || findLow) {\n recursiveHighLow(data);\n }\n\n // Overrides of high / low based on reference value, it will make sure that the invisible reference value is\n // used to generate the chart. This is useful when the chart always needs to contain the position of the\n // invisible reference value in the view i.e. for bipolar scales.\n if (options.referenceValue || options.referenceValue === 0) {\n highLow.high = Math.max(options.referenceValue, highLow.high);\n highLow.low = Math.min(options.referenceValue, highLow.low);\n }\n\n // If high and low are the same because of misconfiguration or flat data (only the same value) we need\n // to set the high or low to 0 depending on the polarity\n if (highLow.high <= highLow.low) {\n // If both values are 0 we set high to 1\n if (highLow.low === 0) {\n highLow.high = 1;\n } else if (highLow.low < 0) {\n // If we have the same negative value for the bounds we set bounds.high to 0\n highLow.high = 0;\n } else if (highLow.high > 0) {\n // If we have the same positive value for the bounds we set bounds.low to 0\n highLow.low = 0;\n } else {\n // If data array was empty, values are Number.MAX_VALUE and -Number.MAX_VALUE. Set bounds to prevent errors\n highLow.high = 1;\n highLow.low = 0;\n }\n }\n\n return highLow;\n };\n\n /**\n * Checks if the value is a valid number or string with a number.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {Boolean}\n */\n Chartist.isNum = function(value) {\n return !isNaN(value) && isFinite(value);\n };\n\n /**\n * Returns true on all falsey values except the numeric value 0.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {boolean}\n */\n Chartist.isFalseyButZero = function(value) {\n return !value && value !== 0;\n };\n\n /**\n * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.\n *\n * @memberof Chartist.Core\n * @param value\n * @returns {*}\n */\n Chartist.getNumberOrUndefined = function(value) {\n return isNaN(+value) ? undefined : +value;\n };\n\n /**\n * Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return undefined.\n *\n * @param value\n * @param dimension\n * @returns {*}\n */\n Chartist.getMultiValue = function(value, dimension) {\n if(Chartist.isNum(value)) {\n return +value;\n } else if(value) {\n return value[dimension || 'y'] || 0;\n } else {\n return 0;\n }\n };\n\n /**\n * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.\n *\n * @memberof Chartist.Core\n * @param {Number} num An integer number where the smallest factor should be searched for\n * @returns {Number} The smallest integer factor of the parameter num.\n */\n Chartist.rho = function(num) {\n if(num === 1) {\n return num;\n }\n\n function gcd(p, q) {\n if (p % q === 0) {\n return q;\n } else {\n return gcd(q, p % q);\n }\n }\n\n function f(x) {\n return x * x + 1;\n }\n\n var x1 = 2, x2 = 2, divisor;\n if (num % 2 === 0) {\n return 2;\n }\n\n do {\n x1 = f(x1) % num;\n x2 = f(f(x2)) % num;\n divisor = gcd(Math.abs(x1 - x2), num);\n } while (divisor === 1);\n\n return divisor;\n };\n\n /**\n * Calculate and retrieve all the bounds for the chart and return them in one array\n *\n * @memberof Chartist.Core\n * @param {Number} axisLength The length of the Axis used for\n * @param {Object} highLow An object containing a high and low property indicating the value range of the chart.\n * @param {Number} scaleMinSpace The minimum projected length a step should result in\n * @param {Boolean} onlyInteger\n * @return {Object} All the values to set the bounds of the chart\n */\n Chartist.getBounds = function (axisLength, highLow, scaleMinSpace, onlyInteger) {\n var i,\n optimizationCounter = 0,\n newMin,\n newMax,\n bounds = {\n high: highLow.high,\n low: highLow.low\n };\n\n bounds.valueRange = bounds.high - bounds.low;\n bounds.oom = Chartist.orderOfMagnitude(bounds.valueRange);\n bounds.step = Math.pow(10, bounds.oom);\n bounds.min = Math.floor(bounds.low / bounds.step) * bounds.step;\n bounds.max = Math.ceil(bounds.high / bounds.step) * bounds.step;\n bounds.range = bounds.max - bounds.min;\n bounds.numberOfSteps = Math.round(bounds.range / bounds.step);\n\n // Optimize scale step by checking if subdivision is possible based on horizontalGridMinSpace\n // If we are already below the scaleMinSpace value we will scale up\n var length = Chartist.projectLength(axisLength, bounds.step, bounds);\n var scaleUp = length < scaleMinSpace;\n var smallestFactor = onlyInteger ? Chartist.rho(bounds.range) : 0;\n\n // First check if we should only use integer steps and if step 1 is still larger than scaleMinSpace so we can use 1\n if(onlyInteger && Chartist.projectLength(axisLength, 1, bounds) >= scaleMinSpace) {\n bounds.step = 1;\n } else if(onlyInteger && smallestFactor < bounds.step && Chartist.projectLength(axisLength, smallestFactor, bounds) >= scaleMinSpace) {\n // If step 1 was too small, we can try the smallest factor of range\n // If the smallest factor is smaller than the current bounds.step and the projected length of smallest factor\n // is larger than the scaleMinSpace we should go for it.\n bounds.step = smallestFactor;\n } else {\n // Trying to divide or multiply by 2 and find the best step value\n while (true) {\n if (scaleUp && Chartist.projectLength(axisLength, bounds.step, bounds) <= scaleMinSpace) {\n bounds.step *= 2;\n } else if (!scaleUp && Chartist.projectLength(axisLength, bounds.step / 2, bounds) >= scaleMinSpace) {\n bounds.step /= 2;\n if(onlyInteger && bounds.step % 1 !== 0) {\n bounds.step *= 2;\n break;\n }\n } else {\n break;\n }\n\n if(optimizationCounter++ > 1000) {\n throw new Error('Exceeded maximum number of iterations while optimizing scale step!');\n }\n }\n }\n\n // Narrow min and max based on new step\n newMin = bounds.min;\n newMax = bounds.max;\n while(newMin + bounds.step <= bounds.low) {\n newMin += bounds.step;\n }\n while(newMax - bounds.step >= bounds.high) {\n newMax -= bounds.step;\n }\n bounds.min = newMin;\n bounds.max = newMax;\n bounds.range = bounds.max - bounds.min;\n\n bounds.values = [];\n for (i = bounds.min; i <= bounds.max; i += bounds.step) {\n bounds.values.push(Chartist.roundWithPrecision(i));\n }\n\n return bounds;\n };\n\n /**\n * Calculate cartesian coordinates of polar coordinates\n *\n * @memberof Chartist.Core\n * @param {Number} centerX X-axis coordinates of center point of circle segment\n * @param {Number} centerY X-axis coordinates of center point of circle segment\n * @param {Number} radius Radius of circle segment\n * @param {Number} angleInDegrees Angle of circle segment in degrees\n * @return {{x:Number, y:Number}} Coordinates of point on circumference\n */\n Chartist.polarToCartesian = function (centerX, centerY, radius, angleInDegrees) {\n var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n\n return {\n x: centerX + (radius * Math.cos(angleInRadians)),\n y: centerY + (radius * Math.sin(angleInRadians))\n };\n };\n\n /**\n * Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right\n *\n * @memberof Chartist.Core\n * @param {Object} svg The svg element for the chart\n * @param {Object} options The Object that contains all the optional values for the chart\n * @param {Number} [fallbackPadding] The fallback padding if partial padding objects are used\n * @return {Object} The chart rectangles coordinates inside the svg element plus the rectangles measurements\n */\n Chartist.createChartRect = function (svg, options, fallbackPadding) {\n var hasAxis = !!(options.axisX || options.axisY);\n var yAxisOffset = hasAxis ? options.axisY.offset : 0;\n var xAxisOffset = hasAxis ? options.axisX.offset : 0;\n // If width or height results in invalid value (including 0) we fallback to the unitless settings or even 0\n var width = svg.width() || Chartist.quantity(options.width).value || 0;\n var height = svg.height() || Chartist.quantity(options.height).value || 0;\n var normalizedPadding = Chartist.normalizePadding(options.chartPadding, fallbackPadding);\n\n // If settings were to small to cope with offset (legacy) and padding, we'll adjust\n width = Math.max(width, yAxisOffset + normalizedPadding.left + normalizedPadding.right);\n height = Math.max(height, xAxisOffset + normalizedPadding.top + normalizedPadding.bottom);\n\n var chartRect = {\n padding: normalizedPadding,\n width: function () {\n return this.x2 - this.x1;\n },\n height: function () {\n return this.y1 - this.y2;\n }\n };\n\n if(hasAxis) {\n if (options.axisX.position === 'start') {\n chartRect.y2 = normalizedPadding.top + xAxisOffset;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n } else {\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom - xAxisOffset, chartRect.y2 + 1);\n }\n\n if (options.axisY.position === 'start') {\n chartRect.x1 = normalizedPadding.left + yAxisOffset;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right - yAxisOffset, chartRect.x1 + 1);\n }\n } else {\n chartRect.x1 = normalizedPadding.left;\n chartRect.x2 = Math.max(width - normalizedPadding.right, chartRect.x1 + 1);\n chartRect.y2 = normalizedPadding.top;\n chartRect.y1 = Math.max(height - normalizedPadding.bottom, chartRect.y2 + 1);\n }\n\n return chartRect;\n };\n\n /**\n * Creates a grid line based on a projected value.\n *\n * @memberof Chartist.Core\n * @param position\n * @param index\n * @param axis\n * @param offset\n * @param length\n * @param group\n * @param classes\n * @param eventEmitter\n */\n Chartist.createGrid = function(position, index, axis, offset, length, group, classes, eventEmitter) {\n var positionalData = {};\n positionalData[axis.units.pos + '1'] = Math.round(position)+0.5;\n positionalData[axis.units.pos + '2'] = Math.round(position)+0.5; // EDITED: fix blurred grid\n positionalData[axis.counterUnits.pos + '1'] = offset;\n positionalData[axis.counterUnits.pos + '2'] = offset + length;\n\n var gridElement = group.elem('line', positionalData, classes.join(' '));\n\n // Event for grid draw\n eventEmitter.emit('draw',\n Chartist.extend({\n type: 'grid',\n axis: axis,\n index: index,\n group: group,\n element: gridElement\n }, positionalData)\n );\n };\n\n /**\n * Creates a label based on a projected value and an axis.\n *\n * @memberof Chartist.Core\n * @param position\n * @param length\n * @param index\n * @param labels\n * @param axis\n * @param axisOffset\n * @param labelOffset\n * @param group\n * @param classes\n * @param useForeignObject\n * @param eventEmitter\n */\n Chartist.createLabel = function(position, length, index, labels, axis, axisOffset, labelOffset, group, classes, useForeignObject, eventEmitter) {\n var labelElement;\n var positionalData = {};\n\n positionalData[axis.units.pos] = position + labelOffset[axis.units.pos];\n positionalData[axis.counterUnits.pos] = labelOffset[axis.counterUnits.pos];\n positionalData[axis.units.len] = length;\n positionalData[axis.counterUnits.len] = axisOffset - 10;\n\n\tvar lblText = labels[index];\n\t//round (!! will brak for non-numeric)\n\tlblText = Math.round(+lblText*100)/100;\n\n if(useForeignObject) {\n // We need to set width and height explicitly to px as span will not expand with width and height being\n // 100% in all browsers\n var content = '' +\n\t\t lblText + '';\n\n labelElement = group.foreignObject(content, Chartist.extend({\n style: 'overflow: visible;'\n }, positionalData));\n } else {\n labelElement = group.elem('text', positionalData, classes.join(' ')).text(lblText);\n }\n\n eventEmitter.emit('draw', Chartist.extend({\n type: 'label',\n axis: axis,\n index: index,\n group: group,\n element: labelElement,\n text: lblText\n }, positionalData));\n };\n\n /**\n * Helper to read series specific options from options object. It automatically falls back to the global option if\n * there is no option in the series options.\n *\n * @param {Object} series Series object\n * @param {Object} options Chartist options object\n * @param {string} key The options key that should be used to obtain the options\n * @returns {*}\n */\n Chartist.getSeriesOption = function(series, options, key) {\n if(series.name && options.series && options.series[series.name]) {\n var seriesOptions = options.series[series.name];\n return seriesOptions.hasOwnProperty(key) ? seriesOptions[key] : options[key];\n } else {\n return options[key];\n }\n };\n\n /**\n * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches\n *\n * @memberof Chartist.Core\n * @param {Object} options Options set by user\n * @param {Array} responsiveOptions Optional functions to add responsive behavior to chart\n * @param {Object} eventEmitter The event emitter that will be used to emit the options changed events\n * @return {Object} The consolidated options object from the defaults, base and matching responsive options\n */\n Chartist.optionsProvider = function (options, responsiveOptions, eventEmitter) {\n var baseOptions = Chartist.extend({}, options),\n currentOptions,\n mediaQueryListeners = [],\n i;\n\n function updateCurrentOptions(preventChangedEvent) {\n var previousOptions = currentOptions;\n currentOptions = Chartist.extend({}, baseOptions);\n\n if (responsiveOptions) {\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n if (mql.matches) {\n currentOptions = Chartist.extend(currentOptions, responsiveOptions[i][1]);\n }\n }\n }\n\n if(eventEmitter && !preventChangedEvent) {\n eventEmitter.emit('optionsChanged', {\n previousOptions: previousOptions,\n currentOptions: currentOptions\n });\n }\n }\n\n function removeMediaQueryListeners() {\n mediaQueryListeners.forEach(function(mql) {\n mql.removeListener(updateCurrentOptions);\n });\n }\n\n if (!window.matchMedia) {\n throw 'window.matchMedia not found! Make sure you\\'re using a polyfill.';\n } else if (responsiveOptions) {\n\n for (i = 0; i < responsiveOptions.length; i++) {\n var mql = window.matchMedia(responsiveOptions[i][0]);\n mql.addListener(updateCurrentOptions);\n mediaQueryListeners.push(mql);\n }\n }\n // Execute initially so we get the correct options\n updateCurrentOptions(true);\n\n return {\n removeMediaQueryListeners: removeMediaQueryListeners,\n getCurrentOptions: function getCurrentOptions() {\n return Chartist.extend({}, currentOptions);\n }\n };\n };\n\n}(window, document, Chartist));\n;/**\n * Chartist path interpolation functions.\n *\n * @module Chartist.Interpolation\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n Chartist.Interpolation = {};\n\n /**\n * This interpolation function does not smooth the path and the result is only containing lines and no curves.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.none({\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @return {Function}\n */\n Chartist.Interpolation.none = function(options) {\n var defaultOptions = {\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n return function none(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(hole) {\n path.move(currX, currY, false, currData);\n } else {\n path.line(currX, currY, false, currData);\n }\n\n hole = false;\n } else if(!options.fillHoles) {\n hole = true;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.\n *\n * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.simple({\n * divisor: 2,\n * fillHoles: false\n * })\n * });\n *\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the simple interpolation factory function.\n * @return {Function}\n */\n Chartist.Interpolation.simple = function(options) {\n var defaultOptions = {\n divisor: 2,\n fillHoles: false\n };\n options = Chartist.extend({}, defaultOptions, options);\n\n var d = 1 / Math.max(1, options.divisor);\n\n return function simple(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n var prevX, prevY, prevData;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var length = (currX - prevX) * d;\n var currData = valueData[i / 2];\n\n if(currData.value !== undefined) {\n\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n path.curve(\n prevX + length,\n prevY,\n currX - length,\n currY,\n currX,\n currY,\n false,\n currData\n );\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = currX = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n /**\n * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.\n *\n * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 1,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param {Object} options The options of the cardinal factory function.\n * @return {Function}\n */\n Chartist.Interpolation.cardinal = function(options) {\n var defaultOptions = {\n tension: 1,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n var t = Math.min(1, Math.max(0, options.tension)),\n c = 1 - t;\n\n // This function will help us to split pathCoordinates and valueData into segments that also contain pathCoordinates\n // and valueData. This way the existing functions can be reused and the segment paths can be joined afterwards.\n // This functionality is necessary to treat \"holes\" in the line charts\n function splitIntoSegments(pathCoordinates, valueData) {\n var segments = [];\n var hole = true;\n\n for(var i = 0; i < pathCoordinates.length; i += 2) {\n // If this value is a \"hole\" we set the hole flag\n if(valueData[i / 2].value === undefined) {\n if(!options.fillHoles) {\n hole = true;\n }\n } else {\n // If it's a valid value we need to check if we're coming out of a hole and create a new empty segment\n if(hole) {\n segments.push({\n pathCoordinates: [],\n valueData: []\n });\n // As we have a valid value now, we are not in a \"hole\" anymore\n hole = false;\n }\n\n // Add to the segment pathCoordinates and valueData\n segments[segments.length - 1].pathCoordinates.push(pathCoordinates[i], pathCoordinates[i + 1]);\n segments[segments.length - 1].valueData.push(valueData[i / 2]);\n }\n }\n\n return segments;\n }\n\n return function cardinal(pathCoordinates, valueData) {\n // First we try to split the coordinates into segments\n // This is necessary to treat \"holes\" in line charts\n var segments = splitIntoSegments(pathCoordinates, valueData);\n\n if(!segments.length) {\n // If there were no segments return 'Chartist.Interpolation.none'\n return Chartist.Interpolation.none()([]);\n } else if(segments.length > 1) {\n // If the split resulted in more that one segment we need to interpolate each segment individually and join them\n // afterwards together into a single path.\n var paths = [];\n // For each segment we will recurse the cardinal function\n segments.forEach(function(segment) {\n paths.push(cardinal(segment.pathCoordinates, segment.valueData));\n });\n // Join the segment path data into a single path and return\n return Chartist.Svg.Path.join(paths);\n } else {\n // If there was only one segment we can proceed regularly by using pathCoordinates and valueData from the first\n // segment\n pathCoordinates = segments[0].pathCoordinates;\n valueData = segments[0].valueData;\n\n // If less than two points we need to fallback to no smoothing\n if(pathCoordinates.length <= 4) {\n return Chartist.Interpolation.none()(pathCoordinates, valueData);\n }\n\n var path = new Chartist.Svg.Path().move(pathCoordinates[0], pathCoordinates[1], false, valueData[0]),\n z;\n\n for (var i = 0, iLen = pathCoordinates.length; iLen - 2 * !z > i; i += 2) {\n var p = [\n {x: +pathCoordinates[i - 2], y: +pathCoordinates[i - 1]},\n {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]},\n {x: +pathCoordinates[i + 2], y: +pathCoordinates[i + 3]},\n {x: +pathCoordinates[i + 4], y: +pathCoordinates[i + 5]}\n ];\n if (z) {\n if (!i) {\n p[0] = {x: +pathCoordinates[iLen - 2], y: +pathCoordinates[iLen - 1]};\n } else if (iLen - 4 === i) {\n p[3] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n } else if (iLen - 2 === i) {\n p[2] = {x: +pathCoordinates[0], y: +pathCoordinates[1]};\n p[3] = {x: +pathCoordinates[2], y: +pathCoordinates[3]};\n }\n } else {\n if (iLen - 4 === i) {\n p[3] = p[2];\n } else if (!i) {\n p[0] = {x: +pathCoordinates[i], y: +pathCoordinates[i + 1]};\n }\n }\n\n path.curve(\n (t * (-p[0].x + 6 * p[1].x + p[2].x) / 6) + (c * p[2].x),\n (t * (-p[0].y + 6 * p[1].y + p[2].y) / 6) + (c * p[2].y),\n (t * (p[1].x + 6 * p[2].x - p[3].x) / 6) + (c * p[2].x),\n (t * (p[1].y + 6 * p[2].y - p[3].y) / 6) + (c * p[2].y),\n p[2].x,\n p[2].y,\n false,\n valueData[(i + 2) / 2]\n );\n }\n\n return path;\n }\n };\n };\n\n /**\n * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.\n *\n * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.\n *\n * @example\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [[1, 2, 8, 1, 7]]\n * }, {\n * lineSmooth: Chartist.Interpolation.step({\n * postpone: true,\n * fillHoles: false\n * })\n * });\n *\n * @memberof Chartist.Interpolation\n * @param options\n * @returns {Function}\n */\n Chartist.Interpolation.step = function(options) {\n var defaultOptions = {\n postpone: true,\n fillHoles: false\n };\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function step(pathCoordinates, valueData) {\n var path = new Chartist.Svg.Path();\n\n var prevX, prevY, prevData;\n\n for (var i = 0; i < pathCoordinates.length; i += 2) {\n var currX = pathCoordinates[i];\n var currY = pathCoordinates[i + 1];\n var currData = valueData[i / 2];\n\n // If the current point is also not a hole we can draw the step lines\n if(currData.value !== undefined) {\n if(prevData === undefined) {\n path.move(currX, currY, false, currData);\n } else {\n if(options.postpone) {\n // If postponed we should draw the step line with the value of the previous value\n path.line(currX, prevY, false, prevData);\n } else {\n // If not postponed we should draw the step line with the value of the current value\n path.line(prevX, currY, false, currData);\n }\n // Line to the actual point (this should only be a Y-Axis movement\n path.line(currX, currY, false, currData);\n }\n\n prevX = currX;\n prevY = currY;\n prevData = currData;\n } else if(!options.fillHoles) {\n prevX = prevY = prevData = undefined;\n }\n }\n\n return path;\n };\n };\n\n}(window, document, Chartist));\n;/**\n * A very basic event module that helps to generate and catch events.\n *\n * @module Chartist.Event\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n Chartist.EventEmitter = function () {\n var handlers = [];\n\n /**\n * Add an event handler for a specific event\n *\n * @memberof Chartist.Event\n * @param {String} event The event name\n * @param {Function} handler A event handler function\n */\n function addEventHandler(event, handler) {\n handlers[event] = handlers[event] || [];\n handlers[event].push(handler);\n }\n\n /**\n * Remove an event handler of a specific event name or remove all event handlers for a specific event.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name where a specific or all handlers should be removed\n * @param {Function} [handler] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.\n */\n function removeEventHandler(event, handler) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n // If handler is set we will look for a specific handler and only remove this\n if(handler) {\n handlers[event].splice(handlers[event].indexOf(handler), 1);\n if(handlers[event].length === 0) {\n delete handlers[event];\n }\n } else {\n // If no handler is specified we remove all handlers for this event\n delete handlers[event];\n }\n }\n }\n\n /**\n * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.\n *\n * @memberof Chartist.Event\n * @param {String} event The event name that should be triggered\n * @param {*} data Arbitrary data that will be passed to the event handler callback functions\n */\n function emit(event, data) {\n // Only do something if there are event handlers with this name existing\n if(handlers[event]) {\n handlers[event].forEach(function(handler) {\n handler(data);\n });\n }\n\n // Emit event to star event handlers\n if(handlers['*']) {\n handlers['*'].forEach(function(starHandler) {\n starHandler(event, data);\n });\n }\n }\n\n return {\n addEventHandler: addEventHandler,\n removeEventHandler: removeEventHandler,\n emit: emit\n };\n };\n\n}(window, document, Chartist));\n;/**\n * This module provides some basic prototype inheritance utilities.\n *\n * @module Chartist.Class\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n function listToArray(list) {\n var arr = [];\n if (list.length) {\n for (var i = 0; i < list.length; i++) {\n arr.push(list[i]);\n }\n }\n return arr;\n }\n\n /**\n * Method to extend from current prototype.\n *\n * @memberof Chartist.Class\n * @param {Object} properties The object that serves as definition for the prototype that gets created for the new class. This object should always contain a constructor property that is the desired constructor for the newly created class.\n * @param {Object} [superProtoOverride] By default extens will use the current class prototype or Chartist.class. With this parameter you can specify any super prototype that will be used.\n * @return {Function} Constructor function of the new class\n *\n * @example\n * var Fruit = Class.extend({\n * color: undefined,\n * sugar: undefined,\n *\n * constructor: function(color, sugar) {\n * this.color = color;\n * this.sugar = sugar;\n * },\n *\n * eat: function() {\n * this.sugar = 0;\n * return this;\n * }\n * });\n *\n * var Banana = Fruit.extend({\n * length: undefined,\n *\n * constructor: function(length, sugar) {\n * Banana.super.constructor.call(this, 'Yellow', sugar);\n * this.length = length;\n * }\n * });\n *\n * var banana = new Banana(20, 40);\n * console.log('banana instanceof Fruit', banana instanceof Fruit);\n * console.log('Fruit is prototype of banana', Fruit.prototype.isPrototypeOf(banana));\n * console.log('bananas prototype is Fruit', Object.getPrototypeOf(banana) === Fruit.prototype);\n * console.log(banana.sugar);\n * console.log(banana.eat().sugar);\n * console.log(banana.color);\n */\n function extend(properties, superProtoOverride) {\n var superProto = superProtoOverride || this.prototype || Chartist.Class;\n var proto = Object.create(superProto);\n\n Chartist.Class.cloneDefinitions(proto, properties);\n\n var constr = function() {\n var fn = proto.constructor || function () {},\n instance;\n\n // If this is linked to the Chartist namespace the constructor was not called with new\n // To provide a fallback we will instantiate here and return the instance\n instance = this === Chartist ? Object.create(proto) : this;\n fn.apply(instance, Array.prototype.slice.call(arguments, 0));\n\n // If this constructor was not called with new we need to return the instance\n // This will not harm when the constructor has been called with new as the returned value is ignored\n return instance;\n };\n\n constr.prototype = proto;\n constr['super'] = superProto;\n constr.extend = this.extend;\n\n return constr;\n }\n\n // Variable argument list clones args > 0 into args[0] and retruns modified args[0]\n function cloneDefinitions() {\n var args = listToArray(arguments);\n var target = args[0];\n\n args.splice(1, args.length - 1).forEach(function (source) {\n Object.getOwnPropertyNames(source).forEach(function (propName) {\n // If this property already exist in target we delete it first\n delete target[propName];\n // Define the property with the descriptor from source\n Object.defineProperty(target, propName,\n Object.getOwnPropertyDescriptor(source, propName));\n });\n });\n\n return target;\n }\n\n Chartist.Class = {\n extend: extend,\n cloneDefinitions: cloneDefinitions\n };\n\n}(window, document, Chartist));\n;/**\n * Base for all chart types. The methods in Chartist.Base are inherited to all chart types.\n *\n * @module Chartist.Base\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n // TODO: Currently we need to re-draw the chart on window resize. This is usually very bad and will affect performance.\n // This is done because we can't work with relative coordinates when drawing the chart because SVG Path does not\n // work with relative positions yet. We need to check if we can do a viewBox hack to switch to percentage.\n // See http://mozilla.6506.n7.nabble.com/Specyfing-paths-with-percentages-unit-td247474.html\n // Update: can be done using the above method tested here: http://codepen.io/gionkunz/pen/KDvLj\n // The problem is with the label offsets that can't be converted into percentage and affecting the chart container\n /**\n * Updates the chart which currently does a full reconstruction of the SVG DOM\n *\n * @param {Object} [data] Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.\n * @param {Object} [options] Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.\n * @param {Boolean} [override] If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base\n * @memberof Chartist.Base\n */\n function update(data, options, override) {\n if(data) {\n this.data = data;\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'update',\n data: this.data\n });\n }\n\n if(options) {\n this.options = Chartist.extend({}, override ? this.options : this.defaultOptions, options);\n\n // If chartist was not initialized yet, we just set the options and leave the rest to the initialization\n // Otherwise we re-create the optionsProvider at this point\n if(!this.initializeTimeoutId) {\n this.optionsProvider.removeMediaQueryListeners();\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n }\n }\n\n // Only re-created the chart if it has been initialized yet\n if(!this.initializeTimeoutId) {\n this.createChart(this.optionsProvider.getCurrentOptions());\n }\n\n // Return a reference to the chart object to chain up calls\n return this;\n }\n\n /**\n * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.\n *\n * @memberof Chartist.Base\n */\n function detach() {\n // Only detach if initialization already occurred on this chart. If this chart still hasn't initialized (therefore\n // the initializationTimeoutId is still a valid timeout reference, we will clear the timeout\n if(!this.initializeTimeoutId) {\n window.removeEventListener('resize', this.resizeListener);\n this.optionsProvider.removeMediaQueryListeners();\n } else {\n window.clearTimeout(this.initializeTimeoutId);\n }\n\n return this;\n }\n\n /**\n * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event. Check the examples for supported events.\n * @param {Function} handler The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.\n */\n function on(event, handler) {\n this.eventEmitter.addEventHandler(event, handler);\n return this;\n }\n\n /**\n * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.\n *\n * @memberof Chartist.Base\n * @param {String} event Name of the event for which a handler should be removed\n * @param {Function} [handler] The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.\n */\n function off(event, handler) {\n this.eventEmitter.removeEventHandler(event, handler);\n return this;\n }\n\n function initialize() {\n // Add window resize listener that re-creates the chart\n window.addEventListener('resize', this.resizeListener);\n\n // Obtain current options based on matching media queries (if responsive options are given)\n // This will also register a listener that is re-creating the chart based on media changes\n this.optionsProvider = Chartist.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter);\n // Register options change listener that will trigger a chart update\n this.eventEmitter.addEventHandler('optionsChanged', function() {\n this.update();\n }.bind(this));\n\n // Before the first chart creation we need to register us with all plugins that are configured\n // Initialize all relevant plugins with our chart object and the plugin options specified in the config\n if(this.options.plugins) {\n this.options.plugins.forEach(function(plugin) {\n if(plugin instanceof Array) {\n plugin[0](this, plugin[1]);\n } else {\n plugin(this);\n }\n }.bind(this));\n }\n\n // Event for data transformation that allows to manipulate the data before it gets rendered in the charts\n this.eventEmitter.emit('data', {\n type: 'initial',\n data: this.data\n });\n\n // Create the first chart\n this.createChart(this.optionsProvider.getCurrentOptions());\n\n // As chart is initialized from the event loop now we can reset our timeout reference\n // This is important if the chart gets initialized on the same element twice\n this.initializeTimeoutId = undefined;\n }\n\n /**\n * Constructor of chart base class.\n *\n * @param query\n * @param data\n * @param defaultOptions\n * @param options\n * @param responsiveOptions\n * @constructor\n */\n function Base(query, data, defaultOptions, options, responsiveOptions) {\n this.container = Chartist.querySelector(query);\n this.data = data;\n this.defaultOptions = defaultOptions;\n this.options = options;\n this.responsiveOptions = responsiveOptions;\n this.eventEmitter = Chartist.EventEmitter();\n this.supportsForeignObject = Chartist.Svg.isSupported('Extensibility');\n this.supportsAnimations = Chartist.Svg.isSupported('AnimationEventsAttribute');\n this.resizeListener = function resizeListener(){\n this.update();\n }.bind(this);\n\n if(this.container) {\n // If chartist was already initialized in this container we are detaching all event listeners first\n if(this.container.__chartist__) {\n this.container.__chartist__.detach();\n }\n\n this.container.__chartist__ = this;\n }\n\n // Using event loop for first draw to make it possible to register event listeners in the same call stack where\n // the chart was created.\n this.initializeTimeoutId = setTimeout(initialize.bind(this), 0);\n }\n\n // Creating the chart base class\n Chartist.Base = Chartist.Class.extend({\n constructor: Base,\n optionsProvider: undefined,\n container: undefined,\n svg: undefined,\n eventEmitter: undefined,\n createChart: function() {\n throw new Error('Base chart type can\\'t be instantiated!');\n },\n update: update,\n detach: detach,\n on: on,\n off: off,\n version: Chartist.version,\n supportsForeignObject: false\n });\n\n}(window, document, Chartist));\n;/**\n * Chartist SVG module for simple SVG DOM abstraction\n *\n * @module Chartist.Svg\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.\n *\n * @memberof Chartist.Svg\n * @constructor\n * @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg\n * @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} className This class or class list will be added to the SVG element\n * @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child\n * @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n */\n function Svg(name, attributes, className, parent, insertFirst) {\n // If Svg is getting called with an SVG element we just return the wrapper\n if(name instanceof Element) {\n this._node = name;\n } else {\n this._node = document.createElementNS(Chartist.namespaces.svg, name);\n\n // If this is an SVG element created then custom namespace\n if(name === 'svg') {\n this.attr({\n 'xmlns:ct': Chartist.namespaces.ct\n });\n }\n }\n\n if(attributes) {\n this.attr(attributes);\n }\n\n if(className) {\n this.addClass(className);\n }\n\n if(parent) {\n if (insertFirst && parent._node.firstChild) {\n parent._node.insertBefore(this._node, parent._node.firstChild);\n } else {\n parent._node.appendChild(this._node);\n }\n }\n }\n\n /**\n * Set attributes on the current SVG element of the wrapper you're currently working on.\n *\n * @memberof Chartist.Svg\n * @param {Object|String} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.\n * @param {String} ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.\n * @return {Object|String} The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.\n */\n function attr(attributes, ns) {\n if(typeof attributes === 'string') {\n if(ns) {\n return this._node.getAttributeNS(ns, attributes);\n } else {\n return this._node.getAttribute(attributes);\n }\n }\n\n Object.keys(attributes).forEach(function(key) {\n // If the attribute value is undefined we can skip this one\n if(attributes[key] === undefined) {\n return;\n }\n\n if (key.indexOf(':') !== -1) {\n var namespacedAttribute = key.split(':');\n this._node.setAttributeNS(Chartist.namespaces[namespacedAttribute[0]], key, attributes[key]);\n } else {\n this._node.setAttribute(key, attributes[key]);\n }\n }.bind(this));\n\n return this;\n }\n\n /**\n * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.\n *\n * @memberof Chartist.Svg\n * @param {String} name The name of the SVG element that should be created as child element of the currently selected element wrapper\n * @param {Object} [attributes] An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper object that can be used to modify the containing SVG data\n */\n function elem(name, attributes, className, insertFirst) {\n return new Chartist.Svg(name, attributes, className, this, insertFirst);\n }\n\n /**\n * Returns the parent Chartist.SVG wrapper object\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} Returns a Chartist.Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.\n */\n function parent() {\n return this._node.parentNode instanceof SVGElement ? new Chartist.Svg(this._node.parentNode) : null;\n }\n\n /**\n * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The root SVG element wrapped in a Chartist.Svg element\n */\n function root() {\n var node = this._node;\n while(node.nodeName !== 'svg') {\n node = node.parentNode;\n }\n return new Chartist.Svg(node);\n }\n\n /**\n * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg} The SVG wrapper for the element found or null if no element was found\n */\n function querySelector(selector) {\n var foundNode = this._node.querySelector(selector);\n return foundNode ? new Chartist.Svg(foundNode) : null;\n }\n\n /**\n * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} selector A CSS selector that is used to query for child SVG elements\n * @return {Chartist.Svg.List} The SVG wrapper list for the element found or null if no element was found\n */\n function querySelectorAll(selector) {\n var foundNodes = this._node.querySelectorAll(selector);\n return foundNodes.length ? new Chartist.Svg.List(foundNodes) : null;\n }\n\n /**\n * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.\n *\n * @memberof Chartist.Svg\n * @param {Node|String} content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject\n * @param {String} [attributes] An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.\n * @param {String} [className] This class or class list will be added to the SVG element\n * @param {Boolean} [insertFirst] Specifies if the foreignObject should be inserted as first child\n * @return {Chartist.Svg} New wrapper object that wraps the foreignObject element\n */\n function foreignObject(content, attributes, className, insertFirst) {\n // If content is string then we convert it to DOM\n // TODO: Handle case where content is not a string nor a DOM Node\n if(typeof content === 'string') {\n var container = document.createElement('div');\n container.innerHTML = content;\n content = container.firstChild;\n }\n\n // Adding namespace to content element\n content.setAttribute('xmlns', Chartist.namespaces.xmlns);\n\n // Creating the foreignObject without required extension attribute (as described here\n // http://www.w3.org/TR/SVG/extend.html#ForeignObjectElement)\n var fnObj = this.elem('foreignObject', attributes, className, insertFirst);\n\n // Add content to foreignObjectElement\n fnObj._node.appendChild(content);\n\n return fnObj;\n }\n\n /**\n * This method adds a new text element to the current Chartist.Svg wrapper.\n *\n * @memberof Chartist.Svg\n * @param {String} t The text that should be added to the text element that is created\n * @return {Chartist.Svg} The same wrapper object that was used to add the newly created element\n */\n function text(t) {\n this._node.appendChild(document.createTextNode(t));\n return this;\n }\n\n /**\n * This method will clear all child nodes of the current wrapper object.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The same wrapper object that got emptied\n */\n function empty() {\n while (this._node.firstChild) {\n this._node.removeChild(this._node.firstChild);\n }\n\n return this;\n }\n\n /**\n * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The parent wrapper object of the element that got removed\n */\n function remove() {\n this._node.parentNode.removeChild(this._node);\n return this.parent();\n }\n\n /**\n * This method will replace the element with a new element that can be created outside of the current DOM.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} newElement The new Chartist.Svg object that will be used to replace the current wrapper object\n * @return {Chartist.Svg} The wrapper of the new element\n */\n function replace(newElement) {\n this._node.parentNode.replaceChild(newElement._node, this._node);\n return newElement;\n }\n\n /**\n * This method will append an element to the current element as a child.\n *\n * @memberof Chartist.Svg\n * @param {Chartist.Svg} element The Chartist.Svg element that should be added as a child\n * @param {Boolean} [insertFirst] Specifies if the element should be inserted as first child\n * @return {Chartist.Svg} The wrapper of the appended object\n */\n function append(element, insertFirst) {\n if(insertFirst && this._node.firstChild) {\n this._node.insertBefore(element._node, this._node.firstChild);\n } else {\n this._node.appendChild(element._node);\n }\n\n return this;\n }\n\n /**\n * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.\n *\n * @memberof Chartist.Svg\n * @return {Array} A list of classes or an empty array if there are no classes on the current element\n */\n function classes() {\n return this._node.getAttribute('class') ? this._node.getAttribute('class').trim().split(/\\s+/) : [];\n }\n\n /**\n * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function addClass(names) {\n this._node.setAttribute('class',\n this.classes(this._node)\n .concat(names.trim().split(/\\s+/))\n .filter(function(elem, pos, self) {\n return self.indexOf(elem) === pos;\n }).join(' ')\n );\n\n return this;\n }\n\n /**\n * Removes one or a space separated list of classes from the current element.\n *\n * @memberof Chartist.Svg\n * @param {String} names A white space separated list of class names\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeClass(names) {\n var removedClasses = names.trim().split(/\\s+/);\n\n this._node.setAttribute('class', this.classes(this._node).filter(function(name) {\n return removedClasses.indexOf(name) === -1;\n }).join(' '));\n\n return this;\n }\n\n /**\n * Removes all classes from the current element.\n *\n * @memberof Chartist.Svg\n * @return {Chartist.Svg} The wrapper of the current element\n */\n function removeAllClasses() {\n this._node.setAttribute('class', '');\n\n return this;\n }\n\n /**\n * Get element height using `getBoundingClientRect`\n *\n * @memberof Chartist.Svg\n * @return {Number} The elements height in pixels\n */\n function height() {\n return this._node.getBoundingClientRect().height;\n }\n\n /**\n * Get element width using `getBoundingClientRect`\n *\n * @memberof Chartist.Core\n * @return {Number} The elements width in pixels\n */\n function width() {\n return this._node.getBoundingClientRect().width;\n }\n\n /**\n * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Chartist.Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.\n * **An animations object could look like this:**\n * ```javascript\n * element.animate({\n * opacity: {\n * dur: 1000,\n * from: 0,\n * to: 1\n * },\n * x1: {\n * dur: '1000ms',\n * from: 100,\n * to: 200,\n * easing: 'easeOutQuart'\n * },\n * y1: {\n * dur: '2s',\n * from: 0,\n * to: 100\n * }\n * });\n * ```\n * **Automatic unit conversion**\n * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.\n * **Guided mode**\n * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill=\"freeze\"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Chartist.Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.\n * If guided mode is enabled the following behavior is added:\n * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation\n * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)\n * - The animate element will be forced to use `fill=\"freeze\"`\n * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.\n * - After the animation the element attribute value will be set to the `to` value of the animation\n * - The animate element is deleted from the DOM\n *\n * @memberof Chartist.Svg\n * @param {Object} animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.\n * @param {Boolean} guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.\n * @param {Object} eventEmitter If specified, this event emitter will be notified when an animation starts or ends.\n * @return {Chartist.Svg} The current element where the animation was added\n */\n function animate(animations, guided, eventEmitter) {\n if(guided === undefined) {\n guided = true;\n }\n\n Object.keys(animations).forEach(function createAnimateForAttributes(attribute) {\n\n function createAnimate(animationDefinition, guided) {\n var attributeProperties = {},\n animate,\n timeout,\n easing;\n\n // Check if an easing is specified in the definition object and delete it from the object as it will not\n // be part of the animate element attributes.\n if(animationDefinition.easing) {\n // If already an easing Bézier curve array we take it or we lookup a easing array in the Easing object\n easing = animationDefinition.easing instanceof Array ?\n animationDefinition.easing :\n Chartist.Svg.Easing[animationDefinition.easing];\n delete animationDefinition.easing;\n }\n\n // If numeric dur or begin was provided we assume milli seconds\n animationDefinition.begin = Chartist.ensureUnit(animationDefinition.begin, 'ms');\n animationDefinition.dur = Chartist.ensureUnit(animationDefinition.dur, 'ms');\n\n if(easing) {\n animationDefinition.calcMode = 'spline';\n animationDefinition.keySplines = easing.join(' ');\n animationDefinition.keyTimes = '0;1';\n }\n\n // Adding \"fill: freeze\" if we are in guided mode and set initial attribute values\n if(guided) {\n animationDefinition.fill = 'freeze';\n // Animated property on our element should already be set to the animation from value in guided mode\n attributeProperties[attribute] = animationDefinition.from;\n this.attr(attributeProperties);\n\n // In guided mode we also set begin to indefinite so we can trigger the start manually and put the begin\n // which needs to be in ms aside\n timeout = Chartist.quantity(animationDefinition.begin || 0).value;\n animationDefinition.begin = 'indefinite';\n }\n\n animate = this.elem('animate', Chartist.extend({\n attributeName: attribute\n }, animationDefinition));\n\n if(guided) {\n // If guided we take the value that was put aside in timeout and trigger the animation manually with a timeout\n setTimeout(function() {\n // If beginElement fails we set the animated attribute to the end position and remove the animate element\n // This happens if the SMIL ElementTimeControl interface is not supported or any other problems occured in\n // the browser. (Currently FF 34 does not support animate elements in foreignObjects)\n try {\n animate._node.beginElement();\n } catch(err) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this), timeout);\n }\n\n if(eventEmitter) {\n animate._node.addEventListener('beginEvent', function handleBeginEvent() {\n eventEmitter.emit('animationBegin', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }.bind(this));\n }\n\n animate._node.addEventListener('endEvent', function handleEndEvent() {\n if(eventEmitter) {\n eventEmitter.emit('animationEnd', {\n element: this,\n animate: animate._node,\n params: animationDefinition\n });\n }\n\n if(guided) {\n // Set animated attribute to current animated value\n attributeProperties[attribute] = animationDefinition.to;\n this.attr(attributeProperties);\n // Remove the animate element as it's no longer required\n animate.remove();\n }\n }.bind(this));\n }\n\n // If current attribute is an array of definition objects we create an animate for each and disable guided mode\n if(animations[attribute] instanceof Array) {\n animations[attribute].forEach(function(animationDefinition) {\n createAnimate.bind(this)(animationDefinition, false);\n }.bind(this));\n } else {\n createAnimate.bind(this)(animations[attribute], guided);\n }\n\n }.bind(this));\n\n return this;\n }\n\n Chartist.Svg = Chartist.Class.extend({\n constructor: Svg,\n attr: attr,\n elem: elem,\n parent: parent,\n root: root,\n querySelector: querySelector,\n querySelectorAll: querySelectorAll,\n foreignObject: foreignObject,\n text: text,\n empty: empty,\n remove: remove,\n replace: replace,\n append: append,\n classes: classes,\n addClass: addClass,\n removeClass: removeClass,\n removeAllClasses: removeAllClasses,\n height: height,\n width: width,\n animate: animate\n });\n\n /**\n * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.\n *\n * @memberof Chartist.Svg\n * @param {String} feature The SVG 1.1 feature that should be checked for support.\n * @return {Boolean} True of false if the feature is supported or not\n */\n Chartist.Svg.isSupported = function(feature) {\n return document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#' + feature, '1.1');\n };\n\n /**\n * This Object contains some standard easing cubic bezier curves. Then can be used with their name in the `Chartist.Svg.animate`. You can also extend the list and use your own name in the `animate` function. Click the show code button to see the available bezier functions.\n *\n * @memberof Chartist.Svg\n */\n var easingCubicBeziers = {\n easeInSine: [0.47, 0, 0.745, 0.715],\n easeOutSine: [0.39, 0.575, 0.565, 1],\n easeInOutSine: [0.445, 0.05, 0.55, 0.95],\n easeInQuad: [0.55, 0.085, 0.68, 0.53],\n easeOutQuad: [0.25, 0.46, 0.45, 0.94],\n easeInOutQuad: [0.455, 0.03, 0.515, 0.955],\n easeInCubic: [0.55, 0.055, 0.675, 0.19],\n easeOutCubic: [0.215, 0.61, 0.355, 1],\n easeInOutCubic: [0.645, 0.045, 0.355, 1],\n easeInQuart: [0.895, 0.03, 0.685, 0.22],\n easeOutQuart: [0.165, 0.84, 0.44, 1],\n easeInOutQuart: [0.77, 0, 0.175, 1],\n easeInQuint: [0.755, 0.05, 0.855, 0.06],\n easeOutQuint: [0.23, 1, 0.32, 1],\n easeInOutQuint: [0.86, 0, 0.07, 1],\n easeInExpo: [0.95, 0.05, 0.795, 0.035],\n easeOutExpo: [0.19, 1, 0.22, 1],\n easeInOutExpo: [1, 0, 0, 1],\n easeInCirc: [0.6, 0.04, 0.98, 0.335],\n easeOutCirc: [0.075, 0.82, 0.165, 1],\n easeInOutCirc: [0.785, 0.135, 0.15, 0.86],\n easeInBack: [0.6, -0.28, 0.735, 0.045],\n easeOutBack: [0.175, 0.885, 0.32, 1.275],\n easeInOutBack: [0.68, -0.55, 0.265, 1.55]\n };\n\n Chartist.Svg.Easing = easingCubicBeziers;\n\n /**\n * This helper class is to wrap multiple `Chartist.Svg` elements into a list where you can call the `Chartist.Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Chartist.Svg` on multiple elements.\n * An instance of this class is also returned by `Chartist.Svg.querySelectorAll`.\n *\n * @memberof Chartist.Svg\n * @param {Array|NodeList} nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)\n * @constructor\n */\n function SvgList(nodeList) {\n var list = this;\n\n this.svgElements = [];\n for(var i = 0; i < nodeList.length; i++) {\n this.svgElements.push(new Chartist.Svg(nodeList[i]));\n }\n\n // Add delegation methods for Chartist.Svg\n Object.keys(Chartist.Svg.prototype).filter(function(prototypeProperty) {\n return ['constructor',\n 'parent',\n 'querySelector',\n 'querySelectorAll',\n 'replace',\n 'append',\n 'classes',\n 'height',\n 'width'].indexOf(prototypeProperty) === -1;\n }).forEach(function(prototypeProperty) {\n list[prototypeProperty] = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n list.svgElements.forEach(function(element) {\n Chartist.Svg.prototype[prototypeProperty].apply(element, args);\n });\n return list;\n };\n });\n }\n\n Chartist.Svg.List = Chartist.Class.extend({\n constructor: SvgList\n });\n}(window, document, Chartist));\n;/**\n * Chartist SVG path module for SVG path description creation and modification.\n *\n * @module Chartist.Svg.Path\n */\n/* global Chartist */\n(function(window, document, Chartist) {\n 'use strict';\n\n /**\n * Contains the descriptors of supported element types in a SVG path. Currently only move, line and curve are supported.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var elementDescriptions = {\n m: ['x', 'y'],\n l: ['x', 'y'],\n c: ['x1', 'y1', 'x2', 'y2', 'x', 'y'],\n a: ['rx', 'ry', 'xAr', 'lAf', 'sf', 'x', 'y']\n };\n\n /**\n * Default options for newly created SVG path objects.\n *\n * @memberof Chartist.Svg.Path\n * @type {Object}\n */\n var defaultOptions = {\n // The accuracy in digit count after the decimal point. This will be used to round numbers in the SVG path. If this option is set to false then no rounding will be performed.\n accuracy: 3\n };\n\n function element(command, params, pathElements, pos, relative, data) {\n var pathElement = Chartist.extend({\n command: relative ? command.toLowerCase() : command.toUpperCase()\n }, params, data ? { data: data } : {} );\n\n pathElements.splice(pos, 0, pathElement);\n }\n\n function forEachParam(pathElements, cb) {\n pathElements.forEach(function(pathElement, pathElementIndex) {\n elementDescriptions[pathElement.command.toLowerCase()].forEach(function(paramName, paramIndex) {\n cb(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n });\n });\n }\n\n /**\n * Used to construct a new path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} close If set to true then this path will be closed when stringified (with a Z at the end)\n * @param {Object} options Options object that overrides the default objects. See default options for more details.\n * @constructor\n */\n function SvgPath(close, options) {\n this.pathElements = [];\n this.pos = 0;\n this.close = close;\n this.options = Chartist.extend({}, defaultOptions, options);\n }\n\n /**\n * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} [pos] If a number is passed then the cursor is set to this position in the path element array.\n * @return {Chartist.Svg.Path|Number} If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.\n */\n function position(pos) {\n if(pos !== undefined) {\n this.pos = Math.max(0, Math.min(this.pathElements.length, pos));\n return this;\n } else {\n return this.pos;\n }\n }\n\n /**\n * Removes elements from the path starting at the current position.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} count Number of path elements that should be removed from the current position.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function remove(count) {\n this.pathElements.splice(this.pos, count);\n return this;\n }\n\n /**\n * Use this function to add a new move SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the move element.\n * @param {Number} y The y coordinate for the move element.\n * @param {Boolean} [relative] If set to true the move element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function move(x, y, relative, data) {\n element('M', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new line SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The x coordinate for the line element.\n * @param {Number} y The y coordinate for the line element.\n * @param {Boolean} [relative] If set to true the line element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function line(x, y, relative, data) {\n element('L', {\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x1 The x coordinate for the first control point of the bezier curve.\n * @param {Number} y1 The y coordinate for the first control point of the bezier curve.\n * @param {Number} x2 The x coordinate for the second control point of the bezier curve.\n * @param {Number} y2 The y coordinate for the second control point of the bezier curve.\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function curve(x1, y1, x2, y2, x, y, relative, data) {\n element('C', {\n x1: +x1,\n y1: +y1,\n x2: +x2,\n y2: +y2,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Use this function to add a new non-bezier curve SVG path element.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} rx The radius to be used for the x-axis of the arc.\n * @param {Number} ry The radius to be used for the y-axis of the arc.\n * @param {Number} xAr Defines the orientation of the arc\n * @param {Number} lAf Large arc flag\n * @param {Number} sf Sweep flag\n * @param {Number} x The x coordinate for the target point of the curve element.\n * @param {Number} y The y coordinate for the target point of the curve element.\n * @param {Boolean} [relative] If set to true the curve element will be created with relative coordinates (lowercase letter)\n * @param {*} [data] Any data that should be stored with the element object that will be accessible in pathElement\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function arc(rx, ry, xAr, lAf, sf, x, y, relative, data) {\n element('A', {\n rx: +rx,\n ry: +ry,\n xAr: +xAr,\n lAf: +lAf,\n sf: +sf,\n x: +x,\n y: +y\n }, this.pathElements, this.pos++, relative, data);\n return this;\n }\n\n /**\n * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} path Any SVG path that contains move (m), line (l) or curve (c) components.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function parse(path) {\n // Parsing the SVG path string into an array of arrays [['M', '10', '10'], ['L', '100', '100']]\n var chunks = path.replace(/([A-Za-z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([A-Za-z])/g, '$1 $2')\n .split(/[\\s,]+/)\n .reduce(function(result, element) {\n if(element.match(/[A-Za-z]/)) {\n result.push([]);\n }\n\n result[result.length - 1].push(element);\n return result;\n }, []);\n\n // If this is a closed path we remove the Z at the end because this is determined by the close option\n if(chunks[chunks.length - 1][0].toUpperCase() === 'Z') {\n chunks.pop();\n }\n\n // Using svgPathElementDescriptions to map raw path arrays into objects that contain the command and the parameters\n // For example {command: 'M', x: '10', y: '10'}\n var elements = chunks.map(function(chunk) {\n var command = chunk.shift(),\n description = elementDescriptions[command.toLowerCase()];\n\n return Chartist.extend({\n command: command\n }, description.reduce(function(result, paramName, index) {\n result[paramName] = +chunk[index];\n return result;\n }, {}));\n });\n\n // Preparing a splice call with the elements array as var arg params and insert the parsed elements at the current position\n var spliceArgs = [this.pos, 0];\n Array.prototype.push.apply(spliceArgs, elements);\n Array.prototype.splice.apply(this.pathElements, spliceArgs);\n // Increase the internal position by the element count\n this.pos += elements.length;\n\n return this;\n }\n\n /**\n * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.\n *\n * @memberof Chartist.Svg.Path\n * @return {String}\n */\n function stringify() {\n var accuracyMultiplier = Math.pow(10, this.options.accuracy);\n\n return this.pathElements.reduce(function(path, pathElement) {\n var params = elementDescriptions[pathElement.command.toLowerCase()].map(function(paramName) {\n return this.options.accuracy ?\n (Math.round(pathElement[paramName] * accuracyMultiplier) / accuracyMultiplier) :\n pathElement[paramName];\n }.bind(this));\n\n return path + pathElement.command + params.join(',');\n }.bind(this), '') + (this.close ? 'Z' : '');\n }\n\n /**\n * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to scale the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to scale the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function scale(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] *= paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Number} x The number which will be used to translate the x, x1 and x2 of all path elements.\n * @param {Number} y The number which will be used to translate the y, y1 and y2 of all path elements.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function translate(x, y) {\n forEachParam(this.pathElements, function(pathElement, paramName) {\n pathElement[paramName] += paramName[0] === 'x' ? x : y;\n });\n return this;\n }\n\n /**\n * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.\n * The method signature of the callback function looks like this:\n * ```javascript\n * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)\n * ```\n * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.\n *\n * @memberof Chartist.Svg.Path\n * @param {Function} transformFnc The callback function for the transformation. Check the signature in the function description.\n * @return {Chartist.Svg.Path} The current path object for easy call chaining.\n */\n function transform(transformFnc) {\n forEachParam(this.pathElements, function(pathElement, paramName, pathElementIndex, paramIndex, pathElements) {\n var transformed = transformFnc(pathElement, paramName, pathElementIndex, paramIndex, pathElements);\n if(transformed || transformed === 0) {\n pathElement[paramName] = transformed;\n }\n });\n return this;\n }\n\n /**\n * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.\n *\n * @memberof Chartist.Svg.Path\n * @param {Boolean} [close] Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.\n * @return {Chartist.Svg.Path}\n */\n function clone(close) {\n var c = new Chartist.Svg.Path(close || this.close);\n c.pos = this.pos;\n c.pathElements = this.pathElements.slice().map(function cloneElements(pathElement) {\n return Chartist.extend({}, pathElement);\n });\n c.options = Chartist.extend({}, this.options);\n return c;\n }\n\n /**\n * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.\n *\n * @memberof Chartist.Svg.Path\n * @param {String} command The command you'd like to use to split the path\n * @return {Array}\n */\n function splitByCommand(command) {\n var split = [\n new Chartist.Svg.Path()\n ];\n\n this.pathElements.forEach(function(pathElement) {\n if(pathElement.command === command.toUpperCase() && split[split.length - 1].pathElements.length !== 0) {\n split.push(new Chartist.Svg.Path());\n }\n\n split[split.length - 1].pathElements.push(pathElement);\n });\n\n return split;\n }\n\n /**\n * This static function on `Chartist.Svg.Path` is joining multiple paths together into one paths.\n *\n * @memberof Chartist.Svg.Path\n * @param {Array} paths A list of paths to be joined together. The order is important.\n * @param {boolean} close If the newly created path should be a closed path\n * @param {Object} options Path options for the newly created path.\n * @return {Chartist.Svg.Path}\n */\n\n function join(paths, close, options) {\n var joinedPath = new Chartist.Svg.Path(close, options);\n for(var i = 0; i < paths.length; i++) {\n var path = paths[i];\n for(var j = 0; j < path.pathElements.length; j++) {\n joinedPath.pathElements.push(path.pathElements[j]);\n }\n }\n return joinedPath;\n }\n\n Chartist.Svg.Path = Chartist.Class.extend({\n constructor: SvgPath,\n position: position,\n remove: remove,\n move: move,\n line: line,\n curve: curve,\n arc: arc,\n scale: scale,\n translate: translate,\n transform: transform,\n parse: parse,\n stringify: stringify,\n clone: clone,\n splitByCommand: splitByCommand\n });\n\n Chartist.Svg.Path.elementDescriptions = elementDescriptions;\n Chartist.Svg.Path.join = join;\n}(window, document, Chartist));\n;/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n var axisUnits = {\n x: {\n pos: 'x',\n len: 'width',\n dir: 'horizontal',\n rectStart: 'x1',\n rectEnd: 'x2',\n rectOffset: 'y2'\n },\n y: {\n pos: 'y',\n len: 'height',\n dir: 'vertical',\n rectStart: 'y2',\n rectEnd: 'y1',\n rectOffset: 'x1'\n }\n };\n\n function Axis(units, chartRect, ticks, options) {\n this.units = units;\n this.counterUnits = units === axisUnits.x ? axisUnits.y : axisUnits.x;\n this.chartRect = chartRect;\n this.axisLength = chartRect[units.rectEnd] - chartRect[units.rectStart];\n this.gridOffset = chartRect[units.rectOffset];\n this.ticks = ticks;\n this.options = options;\n }\n\n function createGridAndLabels(gridGroup, labelGroup, useForeignObject, chartOptions, eventEmitter) {\n var axisOptions = chartOptions['axis' + this.units.pos.toUpperCase()];\n var projectedValues = this.ticks.map(this.projectValue.bind(this));\n var labelValues = this.ticks.map(axisOptions.labelInterpolationFnc);\n\n\tvar lastWidth=undefined;\n projectedValues.forEach(function(projectedValue, index) {\n var labelOffset = {\n x: 0,\n y: 0\n };\n\n // TODO: Find better solution for solving this problem\n // Calculate how much space we have available for the label\n var labelLength=0;/*\n if(projectedValues[index + 1]) {\n // If we still have one label ahead, we can calculate the distance to the next tick / label\n labelLength = projectedValues[index + 1] - projectedValue;\n\t\t lastWidth = labelLength;\n } else if (typeof lastWidth != 'undefined') {\n\t\t labelLength = lastWidth; // EDIT. added the lastWidth thing\n\t }\n\t // else {\n // // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to\n // // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will\n // // still be visible inside of the chart padding.\n // labelLength = Math.max(this.axisLength - projectedValue, 30);\n // }\n\t\t*/\n\n // Skip grid lines and labels where interpolated label values are falsey (execpt for 0)\n if(Chartist.isFalseyButZero(labelValues[index]) && labelValues[index] !== '') {\n return;\n }\n\n // Transform to global coordinates using the chartRect\n // We also need to set the label offset for the createLabel function\n if(this.units.pos === 'x') {\n projectedValue = this.chartRect.x1 + projectedValue;\n labelOffset.x = chartOptions.axisX.labelOffset.x;\n\n // If the labels should be positioned in start position (top side for vertical axis) we need to set a\n // different offset as for positioned with end (bottom)\n if(chartOptions.axisX.position === 'start') {\n labelOffset.y = this.chartRect.padding.top + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n } else {\n labelOffset.y = this.chartRect.y1 + chartOptions.axisX.labelOffset.y + (useForeignObject ? 5 : 20);\n }\n } else {\n projectedValue = this.chartRect.y1 - projectedValue;\n labelOffset.y = chartOptions.axisY.labelOffset.y - (useForeignObject ? labelLength : 0);\n\n // If the labels should be positioned in start position (left side for horizontal axis) we need to set a\n // different offset as for positioned with end (right side)\n if(chartOptions.axisY.position === 'start') {\n labelOffset.x = useForeignObject ? this.chartRect.padding.left + chartOptions.axisY.labelOffset.x : this.chartRect.x1 - 10;\n } else {\n labelOffset.x = this.chartRect.x2 + chartOptions.axisY.labelOffset.x + 10;\n }\n }\n\n if(axisOptions.showGrid) {\n Chartist.createGrid(projectedValue, index, this, this.gridOffset, this.chartRect[this.counterUnits.len](), gridGroup, [\n chartOptions.classNames.grid,\n chartOptions.classNames[this.units.dir]\n ], eventEmitter);\n }\n\n if(axisOptions.showLabel) {\n Chartist.createLabel(projectedValue, labelLength, index, labelValues, this, axisOptions.offset, labelOffset, labelGroup, [\n chartOptions.classNames.label,\n chartOptions.classNames[this.units.dir],\n chartOptions.classNames[axisOptions.position]\n ], useForeignObject, eventEmitter);\n }\n }.bind(this));\n }\n\n Chartist.Axis = Chartist.Class.extend({\n constructor: Axis,\n createGridAndLabels: createGridAndLabels,\n projectValue: function(value, index, data) {\n throw new Error('Base axis can\\'t be instantiated!');\n }\n });\n\n Chartist.Axis.units = axisUnits;\n\n}(window, document, Chartist));\n;/**\n * The auto scale axis uses standard linear scale projection of values along an axis. It uses order of magnitude to find a scale automatically and evaluates the available space in order to find the perfect amount of ticks for your chart.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // This option will be used when finding the right scale division settings. The amount of ticks on the scale will be determined so that as many ticks as possible will be displayed, while not violating this minimum required space (in pixel).\n * scaleMinSpace: 20,\n * // Can be set to true or false. If set to true, the scale will be generated with whole numbers only.\n * onlyInteger: true,\n * // The reference value can be used to make sure that this value will always be on the chart. This is especially useful on bipolar charts where the bipolar center always needs to be part of the chart.\n * referenceValue: 5\n * };\n * ```\n *\n * @module Chartist.AutoScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function AutoScaleAxis(axisUnit, data, chartRect, options) {\n // Usually we calculate highLow based on the data but this can be overriden by a highLow object in the options\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.bounds = Chartist.getBounds(chartRect[axisUnit.rectEnd] - chartRect[axisUnit.rectStart], highLow, options.scaleMinSpace || 20, options.onlyInteger);\n this.range = {\n min: this.bounds.min,\n max: this.bounds.max\n };\n\n Chartist.AutoScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.bounds.values,\n options);\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.bounds.min) / this.bounds.range;\n }\n\n Chartist.AutoScaleAxis = Chartist.Axis.extend({\n constructor: AutoScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The fixed scale axis uses standard linear projection of values along an axis. It makes use of a divisor option to divide the range provided from the minimum and maximum value or the options high and low that will override the computed minimum and maximum.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // If high is specified then the axis will display values explicitly up to this value and the computed maximum from the data is ignored\n * high: 100,\n * // If low is specified then the axis will display values explicitly down to this value and the computed minimum from the data is ignored\n * low: 0,\n * // If specified then the value range determined from minimum to maximum (or low and high) will be divided by this number and ticks will be generated at those division points. The default divisor is 1.\n * divisor: 4,\n * // If ticks is explicitly set, then the axis will not compute the ticks with the divisor, but directly use the data in ticks to determine at what points on the axis a tick need to be generated.\n * ticks: [1, 10, 20, 30]\n * };\n * ```\n *\n * @module Chartist.FixedScaleAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function FixedScaleAxis(axisUnit, data, chartRect, options) {\n var highLow = options.highLow || Chartist.getHighLow(data.normalized, options, axisUnit.pos);\n this.divisor = options.divisor || 1;\n this.ticks = options.ticks || Chartist.times(this.divisor).map(function(value, index) {\n return highLow.low + (highLow.high - highLow.low) / this.divisor * index;\n }.bind(this));\n this.ticks.sort(function(a, b) {\n return a - b;\n });\n this.range = {\n min: highLow.low,\n max: highLow.high\n };\n\n Chartist.FixedScaleAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n this.ticks,\n options);\n\n this.stepLength = this.axisLength / this.divisor;\n }\n\n function projectValue(value) {\n return this.axisLength * (+Chartist.getMultiValue(value, this.units.pos) - this.range.min) / (this.range.max - this.range.min);\n }\n\n Chartist.FixedScaleAxis = Chartist.Axis.extend({\n constructor: FixedScaleAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The step axis for step based charts like bar chart or step based line charts. It uses a fixed amount of ticks that will be equally distributed across the whole axis length. The projection is done using the index of the data value rather than the value itself and therefore it's only useful for distribution purpose.\n * **Options**\n * The following options are used by this axis in addition to the default axis options outlined in the axis configuration of the chart default settings.\n * ```javascript\n * var options = {\n * // Ticks to be used to distribute across the axis length. As this axis type relies on the index of the value rather than the value, arbitrary data that can be converted to a string can be used as ticks.\n * ticks: ['One', 'Two', 'Three'],\n * // If set to true the full width will be used to distribute the values where the last value will be at the maximum of the axis length. If false the spaces between the ticks will be evenly distributed instead.\n * stretch: true\n * };\n * ```\n *\n * @module Chartist.StepAxis\n */\n/* global Chartist */\n(function (window, document, Chartist) {\n 'use strict';\n\n function StepAxis(axisUnit, data, chartRect, options) {\n Chartist.StepAxis['super'].constructor.call(this,\n axisUnit,\n chartRect,\n options.ticks,\n options);\n\n this.stepLength = this.axisLength / (options.ticks.length - (options.stretch ? 1 : 0));\n }\n\n function projectValue(value, index) {\n return this.stepLength * index;\n }\n\n Chartist.StepAxis = Chartist.Axis.extend({\n constructor: StepAxis,\n projectValue: projectValue\n });\n\n}(window, document, Chartist));\n;/**\n * The Chartist line chart can be used to draw Line or Scatter charts. If used in the browser you can access the global `Chartist` namespace where you find the `Line` function as a main entry point.\n *\n * For examples on how to use the line chart please check the examples of the `Chartist.Line` method.\n *\n * @module Chartist.Line\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in line charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Line\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the labels to the chart area\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the labels to the chart area\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // Set the axis type to be used to project values on this axis. If not defined, Chartist.AutoScaleAxis will be used for the Y-Axis, where the high and low options will be set to the global high and low options. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.\n type: undefined,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // If the line should be drawn or not\n showLine: true,\n // If dots should be drawn or not\n showPoint: true,\n // If the line chart should draw an area\n showArea: false,\n // The base for the area chart that will be used to close the area shape (is normally 0)\n areaBase: 0,\n // Specify if the lines should be smoothed. This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none. You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function. Check the examples for a brief description.\n lineSmooth: true,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.\n fullWidth: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-line',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n line: 'ct-line',\n point: 'ct-point',\n area: 'ct-area',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: Chartist.getDataArray(this.data, options.reverseData, true)\n };\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.raw.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNum(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNum(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': pathElement.data.meta\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new line chart.\n *\n * @memberof Chartist.Line\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple line chart\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // As options we currently only set a static size of 300x200 px\n * var options = {\n * width: '300px',\n * height: '200px'\n * };\n *\n * // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options\n * new Chartist.Line('.ct-chart', data, options);\n *\n * @example\n * // Use specific interpolation function with configuration from the Chartist.Interpolation module\n *\n * var chart = new Chartist.Line('.ct-chart', {\n * labels: [1, 2, 3, 4, 5],\n * series: [\n * [1, 1, 8, 1, 7]\n * ]\n * }, {\n * lineSmooth: Chartist.Interpolation.cardinal({\n * tension: 0.2\n * })\n * });\n *\n * @example\n * // Create a line chart with responsive options\n *\n * var data = {\n * // A labels array that can contain any sort of values\n * labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],\n * // Our series array that contains series objects or in this case series data arrays\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.\n * var responsiveOptions = [\n * ['screen and (min-width: 641px) and (max-width: 1024px)', {\n * showPoint: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return Mon, Tue, Wed etc. on medium screens\n * return value.slice(0, 3);\n * }\n * }\n * }],\n * ['screen and (max-width: 640px)', {\n * showLine: false,\n * axisX: {\n * labelInterpolationFnc: function(value) {\n * // Will return M, T, W etc. on small screens\n * return value[0];\n * }\n * }\n * }]\n * ];\n *\n * new Chartist.Line('.ct-chart', data, null, responsiveOptions);\n *\n */\n function Line(query, data, options, responsiveOptions) {\n Chartist.Line['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating line chart type in Chartist namespace\n Chartist.Line = Chartist.Base.extend({\n constructor: Line,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;/**\n * The bar chart module of Chartist that can be used to draw unipolar or bipolar bar and grouped bar charts.\n *\n * @module Chartist.Bar\n */\n/* global Chartist */\n(function(window, document, Chartist){\n 'use strict';\n\n /**\n * Default options in bar charts. Expand the code view to see a detailed list of options with comments.\n *\n * @memberof Chartist.Bar\n */\n var defaultOptions = {\n // Options for X-Axis\n axisX: {\n // The offset of the chart drawing area to the border of the container\n offset: 30,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'end',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum width in pixel of the scale steps\n scaleMinSpace: 30,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Options for Y-Axis\n axisY: {\n // The offset of the chart drawing area to the border of the container\n offset: 40,\n // Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.\n position: 'start',\n // Allows you to correct label positioning on this axis by positive or negative x and y offset.\n labelOffset: {\n x: 0,\n y: 0\n },\n // If labels should be shown or not\n showLabel: true,\n // If the axis grid should be drawn or not\n showGrid: true,\n // Interpolation function that allows you to intercept the value from the axis label\n labelInterpolationFnc: Chartist.noop,\n // This value specifies the minimum height in pixel of the scale steps\n scaleMinSpace: 20,\n // Use only integer values (whole numbers) for the scale steps\n onlyInteger: false\n },\n // Specify a fixed width for the chart as a string (i.e. '100px' or '50%')\n width: undefined,\n // Specify a fixed height for the chart as a string (i.e. '100px' or '50%')\n height: undefined,\n // Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value\n high: undefined,\n // Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value\n low: undefined,\n // Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}\n chartPadding: {\n top: 15,\n right: 15,\n bottom: 5,\n left: 10\n },\n // Specify the distance in pixel of bars in a group\n seriesBarDistance: 15,\n // If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.\n stackBars: false,\n // If set to 'overlap' this property will force the stacked bars to draw from the zero line.\n // If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.\n stackMode: 'accumulate',\n // Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.\n horizontalBars: false,\n // If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.\n distributeSeries: false,\n // If true the whole data is reversed including labels, the series order as well as the whole series data arrays.\n reverseData: false,\n // Override the class names that get used to generate the SVG structure of the chart\n classNames: {\n chart: 'ct-chart-bar',\n horizontalBars: 'ct-horizontal-bars',\n label: 'ct-label',\n labelGroup: 'ct-labels',\n series: 'ct-series',\n bar: 'ct-bar',\n grid: 'ct-grid',\n gridGroup: 'ct-grids',\n vertical: 'ct-vertical',\n horizontal: 'ct-horizontal',\n start: 'ct-start',\n end: 'ct-end'\n }\n };\n\n /**\n * Creates a new chart\n *\n */\n function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }\n\n /**\n * This method creates a new bar chart and returns API object that you can use for later changes.\n *\n * @memberof Chartist.Bar\n * @param {String|Node} query A selector query string or directly a DOM element\n * @param {Object} data The data object that needs to consist of a labels and a series array\n * @param {Object} [options] The options object with options that override the default options. Check the examples for a detailed list.\n * @param {Array} [responsiveOptions] Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]\n * @return {Object} An object which exposes the API for the created chart\n *\n * @example\n * // Create a simple bar chart\n * var data = {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [\n * [5, 2, 4, 2, 0]\n * ]\n * };\n *\n * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.\n * new Chartist.Bar('.ct-chart', data);\n *\n * @example\n * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10\n * new Chartist.Bar('.ct-chart', {\n * labels: [1, 2, 3, 4, 5, 6, 7],\n * series: [\n * [1, 3, 2, -5, -3, 1, -6],\n * [-5, -2, -4, -1, 2, -3, 1]\n * ]\n * }, {\n * seriesBarDistance: 12,\n * low: -10,\n * high: 10\n * });\n *\n */\n function Bar(query, data, options, responsiveOptions) {\n Chartist.Bar['super'].constructor.call(this,\n query,\n data,\n defaultOptions,\n Chartist.extend({}, defaultOptions, options),\n responsiveOptions);\n }\n\n // Creating bar chart type in Chartist namespace\n Chartist.Bar = Chartist.Base.extend({\n constructor: Bar,\n createChart: createChart\n });\n\n}(window, document, Chartist));\n;\nreturn Chartist;\n\n}));\n","(function (root, factory) {\n\t// if (typeof define === 'function' && define.amd) {\n\t// \t// AMD. Register as an anonymous module.\n\t// \tdefine([], function () {\n\t// \t\treturn (root.returnExportsGlobal = factory());\n\t// \t});\n\t// } else if (typeof exports === 'object') {\n\t// \t// Node. Does not work with strict CommonJS, but\n\t// \t// only CommonJS-like enviroments that support module.exports,\n\t// \t// like Node.\n\t// \tmodule.exports = factory();\n\t// } else {\n\t\troot['Chartist.plugins.ctAxisTitle'] = factory();\n\t// }\n}(this, function () {\n\n\t/**\n\t * Chartist.js plugin to display a title for 1 or 2 axises.\n\t *\n\t */\n\t/* global Chartist */\n\t(function (window, document, Chartist) {\n\t\t'use strict';\n\n\t\tvar axisDefaults = {\n\t\t\taxisTitle: '',\n\t\t\taxisClass: 'ct-axis-title',\n\t\t\toffset: {\n\t\t\t\tx: 0,\n\t\t\t\ty: 0\n\t\t\t},\n\t\t\ttextAnchor: 'middle',\n\t\t\tflipText: false\n\t\t};\n\t\tvar defaultOptions = {\n\t\t\taxisX: axisDefaults,\n\t\t\taxisY: axisDefaults\n\t\t};\n\n\t\tChartist.plugins = Chartist.plugins || {};\n\t\tChartist.plugins.ctAxisTitle = function (options) {\n\n\t\t\toptions = Chartist.extend({}, defaultOptions, options);\n\n\t\t\tconsole.log(options);\n\n\t\t\treturn function ctAxisTitle(chart) {\n\n\t\t\t\tchart.on('created', function (data) {\n\t\t\t\t\t//\n\t\t\t\t\t// if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin - You must provide at least one axis title');\n\t\t\t\t\t// } else if (!data.axisX && !data.axisY) {\n\t\t\t\t\t// \tthrow new Error('ctAxisTitle plugin can only be used on charts that have at least one axis');\n\t\t\t\t\t// }\n\n\t\t\t\t\tvar xPos;\n\t\t\t\t\tvar yPos;\n\t\t\t\t\tvar title;\n\n\t\t\t\t\t//position axis X title\n\t\t\t\t\tif (options.axisX.axisTitle && data.axisX) {\n\n\t\t\t\t\t\txPos = (data.axisX.axisLength / 2) + data.options.axisY.offset + data.options.chartPadding.left;\n\n\t\t\t\t\t\tyPos = data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos -= data.options.axisY.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'end') {\n\t\t\t\t\t\t\tyPos += data.axisY.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisX.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisX.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisX.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisX.offset.y,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisX.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//position axis Y title\n\t\t\t\t\tif (options.axisY.axisTitle && data.axisY) {\n\t\t\t\t\t\txPos = 0;\n\n\n\t\t\t\t\t\tyPos = (data.axisY.axisLength / 2) + data.options.chartPadding.top;\n\n\t\t\t\t\t\tif (data.options.axisX.position === 'start') {\n\t\t\t\t\t\t\tyPos += data.options.axisX.offset;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (data.options.axisY.position === 'end') {\n\t\t\t\t\t\t\txPos = data.axisX.axisLength;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar transform = 'rotate(' + (options.axisY.flipText ? -90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n\t\t\t\t\t\ttitle = new Chartist.Svg(\"text\");\n\t\t\t\t\t\ttitle.addClass(options.axisY.axisClass);\n\t\t\t\t\t\ttitle.text(options.axisY.axisTitle);\n\t\t\t\t\t\ttitle.attr({\n\t\t\t\t\t\t\tx: xPos + options.axisY.offset.x,\n\t\t\t\t\t\t\ty: yPos + options.axisY.offset.y,\n\t\t\t\t\t\t\ttransform: transform,\n\t\t\t\t\t\t\t\"text-anchor\": options.axisY.textAnchor\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tdata.svg.append(title, true);\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t};\n\t\t};\n\n\t}(window, document, Chartist));\n\n\treturn Chartist.plugins.ctAxisTitle;\n\n}));\n","(function (root, factory) {\n // if (typeof define === 'function' && define.amd) {\n // // AMD. Register as an anonymous module.\n // define([], function () {\n // return (root.returnExportsGlobal = factory());\n // });\n // } else if (typeof exports === 'object') {\n // // Node. Does not work with strict CommonJS, but\n // // only CommonJS-like enviroments that support module.exports,\n // // like Node.\n // module.exports = factory();\n // } else {\n root['Chartist.plugins.zoom'] = factory();\n // }\n}(this, function () {\n\n /**\n * Chartist.js zoom plugin.\n *\n */\n (function (window, document, Chartist) {\n 'use strict';\n\n var defaultOptions = {\n // onZoom\n // resetOnRightMouseBtn\n };\n\n\n Chartist.plugins = Chartist.plugins || {};\n Chartist.plugins.zoom = function (options) {\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function zoom(chart) {\n\n if (!(chart instanceof Chartist.Line)) {\n return;\n }\n\n var rect, svg, axisX, axisY, chartRect;\n var downPosition;\n var onZoom = options.onZoom;\n var ongoingTouches = [];\n\n chart.on('draw', function (data) {\n var type = data.type;\n if (type === 'line' || type === 'bar' || type === 'area' || type === 'point') {\n data.element.attr({\n 'clip-path': 'url(#zoom-mask)'\n });\n }\n });\n\n chart.on('created', function (data) {\n axisX = data.axisX;\n axisY = data.axisY;\n chartRect = data.chartRect;\n svg = data.svg._node;\n rect = data.svg.elem('rect', {\n x: 10,\n y: 10,\n width: 100,\n height: 100,\n }, 'ct-zoom-rect');\n hide(rect);\n\n var defs = data.svg.querySelector('defs') || data.svg.elem('defs');\n var width = chartRect.width();\n var height = chartRect.height();\n\n defs\n .elem('clipPath', {\n id: 'zoom-mask'\n })\n .elem('rect', {\n x: chartRect.x1,\n y: chartRect.y2,\n width: width,\n height: height,\n fill: 'white'\n });\n\n svg.addEventListener('mousedown', onMouseDown);\n svg.addEventListener('mouseup', onMouseUp);\n svg.addEventListener('mousemove', onMouseMove);\n svg.addEventListener('touchstart', onTouchStart);\n svg.addEventListener('touchmove', onTouchMove);\n svg.addEventListener('touchend', onTouchEnd);\n svg.addEventListener('touchcancel', onTouchCancel);\n });\n\n function copyTouch(touch) {\n var p = position(touch, svg);\n p.id = touch.identifier;\n return p;\n }\n\n function ongoingTouchIndexById(idToFind) {\n for (var i = 0; i < ongoingTouches.length; i++) {\n var id = ongoingTouches[i].id;\n if (id === idToFind) {\n return i;\n }\n }\n return -1;\n }\n\n function onTouchStart(event) {\n var touches = event.changedTouches;\n for (var i = 0; i < touches.length; i++) {\n ongoingTouches.push(copyTouch(touches[i]));\n }\n\n if (ongoingTouches.length > 1) {\n rect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n show(rect);\n }\n }\n\n function onTouchMove(event) {\n var touches = event.changedTouches;\n for (var i = 0; i < touches.length; i++) {\n var idx = ongoingTouchIndexById(touches[i].identifier);\n ongoingTouches.splice(idx, 1, copyTouch(touches[i]));\n }\n\n if (ongoingTouches.length > 1) {\n rect.attr(getRect(ongoingTouches[0], ongoingTouches[1]));\n show(rect);\n event.preventDefault();\n }\n }\n\n function onTouchCancel(event) {\n removeTouches(event.changedTouches);\n }\n\n function removeTouches(touches) {\n for (var i = 0; i < touches.length; i++) {\n var idx = ongoingTouchIndexById(touches[i].identifier);\n if (idx >= 0) {\n ongoingTouches.splice(idx, 1);\n }\n }\n }\n\n function onTouchEnd(event) {\n if (ongoingTouches.length > 1) {\n zoomIn(getRect(ongoingTouches[0], ongoingTouches[1]));\n }\n removeTouches(event.changedTouches);\n hide(rect);\n }\n\n function onMouseDown(event) {\n if (event.button === 0) {\n downPosition = position(event, svg);\n rect.attr(getRect(downPosition, downPosition));\n show(rect);\n event.preventDefault();\n }\n }\n\n var reset = function () {\n chart.options.axisX.highLow = null;\n chart.options.axisY.highLow = null;\n chart.update(chart.data, chart.options);\n };\n\n function onMouseUp(event) {\n if (event.button === 0) {\n var box = getRect(downPosition, position(event, svg));\n zoomIn(box);\n downPosition = null;\n hide(rect);\n event.preventDefault();\n }\n else if (options.resetOnRightMouseBtn && event.button === 2) {\n reset();\n event.preventDefault();\n }\n }\n\n function zoomIn(rect) {\n if (rect.width > 5 && rect.height > 5) {\n var x1 = rect.x - chartRect.x1;\n var x2 = x1 + rect.width;\n var y2 = chartRect.y1 - rect.y;\n var y1 = y2 - rect.height;\n\n chart.options.axisX.highLow = { low: project(x1, axisX), high: project(x2, axisX) };\n chart.options.axisY.highLow = { low: project(y1, axisY), high: project(y2, axisY) };\n\n chart.update(chart.data, chart.options);\n onZoom && onZoom(chart, reset);\n }\n }\n\n function onMouseMove(event) {\n if (downPosition) {\n var point = position(event, svg);\n rect.attr(getRect(downPosition, point));\n event.preventDefault();\n }\n }\n };\n\n };\n\n function hide(rect) {\n rect.attr({ style: 'display:none' });\n }\n\n function show(rect) {\n rect.attr({ style: 'display:block' });\n }\n\n function getRect(firstPoint, secondPoint) {\n var x = firstPoint.x;\n var y = firstPoint.y;\n var width = secondPoint.x - x;\n var height = secondPoint.y - y;\n if (width < 0) {\n width = -width;\n x = secondPoint.x;\n }\n if (height < 0) {\n height = -height;\n y = secondPoint.y;\n }\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n }\n\n function position(event, svg) {\n return transform(event.clientX, event.clientY, svg);\n }\n\n function transform(x, y, svgElement) {\n var svg = svgElement.tagName === 'svg' ? svgElement : svgElement.ownerSVGElement;\n var matrix = svg.getScreenCTM();\n var point = svg.createSVGPoint();\n point.x = x;\n point.y = y;\n point = point.matrixTransform(matrix.inverse());\n return point || { x: 0, y: 0 };\n }\n\n function project(value, axis) {\n var max = axis.bounds.max;\n var min = axis.bounds.min;\n if (axis.scale && axis.scale.type === 'log') {\n var base = axis.scale.base;\n return Math.pow(base,\n value * baseLog(max / min, base) / axis.axisLength) * min;\n }\n return (value * axis.bounds.range / axis.axisLength) + min;\n }\n\n function baseLog(val, base) {\n return Math.log(val) / Math.log(base);\n }\n\n } (window, document, Chartist));\n return Chartist.plugins.zoom;\n\n}));\n","function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}\n\n/** html entities */\nfunction e(x) {\n\treturn String(x)\n\t\t.replace(/&/g, '&')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''')\n\t\t.replace(//g, '>');\n}\n\n/** Returns true if argument is array [] */\nfunction isArray(obj) {\n\treturn Object.prototype.toString.call(obj) === '[object Array]';\n}\n\n/** Returns true if argument is object {} */\nfunction isObject(obj) {\n\treturn Object.prototype.toString.call(obj) === '[object Object]';\n}\n\n/** escape a string to have no special meaning in regex */\nfunction regexEscape(s) {\n\treturn s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\n/** Convert RSSI 0-255 to % */\nfunction rssiPerc(rssi) {\n\tvar r = parseInt(rssi);\n\tif (r > -50) return 100; // 100%\n\tif (r < -100) return 0; // 0%\n\treturn Math.round(2 * (r + 100)); // approximation\n}\n\n/** Perform a substitution in the given string.\n *\n * Arguments - array or list of replacements.\n * Arguments numeric keys will replace {0}, {1} etc.\n * Named keys also work, ie. {foo: \"bar\"} -> replaces {foo} with bar.\n *\n * Braces are added to keys if missing.\n *\n * @returns {String} result\n */\nString.prototype.format = function () {\n\tvar out = this;\n\n\tvar repl = arguments;\n\n\tif (arguments.length == 1 && (isArray(arguments[0]) || isObject(arguments[0]))) {\n\t\trepl = arguments[0];\n\t}\n\n\tfor (var ph in repl) {\n\t\tif (repl.hasOwnProperty(ph)) {\n\t\t\tvar ph_orig = ph;\n\n\t\t\tif (!ph.match(/^\\{.*\\}$/)) {\n\t\t\t\tph = '{' + ph + '}';\n\t\t\t}\n\n\t\t\t// replace all occurrences\n\t\t\tvar pattern = new RegExp(regexEscape(ph), \"g\");\n\t\t\tout = out.replace(pattern, repl[ph_orig]);\n\t\t}\n\t}\n\n\treturn out;\n};\n","/** Module for toggling a modal overlay */\nvar modal = (function () {\n\tvar modal = {};\n\n\tmodal.show = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('hidden visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('visible');\n\t\t}, 1);\n\t};\n\n\tmodal.hide = function (sel) {\n\t\tvar $m = $(sel);\n\t\t$m.removeClass('visible');\n\t\tsetTimeout(function () {\n\t\t\t$m.addClass('hidden');\n\t\t}, 500); // transition time\n\t};\n\n\tmodal.init = function () {\n\t\t// close modal by click outside the dialog\n\t\t$('.Modal').on('click', function () {\n\t\t\tmodal.hide(this);\n\t\t});\n\n\t\t$('.Dialog').on('click', function (e) {\n\t\t\te.stopImmediatePropagation();\n\t\t});\n\n\t\t// Hide all modals on esc\n\t\t$(window).on('keydown', function (e) {\n\t\t\tif (e.which == 27) {\n\t\t\t\tmodal.hide('.Modal');\n\t\t\t}\n\t\t});\n\t};\n\n\treturn modal;\n})();\n","// requires other modules...\n\n// - utils.js\n// - modal.js\n// - wifi.js\n\n// all must be included after 3rd party libs\n\n\n/** Global generic init */\n$().ready(function () {\n\n\t// loader dots...\n\tsetInterval(function () {\n\t\t$('.anim-dots').each(function (x) {\n\t\t\tvar $x = $(x);\n\t\t\tvar dots = $x.html() + '.';\n\t\t\tif (dots.length == 5) dots = '.';\n\t\t\t$x.html(dots);\n\t\t});\n\t}, 1000);\n\n\tmodal.init();\n});\n","/** Wifi page */\nvar wifi = (function () {\n\tvar wifi = {};\n\tvar authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];\n\n\t/** Update display for received response */\n\tfunction onScan(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\trescan(5000); // wait 5sm then retry\n\t\t\treturn;\n\t\t}\n\n\t\tresp = JSON.parse(resp);\n\n\t\tvar done = !bool(resp.result.inProgress) && (resp.result.APs.length > 0);\n\t\trescan(done ? 15000 : 1000);\n\t\tif (!done) return; // no redraw yet\n\n\t\t// clear the AP list\n\t\tvar $list = $('#ap-list');\n\t\t// remove old APs\n\t\t$('.AP').remove();\n\n\t\t$list.toggle(done);\n\t\t$('#ap-loader').toggle(!done);\n\n\t\t// scan done\n\t\tresp.result.APs\n\t\t\t.sort(function (a, b) {\n\t\t\t\treturn b.rssi - a.rssi\n\t\t\t})\n\t\t\t.forEach(function (ap) {\n\t\t\t\tap.enc = parseInt(ap.enc);\n\n\t\t\t\tif (ap.enc > 4) return; // hide unsupported auths\n\n\t\t\t\tvar item = document.createElement('div');\n\n\t\t\t\tvar $item = $(item)\n\t\t\t\t\t.data('ssid', ap.essid)\n\t\t\t\t\t.data('pwd', ap.enc != 0)\n\t\t\t\t\t.addClass('AP');\n\n\t\t\t\t// mark current SSID\n\t\t\t\tif (ap.essid == wifi.current) {\n\t\t\t\t\t$item.addClass('selected');\n\t\t\t\t}\n\n\t\t\t\tvar inner = document.createElement('div');\n\t\t\t\tvar $inner = $(inner).addClass('inner')\n\t\t\t\t\t.htmlAppend('
{0}
'.format(rssiPerc(ap.rssi)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(e(ap.essid)))\n\t\t\t\t\t.htmlAppend('
{0}
'.format(authStr[ap.enc]));\n\n\t\t\t\t$item.on('click', function () {\n\t\t\t\t\tvar $th = $(this);\n\n\t\t\t\t\t// populate the form\n\t\t\t\t\t$('#conn-essid').val($th.data('ssid'));\n\t\t\t\t\t$('#conn-passwd').val(''); // clear\n\n\t\t\t\t\tif ($th.data('pwd')) {\n\t\t\t\t\t\t// this AP needs a password\n\t\t\t\t\t\tmodal.show('#psk-modal');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#conn-form').submit();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\titem.appendChild(inner);\n\t\t\t\t$list[0].appendChild(item);\n\t\t\t});\n\t}\n\n\t/** Ask the CGI what APs are visible (async) */\n\tfunction scanAPs() {\n\t\t$().get('/wifi/scan.cgi', onScan, true, true); // no cache, no jsonp\n\t}\n\n\tfunction rescan(time) {\n\t\tsetTimeout(scanAPs, time);\n\t}\n\n\t/** Set up the WiFi page */\n\twifi.init = function () {\n\t\t//var ap_json = {\n\t\t//\t\"result\": {\n\t\t//\t\t\"inProgress\": \"0\",\n\t\t//\t\t\"APs\": [\n\t\t//\t\t\t{\"essid\": \"Chlivek\", \"bssid\": \"88:f7:c7:52:b3:99\", \"rssi\": \"204\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"TyNikdy\", \"bssid\": \"5c:f4:ab:0d:f1:1b\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"UPC5616805\", \"bssid\": \"08:95:2a:0c:84:3f\", \"rssi\": \"164\", \"enc\": \"4\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"Sitovina\", \"bssid\": \"20:cf:30:98:cb:3a\", \"rssi\": \"166\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"Tramp\", \"bssid\": \"c4:e9:84:6f:6c:e0\", \"rssi\": \"170\", \"enc\": \"3\", \"channel\": \"2\"},\n\t\t//\t\t\t{\"essid\": \"KV2\", \"bssid\": \"4c:5e:0c:2c:84:9b\", \"rssi\": \"172\", \"enc\": \"3\", \"channel\": \"3\"},\n\t\t//\t\t\t{\"essid\": \"UPC373123\", \"bssid\": \"e8:40:f2:ae:0e:f4\", \"rssi\": \"164\", \"enc\": \"3\", \"channel\": \"1\"},\n\t\t//\t\t\t{\"essid\": \"www.podoli.org prazak\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"165\", \"enc\": \"0\", \"channel\": \"4\"},\n\t\t//\t\t\t{\"essid\": \"Medvjedov\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"181\", \"enc\": \"4\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"MARIAN-PC\", \"bssid\": \"f8:d1:11:af:d7:72\", \"rssi\": \"175\", \"enc\": \"3\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"UPC3226244\", \"bssid\": \"64:7c:34:9a:6f:7c\", \"rssi\": \"169\", \"enc\": \"4\", \"channel\": \"6\"},\n\t\t//\t\t\t{\"essid\": \"molly\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"168\", \"enc\": \"3\", \"channel\": \"7\"},\n\t\t//\t\t\t{\"essid\": \"UPC2607759\", \"bssid\": \"88:f7:c7:4e:c1:b2\", \"rssi\": \"164\", \"enc\": \"4\", \"channel\": \"8\"},\n\t\t//\t\t\t{\"essid\": \"blondyna\", \"bssid\": \"98:fc:11:bd:0f:b8\", \"rssi\": \"166\", \"enc\": \"4\", \"channel\": \"9\"},\n\t\t//\t\t\t{\"essid\": \"UPC246587811\", \"bssid\": \"80:f5:03:20:6c:85\", \"rssi\": \"171\", \"enc\": \"3\", \"channel\": \"11\"},\n\t\t//\t\t\t{\"essid\": \"UPC930648\", \"bssid\": \"4c:72:b9:50:6d:38\", \"rssi\": \"167\", \"enc\": \"3\", \"channel\": \"11\"},\n\t\t//\t\t\t{\"essid\": \"PRAHA4.NET-R21-2\", \"bssid\": \"00:00:00:00:00:00\", \"rssi\": \"173\", \"enc\": \"0\", \"channel\": \"12\"},\n\t\t//\t\t\t{\"essid\": \"Internet_B0\", \"bssid\": \"5c:f4:ab:11:3b:b3\", \"rssi\": \"166\", \"enc\": \"3\", \"channel\": \"13\"}\n\t\t//\t\t]\n\t\t//\t}\n\t\t//};\n\n\t\t//onScan(ap_json, 200);\n\t\tscanAPs();\n\t};\n\n\treturn wifi;\n})();\n","var wfm = (function () {\n\tvar wfm = {};\n\n\tfunction buildChart(samples, xlabel, ylabel) {\n\t\tvar data = [];\n\t\tsamples.forEach(function (a, i) {\n\t\t\tdata.push({x: i, y: a});\n\t\t});\n\n\t\t// Build the chart\n\t\tvar plugins = [];\n\t\tvar mql = window.matchMedia('screen and (min-width: 544px)');\n\t\tvar isPhone = !mql.matches;\n\n\t\tif (!isPhone) {\n\t\t\t// larger than phone\n\t\t\tplugins.push(\n\t\t\t\tChartist.plugins.ctAxisTitle({\n\t\t\t\t\taxisX: {\n\t\t\t\t\t\taxisTitle: xlabel,\n\t\t\t\t\t\toffset: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 55\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\taxisY: {\n\t\t\t\t\t\taxisTitle: ylabel,\n\t\t\t\t\t\tflipText: true,\n\t\t\t\t\t\toffset: {\n\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\ty: 15\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tnew Chartist.Line('#chart', {\n\t\t\tseries: [\n\t\t\t\t{\n\t\t\t\t\tname: 'a',\n\t\t\t\t\tdata: data\n\t\t\t\t},\n\t\t\t]\n\t\t}, {\n\t\t\tshowPoint: false,\n\t\t\t// showArea: true,\n\t\t\tfullWidth: true,\n\t\t\tchartPadding: (isPhone ? {right: 20, bottom: 5, left: 0} : {right: 25, bottom: 30, left: 25}),\n\t\t\tseries: {\n\t\t\t\t'a': {\n\t\t\t\t\tlineSmooth: Chartist.Interpolation.none()\n\t\t\t\t}\n\t\t\t},\n\t\t\taxisX: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\tonlyInteger: true\n\t\t\t},\n\t\t\taxisY: {\n\t\t\t\ttype: Chartist.AutoScaleAxis,\n\t\t\t\t//onlyInteger: true\n\t\t\t},\n\t\t\tplugins: plugins\n\t\t});\n\t}\n\n\tfunction onRxData(resp, status) {\n\t\tif (status != 200) {\n\t\t\t// bad response\n\t\t\talert(\"Request failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar json = JSON.parse(resp);\n\t\tif (!json.success) {\n\t\t\talert(\"Sampling failed.\");\n\t\t\treturn;\n\t\t}\n\n\t\tbuildChart(json.samples, 'Sample Nr.', 'ADC value');\n\t}\n\n\twfm.init = function() {\n\t\t//\tvar resp = {\n\t\t//\t\t\"samples\": [1878, 1883, 1887, 1897, 1906, 1915, 1926, 1940, 1955, 1970, 1982, 1996, 2012, 2026, 2038, 2049],\n\t\t//\t\t\"success\": true\n\t\t//\t};\n\n\t\tfunction clickHdl() {\n\t\t\tvar samples = $('#count').val();\n\n\t\t\t//http://192.168.1.13\n\t\t\t$().get('/api/raw.json?n='+samples, onRxData, true, true);\n\t\t}\n\n\t\t$('#load').on('click', clickHdl);\n\n\t\t$('#count').on('keyup', function(e) {\n\t\t\tif (e.which == 13) {\n\t\t\t\tclickHdl();\n\t\t\t}\n\t\t});\n\t};\n\n\treturn wfm;\n})();\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/html_src/sass/app.scss b/html_src/sass/app.scss index 9a41697..a2f1519 100644 --- a/html_src/sass/app.scss +++ b/html_src/sass/app.scss @@ -1,5 +1,4 @@ @import "normalize"; -@import "lib/chartist/chartist"; @import "lib/bourbon/bourbon"; @import "grid-settings"; @@ -7,6 +6,8 @@ @import "utils/index"; +@import "lib/chartist/chartist"; + $form-label-w: 130px; $form-label-gap: 8px; $form-field-w: 250px; diff --git a/html_src/sass/lib/chartist/_chartist.scss b/html_src/sass/lib/chartist/_chartist.scss index 196bc82..a909e66 100644 --- a/html_src/sass/lib/chartist/_chartist.scss +++ b/html_src/sass/lib/chartist/_chartist.scss @@ -116,6 +116,7 @@ .ct-axis-title { fill: $ct-axis-label-color; + @include noselect; } // --- Label --- diff --git a/libesphttpd/core/httpd.c b/libesphttpd/core/httpd.c index 9b9f0af..d8d4ff2 100644 --- a/libesphttpd/core/httpd.c +++ b/libesphttpd/core/httpd.c @@ -28,6 +28,8 @@ Esp8266 http server - core routines //size of the backlog. #define MAX_BACKLOG_SIZE (4*1024) +#define MAX_CORS_TOKEN_LEN 256 + //This gets set at init time. static HttpdBuiltInUrl *builtInUrls; @@ -48,6 +50,7 @@ struct HttpSendBacklogItem { //Private data for http connection struct HttpdPriv { char head[MAX_HEAD_LEN]; + char corsToken[MAX_CORS_TOKEN_LEN]; int headPos; char *sendBuff; int sendBuffLen; @@ -91,15 +94,24 @@ static const ICACHE_RODATA_ATTR MimeMap mimeTypes[]={ }; //Returns a static char* to a mime type for a given url to a file. -const char ICACHE_FLASH_ATTR *httpdGetMimetype(const char *url) { +const char ICACHE_FLASH_ATTR *httpdGetMimetype(const char *filepath) { int i=0; - //Go find the extension - const char *ext=url+(strlen(url)-1); - while (ext!=url && *ext!='.') ext--; + //Go find the extension (searching from the end) + const char *ext=filepath+(strlen(filepath)-1); + while (ext!=filepath && *ext!='.') ext--; if (*ext=='.') ext++; //ToDo: strcmp is case sensitive; we may want to do case-intensive matching here... while (mimeTypes[i].ext!=NULL && strcmp(ext, mimeTypes[i].ext)!=0) i++; + + if (mimeTypes[i].ext == NULL) { + // we didn't find any proper match + if (strncmp(filepath, "/json/", 6) == 0) { + // if it's in the json folder, it surely is json! + return "application/json"; + } + } + return mimeTypes[i].mimetype; } @@ -508,6 +520,18 @@ static void ICACHE_FLASH_ATTR httpdProcessRequest(HttpdConnData *conn) { error("WtF? url = NULL"); return; //Shouldn't happen } + + if (conn->requestType == HTTPD_METHOD_OPTIONS /*&& conn->priv->chunkHdr[0] != 0*/) { + // we have a CORS preflight + httpdStartResponse(conn, 200); + httpdHeader(conn, "Access-Control-Allow-Headers", conn->priv->corsToken); + httpdEndHeaders(conn); + httpdCgiIsDone(conn); + + dbg("CORS preflight resp sent."); + return; + } + //See if we can find a CGI that's happy to handle the request. while (1) { //Look up URL in the built-in URL table. @@ -647,7 +671,7 @@ static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) { // int len = strlen(h); // info("h = %s, len %d", h, len); - //strcpy(conn->priv->corsReqHdrs, h+32);//MAX_CORS_HDR_LEN + strncpy(conn->priv->corsToken, h+32, MAX_CORS_TOKEN_LEN); } } @@ -661,6 +685,7 @@ void httpdRecvCb(ConnTypePtr rconn, char *remIp, int remPort, char *data, unsign if (conn==NULL) return; conn->priv->sendBuff=sendBuff; conn->priv->sendBuffLen=0; + conn->priv->corsToken[0] = 0; //This is slightly evil/dirty: we abuse conn->post->len as a state variable for where in the http communications we are: //<0 (-1): Post len unknown because we're still receiving headers diff --git a/libesphttpd/html-minifier-conf.json b/libesphttpd/html-minifier-conf.json index f7c3dce..d413316 100644 --- a/libesphttpd/html-minifier-conf.json +++ b/libesphttpd/html-minifier-conf.json @@ -3,7 +3,7 @@ "removeCommentsFromCDATA": true, "removeCDATASectionsFromCDATA": true, "collapseWhitespace": true, - "conservativeCollapse": false, + "conservativeCollapse": true, "collapseBooleanAttributes": true, "removeTagWhitespace": true, "removeAttributeQuotes": true, diff --git a/web-gbuild.sh b/web-gbuild.sh new file mode 100755 index 0000000..b8f53d4 --- /dev/null +++ b/web-gbuild.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +xterm -title "ESP gulp build" -e "source $HOME/.bashrc && cd html_src && gulp" diff --git a/web-gwatch.sh b/web-gwatch.sh index 71ca3d1..21d204f 100755 --- a/web-gwatch.sh +++ b/web-gwatch.sh @@ -1,3 +1,3 @@ #!/bin/bash -xterm -title "ESP html build" -e "source $HOME/.bashrc && cd html_src && gulp watch" +xterm -title "ESP gulp watch" -e "source $HOME/.bashrc && cd html_src && gulp watch"