<?php
namespace Claromentis\Core\Ai\Subscriber;

$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_23923804e" . "37345db9c9" . "3f81a4a302" . "b1b" => base64_decode("c2VhcmNoX2ljb2" . "4udmlzaWJsZQ=="), "_718df5d9d601e81" . "04066f86c072735f" . "3" => base64_decode("YWktc2VhcmNoIGFpLXNlYX" . "JjaC1uYXZiYXI="), "_e2cd02b34604bb4da597fe4" . "40cfe476e" => base64_decode("c2V" . "hcm" . "No"), "_0035617050144e4a29c311" . "c203fded3b" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EuYXJpYS1sYWJlbA" . "=="), "_111eb07d16a9103c03fe50eb5325" . "9a6e" => base64_decode("YWlfc2VhcmNoX2ljb2" . "4udmlzaWJsZQ=="), "_28459e8c25caa388efa6e9ebf" . "1e6ab12" => base64_decode("c2VhcmNoX2ZpZW" . "xkX3dyYXBwZXIu" . "K2NsYXNz"), "_7c78ef044de79e7986f197a" . "534a47e29" => base64_decode("Y29tbW9uLmhlYWRlci5h" . "c2tfYW55dGhpbmc="), "_6177aeb22c860fcf2344" . "b3d9d788fd0e" => base64_decode("c2VhcmNoX" . "292ZXJ2aW" . "V3"), "_990213a766fafdaf2a796c3c9" . "d74b872" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EucGxh" . "Y2Vob2xkZXI="), "_81a63d58717daa2360187cde20" . "12676c" => base64_decode("b25QcmVSZW5kZ" . "XI="), "_cf1147f375327c" . "8e8e02acd085df1" . "aa6" => base64_decode("b25Ud2lnUH" . "JlUmVuZGVy"));
use Claromentis\Core\Ai\Ai;
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\Templater\Events\TemplaterPreRenderEvent;
use Claromentis\Core\Templater\TemplaterEvents;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Claromentis\Core\Twig\TwigEvents;




class RenderSubscriber implements EventSubscriberInterface
{
    protected Ai $ai;
    protected Lmsg $lmsg;
    
    
    
    
    
    
    
    public function __construct(Ai $ai, Lmsg $lmsg)
    {
        $this->ai = $ai;
        $this->lmsg = $lmsg;
    }
    public static function getSubscribedEvents()
    {
        return [TemplaterEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_81a63d587" . "17daa23601" . "87cde20126" . "76c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_cf1147f375327c8e8e" . "02acd085df1aa6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments($event->GetArgs());
        $event->SetArgs($args);
    }
    public function onTwigPreRender(TwigPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments();
        $event->addArguments($args);
    }
    
    
    
    
    
    
    
    private function applyTemplateArguments(array $args = []) : array
    {
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_e2cd02b34" . "604bb4da59" . "7fe440cfe4" . "76e"])) {
            $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_990213a766fafdaf2a796c3c" . "9d74b872"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_7c78ef044de79e7986f197a534a47e" . "29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_0035617050144e4a29c3" . "11c203fded3b"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_7c78ef044de79e7986f" . "197a534a47e29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_23923804e37345db9c93f81a4a302" . "b1b"]] = 0;
            $args[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_111eb07d16a9103c03fe5" . "0eb53259a6e"]] = 1;
        }
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_6177aeb22c860fcf2344b" . "3d9d788fd0e"])) {
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_28459e8c25ca" . "a388efa6e9ebf" . "1e6ab12"]] = $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_718df5d9d601e8104066f86c07273" . "5f3"];
        }
        return $args;
    }
}