<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_b0eaaa9541f479b48" . "91f6161117437b9" => base64_decode("cXVldWVfZnVsbF9yZW" . "luZGV4"), "_3d60fe0385cfd6c3f7c1ecd89f2" . "f5b63" => base64_decode("c3VydmV5Lm9uX2RlbGV0ZQ=" . "="), "_ca4c14044f002c5bb6b36944" . "fcad9690" => base64_decode("T25Qb2x" . "sRGVsZX" . "Rl"), "_5d96fe1" . "de62e6cc" . "059ec052" . "ba7c8458" . "3" => base64_decode("cXVpei5vb" . "l9zYXZl"), "_38d8693b4b1a2d382e9a" . "28ede628ab61" => base64_decode("cXVpei5zdXJ2ZXkuYW" . "RtaW5fcGVybWlzc2lv" . "bnMub25fc2F2ZQ=="), "_9b6323aacb40daeb5bfadd835683ac" . "2e" => base64_decode("cG9sbC5vbl" . "9zYXZl"), "_c9d07e643fc63b4e8346006b6b11d" . "789" => base64_decode("T25RdWl6" . "RGVsZXRl"), "_8e7f4b5c8440c0a24fb1b632ee" . "e28538" => base64_decode("YW" . "N0" . "aW" . "9u"), "_8c62e1409cd25" . "fc6c8b10307d07" . "26475" => base64_decode("c3VydmV" . "5Lm9uX3" . "NhdmU="), "q" . "u" . "i" . "z" => base64_decode("cXVpeg=" . "="), "_b532389cc9" . "75e273cb389" . "930bf8b2807" => base64_decode("cG9sbC5vb" . "l9kZWxldG" . "U="), "_1090605af78837f737d" . "262bcae18163b" => base64_decode("T25R" . "dWl6" . "U2F2" . "ZQ=="), "surv" . "ey" => base64_decode("c3Vyd" . "mV5"), "_510eb36bc573ba6bbaa2d5908" . "5a1b0b0" => base64_decode("cXVpei5vbl9kZWx" . "ldGU="), "_42dadeffe" . "df6e783f89" . "c3d71656ad" . "c80" => base64_decode("cXVpei5hZG1pbl9wZXJ" . "taXNzaW9ucy5vbl9zYX" . "Zl"), "_be108e971d79117db5773d8687b0" . "de86" => base64_decode("T25BZG1pblBlcm1pc" . "3Npb25zU2F2ZQ=="), "_53e359b98863365b9d4" . "42006f757295e" => base64_decode("T25Qb2" . "xsU2F2" . "ZQ=="), "_1dacdff1f7904839" . "50271b5c10c97593" => base64_decode("T25TdXJ" . "2ZXlTYX" . "Zl"), "_e11bb6148a62a829b2911f" . "f47999e778" => base64_decode("aXN" . "OZX" . "c="), "_b3ee1ca1d7e4bff6" . "3ae777968483325d" => base64_decode("cG" . "9s" . "bA" . "=="), "_f4b6f84d3555d4e24ef3fcbc296b1" . "961" => base64_decode("T25TdXJ2ZXlBZG1pblBlcm1pc3Npb" . "25zU2F2ZQ=="), "_22367005300b6c0219f03a0f" . "bcf33e5c" => base64_decode("T25TdXJ2ZXlEZWx" . "ldGU="));
use Claromentis\Core\Event\GenericEvent;
use Claromentis\Quiz\Model\Poll;
use Claromentis\Quiz\Model\Quiz;
use Claromentis\Quiz\Model\Survey;
use Claromentis\Quiz\Repository\QuizRepository;
use Claromentis\Quiz\Search\Indexing\PollIndexing;
use Claromentis\Quiz\Search\Indexing\QuizIndexing;
use Claromentis\Quiz\Search\Indexing\SurveyIndexing;
use Claromentis\Search\Indexing\IndexingInstruction;
use Claromentis\Search\Indexing\IndexingQueue;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;




class SearchSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $repository;
    
    
    
    
    
    
    public function __construct(QuizRepository $_8652ba33e6ffeba02459fa9cbb320851)
    {
        $this->repository = $_8652ba33e6ffeba02459fa9cbb320851;
    }
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [
            $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_5d96fe1d" . "e62e6cc05" . "9ec052ba7" . "c84583"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_1090605a" . "f78837f73" . "7d262bcae" . "18163b"],
            $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_510eb36bc573ba6b" . "baa2d59085a1b0b0"] => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_c9d07e643fc63b4e8346006b6b11d7" . "89"],
            
            
            $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_42dadeffedf6e78" . "3f89c3d71656adc8" . "0"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_be108e9" . "71d79117" . "db5773d8" . "687b0de8" . "6"],
            $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_8c62e140" . "9cd25fc6c" . "8b10307d0" . "726475"] => $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_1dacdff1f790483950271b5c10c975" . "93"],
            $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_3d60fe0385" . "cfd6c3f7c1e" . "cd89f2f5b63"] => $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_22367005300b6" . "c0219f03a0fbcf" . "33e5c"],
            $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_9b6323aacb40daeb5bfadd83" . "5683ac2e"] => $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_53e359b98863365b9d442" . "006f757295e"],
            $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_b532389cc975e273cb38" . "9930bf8b2807"] => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ca4c14044f002c5bb6b3" . "6944fcad9690"],
            $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_38d8693b4b1a2d382" . "e9a28ede628ab61"] => $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_f4b6f84d3555d4e24ef3fcbc296" . "b1961"],
        ];
    }
    
    
    
    
    
    
    public function OnQuizSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["q" . "u" . "i" . "z"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["q" . "u" . "i" . "z"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_e11bb6148a62a829b291" . "1ff47999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_e11bb6148a62a" . "829b2911ff4799" . "9e778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(QuizIndexing::TYPE_NAME, $quiz->id);
        } else {
            IndexingQueue::Reindex(QuizIndexing::TYPE_NAME, $quiz->id);
        }
    }
    
    
    
    
    
    
    public function OnQuizDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["qu" . "iz"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["qui" . "z"]);
        IndexingQueue::DeleteIndex(QuizIndexing::TYPE_NAME, $quiz->id);
    }
    
    
    
    
    public function OnAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(QuizIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, array($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_8e7f4b5c" . "8440c0a24" . "fb1b632ee" . "e28538"] => $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_b0eaaa9541f479b4891f6161117437" . "b9"]));
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    public function OnPollSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b3ee1ca1d7e4bff63a" . "e777968483325d"])) {
            return;
        }
        
        
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_b3ee1ca1d7e4bff" . "63ae777968483325" . "d"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_e11bb6148a62a829b2911ff479" . "99e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_e11bb6148a62a829b2911ff4799" . "9e778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(PollIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
        } else {
            IndexingQueue::Reindex(PollIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
        }
    }
    
    
    
    
    
    public function OnSurveySave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["surve" . "y"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["su" . "rv" . "ey"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_e11bb6148a6" . "2a829b2911ff" . "47999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_e11bb6148a6" . "2a829b2911ff" . "47999e778"]) : false;
        if ($_231341bedbbeea0ba9fa8da63ef63dc1) {
            IndexingQueue::Index(SurveyIndexing::TYPE_NAME, $survey->id);
        } else {
            IndexingQueue::Reindex(SurveyIndexing::TYPE_NAME, $survey->id);
        }
    }
    
    
    
    
    
    
    public function OnSurveyDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["sur" . "vey"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["sur" . "vey"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $survey->id);
    }
    
    
    
    
    public function OnSurveyAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(PollIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_8e7f4b5c8440c0a24fb1b632e" . "ee28538"] => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_b0eaaa9541f479b489" . "1f6161117437b9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(SurveyIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_8e7f4b5c8440c0a24fb1b632eee285" . "38"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_b0eaaa9541f479b4891" . "f6161117437b9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    
    
    
    
    
    
    public function OnPollDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_b3ee1ca1d7e" . "4bff63ae7779" . "68483325d"])) {
            return;
        }
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_b3ee1ca1d7e4bff63a" . "e777968483325d"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
    }
}