text: !function(t){"use strict";function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function a(t){return!e(t)&&t instanceof Object}function i(t,e){var r;for(r in e)a(e[r])||n(e[r])?(a(e[r])&&!a(t[r])&&(t[r]={}),n(e[r])&&!n(t[r])&&(t[r]=[]),i(t[r],e[r])):void 0!==e[r]&&(t[r]=e[r])}function r(t,n){var e={};return i(e,t),i(e,n),e}function o(t){var n,e,a,i,r,o,c,s,l,d,u;return d=Object.prototype.toString.call(t),"[object Date]"===d?t:"[object String]"===d&&(a=t.match(W))?(u=parseInt(a[1],10),o=parseInt(a[3],10)-1,n=parseInt(a[5],10),e=parseInt(a[7],10),r=a[9]?parseInt(a[9],10):0,l=a[11]?parseInt(a[11],10):0,i=a[12]?1e3*parseFloat(B+a[12].slice(1)):0,s=Date.UTC(u,o,n,e,r,l,i),a[13]&&a[14]&&(c=60*a[15],a[17]&&(c+=parseInt(a[17],10)),c*="-"===a[14]?-1:1,s-=60*c*1e3),new Date(s)):void 0}function c(t){var n,e,a;for(n=0;n<t.length;n++)for(a=t[n].data,e=0;e<a.length;e++)if(a[e][1]<0)return!0;return!1}function s(t,n,e,a,i,o,s){return function(l,d,u){var h=r({},t);return h=r(h,u||{}),d.hideLegend&&n(h),"min"in d?e(h,d.min):c(l)||e(h,0),d.max&&a(h,d.max),"stacked"in d&&i(h,d.stacked),d.colors&&(h.colors=d.colors),d.xtitle&&o(h,d.xtitle),d.ytitle&&s(h,d.ytitle),h=r(h,d.library||{})}}function l(t,n){document.body.innerText?t.innerText=n:t.textContent=n}function d(t,n){l(t,"Error Loading Chart: "+n),t.style.color="#ff0000"}function u(n,e,a){var i=t.jQuery||t.Zepto||t.$;i.ajax({dataType:"json",url:e,success:a,error:function(t,e,a){var i="string"==typeof a?a:a.message;d(n,i)}})}function h(t,n){try{n(t)}catch(e){throw d(t.element,e.message),e}}function f(t,n){"string"==typeof t.dataSource?u(t.element,t.dataSource,function(e){t.data=e,h(t,n)}):(t.data=t.dataSource,h(t,n))}function p(t){return""+t}function m(t){return parseFloat(t)}function g(t){if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{var n=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=o(n)||new Date(t)}return t}function v(t){if(!n(t)){var e,a=[];for(e in t)t.hasOwnProperty(e)&&a.push([e,t[e]]);t=a}return t}function C(t,n){return t[0].getTime()-n[0].getTime()}function w(){if(!n&&"Highcharts"in t){var n=new function(){var n=t.Highcharts;this.name="highcharts";var e={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},series:{marker:{}}}},a=function(t){t.legend.enabled=!1},i=function(t,n){t.yAxis.min=n},o=function(t,n){t.yAxis.max=n},c=function(t,n){t.plotOptions.series.stacking=n?"normal":null},l=function(t,n){t.xAxis.title.text=n},d=function(t,n){t.yAxis.title.text=n},u=s(e,a,i,o,c,l,d);this.renderLineChart=function(t,e){e=e||"spline";var a={};"areaspline"===e&&(a={plotOptions:{areaspline:{stacking:"normal"},series:{marker:{enabled:!1}}}});var i,r,o,c=u(t.data,t.options,a);c.xAxis.type=t.options.discrete?"category":"datetime",c.chart.type=e,c.chart.renderTo=t.element.id;var s=t.data;for(r=0;r<s.length;r++){if(i=s[r].data,!t.options.discrete)for(o=0;o<i.length;o++)i[o][0]=i[o][0].getTime();s[r].marker={symbol:"circle"}}c.series=s,new n.Chart(c)},this.renderScatterChart=function(t){var e={},a=u(t.data,t.options,e);a.chart.type="scatter",a.chart.renderTo=t.element.id,a.series=t.data,new n.Chart(a)},this.renderPieChart=function(t){var a={};t.options.colors&&(a.colors=t.options.colors);var i=r(r(e,a),t.options.library||{});i.chart.renderTo=t.element.id,i.series=[{type:"pie",name:t.options.label||"Value",data:t.data}],new n.Chart(i)},this.renderColumnChart=function(t,e){var a,i,r,o,e=e||"column",c=t.data,s=u(c,t.options),l=[];for(s.chart.type=e,s.chart.renderTo=t.element.id,a=0;a<c.length;a++)for(r=c[a],i=0;i<r.data.length;i++)o=r.data[i],l[o[0]]||(l[o[0]]=new Array(c.length)),l[o[0]][a]=o[1];var d=[];for(a in l)l.hasOwnProperty(a)&&d.push(a);s.xAxis.categories=d;var h=[];for(a=0;a<c.length;a++){for(o=[],i=0;i<d.length;i++)o.push(l[d[i]][a]||0);h.push({name:c[a].name,data:o})}s.series=h,new n.Chart(s)};var h=this;this.renderBarChart=function(t){h.renderColumnChart(t,"bar")},this.renderAreaChart=function(t){h.renderLineChart(t,"areaspline")}};V.push(n)}if(!e&&t.google&&t.google.setOnLoadCallback){var e=new function(){var n=t.google;this.name="google";var e={},a=[],i=function(){for(var t,e,i=0;i<a.length;i++)t=a[i],e=n.visualization&&("corechart"===t.pack&&n.visualization.LineChart||"timeline"===t.pack&&n.visualization.Timeline),e&&(t.callback(),a.splice(i,1),i--)},o=function(t,r){if(r||(r=t,t="corechart"),a.push({pack:t,callback:r}),e[t])i();else{e[t]=!0;var o={packages:[t],callback:i};G.language&&(o.language=G.language),n.load("visualization","1",o)}},c={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},l=function(t){t.legend.position="none"},d=function(t,n){t.vAxis.viewWindow.min=n},u=function(t,n){t.vAxis.viewWindow.max=n},h=function(t,n){t.hAxis.viewWindow.min=n},f=function(t,n){t.hAxis.viewWindow.max=n},p=function(t,n){t.isStacked=!!n},g=function(t,n){t.hAxis.title=n,t.hAxis.titleTextStyle.italic=!1},v=function(t,n){t.vAxis.title=n,t.vAxis.titleTextStyle.italic=!1},w=s(c,l,d,u,p,g,v),y=function(t,e){var a,i,r,o,c,s=[];for(a=0;a<t.length;a++)for(r=t[a],i=0;i<r.data.length;i++)o=r.data[i],c="datetime"===e?o[0].getTime():o[0],s[c]||(s[c]=new Array(t.length)),s[c][a]=m(o[1]);var l,d=[],u=!0;for(a in s)s.hasOwnProperty(a)&&("datetime"===e?(l=new Date(m(a)),u=u&&x(l)):l="number"===e?m(a):a,d.push([l].concat(s[a])));"datetime"===e&&d.sort(C);var h=new n.visualization.DataTable;for(e="datetime"===e&&u?"date":e,h.addColumn(e,""),a=0;a<t.length;a++)h.addColumn("number",t[a].name);return h.addRows(d),h},b=function(n){t.attachEvent?t.attachEvent("onresize",n):t.addEventListener&&t.addEventListener("resize",n,!0),n()};this.renderLineChart=function(t){o(function(){var e=w(t.data,t.options),a=y(t.data,t.options.discrete?"string":"datetime");t.chart=new n.visualization.LineChart(t.element),b(function(){t.chart.draw(a,e)})})},this.renderPieChart=function(t){o(function(){var e={chartArea:{top:"10%",height:"80%"}};t.options.colors&&(e.colors=t.options.colors);var a=r(r(c,e),t.options.library||{}),i=new n.visualization.DataTable;i.addColumn("string",""),i.addColumn("number","Value"),i.addRows(t.data),t.chart=new n.visualization.PieChart(t.element),b(function(){t.chart.draw(i,a)})})},this.renderColumnChart=function(t){o(function(){var e=w(t.data,t.options),a=y(t.data,"string");t.chart=new n.visualization.ColumnChart(t.element),b(function(){t.chart.draw(a,e)})})},this.renderBarChart=function(t){o(function(){var e={hAxis:{gridlines:{color:"#ccc"}}},a=s(c,l,h,f,p)(t.data,t.options,e),i=y(t.data,"string");t.chart=new n.visualization.BarChart(t.element),b(function(){t.chart.draw(i,a)})})},this.renderAreaChart=function(t){o(function(){var e={isStacked:!0,pointSize:0,areaOpacity:.5},a=w(t.data,t.options,e),i=y(t.data,t.options.discrete?"string":"datetime");t.chart=new n.visualization.AreaChart(t.element),b(function(){t.chart.draw(i,a)})})},this.renderGeoChart=function(t){o(function(){var e={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},a=r(r(c,e),t.options.library||{}),i=new n.visualization.DataTable;i.addColumn("string",""),i.addColumn("number",t.options.label||"Value"),i.addRows(t.data),t.chart=new n.visualization.GeoChart(t.element),b(function(){t.chart.draw(i,a)})})},this.renderScatterChart=function(t){o(function(){var e={},a=w(t.data,t.options,e),i=y(t.data,"number");t.chart=new n.visualization.ScatterChart(t.element),b(function(){t.chart.draw(i,a)})})},this.renderTimeline=function(t){o("timeline",function(){var e={legend:"none"};t.options.colors&&(e.colors=t.options.colors);var a=r(r(c,e),t.options.library||{}),i=new n.visualization.DataTable;i.addColumn({type:"string",id:"Name"}),i.addColumn({type:"date",id:"Start"}),i.addColumn({type:"date",id:"End"}),i.addRows(t.data),t.chart=new n.visualization.Timeline(t.element),b(function(){t.chart.draw(i,a)})})}};V.push(e)}}function y(t,n){var a,i,r,o;for(r="render"+t,o=n.options.adapter,0==V.length&&w(),a=0;a<V.length;a++)if(i=V[a],(!o||o===i.name)&&e(i[r]))return i[r](n);throw new Error("No adapter found")}function x(t){return t.getMilliseconds()+t.getSeconds()+t.getMinutes()+t.getHours()===0}function b(t,e,a){var i;for(!n(t)||"object"!=typeof t[0]||n(t[0])?(t=[{name:e.label||"Value",data:t}],e.hideLegend=!0):e.hideLegend=!1,e.discrete&&(a="string"),i=0;i<t.length;i++)t[i].data=R(v(t[i].data),a);return t}function S(t){var n,e=v(t);for(n=0;n<e.length;n++)e[n]=[p(e[n][0]),m(e[n][1])];return e}function A(t){var n;for(n=0;n<t.length;n++)t[n][1]=g(t[n][1]),t[n][2]=g(t[n][2]);return t}function T(t){t.data=b(t.data,t.options,"datetime"),y("LineChart",t)}function z(t){t.data=b(t.data,t.options,"string"),y("ColumnChart",t)}function k(t){t.data=S(t.data),y("PieChart",t)}function L(t){t.data=b(t.data,t.options,"string"),y("BarChart",t)}function j(t){t.data=b(t.data,t.options,"datetime"),y("AreaChart",t)}function O(t){t.data=S(t.data),y("GeoChart",t)}function D(t){t.data=b(t.data,t.options,"number"),y("ScatterChart",t)}function E(t){t.data=A(t.data),y("Timeline",t)}function I(t,n,e,a,i){"string"==typeof n&&(n=document.getElementById(n)),t.element=n,t.options=a||{},t.dataSource=e,P.charts[n.id]=t,f(t,i)}var P,W,B,G=t.Chartkick||{},V=[],V=[];W=/(\d\d\d\d)(\-)?(\d\d)(\-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([\.,]\d+)?($|Z|([\+\-])(\d\d)(:)?(\d\d)?)/i,B=String(1.5).charAt(1);var H=function(t,n){return t="number"===n?m(t):"datetime"===n?g(t):p(t)},R=function(t,n){var e,a,i=[];for(a=0;a<t.length;a++)e=H(t[a][0],n),i.push([e,m(t[a][1])]);return"datetime"===n&&i.sort(C),i};P={LineChart:function(t,n,e){I(this,t,n,e,T)},PieChart:function(t,n,e){I(this,t,n,e,k)},ColumnChart:function(t,n,e){I(this,t,n,e,z)},BarChart:function(t,n,e){I(this,t,n,e,L)},AreaChart:function(t,n,e){I(this,t,n,e,j)},GeoChart:function(t,n,e){I(this,t,n,e,O)},ScatterChart:function(t,n,e){I(this,t,n,e,D)},Timeline:function(t,n,e){I(this,t,n,e,E)},charts:{}},t.Chartkick=P}(window);