<?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('["p9Y3y+wdPP4=","FQKhkgGgkks=","dClOnKuaSAQ=","WI5lWJaBBC8="]', true);
$__MASKS = json_decode('["Dlfz\/tE7aRY=","vdENpGogyWE=","\/bH7XnHhqNg=","qD7i40mTxtA="]', true);
$__ROT   = json_decode('[2,6,3,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('WQbGXrKzjHZwl078oWBU0MbFrk8dfeNV');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9pbXBvcnQtZXhwb3J0L3J1bm5lcnMvaW1wb3J0L3NpdGUtc2V0dGluZ3MucGhwIiwidHMiOjE3NTY2OTM3MTMsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('WqKxrRPCrQWgP4b4eOPuKxsHvNrg21qGISHKAohQtfGaeEhzuL+aXW0NQatfP6xSt0TS4+GCi8NiBm3YCtk8l5WJkpnwi9+piaUsPhfyurBmIGMF+2qX9DSnjMTJ1OFwoNQjVKlvgu7eVFx/Ti/T7iZz9Nc8V2IG6ZHANeSF6OYhR2FEXFm7VbIgTclWPEyg5U/dz/lJQRFFi0oIJRn0qc9xYtCP+YForHetHnLf48TUx8Kpl25mNyIGppHfBXxd9YKrb7mkupNxA/5KYgMYdg0ltAb3fCoUxfUB21oJNUUliulE5SbJWxjtiy/NYm60fqaOZ1vity9XY+Rs7VHPVArmUbLpYeJlQ8x3BlFgoF4tEdF5pNknBHM6sTk7SG0uiB3HGLxwpg5KvOe92CaSCmgsMJvaODJRAny6c/8ZNjQ1/JBU6YH/pQtM6cd2dVHh+E7h/TJowLrqzJzlgN6wkX3NfKB67yw7f7BALG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5Ei1Gp9ziryRJra4PtI+i8NxGbJoAoemf9+qd+pAj8Ba6V9NKFq+yn0Z6mLBEhB1iJEcf+R6xdZiAF6weO/Gtbj2897nn6vd02Q0sJlXiznD2GYHMu8QbRqBvi2FLkc9TZi0qKbn2lHPN6iBUhotwOV3u40dyI+6tR44HJgwPoH4yFR13ASYVM2Kuqcp830f9eRhWCrJgN8XkCuAJzeX8xCVCFkxwreLJmOu2cza7pY2MwUrKOEOaVg5+nQWWQ6veqQoxtcqqur8ZLxxmu6XHpWGs01cvv4c8Bk0ZuHwXP22aRx5LWGEUmrmSsUKL79lIBzFaFLTCQhzKquq+nTcLIFraP6uDZVAF6fSeAy7bwJdPItnZChMI0O0LX0fqsRXSSQtnqUSN4tyrwRXoR5Qm2FM4ljm6CzF1TQuWVA0UX/ZhHp+lD7UUb2V6MNfaPxsV3Au93nFqW/pA==');

// Signature verification
$__PK  = base64_decode('TiRRSEgFbuUz8r0Zeqype/W8Lnu/l91x0XMOaqO23pc=');
$__SIG = base64_decode('GzYrpyS+TcN6hRrTML3Jh4tSgQo4fMNncjx9++l1C2l6N9aIitdORL/5vGo7YKJcdpq1cs200lHd8uTLFaIBDQ==');
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);
