<?php

// Prevent Direct Access
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

new \Kirki\Panel( 'contact_panel', array(
	'title'       => esc_html__('Contact Us', 'maxo-fa'),
	'priority'       => 21,
) );

////// Contact Info

new \Kirki\Section( 'contact_info_section', array(
	'title'          => esc_html__('Contact Info and Form', 'maxo-fa'),
	'panel'          => 'contact_panel',
) );

// Title
new \Kirki\Field\Text( array(
	'settings' => 'contact_title',
	'label'    => esc_html__('Title', 'maxo-fa'),
	'section'  => 'contact_info_section',
) );

// Display Info
new \Kirki\Field\Toggle( array(
	'settings' => 'contact_info_display',
	'label'    => esc_html__('Show Contact Info?', 'maxo-fa'),
	'section'  => 'contact_info_section',
	'default'  => true,
) );

// Display Form
new \Kirki\Field\Toggle( array(
	'settings' => 'contact_form_display',
	'label'    => esc_html__('Show Contact Form?', 'maxo-fa'),
	'section'  => 'contact_info_section',
	'default'  => true,
) );

// Phone
new \Kirki\Field\Textarea( array(
	'settings' => 'contact_info_phone',
	'label'    => esc_html__('Phone', 'maxo-fa'),
	'section'  => 'contact_info_section',
) );

// Email
new \Kirki\Field\Textarea( array(
	'settings' => 'contact_info_email',
	'label'    => esc_html__('Email', 'maxo-fa'),
	'section'  => 'contact_info_section',
) );

// Address
new \Kirki\Field\Textarea( array(
	'settings' => 'contact_info_address',
	'label'    => esc_html__('Address', 'maxo-fa'),
	'section'  => 'contact_info_section',
) );

// Form ID
new \Kirki\Field\Text( array(
	'settings' => 'contact_form_id',
	'label'    => esc_html__('Contact Form ID', 'maxo-fa'),
	'section'  => 'contact_info_section',
) );

////// Contact Map

new \Kirki\Section( 'contact_map_section', array(
	'title'          => esc_html__('Map', 'maxo-fa'),
	'panel'          => 'contact_panel',
) );

// Display
new \Kirki\Field\Toggle( array(
	'settings' => 'contact_map_display',
	'label'    => esc_html__('Show Map?', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => true,
) );

// API Usage Description
new \Kirki\Field\Custom( array(
	'settings'    => 'contact_map_api_description',
	'label'       => esc_html__('Google Maps API Settings', 'maxo-fa'),
	'section'     => 'contact_map_section',
	'default'     => '',
) );

// API Key
new \Kirki\Field\Text( array(
	'settings' => 'contact_map_api',
	'label'    => esc_html__('API Key', 'maxo-fa'),
	/* translators: %s is the guide link. */
	'description'    => sprintf( esc_html__('You can read the guide to getting an API key in %s.', 'maxo-fa') , '<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">'.esc_html__('this link', 'maxo-fa').'</a>' ),
	'section'  => 'contact_map_section',
) );

// Latitude
new \Kirki\Field\Text( array(
	'settings' => 'contact_map_latitude',
	'label'    => esc_html__('Latitude', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => '0',
) );

// Longitude
new \Kirki\Field\Text( array(
	'settings' => 'contact_map_longitude',
	'label'    => esc_html__('Longitude', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => '0',
) );

// Zoom
new \Kirki\Field\Number( array(
	'settings' => 'contact_map_zoom',
	'label'    => esc_html__('Initial Zoom', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => '14',
) );

// Marker Title
new \Kirki\Field\Text( array(
	'settings' => 'contact_map_marker_title',
	'label'    => esc_html__('Location Marker Title', 'maxo-fa'),
	'description'    => esc_html__('It will be displayed when hovering mouse on the marker.', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => '',
) );

// Iframe Divider
new \Kirki\Field\Custom( array(
	'settings'    => 'contact_map_iframe_divider',
	'section'     => 'contact_map_section',
	'default'     => '<hr>',
) );

// Iframe Usage Description
new \Kirki\Field\Custom( array(
	'settings'    => 'contact_map_iframe_description',
	'label'       => esc_html__('Using iframe Instead Of Google Maps API', 'maxo-fa'),
	'description' => esc_html__('To use iframe instead of google maps API, enter your iframe code in the box below.', 'maxo-fa'),
	'section'     => 'contact_map_section',
	'default'     => '',
) );

// Iframe Code
new \Kirki\Field\Code( array(
	'settings' => 'contact_map_iframe',
	'label'    => esc_html__('iframe Code', 'maxo-fa'),
	'section'  => 'contact_map_section',
	'default'  => '',
	'choices'     => array(
		'language' => 'html',
	),
) );
