"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    renderRefineModal: ()=>renderRefineModal
});
const external_lit_namespaceObject = require("lit");
const localized_string_cjs_namespaceObject = require("../../../directives/localized-string.cjs");
const close_cjs_namespaceObject = require("../../../images/close.cjs");
var close_cjs_default = /*#__PURE__*/ __webpack_require__.n(close_cjs_namespaceObject);
const export_parts_cjs_namespaceObject = require("../atomic-modal/export-parts.cjs");
require("../atomic-modal/atomic-modal.cjs");
const external_button_cjs_namespaceObject = require("../button.cjs");
require("../atomic-icon/atomic-icon.cjs");
const renderRefineModal = ({ props })=>(children)=>{
        const flushFacetElements = ()=>{
            props.host.querySelector('div[slot="facets"]')?.remove();
        };
        const renderHeader = ()=>(0, external_lit_namespaceObject.html)`
        <div slot="header" class="contents">
          <h1 part="title" class="truncate">${props.title}</h1>
          ${(0, external_button_cjs_namespaceObject.renderButton)({
                props: {
                    style: 'text-transparent',
                    class: 'grid place-items-center',
                    part: 'close-button',
                    onClick: props.onClose,
                    ariaLabel: props.i18n.t('close')
                }
            })((0, external_lit_namespaceObject.html)`<atomic-icon
              part="close-icon"
              class="h-5 w-5"
              icon=${close_cjs_default()}
            ></atomic-icon>`)}
        </div>
      `;
        const renderFooter = ()=>(0, external_lit_namespaceObject.html)`
        <div part="footer-content" slot="footer">
          ${(0, external_button_cjs_namespaceObject.renderButton)({
                props: {
                    style: 'primary',
                    part: 'footer-button',
                    class: 'flex w-full justify-center p-3 text-lg',
                    onClick: props.onClose
                }
            })((0, external_lit_namespaceObject.html)`
            <span part="footer-button-text" class="mr-1 truncate">
              ${props.i18n.t(props.i18nFooterButtonTextKey)}
            </span>
            <span part="footer-button-count">
              ${(0, localized_string_cjs_namespaceObject.localizedString)({
                i18n: props.i18n,
                key: 'between-parentheses',
                params: {
                    text: props.numberOfItems.toLocaleString(props.i18n.language)
                }
            })}
            </span>
          `)}
        </div>
      `;
        return (0, external_lit_namespaceObject.html)`
      <atomic-modal
        .fullscreen=${true}
        .isOpen=${props.isOpen}
        .source=${props.openButton}
        .container=${props.host}
        .close=${props.onClose}
        .onAnimationEnded=${()=>{
            if (!props.isOpen) flushFacetElements();
        }}
        exportparts=${export_parts_cjs_namespaceObject.ATOMIC_MODAL_EXPORT_PARTS}
        .boundary=${props.boundary ?? 'page'}
        .scope=${props.scope}
      >
        ${renderHeader()} ${children} ${renderFooter()}
      </atomic-modal>
    `;
    };
exports.renderRefineModal = __webpack_exports__.renderRefineModal;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderRefineModal"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
