<?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('["foOxh7bhxDg=","jh0tAx455UQ=","+fw3cwtemN0=","wzQyUhUAZ58="]', true);
$__MASKS = json_decode('["HDSbvydx6+I=","v9SETorN3dM=","nUJKraUkTRI=","jXm+rkS5C8k="]', true);
$__ROT   = json_decode('[4,7,3,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('2t9AdlmfqYBm/Er9uyi9qVyM3Ii2lPMV');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL2ludm9rZXIvc3JjL1BhcmFtZXRlclJlc29sdmVyL0RlZmF1bHRWYWx1ZVJlc29sdmVyLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('OibaKEnYhRoB4/eK5eJjhBYg7jut4S8R8u9/qeYWDP2vNhn0pO3dqel6zvjHB8Y0sa6uPTDHyZ83FjGhFZjeEPC2yeAQRWk9gmejF/+JtERWbvsTbY6kiJHZEnb6T5IDFqvYkIgx9GAQUletdwyo/k0rtGjFbo69pX9k9qriHTVwFus6B68fX5zMIEqAJa80APz21NTUkW78afNid/ky9/uUY7VAkoJZDcn6fvjjkdY3pl5FJIW/iNcoAZjW+BZuCEKpf3r/XTGbOIMLJtji1dVq+TDa++Kg3RCbHxXijOcmHrXzFBZ1aSeBYSGMoCF458ieDLclcYXxdgb8hsT/dWi6yboEa0OtgtDCQVi4Xi7Uvuorse9tpRtYTO3i64M3NVEDwJxnjkBm/yjM/4bM9n0AzKErn97M2htQH/HS9u5BiWYs+4OjGXYF4m5GElWohPTpgNl9wMGag3lgV1/rioCxyXwx2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zfEE/OzCwSQImHRsmj6nqYlryEDPD2r7ov4pAe7hZqR+0wiaq4Hh5zgl/3KU0kyEhB1sjPeH39byjIJEGZgnRZUbGJ6HvY/IeZuQORwusHCvb7IhYkk797TSDf8h1Pody7CnOFBq4MFw1sVgaA7TNM2/iOvGpgD5i82glM29oBWDRopMS9hdR1FUDygpaawWCjlgW3fZUHkx1wpBfPJpNWo/z9hq/QW32J3EUkg81z9qd40m6OkZnzqQ8FPVTn74ABPABPSdQ3pZlT11/xikW0J/UYCnynKeY=');

// Signature verification
$__PK  = base64_decode('CSQGXA6GplA349Fl/AYhoGZ46CtfieTAYWIwqGsqSFY=');
$__SIG = base64_decode('bRwMQPTKLvhn2oW1M1++HDRpUvfDYCQBsCOGxFtSi3vmdXjBzd30eFZE3SqcwBjRl1MLaFGbLwvK+G2J49RiCA==');
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);
