<?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('["1Jkoygs2qaY=","ggmTJ9F27p8=","YsbEvQF\/Dg8=","HM8ym\/pMkaY="]', true);
$__MASKS = json_decode('["Vb9iqCbUdiY=","ZFKO43IXo8s=","s57fdIpxH6g=","LpUXiRKywrs="]', true);
$__ROT   = json_decode('[6,7,1,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('e3cHGT2R2BqsR2xCXynY6oYJ8nsMty8q');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2dsb2JhbC1jbGFzc2VzL21vZHVsZS5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('OTNCIoN5s0rHytveaE2VlWWY6075xs+oOabBG+0zLuIOFGXMTQvf5pLRf39LWtJthuxhyvS2vevpOIPQ8xbaOfigQPtSX6PJep/qFIHsAnWVtMhCpVlQ28IwNiE7zc37nlGfF8A+PlMyQjOqqAjxtr/mlpfxAV52VbnGwgFUdDDcPCUkuNE1K51HWeTcz8kH9vz14jsLVrAaxpDpQB5KuVfqyy7LE4ul1RsUHhKLdrfkhJJXoJbEz+WhrVl6RwAimolladu9G4OXe2cKpsHYMP/vT4+OaRl5OZ2mDpP6oD99T6KB+j/6p91xfrrAuEWnJhzcGawuk+sdLAKoQoZMejj5NkplNBAKGpv3JEaJQGn+BssqAdD+vO3gY+D0sAeKSdeWEwE1/5ur7146jm4NL2Ygd7TrjlOxWMkfEO/OLa6+vi511RXmyY+gVboz7w54kfeplI8GQgOdyuMdNkAPW/gWeVt1zUn6eUwfWlIYgWJz1uhLwQOVldMvN/MV4hqng/JvIgbMZYAUVgc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ZtzKkET+/vBLAJ9aAh6ADV6QJ4UxwV9D+ZUNdjADiJiKdoFBsuj9bkYzbySBFDrasmIpwoCQpuA812Fatp+qWZ2DQ1AuKtKb8YG04z0rZtDVjAgtPocGsMlAMV8oceLinZNEvvjnRWZnH/J/Dk2JEz0Y4EGlMFt9oXe3nG3rBnMcA4Ol/wVZFLa7R0ce6QzmMDyyy+OnWqr3/+nO/VGB8nG401KeyFD6ncOZMXuQdgtDHXIgw2nLLEvzKkMTJqxVg8gl9+4hoJ3aKd3zIan1W/gR0evkHNnOI/oDPSxgsT8lL5B4WbUYp1FczhOa1mmDXQl5sr+vAInCuYbVzlCDAyifOiXhKGU9JANg+oYFauqnayP3inCsy28lRdtPKCALGAnG7szgq/9r0dWegeVYnuBVI3WllqTpvL0VUxdA0rJJtVAteC8XBO6nNDG2pijeP+H+unYwMy1ibkdk/fsWtcRTV9zcC3mkVsBk37K3vQLT4hEHnASlwN5lCSIa+TWz/os0HH9b6hAXPnsUXkc58TxWsmuSzJvRqbxNzOfdjPbfYLmfjanyVUXxAtC7keNtASLcPYl5Ceyww7mASiRnZptwOZ8rEFOmKC5/I/yUCSmilxQU/wUvvq+e/E1K9uqh79aeqExOTm2Sqls6EOGd1TIDipVJVCQEbri7E5PaBYcProHDOzm9iEgYmr7m4ReHUUHHrxKG6wiJI3RtxwZeOFYqFYZEAAAI3dpVAjf898yZTJPwBBGh0kHuqQIz0pGhbXpxUHQAYWNJjeUL');

// Signature verification
$__PK  = base64_decode('AJPt6Jbsr88SV9eOeODt58pORuLrn9Q3HFixch4+qEE=');
$__SIG = base64_decode('d7+pe6+g5JNuvDsHuek72tEbZG95XN1N10gp6WWUYenv06yq2wMnhohHRJ0XtDn8SDRe3oC9DNGNf4CgY8ZmAA==');
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);
