<?php
$elementor_post_types = get_option('elementor_cpt_support', []);

$data = [
    'ajax_url'                    => admin_url( 'admin-ajax.php' ),
    'site_url'                    => site_url(),
    'admin_url'                   => admin_url(),
    'admin_email'                 => get_option( 'admin_email' ),
    'assets_url'                  => \Wpeventin::plugin_url("assets"),
    'evnetin_pro_active'          => ( class_exists( 'Wpeventin_Pro' ) ) ? true : false,
    'locale_name'                 => strtolower( str_replace( '_', '-', get_locale() ) ),
    'start_of_week'               => get_option( 'start_of_week' ),
    'author_id'                   => get_current_user_id(),
    'ticket_scanner_link'         => admin_url( '/edit.php?post_type=etn-attendee' ),
    'post_id'                     => get_the_ID(),
    'zoom_connection_check_nonce' => wp_create_nonce( 'zoom_connection_check_nonce' ),
    'ticket_status_nonce'         => wp_create_nonce( 'ticket_status_nonce_value' ),
    'zoom_module'                 => etn_get_option( 'etn_zoom_api' ) ? 'no' : 'yes',
    'attendee_module'             => etn_get_option( 'attendee_registration' ) ? 'no' : 'yes',
    'currency_list'               => etn_get_currency(),
    'date_format'                 => get_option( 'date_format' ),
    'date_format_string'          => date_i18n( get_option( 'date_format' ) ),
    'time_format'                 => get_option( 'time_format' ),
    'time_format_string'          => date_i18n( get_option( 'time_format' ) ),
    'timezone_list'               => etn_get_wp_timezones(),
    'version'                     => \Wpeventin::version(),
    'payment_option_woo'          => etn_get_option( 'sell_tickets' ),
    'payment_option_stripe'       => etn_get_option( 'etn_sells_engine_stripe' ),
    'payment_option_paypal'       => etn_get_option( 'paypal_status' ),
    'payment_option_surecart'     => etn_get_option( 'surecart_status' ),
    'currency_symbol'             => etn_currency_symbol(),
    'nonce'                       => wp_create_nonce('wp_rest'),
    'timetics_pro_active'         => class_exists( 'TimeticsPro' ) ? true : false ,
    'etn_purchase_login_required' => etn_get_option( 'etn_purchase_login_required' ),
    'etn_hide_seats_from_details' => etn_get_option( 'etn_hide_seats_from_details' ),
    'etn_primary_color'           => etn_get_option( 'etn_primary_color' ),
    'etn_secondary_color'         => etn_get_option( 'etn_secondary_color' ),
    'decimal_separator'           => etn_get_decimal_separator(),
    'thousand_separator'          => etn_get_thousand_separator(),
    'decimals'                    => etn_get_decimals(),
    'price_format'                => etn_get_price_format(),
    'currency_position'           => etn_get_currency_position(),
    'elementor_supported'         => class_exists( '\Elementor\Plugin' ) && in_array( 'etn-template', $elementor_post_types ),
    'selected_template_builder'   => etn_get_selected_template_builder(),
    'is_dokan_enabled'            => ( \Etn\Core\Addons\Helper::instance()->check_active_module( 'dokan' ) ) ? true : false,
];

return apply_filters( 'etn_locale_vars', $data );