<?php
$uid = $block->getUid();
$additionalClass = $block->getAdditionalClass();

// CUSTOM THEME
$themeHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Theme');
$themeClass = "";
$theme = ['model' => $themeHelper->getThemeModel()];
if (stripos($theme['model'], "Infortis") !== false) {
    $themeClass = "ultimo";
}

// PRICES
$priceHelper = $this->helper('Magento\Framework\Pricing\Helper\Data');

// CONFIG
$dataHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Data');
$coreConfigHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Config');
$storeId = $dataHelper->getCurrentStoreId();
$configHelper = $this->helper('Wyomind\ElasticsearchLayeredNavigation\Helper\Config');
$labels = $configHelper->getLabels($storeId);
$displayInputBoxesForPriceFilter = $configHelper->displayInputBoxesForPriceFilter($block->getType(), $storeId);
$layerHideOneValue = $configHelper->isLayerHideOneValue($block->getType(), $storeId);
$isLayerUpdateEnabled = $configHelper->isLayerUpdateEnabled($block->getType(), $storeId);
if ($isLayerUpdateEnabled) {
    $layerUpdateMethod = $configHelper->getLayerUpdateMethod($block->getType(), $storeId);
} else {
    $layerUpdateMethod = -1;
}

$categoryHelper = $this->helper('Wyomind\ElasticsearchLayeredNavigation\Helper\Category');
$currentCategory = $categoryHelper->getCurrentCategoryId();

// RESULTS
$frontendHelper = $this->helper('Wyomind\ElasticsearchLayeredNavigation\Helper\Frontend');
$swatchMediaUrl =$frontendHelper->getBaseMediaUrl();
$result = $frontendHelper->getResult($block->getType());

// FILTERS
$filterableAttributes = json_decode($configHelper->getFilterableAttributesJson($block->getType(), $storeId), true);
?>

<div class="block filter <?= $additionalClass ?> <?= $themeClass ?> wyomind-bg-secondary" uid="<?= $uid; ?>">
    <?php if ($uid == "mobile"): ?>
        <span style="text-align: center;display: block;">
            <a class="eln-layer-clear-all clear <?php if (empty($result['selectedFilters'])): ?>hidden<?php endif; ?>"
               href="#"><?= $labels['clear_all'] ?></a>
        </span>
        <?php echo $block->getChildHtml("wyo_eln_layer_breadcrumb_mobile"); ?>
    <?php endif; ?>
    <div class="block-content filter-content wyomind-bg-secondary">

        <?php if ($uid == "top"): ?>
        <div class="eln-layer-title-section sidebar-main">
            <span class="eln-layer-title"><?= $labels['search_by'] ?></span>
            <a class="eln-layer-clear-all clear <?php if (empty($result['selectedFilters'])): ?>hidden<?php endif; ?>"
               href="#"><?= $labels['clear_all'] ?></a>
        </div>
        <div class="eln-tool-top">
            <?php endif; ?>
            <?php
            $selectedFilters = $result['selectedFilters'];
            $filters = $result['aggregations'];
            ?>
            <div data-role="eln-filters-content" class="eln-layer" <?= /* @noEscape */ (!count($filterableAttributes[$uid])?"style='display:none'":"") ?>>
                <?php foreach ($filterableAttributes[$uid] as $attributeInfo): ?>
                    <?php
                    $attributeCode = $attributeInfo[0];
                    $showResultsCount = $attributeInfo[1];
                    $showMoreLess = $attributeInfo[2];
                    $showMoreLessNbValues = $attributeInfo[3];
                    $showLayerFilter = $attributeInfo[4];
                    $closed = $attributeInfo[5];
                    $generateUrl = $attributeInfo[6];
                    $noFollow = $attributeInfo[7];
                    ?>
                    <?php
                    $code = "";
                    if (isset($filters[$attributeCode])):
                        $code = $attributeCode;
                    elseif (isset($filters[$attributeCode . "_ids"])) :
                        $code = $attributeCode . "_ids";
                    endif;
                    ?>
                    <?php if ($code != "") : ?>
                        <?php
                        $filter = $filters[$code];
                        $attributeFilter = "";
                        $goahead = 0;
                        ?>
                        <?php if ($code === "final_price"): ?>
                            <?php if ($filter['min'] != $filter['max']): ?>
                                <?php
                                $min = $filter['min'];
                                $max = $filter['max'];
                                $valMin = $filter['values']['min'];
                                $valMax = $filter['values']['max'];
                                if ($min != $valMin || $max != $valMax) :
                                    $closed = false;
                                endif;
                                ?>

                                <!-- price filter template -->
                                <div class="eln-filter-item filter-options-item price-slider <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                     attribute-code="final_price" data-role="eln-product-prices-filter-content">
                                    <div data-role="title" class="filter-options-title"><?php echo __("Price"); ?></div>
                                    <div class="eln-filter-content filter-options-content price">
                                        <div class="eln-price-slider" valmax="<?= $valMax ?>" valmin="<?= $valMin ?>"
                                             max="<?= $max ?>" min="<?= $min ?>"></div>
                                        <div class="price-range a-center">
                                            <span class="from wyomind-primary-color"><?= $priceHelper->currency($valMin, true, false) ?></span>
                                            -
                                            <span class="to wyomind-primary-color"><?= $priceHelper->currency($valMax, true, false) ?></span>
                                            <?php if ($displayInputBoxesForPriceFilter) : ?>
                                                <div>
                                                    <input type="text" class="eln-price min input-text"
                                                           placeholder="min"
                                                           value="<?php if ($valMin != $min): echo $valMin; endif; ?>">
                                                    <input type="text" class="eln-price max input-text"
                                                           placeholder="max"
                                                           value="<?php if ($valMax != $max): echo $valMax; endif; ?>">
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                        <div class="price-limit">
                                            <div class="max"><?= $priceHelper->currency($max, true, false) ?></div>
                                            <div class="min"><?= $priceHelper->currency($min, true, false) ?></div>
                                        </div>
                                    </div>
                                </div>
                                <!-- /price filter tempalte -->


                                <?php
                                $initSlider = true;
                                $min = $filter['min'];
                                $max = $filter['max'];
                                $valMin = $filter['values']['min'];
                                $valMax = $filter['values']['max'];
                                ?>
                            <?php endif; ?>
                        <?php elseif ($code === "rating") : ?>
                            <?php foreach ($filter as $rating): ?>
                                <?php $goahead += $rating['count']; ?>
                            <?php endforeach; ?>
                            <?php if ((($layerHideOneValue && count($filter) > 1) || !$layerHideOneValue) && ($goahead > 0 || $layerUpdateMethod > 0)) : ?>


                                <!-- ratings filter template -->
                                <?php $selected = (isset($selectedFilters[$code])) ? array_keys($selectedFilters[$code]['values']) : []; ?>
                                <?php
                                if (count($selected)) :
                                    $closed = false;
                                endif;
                                ?>
                                <div class="eln-filter-item filter-options-item <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                     attribute-code="rating"
                                     data-role="eln-product-ratings-filter-content">
                                    <div data-role="title"
                                         class="filter-options-title"><?php echo __("Rating"); ?></div>
                                    <div class="eln-filter-content filter-options-content">
                                        <div class="swatch-attribute-options clearfix">
                                            <div class="swatch-attribute hide-more">
                                                <div class="container">
                                                    <?php foreach ($filter as $data) : ?>
                                                        <?php if ($generateUrl) : ?>
                                                            <a
                                                            href="<?= (!in_array($data['rating'], $selected)) ? $frontendHelper->createFilterUrl($generateUrl, "rating", $data['rating']) : $frontendHelper->createFilterUrlMinus($generateUrl, "rating", $data['rating']); ?>"
                                                            <?php if ($noFollow): ?>rel="nofollow"<?php endif; ?>
                                                        <?php else: ?>
                                                            <span
                                                        <?php endif; ?>
                                                        class="eln-filter-option filter-option rating <?= (empty($data)) ? "disabled" : "" ?>"
                                                        style="display:block" attribute-code="rating"
                                                        option-id="<?= $data['rating'] ?>"
                                                        option-label="<?= $data['rating'] ?>">
                                                        <input type="checkbox" <?= (in_array($data['rating'], $selected)) ? 'checked="checked"' : '' ?>
                                                        "/>
                                                        <?php if ($data['rating'] == "-1"): ?>
                                                            <span title="<?= __('No rating') ?><?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"
                                                                  id="rating-filter--1"
                                                                  class="label title <?= (in_array($data['rating'], $selected)) ? "selected" : "" ?>"><?= __("No rating") ?></span>
                                                                <?php if ($showResultsCount == 1 && $data['count'] > 0): ?>
                                                                <span class="count"><?= $data['count'] ?></span>
                                                            <?php endif; ?>
                                                        <?php else: ?>
                                                            <span id="rating-filter-<?= $data['rating'] ?>"
                                                                  class="title <?= (in_array($data['rating'], $selected)) ? "selected" : "" ?>">
                                                                    <div title="<?= $data['rating'] ?>%<?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"
                                                                         style="float: none;max-width: 100%;width: 100%; display:inline">
                                                                        <div class="product-reviews-summary short"
                                                                             style="display:inline-block">
                                                                            <div class="rating-summary">
                                                                                <span class="label"><span><?= __("Rating:") ?></span></span>
                                                                                <div class="rating-result"
                                                                                     title="<?= $data['rating'] ?>%<?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>">
                                                                                    <span style="width:<?= $data['rating'] ?>%">
                                                                                        <span><?= $data['rating'] ?>
                                                                                            %</span>
                                                                                    </span>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </span>
                                                                <?php if ($showResultsCount == 1 && $data['count'] > 0): ?>
                                                                <span class="count"><?= $data['count'] ?></span>
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                        <?php if ($generateUrl) : ?>
                                                            </a>
                                                        <?php else: ?>
                                                            </span>
                                                        <?php endif; ?>
                                                    <?php endforeach; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- /ratings filter template -->

                            <?php endif; ?>
                        <?php elseif ($code == "categories") : ?>
                            <?php foreach ($filter as $category): ?>
                                <?php $goahead += ($category['count'] == -1) ? 0 : $category['count']; ?>
                            <?php endforeach; ?>
                            <?php if ($goahead > 0 || $layerUpdateMethod > 0): ?>
                                <div class="eln-filter-item filter-options-item <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                     attribute-code="categories">
                                    <div data-role="title"
                                         class="filter-options-title"><?php echo __("Categories"); ?></div>
                                    <div class="eln-filter-content filter-options-content"
                                         data-role="eln-product-category-filter-content">
                                        <ul>
                                            <?php $values = []; ?>
                                            <?php if (isset($selectedFilters["categories_ids"])): ?>
                                                <?php $values = array_keys($selectedFilters["categories_ids"]['values']); ?>
                                            <?php endif; ?>
                                            <?php $catContent = []; ?>

                                            <?php $content = ""; ?>
                                            <?php foreach ($filters['categories_ordered'] as $category): ?>
                                                <!-- template item -->

                                                <?php $category = $filter[$category]; ?>
                                                <?php $selected = in_array($category['id'], $values); ?>

                                                <?php //if (!isset($category['parent'])): ?>
                                                <?php
                                                $tmpContent = '<li';
                                                if (isset($category['children']) && $category['children']) {
                                                    $tmpContent .= ' class="children" category-id="' . $category['id'] . '" data-role="eln-product-category-filter-item-filter-content"';
                                                }
                                                $tmpContent .= '>';
                                                $tmpContent .= '<span class="tree"></span>';
                                                $tmpContent .= '<a href="#" class="eln-filter-option filter-option ' . (($category['count'] < 0) ? 'disabled' : '') . '"';
                                                $tmpContent .= ' style="display:block" attribute-code="categories_ids" option-id="' . $category['id'] . '">';
                                                $tmpContent .= '<input type="checkbox" ' . (($selected) ? 'checked="checked"' : '') . '/>';
                                                $tmpContent .= '<div title="' . $category['label'] . (($showResultsCount == 1 && $category['count'] > 0) ? " (" . $category['count'] . ")" : "") . '" style="float: none;max-width: 100%;width: 100%;">';
                                                $tmpContent .= '<span class="title ' . ($selected ? 'selected' : '') . '" category-id="' . $category['id'] . '">' . $category['label'] . '</span>';
                                                if ($showResultsCount == 1 && $category['count'] > 0) {
                                                    $tmpContent .= '<span class="count">' . $category['count'] . '</span>';
                                                }
                                                $tmpContent .= '</div></a>';
                                                $tmpContent .= '<ul id="eln-category-' . $category['id'] . '">{{' . $category['id'] . '}}</ul></li>';

                                                if (($currentCategory == -1 && isset($category['parent'])) || ($currentCategory != -1 && $category['id'] != $currentCategory)) {
                                                    $content = str_replace("{{" . $category['parent'] . "}}", $tmpContent . "{{" . $category['parent'] . "}}", $content);
                                                } else {
                                                    $content .= $tmpContent;
                                                }
                                                ?>

                                                <?php //endif; ?>
                                                <!-- /template item -->
                                            <?php endforeach; ?>

                                            <?php echo preg_replace("/\{\{[0-9]+\}\}/", "", $content); ?>


                                        </ul>
                                    </div>
                                </div>
                            <?php endif; ?>

                        <?php else: ?>
                            <?php
                            $goahead = 0;
                            foreach ($filter['values'] as $optionId => $data):
                                $goahead += $data['count'];
                            endforeach;
                            ?>
                            <?php if ((($layerHideOneValue && count($filter['values']) > 1) || !$layerHideOneValue) && ($goahead > 0 || $layerUpdateMethod > 0)): ?>
                                <?php
                                $attributeCode = $code;
                                $selected = isset($selectedFilters[$code]) && isset($selectedFilters[$code]['values']) ? array_keys($selectedFilters[$code]['values']) : [];
                                if (count($selected)) :
                                    $closed = false;
                                endif;
                                ?>

                                <?php if ($filter['textSwatch']) : ?>

                                    <div class="eln-filter-item filter-options-item <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                         attribute-code="<?= $attributeCode ?>"
                                         data-role="eln-product-text-swatch-filter-content">
                                        <div data-role="title"
                                             class="filter-options-title"><?= $filter['label'] ?></div>
                                        <div id="eln-swatch-filter-content"
                                             class="eln-filter-content filter-options-content">
                                            <div class="swatch-attribute-options clearfix">
                                                <div class="swatch-attribute swatch-layered hide-more">
                                                    <div class="container">
                                                        <?php foreach ($filter['values'] as $data): ?>
                                                            <?php if ($generateUrl) : ?>
                                                                <a
                                                                href="<?= (!in_array($data['id'], $selected)) ? $frontendHelper->createFilterUrl($generateUrl, $attributeCode, $data['label']) : $frontendHelper->createFilterUrlMinus($generateUrl, $attributeCode, $data['label']) ?>"
                                                                <?php if ($noFollow): ?>rel="nofollow"<?php endif; ?>
                                                            <?php else: ?>
                                                                <span
                                                            <?php endif; ?>
                                                            class="<?= ($showMoreLess == 1) ? "hide" . $showMoreLessNbValues . " " : "" ?>eln-filter-option filter-option swatch-option-link-layered <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                            attribute-code="<?= $attributeCode ?>"
                                                            option-id="<?= $data['id'] ?>"
                                                            option-label="<?= $data['label'] ?>">
                                                            <div class="swatch-option text <?= (in_array($data['id'], $selected)) ? "selected" : "" ?> <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                                 title="<?= $data['label'] ?><?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"><?= $data['data']??$data['label'] ?></div>
                                                            <?php if ($generateUrl) : ?>
                                                                </a>
                                                            <?php else: ?>
                                                                </span>
                                                            <?php endif; ?>
                                                        <?php endforeach; ?>
                                                    </div>
                                                    <?php if (count($filter['values']) > $showMoreLessNbValues && $showMoreLess): ?>
                                                        <a class="show-more wyomind-primary-color"
                                                           href="#"><?= __('Show more'); ?></a>
                                                        <a class="show-less wyomind-primary-color"
                                                           href="#"><?= __('Show less'); ?></a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <?php // visual swatch attribute filter ?>
                                <?php elseif ($filter['visualSwatch']) : ?>

                                    <div class="eln-filter-item filter-options-item <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                         attribute-code="<?= $attributeCode ?>"
                                         data-role="eln-product-visual-swatch-filter-content">
                                        <div data-role="title"
                                             class="filter-options-title"><?= $filter['label'] ?></div>
                                        <div id="eln-swatch-filter-content"
                                             class="eln-filter-content filter-options-content">
                                            <div class="swatch-attribute-options clearfix">
                                                <div class="swatch-attribute swatch-layered hide-more">
                                                    <div class="container">
                                                        <?php foreach ($filter['values'] as $data): ?>
                                                            <?php if ($generateUrl) : ?>
                                                                <a
                                                                href="<?= (!in_array($data['id'], $selected)) ? $frontendHelper->createFilterUrl($generateUrl, $attributeCode, $data['label']) : $frontendHelper->createFilterUrlMinus($generateUrl, $attributeCode, $data['label']) ?>"
                                                                <?php if ($noFollow): ?>rel="nofollow"<?php endif; ?>
                                                                class="<?= ($showMoreLess == 1) ? "hide" . $showMoreLessNbValues . " " : "" ?>eln-filter-option filter-option swatch-option-link-layered <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                                attribute-code="<?= $attributeCode ?>"
                                                                option-id="<?= $data['id'] ?>"
                                                                option-label="<?= $data['label'] ?>">
                                                            <?php else: ?>
                                                                <span class="<?= ($showMoreLess == 1) ? "hide" . $showMoreLessNbValues . " " : "" ?>eln-filter-option filter-option swatch-option-link-layered <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                                attribute-code="<?= $attributeCode ?>"
                                                                option-id="<?= $data['id'] ?>"
                                                                option-label="<?= $data['label'] ?>">
                                                            <?php endif; ?>
                                                            <?php if ($data['type'] == 2): ?>
                                                                <div class="swatch-option color <?= (in_array($data['id'], $selected)) ? "selected" : "" ?> <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                                     title="<?= $data['label'] ?><?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"
                                                                     style="background: url('/<?php echo $coreConfigHelper->getEnablePubFolder() ? "pub/" : ""; ?>media/attribute/swatch<?= $data['data'] ?>'); no-repeat center; background-size: 100%;"></div>
                                                            <?php else: ?>
                                                                <div class="swatch-option color <?= (in_array($data['id'], $selected)) ? "selected" : "" ?> <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                                     title="<?= $data['label'] ?><?= ($showResultsCount == 1 && $data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"
                                                                     style="background: <?= $data['data'] ?> no-repeat center; background-size: 100%;"></div>
                                                            <?php endif; ?>
                                                            <?php if ($generateUrl) : ?>
                                                                </a>
                                                            <?php else: ?>
                                                                </span>
                                                            <?php endif; ?>
                                                        <?php endforeach; ?>
                                                    </div>
                                                    <?php if (count($filter['values']) > $showMoreLessNbValues && $showMoreLess): ?>
                                                        <a class="show-more wyomind-primary-color"
                                                           href="#"><?= __('Show more'); ?></a>
                                                        <a class="show-less wyomind-primary-color"
                                                           href="#"><?= __('Show less'); ?></a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <?php // all other attributes ?>
                                <?php else: ?>
                                    <div class="eln-filter-item filter-options-item <?= $block->getUid() != "top" && !$closed ? "active" : "" ?>"
                                         attribute-code="<?= $attributeCode ?>"
                                         data-role="eln-product-attribute-filter-content">
                                        <div class="filter-options-title"><?= $filter['label'] ?></div>
                                        <div class="eln-filter-content filter-options-content" role="tabpanel">
                                            <div class="swatch-attribute-options clearfix">
                                                <div class="swatch-attribute hide-more">
                                                    <div class="container">
                                                        <?php if ($showLayerFilter): ?>
                                                            <input type="text" class="eln-layer-filter"/>
                                                        <?php endif; ?>
                                                        <?php foreach ($filter['values'] as $data): ?>
                                                            <?php if ($generateUrl) : ?>
                                                                <a
                                                                href="<?= (!in_array($data['id'], $selected)) ? $frontendHelper->createFilterUrl($generateUrl, $attributeCode, $data['label']) : $frontendHelper->createFilterUrlMinus($generateUrl, $attributeCode, $data['label']) ?>"
                                                                <?php if ($noFollow): ?>rel="nofollow"<?php endif; ?>
                                                            <?php else: ?>
                                                                <span
                                                            <?php endif; ?>
                                                            class="<?= ($showMoreLess == 1) ? "hide" . $showMoreLessNbValues . " " : "" ?>eln-filter-option filter-option <?= ($data['count'] == 0) ? "disabled" : "" ?>"
                                                            style="display:block"
                                                            attribute-code="<?= $attributeCode ?>"
                                                            option-id="<?= $data['id'] ?>"
                                                            option-label="<?= $data['label'] ?>">
                                                            <input type="checkbox" <?= (in_array($data['id'], $selected)) ? "checked=\"checked\"" : "" ?>/>
                                                            <div data-filter="<?= strtolower($data['label']) ?>"
                                                                 title="<?= $data['label'] ?><?= ($data['count'] > 0) ? " (" . $data['count'] . ")" : "" ?>"
                                                                 style="float: none;max-width: 100%;width: 100%;">
                                                                <span class="title <?= (in_array($data['id'], $selected)) ? "selected" : "" ?>">
                                                                    <?php if ($data['image'] != "") : ?>
                                                                        <img class='eln-option-image' src="<?= $swatchMediaUrl ?><?= $data['image'] ?>" width="20" height="20"/>
                                                                    <?php endif; ?>
                                                                    <?= $data['label'] ?></span>
                                                                    <?php if ($showResultsCount == 1 && $data['count'] > 0) : ?>
                                                                        <span class="count"><?= $data['count'] ?></span>
                                                                    <?php endif; ?>
                                                            </div>
                                                            <?php if ($generateUrl) : ?>
                                                                </a>
                                                            <?php else: ?>
                                                                </span>
                                                            <?php endif; ?>
                                                        <?php endforeach; ?>
                                                    </div>
                                                    <?php if (count($filter['values']) > $showMoreLessNbValues && $showMoreLess): ?>
                                                        <a class="show-more wyomind-primary-color"
                                                           href="#"><?= __('Show more'); ?></a>
                                                        <a class="show-less wyomind-primary-color"
                                                           href="#"><?= __('Show less'); ?></a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                <?php endif; ?>
                            <?php endif; ?>
                        <?php endif; ?>
                    <?php endif; ?>
                <?php endforeach; ?>
            </div>
            <?php if ($uid == "top"): ?>
            <?php echo $block->getChildHtml("wyo_eln_layer_breadcrumb"); ?>
        </div>
    <?php endif; ?>
    </div>
</div>
<?php if ($uid == "mobile"): ?>
    <div class='uid-mobile-toolbar wyomind-bg-secondary'>
        <?php echo $block->getChildHtml("wyo_eln_layer_count_mobile"); ?>
        <button class="close action primary ">
            <i class="fas fa-times" style="float:left"></i>
            <span>Close</span>
        </button>
    </div>
    <div class="mobile-filter-open wyomind-bg-secondary">
        <?php $subBlock = $block->getChildBlock("wyo_eln_layer_count_mobile"); ?>
        <?php $subBlock->setData('type','open-filters'); ?>
        <?= $subBlock->toHtml(); ?>
    </div>
<?php endif; ?>

