<?php

/**
 * General Settings.
 *
 * @since   4.4.0
 * @package Extra Product Options for WooCommerce
 *
 * Available Variables (from element-form.php):
 * @var array  $epofw_field_data        The field/element data array.
 * @var array  $epofw_general_data      The field general settings array.
 * @var string $epofw_field_type        The field type (text, select, etc.).
 * @var string $epofw_field_name        The field name attribute.
 * @var string $epofw_input_field_id    The field ID attribute.
 * @var string $epofw_field_class       The field CSS class.
 * @var string $epofw_field_required    Whether field is required (on/off).
 * @var array  $epofw_label_data        The label settings array.
 * @var string $epofw_field_name_prefix The form field name prefix.
 * @var string $epofw_field_id          The field ID/key.
 * @var int    $epofw_get_post_id       The addon post ID.
 * @var bool   $epofw_remove_fields_for_heading_paragraph Whether to show all fields.
 */
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
// Check if this is a premium field type and user is not premium.
$epofw_is_premium_field_type = epofw_is_premium_field_type( $epofw_field_type );
$epofw_is_premium_user = false;
$epofw_show_premium_preview = $epofw_is_premium_field_type && !$epofw_is_premium_user;
$epofw_mask_preview_data = false;
if ( $epofw_is_premium_field_type ) {
    $epofw_mask_preview_data = true;
}
// Get premium field data for disabled state when showing premium field types to free users.
$epofw_prem_data_gs = ( $epofw_show_premium_preview ? epofw_get_premium_field_data() : array(
    'class'      => '',
    'badge'      => '',
    'disabled'   => '',
    'is_premium' => true,
) );
?>
<div class="epofw-tab-content active" data-tab="general-settings">
<div class="epofw-onboarding-hint">
	<div class="epofw-onboarding-hint-content">
		<span class="epofw-onboarding-icon"><i class="dashicons dashicons-info-outline"></i></span>
		<span class="epofw-onboarding-text"><?php 
esc_html_e( 'Configure your field settings below. Start with General Settings, then explore other tabs for advanced options like pricing and conditional logic.', 'extra-product-options-for-woocommerce' );
?></span>
	</div>
	<?php 
epofw_render_tutorial_buttons( $epofw_field_type, 'small', true );
?>
</div>
<?php 
// Show actual settings for all users (premium field types will have disabled fields with PRO badge).
$epofw_example_text = esc_html__( 'Example:', 'extra-product-options-for-woocommerce' );
$epofw_input_name_format = 'input';
if ( 'textarea' === $epofw_field_type ) {
    $epofw_input_name_format = 'textarea';
} elseif ( 'select' === $epofw_field_type || 'multiselect' === $epofw_field_type ) {
    $epofw_input_name_format = 'select';
} elseif ( 'heading' === $epofw_field_type ) {
    $epofw_input_name_format = 'label';
} elseif ( 'paragraph' === $epofw_field_type ) {
    $epofw_input_name_format = 'p';
} elseif ( 'separator' === $epofw_field_type ) {
    $epofw_input_name_format = 'hr';
}
if ( $epofw_mask_preview_data ) {
    // Keep premium field visible, but do not expose saved values in free preview HTML.
    $epofw_field_name = '';
    $epofw_input_field_id = '';
    $epofw_field_class = '';
}
// For separator, hide the same fields as heading/paragraph.
$epofw_hide_fields_for_separator = 'separator' === $epofw_field_type;
?>
<div class="epofw-form-group<?php 
echo esc_attr( $epofw_prem_data_gs['class'] );
?>">
	<div class="epofw-field-label">
		<label for="field_status"><?php 
esc_html_e( 'Field Status', 'extra-product-options-for-woocommerce' );
?> <span class="epofw-required">*</span><?php 
echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_gs['badge'] : '' ), epofw_get_badge_allowed_html() );
?></label>
		<div class="epofw-field-description">
			<?php 
esc_html_e( 'Choose whether this field is enabled or disabled on the frontend. Disabled fields will not appear to customers.', 'extra-product-options-for-woocommerce' );
?>
		</div>
	</div>
	<div class="epofw-field-input">
		<input type="checkbox" 
		<?php 
if ( !$epofw_is_premium_field_type ) {
    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field_status]"';
} else {
}
?>
		id="field_status" value="on" <?php 
checked( $epofw_field_status, 'on' );
echo esc_attr( $epofw_prem_data_gs['disabled'] );
?>>
		<label for="field_status" class="toggle-switch"></label>
	</div>
	<input type="hidden" class="epofw-field-type" 
	<?php 
if ( !$epofw_is_premium_field_type ) {
    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field][type]"';
} else {
}
?>
	value="<?php 
echo esc_attr( $epofw_field_type );
?>">
</div>

<?php 
// Separator-specific options.
if ( $epofw_hide_fields_for_separator ) {
    // Get separator settings.
    $epofw_separator_settings = epofw_check_array_key_exists( 'separator_settings', $epofw_field_data );
    if ( empty( $epofw_separator_settings ) || !is_array( $epofw_separator_settings ) ) {
        $epofw_separator_settings = array();
    }
    $epofw_separator_color = epofw_check_array_key_exists( 'color', $epofw_separator_settings );
    $epofw_separator_style = epofw_check_array_key_exists( 'style', $epofw_separator_settings );
    $epofw_separator_width = epofw_check_array_key_exists( 'width', $epofw_separator_settings );
    // Handle margin: check if it's a simple value or advanced array.
    $epofw_separator_margin_settings = epofw_check_array_key_exists( 'margin', $epofw_separator_settings );
    if ( is_array( $epofw_separator_margin_settings ) && !empty( $epofw_separator_margin_settings ) ) {
        // Advanced margin is stored.
        $epofw_separator_margin_top = epofw_check_array_key_exists( 'top', $epofw_separator_margin_settings );
        $epofw_separator_margin_right = epofw_check_array_key_exists( 'right', $epofw_separator_margin_settings );
        $epofw_separator_margin_bottom = epofw_check_array_key_exists( 'bottom', $epofw_separator_margin_settings );
        $epofw_separator_margin_left = epofw_check_array_key_exists( 'left', $epofw_separator_margin_settings );
        $epofw_separator_margin_units = epofw_check_array_key_exists( 'units', $epofw_separator_margin_settings );
    } else {
        // Simple margin or empty, set defaults.
        $epofw_separator_margin_top = '10';
        $epofw_separator_margin_right = '0';
        $epofw_separator_margin_bottom = '10';
        $epofw_separator_margin_left = '0';
        $epofw_separator_margin_units = 'px';
    }
    // Set defaults.
    if ( empty( $epofw_separator_color ) ) {
        $epofw_separator_color = '#959595';
    }
    if ( empty( $epofw_separator_style ) ) {
        $epofw_separator_style = 'dashed';
    }
    if ( empty( $epofw_separator_width ) ) {
        $epofw_separator_width = '1';
    }
    if ( empty( $epofw_separator_margin_units ) ) {
        $epofw_separator_margin_units = 'px';
    }
    ?>
	<div class="epofw-form-group">
		<div class="epofw-field-label">
			<label for="separator_color"><?php 
    esc_html_e( 'Separator Color', 'extra-product-options-for-woocommerce' );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    esc_html_e( 'Choose the color for the separator line.', 'extra-product-options-for-woocommerce' );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][color]" id="separator_color" value="<?php 
    echo esc_attr( $epofw_separator_color );
    ?>" class="epofw_colorpicker">
		</div>
	</div>

	<div class="epofw-form-group">
		<div class="epofw-field-label">
			<label for="separator_style"><?php 
    esc_html_e( 'Separator Style', 'extra-product-options-for-woocommerce' );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    esc_html_e( 'Choose the style for the separator line.', 'extra-product-options-for-woocommerce' );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][style]" id="separator_style" class="epofw-form-control">
				<option value="solid" <?php 
    selected( $epofw_separator_style, 'solid' );
    ?>><?php 
    esc_html_e( 'Solid', 'extra-product-options-for-woocommerce' );
    ?></option>
				<option value="dashed" <?php 
    selected( $epofw_separator_style, 'dashed' );
    ?>><?php 
    esc_html_e( 'Dashed', 'extra-product-options-for-woocommerce' );
    ?></option>
				<option value="dotted" <?php 
    selected( $epofw_separator_style, 'dotted' );
    ?>><?php 
    esc_html_e( 'Dotted', 'extra-product-options-for-woocommerce' );
    ?></option>
				<option value="double" <?php 
    selected( $epofw_separator_style, 'double' );
    ?>><?php 
    esc_html_e( 'Double', 'extra-product-options-for-woocommerce' );
    ?></option>
			</select>
		</div>
	</div>

	<div class="epofw-form-group">
		<div class="epofw-field-label">
			<label for="separator_width"><?php 
    esc_html_e( 'Separator Width (px)', 'extra-product-options-for-woocommerce' );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    esc_html_e( 'Set the thickness of the separator line in pixels.', 'extra-product-options-for-woocommerce' );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][width]" id="separator_width" value="<?php 
    echo esc_attr( $epofw_separator_width );
    ?>" min="1" max="10" step="1" class="epofw-form-control">
		</div>
	</div>

	<div class="epofw-form-group">
		<div class="epofw-field-label">
			<label for="separator_margin_top_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Separator Margin', 'extra-product-options-for-woocommerce' );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    esc_html_e( 'Set individual margin values for each side of the separator.', 'extra-product-options-for-woocommerce' );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<div class="epofw-spacing-inputs">
				<div class="epofw-spacing-input">
					<label for="separator_margin_top_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Top', 'extra-product-options-for-woocommerce' );
    ?></label>
					<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][margin][top]" id="separator_margin_top_<?php 
    echo esc_attr( $epofw_field_id );
    ?>" value="<?php 
    echo esc_attr( $epofw_separator_margin_top );
    ?>" placeholder="0" min="0" step="1">
				</div>
				<div class="epofw-spacing-input">
					<label for="separator_margin_right_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Right', 'extra-product-options-for-woocommerce' );
    ?></label>
					<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][margin][right]" id="separator_margin_right_<?php 
    echo esc_attr( $epofw_field_id );
    ?>" value="<?php 
    echo esc_attr( $epofw_separator_margin_right );
    ?>" placeholder="0" min="0" step="1">
				</div>
				<div class="epofw-spacing-input">
					<label for="separator_margin_bottom_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Bottom', 'extra-product-options-for-woocommerce' );
    ?></label>
					<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][margin][bottom]" id="separator_margin_bottom_<?php 
    echo esc_attr( $epofw_field_id );
    ?>" value="<?php 
    echo esc_attr( $epofw_separator_margin_bottom );
    ?>" placeholder="0" min="0" step="1">
				</div>
				<div class="epofw-spacing-input">
					<label for="separator_margin_left_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Left', 'extra-product-options-for-woocommerce' );
    ?></label>
					<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][margin][left]" id="separator_margin_left_<?php 
    echo esc_attr( $epofw_field_id );
    ?>" value="<?php 
    echo esc_attr( $epofw_separator_margin_left );
    ?>" placeholder="0" min="0" step="1">
				</div>
				<div class="epofw-spacing-input epofw-units-input">
					<label for="separator_margin_units_<?php 
    echo esc_attr( $epofw_field_id );
    ?>"><?php 
    esc_html_e( 'Units', 'extra-product-options-for-woocommerce' );
    ?></label>
					<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[separator_settings][margin][units]" id="separator_margin_units_<?php 
    echo esc_attr( $epofw_field_id );
    ?>" class="epofw-form-control">
						<option value="px" <?php 
    selected( $epofw_separator_margin_units, 'px' );
    ?>><?php 
    esc_html_e( 'px', 'extra-product-options-for-woocommerce' );
    ?></option>
						<option value="em" <?php 
    selected( $epofw_separator_margin_units, 'em' );
    ?>><?php 
    esc_html_e( 'em', 'extra-product-options-for-woocommerce' );
    ?></option>
						<option value="rem" <?php 
    selected( $epofw_separator_margin_units, 'rem' );
    ?>><?php 
    esc_html_e( 'rem', 'extra-product-options-for-woocommerce' );
    ?></option>
						<option value="%" <?php 
    selected( $epofw_separator_margin_units, '%' );
    ?>><?php 
    esc_html_e( '%', 'extra-product-options-for-woocommerce' );
    ?></option>
					</select>
				</div>
			</div>
		</div>
	</div>
	<?php 
}
?>

<?php 
if ( $epofw_remove_fields_for_heading_paragraph && !$epofw_hide_fields_for_separator ) {
    ?>
	<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_gs['class'] );
    ?>">
		<div class="epofw-field-label">
			<label for="field_name"><?php 
    esc_html_e( 'Field Name', 'extra-product-options-for-woocommerce' );
    echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_gs['badge'] : '' ), epofw_get_badge_allowed_html() );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    printf( 
        /* translators: %s: example text */
        esc_html__( 'Enter a unique name for this field. This will be used as the HTML input name attribute and form field identifier. %s', 'extra-product-options-for-woocommerce' ),
        '<br><strong>' . esc_html( $epofw_example_text ) . '</strong><code>&lt;' . esc_attr( $epofw_input_name_format ) . ' name="' . esc_attr( $epofw_field_name ) . '"&gt;</code>'
     );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<input type="text" 
			<?php 
    if ( !$epofw_is_premium_field_type ) {
        echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field][name]"';
    } else {
    }
    ?>
	id="field_name" value="<?php 
    echo esc_attr( $epofw_field_name );
    ?>" class="epofw-form-control epofw-dynamic-code-example"<?php 
    echo esc_attr( $epofw_prem_data_gs['disabled'] );
    ?>>
		</div>
	</div>
	<?php 
}
// Hide Field ID and Field Class for separator - only show Field Status.
if ( !$epofw_hide_fields_for_separator ) {
    ?>
	<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_gs['class'] );
    ?>">
		<div class="epofw-field-label">
			<label for="field_id"><?php 
    esc_html_e( 'Field ID', 'extra-product-options-for-woocommerce' );
    echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_gs['badge'] : '' ), epofw_get_badge_allowed_html() );
    ?></label>
			<div class="epofw-field-description">
			<?php 
    printf( 
        /* translators: %s: example text */
        esc_html__( 'Enter a unique ID for this field. This will be used as the HTML input id attribute. %s', 'extra-product-options-for-woocommerce' ),
        '<br><strong>' . esc_html( $epofw_example_text ) . '</strong><code>&lt;' . esc_attr( $epofw_input_name_format ) . ' id="' . esc_attr( $epofw_input_field_id ) . '"&gt;</code>'
     );
    ?>
			</div>
		</div>
		<div class="epofw-field-input">
			<input type="text" 
			<?php 
    if ( !$epofw_is_premium_field_type ) {
        echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field][id]"';
    } else {
    }
    ?>
			id="field_id" value="<?php 
    echo esc_attr( $epofw_input_field_id );
    ?>" class="epofw-form-control epofw-dynamic-code-example"<?php 
    echo esc_attr( $epofw_prem_data_gs['disabled'] );
    ?>>
		</div>
	</div>

	<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_gs['class'] );
    ?>">
		<div class="epofw-field-label">
			<label for="field_class"><?php 
    esc_html_e( 'Field Class', 'extra-product-options-for-woocommerce' );
    echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_gs['badge'] : '' ), epofw_get_badge_allowed_html() );
    ?></label>
			<div class="epofw-field-description">
				<?php 
    printf( 
        /* translators: %s: example text */
        esc_html__( 'Enter custom CSS classes for this field. These classes will be added to the HTML input element for custom styling. Separate multiple classes with spaces. %s', 'extra-product-options-for-woocommerce' ),
        '<br><strong>' . esc_html( $epofw_example_text ) . '</strong><code>&lt;' . esc_attr( $epofw_input_name_format ) . ' class="' . esc_attr( $epofw_field_class ) . '"&gt;</code>'
     );
    ?>
				</div>
			</div>
		<div class="epofw-field-input">
			<input type="text" 
			<?php 
    if ( !$epofw_is_premium_field_type ) {
        echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field][class]"';
    } else {
    }
    ?>
			id="field_class" value="<?php 
    echo esc_attr( $epofw_field_class );
    ?>" class="epofw-form-control epofw-dynamic-code-example"<?php 
    echo esc_attr( $epofw_prem_data_gs['disabled'] );
    ?>>
		</div>
	</div>
	<?php 
}
?>

	<?php 
// For heading, paragraph, and separator fields, hide Required field.
// Only show Required for fields that are not heading, paragraph, or separator.
if ( $epofw_remove_fields_for_heading_paragraph && !$epofw_hide_fields_for_separator ) {
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_gs['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_required"><?php 
    esc_html_e( 'Required', 'extra-product-options-for-woocommerce' );
    echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_gs['badge'] : '' ), epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enable this option to make this field required. Users must select an option before proceeding.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" 
				<?php 
    if ( !$epofw_is_premium_field_type ) {
        echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[field][required]"';
    } else {
    }
    ?>
				id="field_required" value="on" <?php 
    checked( $epofw_field_required, 'on' );
    ?> class="epofw-has-sub" data-nextfe="required_fields"<?php 
    echo esc_attr( $epofw_prem_data_gs['disabled'] );
    ?>>
				<label for="field_required" class="toggle-switch"></label>
			</div>
		</div>

			<?php 
    // Premium features: Required Text options.
    $epofw_is_premium_user_gs = false;
    $epofw_disabled_class_gs = ( !$epofw_is_premium_user_gs ? ' epofw-premium-field-disabled' : '' );
    $epofw_pro_badge_gs = ( !$epofw_is_premium_user_gs ? '<span class="epofw-pro-badge-inline">' . esc_html__( 'PRO', 'extra-product-options-for-woocommerce' ) . '</span>' : '' );
    $epofw_disabled_attr_gs = ( !$epofw_is_premium_user_gs ? ' disabled' : '' );
    // Ensure variables are defined for free users (they're only set in element-form.php for premium users).
    $epofw_field_rd_text = ( isset( $epofw_field_rd_text ) ? $epofw_field_rd_text : '' );
    $epofw_field_rd_text_color = ( isset( $epofw_field_rd_text_color ) ? $epofw_field_rd_text_color : '' );
    $epofw_field_rd_text_class = ( isset( $epofw_field_rd_text_class ) ? $epofw_field_rd_text_class : '' );
    ?>
			<!-- Required Fields Container -->
			<div class="epofw-required-fields-container" id="required_fields" style="display: <?php 
    echo ( 'on' === $epofw_field_required ? 'block' : 'none' );
    ?>;">
				<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_disabled_class_gs );
    ?>">
					<div class="epofw-field-label">
						<label for="field_rd_text"><?php 
    esc_html_e( 'Required Text', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_pro_badge_gs, epofw_get_badge_allowed_html() );
    ?></label>
						<div class="epofw-field-description">
							<?php 
    esc_html_e( 'Enter the text that will be displayed when this field is required but not filled.', 'extra-product-options-for-woocommerce' );
    ?>
						</div>
					</div>
					<div class="epofw-field-input">
						<input type="text" 
						<?php 
    if ( !$epofw_is_premium_field_type ) {
    } else {
    }
    ?>
						id="field_rd_text" value="<?php 
    echo esc_attr( $epofw_field_rd_text );
    ?>" class="epofw-form-control"<?php 
    echo esc_attr( $epofw_disabled_attr_gs );
    ?>>
					</div>
				</div>

				<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_disabled_class_gs );
    ?>">
					<div class="epofw-field-label">
						<label for="field_rd_text_color"><?php 
    esc_html_e( 'Required Text Color', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_pro_badge_gs, epofw_get_badge_allowed_html() );
    ?></label>
						<div class="epofw-field-description">
							<?php 
    esc_html_e( 'Choose the color for the required field validation message.', 'extra-product-options-for-woocommerce' );
    ?>
						</div>
					</div>
					<div class="epofw-field-input">
						<input type="text" class="epofw_colorpicker" 
						<?php 
    if ( !$epofw_is_premium_field_type ) {
    } else {
    }
    ?>
						id="field_rd_text_color" value="<?php 
    echo esc_attr( $epofw_field_rd_text_color );
    ?>"<?php 
    echo esc_attr( $epofw_disabled_attr_gs );
    ?>>
					</div>
				</div>

				<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_disabled_class_gs );
    ?>">
					<div class="epofw-field-label">
						<label for="field_rd_text_class"><?php 
    esc_html_e( 'Required Text Class', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_pro_badge_gs, epofw_get_badge_allowed_html() );
    ?></label>
						<div class="epofw-field-description">
							<?php 
    printf( 
        /* translators: %s: example text */
        esc_html__( 'Enter custom CSS classes for styling the required field validation message. %s', 'extra-product-options-for-woocommerce' ),
        '<br><strong>' . esc_html( $epofw_example_text ) . '</strong><code>&lt;p class="epofw_error ' . esc_attr( $epofw_field_rd_text_class ) . '" style="color: #898989;"&gt;' . esc_html( $epofw_field_rd_text ) . '&lt;/p&gt;</code>'
     );
    ?>
						</div>
					</div>
					<div class="epofw-field-input">
						<input type="text" 
						<?php 
    if ( !$epofw_is_premium_field_type ) {
    } else {
    }
    ?>
						id="field_rd_text_class" value="<?php 
    echo esc_attr( $epofw_field_rd_text_class );
    ?>" class="epofw-form-control epofw-dynamic-code-example"<?php 
    echo esc_attr( $epofw_disabled_attr_gs );
    ?>>
					</div>
				</div>
			</div>
			<?php 
}
?>

	<?php 
// Premium feature: Select/Deselect All Button for multiselect.
if ( 'multiselect' === $epofw_field_type ) {
    $epofw_is_premium_user_ms = false;
    $epofw_disabled_class_ms = ( !$epofw_is_premium_user_ms ? ' epofw-premium-field-disabled' : '' );
    $epofw_pro_badge_ms = ( !$epofw_is_premium_user_ms ? '<span class="epofw-pro-badge-inline">' . esc_html__( 'PRO', 'extra-product-options-for-woocommerce' ) . '</span>' : '' );
    $epofw_disabled_attr_ms = ( !$epofw_is_premium_user_ms ? ' disabled' : '' );
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_disabled_class_ms );
    ?>">
			<div class="epofw-field-label">
				<label for="field_select_all_btn"><?php 
    esc_html_e( 'Select/Deselect All Button', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_pro_badge_ms, epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
				<?php 
    esc_html_e( 'Enable this option to show select and deselect all button.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" 
				<?php 
    if ( !$epofw_is_premium_field_type ) {
    } else {
    }
    ?>
				id="field_select_all_btn" value="on" <?php 
    checked( epofw_check_array_key_exists( 'sedeall_btn', $epofw_options_data ), 'on' );
    echo esc_attr( $epofw_disabled_attr_ms );
    ?>>
				<label for="field_select_all_btn" class="toggle-switch"></label>
			</div>
		</div>
		<?php 
}
?>

<?php 
/**
 * Fires after general settings fields so addons can add type-specific settings (e.g. Product Group).
 *
 * @since 4.4.6
 * @param string $epofw_field_type        Field type.
 * @param array  $epofw_field_data        Field data.
 * @param string $epofw_field_name_prefix Form field name prefix.
 * @param string $epofw_field_id         Field ID.
 * @param int    $epofw_get_post_id       Addon post ID.
 */
do_action(
    'epofw_field_general_settings_extra',
    $epofw_field_type,
    $epofw_field_data,
    $epofw_field_name_prefix,
    $epofw_field_id,
    $epofw_get_post_id
);
// Input Container Styling has been removed - use Field Container Styling instead.
// This section intentionally left blank to maintain file structure.
?>
</div><!-- End epofw-tab-content general-settings -->
