<?php
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}

if ($args) {
    extract($args);
}

if(empty($options)) {
    $options = get_option('fast_fuzzy_search_options', fast_fuzzy_search_get_default_options());
};

$aesthetic = apply_filters(
    'fast_fuzzy_search_aesthetic',
    !empty($options['aesthetic']) ? $options['aesthetic'] : 'minimal-light',
    $options
);

$position = !empty($options['position']) ? $options['position'] : 'bottom-center';
$inline = !empty($is_inline) && $is_inline === true ? 'fast-fuzzy-search--inline' : 'fast-fuzzy-search--'.$position;

?>

<button
    x-data="fastFuzzySearchIconButton"
    x-show="isNotVisible"
    class="fast-fuzzy-search__icon-button fast-fuzzy-search--<?php echo esc_attr($aesthetic); ?> <?php echo esc_attr($inline); ?>"
    x-on:click="handleButtonClick"
    x-on:keydown.ctrl.k.window.prevent="handleButtonClick">
    <span class="fast-fuzzy-search__icon-frame"><?php echo wp_kses(fast_fuzzy_search_svg('search'), fast_fuzzy_search_allowed_svg_tags()); ?></span>
</button>