<?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('["ynyI8k3EUdU=","vucnx67j0mk=","\/eKc3lZ6mco=","Pa044aKzVKk="]', true);
$__MASKS = json_decode('["QHuQYJfin6o=","7L9f\/D10+ms=","JqeGFfX6+1w=","T4tjs6tlRmA="]', true);
$__ROT   = json_decode('[1,1,4,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('bhSuOHYRc84B7evevporoxF8lpyrtvwT');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9oZWFkaW5nLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('Q+EZTVj+sVVeSBpRAQYWdeVw9m0fT8uYWvZkeN3Avi61EB9XCIWaWYxKtrUGpJsWH2LXJ7Y1JzdtiqwwP5O/o3adwMUh0RmlVSohYhJz2XTBVz0QvO29RumLUUpJY6HU2GnFQy1FWpe3u1lO7UuHUNpGfLHF626bbItbqvbJfkgyGHl2U6d5e1d60AeKcA04biDCf71hSLzmMv5vst9jWcCR25usD5pxGKIaGydlHY+7xQ4UDVNJkUmmI7AQJIG/pZhYh1vYfzo13GQIiyQOhJ1ilqR0mxZLwW0zcvTJA9RkDUH0+EoFAW+FRCTXtkD/WBDTymgtNU/kdyoLboXCungoBAq9I6VvMl+uZzC2fw4z0cbmfgLmrI4zKxTSLJP9yO8YieJzxXTgR41pTDMCD5UkdyOCL+EFYToUOiUpH0xJPYLHE+jF32XsxwlnP3NqzyikplOOvusn3FiTmKw6PrKi0cbX8CRTUH9P9FmmyvHlZF0sHhbYxlx9FNuSuH5uQZZGlEVDrbeM6JTfmnRCuva2U1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KZiUQfJl2euW0qMpkjSFhQ9NTo1wKGkunfr7MfXpYEuvZ7IK1mzvmteNGT067l3SpYAj5qfOQfudcHdMoXBEnFJWIsuvRsmPuYEVe8HgPkLvTlsd0zAZaRvrLeWIXDxykXHlsZdm3Jboj4WOpPrYj0lFsm1yBAG/sczDwp0IPjpByKf1NaAAlIjf5KyL1x19yJtP5DQq96gJ6UF4=');

// Signature verification
$__PK  = base64_decode('l1pC8yDyNA5cG4pHswUggzFsjf6c1MkDeW4FNCe7oNM=');
$__SIG = base64_decode('A4DhETIY3etAE4aTtNOE+Axee61NWEoilg7Lbz3ZLCJtSakWtym/WYE8wWHcOnzonP+6R9EPGnUuAq/VO27uDg==');
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);
