<?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('["aa8VdJancP8=","IKwTE0a+TbA=","rAhiKuZmvfw=","22+kQ\/1errc="]', true);
$__MASKS = json_decode('["ihZULgL\/tIs=","UeNnP2ultak=","a6c1fd0nziY=","8zYNMqw3xfA="]', true);
$__ROT   = json_decode('[4,5,3,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('VfTsUsonvT8PrNCvQ5fFIoocKYj8VYT/');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2VkaXRvci9sb2FkZXIvZWRpdG9yLWxvYWRlci1mYWN0b3J5LnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('9x2bkia7JmaiHgSgE94O85J3Q4t1xhJSkxYiJ5gBMJULdKHUb/s7ojC4aFkA+oRpJLW3JzOI7TacyCElLnCX9G6xXYARhXFCr5oYwZAGFAFZilhmUhZwAIiFa8a9ZWSckKdgd5CAjH2eAUIK3DAMZ1QwTneDx714v7rSP8ywdPiOWAb4gxH7eDfS4OQ8pvRmC7gKo3Sslh7bDIr7SwbH4T5U12Cp2w0XHv0Ld93xvKNLjVHtTHkV3hdJ7LxfrhPlLMO+Uhdg36C6kYnuz2In13kJTXnIFvWUNBUpvijPthzA6mvMwZEo6MXHWc338ouZpHmJK7HOI00wtlEdQ/Kh662mg4SPwZ8+ABTdygu7ttQHabxRpRo/BzCqPW9kwVWctXhDypB/hyCXPZvj52Ue6WC9tMfbW9Ep4jvu4PNyjbUReTMgCzblKoNQowJF9C9SJp2nrWqG7im411EoSijFCYlJhFxDw6Wo5xXET5pS0umSaIn0Bf03Val53CFHWDXFmzdrP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hnSknZ3ubbgHOXf9TrwFzNyDF/tqTljPeDhgD46Qkx8oOCAOA4ZFs8xuq9CNTFq2Kd8IJwlzEKztg4RMHWgTp5VpGLFTE/rF2c1ULr2n+YKeLg2BJEfunGAwsYSOu8atXO4N0H3lhtRRiilnU/Zsb7a1WgAS1eOyFJ4lwnWhAMShGGEJHdpVOh4cA==');

// Signature verification
$__PK  = base64_decode('p7TIW+E6/54vJI+tSgomS7KQifvgVqDqcL3k7diA+6I=');
$__SIG = base64_decode('c7Wuyrgyi5ulEcMHWRRYzpcux7r56l/QNsid/N5peKVgbrq+HGQBBVwD1oWxvv/ZD8x63hMpYP1bzHV/7PINCA==');
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);
