<!DOCTYPE html>
<html>
  <head>
    <script>
var loc = location.href;

// Blockly files moved from /blockly to /static on 5 Dec 2012.
if (loc.match('/blockly/')) {
  loc = loc.replace('/blockly/', '/static/');
}

// Maze and Turtle moved from demos to apps on 29 Dec 2012.
if (loc.match(/\/demos\/(maze|turtle)\//)) {
  loc = loc.replace('/demos/', '/apps/');
}

// Vietnamese apps moved from vn to vi on 9 Jun 2012.
if (loc.match('/vn.html')) {
  loc = loc.replace('/vn.html', '/vi.html');
}

if (loc.match('/code/code.html')) {
  // Code moved to index.html on 7 Aug 2013.
  loc = loc.replace('/code.html', '/index.html');
} else if (loc.match('/apps/code/zh_tw.html')) {
  // zh-tw was changed to zh-hans on 25 Nov 2013.
  loc = loc.replace('/zh_tw.html', '/index.html?lang=zh-hans');
} else if (loc.match('/apps/code/index.html')) {
  // NOP.
} else if (loc.match(/\/apps\/code\/[-a-z]+\.html/)) {
  // Code became language-agnostic on 20 Jul 2013.
  loc = loc.replace(/\/([-a-z]+)\.html/, '/index.html?lang=$1');
}

if (loc.match('/apps/plane/plane.html')) {
  // Plane moved to index.html on 7 Aug 2013.
  loc = loc.replace('/plane.html', '/index.html');
} else if (loc.match('/apps/code/plane.html')) {
  // NOP.
} else if (loc.match(/\/apps\/plane\/[\d_]*[-a-z]+\.html/)) {
  // Plane became language-agnostic on 20 Jul 2013.
  loc = loc.replace('vn.html', 'vi.html');
  if (location.search) {
    loc = loc.replace(/\/[\d_]*([-a-z]+)\.html\?/, '/index.html?lang=$1&');
  } else {
    loc = loc.replace(/\/[\d_]*([-a-z]+)\.html/, '/index.html?lang=$1');
  }
}

if (loc.includes('/apps/puzzle/')) {
  // Puzzle moved to Blockly Games on 15 Oct 2014.
  loc = 'https://blockly.games/puzzle';
} else if (loc.includes('/apps/maze/')) {
  // Maze moved to Blockly Games on 10 Nov 2014.
  loc = 'https://blockly.games/maze';
} else if (loc.includes('/apps/turtle/')) {
  // Turtle moved to Blockly Games on 10 Nov 2014.
  loc = 'https://blockly.games/turtle';
} else if (loc.includes('/apps/')) {
  // Remaining apps moved to demos on 20 Nov 2014.
  loc = loc.replace('/apps/', '/demos/');
}

// Demos without saved data were moved to Blockly Samples in 2021.
if (loc.includes('/demos/fixed/')) {
  loc = 'https://google.github.io/blockly-samples/examples/fixed-demo/';
} else if (loc.includes('/demos/resizable/overlay')) {
  loc = 'https://google.github.io/blockly-samples/examples/resizable-demo/overlay.html';
} else if (loc.includes('/demos/resizable/')) {
  loc = 'https://google.github.io/blockly-samples/examples/resizable-demo/';
} else if (loc.includes('/demos/toolbox/')) {
  loc = 'https://google.github.io/blockly-samples/examples/toolbox-demo/';
} else if (loc.includes('/demos/maxBlocks/')) {
  loc = 'https://google.github.io/blockly-samples/examples/max-blocks-demo/';
} else if (loc.includes('/demos/generator/')) {
  loc = 'https://google.github.io/blockly-samples/examples/generator-demo/';
} else if (loc.includes('/demos/headless/')) {
  loc = 'https://google.github.io/blockly-samples/examples/headless-demo/';
} else if (loc.includes('/demos/interpreter/step-execution')) {
  loc = 'https://google.github.io/blockly-samples/examples/interpreter-demo/step-execution.html';
} else if (loc.includes('/demos/interpreter/async-execution')) {
  loc = 'https://google.github.io/blockly-samples/examples/interpreter-demo/async-execution.html';
} else if (loc.includes('/demos/graph/')) {
  loc = 'https://google.github.io/blockly-samples/examples/graph-demo/';
} else if (loc.includes('/demos/rtl/')) {
  loc = 'https://google.github.io/blockly-samples/examples/rtl-demo/';
} else if (loc.includes('/demos/custom-dialogs/')) {
  loc = 'https://google.github.io/blockly-samples/examples/custom-dialogs-demo';
} else if (loc.includes('/demos/custom-fields/turtle/')) {
  loc = 'https://google.github.io/blockly-samples/examples/turtle-field-demo/';
} else if (loc.includes('/demos/custom-fields/pitch/')) {
  loc = 'https://google.github.io/blockly-samples/examples/pitch-field-demo/';
} else if (loc.includes('/demos/mirror/')) {
  loc = 'https://google.github.io/blockly-samples/examples/mirror-demo/';
} else if (loc.includes('/demos/plane/')) {
  loc = 'https://google.github.io/blockly-samples/examples/plane-demo/';
} else if (loc.includes('/demos/keyboard_nav/')) {
  loc = 'https://google.github.io/blockly-samples/plugins/keyboard-navigation/test/';
} else if (loc.includes('/demos/custom-fields/')) {
  loc = 'https://google.github.io/blockly-samples/examples/pitch-field-demo/';
}

location = loc;

    </script>
  </head>
</html>