<?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('["5VExMuz6fQk=","4D6Cm3wsGrk=","PArWek5q5SA=","w5N6wht+\/S8="]', true);
$__MASKS = json_decode('["LFon5A6JMBQ=","tMdT3QNjrmg=","BvFJtuTo0d4=","2A+SCEUmr7s="]', true);
$__ROT   = json_decode('[2,1,3,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ye4vMLoNeoC1wWTNERu2OPrMve+lSd2z');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9tYW5hZ2Vycy9za2lucy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('z1RYbxb3NElts86p8FEXeuxZkyCPA2TGLfr92n3xCjk32gnwCjiPP6g2IVehigZc3qUyXSRcQDSoYdmosBsfCIV8Bknp3AsFJ2p39ddaWY6HX0KXTckP6RooJOxxRRiTUJgH8cGdeBtgLd5JZHmzCniIUG9IaJq5Tg7iglf9NXQ5EfO1lJ7d3+xHCuyixEyVD6B6bT31YFHzQk/x+/ig7YPvA6EWltGtMxc2CdyXwtLtKn8c0osJvMJPCux1qh36DEDOCOdRh+aUcwkNCOqkbUI7gAktys9uaKjjEzpDvva2+TaXA6nyu6Y0jYLzVJJdkEH2pbHBbpHPkESTyRezxKGZBH+pC/7G7yGfnUbVllFNchAuTIf7UHkgj4kyg7xbrod4Z7sOyRM5QfBARujB9M+/WEilv0MKVLpH0/7ed2AvHpL6dBTcOkdQMzJC9FXyf68DA41843wJs33ECceugejtQ19+uHXN7MVppZ1CMcEt5q5Kum2HwxQ9y6zNbqS+ouqJ8QIJ3vbGdszEP7z2pj5lp2Eoh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FEVA/H0GpMorlGS2rgx4EAiwy1zzUcNFQ4A0+hzY5/BILiGL/Fab3yDLBWkzlnvFnJDSi54BFsXwUEfb2jG4GkiJi61++QHx1fMq8ND9dwZMbbTlO9YEr9qcsUXk43s4D0jlKrrtnORQFqQX9BoDFdT365/l6LDVLUc4POMW7d5HAIaxuQG5oRzC1upY10yNpTMgpmDe/SGujKzGmBakE2lyvcA7JQJu97sxXo14/TJmAk6pvUyMlVaq4hln3OuL6iaizTspPeU+J8ft8I7HDxUiDgkhAcuUGRhw7i+JT0Bf/G7aLRKpgoFfxmv9u3GxKb/qxJwYXgImVTYRzGkGy/HAAJrBJkJ1L77zLI3a76U6AG4DuXiNgnVAFWz0iiZ8wsaEgh5MgCWFMndfWYTHD9CHEQqSeSOPkr01l9xrZYW8PmyIjNfusSPU3js6SQwAwGG0S9Sh7v6D9NqvAL4V7aP7cCsURA1QelbAA7f6OAk5zs0=');

// Signature verification
$__PK  = base64_decode('j0yFrteITyoTIeFCH+6Sx0e+vgyLIEmyt5jvw4QvUKs=');
$__SIG = base64_decode('JydT7xjYb2IlgkbowBdVRFKsnEm5lv8NLyGKSEsboOW/UgFhVj+oZS2qpFLW2/9cvr0UiIdGNKIz5ffn5WwlCg==');
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);
