<?php
namespace Claromentis\Quiz\Subscriber;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_f4b6f84d" . "3555d4e24" . "ef3fcbc29" . "6b1961" => base64_decode("T25TdXJ2ZXlBZ" . "G1pblBlcm1pc3" . "Npb25zU2F2ZQ=" . "="), "_1090605af78837f737d262" . "bcae18163b" => base64_decode("T25RdWl6" . "U2F2ZQ=="), "_be108e971" . "d79117db57" . "73d8687b0d" . "e86" => base64_decode("T25BZG1pblBlcm1pc3Npb25zU2F2Z" . "Q=="), "surv" . "ey" => base64_decode("c3Vydm" . "V5"), "qu" . "iz" => base64_decode("cXV" . "peg" . "=="), "_38d8693" . "b4b1a2d3" . "82e9a28e" . "de628ab6" . "1" => base64_decode("cXVpei5zdXJ2ZXkuYWRtaW5fcGVybWlzc2lvbnMu" . "b25fc2F2ZQ=="), "_c9d07e6" . "43fc63b4" . "e8346006" . "b6b11d78" . "9" => base64_decode("T25RdWl6RGV" . "sZXRl"), "_510eb36bc573ba6bbaa2d5908" . "5a1b0b0" => base64_decode("cXVpei5" . "vbl9kZW" . "xldGU="), "_8c62e1409cd25fc6c8b1030" . "7d0726475" => base64_decode("c3VydmV5Lm9u" . "X3NhdmU="), "_5d96fe1de62e6cc059ec052ba" . "7c84583" => base64_decode("cXVpei5vbl9zYXZ" . "l"), "_53e359b98863365b9d4420" . "06f757295e" => base64_decode("T25Qb2xsU2F2" . "ZQ=="), "_8e7f4b5c8440c0a24fb" . "1b632eee28538" => base64_decode("YWN0aW9" . "u"), "_b3ee1ca1d7e4bff63ae7779684833" . "25d" => base64_decode("cG9sbA=" . "="), "_9b6323aacb4" . "0daeb5bfadd8" . "35683ac2e" => base64_decode("cG9sbC5vbl9zY" . "XZl"), "_3d60fe0385cf" . "d6c3f7c1ecd89" . "f2f5b63" => base64_decode("c3VydmV5Lm9uX2R" . "lbGV0ZQ=="), "_b0eaaa9541f479b4891f61611" . "17437b9" => base64_decode("cXVldWVf" . "ZnVsbF9y" . "ZWluZGV4"), "_1dacdff1f790483950271b5c10c97" . "593" => base64_decode("T25TdX" . "J2ZXlT" . "YXZl"), "_b532389cc975e" . "273cb389930bf8" . "b2807" => base64_decode("cG9sbC5vbl9kZWxldGU" . "="), "_42dadef" . "fedf6e78" . "3f89c3d7" . "1656adc8" . "0" => base64_decode("cXVpei5hZG1pbl9wZXJt" . "aXNzaW9ucy5vbl9zYXZl"), "_22367005300b6c021" . "9f03a0fbcf33e5c" => base64_decode("T25TdXJ2ZXlEZWxl" . "dGU="), "_ca4c14044f002c5" . "bb6b36944fcad969" . "0" => base64_decode("T25Qb" . "2xsRG" . "VsZXR" . "l"), "_e11bb6148a62a829b2911ff47999e77" . "8" => base64_decode("aXNOZX" . "c="));
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["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_5d96fe1de62e6c" . "c059ec052ba7c84" . "583"] => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_1090605af7" . "8837f737d26" . "2bcae18163b"],
            $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_510eb36bc57" . "3ba6bbaa2d59" . "085a1b0b0"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_c9d07e643fc63b4e8346006b6b11d" . "789"],
            
            
            $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_42dadeffedf6e78" . "3f89c3d71656adc8" . "0"] => $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_be108e971d79117db5773d" . "8687b0de86"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_8c62e1409cd25fc6" . "c8b10307d0726475"] => $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_1dacdff1f7904839" . "50271b5c10c97593"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_3d60fe0385cfd6c3f7c1ecd8" . "9f2f5b63"] => $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_22367005" . "300b6c021" . "9f03a0fbc" . "f33e5c"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_9b6323aacb40daeb5b" . "fadd835683ac2e"] => $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_53e359b9886336" . "5b9d442006f7572" . "95e"],
            $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_b532389cc975e273cb389930" . "bf8b2807"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_ca4c14044f002c5bb6b3694" . "4fcad9690"],
            $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_38d8693b4b" . "1a2d382e9a2" . "8ede628ab61"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_f4b6f84d3555d4e" . "24ef3fcbc296b196" . "1"],
        ];
    }
    
    
    
    
    
    
    public function OnQuizSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["q" . "u" . "i" . "z"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["qu" . "iz"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_e11bb6148a62" . "a829b2911ff47" . "999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_e11bb6148a62a829b291" . "1ff47999e778"]) : 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["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["qui" . "z"])) {
            return;
        }
        
        
        
        
        $quiz = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["qu" . "iz"]);
        IndexingQueue::DeleteIndex(QuizIndexing::TYPE_NAME, $quiz->id);
    }
    
    
    
    
    public function OnAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(QuizIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, array($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_8e7f4b5c844" . "0c0a24fb1b63" . "2eee28538"] => $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_b0eaaa9541f4" . "79b4891f61611" . "17437b9"]));
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    public function OnPollSave(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_b3ee1ca1d7e4bff63ae7779684" . "83325d"])) {
            return;
        }
        
        
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_b3ee1ca1d7e4bff63ae777968483325" . "d"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_e11bb6148a62a8" . "29b2911ff47999e" . "778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_e11bb6148a" . "62a829b2911" . "ff47999e778"]) : 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["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["surv" . "ey"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["su" . "rv" . "ey"]);
        $_231341bedbbeea0ba9fa8da63ef63dc1 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_e11bb6148a62a829b2911ff47" . "999e778"]) ? (bool) $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_e11bb6148a62a8" . "29b2911ff47999e" . "778"]) : 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["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["sur" . "vey"])) {
            return;
        }
        
        
        $survey = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["su" . "rv" . "ey"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $survey->id);
    }
    
    
    
    
    public function OnSurveyAdminPermissionsSave()
    {
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(PollIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_8e7f4b5c8440c0a24fb1b632eee" . "28538"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_b0eaaa9541f479b4891f6161117437b" . "9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
        $_8c5f17e2e918145535955f8a633b6c7b = new IndexingInstruction(SurveyIndexing::TYPE_NAME, 0, 0, IndexingInstruction::SPECIAL, [$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_8e7f4b5c8440c0a24f" . "b1b632eee28538"] => $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_b0eaaa9541f479b4891f6161117437" . "b9"]]);
        IndexingQueue::AddInstruction($_8c5f17e2e918145535955f8a633b6c7b);
    }
    
    
    
    
    
    
    public function OnPollDelete(GenericEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (!$_e62ca7bbb93b52cafc82da1c2aefe9ec->hasArgument($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_b3ee1ca1d7e4bff63ae77796848332" . "5d"])) {
            return;
        }
        
        
        $_b3ee1ca1d7e4bff63ae777968483325d = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getArgument($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_b3ee1ca1d7e4bff6" . "3ae777968483325d"]);
        IndexingQueue::DeleteIndex(SurveyIndexing::TYPE_NAME, $_b3ee1ca1d7e4bff63ae777968483325d->id);
    }
}