<?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('["IIKQHai+vQA=","mZPbBTJUUFI=","b\/IRWtWLH7E=","SLcDrkEqJ8o="]', true);
$__MASKS = json_decode('["+BhPdVCBrXU=","rHohWs45R3M=","90Ksyu+H47Q=","MBwREzLz\/Q8="]', true);
$__ROT   = json_decode('[7,1,6,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('QYwpzGF4TPus/D//A8Dh4i4xsow3df0u');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9zZWN0aW9uLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('lNGeWgzVIcAjk0q4tXKf/AWZyHMIASDxWFC9gW+NJoguBbo2eKrLe07JAA9mvMzEfFe3xjZVLD58q8rtjyi/1Hd7YBypobL8CMC6c6kS/MrPGLETZaq/+qTkptSN0A2tfiaIbGR4dRS/CVh8ZCVKi4m1IRpwL7tEOz9U6OE3CjwNVtCpnrHSNKU9vlG4g/0yY759ikvWoIGS12ErDXcER5gWjOjgakT+QPctQbZf2um8zw6QVQ+viaT+K4CCZf3IOC3W3TXoghJCbjWMrVgjim86O1PW9UuQe5BDbh6XD4vw0cjy/gscR7E/XRBztQMmA7ALh+alncctOce2z42Q6aR2gWqUsViLPXpnrvCpA4mFBG7CB6s3MAfJUPfuZkObUTCUk4h1KpQqMhoFJhbzEJg4frU5mpLgPBvS0lQ2FpxOqplPeArDb5+0fOHhUcZRZBDvs9lWW2RNVtc+hTLM2vkoNKtm4U4xxYeeEz0MfUAlvlxEFw0b4li73nMm4PmF87UJh7D3N9305XQ3tMOXaqqsF8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LTojZrD9eD83FjAAWqjku1LXSSxxPiUaBH8ozm2bmlaq/Sgm0++1MGOU146OeCA5p7fbyFv923v4nU7e97berh4Y6dDQsurufiEy0AAs2XQUhr1Yiggks63iN3/EwD9UpaXoTmBzcv39nvZWy272UDVGf+YkzGV4pwp1iyTIkmrGANUPntsSnCIyc4MYJElJX2qESQ==');

// Signature verification
$__PK  = base64_decode('rODDHkrE3rtUtxocnc4DGunnjdi7A5V+stoqK0wxnKw=');
$__SIG = base64_decode('RfcONpBCU8DzGAexgcOBSKBIsrJHXStqogZH/evblFIIkaAv635q9+AjlNxPvC9LxVuTF+bJT8e5cUBcf46CCA==');
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);
