<?php
namespace Claromentis\Console\Events;

$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_6d53e68114530ed7972713c6" . "2b800bfd" => base64_decode("ZGJfZW" . "5k"), "_8e9198a37af2aef09" . "ab6f4d09e63b99e" => base64_decode("ZGF0YV9iZ" . "Wdpbg=="), "_0dbda6cea18b95524b696deee84fcad" . "1" => base64_decode("RGJFbmQ" . "="), "_d5ae3fd936" . "b081e620929" . "48acad1866e" => base64_decode("RGF0YUJlZ2" . "lu"), "_65e744b83dac5daa" . "893eb3dd929c6535" => base64_decode("R2V0VGFibGVzU" . "HJvZ3Jlc3M="), "_7bcdfd12540318f956c42d9d627403e" . "d" => base64_decode("Q2R" . "uQm" . "Vna" . "W4="), "_48716664ff1a8cdd6c" . "ccfc9613c645fe" => base64_decode("b" . "W" . "F" . "4"), "_97c8b6f00dcbaa32e80" . "e66044c92c5b6" => base64_decode("R2V0Q2RuUHJ" . "vZ3Jlc3M="), "_7cdb85d837287cc" . "2898a18128663e6c" . "1" => base64_decode("Y2Ru" . "X2Vu" . "ZA=="), "_5e723961a2901972976f37c6ab7ec" . "f98" => base64_decode("RGF0" . "YUVu" . "ZA=="), "_524a9aff7db045ab3de862d55" . "3a9c90a" => base64_decode("RG9Qcm9nc" . "mVzcw=="), "_c3193c9edf55f075" . "81c41c31ab168148" => base64_decode("RGJCZWdp" . "bg=="), "_97803a8b7" . "cef7cbb359" . "8a2cb58a48" . "53c" => base64_decode("Y2RuX2JlZ2" . "lu"), "_4b75dcc9a37fa8f" . "1f41bd883e91162a" . "7" => base64_decode("Q2RuRW5" . "k"), "_1e3e938444e0" . "12338c44c371c" . "ab7cc3b" => base64_decode("R2V0RGF" . "0YVByb2" . "dyZXNz"), "_4d707fab93bebb00bbe69e" . "8159697c90" => base64_decode(""), "_c05e8a75853f6ef" . "3245cd003e243686" . "8" => base64_decode("ZGJfYmVna" . "W4="), "_73115ee8f369adc89a652597" . "8197c094" => base64_decode("ZGF0YV9l" . "bmQ="));
use Claromentis\Admin\Sysadmin\Events\DataExportUpdateEvent;
use Claromentis\Admin\Sysadmin\UseCase\AbstractImportExport;
use Claromentis\Admin\Sysadmin\UseCase\DataExport;
use Claromentis\Core\Event\EventSubscriberInterface;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Style\SymfonyStyle;
class DataExportSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $io;
    protected $progress_callback = null;
    protected $progress_method;
    protected $progress_message = '';
    protected $scale = 1;
    protected $size = 1;
    
    
    
    
    protected $progress_bar;
    protected $messages = ['db_begin' => 'Exporting Database...', 'db_end' => 'Database exported', 'data_begin' => 'Exporting data directory...', 'data_end' => 'Data directory exported', 'cdn_begin' => 'Exporting CDN files...', 'cdn_end' => 'CDN files exported'];
    public function __construct(SymfonyStyle $_864a669886d8589b69da46fc523ffd71)
    {
        $this->io = $_864a669886d8589b69da46fc523ffd71;
    }
    
    
    
    
    public function setMessages(array $_fab5a2188c706d282c3aea92f0ccbd01) : void
    {
        $this->messages = $_fab5a2188c706d282c3aea92f0ccbd01;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [AbstractImportExport::DB_START_EVENT => $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_c3193c9edf" . "55f07581c41" . "c31ab168148"], AbstractImportExport::DB_END_EVENT => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_0dbda6cea18b95524b696deee84fcad" . "1"], AbstractImportExport::DATA_START_EVENT => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_d5ae3fd" . "936b081e" . "62092948" . "acad1866" . "e"], AbstractImportExport::DATA_END_EVENT => $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_5e723961a290197297" . "6f37c6ab7ecf98"], AbstractImportExport::CDN_START_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_7bcdfd12540318f956c42" . "d9d627403ed"], AbstractImportExport::CDN_END_EVENT => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_4b75dcc9" . "a37fa8f1f" . "41bd883e9" . "1162a7"], AbstractImportExport::UPDATE_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_524a9aff7db045ab3de862d55" . "3a9c90a"]];
    }
    public function DbBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_c05e8a75853f6ef3245cd003e243686" . "8"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetTablesSize(), $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_65e744b83dac5daa893eb3dd9" . "29c6535"]);
    }
    public function DbEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_6d53e68114530ed797" . "2713c62b800bfd"]]);
    }
    public function DataBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_8e9198a37af2aef09ab6f4d09e6" . "3b99e"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetDataSize(), $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_1e3e938444e01233" . "8c44c371cab7cc3b"]);
    }
    public function DataEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_73115ee8f3" . "69adc89a652" . "5978197c094"]]);
    }
    public function CdnBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_97803a8b7cef7cbb3598a2cb58a48" . "53c"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetCdnSize(), $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_97c8b6f00d" . "cbaa32e80e6" . "6044c92c5b6"]);
    }
    public function CdnEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_7cdb85d837287" . "cc2898a1812866" . "3e6c1"]]);
    }
    public function DoProgress(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        if (isset($this->progress_method)) {
            $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
            $_5f42d55f4c50c2ac2c3e7b1234a36729 = [$_7fb3df533b7949de8374b1cf6d5394ad, $this->progress_method]();
            $this->progress_bar->setProgress((int) ($_5f42d55f4c50c2ac2c3e7b1234a36729 / $this->scale));
        }
    }
    protected function GenericBegin(int $_22ec5ebc4f009f2eab827fc0adf28b8f, string $_e05e0022a2e5ad344b9c4a0d3f64e1a5, float $_be00ff7d4d52251ef742a5c1d7e92be9, string $_b76f867b404b9e82319b2671531d369b)
    {
        $this->scale = $_22ec5ebc4f009f2eab827fc0adf28b8f;
        $this->size = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_48716664ff1a8c" . "dd6cccfc9613c64" . "5fe"]((int) ($_be00ff7d4d52251ef742a5c1d7e92be9 / $_22ec5ebc4f009f2eab827fc0adf28b8f), 1);
        $this->io->writeln($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_4d707fab93be" . "bb00bbe69e815" . "9697c90"]);
        $this->io->writeln($_e05e0022a2e5ad344b9c4a0d3f64e1a5);
        $this->progress_bar = new ProgressBar($this->io, $this->size);
        $this->progress_method = $_b76f867b404b9e82319b2671531d369b;
    }
    protected function GenericEnd(string $_e05e0022a2e5ad344b9c4a0d3f64e1a5)
    {
        $this->progress_method = null;
        $this->progress_bar->setProgress($this->size);
        $this->progress_bar->finish();
        $this->io->writeln($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_4d707fab93bebb00bbe69e" . "8159697c90"]);
        $this->io->writeln($_e05e0022a2e5ad344b9c4a0d3f64e1a5);
    }
}