import * as i0 from '@angular/core';
import { inject, ViewEncapsulation, ChangeDetectionStrategy, Component, EventEmitter, ChangeDetectorRef, ElementRef, booleanAttribute, Output, Input, HostBinding, NgModule } from '@angular/core';
import { takeUntil, distinctUntilKeyChanged, map } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { TranslateService } from '@ngx-translate/core';
import { EuiEuLanguages, EuiAppShellService } from '@eui/core';
import { DIALOG_COMPONENT_CONFIG, EuiDialogService, EuiDialogConfig } from '@eui/components/eui-dialog';
import * as i1 from '@eui/components/eui-button';
import { EUI_BUTTON } from '@eui/components/eui-button';
import * as i2 from '@eui/components/eui-icon';
import { EUI_ICON } from '@eui/components/eui-icon';
import * as i1$1 from '@eui/components/eui-dropdown';
import { EUI_DROPDOWN } from '@eui/components/eui-dropdown';
import { AsyncPipe, NgTemplateOutlet } from '@angular/common';

/**
 * Modal component for language selection.
 * Displays EU and non-EU languages in a grid layout with 4 languages per row.
 */
class EuiModalSelectorComponent {
    constructor() {
        /**
         * Configuration injected from the dialog service
         */
        this.config = inject(DIALOG_COMPONENT_CONFIG, { optional: true });
        /** EU languages organized in rows of up to 4 languages */
        this.languageRows = [];
        /**
         * Non-EU languages organized in rows of up to 4 languages
         * @deprecated use {@link additionalLanguageRows}
         */
        this.additionaLanguageRows = [];
        /** Non-EU languages organized in rows of up to 4 languages */
        this.additionalLanguageRows = [];
        /** Dialog service for handling modal operations */
        this.euiDialogService = inject(EuiDialogService);
    }
    /**
     * Initializes language rows by separating EU and non-EU languages
     */
    ngOnInit() {
        this.languageRows = this.prepareLanguageRows(EuiEuLanguages.filterEULanguages(this.config?.languages));
        this.additionalLanguageRows = this.prepareLanguageRows(EuiEuLanguages.filterNonEULanguages(this.config?.languages));
        this.additionaLanguageRows = this.additionalLanguageRows;
    }
    /**
     * Handles language selection
     * @param {EuiLanguage} languageCode - The language being selected
     */
    selectLanguage(languageCode) {
        if (this.selectedLanguage?.code !== languageCode.code) {
            for (const language of this.config?.languages || []) {
                if (language.code === languageCode.code) {
                    this.selectedLanguage = language;
                    break;
                }
            }
        }
        this.config?.languageChanged(languageCode);
        this.euiDialogService.closeDialog();
    }
    /**
     * Organizes languages into rows of up to 4 languages each
     * @param {EuiLanguage[]} languages - Array of languages to organize
     * @returns {EuiLanguage[][]} 2D array of languages organized in rows
     */
    prepareLanguageRows(languages) {
        // If no languages, return an empty array
        if (!languages.length)
            return [];
        return languages.reduce((rows, language, index) => {
            // Calculate current row index
            const rowIndex = Math.floor(index / 4);
            // If we need to create a new row
            if (!rows[rowIndex]) {
                rows[rowIndex] = [];
            }
            // Add language to the current row
            rows[rowIndex].push(language);
            return rows;
        }, []);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiModalSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiModalSelectorComponent, isStandalone: true, selector: "eui-modal-selector", ngImport: i0, template: "@if (additionalLanguageRows?.length > 0) {\n    <h4>EU official languages</h4>\n}\n@for (row of languageRows; track row) {\n    <div id=\"eu_languages\" class=\"row\">\n        @for (language of row; track language) {\n            <div class=\"col-md-6 mb-2\">\n                <div class=\"eui-u-flex eui-u-mb-xs\">\n                    <span class=\"eui-u-text-uppercase eui-u-width-2\">{{language.code}}</span>\n                    <button\n                        type=\"button\"\n                        e2eAttr=\"eui-language-selector-item_{{ language.code }}\"\n                        euiButton\n                        euiPrimary\n                        [euiBasicButton]=\"language.code !== config?.selectedLanguage.code\"\n                        (click)=\"selectLanguage(language)\">\n                        {{ language.label }}\n                    </button>\n                </div>\n            </div>\n        }\n    </div>\n}\n@if (additionalLanguageRows?.length > 0) {\n    <br />\n    <h4>Non-EU Languages</h4>\n    @for (row of additionalLanguageRows; track row) {\n        <div id=\"extra_languages\" class=\"row\">\n            @for (language of row; track language) {\n                <div class=\"col-md-6 mb-2\">\n                    <div class=\"eui-u-flex eui-u-mb-xs\">\n                        <span class=\"eui-u-text-uppercase eui-u-width-2\">{{language.code}}</span>\n                        <button\n                            type=\"button\"\n                            e2eAttr=\"eui-language-selector-item_{{ language.code }}\"\n                            euiButton\n                            euiPrimary\n                            [euiBasicButton]=\"language.code !== config?.selectedLanguage.code\"\n                            (click)=\"selectLanguage(language)\">\n                            {{ language.label }}\n                        </button>\n                    </div>\n                </div>\n            }\n        </div>\n    }\n}\n", dependencies: [{ kind: "component", type: i1.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiCTAButton", "euiBlockButton", "euiIconButton", "euiAvatarButton", "euiLineWrap", "isCompact", "hasNoFocusRing", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiModalSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-modal-selector', changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, imports: [
                        ...EUI_BUTTON,
                    ], template: "@if (additionalLanguageRows?.length > 0) {\n    <h4>EU official languages</h4>\n}\n@for (row of languageRows; track row) {\n    <div id=\"eu_languages\" class=\"row\">\n        @for (language of row; track language) {\n            <div class=\"col-md-6 mb-2\">\n                <div class=\"eui-u-flex eui-u-mb-xs\">\n                    <span class=\"eui-u-text-uppercase eui-u-width-2\">{{language.code}}</span>\n                    <button\n                        type=\"button\"\n                        e2eAttr=\"eui-language-selector-item_{{ language.code }}\"\n                        euiButton\n                        euiPrimary\n                        [euiBasicButton]=\"language.code !== config?.selectedLanguage.code\"\n                        (click)=\"selectLanguage(language)\">\n                        {{ language.label }}\n                    </button>\n                </div>\n            </div>\n        }\n    </div>\n}\n@if (additionalLanguageRows?.length > 0) {\n    <br />\n    <h4>Non-EU Languages</h4>\n    @for (row of additionalLanguageRows; track row) {\n        <div id=\"extra_languages\" class=\"row\">\n            @for (language of row; track language) {\n                <div class=\"col-md-6 mb-2\">\n                    <div class=\"eui-u-flex eui-u-mb-xs\">\n                        <span class=\"eui-u-text-uppercase eui-u-width-2\">{{language.code}}</span>\n                        <button\n                            type=\"button\"\n                            e2eAttr=\"eui-language-selector-item_{{ language.code }}\"\n                            euiButton\n                            euiPrimary\n                            [euiBasicButton]=\"language.code !== config?.selectedLanguage.code\"\n                            (click)=\"selectLanguage(language)\">\n                            {{ language.label }}\n                        </button>\n                    </div>\n                </div>\n            }\n        </div>\n    }\n}\n" }]
        }] });

/**
 * @description A component that provides language selection functionality for applications.
 *
 * This component displays available languages and allows users to select their preferred language.
 * It adapts its display based on the number of available languages:
 * - For 1 language: No selector is shown
 * - For 2-3 languages: Displays a dropdown menu
 * - For 4+ languages: Opens a modal dialog with the full list
 *
 * The component integrates with EuiAppShellService to manage language state
 * and uses TranslateService for localization.
 */
class EuiLanguageSelectorComponent {
    constructor() {
        /**
         * @property hasLanguageSelection - Enables/disables language selection functionality.
         * @default true
         */
        this.hasLanguageSelection = true;
        /**
         * @property isToolbarSelector - When true, applies styling for toolbar integration.
         * @default false
         */
        this.isToolbarSelector = false;
        /**
         * @property euiPrimary - When true, applies primary styling.
         * @default false
         */
        this.euiPrimary = false;
        /**
         * @event languageSelectorClick - Emitted when the language selector is clicked.
         */
        this.languageSelectorClick = new EventEmitter();
        this.appShellService = inject(EuiAppShellService);
        this.destroy$ = new Subject();
        this.isAriaLabelChanged = false;
        this.cd = inject(ChangeDetectorRef);
        this.euiDialogService = inject(EuiDialogService);
        this.translateService = inject(TranslateService);
        this.elRef = inject(ElementRef);
    }
    get cssClasses() {
        return [
            'eui-language-selector',
            this.languages?.length <= 1 ? 'eui-language-selector--empty' : '',
            this.isToolbarSelector ? 'eui-language-selector--toolbar-selector' : '',
        ]
            .join(' ')
            .trim();
    }
    /**
     * returns true if there are at least one and max four languages.
     */
    get isShowDropDown() {
        return this.languages?.length > 1 && this.languages?.length < 4;
    }
    /**
     * returns true if there are at least five languages.
     */
    get isShowModal() {
        return this.languages?.length >= 4;
    }
    ngOnChanges(changes) {
        if (changes && changes['ariaLabel']) {
            this.isAriaLabelChanged = true;
            this.ariaLabel = changes['ariaLabel'].currentValue;
        }
    }
    ngOnInit() {
        // update languages array based on AppShell State 'language' changes
        this.appShellService.state$
            .pipe(takeUntil(this.destroy$), distinctUntilKeyChanged('languages'), map((state) => state.languages))
            .subscribe((languages) => {
            this.languages = languages ? EuiEuLanguages.getOrderedLanguages(languages) : EuiEuLanguages.getLanguages();
            this.cd.detectChanges();
        });
        // update activeLanguage array based on AppShell State 'language' changes
        this.appShellService.state$
            .pipe(takeUntil(this.destroy$), distinctUntilKeyChanged('activeLanguage'), map((state) => state?.activeLanguage))
            .subscribe((activeLanguage) => {
            this.selectedLanguage = this.getLanguage(activeLanguage);
            if (!this.isAriaLabelChanged) {
                this.ariaLabel = `Change Language - Current Language: ${this.selectedLanguage.label}`;
            }
            this.cd.detectChanges();
        });
    }
    ngAfterViewInit() {
        // TODO: Using DI like "inject(EuiToolbarComponent, {optional: true, skipSelf: true})" would create
        //  circular dependencies. Better approaches would be:
        //  1. Parent component provides the isToolbarSelector input
        //  2. Apply the eui-language-selector--toolbar-selector class directly
        let hasToolbarParent = false;
        try {
            hasToolbarParent = this.elRef.nativeElement.closest('eui-toolbar');
        }
        catch (e) {
            // do nothing
        }
        if (hasToolbarParent) {
            setTimeout(() => {
                this.isToolbarSelector = true;
            }, 1);
        }
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
    }
    /**
     * Updates the active language in the application.
     * @param language - The language object to set as active.
     */
    onLanguageChanged(language) {
        // Update the AppShellService state
        this.appShellService.setState({
            ...this.appShellService.state,
            activeLanguage: language.code,
        });
    }
    /**
     * Opens a modal dialog with the full list of available languages.
     * @param [titleLabel] - Optional custom title for the modal.
     */
    onOpen(titleLabel = this.translateService.instant('eui.languageSelector.modalTitle')) {
        this.euiDialogService.openDialog(new EuiDialogConfig({
            title: titleLabel,
            hasFooter: false,
            hasClosedOnClickOutside: true,
            bodyComponent: {
                component: EuiModalSelectorComponent,
                config: {
                    languages: this.languages,
                    selectedLanguage: this.selectedLanguage,
                    languageChanged: (language) => this.onLanguageChanged(language),
                },
            },
        }));
    }
    onClick() {
        this.languageSelectorClick.emit();
    }
    /**
     * Retrieves a language object by its code.
     *
     * @param languageCode - Two-character language code.
     */
    getLanguage(languageCode) {
        return this.languages.find((lang) => lang.code === languageCode);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiLanguageSelectorComponent, isStandalone: true, selector: "eui-language-selector", inputs: { hasLanguageSelection: ["hasLanguageSelection", "hasLanguageSelection", booleanAttribute], isToolbarSelector: ["isToolbarSelector", "isToolbarSelector", booleanAttribute], euiPrimary: ["euiPrimary", "euiPrimary", booleanAttribute], ariaLabel: ["aria-label", "ariaLabel"] }, outputs: { languageSelectorClick: "languageSelectorClick" }, host: { properties: { "class": "this.cssClasses" } }, providers: [
            EuiDialogService,
        ], usesOnChanges: true, ngImport: i0, template: "@if (!hasLanguageSelection) {\n    <button class=\"eui-language-selector__button\"\n        euiButton\n        euiBasicButton\n        [euiBranding]=\"isToolbarSelector\"\n        (click)=\"onClick()\"\n        [attr.aria-label]=\"ariaLabel\">\n        <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n        <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async).activeLanguage }}</span>\n    </button>\n\n} @else if (hasLanguageSelection && isShowDropDown) {\n    <eui-dropdown>\n        <button class=\"eui-language-selector__button\"\n            [attr.aria-label]=\"ariaLabel\"\n            euiButton\n            euiBasicButton\n            [euiBranding]=\"isToolbarSelector\">\n            <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n            <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async).activeLanguage }}</span>\n        </button>\n\n        <eui-dropdown-content>\n            <div class=\"eui-language-selector-menu\">\n                @for (language of languages; track language) {\n                    <button\n                        euiDropdownItem\n                        attr.data-e2e=\"eui-language-selector-item_{{ language.code }}\"\n                        class=\"eui-language-selector-menu-language-item\"\n                        (click)=\"onLanguageChanged(language)\">\n                        {{ language.label }} ({{ language.code }})\n                    </button>\n                }\n            </div>\n        </eui-dropdown-content>\n    </eui-dropdown>\n\n} @else if (hasLanguageSelection && isShowModal) {\n    <button class=\"eui-language-selector__button\"\n        euiButton euiBasicButton\n        (click)=\"onOpen()\"\n        [attr.aria-label]=\"ariaLabel\"\n        [euiBranding]=\"isToolbarSelector\">\n        <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n        <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async)?.activeLanguage }}</span>\n    </button>\n}\n\n<ng-template #languageSelectorIcon>\n    <eui-icon-svg icon=\"eui-ecl-global\" />\n</ng-template>\n", styles: [".eui-19 .eui-language-selector{align-items:center;cursor:pointer;display:flex;position:relative}.eui-19 .eui-language-selector__button{padding-left:var(--eui-s-s);padding-right:var(--eui-s-s)}.eui-19 .eui-language-selector__code{text-transform:uppercase}.eui-19 .eui-language-selector-menu-language-item{padding:var(--eui-s-m);border-bottom:1px solid var(--eui-c-divider);text-align:center;cursor:pointer}.eui-19 .eui-language-selector-menu-language-item:hover{background:var(--eui-c-hover)}.eui-19 .eui-language-selector--empty{display:none}.eui-19.eui-t-dark .eui-language-selector__button{--_basic-color: var(--eui-c-black)}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i1$1.EuiDropdownComponent, selector: "eui-dropdown", inputs: ["e2eAttr", "tabIndex", "width", "height", "position", "subDropdownPosition", "isBlock", "isDropDownRightAligned", "hasClosedOnClickInside", "isLabelUpdatedFromSelectedItem", "isExpandOnHover", "hasTabNavigation", "isRightClickEnabled", "euiDisabled"], outputs: ["expand", "isDropdownOpen"] }, { kind: "component", type: i1$1.EuiDropdownItemComponent, selector: "eui-dropdown-item, [euiDropdownItem]", inputs: ["subDropdown", "isActive", "isFocus"] }, { kind: "directive", type: i1$1.EuiDropdownContentDirective, selector: "eui-dropdown-content" }, { kind: "component", type: i2.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i1.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiCTAButton", "euiBlockButton", "euiIconButton", "euiAvatarButton", "euiLineWrap", "isCompact", "hasNoFocusRing", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-language-selector', encapsulation: ViewEncapsulation.None, imports: [
                        AsyncPipe,
                        NgTemplateOutlet,
                        ...EUI_DROPDOWN,
                        ...EUI_ICON,
                        ...EUI_BUTTON,
                    ], providers: [
                        EuiDialogService,
                    ], template: "@if (!hasLanguageSelection) {\n    <button class=\"eui-language-selector__button\"\n        euiButton\n        euiBasicButton\n        [euiBranding]=\"isToolbarSelector\"\n        (click)=\"onClick()\"\n        [attr.aria-label]=\"ariaLabel\">\n        <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n        <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async).activeLanguage }}</span>\n    </button>\n\n} @else if (hasLanguageSelection && isShowDropDown) {\n    <eui-dropdown>\n        <button class=\"eui-language-selector__button\"\n            [attr.aria-label]=\"ariaLabel\"\n            euiButton\n            euiBasicButton\n            [euiBranding]=\"isToolbarSelector\">\n            <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n            <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async).activeLanguage }}</span>\n        </button>\n\n        <eui-dropdown-content>\n            <div class=\"eui-language-selector-menu\">\n                @for (language of languages; track language) {\n                    <button\n                        euiDropdownItem\n                        attr.data-e2e=\"eui-language-selector-item_{{ language.code }}\"\n                        class=\"eui-language-selector-menu-language-item\"\n                        (click)=\"onLanguageChanged(language)\">\n                        {{ language.label }} ({{ language.code }})\n                    </button>\n                }\n            </div>\n        </eui-dropdown-content>\n    </eui-dropdown>\n\n} @else if (hasLanguageSelection && isShowModal) {\n    <button class=\"eui-language-selector__button\"\n        euiButton euiBasicButton\n        (click)=\"onOpen()\"\n        [attr.aria-label]=\"ariaLabel\"\n        [euiBranding]=\"isToolbarSelector\">\n        <ng-template *ngTemplateOutlet=\"languageSelectorIcon\"></ng-template>\n        <span class=\"eui-language-selector__code\">{{ (appShellService.state$ | async)?.activeLanguage }}</span>\n    </button>\n}\n\n<ng-template #languageSelectorIcon>\n    <eui-icon-svg icon=\"eui-ecl-global\" />\n</ng-template>\n", styles: [".eui-19 .eui-language-selector{align-items:center;cursor:pointer;display:flex;position:relative}.eui-19 .eui-language-selector__button{padding-left:var(--eui-s-s);padding-right:var(--eui-s-s)}.eui-19 .eui-language-selector__code{text-transform:uppercase}.eui-19 .eui-language-selector-menu-language-item{padding:var(--eui-s-m);border-bottom:1px solid var(--eui-c-divider);text-align:center;cursor:pointer}.eui-19 .eui-language-selector-menu-language-item:hover{background:var(--eui-c-hover)}.eui-19 .eui-language-selector--empty{display:none}.eui-19.eui-t-dark .eui-language-selector__button{--_basic-color: var(--eui-c-black)}\n"] }]
        }], propDecorators: { cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], hasLanguageSelection: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isToolbarSelector: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], euiPrimary: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], ariaLabel: [{
                type: Input,
                args: ['aria-label']
            }], languageSelectorClick: [{
                type: Output
            }] } });

/**
 * @description
 * Module that declares and exports the EuiLanguageSelectorComponent.
 *
 * @deprecated Use {@link EUI_LANGUAGE_SELECTOR} instead
 */
class EuiLanguageSelectorModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorModule, imports: [EuiLanguageSelectorComponent, EuiModalSelectorComponent], exports: [EuiLanguageSelectorComponent, EuiModalSelectorComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorModule, imports: [EuiLanguageSelectorComponent, EuiModalSelectorComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiLanguageSelectorModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiLanguageSelectorComponent, EuiModalSelectorComponent],
                    exports: [EuiLanguageSelectorComponent, EuiModalSelectorComponent],
                }]
        }] });

const EUI_LANGUAGE_SELECTOR = [
    EuiLanguageSelectorComponent,
    EuiModalSelectorComponent,
];

/**
 * Generated bundle index. Do not edit.
 */

export { EUI_LANGUAGE_SELECTOR, EuiLanguageSelectorComponent, EuiLanguageSelectorModule, EuiModalSelectorComponent };
//# sourceMappingURL=eui-components-eui-language-selector.mjs.map
