diff options
Diffstat (limited to 'kosten/static')
19 files changed, 1199 insertions, 0 deletions
diff --git a/kosten/static/css/style.css b/kosten/static/css/style.css new file mode 100644 index 0000000..f2844f1 --- /dev/null +++ b/kosten/static/css/style.css @@ -0,0 +1,338 @@ +/* +Design by Free CSS Templates +http://www.freecsstemplates.org +Released for free under a Creative Commons Attribution 2.5 License +*/ + +body { + margin: 0; + padding: 0; + background: #000000; + font-size: 13px; + font-family: "Trebuchet MS", Georgia, "Times New Roman", Times, serif; + text-align: justify; + color: #FFFFFF; +} + + +h1, h2, h3 { + margin: 0; + text-transform: lowercase; + font-weight: normal; + color: #FFFFFF; +} + +h1 { + letter-spacing: -1px; + font-size: 32px; +} + +h2 { + font-size: 23px; +} + +h3 { + font-size: 18px; +} + +p, ul, ol { + text-align: justify; + line-height: 20px; +} + +p + h2, p + h3 { + margin-top: 1.5em; +} + +a:link { + color: #8BD80E; +} + +a:hover, a:active { + text-decoration: none; + color: #8BD80E; +} + +a:visited { + color: #8BD80E; +} + +img { + border: none; +} + +#left { + float: left; + margin-right: 15px; + text-decoration: none; +} + +#right { + float: right; + margin-left: 15px; + text-decoration: none; +} + +img.arrow { + width: 20px; + height: 20px; + vertical-align: middle; +} + +.navdate { + vertical-align: middle; + padding-right: 5px; + padding-left: 5px; +} + +.heading { + font-weight: bold; +} + +.detail .heading { + cursor: pointer; +} + +.detail > .mark { + cursor: pointer; +} + +ul.arrow { + list-style-image: url(../images/closed.png); +} + +.error { + color: #E15418; +} + +.pie { + display: inline-block; + width: 410px; + height: 150px; +} + +.month_exp { + display: inline-block; + width: 280px; + vertical-align: top; + margin-bottom: 30px; + margin-right: 10px; +} + +/* Header */ + +#header { + width: 760px; + margin: 0 auto; + height: 42px; +} + +#head-wrapper { + margin: 0; + padding: 0; + background: #FFFFFF url(../images/img01.gif) repeat-x left top; +} + +/* Menu */ + +#menu { + float: left; + width: 760px; + height: 50px; + background: url(../images/img02.gif) no-repeat left top; +} + +#menu > ul { + margin: 0; + padding: 0px 0 0 10px; + list-style: none; + line-height: normal; +} + +.menu-item { + display: block; + float: left; +} + +.menu-item > a { + display: block; + float: left; + background: url(../images/img04.gif) no-repeat right 55%; + margin-top: 5px; + margin-right: 3px; + padding: 8px 17px; + text-decoration: none; + font-size: 13px; + color: #000000; +} + +.menu-item > a:hover { + color: #000000; +} + +li.search { + display: block; + float: left; + cursor: pointer; + position: relative; +} + +img.search { + padding: 9px 10px; +} + +form.search { + position: relative; +} + +input.search { + position: absolute; + top: -10px; + left: -30px; + width: 80px; + overflow: hidden; +} + +input.search-submit { + position: absolute; + top: -20px; + z-index: -1; + color: transparent; + border: none; + outline: none; + opacity: 0; +} + +/** LOGO */ + +#logo { + width: 760px; + height: 80px; + margin: 0 auto; +} + +#logo > h1, #logo > h2, #logo > img { + float: left; + margin: 0; + padding: 30px 0 0 0px; + line-height: normal; +} + +#logo > img { + float: left; + margin-right: 15px; + padding: 30px 0 0 0px; +} + +#logo > h1 { + font-family: Georgia, "Times New Roman", Times, serif; + font-size:40px; +} + +#logo > h1 > a { + text-decoration: none; + color: #4C4C4C; +} + +#logo > h1 > a:hover { text-decoration: underline; } + +#logo > h2 { + float: left; + padding: 45px 0 0 18px; + font: 18px Georgia, "Times New Roman", Times, serif; + color: #8BD80E; +} + +/* Page */ + +#page { + width: 710px; + margin: 0 auto; + background: #4C4C4C url(../images/img03.gif) no-repeat left bottom; + padding: 0 25px; +} + +/* Post */ + +#messages { + list-style-type: none; + padding: 0; + margin: 0; +} + +#messages > li { + background: #9e9e9e; + color: #000; + padding: 5px; + margin: 5px 5px 15px 5px; + text-align: center; + box-shadow: 0 0 6px #888; +} + +#messages > li.msg-error { + background: #DA6F6F; +} + +#messages a { + color: #fff; +} + +#content { + float: left; + width: 710px; + padding: 15px 0px; + margin-bottom: 20px; +} + +#page_heading { + margin-bottom: 20px; + padding-bottom: 5px; +} + +#content h2, #content h3 { + margin-bottom: 0.5em; +} + +/* Forms */ + +form input[value], form select { + width: 170px; + padding: 1px; + margin-left: 4px; + box-sizing: border-box; + font-size: 100%; + font-family: inherit; + height: 25px; +} + +form input[type=checkbox] { + width: initial; +} + +form input[type=submit] { + margin-top: 10px; +} + +/* Footer */ +#footer { + margin: 0 auto; + padding: 20px 0 10px 0; + background: #000000; + height: auto; +} + +#footer > p { + font-size: 11px; +} + +#legal { + clear: both; + padding-top: 17px; + text-align: center; + color: #FFFFFF; +} + +#legal > a { + font-weight: normal; + color: #FFFFFF; +} diff --git a/kosten/static/images/add.png b/kosten/static/images/add.png Binary files differnew file mode 100644 index 0000000..b748150 --- /dev/null +++ b/kosten/static/images/add.png diff --git a/kosten/static/images/arrow_left.png b/kosten/static/images/arrow_left.png Binary files differnew file mode 100644 index 0000000..de740e7 --- /dev/null +++ b/kosten/static/images/arrow_left.png diff --git a/kosten/static/images/arrow_right.png b/kosten/static/images/arrow_right.png Binary files differnew file mode 100644 index 0000000..14922a9 --- /dev/null +++ b/kosten/static/images/arrow_right.png diff --git a/kosten/static/images/closed.png b/kosten/static/images/closed.png Binary files differnew file mode 100644 index 0000000..6bba92a --- /dev/null +++ b/kosten/static/images/closed.png diff --git a/kosten/static/images/closed.svg b/kosten/static/images/closed.svg new file mode 100644 index 0000000..52ba819 --- /dev/null +++ b/kosten/static/images/closed.svg @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="17.636721" + height="17.929689" + id="svg2" + version="1.1" + inkscape:version="0.47 r22583" + sodipodi:docname="Neues Dokument 1"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="-209.23704" + inkscape:cy="-128.63304" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1670" + inkscape:window-height="950" + inkscape:window-x="0" + inkscape:window-y="32" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Ebene 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-295.89136,-253.17896)"> + <g + style="font-size:40px;font-style:normal;font-weight:normal;fill:#8bd80e;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" + id="text2816" + transform="translate(12.121831,-7.0710678)"> + <path + d="m 283.76953,260.25003 9.16016,8.16406 0,1.60157 -9.16016,8.16406 0,-3.73047 5.87891,-5.23438 -5.87891,-5.23437 0,-3.73047 m 8.47656,0 9.16016,8.16406 0,1.60157 -9.16016,8.16406 0,-3.73047 5.87891,-5.23438 -5.87891,-5.23437 0,-3.73047" + id="path2821" + style="fill:#8bd80e;fill-opacity:1" /> + </g> + </g> +</svg> diff --git a/kosten/static/images/currency.png b/kosten/static/images/currency.png Binary files differnew file mode 100644 index 0000000..f0bee75 --- /dev/null +++ b/kosten/static/images/currency.png diff --git a/kosten/static/images/img01.gif b/kosten/static/images/img01.gif Binary files differnew file mode 100644 index 0000000..5f082bd --- /dev/null +++ b/kosten/static/images/img01.gif diff --git a/kosten/static/images/img02.gif b/kosten/static/images/img02.gif Binary files differnew file mode 100644 index 0000000..6f7624f --- /dev/null +++ b/kosten/static/images/img02.gif diff --git a/kosten/static/images/img03.gif b/kosten/static/images/img03.gif Binary files differnew file mode 100644 index 0000000..137ec06 --- /dev/null +++ b/kosten/static/images/img03.gif diff --git a/kosten/static/images/img04.gif b/kosten/static/images/img04.gif Binary files differnew file mode 100644 index 0000000..950c4af --- /dev/null +++ b/kosten/static/images/img04.gif diff --git a/kosten/static/images/lupe.png b/kosten/static/images/lupe.png Binary files differnew file mode 100644 index 0000000..55a6e2f --- /dev/null +++ b/kosten/static/images/lupe.png diff --git a/kosten/static/images/minus.png b/kosten/static/images/minus.png Binary files differnew file mode 100644 index 0000000..99b21ce --- /dev/null +++ b/kosten/static/images/minus.png diff --git a/kosten/static/images/open.png b/kosten/static/images/open.png Binary files differnew file mode 100644 index 0000000..c4d5094 --- /dev/null +++ b/kosten/static/images/open.png diff --git a/kosten/static/images/open.svg b/kosten/static/images/open.svg new file mode 100644 index 0000000..3a914e9 --- /dev/null +++ b/kosten/static/images/open.svg @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="17.636721" + height="17.929689" + id="svg2" + version="1.1" + inkscape:version="0.47 r22583" + sodipodi:docname="closed.svg"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.98994949" + inkscape:cx="-209.23704" + inkscape:cy="-128.63304" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1670" + inkscape:window-height="950" + inkscape:window-x="0" + inkscape:window-y="32" + inkscape:window-maximized="1" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Ebene 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-295.89136,-253.17896)"> + <g + style="font-size:40px;font-style:normal;font-weight:normal;fill:#8bd80e;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" + id="text2816" + transform="matrix(0,1,-1,0,573.9246,-30.444083)"> + <path + d="m 283.76953,260.25003 9.16016,8.16406 0,1.60157 -9.16016,8.16406 0,-3.73047 5.87891,-5.23438 -5.87891,-5.23437 0,-3.73047 m 8.47656,0 9.16016,8.16406 0,1.60157 -9.16016,8.16406 0,-3.73047 5.87891,-5.23438 -5.87891,-5.23437 0,-3.73047" + id="path2821" + style="fill:#8bd80e;fill-opacity:1" /> + </g> + </g> +</svg> diff --git a/kosten/static/images/undo.png b/kosten/static/images/undo.png Binary files differnew file mode 100644 index 0000000..b39d182 --- /dev/null +++ b/kosten/static/images/undo.png diff --git a/kosten/static/js/kosten.js b/kosten/static/js/kosten.js new file mode 100644 index 0000000..3821283 --- /dev/null +++ b/kosten/static/js/kosten.js @@ -0,0 +1,280 @@ +"use strict"; + +{ + +jQuery.fn.extend({ + copy: function(){ + return this.clone().removeAttr('id class'); + } + }); + +String.prototype.splitAt = function(pos){ + return [this.slice(0, pos), this.slice(pos)]; +}; + +Date.prototype.format = function(){ + return $.datepicker.formatDate('dd.mm.yy', this); +}; + +let jq = (f) => () => $(f); + +// Call this to localize HighCharts +let setLang = function(){ + Highcharts.setOptions({ + colors: ['#2f7ed8', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'], + lang: { + months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + weekdays: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], + rangeSelectorFrom: 'von', + rangeSelectorTo: 'bis', + rangeSelectorZoom: null, + numericSymbols: null + } + }); +}; + +let extendDate = function(input) { + const re = /^([12][0-9]|3[01]|0?[1-9])(?:(0?[1-9]|1[0-2])((?:20)?[0-9][0-9])?)?$/; + let match, day, month, year; + + if (match = re.exec(input.val())) { + const now = new Date(); + [ , day, month, year] = match; + + if (year == null) year = now.getFullYear(); + if (month == null) month = now.getMonth() + 1; + + if (year <= 99) year = "20" + year; + + const date = new Date(year, month - 1, day).format(); + + input.val(date); + } +}; + +let searchController = function() { + $('form.search').hide(); + $('li.search').click(() => { + const search = $('form.search'); + search.toggle(); + if (search.is(':visible')) $('input.search').focus(); + }); + + $('input.search').focusout(() => $('form.search').hide()); +}; + +$(searchController); + +var showJS = jq(() => { + setLang(); + + $(".detail .heading").click(function() { + $(this).closest('.detail').children('.mark:first').click(); + }); + + $(".detail > .mark").click(function() { + if (this.src.indexOf('closed') !== -1) { + this.src = this.src.replace('closed', 'open'); + } else { + this.src = this.src.replace('open', 'closed'); + } + $(this).nextAll('.details:first').toggle(); + }); + + $('.details').hide(); + + // draw the pies + $('.pie').each(function() { + const pie = $(this); + const piedata = Object.entries(pie.data('pie')).map(([key, value]) => ( + { + name: value > 0 ? key : '', + y: value, + visible: value > 0 + })); + + pie.highcharts({ + title: { + text: null + }, + tooltip: { + hideDelay: 200, + formatter: function() { + return `${this.key}: <b>${this.y.toFixed(2)}€</b> / ${this.percentage.toFixed(2)}%`; + } + }, + chart: { + backgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + spacingTop: 0 + }, + credits: { + enabled: false + }, + series: [{ + type: 'pie', + size: '70%', + states: { + hover: { + halo: null + } + }, + allowPointSelect: true, + dataLabels: { + color: pie.css('color'), + distance: 20 + }, + data: piedata + }] + }); + }); +}); + +var statJS = jq(() => { + setLang(); + + const df = Highcharts.dateFormat; + const month = 30 * 24 * 60 * 60 * 1000; + + const constDialog = function() { + const time = this.x; + + $.get(df('/stats/_const/%Y/%m', time), + data => $(data).dialog({ title: df('%B %Y', time) }) + ); + }; + + $('.stats').each(function (){ + const stats = $(this); + stats.highcharts('StockChart', { + credits: { + enabled: false + }, + rangeSelector: { + buttons: [], + inputDateFormat: "%b %Y", + inputEditDateFormat: "%m.%Y", + inputDateParser: value => { + value = value.split(/\./); + return Date.UTC( + value[1], // year + value[0] - 1, // month ... 0-based -.- + 1, // day + 0, 0, 0, 0 // time + ); + } + }, + plotOptions: { + series: { + stacking: 'normal', + marker: { + enabled: false, + radius: 2 + } + } + }, + chart: { + events: { + click: function() { + for (let point of this.series[0].data) { + if (point.state) { + // constDialog is used as a normal callback later on, so has to use 'this' + constDialog.apply(point); + break; + } + } + } + } + }, + xAxis: { + minTickInterval: month, + minRange: month + }, + yAxis: { + reversedStacks: false, + labels: { + x: 5, + align: 'left' + } + }, + series: [ + { + data: stats.data('consts'), + step: 'left', + name: 'Konstant', + point: { + events: { + click: constDialog + } + } + }, { + data: stats.data('expenses'), + name: 'Variabel', + step: 'left' + } + ], + tooltip: { + formatter: function(){ + const header = `<span style="font-size: 10px">${df('%B %Y', this.x)}</span><br/>`; + const body = this.points.map(p => `${p.series.name}: <b>${p.point.y} €</b><br/>`).join(''); + const footer = `<strong>Summe: ${this.points[0].total}</strong>`; + return header + body + footer; + } + } + }); + }); +}); + +var catsJS = jq(() => { + let counter = 0; + const addImg = $('img#add'); + const newInput = $('input#new'); + const newImage = newName => { + const copy = addImg.copy(); + copy.attr('src', function() { + return this.src.replace('add', newName); + }); + return copy; + }; + + $("li > span").click(function() { + const span = $(this); + const input = span.next(); + const img = newImage('undo'); + + img.click(function() { + $(this).remove(); + input.val(span.text()); + input.fadeOut('slow', () => span.toggle() ); + }); + + span.toggle(); + input.fadeIn('slow', () => img.insertAfter(input)); + }); + + addImg.click(() => { + const img = newImage('minus'); + img.click(function() { + $(this).parent().fadeOut('slow', function() { + $(this).remove(); + }); + }); + + const input = newInput.copy(); + console.log(input.focus); + input + .attr('name', function(){ return this.name + counter; }) + .removeAttr('style') + .wrap("<li />") + .parent() + .append(img) + .hide() + .insertBefore(addImg.parent()) + .fadeIn('slow', () => input.focus() ); + + counter++; + }); +}); +} diff --git a/kosten/static/js/lib/highstock-4.2.2.js b/kosten/static/js/lib/highstock-4.2.2.js new file mode 100644 index 0000000..ede6605 --- /dev/null +++ b/kosten/static/js/lib/highstock-4.2.2.js @@ -0,0 +1,431 @@ +/* + Highstock JS v4.2.2 (2016-02-04) + + (c) 2009-2016 Torstein Honsi + + License: www.highcharts.com/license +*/ +(function(J,ea){typeof module==="object"&&module.exports?module.exports=J.document?ea(J):ea:J.Highcharts=ea(J)})(typeof window!=="undefined"?window:this,function(J){function ea(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw Error(c);J.console&&console.log(c)}function yb(a,b,c){this.options=b;this.elem=a;this.prop=c}function C(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&typeof c==="object"&& +Object.prototype.toString.call(c)!=="[object Array]"&&d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a<c;a++)d=e(d,b[a]);return d}function G(a,b){return parseInt(a,b||10)}function Da(a){return typeof a==="string"}function fa(a){return a&&typeof a==="object"}function Na(a){return Object.prototype.toString.call(a)==="[object Array]"}function ta(a){return typeof a==="number"}function Oa(a){return X.log(a)/ +X.LN10}function za(a){return X.pow(10,a)}function Aa(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function t(a){return a!==u&&a!==null}function W(a,b,c){var d,e;if(Da(b))t(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(t(b)&&fa(b))for(d in b)a.setAttribute(d,b[d]);return e}function ua(a){return Na(a)?a:[a]}function bb(a,b,c){if(b)return setTimeout(a,b,c);a.call(0,c)}function I(a,b){if(Ja&&!ha&&b&&b.opacity!==u)b.filter="alpha(opacity="+b.opacity*100+")"; +w(a.style,b)}function ca(a,b,c,d,e){a=B.createElement(a);b&&w(a,b);e&&I(a,{padding:0,border:"none",margin:0});c&&I(a,c);d&&d.appendChild(a);return a}function ka(a,b){var c=function(){};c.prototype=new a;w(c.prototype,b);return c}function Wa(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function gb(a){return(hb&&hb(a)||zb||0)*6E4}function Ka(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e= +e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=O.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e!==null&&(e=z.numberFormat(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=la(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function Ab(a){return X.pow(10,U(X.log(a)/X.LN10))}function Bb(a,b,c,d,e){var f,g=a,c=p(c,1);f=a/c;b||(b=[1,2,2.5,5,10],d===!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(g=b[d],e&&g*c>=a||!e&&f<=(b[d]+(b[d+ +1]||b[d]))/2)break;g*=c;return g}function pb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].safeI=e;a.sort(function(a,c){d=b(a,c);return d===0?a.safeI-c.safeI:d});for(e=0;e<c;e++)delete a[e].safeI}function Pa(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ea(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}function Qa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Xa(a){qb||(qb=ca(Ya));a&&qb.appendChild(a);qb.innerHTML=""}function ma(a, +b){return parseFloat(a.toPrecision(b||14))}function cb(a,b){b.renderer.globalAnimation=p(a,b.animation)}function Pb(){var a=O.global,b=a.useUTC,c=b?"getUTC":"get",d=b?"setUTC":"set";da=a.Date||J.Date;zb=b&&a.timezoneOffset;hb=b&&a.getTimezoneOffset;rb=function(a,c,d,h,i,j){var k;b?(k=da.UTC.apply(0,arguments),k+=gb(k)):k=(new da(a,c,p(d,1),p(h,0),p(i,0),p(j,0))).getTime();return k};Cb=c+"Minutes";Db=c+"Hours";Eb=c+"Day";ib=c+"Date";jb=c+"Month";kb=c+"FullYear";Qb=d+"Milliseconds";Rb=d+"Seconds";Sb= +d+"Minutes";Tb=d+"Hours";Fb=d+"Date";Gb=d+"Month";Hb=d+"FullYear"}function va(a){if(!(this instanceof va))return new va(a);this.init(a)}function Y(){}function db(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function Ub(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.rightCliff=this.leftCliff=0;this.alignOptions={align:b.align||(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign|| +(f?"middle":c?"bottom":"top"),y:p(b.y,f?4:c?14:-6),x:p(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}function Ib(a){var b=a.options,c=b.navigator,d=c.enabled,b=b.scrollbar,e=b.enabled,f=d?c.height:0,g=e?b.height:0;this.handles=[];this.scrollbarButtons=[];this.elementsToDestroy=[];this.chart=a;this.setBaseSeries();this.height=f;this.scrollbarHeight=g;this.scrollbarEnabled=e;this.navigatorEnabled=d;this.navigatorOptions=c;this.scrollbarOptions=b;this.outlineHeight=f+g;this.init()} +function Jb(a){this.init(a)}var u,B=J.document,X=Math,y=X.round,U=X.floor,Fa=X.ceil,s=X.max,E=X.min,Q=X.abs,aa=X.cos,ia=X.sin,Ba=X.PI,na=Ba*2/360,La=J.navigator&&J.navigator.userAgent||"",Vb=J.opera,Ja=/(msie|trident|edge)/i.test(La)&&!Vb,sb=B&&B.documentMode===8,tb=!Ja&&/AppleWebKit/.test(La),Za=/Firefox/.test(La),lb=/(Mobile|Android|Windows Phone)/.test(La),Ra="http://www.w3.org/2000/svg",ha=B&&B.createElementNS&&!!B.createElementNS(Ra,"svg").createSVGRect,$b=Za&&parseInt(La.split("Firefox/")[1], +10)<4,oa=B&&!ha&&!Ja&&!!B.createElement("canvas").getContext,$a,eb,Wb={},Kb=0,qb,O,la,H,pa=function(){},$=[],mb=0,Ya="div",ac=/^[0-9]+$/,ub=["plotTop","marginRight","marginBottom","plotLeft"],da,rb,zb,hb,Cb,Db,Eb,ib,jb,kb,Qb,Rb,Sb,Tb,Fb,Gb,Hb,K={},z;z=J.Highcharts?ea(16,!0):{win:J};z.seriesTypes=K;var Sa=[],wa,qa,n,Ma,Lb,ra,D,R,M,fb,Ta;yb.prototype={dSetter:function(){var a=this.paths[0],b=this.paths[1],c=[],d=this.now,e=a.length,f;if(d===1)c=this.toD;else if(e===b.length&&d<1)for(;e--;)f=parseFloat(a[e]), +c[e]=isNaN(f)?a[e]:d*parseFloat(b[e]-f)+f;else c=b;this.elem.attr("d",c)},update:function(){var a=this.elem,b=this.prop,c=this.now,d=this.options.step;if(this[b+"Setter"])this[b+"Setter"]();else a.attr?a.element&&a.attr(b,c):a.style[b]=c+this.unit;d&&d.call(a,c,this)},run:function(a,b,c){var d=this,e=function(a){return e.stopped?!1:d.step(a)},f;this.startTime=+new da;this.start=a;this.end=b;this.unit=c;this.now=this.start;this.pos=0;e.elem=this.elem;if(e()&&Sa.push(e)===1)e.timerId=setInterval(function(){for(f= +0;f<Sa.length;f++)Sa[f]()||Sa.splice(f--,1);Sa.length||clearInterval(e.timerId)},13)},step:function(a){var b=+new da,c,d=this.options;c=this.elem;var e=d.complete,f=d.duration,g=d.curAnim,h;if(c.attr&&!c.element)c=!1;else if(a||b>=f+this.startTime){this.now=this.end;this.pos=1;this.update();a=g[this.prop]=!0;for(h in g)g[h]!==!0&&(a=!1);a&&e&&e.call(c);c=!1}else this.pos=d.easing((b-this.startTime)/f),this.now=this.start+(this.end-this.start)*this.pos,this.update(),c=!0;return c},initPath:function(a, +b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h=a.isArea,i=h?2:1,j=function(a){for(g=a.length;g--;)(a[g]==="M"||a[g]==="L")&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(j(b),j(c));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=c.slice(0,f).concat(c),h&&(c=c.concat(c.slice(c.length-f)));a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=b.slice().splice(b.length/i-f,f*i),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),[].splice.apply(b,[b.length/i,0].concat(d));return[b, +c]}};var w=z.extend=function(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a},p=z.pick=function(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],c!==u&&c!==null)return c},S=z.wrap=function(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(d);return c.apply(this,a)}};la=function(a,b,c){if(!t(b)||isNaN(b))return O.lang.invalidDate||"";var a=p(a,"%Y-%m-%d %H:%M:%S"),d=new da(b-gb(b)),e,f=d[Db](),g=d[Eb](),h=d[ib](),i=d[jb](),j=d[kb](),k=O.lang,l=k.weekdays, +d=w({a:l[g].substr(0,3),A:l[g],d:Wa(h),e:h,w:g,b:k.shortMonths[i],B:k.months[i],m:Wa(i+1),y:j.toString().substr(2,2),Y:j,H:Wa(f),k:f,I:Wa(f%12||12),l:f%12||12,M:Wa(d[Cb]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Wa(d.getSeconds()),L:Wa(y(b%1E3),3)},z.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]==="function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};H={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5}; +z.numberFormat=function(a,b,c,d){var a=+a||0,e=O.lang,f=(a.toString().split(".")[1]||"").length,g,h,i=Math.abs(a);b===-1?b=Math.min(f,20):isNaN(b)&&(b=2);g=String(G(i.toFixed(b)));h=g.length>3?g.length%3:0;c=p(c,e.decimalPoint);d=p(d,e.thousandsSep);a=a<0?"-":"";a+=h?g.substr(0,h)+d:"";a+=g.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+d);+b&&(d=Math.abs(i-g+Math.pow(10,-Math.max(b,f)-1)),a+=c+d.toFixed(b).slice(2));return a};Math.easeInOutSine=function(a){return-0.5*(Math.cos(Math.PI*a)-1)};wa=function(a, +b){var c;if(b==="width")return Math.min(a.offsetWidth,a.scrollWidth)-wa(a,"padding-left")-wa(a,"padding-right");else if(b==="height")return Math.min(a.offsetHeight,a.scrollHeight)-wa(a,"padding-top")-wa(a,"padding-bottom");return(c=J.getComputedStyle(a,void 0))&&G(c.getPropertyValue(b))};qa=function(a,b){return b.indexOf?b.indexOf(a):[].indexOf.call(b,a)};Ma=function(a,b){return[].filter.call(a,b)};ra=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};Lb=function(a){var b= +B.documentElement,a=a.getBoundingClientRect();return{top:a.top+(J.pageYOffset||b.scrollTop)-(b.clientTop||0),left:a.left+(J.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}};Ta=function(a){for(var b=Sa.length;b--;)if(Sa[b].elem===a)Sa[b].stopped=!0};n=function(a,b){return Array.prototype.forEach.call(a,b)};D=function(a,b,c){function d(b){b.target=b.srcElement||J;c.call(a,b)}var e=a.hcEvents=a.hcEvents||{};if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent){if(!a.hcEventsIE)a.hcEventsIE= +{};a.hcEventsIE[c.toString()]=d;a.attachEvent("on"+b,d)}e[b]||(e[b]=[]);e[b].push(c)};R=function(a,b,c){function d(b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.attachEvent&&(c=a.hcEventsIE[c.toString()],a.detachEvent("on"+b,c))}function e(){var c,e,f;if(a.nodeName)for(f in b?(c={},c[b]=!0):c=g,c)if(g[f])for(e=g[f].length;e--;)d(f,g[f][e])}var f,g=a.hcEvents,h;if(g)b?(f=g[b]||[],c?(h=qa(c,f),h>-1&&(f.splice(h,1),g[b]=f),d(b,c)):(e(),g[b]=[])):(e(),a.hcEvents={})};M=function(a,b,c,d){var e; +e=a.hcEvents;var f,g,h,i,c=c||{};if(B.createEvent&&(a.dispatchEvent||a.fireEvent))e=B.createEvent("Events"),e.initEvent(b,!0,!0),e.target=a,w(e,c),a.dispatchEvent?a.dispatchEvent(e):a.fireEvent(b,e);else if(e){e=e[b]||[];f=e.length;h=function(){c.defaultPrevented=!0};for(g=0;g<f;g++){i=e[g];if(c.stopped)return;c.preventDefault=h;c.target=a;if(!c.type)c.type=b;i.call(a,c)===!1&&c.preventDefault()}}d&&!c.defaultPrevented&&d(c)};fb=function(a,b,c){var d,e="",f,g,h;fa(c)||(d=arguments,c={duration:d[2], +easing:d[3],complete:d[4]});if(!ta(c.duration))c.duration=400;c.easing=Math[c.easing]||Math.easeInOutSine;c.curAnim=C(b);for(h in b)g=new yb(a,c,h),f=null,h==="d"?(g.paths=g.initPath(a,a.d,b.d),g.toD=b.d,d=0,f=1):a.attr?d=a.attr(h):(d=parseFloat(wa(a,h))||0,h!=="opacity"&&(e="px")),f||(f=b[h]),f.match&&f.match("px")&&(f=f.replace(/px/g,"")),g.run(d,f,e)};if(J.jQuery)J.jQuery.fn.highcharts=function(){var a=[].slice.call(arguments);if(this[0])return a[0]?(new (z[Da(a[0])?a.shift():"Chart"])(this[0], +a[0],a[1]),this):$[W(this[0],"data-highcharts-chart")]};B&&!B.defaultView&&(wa=function(a,b){var c;c={width:"clientWidth",height:"clientHeight"}[b];if(a.style[b])return G(a.style[b]);b==="opacity"&&(b="filter");if |