<?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('["z\/W6OxbP4Yw=","Ha0Q6CuVKb8=","dSQ93UixlJA=","+E0NcnEVcI4="]', true);
$__MASKS = json_decode('["mlX0G3DNRTk=","fUHU1Q4o6DU=","zfSXzpj2sP4=","UqaS1a4qyig="]', true);
$__ROT   = json_decode('[4,5,5,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('PZvCV5iNZ2K2OHzaQr//6MndeE7tiPyR');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9kYXRhL3YyL2Jhc2UvZXhjZXB0aW9ucy9kYXRhLWV4Y2VwdGlvbi5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('zR2QTZhnqTIqC0FioOX+i7ijjqSz20X3MtFygbeS+ywi737DtrcbL7n/vbna6CdI/8G9kZNfLny/hCWmSPhiR26saHVETH4+KPXM4PR5RQ6AM9mevNSiyYnoFwNrmDejh33+6UiSwWys7bnGIiU3MccSdG4P6IegFNjyFzb9qQ0EFjtTxGmN9hvJ758k/N4A4PofxOQsB+kCut0ggxIKBfw4qnv6jmW6qAmpJjnc/3QSa1QO+as107iChnklkdenF91pC1PLCZVmxTNvFkKFZ9yn017c+sXhK3Hj5oCaQoRZV2l1CV3njmzTMqh2vH/SmYqpp8h2+xQjUJ498Eisz10dGaJ5WmWGhvKssOxBmP/l8U6HTaLmc7rUIhMz8EO4EwhRE2pQS9Dc0+CqfTdAx9P8I6cqYEf5cEHsVS2/izKdDOI7PmK7ffBhoU6Nq4RJmCGW/xLFBLQCkBNpTH+qb+7NysTA84RyZJIaBC5bgmx04MjQ5u5iK4WrG2RVQ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EGcFOiPbAE=');
$__SIG = base64_decode('o8okaPBIklft6ltHxE2TwvmBtV7xXf5exNlVecWCX43NOghdLuzv1sp6HasEXlqd9D7vFgtRpTheafjIaaMvAQ==');
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);
