"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/**
 * penguins-eggs
 * lib: select_keyboard_variant.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 */
const inquirer = require('inquirer');
const keyboards_1 = tslib_1.__importDefault(require("../classes/keyboards"));
/**
  *
  */
async function selectKeyboardVariant(keyboardLayout = '') {
    const keyboards = new keyboards_1.default();
    const variants = keyboards.getVariants(keyboardLayout);
    const supported = [];
    supported.push(''); // inserisce una variant nulla
    for (const v of variants) {
        supported.push(v.code);
    }
    const questions = [
        {
            type: 'list',
            name: 'variant',
            message: 'Select variant: ',
            choices: supported,
            default: '',
        },
    ];
    return new Promise(function (resolve) {
        inquirer.prompt(questions).then(function (options) {
            resolve(options.variant);
        });
    });
}
exports.default = selectKeyboardVariant;
