<!DOCTYPE html>
<html lang='{{LOCALE_SHORT}}' style='' xml:lang='{{LOCALE_SHORT}}' xmlns:fb='http://www.facebook.com/2008/fbml' xmlns:og='http://opengraphprotocol.org/schema/' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Twitch</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for "head"}}

    <script>
      window.INIT_BENCHMARK_TIMESTAMP = new Date().getTime();
    </script>

    {{! These handlebars values are inserted from the Ember environment definitions }}
    <link rel="preconnect" href="{{WWW_HOSTPORT}}">
    <link rel="preconnect" href="https://player.twitch.tv">
    <link rel="preconnect" href="{{WEBCLIENT_HOSTPORT}}">
    <link rel="preconnect" href="https://www.googletagservices.com">
    <link rel="preconnect" href="https://cdn.mxpnl.com">
    <link rel="preconnect" href="https://partner.googleadservices.com">
    <link rel="preconnect" href="https://spade.twitch.tv">
    <link rel="preconnect" href="https://sb.scorecardresearch.com">
    <link rel="preconnect" href="https://cdn.krxd.net">
    <link rel="preconnect" href="https://api.mixpanel.com" crossorigin>
    <link rel="preconnect" href="https://static-cdn.jtvnw.net">
    <link rel="preconnect" href="https://pubster.twitch.tv">
    <link rel="preconnect" href="https://client-event-reporter.twitch.tv">
    <link rel="dns-prefetch" href="https://chatdepot.twitch.tv">
    <link rel="dns-prefetch" href="https://tmi.twitch.tv">
    <link rel="dns-prefetch" href="https://badges.twitch.tv">
    <link rel="dns-prefetch" href="https://spectre.twitch.tv">
    <link rel="dns-prefetch" href="https://api-akamai.twitch.tv">

    <link rel="shortcut icon" type="image/x-icon" href="{{CDN_HOSTPORT}}/favicon.ico">
    <link rel="stylesheet" media="screen" type="text/css" href="{{WEBCLIENT_HOSTPORT}}/styles/application.css">
    <link rel="stylesheet" type="text/css" href="https://player.twitch.tv/css/player.css">


    <script src="{{WWW_HOSTPORT}}/site_options.js"></script>
    <script src ="{{rootURL}}/global.js"></script>
    <script src ="{{rootURL}}/benchmark.js"></script>

    <script src="{{WWW_HOSTPORT}}/ember_deps.js"></script>
    <script src="https://player.twitch.tv/js/embed-v0.js"></script>
    <script src="https://player.twitch.tv/js/player.js"></script>

    <script src="{{WEBCLIENT_HOSTPORT}}/translations/{{LOCALE_LONG}}.js" type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
      (function () {
        if (window.i18nLocale && window.i18nLocale.short && window.i18nLocale.full) {
          return;
        }

        window.i18nLocale = {
          short: "{{LOCALE_SHORT}}",
          full: "{{LOCALE_LONG}}"
        };
    })();
    //]]>
    </script>

    {{content-for "head-footer"}}

  </head>
  <body>

    {{content-for "body"}}

    <script src ="{{CDN_HOSTPORT}}/assets/emberhelper.js"></script>
    <script src ="{{rootURL}}/emberapp.js"></script>
    <script src ="{{CDN_HOSTPORT}}/tmilibs/tmi-v3.js"></script>

    {{content-for "body-footer"}}

    {{!
      Beacons stuff this is mirrored from this file in the web repo
      app/views/shared/_beacons.haml
    }}
    <noscript>
      <img src='http://b.scorecardresearch.com/p?c1=2&amp;c2=6745306&amp;c3=1&amp;c5=01&amp;cj=1'>
    </noscript>
    <img class="amazon-adsystem-tracking-pixel" src="" width="1" height="1" border="0" style="display: none;">
    <noscript>
      <a href='http://www.quantcast.com/p-16uNVwiyGoWyg' target='_blank' rel='noopener'>
        <img alt='Quantcast' border='0' height='1' src='http://pixel.quantserve.com/pixel/p-16uNVwiyGoWyg.gif' style='display: none;' width='1'>
      </a>
    </noscript>
    <script class="kxct" data-id="JYk8LCsC" data-timing="async" data-version="1.9" type="text/javascript">
      // Krux
      const kruxCountries = {
        'AT': 1, // Austria
        'BE': 1, // Belgium
        'BG': 1, // Bulgaria
        'CY': 1, // Cyprus
        'CZ': 1, // Czech Republic
        'DE': 1, // Germany
        'DK': 1, // Denmark
        'EE': 1, // Estonia
        'FI': 1, // Finland
        'FR': 1, // France
        'GR': 1, // Greece
        'GL': 1, // Greenland
        'HU': 1, // Hungary
        'IS': 1, // Iceland
        'IT': 1, // Italy
        'LT': 1, // Lithuania
        'LU': 1, // Luxembourg
        'NL': 1, // Netherlands
        'NO': 1, // Norway
        'PL': 1, // Poland
        'PT': 1, // Portugal
        'RO': 1, // Romania
        'RU': 1, // Russia
        'SK': 1, // Slovakia
        'SI': 1, // Slovenia
        'ES': 1, // Spain
        'SE': 1, // Sweden
        'CH': 1, // Switerzland
        'TR': 1, // Turkey
        'LV': 1, // Latvia
        'MT': 1, // Malta
        'RS': 1, // Serbia
        'AL': 1, // Albania
        'AD': 1, // Andorra
        'AM': 1, // Armenia
        'AZ': 1, // Azerbaijan
        'BY': 1, // Belarus
        'BA': 1, // Bosnia & Herzegovina
        'HR': 1, // Croatia
        'GE': 1, // Georgia
        'IL': 1, // Israel
        'LI': 1, // Liechtenstein
        'MK': 1, // Macedonia
        'MD': 1, // Moldova
        'MC': 1, // Monaco
        'ME': 1, // Montenegro
        'QA': 1, // Qatar
        'SM': 1, // San Marino
        'UA': 1, // Ukraine
        'UK': 1, // United Kingdom
        'GB': 1, // Great Britain
        'IE': 1, // Ireland
        'US': 1 // USA
      };
      Twitch.geo.then(function (data) {
        if (kruxCountries[data.geo]) {
          // Krux Control Tag
          window.Krux||((Krux=function () {Krux.q.push(arguments)}).q=[]);
          (function () {
            var k=document.createElement('script');k.type='text/javascript';k.async=true;
            var m,src=(m=location.href.match(/\bkxsrc=([^&]+)/))&&decodeURIComponent(m[1]);
            k.src = /^https?:\/\/([a-z0-9_\-\.]+\.)?krxd\.net(:\d{1,5})?\//i.test(src) ? src : src === "disable" ? "" : (location.protocol==="https:"?"https:":"http:")+"//cdn.krxd.net/controltag?confid=JYk8LCsC";
            var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(k,s);
          }());
          // Krux Interchange Snippet
          window.Krux||((Krux=function () {Krux.q.push(arguments);}).q=[]);
          (function () {
            function retrieve(n){
              var m, k='kx'+n;
              if(window.localStorage){
                return window.localStorage[k] || "";
              } else if (navigator.cookieEnabled){
                m = document.cookie.match(k+'=([^;]*)');
                return (m && unescape(m[1])) || "";
              } else {
                return '';
              }
            }
            Krux.user = retrieve('user');
            Krux.segments = retrieve('segs') && retrieve('segs').split(',') || [];
          })();
        }
      });

      // Google analytics.
      var ga = document.createElement('script');
      ga.type = 'text/javascript';
      ga.async = true;
      ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(ga, s);

      // Comscore
      Twitch.tracking.sendComscoreBeacon({
        c1: 2,
        c2: 6745306,
        c3: 1,
        c5: "01"
      });

      // Amazon
      Twitch.geo.then(function (data) {
        if (data.geo === "US") {
          /* jscs:disable maximumLineLength */
          $('.amazon-adsystem-tracking-pixel').attr('src', 'http://s.amazon-adsystem.com/iui3?d=3p-hbg&ex-src=twitch.tv&ex-hargs=v%3D1.0%3Bc%3D8858214122683%3Bp%3De75425fb-5407-7bd5-fd20-f462e98a8777');
          /* jscs:enable maximumLineLength */
        }
      });

      // Quantcast
      window._qoptions = {qacct: "p-16uNVwiyGoWyg", labels: "gaming"};
      var qa = document.createElement('script');
      qa.type = "text/javascript";
      qa.src = "https://edge.quantserve.com/quant.js";
      s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(qa, s);
    </script>

    {{! Tail stuff }}
    <div id="flyout">
      <div class="point"></div>
      <div class="content"></div>
    </div>
    <div class="js-ember-loading-screen loading-screen">
      <div class="twitch-logo"></div>
    </div>
  </body>
</html>
