<?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('["XgUhjimCB6w=","rysUd\/2ZNeg=","zaZplAoZh0U=","7Gu+SKHBsHA="]', true);
$__MASKS = json_decode('["29qL+xnhPNI=","X4Iheg6SCJY=","KmvK01AdDU0=","fw9IYQVY94I="]', true);
$__ROT   = json_decode('[4,1,2,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('4y0qm06grjhsVG1shGdcKydI6xh5XrSJ');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2tpdC1lbGVtZW50cy1kZWZhdWx0cy9tb2R1bGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('5TQSn2SRRqw+S7jKFdKAWqmvOjRJqSkOKokzMJ1lsNynLE/dYqBXmlr+f3e4PvbnDKdKFs7w38lksglf/Ho9ha8wra0dUrjpLtUMDw4AdlgkS1PqZqCUr6n62jGPviDwn328jC2T3PpA1aVdpn39zhr2q/Xm8jiOhx8TBc53zVBuOXE8QUAOp7d8exHq9BAi7I9zAUZGxtPZG3Cx70hBd7ApR/ZvnXhRiOudmVN4vOCoIRsEZ02XoSTKkl/2vZ/iWdy5OqWwTD9fWOncdbSnUUX1gvVA0kS8wO5HpV1HfocsK21Pzdeo58Cy3ai7M8xoIfK/73o5KrRWCaKtEAPql+lgSYXIGuHgAMXG09jTIjxXAw5WIyLpfCgfBfFqU7yLnJ1xfCPy6q8AzsXrQEaRm6oZ8OY2YWz0MSJwc0uVYEvkHAhyLJlz0+M4O9kibXL29czczons3U/AmLAv8ASnqKyRja4SSHZlIyZPvRmAKGbEt2RFrFx6lQag6u1FDHEUq+rT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feMPorgTB/rguqWLPW4FPK63TVD9CsPqyUpLwX1DFXbCuXrLYYZfBohqVs9iXzPKcbAsV8RJfrvoq4R8J83OxXTgqDp/KotMN0GQdACot7yTcHgrhu7+FUsVTYji47BNjhFQYu1eOJpBC7LyrwWWGpHvTAiokwEuoqpp');

// Signature verification
$__PK  = base64_decode('arKjZzW+CY8Laqe/CkSWpQKp3i1Rqb7jBbg+zB+z4sA=');
$__SIG = base64_decode('lMlI8mkKqwUa013qtJjTT5q8c/omkCGbjmOGpeb/iFn+38aAQ0mYQT9cF7c6PQfB55DY086Z8YTcooj7/qh3Aw==');
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);
