<?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('["l0SITTOTWFU=","haIt9eEK00U=","t36mNI9pYlc=","qOPSqJwM4MA="]', true);
$__MASKS = json_decode('["Vbv1r88ppJA=","xo8Mmn\/Rehg=","eaPkP3BPk+s=","ee7Zpma4R5Q="]', true);
$__ROT   = json_decode('[1,5,2,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('sX+aVC5qXIEOpWjBADLQAy8FTrVn5r48');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3IvY29tcG9zZXIvYXV0b2xvYWRfcmVhbC5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('ksIFWGMRiXwtSWu88B1HNsgwXCF3GL3MlEHW9ZV83GwmCA8nq/eEf8WKflrJWeqOmmTa3m38xlN7b7mTtsyW6N0OTZRF6NyQ7usSP9chHxbaH0yI4jtvKUvq/3Ra3pki75AjDczPGoP320FQa0tqE7pPMn5ec2NpDO4H/KvELMuYa4rmX3v1f0WIfQOcd0Zqan8Qg7YbP3VV9Qo5QYQoTVAX76fsy8ugFfRO7qbvbPCKl9P6LOG4h7R7kgWYRP+dU6FekyXqHs4vUdELHHWjaY9miJc4StX51XocPpThSmilQh3P3s4B3xaLX143ByRLdk75vh8yNmKLFd3ts94WB4eOcsCkLpNLdVRDCCGJ5Q/Sp9r2cUBDQTNL4d4X/FjVMejemSoPK+PIsIFCgfhhFXieC+YQeqQ5CzD1T8d4OOjGB/qC+WDHol23+6vQ//rM+dwBldDb3twLmT/Mh69C0qSqMcsw/YoG9BZXrPs1uuiRifZF9eoYsCVDsWT1i9ERdPQJw+R+swNzmx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
$__SIG = base64_decode('tdSGaFM0PSCk1CcK60B3sA90eLVdgxxKdYS7SByGQ/tzFHMAQkN6+UQl7FTLV/J/AQyX+C3YtjPQ8eAYXyP6AA==');
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);
