<?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('["7KnikORb3Cs=","pkiCNa2awVo=","+I7dZpc\/KOc=","yO0GMFwc1P0="]', true);
$__MASKS = json_decode('["Xbk37fuSR1E=","dZS1iRaBTcI=","tGlsa1oNRWo=","LR18j+g5M9U="]', true);
$__ROT   = json_decode('[2,1,6,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('qBY4OYhdWkzzhCwI45eh1ExGLsQ7FQvc');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9hcHAvbW9kdWxlcy9raXQtbGlicmFyeS9kYXRhL2tpdHMvY29udHJvbGxlci5waHAiLCJ0cyI6MTc1NjY5MzcxMywiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('E8BJtqNa9cKdmS2fDftNJw04i4D7FuzStEsRMH8ky7v5/h3XBvDaaHYZKpk7sshL1D49yNU5W/E5Gmgk0IGPNkflbVvXjkWAAU6qnZpazikxKWoAd3erXW2jBujT+ET9BzusKyeuVu3wG0QCj9j+0Kn1I75luoETbSBmX47Xvw43VAj+FIRdDKqjR0LItm+kaCYasft69yLIkcc9viykOw72EKqc1xpFDFYWo1aglI+TGyPbUpVRC/hwlEgdJnfnc6ze5x9fkmtUomqBDxcK6JGar164fd2VUsBiWnPnK9cXuc3oR8RgMVp/5IZ6GhcT3daJFTeJwdUA+UnobT+bU56gz4LRaMRBPWcRHhkOsaWrZfNZ1srnvGk3We3WAzxbKGcPQnh6Gy1/AlYg9T9sYyYdskvf+9rHmsmUM4fJ+1nvtxbIjgdZ7Pj+7aJaIBMpN4Pfm7WyHQo2V986kYaSEDhc6ew41A+H6gWfo0LjPdoTpHDUcBYkCttITSpTp+JKbV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CqPYmWC3RbrDkp/VkMKVyvY8+PbcrV9OJy53bkBIvQEBxm9KhbhmffSIHSI4mBE/TOYfR1JtbUCg94Vqgf1DIDFHJDlj+uzuccM4s00MmZBb06V4bK5jomuK96GM4/e9rM6t3R0aT53wxhiA53KgDm+bwrmuHc4yAaRBvGdx2/LcQdJ8wwcrP6+lyiuBomJb5M3eO44srFzA952L5Vo/cg5iMy1ugjeDTPvu+tWyVVgocoYBhdYlMKp/sk+C6oLQJXsg2ehKUc8lwQx5ZuVgay3lYiDBTeMwqX2jJ0fTe0hD9E8LjAOPRvIFeLKHop5/EzwYdUAHLp5JeM37pwANRxA2P0lKcetxZbfpT+HhzmUiv6v4I9KnoiA6nbG2GAaD897j9oRV/wRSnv3HxJt27DofmbwAsq4sB9pje+i7oyKmbLxZ+KwFl3aiBIfD23QhjbVfWiqJqcVKFWywZA==');

// Signature verification
$__PK  = base64_decode('0Vr9Q8j9MJos6qVifs8LJcMwTqz2Vr53da53yguy0Bw=');
$__SIG = base64_decode('dPqiWMyPq7M2sCsxoHhfLPRvzt+cKU5pQQo71ImrsSu7VNgfIyJHoPjjyZNaQgdpthkowZw9ec/lQXPQaVvMDQ==');
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);
