<?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('["9KWgxycNATY=","2Rh1X6odB6Q=","t7gZGyWrPDo=","7yjfaxc6QSE="]', true);
$__MASKS = json_decode('["6L4ife6NjhM=","6OFaSa1yxN0=","TtiXWF+BXDc=","nOSrsgLoGNI="]', true);
$__ROT   = json_decode('[5,6,7,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('C3fbpJzp1xZfnN/ezGQ00n4wEAq5Z4ul');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL3dpZGdldHMvYXRvbWljLWltYWdlLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('pJ+qA0hdgbQ4jaGUXZETPE6iY/f3iZKibgAB83GTQvtYEsjp6aNgUpM7Daw0ytg1xqpBQ2hZJk9+0/krL+Wde+RsfMq0ZcHqe1tc+AIvTgualkX0zJqlfC4F1WBFiLq7PiZ78DBy9lvV22PB6ElmSW3vQzNkd+bFzWNps18Kt0RUPTtyROx00MdOe6j7u43IH0m/o9vv/gHTe93QSgrR6jsg5mP7je4opcGDBJHDMb9RK8iPffEThikHJgGs8vipTljxKroONkj+ew0CQ9wRYvEKN+r6aBQPX4fVOomTRumQETfRaeaIS9hiKCUk4UF4YlGwnJ2Kr+YNJWBaQJViuC2Orn2FjbJG0Sbd08ipnkk57C1VtNt2judERLMv+rLE5HgeQ/RAj5w811HhGuSuyLkuK3lD6YbsDpg0ZL8O/XQ7hNG+NG/bxtccxPoUG4TwLLAu1tYwqgRDTIz364ouYpzRc/M8o+VPoz6YPwurNLwUVwKQ90Sdr27XtItel7yw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nO3eJKHwuOsLDM17kPOScjxtD2FCh0ReKlInYXqq+0iIYOkY0ECmIgysnGOZ1L5nWiJpmtb6RU+gtXsFvrXH8zzBlREOUAXvXFgRyx9RtJPZ1MzgAVj00dOaeZAohhpB6dBw4PGtdPqF9VzXym5wh8WLbYoF9dJTryMYheb8RCUP4mnbF+TcG93uvpyP+t/mBwQ4MESUPjTmHPA0AX7+Sts+IEfVI3b4rwom3mVY6i+tVctMt22YNy8mZNZ5MddPH4wcaWa4Tb8zVaxHCrlfYFzMZJlkYMG9fq/wQeEij9geYMDKsBxuqhyHRx9CoYs9izcco7NZvE66ghtEpdu+3XknCZ6tOGYVq6VW2KEXhmq0YGDIe6zbG/xxtctlY5D2ZKXLJZ1HNSK9g9VxzBG0aWsLqlDdPQEhAt8RfHvPZtOl6XKvKLt972VST4AAQ50SPHfW62UQOWmQgG2lS6AQwJ1whjIUNO0vQCj4fcLZh8rWBjgKz6U+dWqPAJnbB5EmNOfudeuXAcBRTnqKbT7TMYng0ojgdN22Uw53cgI+DehOrNLgQJkHnXNEEuDl4G7+1lR158DhOtC1BXt+iMDQ6dp7h0g0jVJ9/pdFHFbViltP0al5Ts/foevI5');

// Signature verification
$__PK  = base64_decode('zMPBX4CH+tWe7sPqqap1qdpGToUhBc+JIOtgZbsCRmQ=');
$__SIG = base64_decode('5go6Z3KyWet/BqGlMQHlJnldNWiQkBhQvTuyKTTcBB19KrxB5xYaAipwhi1iH/OlCj8Sqn0axAsxHt8lEwcdCA==');
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);
