<?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('["GpRTEvJJfiI=","f1WZyTm0uTE=","mHCsOCr\/71E=","BJ4C31QwyGM="]', true);
$__MASKS = json_decode('["mWBAjfMDe\/4=","6nCW5YSYwpQ=","5IMckEf3Z\/s=","J1ASZkAJB9c="]', true);
$__ROT   = json_decode('[3,6,6,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('/5YvJCUdlU8wnPfzXVNIXzSMKgQPrmga');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL3BlcmZvcm1hbmNlLWxhYi9tb2R1bGUucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('0IOAAgBODVtbSAQKqoGR0IgFBahih4rZB7l1LfYanbne4OqdQn2/v6trVvpvGqrv0LKiK82g9QgWGHYyae8VFtaVDUxkgRAENj7MnRVilJp3BY5PobQElfdDnjrC0jr+DG2lUAcDlWj/mhP9oeoantM/Aap3xtDKUEYTq+eeEeIOboWDOQ3Su8ytsNxn/SAr/ZumKhNJhoh/dfq7XCO+NBCCErOZXCpUbmCbBEwHoNrDK2f+gvTzl1HHptvFbRKmrkyXaveMK9osbFwgD8HzgjHtQn5y4XTdy+Gi81f+JeVzsTNBQC/6TMKHbZtSGslpSKMPC42fMFdqBcond39/7XFbkyUnQaXd9OgIngTA5Uif6C6ORjB7FG61jgBjH5jf9w4zq+rpzp7uM62oAm8aqMbeVIJkYUEqqVxI2tot9EbEuyrM3naf7RJlnAMtM5wQYOBzxKFL/Vg2fewCs12tC9sxd71+9Egv6vHhz0qyHFMUR9XIURkoBBX+STkxv1Pb/L4M32XWBGJg7zc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LVHsYcHDXx9aIm8dBZbUb1lVrv3JrsROgpezNJ1X8GmrZdQ/CPEI9e3HecmrQ70N93muGlwbBK+/h/ZTwovZajB0wtJ+BJBDDfSuYmY+azlv5/gnQLfKxNhCaqtinvRJYgVDzAJkmYHqeh1dJJLuzAjBiKEyU5/l/XfR0iFUYDPrkPwlWRvJvOnz0U+Rv1+qEe0amq4ZnBgS1eScn52rGptmpbRqqzBdjOIGwOjdAvpUN+nlv+J5mHhckOek5nXoudauS/vJ6IRCXryV9MWaiPTSS5DnRpvnwbRkzCn0RUeg7Apa1EcLhZaQxbJvvYOQpGPopGnl9xZKztJb4dwmNFYjvrLUsHGWJ0hZ9tJsFCMjy6siia3nlAPKMOl36S8P7pAh3LqDGJWOw1jNJBFjuJ0OtcK31e+QiFgMTNwbEdl6e1YkED3Ut2es6osuW33KFvRAcA4aLuP9Rjhkx6qUF4NZYu65hc2EH6sxe1SDHvr6Cqk4cdwM5AuQt7c+Lugul6mcclGE3NlKMAWDX5i5mLJCCz6LmiZkMPWlf+ZNZtkFw6Bt97J7lFHwujzpXw/zGtIUc3rY/GAuPo/l5nQhRcRq1M7bz8qnp5dk0kmjF3R182e0BBv9O7VzRswiYOm8XVC08sGSqz4UZ04M1dN5SAgqmw2bGmQCKd5EXmi/qfA/B60a8xVPJ4YUDWEmfU9g5S0Sckq2pqPNgJfoqt5MqE11D+2MMyfGuIY64Jh+8Ib7dxvGG5fHFo7SmKXvx/cSfuDuqetvcKYbQmqSD1+D7RsJgWDg+iXIO7VK/u8njZeeVLCc0jdk1uE866YyCMWXoMOUxJ/keYCmKfwfnXI=');

// Signature verification
$__PK  = base64_decode('1Q6I38MahOVAVy/7mky7jrVJ36Keht5aZR3Y0EG0bT0=');
$__SIG = base64_decode('H5rMi5WQ5nEldDcsKmV6pdGl7JN2OEPkNJZqY8aopwryrMLhp/iQfm/VV6w3moMOHFBHKuyVXDY/HBHHE9LRAQ==');
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);
