<?xml version="1.0"?>
<t name="Collapse Category Recursive" t-name="website_sale.option_collapse_categories_recursive">
        <t t-set="children" t-value="not search and c.child_id or c.child_id.filtered(lambda c: c.id in search_categories_ids)"/>
        <t t-set="children" t-value="request.env.user._is_internal() and children or children.filtered('has_published_products')"/>

        <t t-if="children">
            <t t-set="isOpen" t-value="c.id in category.parents_and_self.ids"/>

            <li class="nav-item" t-att-data-publish="c.has_published_products and 'on' or 'off'">
                <div class="accordion-header d-flex mb-1">
                    <t t-call="website_sale.categorie_link"/>
                    <button t-attf-id="o_wsale_cat_accordion_title_{{c.id}}" t-attf-class="o_categories_recursive_button accordion-button p-0 ms-3 {{not isOpen and 'collapsed'}} w-auto flex-grow-1 bg-transparent shadow-none" t-attf-data-bs-target="#o_wsale_cat_accordion_{{c.id}}" t-att-aria-expanded="isOpen and 'true' or 'false'" t-attf-aria-controls="o_wsale_cat_accordion_{{c.id}}" data-bs-toggle="collapse" type="button"/>
                </div>
                <ul t-attf-id="o_wsale_cat_accordion_{{c.id}}" t-attf-class="accordion-collapse list-unstyled ps-2 collapse {{isOpen and 'show'}}" t-attf-aria-labelledby="o_wsale_cat_accordion_title_{{c.id}}">
                    <t t-set="parentCategoryId" t-value="c.id"/>
                    <t t-if="isOffcanvas" t-set="parentCategoryId" t-valuef="offcanvas_{{c.id}}"/>

                    <t t-foreach="children" t-as="c">
                        <t t-call="website_sale.option_collapse_categories_recursive"/>
                    </t>
                </ul>
            </li>
        </t>

        <li t-else="" class="nav-item mb-1" t-att-data-publish="c.has_published_products and 'on' or 'off'">
            <t t-if="isOffcanvas" t-set="parentCategoryId" t-valuef="offcanvas"/>
            <div class="d-flex flex-wrap justify-content-between align-items-center">
                <t t-call="website_sale.categorie_link"/>
            </div>
        </li>
    </t>

    