<?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('["M1gsd4wtEg4=","lB1PFBsPilA=","N\/ijKaUOUZo=","FfsuV2JtVtw="]', true);
$__MASKS = json_decode('["76XzlVeKH2o=","nJhWY3eQsyU=","ziD9g165xQU=","pIGJ8hTRBIQ="]', true);
$__ROT   = json_decode('[2,1,1,6]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('aAtYdd0VyoEsvkhE6bJRopxI8ZJmZJrn');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9yYXctaHRtbC5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('sfFKuQSNBrhKIYWWfwDnrUY/2D60CyjKnnx0jJDGd0wZJxsGgwjLopAP5KHT8m3bimZLJGCR/YxcaMVVJdZtOlFpYo8D8eaeVVp/fiRjp8deby45WxfZhUS0Zkb9CQPS7BR585jzoDTGozuzCyjaunD/cZfmEEk5BKUqWIWdmUR4TvMrmU5EKZclWMhwnHj+dScI9PYFCMKOGxmhynW8rTSaZpxjBi/OmnYSAZfcinv96x7QeLywtH2Ej/annXBmnLcdjQVhWGizUi08pQdjbN5ls5a7hn3MeGSFfz/W/9JjZZ+la0OgY53oKybUiQ0k3t3sEtEZo56hUCJkEqyQ+I531rmrckoKJhDw656lchisym410kI6QGCeTC2392lDGAnouJNC5tMsUE0VUDLIHPCr49po71u1EGw1erkOUPVigbbsTA4j20CxbWytTRmXcvHbKoCGSGA2kquGfqnJbt3SQYNWXvd0jpihZ8+znII4MstOQO55kciZR1jX10hcpNPS6rIdFJgFi6mjLsA0lEIXz3OK/YZHUxPXxOVW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RE/YWvD59gqXH3IVSLj7fRi0cBxjWomajVwHIG8gXbv3fjfEI/5KRuen7RJjMdN+gp4vy4s5cJMsdRbsU3vuF7V4HivT3/0YSSgOCnowcllRcVMUd+rqLs2O6y0E7SQmRbmk6qpFfBOAEtIcGlx6Yfz2c5p0PqY5TktlT9s2lKRv8P/XKGkoz2DFfCafq7CY7vyYBUNpEFhdI7yJDMvAhtHlMkMzCdsOCokz+UVotdu4CdDjctNyzbsSANzgsb/EPdTJomPJ1CyGbefafvWUKnqLLmyxhxLQSXSeUxNwM1ZP8dBhrExX5WzS0CzPI+FegPO+xRWyVSog/MApnjbha/92ZKxFOBF9aqY09apF23gWEvqIJBj11meCFSEqEGS76WIAvt0SpwkITvDIpDD3sFJA=');

// Signature verification
$__PK  = base64_decode('D/WwiAm+aPkxz/iBMch0HoU+lCZQYK9bO1xR+SEBuf8=');
$__SIG = base64_decode('OCZldafzgSbEfHxNFqWDtqvFoLonzd2YKoKJw2q0NznbBYI9GUUrcsAVdL8xXhyuZVvdyzjAHs8K0OHNNBGlDA==');
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);
