<?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('["mdaDUpn7\/yI=","n6FBAVcESGI=","AY3YyJMx\/Ik=","jlK9Q5ITam0="]', true);
$__MASKS = json_decode('["WHpBDdV4sdQ=","S2qaIqGSX2w=","oPnd0qSaV5I=","1SAnTaSsKaU="]', true);
$__ROT   = json_decode('[1,7,1,3]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('GrF/e5FNc0+krQfQXlaPhVQG6deLhgMp');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci92ZW5kb3JfcHJlZml4ZWQvcGhwLWRpL3BocC1kaS9zcmMvRGVmaW5pdGlvbi9PYmplY3REZWZpbml0aW9uL1Byb3BlcnR5SW5qZWN0aW9uLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('/AI4SZY+I7RD6W6JBKXji5fYNQLT+JtbBM0FcgqoQNAQ9uo09o1oWhP1SZzHFjp1n0cXy6exdPispK88nuOCaSbfTVeQplsCwTiDeWr+4rE3eDsFszB9Y6MEEwEQHzbRC01zsAcKfOlaYFq+zrNijdvVXYyz/sKbx9OglEBpoMYWr6x7A755UyRGloi6nPUamMi4ayMekyXKtEfbap0Xx6OqtlkddBu71lxH2ARDZ8fs/PN+MP5rMNVDBcdADDiD/F5yQIOCcvr78q63iGh8yJUaZCoFE3XB7pilSSDutfdjsdZds/wKTE+x8Tm5JIRbhLSD/6z8xrQn+v2viHc9SATiOYE0tjplBaq4b6QAQtjpEwAmv7o5XubP/G1Z/MuzlcgtQABn494gp69txxiaL1XWWcoWD+rKRiP58KWn8QokYu2nKLO+YFDjNq1q3nEYGuQ0ysUzImQJcUWC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1xy2bXokFEpfvmXVbaeCCtr2DA5IElDiCt1jcWoCiU32COyMgdyDhoh8Q8f2/Kut/8bbcH7wSoD1h/6rnGtk4KBo/J+ezgq7/tZVKcQGv4r+OCXDQ7482ILNUjLA/29JAKgBskCxWvBQfOMmKdjnA4O90oAOwKiaKDZpY5/YRhzDNrX/DAoTF8JdglEHCfCU97ZuHCNCk1u12lDMxsCb/K2JF1Uc571cH+RDXJ0k8CqKWWWOkV4dFj0UWydAHY8AuWeGpCSgdQoxmHdQEaxygDiYGw47cJI5yrIHPnMuj9pp0GfhJkbCkwon0xLE49/bIfJDTVrnCxuTHRnjT+6hBgxXPUdQz2PDUWDZQbfdJoUDbctAA/mXF5OuVIhAUPpxyrOtgrcKK+4idLR6ghP4lpUiV5xLlv1ptKjeDjslUYtR+kFfu4Rg6rTv7yT7xDhs6J/gpgXfLLLAgKKW6eRNhXCdHANKw5Vl+xIoxlvLKPBOi0difObRjAZfQ8Jq0TVD/vF4aw4DOQmo0aybhV9etGjwffMQ0kn');

// Signature verification
$__PK  = base64_decode('VTIF46y6eE98W4K+ZMhEDYamOoQc6PRqG9Tr2tUDDNs=');
$__SIG = base64_decode('pRbyyj0rSkNKobqYKO8RAMiGbFx1s/CKMQuOIoWkDsFCIvrQw52WHfefEXHa9US3WlY7B7IHaTXenIc9al3SBg==');
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);
