<?php
namespace Claromentis\Search\Suggestions;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] ?: array()) + array("_7f628626dd1d55c71b1f" . "c0932ffd1d2c" => base64_decode("aXNfYXJy" . "YXk="), "_49c6565477e" . "e9f822b499a5" . "3e6d2995f" => base64_decode("YXJyYXlfa2V5X2V4aX" . "N0cw=="), "_f73dab606630b38864" . "5c4f7d3fbb13bb" => base64_decode("YXJyYXlfbWVy" . "Z2U="), "_ab1e14183ebb023" . "78ed5335a96a4288" . "d" => base64_decode("Y2ZnX3NlYXJja" . "F9wbHVnaW5z"));
use ErrorHandler;









class PluginLoader extends ErrorHandler
{
    
    
    
    
    
    
    protected static $valid_applications = array('documents' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Document', 'publish' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Publish', 'news' => 'Claromentis\\Search\\Suggestions\\SearchResource\\News', 'people' => 'Claromentis\\Search\\Suggestions\\SearchResource\\People', 'forum' => 'Claromentis\\Search\\Suggestions\\SearchResource\\Forum');
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function GetPluginByUrl($url)
    {
        $_a99e51514fd0fcca58579cb5552a6035 = static::GetPlugins();
        foreach ($_a99e51514fd0fcca58579cb5552a6035 as $_6a02aaefc5f2925e469e5aca3990865a => $_327c87139880ba8bc0fa0b9a7e24a44d) {
            if ($_327c87139880ba8bc0fa0b9a7e24a44d::IsSupportedUrl($url)) {
                $_daf0ea4a4657bd95111bb4f0079b9cff = new $_327c87139880ba8bc0fa0b9a7e24a44d();
                return [$_daf0ea4a4657bd95111bb4f0079b9cff, $_6a02aaefc5f2925e469e5aca3990865a];
            }
        }
        return [null, null];
    }
    
    
    
    
    
    
    
    
    
    public static function PluginFactory($_f44467aacb8a4520c7382769d24aa422)
    {
        $_a99e51514fd0fcca58579cb5552a6035 = static::GetPlugins();
        if ($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_49c6565477ee9f822b499a53e6" . "d2995f"]($_f44467aacb8a4520c7382769d24aa422, $_a99e51514fd0fcca58579cb5552a6035)) {
            return new $_a99e51514fd0fcca58579cb5552a6035[$_f44467aacb8a4520c7382769d24aa422]();
        } else {
            return null;
        }
    }
    
    
    
    
    
    
    
    private static function GetPlugins()
    {
        global $g_application;
        $_ab1e14183ebb02378ed5335a96a4288d = $g_application->config->get($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_ab1e14183ebb0" . "2378ed5335a96a" . "4288d"]);
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_7f628626" . "dd1d55c71" . "b1fc0932f" . "fd1d2c"]($_ab1e14183ebb02378ed5335a96a4288d)) {
            $_a99e51514fd0fcca58579cb5552a6035 = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_f73dab606630b388645c4f7d3fbb" . "13bb"](self::$valid_applications, $_ab1e14183ebb02378ed5335a96a4288d);
        } else {
            $_a99e51514fd0fcca58579cb5552a6035 = self::$valid_applications;
        }
        return $_a99e51514fd0fcca58579cb5552a6035;
    }
}