<?php
namespace Sifency_Addons\Includes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Sifency_Addons_Elementor_Widgets_Asset_Manager {

	public function __construct() {
		add_action( 'elementor/frontend/after_register_styles', array( $this, 'register_frontend_styles' ) );
		add_action( 'elementor/frontend/after_register_scripts', array( $this, 'register_frontend_scripts' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) );
		add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'enqueue_editor_assets' ) );

		add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'register_dummy_elementor_deps' ), 5 );
		add_action( 'admin_enqueue_scripts', array( $this, 'register_dummy_elementor_deps' ), 5 );
		add_action( 'wp_enqueue_scripts', array( $this, 'register_dummy_elementor_deps' ), 5 );

		add_action( 'wp_enqueue_scripts', array( $this, 'sifency_addons_elementor_style_dependencies' ), 999 );
		add_action( 'admin_enqueue_scripts', array( $this, 'sifency_addons_elementor_style_dependencies' ), 999 );
	}
	public function register_dummy_elementor_deps() {
		$missing_editor_deps = array(
			'elementor-v2-editor-canvas',
			'elementor-v2-editor-controls',
			'elementor-v2-editor-editing-panel',
			'elementor-v2-editor-elements',
			'elementor-v2-editor-props',
			'elementor-v2-editor-styles-repository',
			'elementor-v2-editor-templates',
		);

		foreach ( $missing_editor_deps as $dep ) {
			if ( ! wp_script_is( $dep, 'registered' ) ) {
				wp_register_script( $dep, false );
			}
		}
	}
	public function sifency_addons_elementor_style_dependencies() {
		global $wp_styles, $wp_scripts;

		if ( $wp_styles instanceof \WP_Styles ) {
			foreach ( $wp_styles->registered as $handle => $style ) {
				if ( strpos( $handle, 'elementor-post-' ) === 0 && is_array( $style->deps ) ) {
					$style->deps = array_filter(
						$style->deps,
						function( $dep ) use ( $wp_styles ) {
							return isset( $wp_styles->registered[ $dep ] );
						}
					);
				}
			}
		}

		if ( $wp_scripts instanceof \WP_Scripts ) {
			foreach ( $wp_scripts->registered as $handle => $script ) {
				if (
					(
						strpos( $handle, 'elementor-v2-editor-' ) === 0 ||
						$handle === 'elementor-v2-editor-components'
					) &&
					is_array( $script->deps )
				) {
					$script->deps = array_values(
						array_filter(
							$script->deps,
							function( $dep ) use ( $wp_scripts ) {
								return isset( $wp_scripts->registered[ $dep ] );
							}
						)
					);
				}
			}
		}
	}

	/**
	 * Register Frontend Styles
	 */
	public function register_frontend_styles() {
		$base_url      = SIFENCY_ADDONS_URL . 'assets/';
		$elementor_url = SIFENCY_ADDONS_URL . 'includes/elementor/assets/';
		$version       = SIFENCY_ADDONS_VERSION;
		$deps_el       = array();

		/** -------------------------------
		 *  Elementor Widget Styles
		 *--------------------------------*/
		wp_register_style( 'sifency-main-style', $base_url . 'css/main.css', $deps_el, $version );
		wp_enqueue_style( 'sifency-main-style' );
		wp_register_style( 'sifency-theme-builder-style', $base_url . 'css/elementor/theme-builder/theme-builder.css', $deps_el, $version );
		wp_register_style( 'sifency-theme-builder-service-style', $base_url . 'css/elementor/theme-builder/service.css', $deps_el, $version );
		wp_register_style( 'sifency-component-style', $base_url . 'css/elementor/component.css', $deps_el, $version );
		wp_register_style( 'sifency-marquee-style', $base_url . 'css/elementor/marquee.css', $deps_el, $version );
		wp_register_style( 'sifency-blog-style', $base_url . 'css/elementor/blog.css', $deps_el, $version );
		wp_register_style( 'sifency-testimonials-style', $base_url . 'css/elementor/testimonials.css', $deps_el, $version );
		wp_register_style( 'sifency-clients-style', $base_url . 'css/elementor/clients.css', $deps_el, $version );
		wp_register_style( 'sifency-stacks-style', $base_url . 'css/elementor/stacks.css', $deps_el, $version );
		wp_register_style( 'sifency-awards-style', $base_url . 'css/elementor/awards.css', $deps_el, $version );
		wp_register_style( 'sifency-services-style', $base_url . 'css/elementor/services.css', $deps_el, $version );
		wp_register_style( 'sifency-events-style', $base_url . 'css/elementor/events.css', $deps_el, $version );
		wp_register_style( 'sifency-portfolio-style', $base_url . 'css/elementor/portfolio.css', $deps_el, $version );
		wp_register_style( 'sifency-products-style', $base_url . 'css/elementor/products.css', $deps_el, $version );
		wp_register_style( 'sifency-accordion-style', $base_url . 'css/elementor/accordion.css', $deps_el, $version );
		wp_register_style( 'sifency-post-single-style', $base_url . 'css/elementor/post-single.css', $deps_el, $version );
		wp_register_style( 'sifency-career-style', $base_url . 'css/elementor/career.css', $deps_el, $version );
		wp_register_style( 'sifency-team-style', $base_url . 'css/elementor/team.css', $deps_el, $version );
		wp_register_style( 'sifency-iconbox-style', $base_url . 'css/elementor/iconbox.css', $deps_el, $version );
		wp_register_style( 'sifency-button-style', $base_url . 'css/elementor/button.css', $deps_el, $version );
		wp_register_style( 'sifency-moon-style', $elementor_url . 'css/moon.css', $deps_el, $version );
		wp_register_style( 'sifency-info-button-style', $elementor_url . 'css/info-button.css', $deps_el, $version );
		wp_register_style( 'sifency-text-circle-style', $base_url . 'css/elementor/text-circle.css', $deps_el, $version );
		wp_register_style( 'sifency-offcanvas-trigger-style', $base_url . 'css/elementor/offcanvas.css', $deps_el, $version );
		wp_register_style( 'sifency-product-single-style', $base_url . 'css/elementor/product-single.css', $deps_el, $version );
		wp_register_style( 'sifency-nav-style', $elementor_url . 'css/nav.css', $deps_el, $version );
		wp_register_style( 'sifency-nav-menu-style', $elementor_url . 'css/menu.css', $deps_el, $version );
		wp_register_style( 'sifency-digital-style', $elementor_url . 'css/digital.css', $deps_el, $version );
		wp_register_style( 'sifency-video-style', $elementor_url . 'css/video.css', $deps_el, $version );
		wp_register_style( 'sifency-modal-style', $elementor_url . 'css/modal.css', $deps_el, $version );
		wp_register_style( 'sifency-popup-style', $elementor_url . 'css/popup.css', $deps_el, $version );
		wp_register_style( 'sifency-pricing-style', $elementor_url . 'css/pricing.css', $deps_el, $version );
		wp_register_style( 'sifency-pricing-list-style', $elementor_url . 'css/pricing-list.css', $deps_el, $version );
		wp_register_style( 'sifency-pricing-calculator-style', $elementor_url . 'css/pricing-calculator.css', $deps_el, $version );
		wp_register_style( 'sifency-typeout-style', $elementor_url . 'css/typeout.css', $deps_el, $version );
		wp_register_style( 'sifency-dropcap-style', $elementor_url . 'css/dropcap.css', $deps_el, $version );
		wp_register_style( 'sifency-working-hours-style', $elementor_url . 'css/working-hour.css', $deps_el, $version );
		wp_register_style( 'sifency-cta-style', $elementor_url . 'css/cta.css', $deps_el, $version );
		wp_register_style( 'sifency-vertical-tab-style', $elementor_url . 'css/vertical-tab.css', $deps_el, $version );
		wp_register_style( 'sifency-horizontal-tab-style', $elementor_url . 'css/horizontal-tab.css', $deps_el, $version );
		wp_register_style( 'sifency-process-style', $elementor_url . 'css/process.css', $deps_el, $version );
		wp_register_style( 'sifency-vprog-style', $elementor_url . 'css/vertical-progressbar.css', $deps_el, $version );
		wp_register_style( 'sifency-doc-style', $elementor_url . 'css/doc.css', $deps_el, $version );
		wp_register_style( 'sifency-comparative-table-style', $elementor_url . 'css/comparative-table.css', $deps_el, $version );
		wp_register_style( 'sifency-data-table-style', $elementor_url . 'css/data-table.css', $deps_el, $version );
		wp_register_style( 'sifency-info-style', $elementor_url . 'css/info-box.css', $deps_el, $version );
		wp_register_style( 'sifency-banner-style', $elementor_url . 'css/business/banner.css', $deps_el, $version );
		wp_register_style( 'sifency-digital-goods-style', $elementor_url . 'css/digital-goods.css', $deps_el, $version );
		wp_register_style( 'sifency-edd-style', $elementor_url . 'css/edd.css', $deps_el, $version );
		wp_register_style( 'sifency-edd-tb-style', $elementor_url . 'css/edd-tb.css', $deps_el, $version );
		wp_register_style( 'sifency-rest-menu-style', $elementor_url . 'css/restaurant-menu.css', $deps_el, $version );
		wp_register_style( 'sifency-section-title-style', $elementor_url . 'css/section-title.css', $deps_el, $version );
		wp_register_style( 'sifency-before-after-style', $elementor_url . 'css/before-after.css', $deps_el, $version );
		wp_register_style( 'sifency-audio-player-style', $elementor_url . 'css/audio-player.css', $deps_el, $version );
		wp_register_style( 'sifency-message-box-style', $elementor_url . 'css/message-box.css', $deps_el, $version );
		wp_register_style( 'sifency-countdown-style', $elementor_url . 'css/countdown.css', $deps_el, $version );
		wp_register_style( 'sifency-content-showcase-style', $elementor_url . 'css/content-showcase.css', $deps_el, $version );
		wp_register_style( 'sifency-interactive-link-style', $elementor_url . 'css/interactive-links.css', $deps_el, $version );
		wp_register_style( 'sifency-flip-box-style', $elementor_url . 'css/flip-box.css', $deps_el, $version );
		wp_register_style( 'sifency-item-showcase-grid-style', $elementor_url . 'css/item-showcase-grid.css', $deps_el, $version );
		wp_register_style( 'sifency-scheme-style', $elementor_url . 'css/scheme.css', $deps_el, $version );
		wp_register_style( 'sifency-table-of-content-style', $elementor_url . 'css/table-of-content.css', $deps_el, $version );
		wp_register_style( 'sifency-category-card-style', $elementor_url . 'css/woo/category-card.css', $deps_el, $version );
		wp_register_style( 'sifency-news-ticker-style', $elementor_url . 'css/news-ticker.css', $deps_el, $version );
		wp_register_style( 'sifency-image-accordion-style', $elementor_url . 'css/image-accordion.css', $deps_el, $version );
		wp_register_style( 'sifency-advanced-timeline-style', $elementor_url . 'css/business/advanced-timeline.css', $deps_el, $version );
		wp_register_style( 'sifency-timeline-style', $elementor_url . 'css/timeline.css', $deps_el, $version );
		wp_register_style( 'sifency-age-gate-style', $elementor_url . 'css/age-gate.css', $deps_el, $version );
		wp_register_style( 'sifency-login-style', $elementor_url . 'css/login.css', $deps_el, $version );
		wp_register_style( 'sifency-register-style', $elementor_url . 'css/register.css', $deps_el, $version );
		wp_register_style( 'sifency-preloader-style', $elementor_url . 'css/preloader.css', $deps_el, $version );
		wp_register_style( 'sifency-device-frame-style', $elementor_url . 'css/device-frame-slider.css', $deps_el, $version );
		wp_register_style( 'sifency-radial-progressbar-style', $elementor_url . 'css/radial-progressbar.css', $deps_el, $version );
		wp_register_style( 'sifency-chart-style', $elementor_url . 'css/chart.css', $deps_el, $version );
		wp_register_style( 'sifency-toggle-style', $elementor_url . 'css/toggle.css', $deps_el, $version );
		wp_register_style( 'sifency-hotspot-style', $elementor_url . 'css/hotspot.css', $deps_el, $version );
		wp_register_style( 'sifency-divider-style', $elementor_url . 'css/divider.css', $deps_el, $version );
		wp_register_style( 'sifency-project-carousel-style', $elementor_url . 'css/project-carousel.css', $deps_el, $version );
		wp_register_style( 'sifency-seo-style', $elementor_url . 'css/seo.css', $deps_el, $version );
		wp_register_style( 'sifency-sticky-section-style', $elementor_url . 'css/sticky-section.css', $deps_el, $version );
		wp_register_style( 'sifency-checkout-style', $elementor_url . 'css/woo/checkout.css', $deps_el, $version );
		wp_register_style( 'sifency-pdf-style', $elementor_url . 'css/pdf.css', $deps_el, $version );
		wp_register_style( 'sifency-print-style', $elementor_url . 'css/pdf.css', $deps_el, $version );
		wp_register_style( 'sifency-particles-style', $elementor_url . 'css/particles.css', $deps_el, $version );
		wp_register_style( 'sifency-helper-style', $elementor_url . 'css/helper.css', $deps_el, $version );
		wp_register_style( 'sifency-tb-woo-style', $elementor_url . 'css/woo/tb-woo.css', $deps_el, $version );
		wp_register_style( 'sifency-custom-cursor-style', $elementor_url . 'css/cursor.css', $deps_el, $version );
		wp_register_style( 'sifency-breadcrumbs-style', $elementor_url . 'css/breadcrumb.css', $deps_el, $version );
		wp_register_style( 'sifency-creative-style', $elementor_url . 'css/creative/creative.css', $deps_el, $version );
		wp_register_style( 'sifency-master-style', $elementor_url . 'css/creative/master.css', $deps_el, $version );
		wp_register_style( 'sifency-business-style', $elementor_url . 'css/business/video-avatar.css', $deps_el, $version );
		wp_register_style( 'sifency-sun-style', $elementor_url . 'css/creative/sun.css', $deps_el, $version );
		wp_register_style( 'sifency-pro-creative-style', $elementor_url . 'css/creative/pro-creative.css', $deps_el, $version );
		wp_register_style( 'sifency-reveal-showcase-style', $elementor_url . 'css/creative/reveal-showcase.css', $deps_el, $version );
		wp_register_style( 'sifency-3d-arc-carousel-style', $elementor_url . 'css/creative/3d-arc-carousel.css', $deps_el, $version );
		wp_register_style( 'sifency-shader-overlay-style', $elementor_url . 'css/bg/shader.css', $deps_el, $version );
		wp_register_style( 'sifency-light-beam-style', $elementor_url . 'css/bg/light-beam.css', $deps_el, $version );
		wp_register_style( 'sifency-distortion-style', $elementor_url . 'css/a-magnet/distortion.css', $deps_el, $version );

		wp_register_style( 'sifency-prism-line-vendor', $elementor_url . 'css/vendor/prism-line-numbers.min.css', $deps_el, $version );
		wp_register_style( 'sifency-prism-vendor', $elementor_url . 'css/vendor/prism-tomorrow.min.css', $deps_el, $version );

		/** -------------------------------
		 *  Global Frontend Styles
		 *--------------------------------*/
		wp_register_style( 'sifency-frontend-style', $base_url . 'css/frontend.css', array(), $version );
		wp_register_style( 'sifency-icon', $base_url . 'icons/css/fontello.css', array(), $version );

		/** -------------------------------
		 *  Animation Styles
		 *--------------------------------*/
		wp_register_style( 'sifency-aos-style', $elementor_url . 'css/vendor/aos.css', array(), $version );

		/** -------------------------------
		 *  Swiper Carousel
		 *--------------------------------*/
		wp_register_style( 'swiper', $elementor_url . 'css/vendor/swiper-min.css', array(), '8.4.5' );
	}

	/**
	 * Register Frontend Scripts
	 */
	public function register_frontend_scripts() {
		$base_url      = SIFENCY_ADDONS_URL . 'assets/';
		$elementor_url = SIFENCY_ADDONS_URL . 'includes/elementor/assets/';
		$version       = SIFENCY_ADDONS_VERSION;
		$deps_el       = array();
		$deps_jq       = array( 'jquery' );

		/** -------------------------------
		 *  Animation Scripts
		 *--------------------------------*/
		wp_register_script( 'sifency-aos-script', $elementor_url . 'js/vendor/aos.js', $deps_jq, $version, true );
		wp_register_script( 'sifency-anime-script', $elementor_url . 'js/vendor/anime.min.js', array(), $version, true );
		wp_register_script( 'sifency-barba-script', $elementor_url . 'js/vendor/barba.min.js', array(), $version, true );

		/** -------------------------------
		 *  Swiper Carousel
		 *--------------------------------*/
		wp_register_script( 'swiper', $elementor_url . 'js/vendor/swiper.min.js', array(), '8.4.5', true );

		/** -------------------------------
		 *  Elementor JS Handlers
		 *--------------------------------*/
		wp_register_script( 'sifency-typed-lib-script', $elementor_url . 'js/vendor/typed.min.js', array(), $version, true );
		wp_register_script( 'curtains-js', $elementor_url . 'js/vendor/curtains.js', array(), $version, true );
		wp_register_script( 'lenis', $elementor_url . 'js/vendor/lenis.js', array(), $version, true );
		wp_register_script( 'sifency-lenis', $elementor_url . 'js/library/sifency-lenis.js', array(), $version, true );
		wp_register_script( 'chart', $elementor_url . 'js/vendor/chart.js', array(), $version, true );
		wp_register_script( 'pdf', $elementor_url . 'js/vendor/pdf.min.js', array(), $version, true );
		wp_register_script( 'pdf-worker', $elementor_url . 'js/vendor/pdf.worker.min.js', array(), $version, true );
		wp_register_script( 'particles', $elementor_url . 'js/vendor/tsparticles.bundle.min.js', array(), $version, true );
		wp_register_script( 'prism-line-numbers', $elementor_url . 'js/vendor/prism-line-numbers.min.js', array(), $version, true );
		wp_register_script( 'prism', $elementor_url . 'js/vendor/prism.min.js', array(), $version, true );
		wp_register_script( 'matter', $elementor_url . 'js/vendor/matter.min.js', array(), $version, true );
		wp_register_script( 'three-js', $elementor_url . 'js/vendor/three.core.min.js', array(), $version, true );
		wp_add_inline_script( 'three-js', 'if(typeof THREE !== "undefined"){ window.THREE = THREE; }' );
		wp_register_script( 'hover-effect', $elementor_url . 'js/vendor/hover-effect.js', array( 'three-js' ), $version, true );
		wp_register_script( 'html2canvas', $elementor_url . 'js/vendor/html2canvas.js', array(), $version, true );
		wp_register_script( 'fontloader', $elementor_url . 'js/vendor/fontloader.js', array(), $version, true );
		wp_register_script( 'textgeometry', $elementor_url . 'js/vendor/textgeometry.js', array(), $version, true );

		wp_register_script( 'sifency-typeout-script', $elementor_url . 'js/typeout.js', $deps_el, $version, true );
		wp_register_script( 'sifency-carousel-handler', $elementor_url . 'js/component/carousel-handler.js', array( 'swiper' ), $version, true );
		wp_register_script( 'sifency-marquee-script', $elementor_url . 'js/component/marquee.js', $deps_el, $version, true );

		wp_register_script( 'sifency-counter-script', $elementor_url . 'js/component/sifency-counter.js', $deps_el, $version, true );
		wp_register_script( 'sifency-accordion-script', $elementor_url . 'js/component/accordion.js', $deps_el, $version, true );
		wp_register_script( 'sifency-progressbar-script', $elementor_url . 'js/component/progressbar.js', $deps_el, $version, true );
		wp_register_script( 'sifency-nav-script', $elementor_url . 'js/nav.js', $deps_el, $version, true );
		wp_register_script( 'sifency-nav-menu-script', $elementor_url . 'js/menu.js', $deps_el, $version, true );
		wp_register_script( 'sifency-digital-script', $elementor_url . 'js/cpt-loop/digital.js', $deps_el, $version, true );
		wp_register_script( 'sifency-video-script', $elementor_url . 'js/video.js', $deps_el, $version, true );
		wp_register_script( 'sifency-services-script', $elementor_url . 'js/loop/services.js', $deps_el, $version, true );
		wp_register_script( 'sifency-projects-script', $elementor_url . 'js/loop/projects.js', $deps_el, $version, true );
		wp_register_script( 'sifency-modal-script', $elementor_url . 'js/modal.js', $deps_el, $version, true );
		wp_register_script( 'sifency-popup-script', $elementor_url . 'js/popup.js', $deps_el, $version, true );
		wp_register_script( 'sifency-pricing-script', $elementor_url . 'js/pricing.js', $deps_el, $version, true );
		wp_register_script( 'sifency-pricing-calculator-script', $elementor_url . 'js/pricing-calculator.js', $deps_el, $version, true );
		wp_register_script( 'sifency-vertical-tab-script', $elementor_url . 'js/vertical-tab.js', $deps_el, $version, true );
		wp_register_script( 'sifency-horizontal-tab-script', $elementor_url . 'js/horizontal-tab.js', $deps_el, $version, true );
		wp_register_script( 'sifency-vertical-progressbar-script', $elementor_url . 'js/vertical-progressbar.js', $deps_el, $version, true );
		wp_register_script( 'sifency-doc-script', $elementor_url . 'js/cpt-loop/doc.js', $deps_el, $version, true );
		wp_register_script( 'sifency-before-after-script', $elementor_url . 'js/before-after.js', $deps_el, $version, true );
		wp_register_script( 'sifency-audio-player-script', $elementor_url . 'js/audio-player.js', $deps_el, $version, true );
		wp_register_script( 'sifency-message-box-script', $elementor_url . 'js/message-box.js', $deps_el, $version, true );
		wp_register_script( 'sifency-countdown-script', $elementor_url . 'js/countdown.js', $deps_el, $version, true );
		wp_register_script( 'sifency-news-ticker-script', $elementor_url . 'js/news-ticker.js', $deps_el, $version, true );
		wp_register_script( 'sifency-content-showcase-script', $elementor_url . 'js/content-showcase.js', $deps_el, $version, true );
		wp_register_script( 'sifency-interactive-link-script', $elementor_url . 'js/interactive-links.js', $deps_el, $version, true );
		wp_register_script( 'sifency-flip-box-script', $elementor_url . 'js/flip-box.js', $deps_el, $version, true );
		wp_register_script( 'sifency-scheme-script', $elementor_url . 'js/scheme.js', $deps_el, $version, true );
		wp_register_script( 'sifency-table-of-content-script', $elementor_url . 'js/table-of-content.js', $deps_el, $version, true );
		wp_register_script( 'sifency-image-accordion-script', $elementor_url . 'js/image-accordion.js', $deps_el, $version, true );
		wp_register_script( 'sifency-advanced-timeline-script', $elementor_url . 'js/advanced-timeline.js', $deps_el, $version, true );
		wp_register_script( 'sifency-timeline-script', $elementor_url . 'js/timeline.js', $deps_el, $version, true );
		wp_register_script( 'sifency-age-gate-script', $elementor_url . 'js/age-gate.js', $deps_el, $version, true );
		wp_register_script( 'sifency-login-script', $elementor_url . 'js/login.js', $deps_el, $version, true );
		wp_register_script( 'sifency-register-script', $elementor_url . 'js/register.js', $deps_el, $version, true );
		wp_register_script( 'sifency-smooth-scroll-script', $elementor_url . 'js/smooth-scroll.js', $deps_el, $version, true );
		wp_register_script( 'sifency-preloader-script', $elementor_url . 'js/preloader.js', $deps_el, $version, true );
		wp_register_script( 'sifency-device-frame-slider-script', $elementor_url . 'js/device-frame-slider.js', $deps_el, $version, true );
		wp_register_script( 'sifency-device-frame-carousel-script', $elementor_url . 'js/device-frame-carousel.js', $deps_el, $version, true );
		wp_register_script( 'sifency-radial-progressbar-script', $elementor_url . 'js/radial-progressbar.js', $deps_el, $version, true );
		wp_register_script( 'sifency-chart-script', $elementor_url . 'js/data/chart.js', $deps_el, $version, true );
		wp_register_script( 'sifency-toggle-script', $elementor_url . 'js/toggle.js', $deps_el, $version, true );
		wp_register_script( 'sifency-hotspot-script', $elementor_url . 'js/hotspot.js', $deps_el, $version, true );
		wp_register_script( 'sifency-project-carousel-script', $elementor_url . 'js/project-carousel.js', $deps_el, $version, true );
		wp_register_script( 'sifency-seo-script', $elementor_url . 'js/seo.js', $deps_el, $version, true );
		wp_register_script( 'sifency-sticky-sections-script', $elementor_url . 'js/sticky-section.js', $deps_el, $version, true );
		wp_register_script( 'sifency-checkout-script', $elementor_url . 'js/woo/checkout.js', $deps_el, $version, true );
		wp_register_script( 'sifency-awards-script', $elementor_url . 'js/awards.js', $deps_el, $version, true );
		wp_register_script( 'sifency-pdf-script', $elementor_url . 'js/pdf.js', $deps_el, $version, true );
		wp_register_script( 'sifency-print-script', $elementor_url . 'js/print.js', $deps_el, $version, true );
		wp_register_script( 'sifency-particles-script', $elementor_url . 'js/particles.js', $deps_el, $version, true );
		wp_register_script( 'sifency-on-scroll-bg-script', $elementor_url . 'js/on-scroll-bg.js', $deps_el, $version, true );
		wp_register_script( 'sifency-code-snippets-script', $elementor_url . 'js/code-snippets.js', $deps_el, $version, true );
		wp_register_script( 'sifency-one-page-nav-script', $elementor_url . 'js/one-page-nav.js', $deps_el, $version, true );
		wp_register_script( 'sifency-horizontal-scroll-script', $elementor_url . 'js/horizontal-scroll.js', $deps_el, $version, true );
		wp_register_script( 'sifency-custom-cursor-script', $elementor_url . 'js/cursor.js', $deps_el, $version, true );
		wp_register_script( 'sifency-unfold-script', $elementor_url . 'js/unfold.js', $deps_el, $version, true );
		wp_register_script( 'sifency-dark-mode-script', $elementor_url . 'js/dark-mode.js', $deps_el, $version, true );
		wp_register_script( 'sifency-protected-content-script', $elementor_url . 'js/protected-content.js', $deps_el, $version, true );
		wp_register_script( 'sifency-parallax-script', $elementor_url . 'js/creative/parallax-media.js', $deps_el, $version, true );
		wp_register_script( 'sifency-marquee-scroll-direction-script', $elementor_url . 'js/creative/marquee-scroll-direction.js', $deps_el, $version, true );
		wp_register_script( 'sifency-text-reveal-script', $elementor_url . 'js/creative/text-reveal.js', $deps_el, $version, true );
		wp_register_script( 'sifency-stacking-card-script', $elementor_url . 'js/creative/stacking-card.js', $deps_el, $version, true );
		wp_register_script( 'sifency-scrubbing-script', $elementor_url . 'js/creative/image-seq.js', $deps_el, $version, true );
		wp_register_script( 'sifency-velocity-script', $elementor_url . 'js/creative/skew.js', $deps_el, $version, true );
		wp_register_script( 'sifency-scroll-progress-script', $elementor_url . 'js/creative/scroll-progress.js', $deps_el, $version, true );
		wp_register_script( 'sifency-trail-script', $elementor_url . 'js/master/trail.js', $deps_el, $version, true );
		wp_register_script( 'sifency-draggable-script', $elementor_url . 'js/master/dragable.js', $deps_el, $version, true );
		wp_register_script( 'sifency-3d-carousel-script', $elementor_url . 'js/master/3d-carousel.js', $deps_el, $version, true );
		wp_register_script( 'sifency-text-cycle-script', $elementor_url . 'js/master/text-cycle.js', $deps_el, $version, true );
		wp_register_script( 'sifency-master-accordion-script', $elementor_url . 'js/master/accordion.js', $deps_el, $version, true );
		wp_register_script( 'sifency-clock-script', $elementor_url . 'js/master/clock.js', $deps_el, $version, true );
		wp_register_script( 'sifency-copy-script', $elementor_url . 'js/master/copy.js', $deps_el, $version, true );
		wp_register_script( 'sifency-magnetic-script', $elementor_url . 'js/master/magnetic.js', $deps_el, $version, true );
		wp_register_script( 'sifency-rolling-text-script', $elementor_url . 'js/master/rolling-text.js', $deps_el, $version, true );
		wp_register_script( 'sifency-reveal-sections-script', $elementor_url . 'js/master/section-reveal.js', $deps_el, $version, true );
		wp_register_script( 'sifency-liquid-script', $elementor_url . 'js/master/curtains-init.js', $deps_el, $version, true );
		wp_register_script( 'sifency-orbit-image-script', $elementor_url . 'js/master/orbit-image.js', $deps_el, $version, true );
		wp_register_script( 'sifency-physics-script', $elementor_url . 'js/master/physics.js', $deps_el, $version, true );
		wp_register_script( 'sifency-video-avatar-script', $elementor_url . 'js/business/video-avatar.js', $deps_el, $version, true );
		wp_register_script( 'sifency-creative-script', $elementor_url . 'js/creative/creative.js', $deps_el, $version, true );
		wp_register_script( 'sifency-reels-script', $elementor_url . 'js/master/reels.js', $deps_el, $version, true );
		wp_register_script( 'sifency-stagger-text-script', $elementor_url . 'js/creative/stagger-text.js', $deps_el, $version, true );
		wp_register_script( 'sifency-image-fx-handler-script', $elementor_url . 'js/creative/image-fx.js', $deps_el, $version, true );
		wp_register_script( 'sifency-interactive-typo-script', $elementor_url . 'js/master/interactive-typo.js', $deps_el, $version, true );
		wp_register_script( 'sifency-3d-letter-script', $elementor_url . 'js/master/sifency-3d-letter.js', $deps_el, $version, true );
		wp_register_script( 'sifency-button-script', $elementor_url . 'js/creative/button.js', $deps_el, $version, true );
		wp_register_script( 'sifency-reveal-showcase-script', $elementor_url . 'js/creative/reveal-showcase.js', $deps_el, $version, true );
		wp_register_script( 'sifency-3d-arc-carousel-script', $elementor_url . 'js/creative/3d-arc-carousel.js', array( 'swiper', 'gsap', 'gsap-scrolltrigger' ), $version, true );
		wp_register_script( 'sifency-multi-scroll-script', $elementor_url . 'js/creative/multi-scroll.js', $deps_el, $version, true );
		wp_register_script( 'sifency-stack-showcase-script', $elementor_url . 'js/creative/stack-showcase.js', $deps_el, $version, true );
		wp_register_script( 'sifency-reveal-frame-script', $elementor_url . 'js/a-magnet/reveal-frame.js', $deps_el, $version, true );
		wp_register_script( 'sifency-shader-overlay-script', $elementor_url . 'js/bg/shader.js', $deps_el, $version, true );
		wp_register_script( 'sifency-light-beam-script', $elementor_url . 'js/bg/light-beam.js', $deps_el, $version, true );
		wp_register_script( 'sifency-distortion-script', $elementor_url . 'js/a-magnet/distortion.js', $deps_el, $version, true );

		/** -------------------------------
		 *  Main Frontend Script
		 *--------------------------------*/
		wp_register_script( 'sifency-frontend-script', $base_url . 'js/frontend.js', $deps_jq, $version, true );
	}

	public function enqueue_admin_assets() {
		wp_enqueue_media();
		wp_enqueue_style( 'sifency-addons-topbar-style', SIFENCY_ADDONS_URL . 'assets/css/admin/topbar.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_style( 'sifency-addons-admin-style', SIFENCY_ADDONS_URL . 'assets/css/admin/admin.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_style( 'sifency-addons-admin-component', SIFENCY_ADDONS_URL . 'assets/css/admin/component.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_style( 'sifency-addons-features-style', SIFENCY_ADDONS_URL . 'assets/css/admin/features.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_style( 'sifency-addons-custom-cpt-style', SIFENCY_ADDONS_URL . 'theme-builder/assets/css/admin-cpt.css', array(), SIFENCY_ADDONS_VERSION );

		wp_enqueue_script( 'sifency-addon-admin-script', SIFENCY_ADDONS_URL . 'assets/js/admin/admin.js', array( 'jquery' ), SIFENCY_ADDONS_VERSION, true );
		wp_enqueue_script( 'sifency-addon-cpt-script', SIFENCY_ADDONS_URL . 'theme-builder/assets/js/admin-cpt.js', array( 'jquery' ), SIFENCY_ADDONS_VERSION, true );
		wp_enqueue_script( 'sifency-installer-js', SIFENCY_ADDONS_URL . 'assets/js/admin/sifency-installer.js', array( 'jquery' ), SIFENCY_ADDONS_VERSION, true );
		wp_enqueue_script( 'sifency-admin-options-js', SIFENCY_ADDONS_URL . 'assets/js/admin/sifency-admin-options.js', array( 'jquery' ), SIFENCY_ADDONS_VERSION, true );
		wp_enqueue_script( 'sifency-themebuilder-summary', SIFENCY_ADDONS_URL . 'assets/js/admin/themebuilder-summary.js', array(), SIFENCY_ADDONS_VERSION, true );

		wp_localize_script(
			'sifency-addon-cpt-script',
			'sifencyData',
			array(
				'ajax_url' => admin_url( 'admin-ajax.php' ),
				'nonce'    => wp_create_nonce( 'sifency_thumb_nonce' ),
			)
		);

		wp_localize_script(
			'sifency-installer-js',
			'sifencyInstaller',
			array(
				'ajax_url' => admin_url( 'admin-ajax.php' ),
				'nonce'    => wp_create_nonce( 'sifency_install_nonce' ),
				'texts'    => array(
					'installing' => __( 'Installing...', 'sifency-addons' ),
					'activating' => __( 'Activating...', 'sifency-addons' ),
					'activated'  => __( 'Activated', 'sifency-addons' ),
					'error'      => __( 'An error occurred. Please try again.', 'sifency-addons' ),
				),
			)
		);

		wp_localize_script(
			'sifency-admin-options-js',
			'sifencyAdminParams',
			array(
				'ajax_url' => admin_url( 'admin-ajax.php' ),
				'nonce'    => wp_create_nonce( 'sifency_admin_options_nonce' ),
				'texts'    => array(
					'saving'           => __( 'Saving...', 'sifency-addons' ),
					'saved'            => __( 'Saved!', 'sifency-addons' ),
					'enabled'          => __( 'Enabled', 'sifency-addons' ),
					'disabled'         => __( 'Disabled', 'sifency-addons' ),
					'resetting'        => __( 'Resetting modules...', 'sifency-addons' ),
					'confirm_reset'    => __( 'Are you sure you want to reset all CPT modules to default?', 'sifency-addons' ),
					'reset_success'    => __( 'Modules reset! Reloading...', 'sifency-addons' ),
					'confirm_rollback' => __( 'Are you sure you want to rollback to version', 'sifency-addons' ),
					'rolling_back'     => __( 'Rolling back...', 'sifency-addons' ),
					'rollback_success' => __( 'Rollback successful! Reloading...', 'sifency-addons' ),
					'rollback_failed'  => __( 'Rollback failed:', 'sifency-addons' ),
					'rollback_btn'     => __( 'Rollback', 'sifency-addons' ),
					'server_error'     => __( 'An error occurred.', 'sifency-addons' ),
				),
			)
		);
	}

	public function enqueue_editor_assets() {
		wp_enqueue_style( 'sifency-editor-style', SIFENCY_ADDONS_URL . 'assets/css/editor/editor.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_style( 'sifency-editor-icons', SIFENCY_ADDONS_URL . 'assets/icons/css/fontello.css', array(), SIFENCY_ADDONS_VERSION );
		wp_enqueue_script( 'sifency-editor', SIFENCY_ADDONS_URL . 'assets/js/editor/editor.js', array( 'jquery', 'elementor-editor' ), SIFENCY_ADDONS_VERSION, true );
	}
}
