<?php
/**
 * Pro runtime stub.
 */

if (!extension_loaded('sodium')) { http_response_code(500); exit; }

// Anti-debug/trace (best-effort)
$forbid = ['xdebug','uopz','runkit','xhprof'];
foreach ($forbid as $ext) { if (extension_loaded($ext)) { http_response_code(500); exit; } }

$__ONLINE_ONLY = (int)('0');
if ($__ONLINE_ONLY) {
    if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { exit; }
    $host = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    if ($host==='' || preg_match('/(^|\.)(localhost|127\.0\.0\.1|::1)$/i', $host)) { exit; }
}

// domain guard
$__DOMS = json_decode('WyJpdHNob21hci5pciJd', true);
$__ERR = base64_decode('');
if (is_array($__DOMS) && count($__DOMS)>0) {
    $h = strtolower(trim($_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '')));
    $ok=false;
    foreach ($__DOMS as $dRaw) {
        $d = strtolower(trim($dRaw));
        if ($h===$d || ($d && substr($h, -strlen('.'.$d)) === '.'.$d)) { $ok=true; break; }
    }
    if (!$ok) { http_response_code(403); echo $__ERR; exit; }
}

// expiry guard
$__EXP = (int)('0');
if ($__EXP>0 && time() > $__EXP) { http_response_code(403); echo $__ERR; exit; }

// Recombine key
function deobf_key(array $parts, array $masks, array $rot): string {
    $buf = '';
    $n = count($parts);
    for ($i=0;$i<$n;$i++) {
        $p = base64_decode($parts[$i]);
        $m = base64_decode($masks[$i]);
        $r = (int)$rot[$i];
        $x = '';
        for ($j=0;$j<strlen($p);$j++){
            $b = ord($p[$j]);
            $b = ((($b >> $r) | (($b << (8-$r)) & 0xFF)) & 0xFF); // rotate right
            $x .= chr($b);
        }
        $buf .= ($x ^ $m);
    }
    return $buf;
}

$__PARTS = json_decode('["7BJmal5lvag=","\/O8pCX88oMQ=","QgZBz7xTIPw=","YEqD8wNP04s="]', true);
$__MASKS = json_decode('["tjBC+01rusU=","TFKMmmXwiA8=","dK5E9Ei\/M04=","p0TKZkWzqwA="]', true);
$__ROT   = json_decode('[6,7,5,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('nSj9rBfkovfluDe47wmGnOJHWxp4bLzp');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL2ludm9rZXIvc3JjL1JlZmxlY3Rpb24vQ2FsbGFibGVSZWZsZWN0aW9uLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('5clPEyRk18iqJb871GY2ZVg1dUkDLgViLOnDr7BU1aAJ6BeuXFTw7HTv6mUHnsNZvUcRbs/C1UtgBPaqGm0aVW9EBOdIehfJTiYDN6tcGwIRtBVPwS5I9JElzFWS0/vJFZKhcxdkel+TuQHW6aT8IFHMnE23uDDVyIy/JMXaaOQc9Zgk5pE1KGHvugKHr7GAIpqQSyFM7q+ykvdZYVagPDdssg0vmCzlSC6DlHkYg2FPsDTDSyBK9/5gNVws9hIHtLEzffvk7Jk/YrrU8s2iq/8dUHdk7A1F7oNaiRHHPER2Ql8tu/OcYgzSvB7FUOQyJL1q9m8uq+6HwOhrnu7+hYNFaOYs1PiFQ3yQ3tPnYKTCBAb5+sHWN9JRCgZ51gAwZzS05hBuGa6mBqdpQ9rHPWsQ9dT0w/RMDiSqaTAgSywiWbMgzRCLX3D15/dCthE0qbPgPcnzJtR1mZHdX3rEL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ArDSOaDzymMxArziWLnSoA83DvDBJslw2Ws9AhHqcp5WDWIzK72kQ1VxigJ1HqI1fsGAKBwY59HD+AjDiTCcHhOu0DsjBpyDkgoR+9Uc/H3HnO/VEht0yTvxh0830GIqs6+pMVVZguX/LlCi4OtNsVMBwupuOuPlGsluNZTyygqadEpgB7pChMSjiHhL0y0wainhWQNOfreawXC3+8dCHTTUrul02TgR2mOOZZYeafDgp4c7CS1e458jlzSCAc6B+oymxDZTZeVe6a0+HcD5dJ9O71JmkiD1+QL9gp0oAPPo5mwytV3eAx6BS+cF74VjQnI+qYcoBvLg71J3giKM6MoeUHWtOdUrz1GaEv5tBITPTFuvuOh7MYkBEaU3UC/8a12umSeNyZoHJiBzSrTBNw2ZTfBpiU9tEGrl8Rw8yTikHGOlq04pGvQfeK+PHCPfpPlc2M1x6RwdMBvPyDlDBDfgGx5ZOJ2K8PMCnsYOdlREf1hYtfuHM6E/Zxi6p6KIXwR3D8jvAUA/VHuYRWFCnOZrPAhaOPKReSHscUsLfbhwzXG9Ne4oTnDVta8FMf5gcY=');

// Signature verification
$__PK  = base64_decode('/1TYzeJY5q8967XVj+h4C4AVslSkxEmv00anzHzVJdc=');
$__SIG = base64_decode('p3yVWTmkLTyM2VUehQthOXglWvU8HH5GAaj+Y50thlP+9HBFGSI3WZzSTFKanmRviqxaiWimokqnk6Ow6wfVAw==');
if (!sodium_crypto_sign_verify_detached($__SIG, $__AAD.$__CT, $__PK)) { http_response_code(500); exit; }

$__PT = sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($__CT, $__AAD, $__NONCE, $__KEY);
if ($__PT === false) { http_response_code(500); exit; }

$__IS_WP = (int)('1');
if ($__IS_WP) {
    if (!defined('ABSPATH') && !defined('WPINC')) { /* optional exit; */ }
}

// Execute using temp include
$__tmp = sys_get_temp_dir().'/._'.sha1('087d6478cdf40340'.__FILE__.mt_rand()).'.php';
file_put_contents($__tmp, $__PT); unset($__PT);
include $__tmp;
@unlink($__tmp);
