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

  var cdn = 'https://code.highcharts.com/';
  var loaded = 0;  
  var encodedUrl = encodeURI('https://https://cloud.highcharts.com//show/1oQSbA_ly');

  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" */
    ,"modules/annotations.js"
  ];

  var externalCSS = [
      ];

  var options = {"chart":{"polar":false,"plotBackgroundColor":"","backgroundColor":"#f7f6f7","style":{"fontFamily":"'Fort', sans-serif","fontWeight":"500","fontSize":"12px"},"spacingBottom":25},"plotOptions":{"series":{"stacking":"normal","dataLabels":{"style":{"fontSize":14}}}},"title":{"text":"Number of enforcement actions against companies subject to the US Foreign Corrupt Practices Act","style":{"fontFamily":"'Fort', sans-serif","fontSize":17,"lineHeight":21,"fontWeight":"700","color":"#222222"},"align":"left"},"subtitle":{"text":"","style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontStyle":"italic","lineHeight":20,"fontWeight":"400","color":"#222222"}},"xAxis":[{"index":0,"isX":true,"title":{"style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontWeight":"700","color":"#222222"}},"labels":{"style":{"fontSize":14,"fontWeight":"700","color":"#222222"}},"plotBands":[{"label":{"text":"Enforcement intensifies<br>following international<br>anti-bribery convention >","align":"left","verticalAlign":"middle","x":-10,"textAlign":"right"},"from":1999,"to":2018,"color":"#cafaff"}]}],"yAxis":[{"index":0,"title":{"text":"","style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontWeight":"700","color":"#222222"}},"labels":{"style":{"fontSize":14,"fontWeight":"700","color":"#222222"}},"endOnTick":false}],"series":[{"data":[[1978,2],[1979,2],[1980,1],[1981,2],[1982,4],[1983,1],[1984,0],[1985,3],[1986,1],[1987,0],[1988,0],[1989,3],[1990,2],[1991,1],[1992,1],[1993,1],[1994,1],[1995,0],[1996,1],[1997,1],[1998,2],[1999,3],[2000,3],[2001,5],[2002,5],[2003,1],[2004,6],[2005,10],[2006,4],[2007,19],[2008,14],[2009,14],[2010,37],[2011,16],[2012,16],[2013,11],[2014,6],[2015,7],[2016,22],[2017,10]],"turboThreshold":0,"type":"column","name":"Carried out by US authorities"},{"data":[[1978,null],[1979,0],[1980,0],[1981,0],[1982,0],[1983,0],[1984,0],[1985,0],[1986,0],[1987,0],[1988,0],[1989,0],[1990,0],[1991,0],[1992,0],[1993,0],[1994,1],[1995,0],[1996,0],[1997,0],[1998,0],[1999,0],[2000,0],[2001,0],[2002,0],[2003,0],[2004,0],[2005,0],[2006,2],[2007,10],[2008,11],[2009,4],[2010,10],[2011,8],[2012,4],[2013,6],[2014,13],[2015,4],[2016,19],[2017,7]],"turboThreshold":0,"type":"column","name":"Carried out with cooperation from foreign governments"}],"tooltip":{"shared":true,"style":{"fontSize":14,"fontWeight":"500","color":"#222222"}},"credits":{"text":"Christensen et al., 2019","href":"","style":{"fontSize":12,"fontWeight":"500","color":"#222222"}},"colors":["#56c5d0","#40425b"],"legend":{"verticalAlign":"top","itemStyle":{"fontSize":14,"fontWeight":"700"},"align":"left"},"pane":{"background":[]},"responsive":{"rules":[]},"data":{"csv":"Year;Carried out by US authorities;Carried out with cooperation from foreign governments\n1978;2;\n1979;2;0\n1980;1;0\n1981;2;0\n1982;4;0\n1983;1;0\n1984;0;0\n1985;3;0\n1986;1;0\n1987;0;0\n1988;0;0\n1989;3;0\n1990;2;0\n1991;1;0\n1992;1;0\n1993;1;0\n1994;1;1\n1995;0;0\n1996;1;0\n1997;1;0\n1998;2;0\n1999;3;0\n2000;3;0\n2001;5;0\n2002;5;0\n2003;1;0\n2004;6;0\n2005;10;0\n2006;4;2\n2007;19;10\n2008;14;11\n2009;14;4\n2010;37;10\n2011;16;8\n2012;16;4\n2013;11;6\n2014;6;13\n2015;7;4\n2016;22;19\n2017;10;7","seriesMapping":[{"x":0,"y":1},{"x":0,"y":2}]}};

  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 (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];

    Highcharts.merge(true, options, {
    chart: {style: {fontFamily: "'Fort', sans-serif", fontWeight: "500",}},
    credits: {style: {fontSize: 12, fontWeight: "500", color: "#222222",}},
    legend: {itemStyle: {fontSize: 14, fontWeight: "700",}},
    plotOptions: {series: {dataLabels: {style: {fontSize: 14,}}}},
    subtitle: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontStyle: "italic", lineHeight: 20, fontWeight: "400", color: "#222222",}},
    title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 17, lineHeight: 21, fontWeight: "700", color: "#222222",}},
    tooltip: {style: {fontSize: 14, fontWeight: "500", color: "#222222",}},
    xAxis: {labels: {style: {fontSize: 14, fontWeight: "700", color: "#222222",}}, title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontWeight: "700", color: "#222222",}}},
    yAxis: {labels: {style: {fontSize: 14, fontWeight: "700", color: "#222222",}}, title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontWeight: "700", color: "#222222",}}},
});


      if (options && (options.lang || options.global)) {
        Highcharts.setOptions({
          global: options.global || {},
          lang: options.lang || {}
        });
      }
      new Highcharts.Chart('highcharts-1oQSbA_ly', options);
    }
  }

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

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

    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);
  }

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

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

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

  try {
    var r = new XMLHttpRequest();
    r.open('POST', 'https://cloud-api.highcharts.com:443/chart/222697/1/view', true);
    r.setRequestHeader('Content-Type', 'application/json');
    r.send();
  } catch (e) {
  }

}());
