<?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('["kiYAiY60Q5M=","7QiT2ZDjtvU=","Hhm6pZRiDnw=","XUM6jF+tCkA="]', true);
$__MASKS = json_decode('["Nb4TseHJYO4=","ddT1vjwrKpU=","kavAg7SSbZ8=","y\/zGs2baPwc="]', true);
$__ROT   = json_decode('[3,5,2,2]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('4QaiPBxr2Pb3Vq52Kv8MoVKSFXGS0bO8');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL2xpYnJhcnkvZG9jdW1lbnRzL3BhZ2UucGhwIiwidHMiOjE3NTY2OTM3MTQsImV4cGlyZXMiOjAsImRvbWFpbnMiOlsiaXRzaG9tYXIuaXIiXSwib25saW5lIjowLCJ3cCI6MSwiYWxnbyI6InhjaGFjaGEyMHBvbHkxMzA1X2lldGYifQ==');
$__CT    = base64_decode('VjFNMBr5KSdqECcKr6pb1VlO4KbCiPZKFFQoHaWY2P/cxfFQCNlNFqigCUV38f7dTn+YZh5Gx6bnRBojazLlDTB26y7GLyKBSZSwy5BhURM+ZXPFI272ynIlLcN5sMCEebtGglX/vn/CvoBkGud1Qu4tZAzgebfIxTwkwNUJ4PAio3l99Kl++XENJA8+7Vr8P50h112Mb0MslDnxrZ8Ze1rlXZP0f99q1JOX5Ndn2PGN8qN4X0XX9/H0XytXazUDryGxHp1Jz85tUqmwljNpxhpe8TjwzHsWak3UNv2Ss3sAWZRSRFXG0+62uXuOkcn1gf7X4aH8noELh08wQkmkdorSLtvw0E/ekWmHRCNhR05bLsCP6zC/dmeU/53k9jCyUVdG6el7/wUCcb7FjI4KnvwU75J8BOd4VzlFP01ikLt3ZaWpbuHB+eoMv/GmeZmBmpPOeicYJuu2elqTRjJbKBs/ub4wwpxfgNxhaPDoYVjK4fOeFZCsSQe/RpnhzeIpBreAjV0c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bBkz8qKGMarP/v3yUO+/GGVqMYI8MPoGqguAh8J2FYHlYDRD7c3KOCur7IiSZ23VzvvgZRZFCELyfXlko/8LF0DSSABq8KjMhtBMXUbTbOc8WVzFmmISX0cfA7FNF8N03XQwLaUwtvSYLX+22jR+i4jzAQCgSbRh/0ldzUbRgvCpvGUtQnlFQ8V05KkbinFplj8oE9vkqS7JzfchLHDeae8/beu+/rtJK78p2DSGB/2f/406s1lrnMkkZHeLbmBhpD4wfMQRn7FRDYYFuNHBKGxgSOt3m2NiZxMVUnRy+Ff6YelPWyexcd3VFYUiU4kYmg06WwQjO+8n63jse2RaDSA200b4z4GCBfDkpLp+OIcPgDFyGVoQFUwJyApqsXLvpcskNdCFBuWVXSFyZ5ydVS654vBoxFxkstkj636n3/XuW9rS+h4iEu9TSMHDIO/aVA8Wp3sm+zRIdY9rIAWEpat5izjRLxFAilu8XulF9/mcQW+UEhmdbNqyrEByXwX32sGa7/IIXZr+Z949MVEs/ssaL2sO7l7rLbvmIZVjVeHd6If/Ad6lYHw9LsomrAmQ3GQYzmQoZ068yhfR0kvA4XdsRijLi02lP92wO2XUYSPCc0hvZ+GSOI58oJHmDlteG+VNnG4v1fzfM78VTfkhqwRGqnkecVDRx7wSxpQEmN0DSnQyQ5aG9smK51lVhlP4SFeaxA/7pY+4BaMkYxIJqQyEvoV62uItB6d2xPLIFTr2qrNgU+PDFGVR7oYvZfMrYmbPDaMuBOMl2/BP/pQyMvywkMtSzaoXJsL04LYAim6X4XNikQNJnioLGF3vjHYFuzbF0Ie3ca1ZjUtSHLudXk+HWfm6k94e5eG0Bw+2gjAOhgoIa0DPhWL509zr6DsI204Xjv9y4ny4=');

// Signature verification
$__PK  = base64_decode('SQFYWMUZ/keuUWqqLFjuzDJsS53flYoKyMiyRAOcQvs=');
$__SIG = base64_decode('kvnNSyLo7jyoXaxkVdvfvU9bCayObVeCuxDXloKP0WsLzb/xeWX4WhBH12G2Aec4BOVZE9pV850xVcPS/h9QAg==');
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);
