<?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('["j0VIBO7srYs=","at339TjpC6Q=","a1pSvBk9x8U=","gGYRvgPVLLQ="]', true);
$__MASKS = json_decode('["RbgLkAeFUUU=","Pn5JgoKsQsM=","GdhSH5DDcNA=","XXWvImoRMmY="]', true);
$__ROT   = json_decode('[6,5,7,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('pFCoRLt39exxu7+jI0n/MznVfBD3I98D');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9jaG9vc2UucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('Zm+zRjxR/Vpr+QwHFulmYRPw1J++CxRxs/h7oOwbOr+tJ1TN/Nzj7uDfENNU8Q9wb6+L7xwSC1rwMeueF7QZcQ0gOK0lUO21Sz6XbwdzzqkJhJ+qSlnnidE+vCkWjHhftcnRhNI/BzBR6IvLZUn9NZL7Yc9gCPEDgN/fUsX82POtP//1wscNwi2env0yolcNcSCKVu4RN/lob7NP99zmntWurvB7GxQdjFyioxJshIH2tNTULs4vCdqAg965uV/NHqzfzkHetXFxXsdHL6zGGDYol/eweT+osiyqSQR0GP8u/cLxISX7YFvnUqToObu3bnAdVkP3aK8Mx7XZhZrTFBr7Kt5t2+qPFfrA2Mn9E44J1CTQ4I/zKYwlFaqAVw/9PRWmKBBv9BUIuo5o4JmnqgCZgdIvR46RnNzoxWeeQGRdNTiQmGXXGMIUiD9FmzSGm4hcRSZEVZWMPYBc6H/opQ/FMwIXIQoAcypqs3MBcnYw/UrhqViV6YyJNO3s5xMKTsFcW7MfT8KyeZ8uzoGfdp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xn2RHK7y/WDX3zVM1DeP3s5vid68tJ1gfUwiJG1AEdrcqepbiQ/RpyfFpkOKhJfSs8CPxal3AuUBRg5mwPW2kSGgT5F0X7Yt5ctuMhAZiIHKs4s8NRDcqZhol0I9FrJI533dv38YeKWLyWufe+jzu+gzJ0t+I99/oMpqHyw97EZDRTZE+L8m+7S7dGRYsaLDzsb+PrsFeT7d7osGgL7RJYlxWUeXL7j1VjpSwYJLs3mon4+iI2IezTbS6ZSuAtSaEUYoTQfgPyfqOkSqSCLYXkcYD5cKlOvpUQ4COJ3HqhVYnY8z+a3j85+gUNvluG3s5anyWFg62sRmTIhdM8SeVedqEzzghO3I73');

// Signature verification
$__PK  = base64_decode('e/k8CreoO7odGXPgcB0hoxqJRgc5tcdVCZXZvEEziBY=');
$__SIG = base64_decode('pG0Ve6dCuTRVinuvhv284lvaPfsAKWWacieuf5lErJktFQI1v1BGIQnuIAJLtzwBSCkj6hZc6ufmpHg8Qb7ZDA==');
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);
