'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const __chunk_1 = require('./chunk-91f43df3.js');
const __chunk_7 = require('./chunk-156a604f.js');

/**
 * @internal
 */
class SelectPopover {
    constructor(hostRef) {
        __chunk_1.registerInstance(this, hostRef);
        /** Array of options for the popover */
        this.options = [];
    }
    onSelect(ev) {
        const option = this.options.find(o => o.value === ev.target.value);
        if (option) {
            __chunk_7.safeCall(option.handler);
        }
    }
    hostData() {
        const mode = __chunk_1.getIonMode(this);
        return {
            class: {
                [mode]: true,
            }
        };
    }
    __stencil_render() {
        return (__chunk_1.h("ion-list", null, this.header !== undefined && __chunk_1.h("ion-list-header", null, this.header), (this.subHeader !== undefined || this.message !== undefined) &&
            __chunk_1.h("ion-item", null, __chunk_1.h("ion-label", { "text-wrap": true }, this.subHeader !== undefined && __chunk_1.h("h3", null, this.subHeader), this.message !== undefined && __chunk_1.h("p", null, this.message))), __chunk_1.h("ion-radio-group", null, this.options.map(option => __chunk_1.h("ion-item", null, __chunk_1.h("ion-label", null, option.text), __chunk_1.h("ion-radio", { checked: option.checked, value: option.value, disabled: option.disabled }))))));
    }
    render() { return __chunk_1.h(__chunk_1.Host, this.hostData(), this.__stencil_render()); }
    static get style() { return ".sc-ion-select-popover-h ion-list.sc-ion-select-popover{margin-left:0;margin-right:0;margin-top:-1px;margin-bottom:-1px}.sc-ion-select-popover-h ion-label.sc-ion-select-popover, .sc-ion-select-popover-h ion-list-header.sc-ion-select-popover{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}"; }
}

exports.ion_select_popover = SelectPopover;
