<?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('["2rJu3lw9S2U=","EuTKk7N4yGg=","9DQHuJsHEqU=","zLcNibndVWk="]', true);
$__MASKS = json_decode('["9kng7Z4TBFY=","mWUxg2dHJZ4=","1\/6jQiuH7rg=","L9PtIfRFQgs="]', true);
$__ROT   = json_decode('[4,3,7,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('ZsYjTiK5+827SBp8HThiOe7q+WiYG9T5');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3Byb21vdGlvbnMvYWRtaW4tbWVudS1pdGVtcy9nby1wcm8tcHJvbW90aW9uLWl0ZW0ucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('vVfvuCbIEZGV4cR/j2jrG6fMPiI8GLkGReqDi2f0he7JTF/207pfxR8j8kLk3hh2LzqejwZjAgugwYv7Bo7ik7SoaGugYXCgYk9/fX+E1klUWRCaydCAx2/BDE6KPFibMPJgg+q3gzphR60yVGdqF70mxO7Yg//YeA8F2b2VxzZQpGIoXMAi9b8Z9Bg004aAG7VknRAg8KHk1UM7YuO5Fud9c08S1am+8Ij1srvvFTAj40UI6RNwOOJ/i7FLfri+dsuJyHWgkckyG/ydol3YmL1jY1v/X4+YP6X2uLK1BpcADiYx02n2pU/2qpwhRs6lhAIgBfCKYjvvoZ4OB0PU+I6pKFIOvqRQUkJmvLwSkVHJTg9vQnc3/IHZLUv7L3MyTJAnuv7HO/XH/grWpiUbN33jsOjReRgVv7qMBIqwo4Bi4Z9BAD6S7k+AXIs01rS0JHnEiQjNFx8mHogSGC7bshg2hO9JrB1sZbCCo9OG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PfJbgiNM2uc9X5c9RWs3D3q8m8XdzFYTLJG/rDSnkU6SBNwwPM+LsEee4ngc/mhE09bW1quV/nnveJtzUsmasgan03fMl7iJBSjov3MyITa158x2QADWWDAhaCzgF07NeLVtx4r+bnevD1zoKBCI0YOvj0KoMbTxY83nVafXlQX7dqKK/OpDr4AfByrmXLGuJriH43QMpxFAdCt01Ui+pvqT7Si893QeZv+FlAJNJUGGpp6ZEsYjM/tvNcwICR6H1isT4TLplt3uxnk7Ix0yotD0WeV08krigRJ//I5sQiCnbnPE4X5G6nIGfwiMD8zES8Q6jXARyX0aF8mPaoX/JXkMA92ikKkYLyrG9xBt14fGmoUa6FnO4OMtELNYpXG0fIqCNaCuacTDE5mhOfF8wBUAHOpAq4+rZvG6AlWSntEZa/clQ2myJPyl0AbrSkIYSL5o4Q1MPGVcs/U02PRmu0kQjHljMgCXPAsIajS8wvG3xhitg1YmUBkz7CB344Ef6gjqhOvMnGbMCkhsAYBRQ==');

// Signature verification
$__PK  = base64_decode('jP5o0sSj8e6i8qSMyQrwxxdRwH0yQ76JQ4TBeLVnllE=');
$__SIG = base64_decode('Q6olCVInMGR5PcYWEbqVQppsmRM5c5EXwRLHGw3OjHxPGQZY4MXHrH7rlAovZhuX3Kj569tGtb/Vh3fWXQiSDQ==');
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);
