1/*! For license information please see 7.918d2223.chunk.js.LICENSE.txt */ 2(this["webpackJsonpretsas-books-website"]=this["webpackJsonpretsas-books-website"]||[]).push([[7],{1201:function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-lex-runtime-service","description":"AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test:unit":"mocha **/cjs/**/*.spec.js","test":"yarn test:unit","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-runtime-service","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-lex-runtime-service"}}')},1249:function(e,t,n){"use strict";n.r(t),n.d(t,"amplify_chatbot",(function(){return Ke}));var i,o,r,a,s,c,u,l,d,p,f,m,v,b,h,g,y,w,x,O,S,j,E,T,C,L,I,k,A,N,_,z,P,R,F,B,M,D=n(657),U=n(1174),$=n(755),q=n(1356),V=n(662),H=n(659),W=n(929),J=function(){return(J=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},G=new U.a("AbstractInteractionsProvider"),X=function(){function e(e){void 0===e&&(e={}),this._config=e}return e.prototype.configure=function(e){return void 0===e&&(e={}),this._config=J(J({},this._config),e),G.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"Interactions"},Object.defineProperty(e.prototype,"options",{get:function(){return J({},this._config)},enumerable:!0,configurable:!0}),e}(),Y=n(705),K=n(1201),Q=n(802),Z=n(810),ee=n(813),te=n(716),ne=n(756),ie=n(805),oe=n(806),re=n(759),ae="runtime.lex.{region}.amazonaws.com",se=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),ce=new Set(["cn-north-1","cn-northwest-1"]),ue=new Set(["us-iso-east-1"]),le=new Set(["us-isob-east-1"]),de=new Set(["us-gov-east-1","us-gov-west-1"]),pe={apiVersion:"2016-11-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"runtime.lex.ap-northeast-1.amazonaws.com",partition:"aws",signingService:"lex"};break;case"ap-southeast-1":n={hostname:"runtime.lex.ap-southeast-1.amazonaws.com",partition:"aws",signingService:"lex"};break;case"ap-southeast-2":n={hostname:"runtime.lex.ap-southeast-2.amazonaws.com",partition:"aws",signingService:"lex"};break;case"eu-central-1":n={hostname:"runtime.lex.eu-central-1.amazonaws.com",partition:"aws",signingService:"lex"};break;case"eu-west-1":n={hostname:"runtime.lex.eu-west-1.amazonaws.com",partition:"aws",signingService:"lex"};break;case"eu-west-2":n={hostname:"runtime.lex.eu-west-2.amazonaws.com",partition:"aws",signingService:"lex"};break;case"us-east-1":n={hostname:"runtime.lex.us-east-1.amazonaws.com",partition:"aws",signingService:"lex"};break;case"us-west-2":n={hostname:"runtime.lex.us-west-2.amazonaws.com",partition:"aws",signingService:"lex"};break;default:se.has(e)&&(n={hostname:ae.replace("{region}",e),partition:"aws",signingService:"lex"}),ce.has(e)&&(n={hostname:"runtime.lex.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),ue.has(e)&&(n={hostname:"runtime.lex.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),le.has(e)&&(n={hostname:"runtime.lex.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),de.has(e)&&(n={hostname:"runtime.lex.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:ae.replace("{region}",e),partition:"aws",signingService:"lex"})}return Promise.resolve(Object(Y.a)({signingService:"lex"},n))},serviceId:"Lex Runtime Service",urlParser:n(815).a},fe=Object(Y.a)(Object(Y.a)({},pe),{runtime:"browser",base64Decoder:ne.a,base64Encoder:ne.b,bodyLengthChecker:ie.a,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:Object(oe.a)({serviceId:pe.serviceId,clientVersion:K.version}),maxAttempts:te.a,region:Object(ee.a)("Region is missing"),requestHandler:new Z.a,sha256:Q.Sha256,streamCollector:Z.b,utf8Decoder:re.a,utf8Encoder:re.b}),me=n(811),ve=n(800),be=n(801),he=n(814),ge=n(812),ye=n(809),we=n(664),xe=function(e){function t(t){var n=this,i=Object(Y.a)(Object(Y.a)({},fe),t),o=Object(me.b)(i),r=Object(me.a)(o),a=Object(ge.b)(r),s=Object(te.c)(a),c=Object(be.b)(s),u=Object(ye.b)(c);return(n=e.call(this,u)||this).config=u,n.middlewareStack.use(Object(ge.a)(n.config)),n.middlewareStack.use(Object(te.b)(n.config)),n.middlewareStack.use(Object(ve.a)(n.config)),n.middlewareStack.use(Object(be.a)(n.config)),n.middlewareStack.use(Object(he.a)(n.config)),n.middlewareStack.use(Object(ye.a)(n.config)),n}return Object(Y.c)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(we.a);(i||(i={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(o||(o={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)({},e),e.parameters&&{parameters:we.d})},(r||(r={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)}
2,(a||(a={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(s||(s={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(c||(c={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(u||(u={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(l||(l={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(d||(d={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(p||(p={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},function(e){e.FAILED="Failed",e.FULFILLED="Fulfilled",e.READY_FOR_FULFILLMENT="ReadyForFulfillment"}(f||(f={})),function(e){e.COMPOSITE="Composite",e.CUSTOM_PAYLOAD="CustomPayload",e.PLAIN_TEXT="PlainText",e.SSML="SSML"}(m||(m={})),function(e){e.CLOSE="Close",e.CONFIRM_INTENT="ConfirmIntent",e.DELEGATE="Delegate",e.ELICIT_INTENT="ElicitIntent",e.ELICIT_SLOT="ElicitSlot"}(v||(v={})),(b||(b={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.slots&&{slots:we.d}),e.message&&{message:we.d})},function(e){e.CONFIRMED="Confirmed",e.DENIED="Denied",e.NONE="None"}(h||(h={})),(g||(g={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)({},e),e.slots&&{slots:we.d})},(y||(y={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.recentIntentSummaryView&&{recentIntentSummaryView:e.recentIntentSummaryView.map((function(e){return g.filterSensitiveLog(e)}))}),e.sessionAttributes&&{sessionAttributes:we.d}),e.dialogAction&&{dialogAction:b.filterSensitiveLog(e.dialogAction)}),e.activeContexts&&{activeContexts:we.d})},(w||(w={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(x||(x={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(O||(O={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(S||(S={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(j||(j={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.sessionAttributes&&{sessionAttributes:we.d}),e.requestAttributes&&{requestAttributes:we.d}),e.activeContexts&&{activeContexts:we.d})},function(e){e.CONFIRM_INTENT="ConfirmIntent",e.ELICIT_INTENT="ElicitIntent",e.ELICIT_SLOT="ElicitSlot",e.FAILED="Failed",e.FULFILLED="Fulfilled",e.READY_FOR_FULFILLMENT="ReadyForFulfillment"}(E||(E={})),(T||(T={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.message&&{message:we.d}),e.activeContexts&&{activeContexts:we.d})},(C||(C={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(L||(L={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(I||(I={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.sessionAttributes&&{sessionAttributes:we.d}),e.requestAttributes&&{requestAttributes:we.d}),e.inputText&&{inputText:we.d}),e.activeContexts&&{activeContexts:we.d})},(k||(k={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(A||(A={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)({},e),e.slots&&{slots:we.d})},function(e){e.GENERIC="application/vnd.amazonaws.card.generic"}(N||(N={})),(_||(_={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(z||(z={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(P||(P={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(R||(R={})).filterSensitiveLog=function(e){return Object(Y.a)({},e)},(F||(F={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.alternativeIntents&&{alternativeIntents:e.alternativeIntents.map((function(e){return A.filterSensitiveLog(e)}))}),e.slots&&{slots:we.d}),e.sessionAttributes&&{sessionAttributes:we.d}),e.message&&{message:we.d}),e.activeContexts&&{activeContexts:we.d})},(B||(B={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.sessionAttributes&&{sessionAttributes:we.d}),e.dialogAction&&{dialogAction:b.filterSensitiveLog(e.dialogAction)}),e.recentIntentSummaryView&&{recentIntentSummaryView:e.recentIntentSummaryView.map((function(e){return g.filterSensitiveLog(e)}))}),e.activeContexts&&{activeContexts:we.d})}
2,(M||(M={})).filterSensitiveLog=function(e){return Object(Y.a)(Object(Y.a)(Object(Y.a)({},e),e.message&&{message:we.d}),e.activeContexts&&{activeContexts:we.d})};var Oe=n(938),Se=n(673),je=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Object(Y.c)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Se.a)(t,this.serialize,this.deserialize));var i=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeServiceClient",commandName:"PostTextCommand",inputFilterSensitiveLog:I.filterSensitiveLog,outputFilterSensitiveLog:F.filterSensitiveLog},r=t.requestHandler;return i.resolve((function(e){return r.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return Object(Oe.d)(e,t)},t.prototype.deserialize=function(e,t){return Object(Oe.b)(e,t)},t}(we.b),Ee=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Object(Y.c)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Se.a)(t,this.serialize,this.deserialize));var i=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeServiceClient",commandName:"PostContentCommand",inputFilterSensitiveLog:j.filterSensitiveLog,outputFilterSensitiveLog:T.filterSensitiveLog},r=t.requestHandler;return i.resolve((function(e){return r.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return Object(Oe.c)(e,t)},t.prototype.deserialize=function(e,t){return Object(Oe.a)(e,t)},t}(we.b),Te=n(1335),Ce=n(1255),Le=function(e){if(e instanceof Blob||e instanceof ReadableStream)return new Response(e).arrayBuffer().then((function(e){return new Uint8Array(e)}));throw new Error("Readable is not supported.")},Ie=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ke=function(){return(ke=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ae=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function s(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Ne=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(s){r=[6,s],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},_e=new U.a("AWSLexProvider"),ze=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n._botsCompleteCallback={},n}return Ie(t,e),t.prototype.getProviderName=function(){return"AWSLexProvider"},t.prototype.reportBotStatus=function(e,t){var n=this;_e.debug("postContent state",e.dialogState),"ReadyForFulfillment"!==e.dialogState&&"Fulfilled"!==e.dialogState||("function"===typeof this._botsCompleteCallback[t]&&setTimeout((function(){return n._botsCompleteCallback[t](null,{slots:e.slots})}),0),this._config&&"function"===typeof this._config[t].onComplete&&setTimeout((function(){return n._config[t].onComplete(null,{slots:e.slots})}),0)),"Failed"===e.dialogState&&("function"===typeof this._botsCompleteCallback[t]&&setTimeout((function(){return n._botsCompleteCallback[t]("Bot conversation failed")}),0),this._config&&"function"===typeof this._config[t].onComplete&&setTimeout((function(){return n._config[t].onComplete("Bot c
2onversation failed")}),0))},t.prototype.sendMessage=function(e,t){return Ae(this,void 0,void 0,(function(){var n,i,o,r,a,s,c,u,l,d;return Ne(this,(function(p){switch(p.label){case 0:return this._config[e]?[4,Te.a.get()]:[2,Promise.reject("Bot "+e+" does not exist")];case 1:if(!(n=p.sent()))return[2,Promise.reject("No credentials")];if(this.lexRuntimeServiceClient=new xe({region:this._config[e].region,credentials:n,customUserAgent:Object(Ce.b)()}),"string"!==typeof t)return[3,6];i={botAlias:this._config[e].alias,botName:e,inputText:t,userId:n.identityId},_e.debug("postText to lex",t),p.label=2;case 2:return p.trys.push([2,4,,5]),o=new je(i),[4,this.lexRuntimeServiceClient.send(o)];case 3:return u=p.sent(),this.reportBotStatus(u,e),[2,u];case 4:return r=p.sent(),[2,Promise.reject(r)];case 5:return[3,11];case 6:a=t.content,s=t.options.messageType,i="voice"===s?{botAlias:this._config[e].alias,botName:e,contentType:"audio/x-l16; sample-rate=16000",inputStream:a,userId:n.identityId,accept:"audio/mpeg"}:{botAlias:this._config[e].alias,botName:e,contentType:"text/plain; charset=utf-8",inputStream:a,userId:n.identityId,accept:"audio/mpeg"},_e.debug("postContent to lex",t),p.label=7;case 7:return p.trys.push([7,10,,11]),c=new Ee(i),[4,this.lexRuntimeServiceClient.send(c)];case 8:return u=p.sent(),[4,Le(u.audioStream)];case 9:return l=p.sent(),this.reportBotStatus(u,e),[2,ke(ke({},u),{audioStream:l})];case 10:return d=p.sent(),[2,Promise.reject(d)];case 11:return[2]}}
2))}))},t.prototype.onComplete=function(e,t){if(!this._config[e])throw new ErrorEvent("Bot "+e+" does not exist");this._botsCompleteCallback[e]=t},t}(X),Pe=function(){return(Pe=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Re=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function s(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Fe=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(s){r=[6,s],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},Be=new U.a("Interactions"),Me=new(function(){function e(e){this._options=e,Be.debug("Interactions Options",this._options),this._pluggables={}}return e.prototype.getModuleName=function(){return"Interactions"},e.prototype.configure=function(e){var t=this,n=e?e.Interactions||e:{};Be.debug("configure Interactions",{opt:n}),this._options=Pe(Pe({bots:{}},n),n.Interactions);var i=this._options.aws_bots_config,o=this._options.bots;return!Object.keys(o).length&&i&&Array.isArray(i)&&i.forEach((function(e){t._options.bots[e.name]=e})),!this._pluggables.AWSLexProvider&&o&&Object.keys(o).map((function(e){return o[e]})).find((function(e){return!e.providerName||"AWSLexProvider"===e.providerName}))&&(this._pluggables.AWSLexProvider=new ze),Object.keys(this._pluggables).map((function(e){t._pluggables[e].configure(t._options.bots)})),this._options},e.prototype.addPluggable=function(e){if(e&&"Interactions"===e.getCategory()){if(this._pluggables[e.getProviderName()])throw new Error("Bot "+e.getProviderName()+" already plugged");return e.configure(this._options.bots),void(this._pluggables[e.getProviderName()]=e)}},e.prototype.send=function(e,t){return Re(this,void 0,void 0,(function(){var n;return Fe(this,(function(i){switch(i.label){case 0:if(!this._options.bots||!this._options.bots[e])throw new Error("Bot "+e+" does not exist");if(n=this._options.bots[e].providerName||"AWSLexProvider",!this._pluggables[n])throw new Error("Bot "+n+" does not have valid pluggin did you try addPluggable first?");return[4,this._pluggables[n].sendMessage(e,t)];case 1:return[2,i.sent()]}}))}))},e.prototype.onComplete=function(e,t){if(!this._options.bots||!this._options.bots[e])throw new Error("Bot "+e+" does not exist");var n=this._options.bots[e].providerName||"AWSLexProvider";if(!this._pluggables[n])throw new Error("Bot "+n+" does not have valid pluggin did you try addPluggable first?");this._pluggables[n].onComplete(e,t)},e}())(null);W.a.register(Me);var De,Ue,$e,qe=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function s(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))},Ve=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(s){r=[6,s],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},He=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),o=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i},We=function(e,t,n){for(var i=0;i<n.length;
2i++)e.setUint8(t+i,n.charCodeAt(i))},Je=function(e,t){var n=2*e.length,i=8+n,o=new ArrayBuffer(36+i),r=new DataView(o);return We(r,0,"RIFF"),r.setUint32(4,24+i,!0),We(r,8,"WAVE"),We(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,2*t,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),We(r,36,"data"),r.setUint32(40,n,!0),function(e,t,n){for(var i=t,o=0;o<n.length;o++,i+=2){var r=Math.max(-1,Math.min(1,n[o]));e.setInt16(i,r<0?32768*r:32767*r,!0)}}(r,44,e),r},Ge=function(e,t,n,i){var o=function(e,t,n){if(n===t)return e;for(var i=t/n,o=Math.round(e.length/i),r=new Float32Array(o),a=0,s=0;a<r.length;){for(var c=Math.round((a+1)*i),u=0,l=0,d=s;d<c&&d<e.length;d++)u+=e[d],l++;r[a]=u/l,a++,s=c}return r}(function(e,t){for(var n=new Float32Array(t),i=0,o=0;o<e.length;o++)n.set(e[o],i),i+=e[o].length;return n}(e,t),n,i),r=Je(o,i);return new Blob([r],{type:"application/octet-stream"})},Xe=new U.a("AudioRecorder"),Ye=function(){function e(e){this.streamBuffer=[],this.streamBufferLength=0,this.recording=!1,this.options=e}return e.prototype.init=function(){return qe(this,void 0,void 0,(function(){var e=this;return Ve(this,(function(t){switch(t.label){case 0:return Object($.b)().isBrowser?(window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext,[4,navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){e.audioSupported=!0,e.setupAudioNodes(t)})).catch((function(){return e.audioSupported=!1,Promise.reject("Audio is not supported")}))]):[3,2];case 1:return t.sent(),[3,3];case 2:return this.audioSupported=!1,[2,Promise.reject("Audio is not supported")];case 3:return[2]}}
2))}))},e.prototype.setupAudioNodes=function(e){return qe(this,void 0,void 0,(function(){var t,n,i,o,r=this;return Ve(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.audioContext.resume()];case 1:return a.sent(),[3,3];case 2:return t=a.sent(),Xe.error(t),[3,3];case 3:return n=this.audioContext.createMediaStreamSource(e),(i=this.audioContext.createScriptProcessor(4096,1,1)).onaudioprocess=function(e){if(r.recording){var t=e.inputBuffer.getChannelData(0);r.streamBuffer.push(new Float32Array(t)),r.streamBufferLength+=t.length,r.analyse()}},(o=this.audioContext.createAnalyser()).minDecibels=-90,o.maxDecibels=-10,o.smoothingTimeConstant=.85,n.connect(o),o.connect(i),i.connect(n.context.destination),this.analyserNode=o,[2]}}))}))},e.prototype.startRecording=function(e,t){return qe(this,void 0,void 0,(function(){var n,i;return Ve(this,(function(o){switch(o.label){case 0:if(this.recording||!this.audioSupported)return[2];this.onSilence=e||function(){},this.visualizer=t||function(){},n=this.audioContext,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.resume()];case 2:return o.sent(),[3,4];case 3:return i=o.sent(),Xe.error(i),[3,4];case 4:return this.start=Date.now(),this.recording=!0,[2]}}))}))},e.prototype.stopRecording=function(){this.audioSupported&&(this.recording=!1)},e.prototype.clear=function(){this.stopRecording(),this.streamBufferLength=0,this.streamBuffer=[]},e.prototype.play=function(e){var t=this;if(e&&this.audioSupported){var n=new Blob([e]);return new Promise((function(e,i){var o=new FileReader;o.onload=function(){t.playbackSource&&t.playbackSource.disconnect(),t.playbackSource=t.audioContext.createBufferSource();t.audioContext.decodeAudioData(o.result,(function(n){t.playbackSource.buffer=n,t.playbackSource.connect(t.audioContext.destination),t.playbackSource.onended=function(){return e()},t.playbackSource.start(0)}),(function(e){return i(e)}))},o.onerror=function(){return i()},o.readAsArrayBuffer(n)}))}},e.prototype.stop=function(){this.playbackSource&&this.playbackSource.stop()},e.prototype.analyse=function(){if(this.audioSupported){var e=this.analyserNode;e.fftSize=2048;var t=e.fftSize,n=new Uint8Array(t),i=this.options.amplitude,o=this.options.time;e.getByteTimeDomainData(n),this.visualizer(n,t);for(var r=0;r<t;r++){var a=n[r]/128-1;(a>i||a<-1*i)&&(this.start=Date.now())}Date.now()-this.start>o&&this.onSilence()}},e.prototype.exportWAV=function(e){return void 0===e&&(e=16e3),qe(this,void 0,void 0,(function(){var t,n;return Ve(this,(function(i){return this.audioSupported?(t=this.audioContext.sampleRate,n=Ge(this.streamBuffer,this.streamBufferLength,t,e),this.clear(),[2,n]):[2]}))}))},e}();!function(e){e[e.Initial=0]="Initial",e[e.Listening=1]="Listening",e[e.SendingText=2]="SendingText",e[e.SendingVoice=3]="SendingVoice",e[e.Error=4]="Error"}(De||(De={})),function(e){e.Bot="bot",e.User="user"}(Ue||(Ue={})),function(e){e[e.Recoverable=0]="Recoverable",e[e.Unrecoverable=1]="Unrecoverable"}($e||($e={}));var Ke=function(){function e(e){var t=this;Object(D.k)(this,e),this.clearOnComplete=!1,this.conversationModeOn=!1,this.botTitle=V.a.CHATBOT_TITLE,this.voiceEnabled=!1,this.textEnabled=!0,this.silenceTime=1500,this.silenceThreshold=.2,this.messages=[],this.text="",this.chatState=De.Initial,this.messageJSX=function(e){var n=e.map((function(e){return Object(D.i)("div",{class:"bubble "+e.from},e.content)}));if(t.chatState===De.SendingText||t.chatState===De.SendingVoice){var i=t.chatState===De.SendingText?Ue.Bot:Ue.User;n.push(Object(D.i)("div",{class:"bubble "+i},Object(D.i)("div",{class:"dot-flashing "+i},Object(D.i)("span",{class:"dot left"}),Object(D.i)("span",{class:"dot middle"}),Object(D.i)("span",{class:"dot right"}))))}return n},this.chatCompleted=Object(D.f)(this,"chatCompleted",7)}return e.prototype.submitHandler=function(e){this.sendTextMessage()},e.prototype.componentWillLoad=function(){if(!Me||"function"!==typeof Me.onComplete)throw new Error(H.l);this.validateProps()},e.prototype.componentDidRender=function(){var e=this.element.shadowRoot.querySelector(".body");e.scrollTop=e.scrollHeight},e.prototype.validateProps=function(){var e=this;if(this.voiceEnabled||this.textEnabled)if(this.botName){this.welcomeMessage&&this.appendToChat(this.welcomeMessage,Ue.Bot),this.voiceEnabled&&(this.audioRecorder=new Ye({time:this.silenceTime,amplitude:this.silenceThreshold}),this.audioRecorder.init().catch((function(t){e.setError(t,$e.Recoverable)})));try{Me.onComplete(this.botName,(function(t,n){e.chatCompleted.emit({data:n,err:t}),e.clearOnComplete?e.reset():e.chatState=De.Initial}))}catch(t){this.setError(t,$e.Unrecoverable)}}else this.setError(V.a.NO_BOT_NAME_ERROR,$e.Unrecoverable);else this.setError(V.a.CHAT_DISABLED_ERROR,$e.Unrecoverable)},e.prototype.handleSubmit=function(e){e.preventDefault(),this.sendTextMessage()},e.prototype.handleMicButton=function(){var e=this;this.chatState===De.Initial&&(this.audioRecorder.stop(),this.chatState=De.Listening,this.audioRecorder.startRecording((function(){return e.handleSilence()}),(function(t,n){return e.visualizer(t,n)}
2)))},e.prototype.handleSilence=function(){var e=this;this.chatState=De.SendingVoice,this.audioRecorder.stopRecording(),this.audioRecorder.exportWAV().then((function(t){e.sendVoiceMessage(t)}))},e.prototype.handleTextChange=function(e){var t=e.target;this.text=t.value},e.prototype.handleCancelButton=function(){this.audioRecorder.clear(),this.chatState=De.Initial},e.prototype.handleToastClose=function(e){this.error=void 0,e===$e.Recoverable&&(this.chatState=De.Initial)},e.prototype.visualizer=function(e,t){!function(e,t,n){if(n){if(!Object($.b)().isBrowser)throw new Error("Visualization is not supported on non-browsers.");var i=n.getBoundingClientRect(),o=i.width,r=i.height;n.width=o,n.height=r;var a=n.getContext("2d");a.fillStyle="white",a.clearRect(0,0,o,r),requestAnimationFrame((function(){a.fillRect(0,0,o,r),a.lineWidth=1;var i=getComputedStyle(document.documentElement).getPropertyValue("--amplify-primary-color");a.strokeStyle=i&&""!==i?i:"#ff9900",a.beginPath();for(var s=1*o/t,c=0,u=0;u<t||u%3===0;u++){var l=e[u]/128*r/2;0===u?a.moveTo(c,l):a.lineTo(c,l),c+=s}a.lineTo(n.width,n.height/2),a.stroke()}))}}(e,t,this.element.shadowRoot.querySelector("canvas"))},e.prototype.sendTextMessage=function(){return qe(this,void 0,void 0,(function(){var e,t,n;return Ve(this,(function(i){switch(i.label){case 0:if(0===this.text.length||this.chatState!==De.Initial)return[2];e=this.text,this.text="",this.appendToChat(e,Ue.User),this.chatState=De.SendingText,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Me.send(this.botName,e)];case 2:return t=i.sent(),[3,4];case 3:return n=i.sent(),this.setError(n,$e.Recoverable),[2];case 4:return t.message&&this.appendToChat(t.message,Ue.Bot),this.chatState=De.Initial,[2]}}))}))},e.prototype.sendVoiceMessage=function(e){return qe(this,void 0,void 0,(function(){var t,n,i,o,r=this;return Ve(this,(function(a){switch(a.label){case 0:t={content:e,options:{messageType:"voice"}},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Me.send(this.botName,t)];case 2:return n=a.sent(),[3,4];case 3:return i=a.sent(),this.setError(i,$e.Recoverable),[2];case 4:return this.chatState=De.Initial,o=n.dialogState,n.inputTranscript&&this.appendToChat(n.inputTranscript,Ue.User),this.appendToChat(n.message,Ue.Bot),[4,this.audioRecorder.play(n.audioStream).then((function(){r.conversationModeOn&&"Fulfilled"!==o&&"Failed"!==o&&r.chatState===De.Initial&&r.handleMicButton()})).catch((function(e){return r.setError(e,$e.Recoverable)}))];case 5:return a.sent(),[2]}}))}))},e.prototype.appendToChat=function(e,t){this.messages=He(this.messages,[{content:e,from:t}])},e.prototype.setError=function(e,t){var n="string"===typeof e?e:e.message;this.chatState=De.Error,this.error={message:n,errorType:t}},e.prototype.reset=function(){this.chatState=De.Initial,this.text="",this.error=void 0,this.messages=[],this.welcomeMessage&&this.appendToChat(this.welcomeMessage,Ue.Bot),this.audioRecorder&&this.audioRecorder.clear()},e.prototype.listeningFooterJSX=function(){var e=this;return[Object(D.i)("canvas",{height:"50"}),Object(D.i)("amplify-button",{"data-test":"chatbot-cancel-button",handleButtonClick:function(){return e.handleCancelButton()},class:"icon-button",variant:"icon",icon:"ban"})]},e.prototype.footerJSX=function(){var e=this;if(this.chatState===De.Listening)return this.listeningFooterJSX();var t=this.textEnabled?V.a.TEXT_INPUT_PLACEHOLDER:V.a.VOICE_INPUT_PLACEHOLDER;return[Object(D.i)("amplify-input",{placeholder:q.a.get(t),description:"text",handleInputChange:function(t){return e.handleTextChange(t)},value:this.text,disabled:this.chatState===De.Error||!this.textEnabled}),this.voiceEnabled&&Object(D.i)("amplify-button",{"data-test":"chatbot-mic-button",handleButtonClick:function(){return e.handleMicButton()},class:"icon-button",variant:"icon",icon:"microphone",disabled:this.chatState===De.Error||this.chatState!==De.Initial}),this.textEnabled&&Object(D.i)("amplify-button",{"data-test":"chatbot-send-button",class:"icon-button",variant:"icon",icon:"send",handleButtonClick:function(){return e.sendTextMessage()},disabled:this.chatState===De.Error||this.chatState!==De.Initial})]},e.prototype.errorToast=function(){var e=this;if(this.error){var t=this.error,n=t.message,i=t.errorType;return Object(D.i)("amplify-toast",{message:q.a.get(n),handleClose:function(){return e.handleToastClose(i)}})}},e.prototype.render=function(){var e=this;return Object(D.i)(D.b,null,Object(D.i)("div",{class:"amplify-chatbot"},Object(D.i)("slot",{name:"header"},Object(D.i)("div",{class:"header","data-test":"chatbot-header"},q.a.get(this.botTitle))),Object(D.i)("div",{class:"body","data-test":"chatbot-body"},this.messageJSX(this.messages)),Object(D.i)("form",{onSubmit:function(t){return e.handleSubmit(t)}},Object(D.i)("div",{class:"footer","data-test":"chatbot-footer"},this.footerJSX())),this.errorToast()))},Object.defineProperty(e.prototype,"element",{get:function(){return Object(D.h)(this)}
2,enumerable:!1,configurable:!0}),e}();Ke.style=".bot .dot{background-color:var(--bot-dot-color)}.user .dot{background-color:var(--user-dot-color)}.dot-flashing{width:2.625rem}.dot-flashing .dot{display:inline-block;width:0.625rem;height:0.625rem;border-radius:10rem;opacity:0.65}.dot-flashing .left{-webkit-animation:dot-flashing 1s infinite alternate;animation:dot-flashing 1s infinite alternate;-webkit-animation-delay:0s;animation-delay:0s}.dot-flashing .middle{margin-left:0.375rem;margin-right:0.375rem;-webkit-animation:dot-flashing 1s infinite linear alternate;animation:dot-flashing 1s infinite linear alternate;-webkit-animation-delay:0.5s;animation-delay:0.5s}.dot-flashing .right{-webkit-animation:dot-flashing 1s infinite alternate;animation:dot-flashing 1s infinite alternate;-webkit-animation-delay:1s;animation-delay:1s}@-webkit-keyframes dot-flashing{0%{opacity:0.65}50%,100%{opacity:0.1}}@keyframes dot-flashing{0%{opacity:0.65}50%,100%{opacity:0.1}}:host{--width:28.75rem;--height:37.5rem;--header-color:var(--amplify-secondary-color);--header-size:var(--amplify-text-lg);--bot-background-color:rgb(230, 230, 230);--bot-text-color:black;--bot-dot-color:var(--bot-text-color);--user-background-color:var(--amplify-blue);--user-text-color:var(--amplify-white);--user-dot-color:var(--user-text-color)}.amplify-chatbot{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;background-color:var(--background-color);border-radius:0.375rem;-webkit-box-shadow:0.0625rem 0rem 0.25rem 0 rgba(0, 0, 0, 0.15);box-shadow:0.0625rem 0rem 0.25rem 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;box-sizing:border-box;font-family:var(--amplify-font-family);margin-bottom:1rem;width:100%;height:var(--height);max-width:var(--width)}@media (min-width: 672px){.amplify-chatbot{width:var(--width)}}.header{padding:1.25rem 0.375rem 1.25rem 0.375rem;color:var(--header-color);font-size:var(--header-size);font-weight:bold;text-align:center;word-wrap:break-word}.body{border-top:0.0625rem solid rgba(0, 0, 0, 0.05);padding:1.5rem 1rem 0 1rem;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-direction:column;flex-direction:column;overflow:auto}.bubble{max-width:100%;padding:0.8em 1.4em;text-align:left;word-wrap:break-word;margin-bottom:0.625rem}.bot{margin-right:auto;background-color:var(--bot-background-color);color:var(--bot-text-color);border-radius:1.5rem 1.5rem 1.5rem 0}.user{margin-left:auto;background-color:var(--user-background-color);color:var(--user-text-color);border-radius:1.5rem 1.5rem 0 1.5rem}.footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top:0.062rem solid rgba(0, 0, 0, 0.05);padding-right:0.625rem;min-height:3.125rem}.footer amplify-input{--border:none;--margin:0;-ms-flex-positive:1;flex-grow:1}canvas{margin-left:0.625rem;margin-right:0.625rem;-ms-flex-positive:1;flex-grow:1;height:3.125rem}.icon-button{--icon-height:1.25rem;--icon-fill:var(--amplify-primary-color);--padding:0.625rem;--width:auto}"},705:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return c}));var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(t){r(t)}}function s(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function s(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(s){r=[6,s],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function c(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}Object.create},938:function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l}));var i=n(705),o=n(667),r=n(664),a=function(t,n){return Object(i.b)(void 0,void 0,void 0,(function(){var a,s,c,u,l,d,p,f,m;return Object(i.d)(this,(function(v){switch(v.label){case 0:if(a=Object(i.a)(Object(i.a)(Object(i.a)(Object(i.a)(Object(i.a)({"content-type":"application/octet-stream","x-amz-content-sha256":"UNSIGNED-PAYLOAD"},D(t.sessionAttributes)&&{"x-amz-lex-session-attributes":e.from(r.c.fromObject(t.sessionAttributes)).toString("base64")}),D(t.requestAttributes)&&{"x-amz-lex-request-attributes":e.from(r.c.fromObject(t.requestAttributes)).toString("base64")}),D(t.contentType)&&{"content-type":t.contentType}),D(t.accept)&&{accept:t.accept}),D(t.activeContexts)&&{"x-amz-lex-active-contexts":e.from(r.c.fromObject(t.activeContexts)).toString("base64")}),s="/bot/{botName}/alias/{botAlias}/user/{userId}/content",void 0===t.botName)throw new Error("No value provided for input HTTP label: botName.");if((c=t.botName).length<=0)throw new Error("Empty value provided for input HTTP label: botName.");if(s=s.replace("{botName}",Object(r.f)(c)),void 0===t.botAlias)throw new Error("No value provided for input HTTP label: botAlias.");
2if((c=t.botAlias).length<=0)throw new Error("Empty value provided for input HTTP label: botAlias.");if(s=s.replace("{botAlias}",Object(r.f)(c)),void 0===t.userId)throw new Error("No value provided for input HTTP label: userId.");if((c=t.userId).length<=0)throw new Error("Empty value provided for input HTTP label: userId.");return s=s.replace("{userId}",Object(r.f)(c)),void 0!==t.inputStream&&(u=t.inputStream),[4,n.endpoint()];case 1:return l=v.sent(),d=l.hostname,p=l.protocol,f=void 0===p?"https":p,m=l.port,[2,new o.a({protocol:f,hostname:d,port:m,method:"POST",headers:a,path:s,body:u})]}}))}))},s=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var n,a,s,c,u,l,d,p,f;return Object(i.d)(this,(function(m){switch(m.label){case 0:if(n={"content-type":"application/json"},a="/bot/{botName}/alias/{botAlias}/user/{userId}/text",void 0===e.botName)throw new Error("No value provided for input HTTP label: botName.");if((s=e.botName).length<=0)throw new Error("Empty value provided for input HTTP label: botName.");if(a=a.replace("{botName}",Object(r.f)(s)),void 0===e.botAlias)throw new Error("No value provided for input HTTP label: botAlias.");if((s=e.botAlias).length<=0)throw new Error("Empty value provided for input HTTP label: botAlias.");if(a=a.replace("{botAlias}",Object(r.f)(s)),void 0===e.userId)throw new Error("No value provided for input HTTP label: userId.");if((s=e.userId).length<=0)throw new Error("Empty value provided for input HTTP label: userId.");return a=a.replace("{userId}",Object(r.f)(s)),c=JSON.stringify(Object(i.a)(Object(i.a)(Object(i.a)(Object(i.a)({},void 0!==e.activeContexts&&null!==e.activeContexts&&{activeContexts:j(e.activeContexts,t)}),void 0!==e.inputText&&null!==e.inputText&&{inputText:e.inputText}),void 0!==e.requestAttributes&&null!==e.requestAttributes&&{requestAttributes:T(e.requestAttributes,t)}),void 0!==e.sessionAttributes&&null!==e.sessionAttributes&&{sessionAttributes:T(e.sessionAttributes,t)})),[4,t.endpoint()];case 1:return u=m.sent(),l=u.hostname,d=u.protocol,p=void 0===d?"https":d,f=u.port,[2,new o.a({protocol:p,hostname:l,port:f,method:"POST",headers:n,path:a,body:c})]}}))}))},c=function(t,n){return Object(i.b)(void 0,void 0,void 0,(function(){var o,a;return Object(i.d)(this,(function(i){return 200!==t.statusCode&&t.statusCode>=300?[2,u(t,n)]:(o={$metadata:B(t),activeContexts:void 0,alternativeIntents:void 0,audioStream:void 0,botVersion:void 0,contentType:void 0,dialogState:void 0,inputTranscript:void 0,intentName:void 0,message:void 0,messageFormat:void 0,nluIntentConfidence:void 0,sentimentResponse:void 0,sessionAttributes:void 0,sessionId:void 0,slotToElicit:void 0,slots:void 0},void 0!==t.headers["content-type"]&&(o.contentType=t.headers["content-type"]),void 0!==t.headers["x-amz-lex-intent-name"]&&(o.intentName=t.headers["x-amz-lex-intent-name"]),void 0!==t.headers["x-amz-lex-nlu-intent-confidence"]&&(o.nluIntentConfidence=new r.c(e.from(t.headers["x-amz-lex-nlu-intent-confidence"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-alternative-intents"]&&(o.alternativeIntents=new r.c(e.from(t.headers["x-amz-lex-alternative-intents"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-slots"]&&(o.slots=new r.c(e.from(t.headers["x-amz-lex-slots"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-session-attributes"]&&(o.sessionAttributes=new r.c(e.from(t.headers["x-amz-lex-session-attributes"],"base64").toString("ascii"))),void 0!==t.headers["x-amz-lex-sentiment"]&&(o.sentimentResponse=t.headers["x-amz-lex-sentiment"]),void 0!==t.headers["x-amz-lex-message"]&&(o.message=t.headers["x-amz-lex-message"]),void 0!==t.headers["x-amz-lex-message-format"]&&(o.messageFormat=t.headers["x-amz-lex-message-format"]),void 0!==t.headers["x-amz-lex-dialog-state"]&&(o.dialogState=t.headers["x-amz-lex-dialog-state"]),void 0!==t.headers["x-amz-lex-slot-to-elicit"]&&(o.slotToElicit=t.headers["x-amz-lex-slot-to-elicit"]),void 0!==t.headers["x-amz-lex-input-transcript"]&&(o.inputTranscript=t.headers["x-amz-lex-input-transcript"]),void 0!==t.headers["x-amz-lex-bot-version"]&&(o.botVersion=t.headers["x-amz-lex-bot-version"]),void 0!==t.headers["x-amz-lex-session-id"]&&(o.sessionId=t.headers["x-amz-lex-session-id"]),void 0!==t.headers["x-amz-lex-active-contexts"]&&(o.activeContexts=new r.c(e.from(t.headers["x-amz-lex-active-contexts"],"base64").toString("ascii"))),a=t.body,o.audioStream=a,[2,Promise.resolve(o)])}))}))},u=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var n,o,r,a,s,c,u,l,d,S,j,E,T,C,L,I,k,A;return Object(i.d)(this,(function(N){switch(N.label){case 0:return o=[Object(i.a)({},e)],A={},[4,U(e.body,t)];case 1:switch(n=i.a.apply(void 0,o.concat([(A.body=N.sent(),A)])),a="UnknownError",a=$(e,n.body),a){case"BadGatewayException":case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotAcceptableException":case"com.amazonaws.lexruntimeservice#NotAcceptableException":return[3,16
2];case"NotFoundException":case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,18];case"RequestTimeoutException":case"com.amazonaws.lexruntimeservice#RequestTimeoutException":return[3,20];case"UnsupportedMediaTypeException":case"com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException":return[3,22]}return[3,24];case 2:return s=[{}],[4,p(n,t)];case 3:return r=i.a.apply(void 0,[i.a.apply(void 0,s.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 4:return c=[{}],[4,f(n,t)];case 5:return r=i.a.apply(void 0,[i.a.apply(void 0,c.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 6:return u=[{}],[4,m(n,t)];case 7:return r=i.a.apply(void 0,[i.a.apply(void 0,u.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 8:return l=[{}],[4,v(n,t)];case 9:return r=i.a.apply(void 0,[i.a.apply(void 0,l.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 10:return d=[{}],[4,b(n,t)];case 11:return r=i.a.apply(void 0,[i.a.apply(void 0,d.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 12:return S=[{}],[4,h(n,t)];case 13:return r=i.a.apply(void 0,[i.a.apply(void 0,S.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 14:return j=[{}],[4,g(n,t)];case 15:return r=i.a.apply(void 0,[i.a.apply(void 0,j.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 16:return E=[{}],[4,y(n,t)];case 17:return r=i.a.apply(void 0,[i.a.apply(void 0,E.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 18:return T=[{}],[4,w(n,t)];case 19:return r=i.a.apply(void 0,[i.a.apply(void 0,T.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 20:return C=[{}],[4,x(n,t)];case 21:return r=i.a.apply(void 0,[i.a.apply(void 0,C.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 22:return L=[{}],[4,O(n,t)];case 23:return r=i.a.apply(void 0,[i.a.apply(void 0,L.concat([N.sent()])),{name:a,$metadata:B(e)}]),[3,25];case 24:I=n.body,a=I.code||I.Code||a,r=Object(i.a)(Object(i.a)({},I),{name:""+a,message:I.message||I.Message||a,$fault:"client",$metadata:B(e)}),N.label=25;case 25:return k=r.message||r.Message||a,r.message=k,delete r.Message,[2,Promise.reject(Object.assign(new Error(k),r))]}}))}))},l=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var n,o;return Object(i.d)(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,d(e,t)]:(n={$metadata:B(e),activeContexts:void 0,alternativeIntents:void 0,botVersion:void 0,dialogState:void 0,intentName:void 0,message:void 0,messageFormat:void 0,nluIntentConfidence:void 0,responseCard:void 0,sentimentResponse:void 0,sessionAttributes:void 0,sessionId:void 0,slotToElicit:void 0,slots:void 0},[4,U(e.body,t)]);case 1:return void 0!==(o=i.sent()).activeContexts&&null!==o.activeContexts&&(n.activeContexts=L(o.activeContexts,t)),void 0!==o.alternativeIntents&&null!==o.alternativeIntents&&(n.alternativeIntents=N(o.alternativeIntents,t)),void 0!==o.botVersion&&null!==o.botVersion&&(n.botVersion=o.botVersion),void 0!==o.dialogState&&null!==o.dialogState&&(n.dialogState=o.dialogState),void 0!==o.intentName&&null!==o.intentName&&(n.intentName=o.intentName),void 0!==o.message&&null!==o.message&&(n.message=o.message),void 0!==o.messageFormat&&null!==o.messageFormat&&(n.messageFormat=o.messageFormat),void 0!==o.nluIntentConfidence&&null!==o.nluIntentConfidence&&(n.nluIntentConfidence=A(o.nluIntentConfidence,t)),void 0!==o.responseCard&&null!==o.responseCard&&(n.responseCard=P(o.responseCard,t)),void 0!==o.sentimentResponse&&null!==o.sentimentResponse&&(n.sentimentResponse=R(o.sentimentResponse,t)),void 0!==o.sessionAttributes&&null!==o.sessionAttributes&&(n.sessionAttributes=F(o.sessionAttributes,t)),void 0!==o.sessionId&&null!==o.sessionId&&(n.sessionId=o.sessionId),void 0!==o.slotToElicit&&null!==o.slotToElicit&&(n.slotToElicit=o.slotToElicit),void 0!==o.slots&&null!==o.slots&&(n.slots=F(o.slots,t)),[2,Promise.resolve(n)]}}))}))},d=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var n,o,r,a,s,c,u,l,d,y,x,O,S,j,E;return Object(i.d)(this,(function(T){switch(T.label){case 0:return o=[Object(i.a)({},e)],E={},[4,U(e.body,t)];case 1:switch(n=i.a.apply(void 0,o.concat([(E.body=T.sent(),E)])),a="UnknownError",a=$(e,n.body),a){case"BadGatewayException":case"com.amazonaws.lexruntimeservice#BadGatewayException":return[3,2];case"BadRequestException":case"com.amazonaws.lexruntimeservice#BadRequestException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimeservice#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimeservice#DependencyFailedException":return[3,8];case"InternalFailureException":case"com.amazonaws.lexruntimeservice#InternalFailureException":return[3,10];case"LimitExceededException":case"com.amazonaws.lexruntimeservice#LimitExceededException":return[3,12];case"LoopDetectedException":case"com.amazonaws.lexruntimeservice#LoopDetectedException":return[3,14];case"NotFoundException":case"com.amazonaws.lexruntimeservice#NotFoundException":return[3,16
2]}return[3,18];case 2:return s=[{}],[4,p(n,t)];case 3:return r=i.a.apply(void 0,[i.a.apply(void 0,s.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 4:return c=[{}],[4,f(n,t)];case 5:return r=i.a.apply(void 0,[i.a.apply(void 0,c.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 6:return u=[{}],[4,m(n,t)];case 7:return r=i.a.apply(void 0,[i.a.apply(void 0,u.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 8:return l=[{}],[4,v(n,t)];case 9:return r=i.a.apply(void 0,[i.a.apply(void 0,l.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 10:return d=[{}],[4,b(n,t)];case 11:return r=i.a.apply(void 0,[i.a.apply(void 0,d.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 12:return y=[{}],[4,h(n,t)];case 13:return r=i.a.apply(void 0,[i.a.apply(void 0,y.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 14:return x=[{}],[4,g(n,t)];case 15:return r=i.a.apply(void 0,[i.a.apply(void 0,x.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 16:return O=[{}],[4,w(n,t)];case 17:return r=i.a.apply(void 0,[i.a.apply(void 0,O.concat([T.sent()])),{name:a,$metadata:B(e)}]),[3,19];case 18:S=n.body,a=S.code||S.Code||a,r=Object(i.a)(Object(i.a)({},S),{name:""+a,message:S.message||S.Message||a,$fault:"client",$metadata:B(e)}),T.label=19;case 19:return j=r.message||r.Message||a,r.message=j,delete r.Message,[2,Promise.reject(Object.assign(new Error(j),r))]}}))}))},p=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"BadGatewayException",$fault:"server",$metadata:B(e),Message:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},f=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"BadRequestException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},m=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"ConflictException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},v=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"DependencyFailedException",$fault:"client",$metadata:B(e),Message:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},b=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"InternalFailureException",$fault:"server",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},h=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"LimitExceededException",$fault:"client",$metadata:B(e),message:void 0,retryAfterSeconds:void 0},void 0!==e.headers["retry-after"]&&(t.retryAfterSeconds=e.headers["retry-after"]),void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},g=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"LoopDetectedException",$fault:"server",$metadata:B(e),Message:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),[2,t]}))}))},y=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"NotAcceptableException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},w=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"NotFoundException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},x=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"RequestTimeoutException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}
2))},O=function(e,t){return Object(i.b)(void 0,void 0,void 0,(function(){var t,n;return Object(i.d)(this,(function(i){return t={name:"UnsupportedMediaTypeException",$fault:"client",$metadata:B(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},S=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i.e)(t,2),r=o[0],a=o[1];return null===a?e:Object(i.a)(Object(i.a)({},e),((n={})[r]=a,n))}),{})},j=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return Object(i.a)(Object(i.a)(Object(i.a)({},void 0!==e.name&&null!==e.name&&{name:e.name}),void 0!==e.parameters&&null!==e.parameters&&{parameters:S(e.parameters,t)}),void 0!==e.timeToLive&&null!==e.timeToLive&&{timeToLive:E(e.timeToLive,t)})}(e,t)}))},E=function(e,t){return Object(i.a)(Object(i.a)({},void 0!==e.timeToLiveInSeconds&&null!==e.timeToLiveInSeconds&&{timeToLiveInSeconds:e.timeToLiveInSeconds}),void 0!==e.turnsToLive&&null!==e.turnsToLive&&{turnsToLive:e.turnsToLive})},T=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i.e)(t,2),r=o[0],a=o[1];return null===a?e:Object(i.a)(Object(i.a)({},e),((n={})[r]=a,n))}),{})},C=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i.e)(t,2),r=o[0],a=o[1];return null===a?e:Object(i.a)(Object(i.a)({},e),((n={})[r]=a,n))}),{})},L=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{name:void 0!==e.name&&null!==e.name?e.name:void 0,parameters:void 0!==e.parameters&&null!==e.parameters?C(e.parameters,t):void 0,timeToLive:void 0!==e.timeToLive&&null!==e.timeToLive?I(e.timeToLive,t):void 0}}(e,t)}))},I=function(e,t){return{timeToLiveInSeconds:void 0!==e.timeToLiveInSeconds&&null!==e.timeToLiveInSeconds?e.timeToLiveInSeconds:void 0,turnsToLive:void 0!==e.turnsToLive&&null!==e.turnsToLive?e.turnsToLive:void 0}},k=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{attachmentLinkUrl:void 0!==e.attachmentLinkUrl&&null!==e.attachmentLinkUrl?e.attachmentLinkUrl:void 0,buttons:void 0!==e.buttons&&null!==e.buttons?_(e.buttons,t):void 0,imageUrl:void 0!==e.imageUrl&&null!==e.imageUrl?e.imageUrl:void 0,subTitle:void 0!==e.subTitle&&null!==e.subTitle?e.subTitle:void 0,title:void 0!==e.title&&null!==e.title?e.title:void 0}}(e,t)}))},A=function(e,t){return{score:void 0!==e.score&&null!==e.score?e.score:void 0}},N=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:z(e,t)}))},_=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{text:void 0!==e.text&&null!==e.text?e.text:void 0,value:void 0!==e.value&&null!==e.value?e.value:void 0}}(e)}))},z=function(e,t){return{intentName:void 0!==e.intentName&&null!==e.intentName?e.intentName:void 0,nluIntentConfidence:void 0!==e.nluIntentConfidence&&null!==e.nluIntentConfidence?A(e.nluIntentConfidence,t):void 0,slots:void 0!==e.slots&&null!==e.slots?F(e.slots,t):void 0}},P=function(e,t){return{contentType:void 0!==e.contentType&&null!==e.contentType?e.contentType:void 0,genericAttachments:void 0!==e.genericAttachments&&null!==e.genericAttachments?k(e.genericAttachments,t):void 0,version:void 0!==e.version&&null!==e.version?e.version:void 0}},R=function(e,t){return{sentimentLabel:void 0!==e.sentimentLabel&&null!==e.sentimentLabel?e.sentimentLabel:void 0,sentimentScore:void 0!==e.sentimentScore&&null!==e.sentimentScore?e.sentimentScore:void 0}},F=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(i.e)(t,2),r=o[0],a=o[1];return null===a?e:Object(i.a)(Object(i.a)({},e),((n={})[r]=a,n))}),{})},B=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},M=function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then((function(e){return t.utf8Encoder(e)}))},D=function(e){return void 0!==e&&null!==e&&""!==e&&(!Object.getOwnPropertyNames(e).includes("length")||0!=e.length)&&(!Object.getOwnPropertyNames(e).includes("size")||0!=e.size)},U=function(e,t){return M(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},$=function(e,t){var n,i,o=function(e){var t=e;return t.indexOf(":")>
2=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},r=(n=e.headers,i="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===i.toLowerCase()})));return void 0!==r?o(e.headers[r]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""}}).call(this,n(663).Buffer)}}]); 3//# sourceMappingURL=7.918d2223.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.