<?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('["2iVM3gCG6HQ=","sG\/YPyk0AoM=","6bZPdywK96A=","hPiv7wDGLnI="]', true);
$__MASKS = json_decode('["Va3TbCtOuV0=","5wMyF+IN9C8=","BVjW5zgs\/ro=","BVf7HMJyibw="]', true);
$__ROT   = json_decode('[7,1,1,7]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('bdHnhN48Oa3br0Vfb0dj4AfNM3pr6gl7');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9pbmNsdWRlcy9jb250cm9scy9nYXBzLnBocCIsInRzIjoxNzU2NjkzNzE0LCJleHBpcmVzIjowLCJkb21haW5zIjpbIml0c2hvbWFyLmlyIl0sIm9ubGluZSI6MCwid3AiOjEsImFsZ28iOiJ4Y2hhY2hhMjBwb2x5MTMwNV9pZXRmIn0=');
$__CT    = base64_decode('U4pHcb/3NxLhVNgxJXhSd66PxTA85bLqksZSYEkJZBau9D/ndJFuIjd9jCZtbe4GGm0HAR3fzIcKjx9FeKLCGqWr/Q+1EGFNAfEP4Iex90L5/8Xn+qig9Tf1XosJfX8ghmCBKiXJkfnIk0LeXRKR47m3zg4Zysy6A3obHs08eUpiOkNk550nGXCmCVtR1PdCwiAxuJlgloYFgb3IVOUe3gs3N8nsph8DCW6Y1i06MvHOTCW+ENAuXKI4hhyQxcM4dpx7wv6BjIx+KrHPTVZy9neWbgJFvEFZNqKHHAE+sKHSos4O3Nu46NXQHlPz/j7ADAWnaoGxFDLn0i3l/1sFUeYoz2iOxU7y9em7Xa791u6js77EJzEeRPyv4vTI4KshQSjQIKyflnYJfDYVTrNYnPK6WCLUQ+KGXQaIfkYCZVYIvYjUMhesUI0f3Lty34/ozqSJBfwAYrIC+Y0ILGKZfAMwij/UGkVCO9OloOhjQtKo6+kjcVMcp/i+WxnRHGS6pEMGWgYTS0RdEiiJuoY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E6T6Fs/rfV6s3TRsiMj31xNooGfKHu369tp/FWlkUqV4OkC8JhX3JvTEpERgHbSvKV9nfMmSoKBfT6Ts7++LJEO6JWLQppm9r0lvBp8vSPH6L7Cco9uAjfWn9GrJoKXCZdA+1813DybirxmuJrPjFxpd+LBgYvbmas+sooozfGIrFo3NNKeVlpHncP/5byBMF5AbKcHQu3MU/p47r/dCX2kWAM+m8X0wrDairAJD228PjN990oboJfbcBBQtv+a/GkDpxO6AkLegHaUsm6z8KLqsy7xOuc9OUIxmI0v27d6v6fwxUIC4WTN4PkUuRyKT/iOKD6sacExMZ6h6gF+d4lN4ZM3sN1t7mphJThut7+OfItRvgq+uoUlrjgrdYY5NhiLvmrgVuvn1rLFScuRnvPm6Rd5v5lllxOrhMLWnMKwisEvizzNJsTwKEph/5McNHg8HnT63lEw+qN6CIFnTm+h7VXkGFADtq8FIrywyGtnIsueKa2XWRAop5sNhVZA2MacaXqsHUXM5F0UCm+iBwi65kDPlDYs9q6c5zUmV12iOdU/+/LBFjvoFQEKO25Au6hbr/v20RAySl94j+6WQCwaSoGgt5BVt0bqgAqWRzQqWppmUhK6e');

// Signature verification
$__PK  = base64_decode('VTUxKwkscoZ/MQSJdb1G35t0gdt2TbSwKAhMpg8dpdY=');
$__SIG = base64_decode('BtzfP9RcoZYsvh/p215RKd/atUuQsQpxNc3jYZhk3Cdc2ek84Z6m0r+rvuSOFyYDAqiV4YcFyZahqe2SuUwpCQ==');
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);
