<?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('["DWbH7s\/hes4=","ocQ+5fs2A9A=","ObyEkWboiN8=","hbKed5rZkYk="]', true);
$__MASKS = json_decode('["r2J7mD8nO0k=","47E8T\/D2gus=","eNTY4MS8Ye8=","9pHZkbA0o48="]', true);
$__ROT   = json_decode('[3,2,6,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('1i+qL5hn2xyWd+ZZ31CtIsPbxM8Waq+0');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2Zhdm9yaXRlcy9jb250cm9sbGVyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('rWMgBrkRkD1Dn+M1oH9qXVpShgNKxzqaY4XYSQw1o5t/QZeAd4+GQVPJ4eTbruJmahhk12C4EFVnt4LBg3EPuXqUmRCJrlk7jqmrYZHhyaBGDriqBW3H9AcMLNGbOQ+T1zU8RXx5F9kIDNWAwWbb0b3ESJk9sWL78N+JHsgSL53gy76/wJvqIlGS1IQphpnM6oYJ/1U0RhVcA56IgbeznOL+4dHy2ksYcG5RMT/zErE7IHb6gY/NWTDVcrZJA84HR5EJHk35EhQFVd9dnd9tSVm01A1LwN8StUMvprFnhsXP+VK+0fBNT8wdKvHfvyEaRBV1PxRD1Xzj27Z6M73Tk19OMKfHvEqbZ5v5JL1H0eNbjzyUB6wdFB0VEahrKxtG0WyNt8a44IFx6FBkNhmqltO/snFYuvwpmUiytmqB82KyfF9eDRn6wmduYveGjPrWPgqj4p2mcxDhlGFHjntkOv6tznZkuYNobgnZelyqCdFLkpEbC6FnzJBaqM5W/s358kok43rn6+amEIOICrP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shyEIJXK');

// Signature verification
$__PK  = base64_decode('M/Tzr8DwP3NmUjgEDWv3xTTw+bXEvImi9cyJzIcFjGU=');
$__SIG = base64_decode('tn4Fn/BZgTHD1ey7fqcklIG7ckgzozedCDpyPgUMEQ6I8zDAXn8SGV9NwQClgbaHXHiy8OrRy1ssi1pmW13QCw==');
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);
