{
    "Interactions Manual Configuration": {
        "prefix": "Interactions",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "import Amplify from 'aws-amplify';\n",
            "Amplify.configure({",
                "\tAuth: {",
                    "\t\tidentityPoolId: ${1:'us-east-1:xxx-xxx-xxx-xxx-xxx'},",
                    "\t\tregion: ${2:'us-east-1'}",
                "\t},",
                "\tInteractions: {",
                    "\t\tbots: {",
                        "\t\t\t${3:\"BookTripMOBILEHUB\"}: {",
                            "\t\t\t\t${4:\"name\": \"BookTripMOBILEHUB\"},",
                            "\t\t\t\t${5:\"alias\": \"$LATEST\"},",
                            "\t\t\t\t${6:\"region\": \"us-east-1\"},",
                        "\t\t\t},",
                    "\t\t}",
                "\t}",
            "});"
        ]
    },
    "handleComplete React": {
        "prefix": "handleComplete",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "handleComplete = function (err, confirmation) {",
                "\tif (err) {",
                    "\t\talert('bot conversation failed')",
                    "\t\treturn;",
                "\t}",
                "\talert('done: ' + JSON.stringify(confirmation, null, 2));\n",
                "\treturn ${1:'Trip booked. Thank you! What would you like to do next?'};",
            "}\n",
            "Interactions.onComplete(botName, handleComplete );"
        ]
    },
    "ChatBot React": {
        "prefix": "<Chatbot",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "<ChatBot",
            "\ttitle=${1:\"My Bot\"}",
            "\ttheme={${2:myTheme}}",
            "\tbotName=${3:\"BookTripMOBILEHUB\"}",
            "\twelcomeMessage=${4:\"Welcome, how can I help you today?\"}",
            "\tonComplete={${5:this.handleComplete.bind(this)}}",
            "\tclearonComplete={${6:true}}",
            "/>"
        ]
    },
    "ChatBot React Native": {
        "prefix": "<Chatbot",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "<ChatBot",
            "\tbotName={${1:botName}}",
            "\twelcomeMessage={${2:welcomeMessage}}",
            "\tonComplete={${3:this.handleComplete}}",
            "\tclearonComplete={${4:false}}",
            "\tstyles={Stylesheet.create({",
                "\t\titemMe: {",
                    "\t\t\tcolor: ${5:'red'}",
                "\t\t}",
            "\t})}",
            "/>"
        ]
    },
    "handleComplete React Native": {
        "prefix": "handleComplete",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "handleComplete(err, confirmation) {",
                "\tif (err) {",
                    "\t\tAlert.alert('Error','Bot conversation failed', [{ text: 'OK' }]);",
                    "\t\treturn;",
                "\t}",
                "\tAlert.alert('Done', JSON.stringify(confirmation, null, 2), [{ text: 'OK' }]);\n",
                "\tthis.setState({",
                "\tbotName: ${1:'BookTripMOBILEHUB'}",
                "\t});",
                "\treturn ${2:'Trip booked. Thank you! What would you like to do next?'};",
            "}\n",
            "render() {",
                "\tconst { botName, showChatBot, welcomeMessage } = this.state;\n",
                "\treturn (",
                "\t<SafeAreaView style={styles.container}>",
                "\t\t<ChatBot",
                "\t\t\tbotName={botName}",
                "\t\t\twelcomeMessage={welcomeMessage}",
                "\t\t\tonComplete={this.handleComplete}",
                "\t\t\tclearonComplete={false}",
                "\t\t\tstyles={Stylesheet.create({",
                    "\t\t\t\titemMe: {",
                        "\t\t\t\t\tcolor: ${3:'red'}",
                    "\t\t\t\t}",
                "\t\t\t})}",
                "\t\t/>",
                "\t</SafeAreaView>",
                "\t);",
            "}"
        ]
    }
}