<?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('["Cog9nu010h8=","ixEmDtJKRT8=","4ZbS8HU3OmE=","7Anc9\/zb9tk="]', true);
$__MASKS = json_decode('["VJ5E6\/sgbKY=","cFZDKFQ8rnI=","RugWp8ACgq0=","CXgBlpevxjo="]', true);
$__ROT   = json_decode('[4,1,4,1]', true);
$__KEY   = deobf_key($__PARTS, $__MASKS, $__ROT);

$__NONCE = base64_decode('XEaqQn7dyZI6qDHd/4LDvvrlcDMeBCSI');
$__AAD   = base64_decode('eyJsaWNfbW9kZSI6ImxvY2FsIiwibGljX3VybCI6IiIsImxpY19hcHAiOiIiLCJsaWNfcHViIjoiIiwibGljX2NhY2hlIjozNjAwLCJidWlsZCI6IjA4N2Q2NDc4Y2RmNDAzNDAiLCJwYXRoIjoiL2hvbWUvaXRzaG9tYXIvaXRzaG9tYXIuaXIvc291cmNlL2VsZW1lbnRvci9tb2R1bGVzL25vdGlmaWNhdGlvbnMvb3B0aW9ucy5waHAiLCJ0cyI6MTc1NjY5MzcxNCwiZXhwaXJlcyI6MCwiZG9tYWlucyI6WyJpdHNob21hci5pciJdLCJvbmxpbmUiOjAsIndwIjoxLCJhbGdvIjoieGNoYWNoYTIwcG9seTEzMDVfaWV0ZiJ9');
$__CT    = base64_decode('gv1vWd1kgILD3UTtiB65HkJn1J3Nsx06dDmqXkNm4FLqoXvA5VqBwrIAcx1yQFXibiefO/wLN3LrRDsNMp8I/D94HHiw4R4EECwfjok6G+I0JkfYIdk9Fjc162LA/HztC7gkHQ43YyJcrCFmdTJX3z31W5oqMN9uu9om8g9AYErf5Xsqefa/8oIz8eDiD+NN/q7oBfgiTZ7z99yZ75YGraPpTeGIhgPpuZjZ5A8KwlKVEWJJWYFZiNb34ZDsFBItmeB/hyrT6erbRogvTmqkSwrZB0SLTkit/+StRzQIzPFZ27a13iHJmE+SFah1imy4gmO7c/kxK28hIENaS48pQebfzfG0v8rFYhCOhG1EDseotxhYxpUYOD7YT++XgtmhCUzAYZTNbrZ6KDArFVVAMT0Kd/4LQTpzsD/95QqM9KSzBKCsFiInwkszXNzaxRyV4PxIpCfnl5k2TgzYnsSVWfBlOwqhjnwnFggirtcTPTjCpIltNVKyN8+KE8MI1KEH3Bzq13GNIndRWKeidHP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4Hz0qLUm1tjz2i2YJv+DhsjK3A2mKisM1UgCm3B3pNwvNh/gbICv8ZP1cX2jBv1QsgTWQ8yEVsg7Fs6ip5aXUvOpM1OQhEFyBPZg7/m895UVHp7fmoBJ/9Aml7Vubj+QrMo3ItAusPZGAx8jkrU1ZFrxaRNJJtl9WsSI5lU6ztIlSNBiXTulWqNUYVzUoLcWNE2vjKQ8tzEvwXZqK5YQApFZl302zLmR6ZBZAWrVWdpoQGLqAS2XeuZjXECrmHUNp5e49tX3nrIOI/jp0Qa70EsDfeah9QO+r8dmzkBAuWMLvQitfpxSjwxHIIenrJlNa0W9FlHRGC5bRvcio2eBDfCnU0HkWUKzVX+qySTYdK63nPiFj/XkrZwA9w7jVnFFQTi1pf9gULUo0SFK0Ma4ktJC1eo4YQ30nBb/wGoCY01hmgaI648dzlJ9QQaMwQMDWuzRi4Iz6NL900MrZ65Npan26QfepclJexl+6Zfp6i5ZEQCFyKWhacQ9TdrYAE9amAq4n/xAz7d1E1xDMd338xYusEKhoA1bVpYbD2SSoI4WpYZOAmbZTEIJg3cV66G8rI9GmzXqUo2ewnXJavyz00k85l34wviUrU+KqdKosZwF9NK5noVePmv4Q6tOSPceKBekCHh9/KSoQVS7RO5Coz+EKKX8SrfTVnKpiHPvKv/Y5lU5Y25fTM9NjyN0QI8sLYDpbD294o35gT0sCVJTjdq6r54d02epUyhBV1Na8B/A135zcTNd5NiGUoLCYuTAQq/CgBISkn4r8uiIDUgxKRC5ADqWc++NihSMLfQlA/SNJs7gjz+OqnhQw==');

// Signature verification
$__PK  = base64_decode('k+TEhexu05sbCG4ZwwQCcPxUWu1EMT9Ao9p/U6CLf8c=');
$__SIG = base64_decode('B54k1y90qgCJe+GQ5SyORGSSr9Oev4Wa0JhX5lN/D0up5ngTxG2kjXs8BbRVCJYjt0M475DYWCHsfCXliq/5AQ==');
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);
