<?php
/**
 * WPBakery Page Builder Integration
 *
 * Registers all ID Shortcodes elements for WPBakery Page Builder.
 *
 * @package ID_Shortcodes
 * @license GPL-2.0-or-later
 */

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

class IDSC_WPBakery {

    public function __construct() {
        if ( function_exists( 'vc_map' ) ) {
            add_action( 'vc_before_init', array( $this, 'register_elements' ) );
        }
    }

    public function register_elements() {
        $this->register_alert();
        $this->register_testimonial();
        $this->register_card();
        $this->register_progress();
        $this->register_icon_list();
        $this->register_social_links();
        $this->register_accordion();
        $this->register_gallery();
        $this->register_tabs();
        $this->register_counter();
        $this->register_toc();
        $this->register_map();
    }

    private function register_alert() {
        vc_map( array(
            'name'        => __( 'Alert / Notice', 'idsc' ),
            'base'        => 'idsc_alert',
            'description' => __( 'Styled alert or notice box', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-warning',
            'params'      => array(
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Type', 'idsc' ),
                    'param_name'  => 'type',
                    'value'       => array(
                        __( 'Info', 'idsc' )    => 'info',
                        __( 'Success', 'idsc' ) => 'success',
                        __( 'Warning', 'idsc' ) => 'warning',
                        __( 'Error', 'idsc' )   => 'error',
                    ),
                    'std'         => 'info',
                    'description' => __( 'Alert style.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Title', 'idsc' ),
                    'param_name'  => 'title',
                    'description' => __( 'Optional alert title.', 'idsc' ),
                ),
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Message', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Alert message content.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Dismissible', 'idsc' ),
                    'param_name'  => 'dismissible',
                    'value'       => array(
                        __( 'No', 'idsc' )  => 'no',
                        __( 'Yes', 'idsc' ) => 'yes',
                    ),
                    'std'         => 'no',
                    'description' => __( 'Allow users to dismiss the alert.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Show Icon', 'idsc' ),
                    'param_name'  => 'icon',
                    'value'       => array(
                        __( 'Yes', 'idsc' ) => 'yes',
                        __( 'No', 'idsc' )  => 'no',
                    ),
                    'std'         => 'yes',
                    'description' => __( 'Display an icon in the alert.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_testimonial() {
        vc_map( array(
            'name'        => __( 'Testimonial', 'idsc' ),
            'base'        => 'idsc_testimonial',
            'description' => __( 'Customer testimonial with optional rating', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-format-quote',
            'params'      => array(
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Quote', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'The testimonial text.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Author', 'idsc' ),
                    'param_name'  => 'author',
                    'description' => __( 'Name of the person.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Role / Title', 'idsc' ),
                    'param_name'  => 'role',
                    'description' => __( 'Job title or role.', 'idsc' ),
                ),
                array(
                    'type'        => 'attach_image',
                    'heading'     => __( 'Author Photo', 'idsc' ),
                    'param_name'  => 'photo',
                    'description' => __( 'Photo of the author.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Star Rating', 'idsc' ),
                    'param_name'  => 'rating',
                    'value'       => array(
                        __( 'None', 'idsc' )    => '0',
                        __( '1 Star', 'idsc' )  => '1',
                        __( '2 Stars', 'idsc' ) => '2',
                        __( '3 Stars', 'idsc' ) => '3',
                        __( '4 Stars', 'idsc' ) => '4',
                        __( '5 Stars', 'idsc' ) => '5',
                    ),
                    'std'         => '0',
                    'description' => __( 'Star rating to display.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Layout', 'idsc' ),
                    'param_name'  => 'layout',
                    'value'       => array(
                        __( 'Standard', 'idsc' ) => 'standard',
                        __( 'Card', 'idsc' )     => 'card',
                        __( 'Centered', 'idsc' ) => 'centered',
                    ),
                    'std'         => 'standard',
                    'description' => __( 'Testimonial layout style.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_card() {
        vc_map( array(
            'name'        => __( 'Card', 'idsc' ),
            'base'        => 'idsc_card',
            'description' => __( 'Content card with image and button', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-id-alt',
            'params'      => array(
                array(
                    'type'        => 'attach_image',
                    'heading'     => __( 'Image', 'idsc' ),
                    'param_name'  => 'image',
                    'description' => __( 'Card image.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Title', 'idsc' ),
                    'param_name'  => 'title',
                    'description' => __( 'Card title.', 'idsc' ),
                ),
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Content', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Card body text.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Button Text', 'idsc' ),
                    'param_name'  => 'button_text',
                    'description' => __( 'Text for the card button.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Button URL', 'idsc' ),
                    'param_name'  => 'button_url',
                    'description' => __( 'URL for the card button.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Image Position', 'idsc' ),
                    'param_name'  => 'image_pos',
                    'value'       => array(
                        __( 'Top', 'idsc' )   => 'top',
                        __( 'Left', 'idsc' )  => 'left',
                        __( 'Right', 'idsc' ) => 'right',
                    ),
                    'std'         => 'top',
                    'description' => __( 'Position of the image relative to content.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_progress() {
        vc_map( array(
            'name'        => __( 'Progress Bar', 'idsc' ),
            'base'        => 'idsc_progress',
            'description' => __( 'Animated progress bar', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-chart-bar',
            'params'      => array(
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Value (%)', 'idsc' ),
                    'param_name'  => 'value',
                    'value'       => '75',
                    'description' => __( 'Progress percentage (0-100).', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Label', 'idsc' ),
                    'param_name'  => 'label',
                    'description' => __( 'Text label above the bar.', 'idsc' ),
                ),
                array(
                    'type'        => 'colorpicker',
                    'heading'     => __( 'Bar Color', 'idsc' ),
                    'param_name'  => 'color',
                    'value'       => '#3b82f6',
                    'description' => __( 'Color of the progress bar fill.', 'idsc' ),
                ),
                array(
                    'type'        => 'colorpicker',
                    'heading'     => __( 'Background Color', 'idsc' ),
                    'param_name'  => 'bg_color',
                    'value'       => '#e5e7eb',
                    'description' => __( 'Color of the bar background.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Height (px)', 'idsc' ),
                    'param_name'  => 'height',
                    'value'       => '20',
                    'description' => __( 'Bar height in pixels.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Show Percentage', 'idsc' ),
                    'param_name'  => 'show_pct',
                    'value'       => array(
                        __( 'Yes', 'idsc' ) => 'yes',
                        __( 'No', 'idsc' )  => 'no',
                    ),
                    'std'         => 'yes',
                    'description' => __( 'Display the percentage text.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Animated', 'idsc' ),
                    'param_name'  => 'animated',
                    'value'       => array(
                        __( 'No', 'idsc' )  => 'no',
                        __( 'Yes', 'idsc' ) => 'yes',
                    ),
                    'std'         => 'no',
                    'description' => __( 'Animate the bar fill on scroll.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_icon_list() {
        vc_map( array(
            'name'        => __( 'Icon List', 'idsc' ),
            'base'        => 'idsc_icon_list',
            'description' => __( 'List with custom icons', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-list-view',
            'params'      => array(
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'List Items', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Use [idsc_icon_list_item] shortcodes inside, or enter plain text (one item per line).', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Default Icon', 'idsc' ),
                    'param_name'  => 'icon',
                    'value'       => array(
                        __( 'Check', 'idsc' )       => 'check',
                        __( 'X', 'idsc' )           => 'x',
                        __( 'Arrow Right', 'idsc' ) => 'arrow-right',
                        __( 'Star', 'idsc' )        => 'star',
                        __( 'Heart', 'idsc' )       => 'heart',
                        __( 'Info', 'idsc' )        => 'info',
                        __( 'Plus', 'idsc' )        => 'plus',
                    ),
                    'std'         => 'check',
                    'description' => __( 'Default icon for list items.', 'idsc' ),
                ),
                array(
                    'type'        => 'colorpicker',
                    'heading'     => __( 'Icon Color', 'idsc' ),
                    'param_name'  => 'icon_color',
                    'value'       => '#22c55e',
                    'description' => __( 'Color of the list icons.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Icon Size', 'idsc' ),
                    'param_name'  => 'icon_size',
                    'value'       => array(
                        __( 'Small', 'idsc' )  => 'small',
                        __( 'Medium', 'idsc' ) => 'medium',
                        __( 'Large', 'idsc' )  => 'large',
                    ),
                    'std'         => 'medium',
                    'description' => __( 'Size of the list icons.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_social_links() {
        vc_map( array(
            'name'        => __( 'Social Links', 'idsc' ),
            'base'        => 'idsc_social_links',
            'description' => __( 'Social media icon links', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-share',
            'params'      => array(
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Social Links', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Use [idsc_social_link] shortcodes inside, or enter platform|url per line.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Style', 'idsc' ),
                    'param_name'  => 'style',
                    'value'       => array(
                        __( 'Filled', 'idsc' )  => 'filled',
                        __( 'Outline', 'idsc' ) => 'outline',
                        __( 'Plain', 'idsc' )   => 'plain',
                    ),
                    'std'         => 'filled',
                    'description' => __( 'Icon button style.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Size', 'idsc' ),
                    'param_name'  => 'size',
                    'value'       => array(
                        __( 'Small', 'idsc' )  => 'small',
                        __( 'Medium', 'idsc' ) => 'medium',
                        __( 'Large', 'idsc' )  => 'large',
                    ),
                    'std'         => 'medium',
                    'description' => __( 'Icon size.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Shape', 'idsc' ),
                    'param_name'  => 'shape',
                    'value'       => array(
                        __( 'Square', 'idsc' )  => 'square',
                        __( 'Rounded', 'idsc' ) => 'rounded',
                        __( 'Circle', 'idsc' )  => 'circle',
                    ),
                    'std'         => 'rounded',
                    'description' => __( 'Icon shape.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Color Mode', 'idsc' ),
                    'param_name'  => 'color_mode',
                    'value'       => array(
                        __( 'Brand Colors', 'idsc' ) => 'brand',
                        __( 'Custom Color', 'idsc' ) => 'custom',
                    ),
                    'std'         => 'brand',
                    'description' => __( 'Use brand colors or a single custom color.', 'idsc' ),
                ),
                array(
                    'type'        => 'colorpicker',
                    'heading'     => __( 'Custom Color', 'idsc' ),
                    'param_name'  => 'custom_color',
                    'value'       => '#333333',
                    'description' => __( 'Used when Color Mode is set to Custom.', 'idsc' ),
                    'dependency'  => array( 'element' => 'color_mode', 'value' => 'custom' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Alignment', 'idsc' ),
                    'param_name'  => 'alignment',
                    'value'       => array(
                        __( 'Left', 'idsc' )   => 'left',
                        __( 'Center', 'idsc' ) => 'center',
                        __( 'Right', 'idsc' )  => 'right',
                    ),
                    'std'         => 'center',
                    'description' => __( 'Horizontal alignment.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_accordion() {
        vc_map( array(
            'name'        => __( 'Accordion', 'idsc' ),
            'base'        => 'idsc_accordion',
            'description' => __( 'Expandable accordion sections', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-list-view',
            'params'      => array(
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Accordion Items', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Use [idsc_accordion_item title="..."] shortcodes inside.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Open First Item', 'idsc' ),
                    'param_name'  => 'open_first',
                    'value'       => array(
                        __( 'No', 'idsc' )  => 'no',
                        __( 'Yes', 'idsc' ) => 'yes',
                    ),
                    'std'         => 'no',
                    'description' => __( 'Expand the first item by default.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Icon Style', 'idsc' ),
                    'param_name'  => 'icon',
                    'value'       => array(
                        __( 'Chevron', 'idsc' )    => 'chevron',
                        __( 'Plus/Minus', 'idsc' ) => 'plus-minus',
                        __( 'None', 'idsc' )       => 'none',
                    ),
                    'std'         => 'chevron',
                    'description' => __( 'Toggle icon style.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Border Style', 'idsc' ),
                    'param_name'  => 'border',
                    'value'       => array(
                        __( 'Bordered', 'idsc' )  => 'bordered',
                        __( 'Separated', 'idsc' ) => 'separated',
                        __( 'None', 'idsc' )      => 'none',
                    ),
                    'std'         => 'bordered',
                    'description' => __( 'Border style between items.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_gallery() {
        vc_map( array(
            'name'        => __( 'Gallery', 'idsc' ),
            'base'        => 'idsc_gallery',
            'description' => __( 'Image gallery grid', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-format-gallery',
            'params'      => array(
                array(
                    'type'        => 'attach_images',
                    'heading'     => __( 'Images', 'idsc' ),
                    'param_name'  => 'ids',
                    'description' => __( 'Select gallery images.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Columns', 'idsc' ),
                    'param_name'  => 'columns',
                    'value'       => array(
                        __( '1 Column', 'idsc' )  => '1',
                        __( '2 Columns', 'idsc' ) => '2',
                        __( '3 Columns', 'idsc' ) => '3',
                        __( '4 Columns', 'idsc' ) => '4',
                        __( '5 Columns', 'idsc' ) => '5',
                        __( '6 Columns', 'idsc' ) => '6',
                    ),
                    'std'         => '3',
                    'description' => __( 'Number of columns.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Gap (px)', 'idsc' ),
                    'param_name'  => 'gap',
                    'value'       => '10',
                    'description' => __( 'Space between images in pixels.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Aspect Ratio', 'idsc' ),
                    'param_name'  => 'aspect_ratio',
                    'value'       => array(
                        __( 'Original', 'idsc' ) => 'original',
                        __( 'Square', 'idsc' )   => 'square',
                        __( '4:3', 'idsc' )      => '4:3',
                        __( '16:9', 'idsc' )     => '16:9',
                    ),
                    'std'         => 'original',
                    'description' => __( 'Image aspect ratio.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Border Radius (px)', 'idsc' ),
                    'param_name'  => 'border_radius',
                    'value'       => '0',
                    'description' => __( 'Rounded corners in pixels.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Link To', 'idsc' ),
                    'param_name'  => 'link_to',
                    'value'       => array(
                        __( 'None', 'idsc' )            => 'none',
                        __( 'Media File', 'idsc' )      => 'media',
                        __( 'Attachment Page', 'idsc' )  => 'attachment',
                    ),
                    'std'         => 'none',
                    'description' => __( 'What images should link to.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Show Captions', 'idsc' ),
                    'param_name'  => 'captions',
                    'value'       => array(
                        __( 'No', 'idsc' )  => 'no',
                        __( 'Yes', 'idsc' ) => 'yes',
                    ),
                    'std'         => 'no',
                    'description' => __( 'Display image captions.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_tabs() {
        vc_map( array(
            'name'        => __( 'Tabs', 'idsc' ),
            'base'        => 'idsc_tabs',
            'description' => __( 'Tabbed content sections', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-table-row-after',
            'params'      => array(
                array(
                    'type'        => 'textarea',
                    'heading'     => __( 'Tab Content', 'idsc' ),
                    'param_name'  => 'content',
                    'description' => __( 'Use [idsc_tab title="..."] shortcodes inside.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Layout', 'idsc' ),
                    'param_name'  => 'layout',
                    'value'       => array(
                        __( 'Horizontal', 'idsc' ) => 'horizontal',
                        __( 'Vertical', 'idsc' )   => 'vertical',
                    ),
                    'std'         => 'horizontal',
                    'description' => __( 'Tab navigation layout.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Tab Alignment', 'idsc' ),
                    'param_name'  => 'alignment',
                    'value'       => array(
                        __( 'Left', 'idsc' )   => 'left',
                        __( 'Center', 'idsc' ) => 'center',
                        __( 'Right', 'idsc' )  => 'right',
                    ),
                    'std'         => 'left',
                    'description' => __( 'Alignment of tab buttons.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Default Active Tab', 'idsc' ),
                    'param_name'  => 'active',
                    'value'       => '1',
                    'description' => __( 'Tab number to open by default (starting from 1).', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_counter() {
        vc_map( array(
            'name'        => __( 'Counter', 'idsc' ),
            'base'        => 'idsc_counter',
            'description' => __( 'Animated number counter', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-performance',
            'params'      => array(
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Target Number', 'idsc' ),
                    'param_name'  => 'number',
                    'value'       => '100',
                    'description' => __( 'The number to count up to.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Prefix', 'idsc' ),
                    'param_name'  => 'prefix',
                    'description' => __( 'Text before the number (e.g. $).', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Suffix', 'idsc' ),
                    'param_name'  => 'suffix',
                    'description' => __( 'Text after the number (e.g. + or %).', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Label', 'idsc' ),
                    'param_name'  => 'label',
                    'description' => __( 'Description below the number.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Duration (ms)', 'idsc' ),
                    'param_name'  => 'duration',
                    'value'       => '2000',
                    'description' => __( 'Animation duration in milliseconds.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_toc() {
        vc_map( array(
            'name'        => __( 'Table of Contents', 'idsc' ),
            'base'        => 'idsc_toc',
            'description' => __( 'Auto-generated table of contents', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-editor-ol',
            'params'      => array(
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Heading Levels', 'idsc' ),
                    'param_name'  => 'levels',
                    'value'       => 'h2,h3',
                    'description' => __( 'Comma-separated heading levels to include (e.g. h2,h3,h4).', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Title', 'idsc' ),
                    'param_name'  => 'title',
                    'value'       => 'On This Page',
                    'description' => __( 'Title displayed above the list.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Style', 'idsc' ),
                    'param_name'  => 'style',
                    'value'       => array(
                        __( 'Numbered', 'idsc' ) => 'numbered',
                        __( 'Bulleted', 'idsc' ) => 'bulleted',
                    ),
                    'std'         => 'numbered',
                    'description' => __( 'List style.', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Collapsible', 'idsc' ),
                    'param_name'  => 'collapsible',
                    'value'       => array(
                        __( 'No', 'idsc' )  => 'no',
                        __( 'Yes', 'idsc' ) => 'yes',
                    ),
                    'std'         => 'no',
                    'description' => __( 'Allow collapsing the table of contents.', 'idsc' ),
                ),
            ),
        ) );
    }

    private function register_map() {
        vc_map( array(
            'name'        => __( 'Map', 'idsc' ),
            'base'        => 'idsc_map',
            'description' => __( 'Embedded map', 'idsc' ),
            'category'    => __( 'ID Shortcodes', 'idsc' ),
            'icon'        => 'dashicons dashicons-location-alt',
            'params'      => array(
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Address', 'idsc' ),
                    'param_name'  => 'address',
                    'description' => __( 'Full address or location name.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Height (px)', 'idsc' ),
                    'param_name'  => 'height',
                    'value'       => '400',
                    'description' => __( 'Map height in pixels.', 'idsc' ),
                ),
                array(
                    'type'        => 'textfield',
                    'heading'     => __( 'Zoom Level', 'idsc' ),
                    'param_name'  => 'zoom',
                    'value'       => '14',
                    'description' => __( 'Zoom level (1-20).', 'idsc' ),
                ),
                array(
                    'type'        => 'dropdown',
                    'heading'     => __( 'Map Provider', 'idsc' ),
                    'param_name'  => 'provider',
                    'value'       => array(
                        __( 'OpenStreetMap', 'idsc' ) => 'openstreetmap',
                        __( 'Google Maps', 'idsc' )   => 'google',
                    ),
                    'std'         => 'openstreetmap',
                    'description' => __( 'Map provider to use.', 'idsc' ),
                ),
            ),
        ) );
    }
}
