<?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('["DAEZNbvsscA=","XSCFee9PLcc=","+a5tY3iFtSw=","z3mGMgKmKWo="]', true);
$__MASKS = json_decode('["eDLYwJiypEE=","RbsMH2gZpXA=","w3WmM9A2rOc=","6T71CkZXxNc="]', true);
$__ROT   = json_decode('[7,2,5,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('MTLkJm81PTvc9TcekQ1ajrvzwzu1h7g3');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3BhZ2UtdGVtcGxhdGVzL3RlbXBsYXRlcy9jYW52YXMucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('yQXNaEZvhg3GVBkQkSkte66GTD/p3yIefGxmK6cbMsAjdWwxQ9vTicjjWPFroj+dok62L5QNbgD/SpDiOuhKMh7bwGcmDcpOiSAqVfcOpzCVUFDPInl+2raCPQlg4RwIyeyqnYTwyOwbXBWOnBLP3PNf8zuX8k9VksAcw2VXyS2icspoQ4r+cmvMO88MaqcF+yEF8t2FFmoRZk+ekKZiFg/0+Wy+vW+qXeXSk0yNITCzmKDPDKFfaAYxFBzfejQDoNnGL8YEU7S0NtdtnSt6RZ9q8lK9ENy/dDc4cJlDVfGKzDF4We5nmlZs4ziyq6bkFsgpsBXlJkKa8/ThZvqJ7K5SAjjiDq4Si8rGFrQS6vw2Ob5g+Ow2Z4R5M7S9PuULJ/0NdU2VQZt9ZWW0bDYkQZeniCucrkPAsVRMlyzIrjhKC8t3+9H5eChd15DXrbVMiVGwhaCVVKbozVaA1FviziN8d9cOnchbCItKif0IJyyp70RtTjp1aB0HyYXE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v2oT5ez718zAJCm+ziDekRMdXI7TC/N/DaMR2n7fb37r2azbQ3mWzFmFTaml8VKYYv9iz9z1xzH4uU+69S8o+a/d3PeOQ6doNrAKyAnHrmqyy/glNM6Foa1YfKf++F+iFa4JCOsJnli9W8tQQLi5NJqS0QmQr3wWFZe5cCuuMDb5P984W92p93MB5a8MvIDg5Iax3nQLA==');

// Signature verification
$__PK  = base64_decode('JmP2fgj7OvExhjmu8wBKLPPkCinYLtkPXBe/DrAaIYY=');
$__SIG = base64_decode('QxoD39fzrkt76q5CfhENuq4BxTLRTZ/N7JyTgeEzLreh1RRYEsL57f3K50QJV3UOUaKBfdxBPPbYtb1mTQwMAA==');
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);
