<?php

namespace Hecate;
use Hecate\Customizer\CustomizerJsData;
use Hecate\Customizer\CustomizerManager;
use Hecate\Components\ComponentsRepository;
use Hecate\Components\ComponentMods;

class Theme {


	private static $instance = null;

	private function __construct() {

		add_action( 'after_setup_theme', array( $this, 'boot' ) );
	}

	public static function getInstance() {
		if ( ! self::$instance ) {
			self::$instance = new static();
		}

		return self::$instance;
	}

	public static function init() {
		return self::getInstance();
	}

	public function boot() {

            ComponentMods::init();

			ComponentsRepository::init();

		if ( is_customize_preview() ) {
			CustomizerManager::init();
			CustomizerJsData::init();
		}

	}
}
