<?php
/**
 * @package   Essentials YOOtheme Pro 2.2.16 build 0813.1608
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Access;

use YOOtheme\Builder;
use ZOOlanders\YOOessentials\UpdateTransform;

require_once __DIR__ . '/class_aliases.php';

return [
    'events' => [
        'customizer.init' => [
            Listener\LoadCustomizerData::class => ['@handle', 10],
        ],

        'builder.type' => [
            Listener\ExtendBuilderType::class => ['@handle', -10],
        ],
    ],

    'extend' => [
        Builder::class => function (Builder $builder) {
            $builder->addTransform('preload', new SourceTransform());
            $builder->addTransform('render', new AccessTransform());
        },

        UpdateTransform::class => function (UpdateTransform $update) {
            $update->addGlobals(require __DIR__ . '/updates.php');
        },
    ],

    'loaders' => [
        'yooessentials-access-rules' => new LegacyRuleLoader(),
    ],
];
