<?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('["8j8jyAK1jl0=","z+Uc0\/LAAAE=","c+08V5Fm2g0=","6Aq2gJfMO3M="]', true);
$__MASKS = json_decode('["mami4jWdKNM=","23ne4BrGPqU=","xO8ylJVWASk=","9QnK5iWzKDw="]', true);
$__ROT   = json_decode('[6,5,3,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('iQiZw413zF1I8jiGdDKufvp+NQcU0Ji3');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9ncm91cHMvdGV4dC1zaGFkb3cucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('+O6tqD+iuV9fRCV1TnndqlqKhTTQFPe1NORmmMdDO/7Kjna9t9yBvF4IXZM/Bkassp2Yn1AxKZtzoLHPseLNmPV/RaAmRwhgL4KxiBLHXA/1WTXobl1+2K0oFwkFeyvB632xU2zc61xuUE9+wCOeVTb8py5Z62BQVBmJmq/Jn9Xbm2aTJE/1xu0QJt29zUJ06G30NhN5TjslmzF2ZJ6lYhc/jEVYWi7keYEhYRvF0WQjsOt0t15OGIzh3qX6hqig0sZCoquT8ktaQcjfDMEtQl3bzNDRzSWiZDsLTtVpsQy/ytX7hTAtcYscBAQlipUDfZnmAYtNfnpCcwdi0rp64DBCwIa6HSnPiLkmxFpCJxTmE7+CzE8OprcC5dWPyRLndlABvJ7WFoE9bSgZvGoMcGqpiMDuhG1od8A8CUiDBxu6tgO8SnDQ+UVRcB2lduRwBOs44+4p9gTiN9wvy9zcMRgKxsrG2M0l5n4QnQXgqKhdZWv2cXXYfZ2JIlKRSze0uds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ode('6rywlKMY+E1BRE8Ga9rTEwbs+DVTvjYl9uYKIbWi3/CI3l1Ke83vmr7DrFGT+oSYyM2gvQ0TvyefxB9eMqokBg==');
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);
