<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals

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

$dbhandler       = new WPEFB_DBhandler();
$asset_base_url  = plugin_dir_url( __FILE__ );
$identifier      = 'FORMS';
$meta            = array();
$form_id         = absint( filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT ) );
$form_options    = '{}';
$dashboard_url   = admin_url( 'admin.php?page=wpefb_manage_forms' );
$shortcode_value = '[wpefb_registration' . ( $form_id ? ' id="' . absint( $form_id ) . '"' : '' ) . ']';
$form_title      = __( 'Create Form', 'vedrixa-forms-registration-builder' );
$preview_page_id = (int) get_option( 'wpefb_preview_page_id', 0 );
$preview_url     = home_url( '/' );
if ( $preview_page_id > 0 ) {
	$maybe_preview_url = get_permalink( $preview_page_id );
	if ( is_string( $maybe_preview_url ) && '' !== $maybe_preview_url ) {
		$preview_url = $maybe_preview_url;
	}
}
if ( $form_id ) {
    $preview_url = add_query_arg( 'id', absint( $form_id ), $preview_url );
}

if ( 0 === $form_id ) {
    $form_id = 0;
} else {
    $row = $dbhandler->get_row( $identifier, $form_id );
    if ( is_object( $row ) && isset( $row->meta ) && '' !== $row->meta ) {
		$meta = json_decode( $row->meta, true );
	}
    if ( is_object( $row ) && ! empty( $row->name ) ) {
		$form_title = $row->name;
	}

    if ( is_object( $row ) && ! empty( $row->form_options ) ) {
		$form_options = wp_json_encode( json_decode( $row->form_options ) );
	}
    $dashboard_url = admin_url( 'admin.php?page=wpefb_form_dashboard&id=' . absint( $form_id ) );
}

wp_enqueue_script( 'erfb-formbuilder' );
wp_localize_script(
    'erfb-formbuilder',
    'wpefb_admin_ajax_object',
    array(
        'ajax_url'      => admin_url( 'admin-ajax.php' ),
        'nonce'         => wp_create_nonce( 'wpefb_save_form_structure' ),
        'form_options'  => $form_options,
        'dashboard_url' => esc_url_raw( $dashboard_url ),
        'pro'           => array(
            'enabled'            => WPEFB_Features::is_pro_active(),
            'locked_field_types' => WPEFB_Features::get_locked_field_types(),
            'upgrade_url'        => esc_url_raw( apply_filters( 'wpefb_pro_page_url', admin_url( 'admin.php?page=wpefb_pro' ) ) ),
            'pricing_url'        => esc_url_raw( apply_filters( 'wpefb_upgrade_url', 'https://registrationformbuilder.com/pricing/' ) ),
            'logo_url'           => esc_url_raw( apply_filters( 'wpefb_pro_logo_url', $asset_base_url . 'images/vedrixa-logo.png' ) ),
        ),
    )
);
?>
<div class="advrf-wrapper wrap wef-forms-modern wef-fields-modern">
    <div class="advrf-page-title">

        <h1 class="wpefb-page-heading">
            <?php echo esc_html( $form_title ); ?> <span class="wef-title-muted"><?php esc_html_e( '- Builder', 'vedrixa-forms-registration-builder' ); ?></span></h1>
        <ul class="advrf-nav">
            <li class="advrf-nav-item">
                <a href="<?php echo esc_url( admin_url( 'admin.php?page=wpefb_manage_forms' ) ); ?>">
                    <img width="24" src="<?php echo esc_url( $asset_base_url ); ?>images/edit_submission.png">
                    <?php esc_html_e( 'All Forms', 'vedrixa-forms-registration-builder' ); ?></a>
            </li>
            <li class="advrf-nav-item">
                <a href="<?php echo esc_url( admin_url( 'admin.php?page=wpefb_form_dashboard&id=' . absint( $form_id ) ) ); ?>">
                    <img width="24" src="<?php echo esc_url( $asset_base_url ); ?>images/configuration/display-icon.png">
                    <?php esc_html_e( 'Dashboard', 'vedrixa-forms-registration-builder' ); ?></a>
            </li>
            <li class="advrf-nav-item">
                <a target="_blank" href="<?php echo esc_url( $preview_url ); ?>">
                    <img width="24" src="<?php echo esc_url( $asset_base_url ); ?>images/preview-link.png">
                    <?php esc_html_e( 'Preview', 'vedrixa-forms-registration-builder' ); ?></a>
            </li>    
        </ul>

    </div>
    <div class="advrforms-new-form clearfix">


        <div id="advrf_fb_app" class="advrf-form-builder-wrapper">
            <div class="advrf-feature-request">
                <div id="advrf_progress" style="display: none;">
                    <div class="loader">
                        <img src="<?php echo esc_url( $asset_base_url . 'images/loader.svg' ); ?>" alt="<?php esc_attr_e( 'Loading', 'vedrixa-forms-registration-builder' ); ?>">
                    </div>
                </div> 
            <div class="buttonarea buttonarea-top">
                <p class="submit">
                    <input type="button" value="Save" id="advrforms-form-save-btn" class="button button-primary">
                    <input type="button" value="Save &amp; Close" id="advrforms-form-save-close-btn" class="button button-primary">
                </p>
            </div>
            <div class="advrf-form-builder" id="wefb-builder">
                <div class="advrf-field-type-container" id="field-palette">
                    <div class="wef-field-header">
                        <h4 class="advrf-field-heading"><?php esc_html_e( 'Available Fields', 'vedrixa-forms-registration-builder' ); ?></h4>
                        <div class="wef-field-tabs" role="tablist">
                            <button type="button" class="wef-field-tab is-active" data-category="all"><?php esc_html_e( 'All', 'vedrixa-forms-registration-builder' ); ?></button>
                            <button type="button" class="wef-field-tab" data-category="basic"><?php esc_html_e( 'Basic', 'vedrixa-forms-registration-builder' ); ?></button>
                            <button type="button" class="wef-field-tab" data-category="layout"><?php esc_html_e( 'Layout', 'vedrixa-forms-registration-builder' ); ?></button>
                            <button type="button" class="wef-field-tab" data-category="advanced"><?php esc_html_e( 'Advanced', 'vedrixa-forms-registration-builder' ); ?></button>
                            <button type="button" class="wef-field-tab" data-category="social"><?php esc_html_e( 'Social', 'vedrixa-forms-registration-builder' ); ?></button>
                        </div>
                        <div class="wef-field-search">
                            <span class="dashicons dashicons-search"></span>
                            <input type="text" id="wef-field-search" placeholder="<?php esc_attr_e( 'Search fields...', 'vedrixa-forms-registration-builder' ); ?>">
                        </div>
                    </div>

                    <div class="field-item" data-type="heading" data-category="layout" data-label="<?php esc_attr_e( 'Heading', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Section title text', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-editor-textcolor"></span>
                        <span class="field-label"><?php esc_html_e( 'Heading', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Section title text', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="paragraph" data-category="layout" data-label="<?php esc_attr_e( 'Paragraph', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Static helper text', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-editor-paragraph"></span>
                        <span class="field-label"><?php esc_html_e( 'Paragraph', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Static helper text', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="text" data-category="basic" data-label="<?php esc_attr_e( 'Text', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Single line input', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-editor-textcolor"></span>
                        <span class="field-label"><?php esc_html_e( 'Text', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Single line input', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="select" data-category="basic" data-label="<?php esc_attr_e( 'Drop Down', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Select from list', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-arrow-down-alt2"></span>
                        <span class="field-label"><?php esc_html_e( 'Drop Down', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Select from list', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="radio" data-category="basic" data-label="<?php esc_attr_e( 'Radio Button', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Single choice', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-marker"></span>
                        <span class="field-label"><?php esc_html_e( 'Radio Button', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Single choice', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="textarea" data-category="basic" data-label="<?php esc_attr_e( 'Text Area', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Multi-line input', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-editor-paragraph"></span>
                        <span class="field-label"><?php esc_html_e( 'Text Area', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Multi-line input', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="checkbox" data-category="basic" data-label="<?php esc_attr_e( 'Check Box', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Multiple choices', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-yes-alt"></span>
                        <span class="field-label"><?php esc_html_e( 'Check Box', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Multiple choices', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="DatePicker" data-category="basic" data-label="<?php esc_attr_e( 'Date', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Calendar picker', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-calendar-alt"></span>
                        <span class="field-label"><?php esc_html_e( 'Date', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Calendar picker', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="email" data-category="basic" data-label="<?php esc_attr_e( 'Email', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Email address', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-email-alt"></span>
                        <span class="field-label"><?php esc_html_e( 'Email', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Email address', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="number" data-category="basic" data-label="<?php esc_attr_e( 'Number', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Numeric input', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-editor-ol"></span>
                        <span class="field-label"><?php esc_html_e( 'Number', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Numeric input', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="country" data-category="advanced" data-label="<?php esc_attr_e( 'Country', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Country select', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-admin-site"></span>
                        <span class="field-label"><?php esc_html_e( 'Country', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Country select', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="timezone" data-category="advanced" data-label="<?php esc_attr_e( 'Timezone', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Timezone select', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-clock"></span>
                        <span class="field-label"><?php esc_html_e( 'Timezone', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Timezone select', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="term_checkbox" data-category="advanced" data-label="<?php esc_attr_e( 'T&C Checkbox', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Terms acceptance', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-lock"></span>
                        <span class="field-label"><?php esc_html_e( 'T&C Checkbox', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Terms acceptance', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="file" data-category="advanced" data-label="<?php esc_attr_e( 'File Upload', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Upload a file', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-upload"></span>
                        <span class="field-label"><?php esc_html_e( 'File Upload', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Upload a file', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="repeatable_text" data-category="advanced" data-label="<?php esc_attr_e( 'Repeatable Text', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Repeatable inputs', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-plus-alt2"></span>
                        <span class="field-label"><?php esc_html_e( 'Repeatable Text', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Repeatable inputs', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="first_name" data-category="basic" data-label="<?php esc_attr_e( 'First Name', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'User first name', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-admin-users"></span>
                        <span class="field-label"><?php esc_html_e( 'First Name', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'User first name', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="last_name" data-category="basic" data-label="<?php esc_attr_e( 'Last Name', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'User last name', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-admin-users"></span>
                        <span class="field-label"><?php esc_html_e( 'Last Name', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'User last name', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="user_name" data-category="basic" data-label="<?php esc_attr_e( 'Username', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Account username', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-id"></span>
                        <span class="field-label"><?php esc_html_e( 'Username', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Account username', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="user_email" data-category="basic" data-label="<?php esc_attr_e( 'User Email', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Account email', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-email-alt"></span>
                        <span class="field-label"><?php esc_html_e( 'User Email', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Account email', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="nickname" data-category="advanced" data-label="<?php esc_attr_e( 'Nickname', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Public nickname', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-admin-users"></span>
                        <span class="field-label"><?php esc_html_e( 'Nickname', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Public nickname', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="user_url" data-category="advanced" data-label="<?php esc_attr_e( 'Website', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Personal website', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-admin-links"></span>
                        <span class="field-label"><?php esc_html_e( 'Website', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Personal website', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="user_pass" data-category="basic" data-label="<?php esc_attr_e( 'Password', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'User password', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-lock"></span>
                        <span class="field-label"><?php esc_html_e( 'Password', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'User password', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="confirm_pass" data-category="basic" data-label="<?php esc_attr_e( 'Confirm Password', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Confirm password', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-lock"></span>
                        <span class="field-label"><?php esc_html_e( 'Confirm Password', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Confirm password', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="description" data-category="advanced" data-label="<?php esc_attr_e( 'Biographical Info', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Long bio text', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-format-aside"></span>
                        <span class="field-label"><?php esc_html_e( 'Biographical Info', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Long bio text', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="user_avatar" data-category="advanced" data-label="<?php esc_attr_e( 'Profile Image', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Avatar upload', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-format-image"></span>
                        <span class="field-label"><?php esc_html_e( 'Profile Image', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Avatar upload', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="mobile_number" data-category="advanced" data-label="<?php esc_attr_e( 'Mobile Number', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Mobile contact', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-smartphone"></span>
                        <span class="field-label"><?php esc_html_e( 'Mobile Number', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Mobile contact', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="phone_number" data-category="advanced" data-label="<?php esc_attr_e( 'Phone Number', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Phone contact', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-phone"></span>
                        <span class="field-label"><?php esc_html_e( 'Phone Number', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Phone contact', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="gender" data-category="advanced" data-label="<?php esc_attr_e( 'Gender', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Gender selection', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-groups"></span>
                        <span class="field-label"><?php esc_html_e( 'Gender', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Gender selection', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="language" data-category="advanced" data-label="<?php esc_attr_e( 'Language', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Language select', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-translation"></span>
                        <span class="field-label"><?php esc_html_e( 'Language', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Language select', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="divider" data-category="layout" data-label="<?php esc_attr_e( 'Divider', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Section divider', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-minus"></span>
                        <span class="field-label"><?php esc_html_e( 'Divider', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Section divider', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="spacing" data-category="layout" data-label="<?php esc_attr_e( 'Spacing', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Vertical spacing', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-align-full-width"></span>
                        <span class="field-label"><?php esc_html_e( 'Spacing', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Vertical spacing', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="multi_dropdown" data-category="advanced" data-label="<?php esc_attr_e( 'Multi Dropdown', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Multi select', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-list-view"></span>
                        <span class="field-label"><?php esc_html_e( 'Multi Dropdown', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Multi select', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="facebook" data-category="social" data-label="<?php esc_attr_e( 'Facebook', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-share"></span>
                        <span class="field-label"><?php esc_html_e( 'Facebook', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="twitter" data-category="social" data-label="<?php esc_attr_e( 'Twitter', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-share"></span>
                        <span class="field-label"><?php esc_html_e( 'Twitter', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="google" data-category="social" data-label="<?php esc_attr_e( 'Google+', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-share"></span>
                        <span class="field-label"><?php esc_html_e( 'Google+', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="linked_in" data-category="social" data-label="<?php esc_attr_e( 'Linked In', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-share"></span>
                        <span class="field-label"><?php esc_html_e( 'Linked In', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="youtube" data-category="social" data-label="<?php esc_attr_e( 'YouTube', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Channel URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-video-alt3"></span>
                        <span class="field-label"><?php esc_html_e( 'YouTube', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Channel URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="mixcloud" data-category="social" data-label="<?php esc_attr_e( 'MixCloud', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-format-audio"></span>
                        <span class="field-label"><?php esc_html_e( 'MixCloud', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="soundcloud" data-category="social" data-label="<?php esc_attr_e( 'SoundCloud', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-format-audio"></span>
                        <span class="field-label"><?php esc_html_e( 'SoundCloud', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                    <div class="field-item" data-type="instagram" data-category="social" data-label="<?php esc_attr_e( 'Instagram', 'vedrixa-forms-registration-builder' ); ?>" data-desc="<?php esc_attr_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?>">
                        <span class="erfb-drag-handle"></span><span class="dashicons dashicons-camera"></span>
                        <span class="field-label"><?php esc_html_e( 'Instagram', 'vedrixa-forms-registration-builder' ); ?></span><span class="field-desc"><?php esc_html_e( 'Profile URL', 'vedrixa-forms-registration-builder' ); ?></span>
                    </div>
                </div> 
                
                <div id="field-settings-panel" style="display:none;">
                    <?php
                        require __DIR__ . '/field-settings.php';
                    ?>
                </div>
                
                <div class="advrf-form-fields builder-canvas" id="wefb-canvas">
                  
                    <!-- Sections will be inserted here -->
                    <div class="add-row-button-wrapper">
                        <button id="add-row" class="add-row-button" title="<?php esc_attr_e( 'Add Row', 'vedrixa-forms-registration-builder' ); ?>">+</button>
                    </div>
    
                </div>
                <input type="hidden" id="wefb_field_data" name="wefb_field_data" />
                <input type="hidden" id="wefb_form_id" name="wefb_form_id" value="<?php echo esc_attr( $form_id ); ?>" />
            </div>
        </div>
    </div>    
</div>

