<?php
namespace Claromentis\Pages\Stat;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_98401753167b015e6e59d" . "b23361984f9" => base64_decode("Z2x5cGhpY29ucy1wYWdl" . "cw=="), "_5a8b1c5e7f1c" . "c4976c0a2b564" . "211cc54" => base64_decode("cGFnZXMvc3RhdC" . "9tYWluLmh0bWw="), "_3f05c7e033d5fa" . "5883b27e9248e3a" . "b53" => base64_decode("cGFnZXM" . "="), "_46ebe283f49f124496" . "172f97bfe53b50" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4uYXZlcmFnZV92aWV" . "3cw=="), "_7713666c10f" . "1566e673d0e8" . "106cd8c0a" => base64_decode("ZGF0YV90eXBlX2Jsb2NrX3Zpc" . "2libGUudmlzaWJsZQ=="), "_9b6310d" . "c649a866" . "c978c84b" . "9ed2f81d" . "5" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4uc2VyaWVzLnBhZ2Vfdmll" . "d3NfdG9vbHRpcA=="), "_2ecaaccc5f23b789d" . "2931cf60db90d27" => base64_decode("cGFnZV90aXR" . "sZS5ib2R5"), "_b92b5ed2edaf18b8eec721c1" . "422e34ee" => base64_decode("cm91bm" . "Q="), "_fb97865c9584c8026ea64ae" . "be0463065" => base64_decode("dml" . "ld1" . "9wY" . "Wdl"), "_a36772b93f40b35110e9897" . "980b47ce8" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4ucGFnZV90aXRsZQ=" . "="), "_81639498a0f836244c7c48fa513a" . "9247" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4ub" . "mFtZQ=="), "_0c5123aa744f69bbc0e8b3ea2f6" . "e847d" => base64_decode("bG" . "1z" . "Zw" . "=="), "_385f193fda519d3ef5a76098f12c" . "f7eb" => base64_decode("cGFnZXMuc3RhdF9wbHVnaW4udm" . "lld3M="), "_4d707fab" . "93bebb00b" . "be69e8159" . "697c90" => base64_decode(""), "_f3c01efbec4e34280b394d" . "427cacd62c" => base64_decode("dmlld3NfY2hhcnQuYm9" . "keV9odG1s"), "_7f628626dd1" . "d55c71b1fc09" . "32ffd1d2c" => base64_decode("aXNf" . "YXJy" . "YXk="), "_e0fa173dc2c2bd2ab21f703726682" . "cf1" => base64_decode("dmlld" . "19hc1" . "9ob21" . "l"));
use Claromentis\Stat\StatProviderInterface;
use Claromentis\Stat\StatReporter;
use Claromentis\Stat\StatDiagramDrawer;
use Claromentis\Pages\Perm;
use Claromentis\Core\DAL;
use Date;
class PagesStatContentProvider implements StatProviderInterface
{
    
    
    
    
    const MODULE_IDENTIFIER = 'pages';
    
    
    
    
    private $db;
    
    
    
    
    private $stat_repository;
    
    
    
    
    private $stat_reporter;
    
    
    
    
    
    public function __construct(DAL\Db $_e87574de8e606d438c70d60ffb96ef44, PagesStatRepositoryPages $_e51b1f098b64b6c7e8aecf08e1cc8539)
    {
        $this->db = $_e87574de8e606d438c70d60ffb96ef44;
        $this->stat_repository = $_e51b1f098b64b6c7e8aecf08e1cc8539;
    }
    
    
    
    
    
    
    public function GetStatCollectorData() : array
    {
        return [self::MODULE_IDENTIFIER, [[Perm::AGGREGATION_PAGES_PAGE, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_e0fa173dc2c2bd2a" . "b21f703726682cf1"], false], [Perm::AGGREGATION_PAGES_PAGE, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_fb97865c9584c80" . "26ea64aebe046306" . "5"], false]]];
    }
    
    
    
    
    
    
    public function SetStatReporter(StatReporter $_d4f24b545ad4fb92429634be0606909a)
    {
        $this->stat_reporter = $_d4f24b545ad4fb92429634be0606909a;
    }
    
    
    
    
    
    
    public function GetName() : string
    {
        return $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_0c5123aa744f69bbc0e8b3ea2f6e" . "847d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_81639498a0f836244c" . "7c48fa513a9247"]);
    }
    
    
    
    
    
    
    public function GetIconClass() : string
    {
        return $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_98401753167b015e6e59db" . "23361984f9"];
    }
    
    
    
    
    
    
    public function GetChartType() : string
    {
        return self::MODULE_IDENTIFIER;
    }
    
    
    
    
    
    
    public function GetSeries() : array
    {
        return $this->stat_repository->GetSiteSeries($this->stat_reporter);
    }
    
    
    
    
    
    
    public function GetSeriesTooltips() : array
    {
        $_e3fd03c315298aef158f684d5fe47ca5 = [];
        foreach ($this->GetSeries() as $_0ea4e32b57963ac0cb3057e03e9aef64 => $name) {
            $_e3fd03c315298aef158f684d5fe47ca5[$_0ea4e32b57963ac0cb3057e03e9aef64] = $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_9b6310dc649a866c9" . "78c84b9ed2f81d5"];
        }
        return $_e3fd03c315298aef158f684d5fe47ca5;
    }
    
    
    
    
    
    
    
    
    public function GetSeriesData(int $_d9ba6ca3b609d7f857c96b65791617e3) : array
    {
        
        
        $_23a9b425f65f6a53e91c7f695f8f29e6 = $this->stat_repository->GetSiteSeriesData($this->stat_reporter);
        return $_23a9b425f65f6a53e91c7f695f8f29e6[$_d9ba6ca3b609d7f857c96b65791617e3];
    }
    
    
    
    
    
    
    
    public function GetAllSeriesTotalCount() : int
    {
        $_f4eafa5f493306ffdb51a688b21dd507 = 0;
        if (!empty($this->stat_reporter)) {
            $_f4eafa5f493306ffdb51a688b21dd507 = $this->stat_reporter->GetViewsCount(Perm::AGGREGATION_PAGES_PAGE);
        }
        return $_f4eafa5f493306ffdb51a688b21dd507;
    }
    
    
    
    
    
    
    
    public function GetAllSeriesTotalCountText() : string
    {
        return $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_0c5123aa7" . "44f69bbc0e" . "8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_385f193fda519d3ef5a76098f12c" . "f7eb"], $this->GetAllSeriesTotalCount());
    }
    
    
    
    
    
    
    
    public function GetAllSeriesDailyAverageCount() : float
    {
        $_f4eafa5f493306ffdb51a688b21dd507 = $this->GetAllSeriesTotalCount();
        $_34535e92155a643211db196780a5a677 = $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_b92b5ed2edaf18b8eec721c1422e3" . "4ee"]($_f4eafa5f493306ffdb51a688b21dd507 / $this->stat_reporter->GetDays(), 2);
        return $_34535e92155a643211db196780a5a677;
    }
    
    
    
    
    
    
    
    public function GetAllSeriesDailyAverageCountText() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_0c5123aa744f69b" . "bc0e8b3ea2f6e847" . "d"]($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_46ebe283f49f1" . "24496172f97bfe" . "53b50"], $this->GetAllSeriesDailyAverageCount());
    }
    
    
    
    
    
    
    public function GetPageTitle() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_0c5123aa7" . "44f69bbc0e" . "8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_a36772b93f40b35110e9897980" . "b47ce8"]);
    }
    
    
    
    
    
    
    public function GetTemplateFilename() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_5a8b1c5e7f1cc4976c0a2b5642" . "11cc54"];
    }
    
    
    
    
    
    
    
    
    public function GetTemplateArgs(Date $_1e491d70b7c6ff2f5e7e1fa21ad956f3, Date $_c955d13b8651b08fd00aa43169d63ea1) : array
    {
        $args = [];
        $args[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_2ecaaccc5f23b789d2931cf60db" . "90d27"]] = $this->GetPageTitle();
        $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_7713666c10f1566e673d0e8106" . "cd8c0a"]] = false;
        
        
        $_c450cc95bd5060532f9a9f40c745adcb = new StatDiagramDrawer();
        $_c450cc95bd5060532f9a9f40c745adcb->SetSize(-1, 250);
        $_c450cc95bd5060532f9a9f40c745adcb->SetTitle($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4d707fab93bebb00bb" . "e69e8159697c90"]);
        $_d9ba6ca3b609d7f857c96b65791617e3 = $this->GetSeries();
        $_e3fd03c315298aef158f684d5fe47ca5 = $this->GetSeriesTooltips();
        foreach ($_d9ba6ca3b609d7f857c96b65791617e3 as $_1e2228816f84bbc72921dc2769308b8d => $_0e810c22030b207c1cda2619859f6aeb) {
            $_c450cc95bd5060532f9a9f40c745adcb->AddData($this->GetSeriesData($_1e2228816f84bbc72921dc2769308b8d), $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_7f628626dd1d55c71b" . "1fc0932ffd1d2c"]($_e3fd03c315298aef158f684d5fe47ca5) && !empty($_e3fd03c315298aef158f684d5fe47ca5) ? $_e3fd03c315298aef158f684d5fe47ca5[$_1e2228816f84bbc72921dc2769308b8d] : $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_4d707fab93bebb00bbe69e8159" . "697c90"], $_0e810c22030b207c1cda2619859f6aeb);
        }
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_f3c01efbec4e34280b394d427cacd6" . "2c"]] = $_c450cc95bd5060532f9a9f40c745adcb->Draw();
        
        
        $_c2746b6f6ffb5c666ae214e60e11a456 = new PagesStatReportPages($this->db, $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_3f05c7e03" . "3d5fa5883b" . "27e9248e3a" . "b53"]);
        $_c2746b6f6ffb5c666ae214e60e11a456->SetDatesFilter($_1e491d70b7c6ff2f5e7e1fa21ad956f3, $_c955d13b8651b08fd00aa43169d63ea1);
        $_c2746b6f6ffb5c666ae214e60e11a456->Init();
        $_c2746b6f6ffb5c666ae214e60e11a456->DrawHtml();
        $args += $_c2746b6f6ffb5c666ae214e60e11a456->GetArgs();
        return $args;
    }
}