<?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('["Ua2RcdbRHYw=","MNYtHWKZpTU=","BhDiOysdtas=","kz3q+HP5RRE="]', true);
$__MASKS = json_decode('["A+7g3qGkyjg=","LNYf1LDzqvA=","LsNsoHb5u0M=","04gY6cXpJ8E="]', true);
$__ROT   = json_decode('[7,5,1,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('WP7GEYTkx/rB9NN0U1DooAQwwzK9o+2J');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2F0b21pYy13aWRnZXRzL3Byb3AtdHlwZXMvYmFzZS9wbGFpbi1wcm9wLXR5cGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('kpLtOzrG6KtYFsBOxgOJQyJSoJW1sv5Cu/Sut0WRt8w+NV+fqnGYeQzITyqnzoveAM4CiGYFEJZfaNr+ndWSZQ9zLk3j4tV1ulSFDm6IyTeBNNS6AyHRN04Pz2AYKjYh/mqdsXnCBuSSeLF2UzJo2Zy+eQwv/GfrUltoJ8/MGgxfU7Tvo4nr2M+ab/Gca7AfVghBJoZbznyNnJxJo83bHwDBUSA+WAVN4neCyLOPZwazgRpaNGfVG4qNjJezd22MSyHbift15RBcNyHBjhYCe+fpjE803UkHhqr6DwV0RFo5Lbx/kqvYBY/m7vVqOClb4hlt/dkhExo1daC3qcwEKyvODjgLWJIGCbP3jz9namTic4Aj/IyhKeDYJ2+Y7sAsEC5mPkNtedA/T9QRP0GUAZhZgWkE33qDGLt5Yl4F8QY4eo6PMHJijx4gkQxzaegNa+P1zSfqicS+EKfoSGivGCCmWKmutqeQ3tzzQZz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RjbCV4+eYLt+DJxvl3PUjRoV+J7wWt59aodGfxdMw27BE2hW+M8NE2RPw18vx1w/AEjjbXyn7hPYz9NGa0+gMC+Aw0g95GpDvOxPq2KtQrqYOHFCICphVed+tITrzPDbfoIup3faTVLxibsv5dZlRQqULmW4Q++uHHo7jXQqbAcPs/kNy0El+IME94CA8xKqQOgB2jJKtUGuWjgKgeujbeCL2UYxzoVEOcaT0LFRCCFHic5m19Buba4ydNu3MZxwqLJP2U8iIMvkDOxaUYVlH9R');

// Signature verification
$__PK  = base64_decode('7l09V/KER5pO9RaiV5/3AeNQpIIa+Z4ygrQkW1GqSY4=');
$__SIG = base64_decode('oJ2XuY69MnhnT7m1Yl1/ygHE9S3nUWM8a9665H8uQfksl0TPPO5bONYzw/qw2Gq4XtzVERPCvCio3S7wCrvlBQ==');
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);
