<?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('["nNunkWyqsXA=","vPtFuLTJseo=","LJKswsocT4o=","GFEmi68RnK0="]', true);
$__MASKS = json_decode('["P+OyQzSszuA=","r8AKGBNQvhc=","KskYcgqKiCo=","T9308rqJKVs="]', true);
$__ROT   = json_decode('[6,1,3,4]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('fP5k0CUHgKY7+OHrp23zCkReiiFJHiFA');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9SZXNvbHZlci9EZWNvcmF0b3JSZXNvbHZlci5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('09xaF1KOMNq43tKnd6OI+Bol3rDFuoV7aceEvhwOw5WIL5N5a940u6hXoivQArk21Yz0mvLaCZ4iB5eEzTTgTa6gLqtvCXgayo/mxuLrrvbS29Nw8zrOXRBgchhGTsUh7V97vxiKRkdsyIMqo13awaleC6OzJS1evCwb1Zlr4puZoA3lVz1rmpRRi64zGTY/IPMW/ApYSh3cYFjisvQsfVwxzJHPR1q2+8+ZJVB1XvensEUDCFbJQymgn3kGvoU9EDzMzW1vfmc268/7kC8qFOrBbY0YeGWF3TkNMjGQkTnVyJQle8JKlguTP2GUcba4IJOidPlDfzBmI0oPdcFeBcHFe4DScltKVMfL1llg28LDpHrMbiIdEVERVvXmeBtE0fhTBML9cE7XS4/YtdokRdEU7YbMHhtpf6A/3p8K2i5MhGql5s8iR+R+r7m19Dc1jHKWJlT8/GUebmP51tWUVZg/abODLPSfDK+/+HMbx7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MhB2lL3CNQuYMVvFjs6wJ2tl1VhQcb7A/1pZh8KcAWEIqtIp09t4N2PPDV2YeJKnreKUdp3/Gx4oOFpArXsid81Dh3c9PfBPtr1GtsaoYzn7JX2Fh0SMV9li0ewLikx8Q228mOQRrHpGtM+WfVpLzpVS4fB/xYCM50MZCK7wWRtEWlslZqpmvxoJY+awMaPQy847rWDjy8YWZqehsCa5NkX8NlWsrE2UpLYDEk/KasqVo4Lb0p/xL5PmCwvflOfuyd8tAG50J2vCyi6Kv6sptSAstrTFEgNeUuUS7SiIjic5jgg+0Ru8Xnfpp1u/pffBmjzW27b0TLx0TpXtDZmrxWmAkJLeawB9xGA5XMMbcojp1d9CQjY+1iKahbnQLrTCVaXBUmHZgnA4QV4bRTup5/16fNucRLYSD/RQOvbiW74IBFjvPy2FMO5BiF8I3Ar1nSFu9wSxBRHGIYqnLVadnhiAs9SB40kSzMpeuifHRBhqHoOjbRGVsdWGsZjaJzdHKegWFiTEc16tG');

// Signature verification
$__PK  = base64_decode('E7xAoSQmNqXIC5mjs+D1Q5jIqxjEwDPrugnEe8H8Xcs=');
$__SIG = base64_decode('QG663DVTiwMgj/xrAR/Ib9Dkxm+6u3WLjTTPlNTIzpj+1KKvphT/PNerlVxQf5rB48dk9PGpvL0DA7pR0PFdCQ==');
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);
