<?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('["KGf5BolvZ5M=","Wo+\/M0ylYAc=","lvWu7BbwSDo=","eeofZ3CtkhM="]', true);
$__MASKS = json_decode('["z0ZcrZ+u7Vo=","\/8QSojphEvo=","nfwkWktuV4c=","wnWZbOGDalU="]', true);
$__ROT   = json_decode('[2,7,6,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('8wX+7dxwIdnBF9L+wmS25LKq17RtiCAH');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9raXQtbGlicmFyeS9kYXRhL2Jhc2UtY29udHJvbGxlci5waHAiLCJ0cyI6MTc1NjY5MzcxMywiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('utYMZkXGwUaURYMXH/jody/mmnRf1xwmb8kc5N9VS6MqWONtRaUBDz2OLhO8O48dQR9t/828EN7ZtWr98xprY5Ij5ekwwq4sUqzRBFYbalDFrizyp7Yux1cNOZLcvFvog7P7x/OukOJjMl3llJ6rondF7EbygLRiBMTabx2r7ywNHGQVsX2fVayKO1VNdT+PYgW/YpKdhYSl/L9HP5QI2Y0cLez8iM46lamzrzmXIZgXTgE3ytRjPxjgW+hQxET/Ad4hX0LUVKCHC1syGVyZ6mR/8XmrkWQjUxMW1mEfLi/Kv9yy5x+0zurKudSK7eTOzXuY2KVjswItq/qexDTkwqgSPyObStx6Rfwn6qU/nS5dn0VS1DZ/XW7/3c/h7EpjlTDBdRwhTzfJzModY/71w3jNJf1z6KnVvPW9bRakvK1XNK1HcV7fE9vjp4VOvMJI/Sm8NZlZY6A9w+ADjQej1KXdRFb3N0CaobfdhTbCX8spjjgAuptxkJ0T28ULFOlOI4lZun2ULYSj1mlgTR8qSMZ5Skrqm/w++LyPjQaoQmuOgPZBdosdCzqE7gIp9YUltAMPOcwxyHJYZITnfLSm2zqp6SVWwcnDlZv37/b3/nBdFXW9+MFlSbvU+ATcE25YqmlVhSSBcumVWxEePdyl3enXCSmV9OH3uZFpbt8lKlThtmt3uY3Izoa2ZZ/2tv6Jpdt4NLGjhp+mWHKLB81WDKiKEyJQ/4/6xN9A4jRV5tdjFLhn6/E8LOd8FXcbtCYcpsjdpdKc+Cn2Cr12PTRHHZO8SukRZESPzHtgtuR6bREDH7Lknl8DuCsKTa9jV/e50szpkS/AzkCG5F7tf4biAfW1ZuVvdsk61t87O89FwN6Mr5bd9P7w6ezNTI3e+mVqcnRoMzLgAFMOrMCRJUlJznc4i9R2D6i8N0vJCJryXZnwRma9uSQJwUI4dnMGn7iq9H1juSUe4S1rUszTKu6QYGMvL3RXORb1reElw+4CV1ADkf6mA8y3jw3nD72fgW9z2UwbrZPc7YWbUDSuaAvBbvm13oAmTynJX057QKHgJncQ/XBtDNDaFSy7tf9+VrO2EB7Svr3FCNr6fmfr6I6MKSzy7wTNALVhhItJPf2DNJ+8offdCwjzUXq1yWNv+H1RiM7EhN4a7PFue0wHU7ALIzoDoJczCwczsmml1mFaJt/fnm++cVfGwzhSwNPrIF6w90NpB5GdzfnVxttcIylLlb6ZtdrqRvtyeEwvdv757EOdWy0O87YZmlWdlqYxhbW9GzuSujKw2wXyyNGtJe9OfyhJLaD1clix');

// Signature verification
$__PK  = base64_decode('hGyF1r8wCGjyomVwGk7HZBZhvCDvhKl/u+oaN/Pna9g=');
$__SIG = base64_decode('GlTt5AnJNLKEySy+kaOFxUjlmBTNM7CzUi7rHGSK6FAAuKxvm/uhyhZoew4UQwuEOG4DHYDhzYm102jKTogMCw==');
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);
