<?php
namespace Claromentis\Console\Events;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_7bcdfd12540318f956c42d9d627403" . "ed" => base64_decode("Q2Ru" . "QmVn" . "aW4="), "_c05e8a75853f6ef3245cd003e243" . "6868" => base64_decode("ZGJf" . "YmVn" . "aW4="), "_c3193c9edf55" . "f07581c41c31a" . "b168148" => base64_decode("RGJCZW" . "dpbg=="), "_48716664ff1a8cdd6" . "cccfc9613c645fe" => base64_decode("b" . "W" . "F" . "4"), "_73115ee" . "8f369adc" . "89a65259" . "78197c09" . "4" => base64_decode("ZGF0Y" . "V9lbm" . "Q="), "_7cdb85d837287cc2" . "898a18128663e6c1" => base64_decode("Y2RuX2VuZA=" . "="), "_4d707fab93beb" . "b00bbe69e81596" . "97c90" => base64_decode(""), "_8e9198a37af2aef" . "09ab6f4d09e63b99" . "e" => base64_decode("ZGF0YV9iZWdp" . "bg=="), "_65e744b83dac5daa893eb3dd929c65" . "35" => base64_decode("R2V0VGFibGVzUHJvZ3Jlc" . "3M="), "_d5ae3fd936b081e62092948acad1" . "866e" => base64_decode("RGF0YUJlZ" . "2lu"), "_4b75dcc9a37fa8f1" . "f41bd883e91162a7" => base64_decode("Q2RuRW5" . "k"), "_6d53e6811453" . "0ed7972713c62" . "b800bfd" => base64_decode("ZG" . "Jf" . "ZW" . "5k"), "_1e3e938444e012" . "338c44c371cab7c" . "c3b" => base64_decode("R2V0RGF" . "0YVByb2" . "dyZXNz"), "_97803a8b7cef7cbb3598" . "a2cb58a4853c" => base64_decode("Y2RuX2JlZ" . "2lu"), "_97c8b6f00dcbaa32e80e660" . "44c92c5b6" => base64_decode("R2V0Q2RuUHJvZ3" . "Jlc3M="), "_0dbda6cea18b95524b696deee84" . "fcad1" => base64_decode("RGJ" . "Fbm" . "Q="), "_524a9aff7db045ab3de86" . "2d553a9c90a" => base64_decode("RG9Qcm" . "9ncmVz" . "cw=="), "_5e723961a2901972976f37c6ab7" . "ecf98" => base64_decode("RGF0YUVuZA=" . "="));
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["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_c3193c9edf55f07581c" . "41c31ab168148"], AbstractImportExport::DB_END_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_0dbda6cea18b95524" . "b696deee84fcad1"], AbstractImportExport::DATA_START_EVENT => $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_d5ae3fd936b081e62092948" . "acad1866e"], AbstractImportExport::DATA_END_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_5e723961a2" . "901972976f3" . "7c6ab7ecf98"], AbstractImportExport::CDN_START_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_7bcdfd12540318f956c42d9d627403e" . "d"], AbstractImportExport::CDN_END_EVENT => $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_4b75dcc9a37fa8f1f4" . "1bd883e91162a7"], AbstractImportExport::UPDATE_EVENT => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_524a9aff7db0" . "45ab3de862d55" . "3a9c90a"]];
    }
    public function DbBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_c05e8a75853f6ef324" . "5cd003e2436868"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetTablesSize(), $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_65e744b83dac5" . "daa893eb3dd929" . "c6535"]);
    }
    public function DbEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_6d53e68114530ed7972713c62b80" . "0bfd"]]);
    }
    public function DataBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_8e9198a37af2aef09ab" . "6f4d09e63b99e"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetDataSize(), $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_1e3e938444" . "e012338c44c" . "371cab7cc3b"]);
    }
    public function DataEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_73115ee8f369adc89a6525978197c" . "094"]]);
    }
    public function CdnBegin(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $_7fb3df533b7949de8374b1cf6d5394ad = $_e62ca7bbb93b52cafc82da1c2aefe9ec->getProgressTracker();
        $this->GenericBegin(1000000, $this->messages[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_97803a8b7cef7cbb3598" . "a2cb58a4853c"]], $_7fb3df533b7949de8374b1cf6d5394ad->GetCdnSize(), $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_97c8b6f00dcbaa" . "32e80e66044c92c" . "5b6"]);
    }
    public function CdnEnd(DataExportUpdateEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        $this->GenericEnd($this->messages[$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_7cdb85d837287cc" . "2898a18128663e6c" . "1"]]);
    }
    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["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_48716664ff1a8cdd6" . "cccfc9613c645fe"]((int) ($_be00ff7d4d52251ef742a5c1d7e92be9 / $_22ec5ebc4f009f2eab827fc0adf28b8f), 1);
        $this->io->writeln($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_4d707fab93bebb00bbe69e8159697c9" . "0"]);
        $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["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_4d707fab93bebb00bbe69" . "e8159697c90"]);
        $this->io->writeln($_e05e0022a2e5ad344b9c4a0d3f64e1a5);
    }
}