"use strict";
// -*- mode: typescript; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of Genie
//
// Copyright 2020 The Board of Trustees of the Leland Stanford Junior University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Giovanni Campagna <gcampagn@cs.stanford.edu>
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const C = __importStar(require("../../ast_manip"));
const D = __importStar(require("../../dialogue_acts"));
async function default_1($runtime, $ttUtils, $options, $locale, $grammar, $loader) {
    $grammar.declareSymbol("system_list_proposal");
    if (!$options.flags.inference) {
        $grammar.addRule("system_list_proposal", [new $runtime.Choice(["i see", "i have", "i have found"]), new $runtime.NonTerminal("result_name_list", undefined), ".", new $runtime.Choice(["", "would you like to learn more ?", "would you like to learn more about either of them ?", "would you like to know more about them ?", "would you like to hear more about them ?", "are you interested to hear more about any of them ?"])], (($0, name_list, $1, $2) => D.checkListProposal(name_list, null, true)), D.listProposalKeyFn, {});
    }
    if ($options.flags.inference) {
        $grammar.addRule("system_list_proposal", [new $runtime.Choice(["i see", "i have", "i have found"]), new $runtime.NonTerminal("result_name_list", undefined), "."], (($0, name_list, $1) => D.checkListProposal(name_list, null, true)), D.listProposalKeyFn, {});
    }
    $grammar.addRule("system_list_proposal", [new $runtime.Choice(["i see", "i have", "i have found"]), new $runtime.NonTerminal("result_name_list", undefined), ".", new $runtime.Choice(["they", "all of them"]), "are", new $runtime.NonTerminal("result_info_phrase", undefined), "."], (($0, name_list, $1, $2, $3, res, $4) => D.checkListProposal(name_list, res.info, true)), D.listProposalKeyFn, { priority: (2) });
    $grammar.addRule("system_list_proposal", [new $runtime.Choice(["i see", "i have", "i have found"]), new $runtime.NonTerminal("result_name_list", undefined), ".", "both are", new $runtime.NonTerminal("result_info_phrase", undefined), "."], (($0, name_list, $1, $2, res, $3) => {
        if (name_list.results.length !== 2)
            return null;
        return D.checkListProposal(name_list, res.info, true);
    }), D.listProposalKeyFn, {});
    if (!$options.flags.inference) {
        $grammar.addRule("system_list_proposal", [new $runtime.Choice(["i see", "i have", "i have found"]), new $runtime.NonTerminal("result_name_list", undefined), ".", new $runtime.NonTerminal("action_coref_list_proposal", undefined)], (($0, name_list, $1, action) => D.addActionToListProposal(name_list, action)), D.listProposalKeyFn, { priority: (-1) });
    }
    $grammar.declareSymbol("generic_list_proposal_accept_phrase");
    $grammar.addRule("generic_list_proposal_accept_phrase", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.Choice(["i like", "i am interested in", "i am intrigued by"]), new $runtime.NonTerminal("constant_name", undefined), "."], (($0, $1, name, $2) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.addRule("generic_list_proposal_accept_phrase", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.NonTerminal("constant_name", undefined), "sounds", new $runtime.Choice(["good", "really good", "nice", "interesting"]), "."], (($0, name, $1, $2, $3) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.declareSymbol("list_proposal_accept_phrase_must_have_action");
    $grammar.addRule("list_proposal_accept_phrase_must_have_action", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.Choice(["i will go", "i will take", "i am good for"]), new $runtime.NonTerminal("constant_name", undefined), "."], (($0, $1, name, $2) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.declareSymbol("list_proposal_accept_phrase_with_action");
    $grammar.addRule("list_proposal_accept_phrase_with_action", [new $runtime.NonTerminal("generic_list_proposal_accept_phrase", undefined), new $runtime.NonTerminal("generic_preamble_for_action", undefined), new $runtime.NonTerminal("coref_action_command", undefined)], ((name, $0, action) => [name, action, false]), undefined, {});
    $grammar.addRule("list_proposal_accept_phrase_with_action", [new $runtime.NonTerminal("list_proposal_accept_phrase_must_have_action", undefined), new $runtime.NonTerminal("generic_preamble_for_action", undefined), new $runtime.NonTerminal("coref_action_command", undefined)], ((name, $0, action) => [name, action, false]), undefined, {});
    $grammar.declareSymbol("list_proposal_accept_phrase_with_action_by_name");
    $grammar.addRule("list_proposal_accept_phrase_with_action_by_name", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.NonTerminal("generic_preamble_for_action", undefined), new $runtime.NonTerminal("action_by_name_command", undefined)], (($0, $1, action) => action), C.invocationKeyFn, {});
    $grammar.declareSymbol("list_proposal_tell_me_more");
    $grammar.addRule("list_proposal_tell_me_more", [new $runtime.Choice(["ok", "yeah", ""]), "can you tell me more about", new $runtime.NonTerminal("constant_name", undefined), "?"], (($0, $1, name, $2) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.addRule("list_proposal_tell_me_more", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.Choice(["i like", "i am interested in", "i am intrigued by"]), new $runtime.NonTerminal("constant_name", undefined), ".", new $runtime.NonTerminal("tell_me_more_phrase", undefined)], (($0, $1, name, $2, $3) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.addRule("list_proposal_tell_me_more", [new $runtime.Choice(["ok", "yeah", ""]), new $runtime.NonTerminal("constant_name", undefined), "sounds", new $runtime.Choice(["good", "really good", "nice", "interesting"]), ".", new $runtime.NonTerminal("tell_me_more_phrase", undefined)], (($0, name, $1, $2, $3, $4) => name), C.entityOrNumberValueKeyFn, {});
    $grammar.declareSymbol("positive_list_proposal_reply");
    $grammar.addRule("positive_list_proposal_reply", [new $runtime.NonTerminal("generic_list_proposal_accept_phrase", undefined)], ((name) => [name, null, false]), undefined, {});
    $grammar.addRule("positive_list_proposal_reply", [new $runtime.NonTerminal("list_proposal_accept_phrase_must_have_action", undefined)], ((name) => [name, null, true]), undefined, {});
    $grammar.addRule("positive_list_proposal_reply", [new $runtime.NonTerminal("list_proposal_accept_phrase_with_action", undefined)], ((accept) => accept), undefined, {});
}
exports.default = default_1;
;
//# sourceMappingURL=list-proposal.genie.js.map