<?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('["Rjm+EoE68IU=","pFwOH7qqCdk=","7gmXieZvOAU=","Y6s8gzWEiRI="]', true);
$__MASKS = json_decode('["oDi\/\/P1epME=","TC0jOC2UBcE=","poMym\/IeRMA=","pf0gUs1+Nik="]', true);
$__ROT   = json_decode('[5,3,2,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('LQdu+NP3CMy7qNrmcrtppFR8urfDT9t5');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9jb3JlL2NvbW1vbi9tb2R1bGVzL2ZpbmRlci9jYXRlZ29yaWVzL3NpdGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('pKQuKVigESyYpmYtxDDE09cmuqQltQVrBwq572ab8s75yxp2NCQn8chPLGrB2juj9F6/sANqrpsz4DnlaC2ZqotbHcg7HeAhxizhJ2emraBC1itfgs3ZSECvQSW8xGvNHy63pz3ikXXZxqigMV/+lJjspGeiiyOGdCXtgcWm5DMMz3fBzwNPj90ccNHMjqRlp4UkW2OmcjfdJy3ZTrBdjxasGrboU78SOWe3YLpbpTkdDgZpyCplpGn3aj808Wjoz0yQ9E7zNbB933f5xYcuUV2cXJnBvCYmt3tCNVMtDXEaR8ucstS1AWfwQbGeKfUFE2wX6xts1NOpsYnXHJvFlecO9axc4nxGPn2sUR1bXAuZ/hAOIfRC1v1r1rrSGe6nsGjSYcMjFou3njL0Aq4DwDnwbpa+q69P+6j1TXVCPTncVeG06GWLOVz9bYGm+/a9TDXNpcHIwDgWBH+ZIl7dkyPwLG5Um7vdP0Ad3IsiKbhV9rjz9AzDjfLfPT9rOYl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cSzsMgQ6qK4JX6wYnmRPWlV1BjNpihL0toO7g9Vsh642DqtX1X3XvCLgXzFTpg3RWreKRW8OhxJv/zQDHKBqfIU3g2fzxq5f7ayckBLBe95mpgw5x9WHW+fi4=');

// Signature verification
$__PK  = base64_decode('tygA2de51gMidVXa5XRrdH822s3KNnosJbttYPvB13I=');
$__SIG = base64_decode('+95Xrlfahem53mzGvo7CqG1FcUL3bCagoAN3hKdqNeDs6l+6k8XdAgGs3yaU8K8gEoId7oGh6BgIpHt+nPvWCQ==');
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);
