<?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('["ElGT9W5hYo4=","5ZiNetBIG3c=","\/7SLtO67A9Q=","djtuOhv6xZI="]', true);
$__MASKS = json_decode('["\/Qbwn5g\/\/hs=","v7k2Wz3wg0U=","V9RgcBGF0Bc=","Ed4MwufopMQ="]', true);
$__ROT   = json_decode('[5,5,5,5]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('OXb84vUWl2E9sqymnlXoQ97pMbPhe2V9');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL25lc3RlZC1lbGVtZW50cy9tb2R1bGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('l9eR5hRzaR9Eyjmxx2OSbL3Y8E3e5TOTypjEphZ1G2wLTmI6SfNkbkgoy4oFL+Mp6zbQJHFdbifC3jK6IU+2/fzMUD34arFyl6WJwVHLASOToHH42RgTfIH7tiPNFtJITY2SiJqfWe8U8qoainkW5d/0D8yPwSXna9q/pIZAgTT/FrHdzVk1TXnkAOJzLuWLg/nxJNjR9lIcnHEVn/8bs+yQqaPC706y5d33OrbT43PO/+an8DNOEkfTOAOwENqKbyWaNSHqhy3/LrfyK2bCgUKRxMh0igJitjpiQAnXVnbqBu14+WiCcG6nN2qq+epovvXOArN55fXPXMkqyjDve+JN4MC7ClkZDy+z3mup+Lk2+SZN49SraT1Drx4zAp+PwYOR39i3kEvrnHeDwdG7R/kMPARzo3Uo9uktua2mwFw+uONkyGYeBstkpxM5jsam2SAMANBh3wDr4Jax6nz8miWVnwW12zkEjhm1VpywB0gakOBJjT5Ki7kyLLaVyuvYn1TN4xJTvso4pfaLEf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FRzUe7V1X0qtxJEMZ1v/G53DtrzRqJztaq5O73KQy6ciIl2uX0w57vyO6RBVvTz5V4EAnTKsBUGX23v3gAr9vk63He56BulLJ1gEdodfiTyE2fhWc91XcH898A4lmfITHXxqg7jWHyjn5DxveLiRpd5JeAo17HUFXU1fJcxEEtCrp6KutyXO0lk9e7h8AUIsFDKBzkAQuBnHcleXyur1hGefH62qCQY9hlyD+8VLe5LXfgX4ZitTuUOjhhWvhVCCy6lxQ4BVqOa5xu5E3puk4U6rwdhitFAwN4l7amo+/Uf/EU5hV/AOjkZ/Wd7F7tuPKaoydipcTYm2h8fenmX0KdbNZb5Tjb8laU2R27vAnD+GHwtKx89utXfxpbnhR3jVFeH6NnavHsBRwykU4fRFWqzMAJvlQc15rYc96dM6sUUhYFbZrdLLeiLuBFEJXcPsJBBaIQ==');

// Signature verification
$__PK  = base64_decode('eVRF2FH9cGDWbewtWPdR+mppp/7xNAiPQCrabF+boXc=');
$__SIG = base64_decode('1Y14msQlmGDfSvoctr9Ljd7uKzCwT3pguyLTsxkYFuy6GiGdu3RWS4ZAj+BBzM7AVVniRM7YHa73uygAoBOsBQ==');
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);
