"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__, {
    renderFacetSegmentedValue: ()=>renderFacetSegmentedValue
});
const external_lit_namespaceObject = require("lit");
const keyed_js_namespaceObject = require("lit/directives/keyed.js");
const button_cjs_namespaceObject = require("../../../common/button.cjs");
const multi_class_map_cjs_namespaceObject = require("../../../../directives/multi-class-map.cjs");
const renderFacetSegmentedValue = ({ props })=>{
    const compactCount = new Intl.NumberFormat(props.i18n.language, {
        notation: 'compact'
    }).format(props.numberOfResults);
    const count = props.numberOfResults.toLocaleString(props.i18n.language);
    const ariaLabel = props.i18n.t('facet-value', {
        value: props.displayValue,
        count: props.numberOfResults,
        formattedCount: compactCount
    });
    const labelClasses = (0, multi_class_map_cjs_namespaceObject.tw)({
        'value-label truncate': true,
        'text-primary': props.isSelected,
        'group-hover:text-primary-light group-focus:text-primary': !props.isSelected
    });
    const countClasses = (0, multi_class_map_cjs_namespaceObject.tw)({
        'value-box-count mt-0 w-auto truncate pl-1 text-sm': true,
        'text-primary': props.isSelected,
        'text-neutral-dark group-hover:text-primary-light group-focus:text-primary': !props.isSelected
    });
    const buttonClasses = (0, multi_class_map_cjs_namespaceObject.tw)({
        'value-box group box-border flex h-full items-center p-2': true,
        'selected border-primary shadow-inner-primary': props.isSelected,
        'hover:border-primary-light focus-visible:border-primary-light': !props.isSelected
    });
    const buttonClassString = Object.entries(buttonClasses).filter(([, value])=>value).map(([key])=>key).join(' ');
    return (0, external_lit_namespaceObject.html)`
    ${(0, keyed_js_namespaceObject.keyed)(props.displayValue, (0, external_lit_namespaceObject.html)`<li>
        ${(0, button_cjs_namespaceObject.renderButton)({
        props: {
            style: 'square-neutral',
            part: `value-box${props.isSelected ? ' value-box-selected' : ''}`,
            onClick: ()=>props.onClick(),
            class: buttonClassString,
            ariaPressed: props.isSelected ? 'true' : 'false',
            ariaLabel,
            ref: props.buttonRef
        }
    })((0, external_lit_namespaceObject.html)`<span
              title=${props.displayValue}
              part="value-label"
              class=${(0, multi_class_map_cjs_namespaceObject.multiClassMap)(labelClasses)}
            >
              ${props.displayValue}
            </span>
            <span
              title=${count}
              part="value-count"
              class=${(0, multi_class_map_cjs_namespaceObject.multiClassMap)(countClasses)}
            >
              ${props.i18n.t('between-parentheses', {
        text: compactCount
    })}
            </span>`)}
      </li>`)}
  `;
};
exports.renderFacetSegmentedValue = __webpack_exports__.renderFacetSegmentedValue;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "renderFacetSegmentedValue"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
