<?php
namespace Claromentis\Projects;

$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("us" . "er" . "_i" . "d" => base64_decode("dXNl" . "cl9p" . "ZA=="), "_cffb263d209d676682df" . "061eba286248" => base64_decode("T25QcmVEZWxldGVQc" . "m9qZWN0"), "_9b06d65a15c3dc65a73d39af3e03837" . "1" => base64_decode("T25Qb3N0RGVsZXRlUmVxdWVzdE5vdGlmaWNhdGlvbg=" . "="), "topi" . "c" => base64_decode("dG9waW" . "M="), "_cc6bd2fce49dc34feaea14b" . "cb1fd8421" => base64_decode("T25SZXF1ZXN0Tm90" . "aWZpY2F0aW9uVG9w" . "aWM="), "_4403a337727c9405d4e09dae4d" . "f436af" => base64_decode("T25SZXF1ZXN0Tm" . "90aWZpY2F0aW9u"), "project_" . "id" => base64_decode("cHJvamVjdF" . "9pZA=="));
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Projects\Entity\Topic;
use Claromentis\Projects\Event\ProjectPostDeletedEvent;
use Claromentis\Projects\Event\ProjectPreDeleteEvent;
use Claromentis\Projects\Event\TopicCreateEvent;
use Claromentis\Projects\Service\NotificationService;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;






class NotificationsSubscriber implements EventSubscriberInterface
{
    
    
    protected $notification_service;
    
    
    protected $context;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [
            NotificationService::PROJECT_ADDED_TO_TEAM => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_4403a337727c9405d4e09dae4d" . "f436af"],
            NotificationService::PROJECT_ROLE_CHANGED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_4403a337727c9405d4e09dae4df43" . "6af"],
            NotificationService::PROJECT_UPDATE => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_4403a337727c9405d4e09dae4df" . "436af"],
            NotificationService::PROJECT_STATUS_CHANGE => $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_4403a337727c9405d" . "4e09dae4df436af"],
            NotificationService::PROJECT_DISCUSSION_POSTED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_4403a33772" . "7c9405d4e09" . "dae4df436af"],
            NotificationService::PROJECT_REPLY_POSTED => $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_4403a337727c9405d4e0" . "9dae4df436af"],
            NotificationService::PROJECT_FILE_ADDED => $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_4403a337727" . "c9405d4e09da" . "e4df436af"],
            NotificationService::TASK_ASSIGNED_TO_TASK => $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_4403a33" . "7727c940" . "5d4e09da" . "e4df436a" . "f"],
            NotificationService::TASK_NEW_TASK_ADDED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_4403a3377" . "27c9405d4e" . "09dae4df43" . "6af"],
            NotificationService::TASK_UPDATED => $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_4403a337727c" . "9405d4e09dae4" . "df436af"],
            NotificationService::TASK_COMPLETION => $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_4403a337727c9405d4e" . "09dae4df436af"],
            NotificationService::TASK_DUE_TODAY => $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_4403a337727c940" . "5d4e09dae4df436a" . "f"],
            NotificationService::TASK_OVERDUE => $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_4403a337727c940" . "5d4e09dae4df436a" . "f"],
            NotificationService::TASK_DISCUSSION_POSTED => $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_4403a33" . "7727c940" . "5d4e09da" . "e4df436a" . "f"],
            NotificationService::TASK_REPLY_POSTED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_4403a337727c9405d4e09dae" . "4df436af"],
            NotificationService::TASK_FILE_ADDED => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_4403a337727c9405" . "d4e09dae4df436af"],
            NotificationService::TASK_DELETED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_4403a337727c940" . "5d4e09dae4df436a" . "f"],
            
            
            ProjectPreDeleteEvent::NAME => $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_cffb263d209d67" . "6682df061eba286" . "248"],
            ProjectPostDeletedEvent::NAME => $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_9b06d65a15c3dc65a73d39af3e03" . "8371"],
            
            
            NotificationService::TOPICS_NEW_TOPIC_ADDED => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_cc6bd2fce49dc" . "34feaea14bcb1f" . "d8421"],
        ];
    }
    public function __construct(NotificationService $_88e3baed593bc10d4b7045181b4ac725, SecurityContext $context)
    {
        $this->notification_service = $_88e3baed593bc10d4b7045181b4ac725;
        $this->context = $context;
    }
    
    
    
    
    public function OnPreDeleteProject(ProjectPreDeleteEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->notification_service->SetDeletedProject($_e62ca7bbb93b52cafc82da1c2aefe9ec);
    }
    public function OnPostDeleteRequestNotification($_e62ca7bbb93b52cafc82da1c2aefe9ec, $_8dabb06efc95df4cff7c4afe91857b53)
    {
        $_99aaa03a11622e16e59bff0771ea8ef3 = new Notification($_8dabb06efc95df4cff7c4afe91857b53, $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetData());
        $this->notification_service->SendNotifications($_99aaa03a11622e16e59bff0771ea8ef3, $this->context);
    }
    public function OnRequestNotification(ProjectEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec, $_8dabb06efc95df4cff7c4afe91857b53)
    {
        $_99aaa03a11622e16e59bff0771ea8ef3 = new Notification($_8dabb06efc95df4cff7c4afe91857b53, $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetData());
        $this->notification_service->SendNotifications($_99aaa03a11622e16e59bff0771ea8ef3, $this->context);
    }
    public function OnRequestNotificationTopic(TopicCreateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec, $_8dabb06efc95df4cff7c4afe91857b53)
    {
        
        
        $topic = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getSubject();
        $_99aaa03a11622e16e59bff0771ea8ef3 = new Notification($_8dabb06efc95df4cff7c4afe91857b53, [$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["proj" . "ect_" . "id"] => $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProjectId(), $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["to" . "pi" . "c"] => $topic, $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["us" . "er" . "_i" . "d"] => $_e62ca7bbb93b52cafc82da1c2aefe9ec->getUserId()]);
        $this->notification_service->SendNotifications($_99aaa03a11622e16e59bff0771ea8ef3, $this->context);
    }
}