(function () {
  //Inject code v3.0.1

  var highcharts = document.createElement('script');

  var cdn = 'https://code.highcharts.com/';
  var loaded = 0;  
  var encodedUrl = encodeURI('https://https://app.everviz.com//show/-WBFsK80');
  var chartCreated = false;
  var scripts = [
    "highcharts.js",
    "modules/stock.js",
    "highcharts-more.js",
    "highcharts-3d.js",
    "modules/data.js",
    "modules/exporting.js",
    "modules/funnel.js",
    "modules/solid-gauge.js",
    "modules/export-data.js",
    "modules/accessibility.js"
    /* "modules/series-label.js" */
  ];

  var externalCSS = [
      ];

  var extraScripts = [
  "https://code.highcharts.com/modules/annotations.js"
  ,"https://code.highcharts.com/modules/annotations-advanced.js"
  ];

  var options = {"plotOptions":{"series":{"animation":false,"states":{"inactive":{},"select":{"color":"#EFFFEF","borderColor":"black","dashStyle":"dot"},"hover":{"color":"#a4edba"}},"allowPointSelect":true}},"colors":["#4b803e","#f47b2a","#46ad9b","#f5cb23","#b80d31","#482078","#d3556b","#1b5fab","#9ab92e","#ffa600","#793381","#a9a9a9","#183a7e"],"credits":{"text":"Humanities Indicators, 2019 | American Academy of Arts & Sciences","href":"humanitiesindicators.org","style":{"cursor":"pointer","color":"#999999","fontSize":"11px"}},"title":{"text":"V-06a: Average Minutes per Day Americans Age 15 Years and Older Engaged in Selected Leisure Activities","style":{"fontFamily":"Arial","color":"#333333","fontSize":"18px","fontWeight":"normal","fontStyle":"normal"},"margin":11,"y":22},"xAxis":{"type":"category","title":{"text":"","textAlign":"","useHTML":false,"style":{"fontFamily":"Lucida Sans Unicode","color":"#212121","fontSize":"12px","fontWeight":"bold","fontStyle":"normal"}},"endOnTick":false,"minorTickInterval":"","minorTicks":false,"tickWidth":1,"tickmarkPlacement":"on"},"series":[{"data":[],"turboThreshold":0,"_colorIndex":0,"_symbolIndex":0,"type":"line","marker":{"enabled":false,"symbol":"circle"},"tooltip":{"xDateFormat":"jrgarn@gmail.com","valueDecimals":1},"lineWidth":3},{"data":[],"turboThreshold":0,"_colorIndex":1,"_symbolIndex":0,"type":"line","marker":{"enabled":false,"symbol":"circle"},"tooltip":{"xDateFormat":"jrgarn@gmail.com","valueDecimals":1},"lineWidth":3},{"data":[],"turboThreshold":0,"_colorIndex":2,"_symbolIndex":0,"type":"line","marker":{"enabled":false,"symbol":"circle"},"tooltip":{"xDateFormat":"jrgarn@gmail.com","valueDecimals":1},"lineWidth":3}],"chart":{"plotBorderWidth":1,"height":500},"subtitle":{"text":"2003–2018","style":{"fontFamily":"Lucida Sans Unicode","color":"#666666","fontSize":"14px","fontWeight":"normal","fontStyle":"normal"}},"caption":{"text":"","style":{"fontFamily":"Default","color":"#616161","fontSize":"10px","fontWeight":"normal","fontStyle":"normal"}},"chartarea":{},"plotarea":{},"tooltip":{},"annotations":[],"yAxis":{"title":{"text":"Minutes Spent on Activity","style":{"fontFamily":"Lucida Sans Unicode","color":"#212121","fontSize":"12px","fontWeight":"bold","fontStyle":"normal"}},"type":"linear","tickInterval":25,"min":0,"max":200},"stockTools":{"gui":{"enabled":false}},"navigation":{"bindingsClassName":"tools-container"},"pane":{"background":[]},"responsive":{"rules":[]},"legend":{"itemStyle":{"fontFamily":"Default","color":"#333333","fontSize":"12px","fontWeight":"normal","fontStyle":"normal","cursor":"pointer"}},"labels":{"items":[]},"data":{"csv":"null;Playing Games & Computer Use for Leisure;Reading for Personal Interest;Watching TV\n2003;17.4;21.6;154.8\n2004;19.8;22.8;159\n2005;19.8;22.8;154.8\n2006;19.2;21.6;154.8\n2007;19.8;21;157.2\n2008;20.4;20.4;166.2\n2009;23.4;20.4;169.2\n2010;24.6;18;163.8\n2011;26.4;18;165\n2012;25.2;19.8;169.8\n2013;25.8;19.2;166.2\n2014;27;19.2;169.2\n2015;25.2;19.2;166.8\n2016;24.6;17.4;163.8\n2017;27.6;16.8;166.2\n2018;28.2;15.6;170.4","seriesMapping":[{"x":0,"y":1},{"x":0,"y":2},{"x":0,"y":3}]}};
  
  var templateDataSettings = {};

  var pluginCode = {};;

  options.data.complete = function(options) {
    const keys = Object.keys(templateDataSettings || {});
    keys.forEach(function(key) {
      const serie = options.series[key];
      (serie.data || []).forEach(function(d, i) {
        if (templateDataSettings[key].data && templateDataSettings[key].data[i]) {
          merge(d, templateDataSettings[key].data[i]);
        }
      })
    })  
    return options;
  }

  merge(options, pluginCode);

  function isNull(what){return(typeof what==='undefined'||what===null)}
  function isStr(what){return(typeof what==='string'||what instanceof String)}
  function isNum(what){return!isNaN(parseFloat(what))&&isFinite(what)}
  function isFn(what){return(what&&(typeof what==='function')||(what instanceof Function))}
  function isArr(what){return(!isNull(what)&&what.constructor.toString().indexOf('Array')>-1)}
  function isBool(what){return(what===!0||what===!1)}
  function isBasic(what){return!isArr(what)&&(isStr(what)||isNum(what)||isBool(what)||isFn(what))}
  function isObj(what){return what&&what.constructor.toString().indexOf('Object')>-1}
  function isEmptyObjectArray(arr){return isObj(arr[0])&&arr.some(function(b){return Object.keys(b).length===0})}
  function merge(a,b){if(!a||!b)return a||b;Object.keys(b).forEach(function(bk){if(isNull(b[bk])||isBasic(b[bk])){a[bk]=b[bk]}else if(isArr(b[bk])){if(isEmptyObjectArray(b[bk]))return;a[bk]=[];b[bk].forEach(function(i){if(isNull(i)||isBasic(i)){a[bk].push(i)}else{a[bk].push(merge(isArr(i)?[]:{},i))}})}else{a[bk]=a[bk]||{};merge(a[bk],b[bk])}});return a}

  function isScriptAlreadyIncluded(src){
    var scripts = document.getElementsByTagName("script");
    for (var i = 0; i < scripts.length; i++) {
      if (scripts[i].hasAttribute('src')) {
        const scriptTag = scripts[i].getAttribute('src') || '';
        if ((scriptTag.indexOf(src) >= 0) || 
            (scriptTag.indexOf('highcharts.src.js') > -1 && src === 'highcharts.js') ||
            ((scriptTag.indexOf('stock/highstock.js') > -1) && src === 'modules/highstock.js')) {
          return true;
        }
      }
    }
    return false;
  }

  function loadCSS() {
    var cssLength = externalCSS.length;
    for(var i=0; i < cssLength; i++) {
      var css = document.createElement('link');
      css.rel  = 'stylesheet';
      css.type = "text/css";
      css.href = externalCSS[i];
      document.body.appendChild(css);
    }
  }

  function createChart() {
    if(chartCreated) return;

    if (typeof window['Highcharts'] !== 'undefined') {
      

    if (options.yAxis && options.yAxis.length === 1) options.yAxis = options.yAxis[0];
    if (options.xAxis && options.xAxis.length === 1) options.xAxis = options.xAxis[0];
    if (options.zAxis && options.zAxis.length === 1) options.zAxis = options.zAxis[0];

    /*
// Sample of extending options:
Highcharts.merge(true, options, {
    chart: {
        backgroundColor: "#bada55"
    },
    plotOptions: {
        series: {
            cursor: "pointer",
            events: {
                click: function(event) {
                    alert(this.name + " clicked\n" +
                          "Alt: " + event.altKey + "\n" +
                          "Control: " + event.ctrlKey + "\n" +
                          "Shift: " + event.shiftKey + "\n");
                }
            }
        }
    }
});
*//*
// Sample of extending options:
Highcharts.merge(true, options, {
    chart: {
        backgroundColor: "#0d233a"
    },
    plotOptions: {
        series: {
            cursor: "pointer",
            events: {
                click: function(event) {
                    alert(this.name + " clicked\n" +
                          "Alt: " + event.altKey + "\n" +
                          "Control: " + event.ctrlKey + "\n" +
                          "Shift: " + event.shiftKey + "\n");
                }
            }
        }
    }
});
*/


      if (options && (options.lang || options.global)) {
        Highcharts.setOptions({
          global: options.global || {},
          lang: options.lang || {}
        });
      }

      if (Highcharts.Annotation) {
        Highcharts.Annotation.ControlPoint.prototype.redraw = function (animation) {
          this.graphic[animation ? 'animate' : 'attr'](
              this.options.positioner ? this.options.positioner.call(this, this.target) : null
          );
        };
      }
      
      chartCreated = true;
      window.HighchartsCloud.hasLoaded = true;
      new Highcharts.Chart('highcharts--WBFsK80', options);
    }
  }

  function check(scripts, cb) {
    if (loaded === scripts.length) {
      if (cb) {
        cb();
      } else {
        for (var i = 0; i < window.HighchartsCloud.ondone.length; i++) {
          try {
            window.HighchartsCloud.ondone[i]();
          } catch(e) {
            console.error(e);
          }
        }
      }
    }
  }

  function loadScript(s, scripts, cb) {
    if (!s) next();
    
    function next() {
      ++loaded;
      if (loaded < scripts.length) {
        loadScript(scripts[loaded], scripts, cb);
      }
      check(scripts, cb);
    }

    if (isScriptAlreadyIncluded(s)) {
      return next();
    }

    var n = document.createElement('script');

    n.onload = function () {
      next();
    };

    if (s.indexOf('https') >= 0) {
      n.src = s;
    } else {
      n.src = cdn + s;
    }
    document.body.appendChild(n);
  }

  function loadExtraScripts(){
    if (extraScripts.length > 0) {
      loaded = 0;
      loadScript(extraScripts[0], extraScripts);
    } else {
      check(scripts);
    }
  }

  function loadExtraScriptsAndMakeChart(){
    loaded = 0;
    if (extraScripts.length > 0) {
      loadScript(extraScripts[0], extraScripts, createChart);
    } else {
      check(extraScripts);
    }
  }

  if (typeof window['HighchartsCloud'] === 'undefined') {
    window.HighchartsCloud = {
      ondone: [createChart],
      hasWrapped: false,
      hasLoaded: false
    };

    loadScript(scripts[0], scripts, loadExtraScripts);
    loadCSS();

  } else {
    if (!window.HighchartsCloud.hasLoaded) window.HighchartsCloud.ondone.push(loadExtraScriptsAndMakeChart);
    else loadExtraScriptsAndMakeChart();
  }

}());
