"use strict";
var __webpack_require__ = {};
(()=>{
    __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__, {
    renderColorFacetCheckbox: ()=>renderColorFacetCheckbox
});
const external_lit_namespaceObject = require("lit");
const keyed_js_namespaceObject = require("lit/directives/keyed.js");
const ref_js_namespaceObject = require("lit/directives/ref.js");
const ripple_utils_cjs_namespaceObject = require("../../../../utils/ripple-utils.cjs");
const utils_cjs_namespaceObject = require("../../../../utils/utils.cjs");
const renderColorFacetCheckbox = ({ props })=>(children)=>{
        const id = (0, utils_cjs_namespaceObject.randomID)('facet-value-');
        const count = props.numberOfResults.toLocaleString(props.i18n.language);
        const ariaLabel = props.i18n.t('facet-value', {
            value: props.displayValue,
            count: props.numberOfResults,
            formattedCount: count
        });
        const partValue = props.displayValue.match(/-?[_a-zA-Z]+[_a-zA-Z0-9-]*/)?.toString();
        let labelRef;
        return (0, external_lit_namespaceObject.html)`
      ${(0, keyed_js_namespaceObject.keyed)(props.displayValue, (0, external_lit_namespaceObject.html)`<li class="relative flex items-center">
          <button
            id=${id}
            role="checkbox"
            part=${`value-checkbox value-${partValue}${props.isSelected ? ' value-checkbox-checked' : ''}`}
            @click=${()=>props.onClick()}
            @mousedown=${(e)=>(0, ripple_utils_cjs_namespaceObject.createRipple)(e, {
                color: 'neutral',
                parent: labelRef
            })}
            aria-checked=${getAriaCheckedValue(props.isSelected)}
            class=${`value-checkbox ${props.isSelected ? 'ring-primary' : ''}`}
            aria-label=${ariaLabel}
          ></button>
          <label
            ${(0, ref_js_namespaceObject.ref)((ref)=>{
            labelRef = ref;
        })}
            .htmlFor=${id}
            part="value-checkbox-label"
            @mousedown=${(e)=>(0, ripple_utils_cjs_namespaceObject.createRipple)(e, {
                color: 'neutral'
            })}
          >
            ${children}
            <span part="value-count" class="value-count">
              ${props.i18n.t('between-parentheses', {
            text: count
        })}
            </span>
          </label>
        </li>`)}
    `;
    };
const getAriaCheckedValue = (isSelected)=>isSelected ? 'true' : 'false';
exports.renderColorFacetCheckbox = __webpack_exports__.renderColorFacetCheckbox;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderColorFacetCheckbox"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
