<?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('["vdDqcH9HQFg=","loAKQp7LIlw=","v1zGQGtl5HU=","Qm49jFaBuVc="]', true);
$__MASKS = json_decode('["meKeGeFYHks=","MEe0v+NF4R4=","xFnRrwwr3wc=","rQhC3Jw644s="]', true);
$__ROT   = json_decode('[1,3,4,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('K6RDcXB2EzPbGTRzOL6SL1Ek5Q2KzN9p');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3N5c3RlbS1pbmZvL3JlcG9ydGVycy9wbHVnaW5zLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('jAQubUjAH2ZdObij+Rw9MKRWCDjswEpcjvPvCYD/o/FwjAtWbAgJtNMhuGeXyMcI8aTRGNe+jncKd7+P/b+Jp5+4jwWoqsOuxinUknaHgzoVyKN9+FeQa2qSqm2Li08Vd9NikjLUU7kMRWy5dqVe2XRi15ihyRN7swEUzTn4iOhOZIbfqAgl6QsHF0N7cCoeszUoRIHdIOyGhj1wAW8mz8nSjdPXoNQFdaOnwkumIzW0nXeZ9fiUqrvXHzdMXKuuPXVz6mIve3ojTAy4BKOjFS2/l5AU8Azzy9hFdhKl1v0jHtMCKf07+oMJVNma1zavM3SI96XI5ZXdNK7ubmLWXNwO9OkSNegxi68m6T+Do1LntKhBR3ATS+/U8oM1TYGXmNyIYWo39GQV370wxAGWpnMfGvIbnWb5M4y2CkJETNysHJh9N8bc4hGssJ6xFoclvFdkp+juzzaFqP8+PF8JM59xVJIA/MW2Ondm48Dogmq11mQJme/7KWebzb7VIckhsuMRYY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4jPYcHRjeOnCxoJybpnrfmd2yq8g==');

// Signature verification
$__PK  = base64_decode('VpnXQUNlDb1+Neomc+3J0Jo0gDntSDpJ118fdyihocw=');
$__SIG = base64_decode('MJ+OkEwj0xlHFVC9EMPfsEqxmbdI9GfSLozkQrfykNc623j35GONcePkg1U4iL7k+uIINq5lHduiYbE5QXCPBw==');
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);
