@aws-amplify/interactions 4.1.9 → 4.1.10-unstable.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/lib/.tsbuildinfo +3 -0
  3. package/lib/Interactions.d.ts +24 -0
  4. package/lib/Interactions.js +4 -50
  5. package/lib/Interactions.js.map +1 -1
  6. package/lib/Providers/AWSLexProvider.d.ts +24 -0
  7. package/lib/Providers/AWSLexProvider.js +7 -76
  8. package/lib/Providers/AWSLexProvider.js.map +1 -1
  9. package/lib/Providers/AWSLexProviderHelper/commonUtils.d.ts +1 -0
  10. package/lib/Providers/AWSLexProviderHelper/commonUtils.js +5 -50
  11. package/lib/Providers/AWSLexProviderHelper/commonUtils.js.map +1 -1
  12. package/lib/Providers/AWSLexProviderHelper/utils.d.ts +3 -0
  13. package/lib/Providers/AWSLexProviderHelper/utils.js +7 -52
  14. package/lib/Providers/AWSLexProviderHelper/utils.js.map +1 -1
  15. package/lib/Providers/AWSLexProviderHelper/utils.native.d.ts +3 -0
  16. package/lib/Providers/AWSLexProviderHelper/utils.native.js +11 -56
  17. package/lib/Providers/AWSLexProviderHelper/utils.native.js.map +1 -1
  18. package/lib/Providers/AWSLexV2Provider.d.ts +58 -0
  19. package/lib/Providers/AWSLexV2Provider.js +17 -86
  20. package/lib/Providers/AWSLexV2Provider.js.map +1 -1
  21. package/lib/Providers/InteractionsProvider.d.ts +11 -0
  22. package/lib/Providers/InteractionsProvider.js +5 -25
  23. package/lib/Providers/InteractionsProvider.js.map +1 -1
  24. package/lib/Providers/index.d.ts +3 -0
  25. package/lib/Providers/index.js +8 -18
  26. package/lib/Providers/index.js.map +1 -1
  27. package/lib/index.d.ts +5 -0
  28. package/lib/index.js +8 -22
  29. package/lib/index.js.map +1 -1
  30. package/lib/types/Interactions.d.ts +16 -0
  31. package/lib/types/Provider.d.ts +12 -0
  32. package/lib/types/Providers/AWSLexProvider.d.ts +10 -0
  33. package/lib/types/Providers/AWSLexV2Provider.d.ts +12 -0
  34. package/lib/types/Response.d.ts +3 -0
  35. package/lib/types/Response.js +2 -12
  36. package/lib/types/Response.js.map +1 -1
  37. package/lib/types/index.d.ts +5 -0
  38. package/lib-esm/.tsbuildinfo +3 -0
  39. package/lib-esm/Interactions.js +1 -47
  40. package/lib-esm/Interactions.js.map +1 -1
  41. package/lib-esm/Providers/AWSLexProvider.js +3 -72
  42. package/lib-esm/Providers/AWSLexProvider.js.map +1 -1
  43. package/lib-esm/Providers/AWSLexProviderHelper/commonUtils.js +3 -48
  44. package/lib-esm/Providers/AWSLexProviderHelper/commonUtils.js.map +1 -1
  45. package/lib-esm/Providers/AWSLexProviderHelper/utils.js +3 -48
  46. package/lib-esm/Providers/AWSLexProviderHelper/utils.js.map +1 -1
  47. package/lib-esm/Providers/AWSLexProviderHelper/utils.native.js +3 -48
  48. package/lib-esm/Providers/AWSLexProviderHelper/utils.native.js.map +1 -1
  49. package/lib-esm/Providers/AWSLexV2Provider.js +3 -72
  50. package/lib-esm/Providers/AWSLexV2Provider.js.map +1 -1
  51. package/lib-esm/Providers/InteractionsProvider.js +3 -23
  52. package/lib-esm/Providers/InteractionsProvider.js.map +1 -1
  53. package/lib-esm/Providers/index.d.ts +3 -3
  54. package/lib-esm/Providers/index.js +5 -15
  55. package/lib-esm/Providers/index.js.map +1 -1
  56. package/lib-esm/index.d.ts +4 -9
  57. package/lib-esm/index.js +6 -21
  58. package/lib-esm/index.js.map +1 -1
  59. package/lib-esm/types/Response.js +2 -12
  60. package/lib-esm/types/Response.js.map +1 -1
  61. package/package.json +13 -9
  62. package/src/Interactions.ts +2 -12
  63. package/src/Providers/AWSLexProvider.ts +2 -12
  64. package/src/Providers/AWSLexProviderHelper/commonUtils.ts +2 -12
  65. package/src/Providers/AWSLexProviderHelper/utils.native.ts +2 -12
  66. package/src/Providers/AWSLexProviderHelper/utils.ts +2 -12
  67. package/src/Providers/AWSLexV2Provider.ts +2 -12
  68. package/src/Providers/InteractionsProvider.ts +2 -12
  69. package/src/Providers/index.ts +5 -15
  70. package/src/index.ts +6 -23
  71. package/src/types/Interactions.ts +2 -12
  72. package/src/types/Provider.ts +2 -12
  73. package/src/types/Providers/AWSLexProvider.ts +2 -12
  74. package/src/types/Providers/AWSLexV2Provider.ts +2 -12
  75. package/src/types/Response.ts +2 -12
  76. package/src/types/index.ts +2 -12
  77. package/build.js +0 -5
  78. package/dist/aws-amplify-interactions.js +0 -33213
  79. package/dist/aws-amplify-interactions.js.map +0 -1
  80. package/dist/aws-amplify-interactions.min.js +0 -116
  81. package/dist/aws-amplify-interactions.min.js.map +0 -1
  82. package/index.js +0 -7
  83. package/webpack.config.dev.js +0 -6
@@ -1,116 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("aws_amplify_core")):"function"==typeof define&&define.amd?define("aws_amplify_interactions",["aws_amplify_core"],t):"object"==typeof exports?exports.aws_amplify_interactions=t(require("aws_amplify_core")):e.aws_amplify_interactions=t(e.aws_amplify_core)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=72)}([function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"f",(function(){return a})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return s})),n.d(t,"h",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"g",(function(){return f}));var r=function(e,t){return(r=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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}Object.create;function c(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"o",(function(){return E})),n.d(t,"l",(function(){return A})),n.d(t,"e",(function(){return S})),n.d(t,"f",(function(){return _})),n.d(t,"c",(function(){return P})),n.d(t,"m",(function(){return C})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return v})),n.d(t,"i",(function(){return y})),n.d(t,"j",(function(){return b})),n.d(t,"k",(function(){return m})),n.d(t,"n",(function(){return M}));var r=n(0),o=function(){var e=[],t=[],n=new Set,u=function(n){return e.forEach((function(e){n.add(e.middleware,Object(r.a)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(r.a)({},e))})),n},s=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(r.g)([],Object(r.e)(s(e)),!1))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(r.g)([],Object(r.e)(s(e)),!1))})),t},c=function(n){void 0===n&&(n=!1);var o,u=[],c=[],l={};return e.forEach((function(e){var t=Object(r.a)(Object(r.a)({},e),{before:[],after:[]});t.name&&(l[t.name]=t),u.push(t)})),t.forEach((function(e){var t=Object(r.a)(Object(r.a)({},e),{before:[],after:[]});t.name&&(l[t.name]=t),c.push(t)})),c.forEach((function(e){if(e.toMiddleware){var t=l[e.toMiddleware];if(void 0===t){if(n)return;throw new Error("".concat(e.toMiddleware," is not found when adding ").concat(e.name||"anonymous"," middleware ").concat(e.relation," ").concat(e.toMiddleware))}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(o=u,o.sort((function(e,t){return i[t.step]-i[e.step]||a[t.priority||"normal"]-a[e.priority||"normal"]}))).map(s).reduce((function(e,t){return e.push.apply(e,Object(r.g)([],Object(r.e)(t),!1)),e}),[])},l={add:function(t,o){void 0===o&&(o={});var i=o.name,a=o.override,u=Object(r.a)({step:"initialize",priority:"normal",middleware:t},o);if(i){if(n.has(i)){if(!a)throw new Error("Duplicate middleware name '".concat(i,"'"));var s=e.findIndex((function(e){return e.name===i})),c=e[s];if(c.step!==u.step||c.priority!==u.priority)throw new Error('"'.concat(i,'" middleware with ').concat(c.priority," priority in ").concat(c.step," step cannot be ")+"overridden by same-name middleware with ".concat(u.priority," priority in ").concat(u.step," step."));e.splice(s,1)}n.add(i)}e.push(u)},addRelativeTo:function(e,o){var i=o.name,a=o.override,u=Object(r.a)({middleware:e},o);if(i){if(n.has(i)){if(!a)throw new Error("Duplicate middleware name '".concat(i,"'"));var s=t.findIndex((function(e){return e.name===i})),c=t[s];if(c.toMiddleware!==u.toMiddleware||c.relation!==u.relation)throw new Error('"'.concat(i,'" middleware ').concat(c.relation,' "').concat(c.toMiddleware,'" middleware cannot be overridden ')+"by same-name middleware ".concat(u.relation,' "').concat(u.toMiddleware,'" middleware.'));t.splice(s,1)}n.add(i)}t.push(u)},clone:function(){return u(o())},use:function(e){e.applyToStack(l)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=u(o());return t.use(e),t},applyToStack:u,identify:function(){return c(!0).map((function(e){return e.name+": "+(e.tags||[]).join(",")}))},resolve:function(e,t){var n,o;try{for(var i=Object(r.h)(c().map((function(e){return e.middleware})).reverse()),a=i.next();!a.done;a=i.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return e}};return l},i={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},a={high:3,normal:2,low:1},u=function(){function e(e){this.middlewareStack=o(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),s=function(){this.middlewareStack=o()},c="***SensitiveInformation***",l=function(e){if(null!=e){if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&O.warn(w("Expected number but observed string: ".concat(e))),t}if("number"==typeof e)return e;throw new TypeError("Expected number, got ".concat(typeof e,": ").concat(e))}},f=(Math.ceil(Math.pow(2,127)*(2-Math.pow(2,-23))),function(e){if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError("Expected integer, got ".concat(typeof e,": ").concat(e))}}),d=function(e){return p(e,32)},p=function(e,t){var n=f(e);if(void 0!==n&&h(n,t)!==n)throw new TypeError("Expected ".concat(t,"-bit integer, got ").concat(e));return n},h=function(e,t){switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},v=function(e,t){if(null==e){if(t)throw new TypeError("Expected a non-null value for ".concat(t));throw new TypeError("Expected a non-null value")}return e},y=function(e){if(null!=e){if("object"==typeof e&&!Array.isArray(e))return e;var t=Array.isArray(e)?"array":typeof e;throw new TypeError("Expected object, got ".concat(t,": ").concat(e))}},b=function(e){if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return O.warn(w("Expected string, got ".concat(typeof e,": ").concat(e))),String(e);throw new TypeError("Expected string, got ".concat(typeof e,": ").concat(e))}},m=function(e){return"string"==typeof e?g(e):l(e)},g=function(e){switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error("Unable to parse float value: ".concat(e))}},w=function(e){return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((function(e){return!e.includes("stackTraceWarning")})).join("\n")},O={warn:console.warn};new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var S=function(e){function t(n){var r=e.call(this,n.message)||this;return Object.setPrototypeOf(r,t.prototype),r.name=n.name,r.$fault=n.$fault,r.$metadata=n.$metadata,r}return Object(r.c)(t,e),t}(Error),_=function(e,t){void 0===t&&(t={}),Object.entries(t).filter((function(e){return void 0!==Object(r.e)(e,2)[1]})).forEach((function(t){var n=Object(r.e)(t,2),o=n[0],i=n[1];null!=e[o]&&""!==e[o]||(e[o]=i)}));var n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},E=function(e){var t=e.output,n=e.parsedBody,r=e.exceptionCtor,o=e.errorCode,i=x(t),a=i.httpStatusCode?i.httpStatusCode+"":void 0,u=new r({name:n.code||n.Code||o||a||"UnknowError",$fault:"client",$metadata:i});throw _(u,n)},x=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"]}},A=function(e){switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};n(16);function j(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}var T=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(r.g)([null],Object(r.e)(arguments),!1)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};T.prototype=Object.create(String.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(T,String);var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.c)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))},t}(T);function C(e,t,n){var o,i,a,u;if(void 0===t&&void 0===n)a={},u=e;else{if(a=e,"function"==typeof t)return R(a,t,u=n);u=t}try{for(var s=Object(r.h)(Object.keys(u)),c=s.next();!c.done;c=s.next()){var l=c.value;if(Array.isArray(u[l])){var f=Object(r.e)(u[l],2),d=f[0],p=f[1];if("function"==typeof p){var h=void 0,v=void 0===d&&null!=(h=p()),y="function"==typeof d&&!!d(void 0)||"function"!=typeof d&&!!d;v?a[l]=h:y&&(a[l]=p())}else{v=void 0===d&&null!=p,y="function"==typeof d&&!!d(p)||"function"!=typeof d&&!!d;(v||y)&&(a[l]=p)}}else a[l]=u[l]}}catch(e){o={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a}var R=function(e,t,n){return C(e,Object.entries(n).reduce((function(e,n){var o=Object(r.e)(n,2),i=o[0],a=o[1];return Array.isArray(a)?e[i]=a:e[i]="function"==typeof a?[t,a()]:[t,a],e}),{}))},M=function(e,t,n,r,o,i){if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");var a=r();if(a.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");return e=e.replace(o,i?a.split("/").map((function(e){return j(e)})).join("/"):j(a))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(0),o=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(r.a)(Object(r.a)({},this),{headers:Object(r.a)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var o,i=t[n];return Object(r.a)(Object(r.a)({},e),((o={})[n]=Array.isArray(i)?Object(r.g)([],Object(r.e)(i),!1):i,o))}),{}))),n},e}();var i=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"i",(function(){return h})),n.d(t,"a",(function(){return y})),n.d(t,"d",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"h",(function(){return g})),n.d(t,"n",(function(){return O})),n.d(t,"o",(function(){return S})),n.d(t,"j",(function(){return _})),n.d(t,"k",(function(){return E})),n.d(t,"l",(function(){return x})),n.d(t,"m",(function(){return A}));var r,o,i,a,u=n(0),s=n(1),c=n(4),l=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"BadRequestException",$fault:"client"},n))||this;return r.name="BadRequestException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a),f=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"ConflictException",$fault:"client"},n))||this;return r.name="ConflictException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a),d=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"InternalFailureException",$fault:"server"},n))||this;return r.name="InternalFailureException",r.$fault="server",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a),p=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"LimitExceededException",$fault:"client"},n))||this;return r.name="LimitExceededException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r.retryAfterSeconds=n.retryAfterSeconds,r}return Object(u.c)(t,e),t}(c.a),h=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"NotFoundException",$fault:"client"},n))||this;return r.name="NotFoundException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a);!function(e){e.FAILED="Failed",e.FULFILLED="Fulfilled",e.READY_FOR_FULFILLMENT="ReadyForFulfillment"}(r||(r={})),function(e){e.COMPOSITE="Composite",e.CUSTOM_PAYLOAD="CustomPayload",e.PLAIN_TEXT="PlainText",e.SSML="SSML"}(o||(o={})),function(e){e.CLOSE="Close",e.CONFIRM_INTENT="ConfirmIntent",e.DELEGATE="Delegate",e.ELICIT_INTENT="ElicitIntent",e.ELICIT_SLOT="ElicitSlot"}(i||(i={})),function(e){e.CONFIRMED="Confirmed",e.DENIED="Denied",e.NONE="None"}(a||(a={}));var v,y=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"BadGatewayException",$fault:"server"},n))||this;return r.name="BadGatewayException",r.$fault="server",Object.setPrototypeOf(r,t.prototype),r.Message=n.Message,r}return Object(u.c)(t,e),t}(c.a),b=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"DependencyFailedException",$fault:"client"},n))||this;return r.name="DependencyFailedException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r.Message=n.Message,r}return Object(u.c)(t,e),t}(c.a),m=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"LoopDetectedException",$fault:"server"},n))||this;return r.name="LoopDetectedException",r.$fault="server",Object.setPrototypeOf(r,t.prototype),r.Message=n.Message,r}return Object(u.c)(t,e),t}(c.a),g=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"NotAcceptableException",$fault:"client"},n))||this;return r.name="NotAcceptableException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a);!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"}(v||(v={}));var w,O=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"RequestTimeoutException",$fault:"client"},n))||this;return r.name="RequestTimeoutException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a),S=function(e){function t(n){var r=e.call(this,Object(u.a)({name:"UnsupportedMediaTypeException",$fault:"client"},n))||this;return r.name="UnsupportedMediaTypeException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Object(u.c)(t,e),t}(c.a);!function(e){e.GENERIC="application/vnd.amazonaws.card.generic"}(w||(w={}));var _=function(e){return Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},e),e.sessionAttributes&&{sessionAttributes:s.d}),e.requestAttributes&&{requestAttributes:s.d}),e.activeContexts&&{activeContexts:s.d})},E=function(e){return Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},e),e.message&&{message:s.d}),e.encodedMessage&&{encodedMessage:s.d}),e.encodedInputTranscript&&{encodedInputTranscript:s.d}),e.activeContexts&&{activeContexts:s.d})},x=function(e){return Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},e),e.sessionAttributes&&{sessionAttributes:s.d}),e.requestAttributes&&{requestAttributes:s.d}),e.inputText&&{inputText:s.d}),e.activeContexts&&{activeContexts:s.d})},A=function(e){return Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)(Object(u.a)({},e),e.alternativeIntents&&{alternativeIntents:e.alternativeIntents.map((function(e){return function(e){return Object(u.a)(Object(u.a)({},e),e.slots&&{slots:s.d})}(e)}))}),e.slots&&{slots:s.d}),e.sessionAttributes&&{sessionAttributes:s.d}),e.message&&{message:s.d}),e.activeContexts&&{activeContexts:s.d})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),o=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Object(r.c)(t,e),t}(n(1).e)},function(t,n){t.exports=e},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return u}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}Object.create;function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function u(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create},function(e,t,n){"use strict";n.r(t),n.d(t,"locateWindow",(function(){return o}));const r={};function o(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(37);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var o=n(42);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return o.isEmptyData}});var i=n(43);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return i.numToUint8}});var a=n(44);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),o=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var o=e.getVersionPrecision(t),i=e.getVersionPrecision(n),a=Math.max(o,i),u=0,s=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(u=a-Math.min(o,i)),a-=1;a>=u;){if(s[0][a]>s[1][a])return 1;if(s[0][a]===s[1][a]){if(a===u)return 0;a-=1}else if(s[0][a]<s[1][a])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var o=e[n];if(t(o,n))return o}},e.assign=function(e){for(var t,n,r=e,o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(i));var u=function(){var e=i[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=i.length;t<n;t+=1)u();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=o,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(91))&&r.__esModule?r:{default:r},i=n(18);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){}var t,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new o.default(e,t)},e.parse=function(e){return new o.default(e).getResult()},t=e,(n=[{key:"BROWSER_MAP",get:function(){return i.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return i.ENGINE_MAP}},{key:"OS_MAP",get:function(){return i.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return i.PLATFORMS_MAP}}])&&a(t,n),e}();t.default=u,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=s(n(92)),o=s(n(93)),i=s(n(94)),a=s(n(95)),u=s(n(17));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=u.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=u.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=u.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=u.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return u.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,o={},i=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(o[t]=a,i+=1):"object"==typeof a&&(n[t]=a,r+=1)})),r>0){var a=Object.keys(n),s=u.default.find(a,(function(e){return t.isOS(e)}));if(s){var c=this.satisfies(n[s]);if(void 0!==c)return c}var l=u.default.find(a,(function(e){return t.isPlatform(e)}));if(l){var f=this.satisfies(n[l]);if(void 0!==f)return f}}if(i>0){var d=Object.keys(o),p=u.default.find(d,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(o[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),o=u.default.getBrowserTypeByAlias(r);return t&&o&&(r=o.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(u.default.compareVersions(o,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=o.default.getFirstMatch(i,e)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=o.default.getFirstMatch(i,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(t,e),version:o.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:i.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=o.default.getWindowsVersionName(t);return{name:i.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:i.OS_MAP.iOS},n=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=o.default.getMacOSVersionName(t),r={name:i.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=o.default.getAndroidVersionName(t),r={name:i.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:i.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||o.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:i.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=o.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=o.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,o=(r=n(17))&&r.__esModule?r:{default:r},i=n(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:i.ENGINE_MAP.Blink};var t=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:i.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:i.ENGINE_MAP.Trident},n=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:i.ENGINE_MAP.Presto},n=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:i.ENGINE_MAP.Gecko},n=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:i.ENGINE_MAP.WebKit},n=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var r=n(0),o=n(2),i=n(1),a=n(4),u=n(3),s=function(t,n){return Object(r.b)(void 0,void 0,void 0,(function(){var a,u,s,c,l,f,d,p,v;return Object(r.d)(this,(function(r){switch(r.label){case 0:return[4,n.endpoint()];case 1:return a=r.sent(),u=a.hostname,s=a.protocol,c=void 0===s?"https":s,l=a.port,f=a.path,d=h({},H,{"x-amz-content-sha256":"UNSIGNED-PAYLOAD","content-type":t.contentType||"application/octet-stream","x-amz-lex-session-attributes":[function(){return H(t.sessionAttributes)},function(){return n.base64Encoder(e.from(i.c.fromObject(t.sessionAttributes)))}],"x-amz-lex-request-attributes":[function(){return H(t.requestAttributes)},function(){return n.base64Encoder(e.from(i.c.fromObject(t.requestAttributes)))}],accept:t.accept,"x-amz-lex-active-contexts":[function(){return H(t.activeContexts)},function(){return n.base64Encoder(e.from(i.c.fromObject(t.activeContexts)))}]}),p="".concat((null==f?void 0:f.endsWith("/"))?f.slice(0,-1):f||"")+"/bot/{botName}/alias/{botAlias}/user/{userId}/content",p=Object(i.n)(p,t,"botName",(function(){return t.botName}),"{botName}",!1),p=Object(i.n)(p,t,"botAlias",(function(){return t.botAlias}),"{botAlias}",!1),p=Object(i.n)(p,t,"userId",(function(){return t.userId}),"{userId}",!1),void 0!==t.inputStream&&(v=t.inputStream),[2,new o.a({protocol:c,hostname:u,port:l,method:"POST",headers:d,path:p,body:v})]}}))}))},c=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,a,u,s,c,l,f,d,p;return Object(r.d)(this,(function(h){switch(h.label){case 0:return[4,t.endpoint()];case 1:return n=h.sent(),a=n.hostname,u=n.protocol,s=void 0===u?"https":u,c=n.port,l=n.path,f={"content-type":"application/json"},d="".concat((null==l?void 0:l.endsWith("/"))?l.slice(0,-1):l||"")+"/bot/{botName}/alias/{botAlias}/user/{userId}/text",d=Object(i.n)(d,e,"botName",(function(){return e.botName}),"{botName}",!1),d=Object(i.n)(d,e,"botAlias",(function(){return e.botAlias}),"{botAlias}",!1),d=Object(i.n)(d,e,"userId",(function(){return e.userId}),"{userId}",!1),p=JSON.stringify(Object(r.a)(Object(r.a)(Object(r.a)(Object(r.a)({},null!=e.activeContexts&&{activeContexts:j(e.activeContexts,t)}),null!=e.inputText&&{inputText:e.inputText}),null!=e.requestAttributes&&{requestAttributes:P(e.requestAttributes,t)}),null!=e.sessionAttributes&&{sessionAttributes:P(e.sessionAttributes,t)})),[2,new o.a({protocol:s,hostname:a,port:c,method:"POST",headers:f,path:d,body:p})]}}))}))},l=function(t,n){return Object(r.b)(void 0,void 0,void 0,(function(){var o,a;return Object(r.d)(this,(function(r){return 200!==t.statusCode&&t.statusCode>=300?[2,f(t,n)]:(o=h({$metadata:z(t),contentType:[,t.headers["content-type"]],intentName:[,t.headers["x-amz-lex-intent-name"]],nluIntentConfidence:[function(){return void 0!==t.headers["x-amz-lex-nlu-intent-confidence"]},function(){return new i.c(e.from(n.base64Decoder(t.headers["x-amz-lex-nlu-intent-confidence"])).toString("utf8"))}],alternativeIntents:[function(){return void 0!==t.headers["x-amz-lex-alternative-intents"]},function(){return new i.c(e.from(n.base64Decoder(t.headers["x-amz-lex-alternative-intents"])).toString("utf8"))}],slots:[function(){return void 0!==t.headers["x-amz-lex-slots"]},function(){return new i.c(e.from(n.base64Decoder(t.headers["x-amz-lex-slots"])).toString("utf8"))}],sessionAttributes:[function(){return void 0!==t.headers["x-amz-lex-session-attributes"]},function(){return new i.c(e.from(n.base64Decoder(t.headers["x-amz-lex-session-attributes"])).toString("utf8"))}],sentimentResponse:[,t.headers["x-amz-lex-sentiment"]],message:[,t.headers["x-amz-lex-message"]],encodedMessage:[,t.headers["x-amz-lex-encoded-message"]],messageFormat:[,t.headers["x-amz-lex-message-format"]],dialogState:[,t.headers["x-amz-lex-dialog-state"]],slotToElicit:[,t.headers["x-amz-lex-slot-to-elicit"]],inputTranscript:[,t.headers["x-amz-lex-input-transcript"]],encodedInputTranscript:[,t.headers["x-amz-lex-encoded-input-transcript"]],botVersion:[,t.headers["x-amz-lex-bot-version"]],sessionId:[,t.headers["x-amz-lex-session-id"]],activeContexts:[function(){return void 0!==t.headers["x-amz-lex-active-contexts"]},function(){return new i.c(e.from(n.base64Decoder(t.headers["x-amz-lex-active-contexts"])).toString("utf8"))}]}),a=t.body,o.audioStream=a,[2,o])}))}))},f=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,o,u,s,c;return Object(r.d)(this,(function(l){switch(l.label){case 0:return o=[Object(r.a)({},e)],c={},[4,$(e.body,t)];case 1:switch(n=r.a.apply(void 0,o.concat([(c.body=l.sent(),c)])),u=V(e,n.body),u){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];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[4,v(n,t)];case 3:throw l.sent();case 4:return[4,y(n,t)];case 5:throw l.sent();case 6:return[4,b(n,t)];case 7:throw l.sent();case 8:return[4,m(n,t)];case 9:throw l.sent();case 10:return[4,g(n,t)];case 11:throw l.sent();case 12:return[4,w(n,t)];case 13:throw l.sent();case 14:return[4,O(n,t)];case 15:throw l.sent();case 16:return[4,S(n,t)];case 17:throw l.sent();case 18:return[4,_(n,t)];case 19:throw l.sent();case 20:return[4,E(n,t)];case 21:throw l.sent();case 22:return[4,x(n,t)];case 23:throw l.sent();case 24:s=n.body,Object(i.o)({output:e,parsedBody:s,exceptionCtor:a.a,errorCode:u}),l.label=25;case 25:return[2]}}))}))},d=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,o,a,u;return Object(r.d)(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,p(e,t)]:(n=h({$metadata:z(e)}),a=i.h,u=i.i,[4,G(e.body,t)]);case 1:return null!=(o=a.apply(void 0,[u.apply(void 0,[r.sent()]),"body"])).activeContexts&&(n.activeContexts=R(o.activeContexts,t)),null!=o.alternativeIntents&&(n.alternativeIntents=L(o.alternativeIntents,t)),null!=o.botVersion&&(n.botVersion=Object(i.j)(o.botVersion)),null!=o.dialogState&&(n.dialogState=Object(i.j)(o.dialogState)),null!=o.intentName&&(n.intentName=Object(i.j)(o.intentName)),null!=o.message&&(n.message=Object(i.j)(o.message)),null!=o.messageFormat&&(n.messageFormat=Object(i.j)(o.messageFormat)),null!=o.nluIntentConfidence&&(n.nluIntentConfidence=I(o.nluIntentConfidence,t)),null!=o.responseCard&&(n.responseCard=B(o.responseCard,t)),null!=o.sentimentResponse&&(n.sentimentResponse=U(o.sentimentResponse,t)),null!=o.sessionAttributes&&(n.sessionAttributes=F(o.sessionAttributes,t)),null!=o.sessionId&&(n.sessionId=Object(i.j)(o.sessionId)),null!=o.slotToElicit&&(n.slotToElicit=Object(i.j)(o.slotToElicit)),null!=o.slots&&(n.slots=F(o.slots,t)),[2,n]}}))}))},p=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,o,u,s,c;return Object(r.d)(this,(function(l){switch(l.label){case 0:return o=[Object(r.a)({},e)],c={},[4,$(e.body,t)];case 1:switch(n=r.a.apply(void 0,o.concat([(c.body=l.sent(),c)])),u=V(e,n.body),u){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]}return[3,18];case 2:return[4,v(n,t)];case 3:throw l.sent();case 4:return[4,y(n,t)];case 5:throw l.sent();case 6:return[4,b(n,t)];case 7:throw l.sent();case 8:return[4,m(n,t)];case 9:throw l.sent();case 10:return[4,g(n,t)];case 11:throw l.sent();case 12:return[4,w(n,t)];case 13:throw l.sent();case 14:return[4,O(n,t)];case 15:throw l.sent();case 16:return[4,_(n,t)];case 17:throw l.sent();case 18:s=n.body,Object(i.o)({output:e,parsedBody:s,exceptionCtor:a.a,errorCode:u}),l.label=19;case 19:return[2]}}))}))},h=i.m,v=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).Message&&(t.Message=Object(i.j)(n.Message)),o=new u.a(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},y=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.b(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},b=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.c(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},m=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).Message&&(t.Message=Object(i.j)(n.Message)),o=new u.d(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},g=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.e(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},w=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({retryAfterSeconds:[,e.headers["retry-after"]]}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.f(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},O=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).Message&&(t.Message=Object(i.j)(n.Message)),o=new u.g(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},S=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.h(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},_=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.i(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},E=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.n(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},x=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var t,n,o;return Object(r.d)(this,(function(a){return t=h({}),null!=(n=e.body).message&&(t.message=Object(i.j)(n.message)),o=new u.o(Object(r.a)({$metadata:z(e)},t)),[2,Object(i.f)(o,e.body)]}))}))},A=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(r.e)(t,2),i=o[0],a=o[1];return null===a?e:Object(r.a)(Object(r.a)({},e),((n={})[i]=a,n))}),{})},j=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return function(e,t){return Object(r.a)(Object(r.a)(Object(r.a)({},null!=e.name&&{name:e.name}),null!=e.parameters&&{parameters:A(e.parameters,t)}),null!=e.timeToLive&&{timeToLive:T(e.timeToLive,t)})}(e,t)}))},T=function(e,t){return Object(r.a)(Object(r.a)({},null!=e.timeToLiveInSeconds&&{timeToLiveInSeconds:e.timeToLiveInSeconds}),null!=e.turnsToLive&&{turnsToLive:e.turnsToLive})},P=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(r.e)(t,2),i=o[0],a=o[1];return null===a?e:Object(r.a)(Object(r.a)({},e),((n={})[i]=a,n))}),{})},C=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(r.e)(t,2),a=o[0],u=o[1];return null===u?e:Object(r.a)(Object(r.a)({},e),((n={})[a]=Object(i.j)(u),n))}),{})},R=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{name:Object(i.j)(e.name),parameters:null!=e.parameters?C(e.parameters,t):void 0,timeToLive:null!=e.timeToLive?M(e.timeToLive,t):void 0}}(e,t)}))},M=function(e,t){return{timeToLiveInSeconds:Object(i.g)(e.timeToLiveInSeconds),turnsToLive:Object(i.g)(e.turnsToLive)}},k=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{attachmentLinkUrl:Object(i.j)(e.attachmentLinkUrl),buttons:null!=e.buttons?D(e.buttons,t):void 0,imageUrl:Object(i.j)(e.imageUrl),subTitle:Object(i.j)(e.subTitle),title:Object(i.j)(e.title)}}(e,t)}))},I=function(e,t){return{score:Object(i.k)(e.score)}},L=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:N(e,t)}))},D=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{text:Object(i.j)(e.text),value:Object(i.j)(e.value)}}(e)}))},N=function(e,t){return{intentName:Object(i.j)(e.intentName),nluIntentConfidence:null!=e.nluIntentConfidence?I(e.nluIntentConfidence,t):void 0,slots:null!=e.slots?F(e.slots,t):void 0}},B=function(e,t){return{contentType:Object(i.j)(e.contentType),genericAttachments:null!=e.genericAttachments?k(e.genericAttachments,t):void 0,version:Object(i.j)(e.version)}},U=function(e,t){return{sentimentLabel:Object(i.j)(e.sentimentLabel),sentimentScore:Object(i.j)(e.sentimentScore)}},F=function(e,t){return Object.entries(e).reduce((function(e,t){var n,o=Object(r.e)(t,2),a=o[0],u=o[1];return null===u?e:Object(r.a)(Object(r.a)({},e),((n={})[a]=Object(i.j)(u),n))}),{})},z=function(e){var t,n;return{httpStatusCode:e.statusCode,requestId:null!==(n=null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"])&&void 0!==n?n:e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},q=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)}))},H=function(e){return!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size)},G=function(e,t){return q(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},$=function(e,t){return Object(r.b)(void 0,void 0,void 0,(function(){var n,o;return Object(r.d)(this,(function(r){switch(r.label){case 0:return[4,G(e,t)];case 1:return(n=r.sent()).message=null!==(o=n.message)&&void 0!==o?o:n.Message,[2,n]}}))}))},V=function(e,t){var n,r,o=function(e){var t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):void 0}}).call(this,n(20).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AwsCrc32=t.Crc32=t.crc32=void 0;var r=n(29),o=n(8);t.crc32=function(e){return(new i).update(e).digest()};var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var o=(0,r.__values)(e),i=o.next();!i.done;i=o.next()){var u=i.value;this.checksum=this.checksum>>>8^a[255&(this.checksum^u)]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}();t.Crc32=i;var a=(0,o.uint32ArrayFrom)([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),u=n(71);Object.defineProperty(t,"AwsCrc32",{enumerable:!0,get:function(){return u.AwsCrc32}})},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(6),o=n(34),i={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},a=function(t){return{applyToStack:function(n){n.add(function(t){return function(n){return function(i){return Object(r.b)(void 0,void 0,void 0,(function(){var a,u,s,c;return Object(r.c)(this,(function(l){return a=i.request,!o.a.isInstance(a)||"node"!==t.runtime||a.headers.hasOwnProperty("X-Amzn-Trace-Id")?[2,n(i)]:(u=e.env.AWS_LAMBDA_FUNCTION_NAME,s=e.env._X_AMZN_TRACE_ID,(c=function(e){return"string"==typeof e&&e.length>0})(u)&&c(s)&&(a.headers["X-Amzn-Trace-Id"]=s),[2,n(Object(r.a)(Object(r.a)({},i),{request:a}))])}))}))}}}(t),i)}}}}).call(this,n(13))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=u(d);l=!0;for(var t=c.length;t;){for(s=c,c=[];++f<t;)s&&s[f].run();f=-1,t=c.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||u(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */
16
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
17
- /*! *****************************************************************************
18
- Copyright (c) Microsoft Corporation.
19
-
20
- Permission to use, copy, modify, and/or distribute this software for any
21
- purpose with or without fee is hereby granted.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
24
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
25
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
26
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
27
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
28
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
29
- PERFORMANCE OF THIS SOFTWARE.
30
- ***************************************************************************** */
31
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";(function(e){}).call(this,n(13))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(36),o=n(18),i=n(73),a=n(7),u=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=(0,a.locateWindow)().msCrypto.subtle.importKey("raw",s(e),o.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n(new Error("ImportKey completed without importing key."))},r.onerror=function(){n(new Error("ImportKey failed to import key."))}}))}(e).then((function(e){return(0,a.locateWindow)().msCrypto.subtle.sign(o.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve((0,a.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,r.isEmptyData)(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(s(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n(new Error("Error encountered finalizing hash"))},e.finish()}))}))},e}();function s(e){return"string"==typeof e?(0,i.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(8),o=n(18),i=n(7),a=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){(0,i.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(e),o.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!(0,r.isEmptyData)(e)){var t=(0,r.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,i.locateWindow)().crypto.subtle.sign(o.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,r.isEmptyData)(this.toHash)?Promise.resolve(o.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,i.locateWindow)().crypto.subtle.digest(o.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();t.Sha256=a},function(e,t,n){"use strict";(function(e){
32
- /*!
33
- * The buffer module from node.js, for the browser.
34
- *
35
- * @author Feross Aboukhadijeh <http://feross.org>
36
- * @license MIT
37
- */
38
- var r=n(39),o=n(40),i=n(41);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),o=(e=u(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(s.isBuffer(t)){var n=0|p(t.length);return 0===(e=u(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?u(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=u(e,t<0?0:0|p(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|p(t.length);e=u(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,o){var i,a=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<u;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===s)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+s>u&&(n=u-s),i=n;i>=0;i--){for(var f=!0,d=0;d<s;d++)if(c(e,i+d)!==c(t,d)){f=!1;break}if(f)return i}return-1}function g(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;e[n+a]=u}return a}function w(e,t,n,r){return q(F(t,e.length-n),e,n,r)}function O(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return O(e,t,n,r)}function _(e,t,n,r){return q(z(t),e,n,r)}function E(e,t,n,r){return q(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,u,s,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&c)<<6|63&i)>127&&(l=s);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(s=(15&c)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(l=s);break;case 4:i=e[o+1],a=e[o+2],u=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(s=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(l=s)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=s,t.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return c(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?u(e,t):void 0!==n?"string"==typeof r?u(e,t).fill(n,r):u(e,t).fill(n):u(e,t)}(null,e,t,n)},s.allocUnsafe=function(e){return f(null,e)},s.allocUnsafeSlow=function(e){return f(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!s.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):v.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,r,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),u=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),f=0;f<u;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},s.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return O(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=U(e[i]);return o}function C(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function k(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function I(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),s.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=s.prototype;else{var o=t-e;n=new s(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},s.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},s.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},s.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},s.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=s.isBuffer(e)?e:F(new s(e,r).toString()),u=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%u]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(38))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
39
- /*! *****************************************************************************
40
- Copyright (c) Microsoft Corporation.
41
-
42
- Permission to use, copy, modify, and/or distribute this software for any
43
- purpose with or without fee is hereby granted.
44
-
45
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
46
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
48
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
50
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51
- PERFORMANCE OF THIS SOFTWARE.
52
- ***************************************************************************** */
53
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";(function(e){}).call(this,n(13))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(58),o=n(25),i=n(74),a=n(7),u=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=(0,a.locateWindow)().msCrypto.subtle.importKey("raw",s(e),o.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n(new Error("ImportKey completed without importing key."))},r.onerror=function(){n(new Error("ImportKey failed to import key."))}}))}(e).then((function(e){return(0,a.locateWindow)().msCrypto.subtle.sign(o.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve((0,a.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,r.isEmptyData)(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(s(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n(new Error("Error encountered finalizing hash"))},e.finish()}))}))},e}();function s(e){return"string"==typeof e?(0,i.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(8),o=n(25),i=n(7),a=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){(0,i.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(e),o.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!(0,r.isEmptyData)(e)){var t=(0,r.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,i.locateWindow)().crypto.subtle.sign(o.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,r.isEmptyData)(this.toHash)?Promise.resolve(o.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,i.locateWindow)().crypto.subtle.digest(o.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
54
- /*! *****************************************************************************
55
- Copyright (c) Microsoft Corporation.
56
-
57
- Permission to use, copy, modify, and/or distribute this software for any
58
- purpose with or without fee is hereby granted.
59
-
60
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
61
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
62
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
63
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
64
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
65
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
66
- PERFORMANCE OF THIS SOFTWARE.
67
- ***************************************************************************** */
68
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
69
- /*! *****************************************************************************
70
- Copyright (c) Microsoft Corporation.
71
-
72
- Permission to use, copy, modify, and/or distribute this software for any
73
- purpose with or without fee is hereby granted.
74
-
75
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
76
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
77
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
78
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
79
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
80
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
81
- PERFORMANCE OF THIS SOFTWARE.
82
- ***************************************************************************** */
83
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,(0,n(14).__exportStar)(n(35),t);var r=n(17);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var o=n(19);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return o.Sha256}})},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.186.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","test":"yarn test:unit","test:unit":"ts-mocha test/**/*.spec.ts"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"2.0.0","@aws-crypto/sha256-js":"2.0.0","@aws-sdk/client-sts":"3.186.0","@aws-sdk/config-resolver":"3.186.0","@aws-sdk/credential-provider-node":"3.186.0","@aws-sdk/fetch-http-handler":"3.186.0","@aws-sdk/hash-node":"3.186.0","@aws-sdk/invalid-dependency":"3.186.0","@aws-sdk/middleware-content-length":"3.186.0","@aws-sdk/middleware-host-header":"3.186.0","@aws-sdk/middleware-logger":"3.186.0","@aws-sdk/middleware-recursion-detection":"3.186.0","@aws-sdk/middleware-retry":"3.186.0","@aws-sdk/middleware-serde":"3.186.0","@aws-sdk/middleware-signing":"3.186.0","@aws-sdk/middleware-stack":"3.186.0","@aws-sdk/middleware-user-agent":"3.186.0","@aws-sdk/node-config-provider":"3.186.0","@aws-sdk/node-http-handler":"3.186.0","@aws-sdk/protocol-http":"3.186.0","@aws-sdk/smithy-client":"3.186.0","@aws-sdk/types":"3.186.0","@aws-sdk/url-parser":"3.186.0","@aws-sdk/util-base64-browser":"3.186.0","@aws-sdk/util-base64-node":"3.186.0","@aws-sdk/util-body-length-browser":"3.186.0","@aws-sdk/util-body-length-node":"3.186.0","@aws-sdk/util-defaults-mode-browser":"3.186.0","@aws-sdk/util-defaults-mode-node":"3.186.0","@aws-sdk/util-user-agent-browser":"3.186.0","@aws-sdk/util-user-agent-node":"3.186.0","@aws-sdk/util-utf8-browser":"3.186.0","@aws-sdk/util-utf8-node":"3.186.0","tslib":"^2.3.1"},"devDependencies":{"@aws-sdk/service-client-documentation-generator":"3.186.0","@tsconfig/recommended":"1.0.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^12.7.5","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.19.2","typescript":"~4.6.2"},"overrides":{"typedoc":{"typescript":"~4.6.2"}},"engines":{"node":">=12.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"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"}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,(0,n(15).__exportStar)(n(57),t);var r=n(24);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var o=n(26);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return o.Sha256}})},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-lex-runtime-v2","description":"AWS SDK for JavaScript Lex Runtime V2 Client for Node.js, Browser and React Native","version":"3.186.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"tsc -p tsconfig.cjs.json","build:docs":"typedoc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"2.0.0","@aws-crypto/sha256-js":"2.0.0","@aws-sdk/client-sts":"3.186.0","@aws-sdk/config-resolver":"3.186.0","@aws-sdk/credential-provider-node":"3.186.0","@aws-sdk/eventstream-handler-node":"3.186.0","@aws-sdk/eventstream-serde-browser":"3.186.0","@aws-sdk/eventstream-serde-config-resolver":"3.186.0","@aws-sdk/eventstream-serde-node":"3.186.0","@aws-sdk/fetch-http-handler":"3.186.0","@aws-sdk/hash-node":"3.186.0","@aws-sdk/invalid-dependency":"3.186.0","@aws-sdk/middleware-content-length":"3.186.0","@aws-sdk/middleware-eventstream":"3.186.0","@aws-sdk/middleware-host-header":"3.186.0","@aws-sdk/middleware-logger":"3.186.0","@aws-sdk/middleware-recursion-detection":"3.186.0","@aws-sdk/middleware-retry":"3.186.0","@aws-sdk/middleware-serde":"3.186.0","@aws-sdk/middleware-signing":"3.186.0","@aws-sdk/middleware-stack":"3.186.0","@aws-sdk/middleware-user-agent":"3.186.0","@aws-sdk/node-config-provider":"3.186.0","@aws-sdk/node-http-handler":"3.186.0","@aws-sdk/protocol-http":"3.186.0","@aws-sdk/smithy-client":"3.186.0","@aws-sdk/types":"3.186.0","@aws-sdk/url-parser":"3.186.0","@aws-sdk/util-base64-browser":"3.186.0","@aws-sdk/util-base64-node":"3.186.0","@aws-sdk/util-body-length-browser":"3.186.0","@aws-sdk/util-body-length-node":"3.186.0","@aws-sdk/util-defaults-mode-browser":"3.186.0","@aws-sdk/util-defaults-mode-node":"3.186.0","@aws-sdk/util-user-agent-browser":"3.186.0","@aws-sdk/util-user-agent-node":"3.186.0","@aws-sdk/util-utf8-browser":"3.186.0","@aws-sdk/util-utf8-node":"3.186.0","tslib":"^2.3.1"},"devDependencies":{"@aws-sdk/service-client-documentation-generator":"3.186.0","@tsconfig/recommended":"1.0.1","@types/node":"^12.7.5","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typedoc":"0.19.2","typescript":"~4.6.2"},"overrides":{"typedoc":{"typescript":"~4.6.2"}},"engines":{"node":">=12.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-runtime-v2","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-lex-runtime-v2"}}')},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(6),o=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(r.a)(Object(r.a)({},this),{headers:Object(r.a)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var o,i=t[n];return Object(r.a)(Object(r.a)({},e),((o={})[n]=Array.isArray(i)?Object(r.e)([],Object(r.d)(i),!1):i,o))}),{}))),n},e}();!function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(17),o=n(19),i=n(45),a=n(48),u=n(50),s=n(7),c=function(){function e(e){(0,a.supportsWebCrypto)((0,s.locateWindow)())?this.hash=new o.Sha256(e):(0,u.isMsWindow)((0,s.locateWindow)())?this.hash=new r.Sha256(e):this.hash=new i.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(75),o=void 0!==e&&e.from?function(t){return e.from(t,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?o(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}).call(this,n(20).Buffer)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],u=r[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,u)),l=0,f=u>0?a-4:a;for(n=0;n<f;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],s[l++]=t>>16&255,s[l++]=t>>8&255,s[l++]=255&t;2===u&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,s[l++]=255&t);1===u&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,u=n-o;a<u;a+=16383)i.push(l(e,a,a+16383>u?u:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=a.length;u<s;++u)r[u]=a[u],o[a.charCodeAt(u)]=u;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],u=t;u<n;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
84
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
85
- t.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,s=(1<<u)-1,c=s>>1,l=-7,f=n?o-1:0,d=n?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-l)-1,p>>=-l,l+=u;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,u,s,c=8*i-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=l?(u=0,a=l):a+f>=1?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&u,p+=h,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*v}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(14).__exportStar(n(46),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(14),o=n(21),i=n(47),a=n(8),u=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(21),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=0;f<r.BLOCK_SIZE;f++){if(f<16)this.temp[f]=(255&e[4*f])<<24|(255&e[4*f+1])<<16|(255&e[4*f+2])<<8|255&e[4*f+3];else{var d=this.temp[f-2],p=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[f-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[f]=(p+this.temp[f-7]|0)+(h+this.temp[f-16]|0)}var v=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&s^~u&c)|0)+(l+(r.KEY[f]+this.temp[f]|0)|0)|0,y=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;l=c,c=s,s=u,u=a+v|0,a=i,i=o,o=n,n=v+y|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=u,t[5]+=s,t[6]+=c,t[7]+=l},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(22).__exportStar(n(49),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(22),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(51);r.__exportStar(n(52),t),r.__exportStar(n(53),t),r.__exportStar(n(54),t),r.__exportStar(n(55),t),r.__exportStar(n(56),t)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
86
- /*! *****************************************************************************
87
- Copyright (c) Microsoft Corporation.
88
-
89
- Permission to use, copy, modify, and/or distribute this software for any
90
- purpose with or without fee is hereby granted.
91
-
92
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
93
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
94
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
95
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
96
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
97
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
98
- PERFORMANCE OF THIS SOFTWARE.
99
- ***************************************************************************** */
100
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(24),o=n(26),i=n(59),a=n(62),u=n(64),s=n(7),c=function(){function e(e){(0,a.supportsWebCrypto)((0,s.locateWindow)())?this.hash=new o.Sha256(e):(0,u.isMsWindow)((0,s.locateWindow)())?this.hash=new r.Sha256(e):this.hash=new i.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(15).__exportStar(n(60),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(15),o=n(27),i=n(61),a=n(8),u=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(27),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=0;f<r.BLOCK_SIZE;f++){if(f<16)this.temp[f]=(255&e[4*f])<<24|(255&e[4*f+1])<<16|(255&e[4*f+2])<<8|255&e[4*f+3];else{var d=this.temp[f-2],p=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[f-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[f]=(p+this.temp[f-7]|0)+(h+this.temp[f-16]|0)}var v=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&s^~u&c)|0)+(l+(r.KEY[f]+this.temp[f]|0)|0)|0,y=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;l=c,c=s,s=u,u=a+v|0,a=i,i=o,o=n,n=v+y|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=u,t[5]+=s,t[6]+=c,t[7]+=l},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(28).__exportStar(n(63),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(28),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65);r.__exportStar(n(66),t),r.__exportStar(n(67),t),r.__exportStar(n(68),t),r.__exportStar(n(69),t),r.__exportStar(n(70),t)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return s})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return d})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return y})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return g})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return _})),n.d(t,"__importDefault",(function(){return E})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
101
- /*! *****************************************************************************
102
- Copyright (c) Microsoft Corporation.
103
-
104
- Permission to use, copy, modify, and/or distribute this software for any
105
- purpose with or without fee is hereby granted.
106
-
107
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
108
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
109
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
110
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
111
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
112
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
113
- PERFORMANCE OF THIS SOFTWARE.
114
- ***************************************************************************** */
115
- var r=function(e,t){return(r=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])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;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){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function d(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function b(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof m?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function _(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AwsCrc32=void 0;var r=n(29),o=n(8),i=n(11),a=function(){function e(){this.crc32=new i.Crc32}return e.prototype.update=function(e){(0,o.isEmptyData)(e)||this.crc32.update((0,o.convertToBuffer)(e))},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,(0,o.numToUint8)(this.crc32.digest())]}))}))},e}();t.AwsCrc32=a},function(e,t,n){"use strict";n.r(t),n.d(t,"AbstractInteractionsProvider",(function(){return u})),n.d(t,"AWSLexProvider",(function(){return Tn})),n.d(t,"AWSLexV2Provider",(function(){return Mu})),n.d(t,"Interactions",(function(){return kn}));var r,o=n(5),i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},a=new o.ConsoleLogger("AbstractInteractionsProvider"),u=function(){function e(e){void 0===e&&(e={}),this._config=e}return e.prototype.configure=function(e){return void 0===e&&(e={}),this._config=i(i({},this._config),e),a.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"Interactions"},Object.defineProperty(e.prototype,"options",{get:function(){return i({},this._config)},enumerable:!0,configurable:!0}),e}(),s=n(0);!function(e){e.ENV="env",e.CONFIG="shared config entry"}(r||(r={}));var c=function(e){if("function"==typeof e)return e;var t=Promise.resolve(e);return function(){return t}},l=function(e){var t,n=c(e.useDualstackEndpoint),r=e.endpoint,o=e.useFipsEndpoint,i=e.urlParser;return Object(s.a)(Object(s.a)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:r?c("string"==typeof r?i(r):r):function(){return function(e){return Object(s.b)(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,u;return Object(s.d)(this,(function(s){switch(s.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=s.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.useDualstackEndpoint()];case 2:return o=s.sent(),[4,e.useFipsEndpoint()];case 3:return i=s.sent(),[4,e.regionInfoProvider(r,{useDualstackEndpoint:o,useFipsEndpoint:i})];case 4:if(!(a=(null!==(u=s.sent())&&void 0!==u?u:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser("".concat(n?"https:":"http:","//").concat(a))]}}))}))}(Object(s.a)(Object(s.a)({},e),{useDualstackEndpoint:n,useFipsEndpoint:o}))},isCustomEndpoint:!!r,useDualstackEndpoint:n})},f=function(e){return"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},d=function(e){return f(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},p=function(e,t){var n;void 0===e&&(e=[]);var r=t.useFipsEndpoint,o=t.useDualstackEndpoint;return null===(n=e.find((function(e){var t=e.tags;return r===t.includes("fips")&&o===t.includes("dualstack")})))||void 0===n?void 0:n.hostname},h=function(e,t){var n,r,o,i,a,u,c=t.useFipsEndpoint,l=void 0!==c&&c,f=t.useDualstackEndpoint,d=void 0!==f&&f,h=t.signingService,v=t.regionHash,y=t.partitionHash,b=function(e,t){var n,r=t.partitionHash;return null!==(n=Object.keys(r||{}).find((function(t){return r[t].regions.includes(e)})))&&void 0!==n?n:"aws"}(e,{partitionHash:y}),m=e in v?e:null!==(r=null===(n=y[b])||void 0===n?void 0:n.endpoint)&&void 0!==r?r:e,g={useFipsEndpoint:l,useDualstackEndpoint:d},w=function(e,t){var n=t.regionHostname,r=t.partitionHostname;return n||(r?r.replace("{region}",e):void 0)}(m,{regionHostname:p(null===(o=v[m])||void 0===o?void 0:o.variants,g),partitionHostname:p(null===(i=y[b])||void 0===i?void 0:i.variants,g)});if(void 0===w)throw new Error("Endpoint resolution failed for: ".concat({resolvedRegion:m,useFipsEndpoint:l,useDualstackEndpoint:d}));var O=function(e,t){var n=t.signingRegion,r=t.regionRegex,o=t.useFipsEndpoint;if(n)return n;if(o){var i=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),a=e.match(i);if(a)return a[0].slice(1,-1)}}(w,{signingRegion:null===(a=v[m])||void 0===a?void 0:a.signingRegion,regionRegex:y[b].regionRegex,useFipsEndpoint:l});return Object(s.a)(Object(s.a)({partition:b,signingService:h,hostname:w},O&&{signingRegion:O}),(null===(u=v[m])||void 0===u?void 0:u.signingService)&&{signingService:v[m].signingService})},v=n(2);var y={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},b=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(s.b)(t,void 0,void 0,(function(){var t,o,i,a,u;return Object(s.d)(this,(function(c){if(t=r.request,v.a.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")))try{a=e(o),t.headers=Object(s.a)(Object(s.a)({},t.headers),((u={})["content-length"]=String(a),u))}catch(e){}return[2,n(Object(s.a)(Object(s.a)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),y)}}};var m,g={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},w=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(s.b)(void 0,void 0,void 0,(function(){var r,o;return Object(s.d)(this,(function(i){return v.a.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),g)}}},O={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},S=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(s.b)(void 0,void 0,void 0,(function(){var r,o,i,a,u,c,l,f,d;return Object(s.d)(this,(function(p){switch(p.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,u=t.outputFilterSensitiveLog,[4,e(n)];case 1:return c=p.sent(),a?("function"==typeof a.info&&(l=c.output,f=l.$metadata,d=Object(s.f)(l,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:u(d),metadata:f})),[2,c]):[2,c]}}))}))}}),O)}}},_=n(12);!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(m||(m={}));var E,x=m.STANDARD,A=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],j=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],T=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],P=[500,502,503,504],C=["ECONNRESET","EPIPE","ETIMEDOUT"],R=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||j.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},M=function(){function e(e){var t,n,r,o,i;this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=null!==(t=null==e?void 0:e.beta)&&void 0!==t?t:.7,this.minCapacity=null!==(n=null==e?void 0:e.minCapacity)&&void 0!==n?n:1,this.minFillRate=null!==(r=null==e?void 0:e.minFillRate)&&void 0!==r?r:.5,this.scaleConstant=null!==(o=null==e?void 0:e.scaleConstant)&&void 0!==o?o:.4,this.smooth=null!==(i=null==e?void 0:e.smooth)&&void 0!==i?i:.8;var a=this.getCurrentTimeInSeconds();this.lastThrottleTime=a,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}return e.prototype.getCurrentTimeInSeconds=function(){return Date.now()/1e3},e.prototype.getSendToken=function(){return Object(s.b)(this,void 0,void 0,(function(){return Object(s.d)(this,(function(e){return[2,this.acquireTokenBucket(1)]}))}))},e.prototype.acquireTokenBucket=function(e){return Object(s.b)(this,void 0,void 0,(function(){var t;return Object(s.d)(this,(function(n){switch(n.label){case 0:return this.enabled?(this.refillTokenBucket(),e>this.currentCapacity?(t=(e-this.currentCapacity)/this.fillRate*1e3,[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return this.currentCapacity=this.currentCapacity-e,[2]}}))}))},e.prototype.refillTokenBucket=function(){var e=this.getCurrentTimeInSeconds();if(this.lastTimestamp){var t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}else this.lastTimestamp=e},e.prototype.updateClientSendingRate=function(e){var t;if(this.updateMeasuredRate(),R(e)){var n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());var r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)},e.prototype.calculateTimeWindow=function(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))},e.prototype.cubicThrottle=function(e){return this.getPrecise(e*this.beta)},e.prototype.cubicSuccess=function(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)},e.prototype.enableTokenBucket=function(){this.enabled=!0},e.prototype.updateTokenBucketRate=function(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)},e.prototype.updateMeasuredRate=function(){var e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){var n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}},e.prototype.getPrecise=function(e){return parseFloat(e.toFixed(8))},e}(),k=new Uint8Array(16);function I(){if(!E&&!(E="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(k)}var L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var D=function(e){return"string"==typeof e&&L.test(e)},N=[],B=0;B<256;++B)N.push((B+256).toString(16).substr(1));var U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(N[e[t+0]]+N[e[t+1]]+N[e[t+2]]+N[e[t+3]]+"-"+N[e[t+4]]+N[e[t+5]]+"-"+N[e[t+6]]+N[e[t+7]]+"-"+N[e[t+8]]+N[e[t+9]]+"-"+N[e[t+10]]+N[e[t+11]]+N[e[t+12]]+N[e[t+13]]+N[e[t+14]]+N[e[t+15]]).toLowerCase();if(!D(n))throw TypeError("Stringified UUID is invalid");return n};var F=function(e,t,n){var r=(e=e||{}).random||(e.rng||I)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return U(r)},z=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},q=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return A.includes(e.name)}(e)||R(e)||function(e){var t;return T.includes(e.name)||C.includes((null==e?void 0:e.code)||"")||P.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},H=function(){function e(e,t){var n,r,o;this.maxAttemptsProvider=e,this.mode=m.STANDARD,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:q,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:z,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:function(e,t){var n,r,o,i=e,a=null!==(n=null==t?void 0:t.noRetryIncrement)&&void 0!==n?n:1,u=null!==(r=null==t?void 0:t.retryCost)&&void 0!==r?r:5,s=null!==(o=null==t?void 0:t.timeoutRetryCost)&&void 0!==o?o:10,c=e,l=function(e){return"TimeoutError"===e.name?s:u},f=function(e){return l(e)<=c};return Object.freeze({hasRetryTokens:f,retrieveRetryTokens:function(e){if(!f(e))throw new Error("No retry token available");var t=l(e);return c-=t,t},releaseRetryTokens:function(e){c+=null!=e?e:a,c=Math.min(c,i)}})}(500)}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(s.b)(this,void 0,void 0,(function(){var e;return Object(s.d)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t,n){return Object(s.b)(this,void 0,void 0,(function(){var r,o,i,a,u,c,l,f;return Object(s.d)(this,(function(d){switch(d.label){case 0:return o=0,i=0,[4,this.getMaxAttempts()];case 1:a=d.sent(),u=t.request,v.a.isInstance(u)&&(u.headers["amz-sdk-invocation-id"]=F()),c=function(){var c,f,d,p,h,y,b,m;return Object(s.d)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,7]),v.a.isInstance(u)&&(u.headers["amz-sdk-request"]="attempt=".concat(o+1,"; max=").concat(a)),(null==n?void 0:n.beforeRequest)?[4,n.beforeRequest()]:[3,2];case 1:s.sent(),s.label=2;case 2:return[4,e(t)];case 3:return c=s.sent(),f=c.response,d=c.output,(null==n?void 0:n.afterRequest)&&n.afterRequest(f),l.retryQuota.releaseRetryTokens(r),d.$metadata.attempts=o+1,d.$metadata.totalRetryDelay=i,[2,{value:{response:f,output:d}}];case 4:return p=s.sent(),h=$(p),o++,l.shouldRetry(h,o,a)?(r=l.retryQuota.retrieveRetryTokens(h),y=l.delayDecider(R(h)?500:100,o),b=G(h.$response),m=Math.max(b||0,y),i+=m,[4,new Promise((function(e){return setTimeout(e,m)}))]):[3,6];case 5:return s.sent(),[2,"continue"];case 6:throw h.$metadata||(h.$metadata={}),h.$metadata.attempts=o,h.$metadata.totalRetryDelay=i,h;case 7:return[2]}}))},l=this,d.label=2;case 2:return[5,c()];case 3:return"object"==typeof(f=d.sent())?[2,f.value]:[3,2];case 4:return[2]}}))}))},e}(),G=function(e){if(v.b.isInstance(e)){var t=Object.keys(e.headers).find((function(e){return"retry-after"===e.toLowerCase()}));if(t){var n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n).getTime()-Date.now():1e3*r}}},$=function(e){return e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error("AWS SDK error wrapper for ".concat(e))},V=function(e){function t(t,n){var r=this,o=null!=n?n:{},i=o.rateLimiter,a=Object(s.f)(o,["rateLimiter"]);return(r=e.call(this,t,a)||this).rateLimiter=null!=i?i:new M,r.mode=m.ADAPTIVE,r}return Object(s.c)(t,e),t.prototype.retry=function(t,n){return Object(s.b)(this,void 0,void 0,(function(){var r=this;return Object(s.d)(this,(function(o){return[2,e.prototype.retry.call(this,t,n,{beforeRequest:function(){return Object(s.b)(r,void 0,void 0,(function(){return Object(s.d)(this,(function(e){return[2,this.rateLimiter.getSendToken()]}))}))},afterRequest:function(e){r.rateLimiter.updateClientSendingRate(e)}})]}))}))},t}(H),W={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},K=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(s.b)(void 0,void 0,void 0,(function(){var o;return Object(s.d)(this,(function(i){switch(i.label){case 0:return[4,e.retryStrategy()];case 1:return(null==(o=i.sent())?void 0:o.mode)&&(n.userAgent=Object(s.g)(Object(s.g)([],Object(s.e)(n.userAgent||[]),!1),[["cfg/retry-mode",o.mode]],!1)),[2,o.retry(t,r)]}}))}))}}}(e),W)}}},Y=function(e,t){return(Y=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 Z(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}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function X(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function J(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}Object.create;Object.create;var Q=function(e){function t(n,r){void 0===r&&(r=!0);var o=e.call(this,n)||this;return o.tryNextLink=r,o.name="ProviderError",Object.setPrototypeOf(o,t.prototype),o}return Z(t,e),t.from=function(e,t){return void 0===t&&(t=!0),Object.assign(new this(e.message,t),e)},t}(Error);(function(e){function t(n,r){void 0===r&&(r=!0);var o=e.call(this,n,r)||this;return o.tryNextLink=r,o.name="CredentialsProviderError",Object.setPrototypeOf(o,t.prototype),o}Z(t,e)})(Q),function(e){function t(n,r){void 0===r&&(r=!0);var o=e.call(this,n,r)||this;return o.tryNextLink=r,o.name="TokenProviderError",Object.setPrototypeOf(o,t.prototype),o}Z(t,e)}(Q);for(var ee=function(e,t,n){var r,o,i,a=!1,u=function(){return X(void 0,void 0,void 0,(function(){return J(this,(function(t){switch(t.label){case 0:o||(o=e()),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,o];case 2:return r=t.sent(),i=!0,a=!1,[3,4];case 3:return o=void 0,[7];case 4:return[2,r]}}))}))};return void 0===t?function(e){return X(void 0,void 0,void 0,(function(){return J(this,(function(t){switch(t.label){case 0:return i&&!(null==e?void 0:e.forceRefresh)?[3,2]:[4,u()];case 1:r=t.sent(),t.label=2;case 2:return[2,r]}}))}))}:function(e){return X(void 0,void 0,void 0,(function(){return J(this,(function(o){switch(o.label){case 0:return i&&!(null==e?void 0:e.forceRefresh)?[3,2]:[4,u()];case 1:r=o.sent(),o.label=2;case 2:return a?[2,r]:n&&!n(r)?(a=!0,[2,r]):t(r)?[4,u()]:[3,4];case 3:return o.sent(),[2,r];case 4:return[2,r]}}))}))}},te={},ne={},re=0;re<256;re++){var oe=re.toString(16).toLowerCase();1===oe.length&&(oe="0".concat(oe)),te[re]=oe,ne[oe]=re}function ie(e){for(var t="",n=0;n<e.byteLength;n++)t+=te[e[n]];return t}var ae="X-Amz-Date".toLowerCase(),ue=["authorization",ae,"date"],se="X-Amz-Signature".toLowerCase(),ce="X-Amz-Security-Token".toLowerCase(),le={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},fe=/^proxy-/,de=/^sec-/,pe="AWS4-HMAC-SHA256-PAYLOAD",he={},ve=[],ye=function(e,t,n){return"".concat(e,"/").concat(t,"/").concat(n,"/").concat("aws4_request")},be=function(e,t,n){var r=new e(t);return r.update(n),r.digest()},me=function(e,t,n){var r,o,i=e.headers,a={};try{for(var u=Object(s.h)(Object.keys(i).sort()),c=u.next();!c.done;c=u.next()){var l=c.value;if(null!=i[l]){var f=l.toLowerCase();(f in le||(null==t?void 0:t.has(f))||fe.test(f)||de.test(f))&&(!n||n&&!n.has(f))||(a[f]=i[l].trim().replace(/\s+/g," "))}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return a},ge=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,we)},we=function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())},Oe=function(e,t){var n=e.headers,r=e.body;return Object(s.b)(void 0,void 0,void 0,(function(){var e,o,i,a,u,c,l;return Object(s.d)(this,(function(f){switch(f.label){case 0:try{for(e=Object(s.h)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){c={error:e}}finally{try{o&&!o.done&&(l=e.return)&&l.call(e)}finally{if(c)throw c.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(d=r,"function"==typeof ArrayBuffer&&d instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(d))?((a=new t).update(r),u=ie,[4,a.digest()]):[3,3];case 2:return[2,u.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var d}))}))},Se=function(e){var t=e.headers,n=e.query,r=Object(s.f)(e,["headers","query"]);return Object(s.a)(Object(s.a)({},r),{headers:Object(s.a)({},t),query:n?_e(n):void 0})},_e=function(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Object(s.a)(Object(s.a)({},t),((r={})[n]=Array.isArray(o)?Object(s.g)([],Object(s.e)(o),!1):o,r))}),{})},Ee=function(e){var t,n;e="function"==typeof e.clone?e.clone():Se(e);try{for(var r=Object(s.h)(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;ue.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e},xe=function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e},Ae=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,u=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=u,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=c(r),this.credentialProvider=c(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(s.b)(this,void 0,void 0,(function(){var n,r,o,i,a,u,c,l,f,d,p,h,v,y,b,m,g,w,O,S,_,E,x,A;return Object(s.d)(this,(function(j){switch(j.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,u=t.unhoistableHeaders,c=t.signableHeaders,l=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return d=j.sent(),this.validateResolvedCredentials(d),null==l?[3,2]:(h=l,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=j.sent(),j.label=4;case 4:return p=h,v=je(r),y=v.longDate,b=v.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=ye(b,p,null!=f?f:this.service),g=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():Se(e),a=i.headers,u=i.query,c=void 0===u?{}:u;try{for(var l=Object(s.h)(Object.keys(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.toLowerCase();"x-amz-"!==p.slice(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(p))||(c[d]=a[d],delete a[d])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return Object(s.a)(Object(s.a)({},e),{headers:a,query:c})}(Ee(e),{unhoistableHeaders:u}),d.sessionToken&&(g.query["X-Amz-Security-Token"]=d.sessionToken),g.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",g.query["X-Amz-Credential"]="".concat(d.accessKeyId,"/").concat(m),g.query["X-Amz-Date"]=y,g.query["X-Amz-Expires"]=i.toString(10),w=me(g,a,c),g.query["X-Amz-SignedHeaders"]=Te(w),O=g.query,S="X-Amz-Signature",_=this.getSignature,E=[y,m,this.getSigningKey(d,p,b,f)],x=this.createCanonicalRequest,A=[g,w],[4,Oe(e,this.sha256)]);case 5:return[4,_.apply(this,E.concat([x.apply(this,A.concat([j.sent()]))]))];case 6:return O[S]=j.sent(),[2,g]}}))}))},e.prototype.sign=function(e,t){return Object(s.b)(this,void 0,void 0,(function(){return Object(s.d)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,u=t.signingRegion,c=t.signingService;return Object(s.b)(this,void 0,void 0,(function(){var e,t,o,l,f,d,p,h,v,y,b;return Object(s.d)(this,(function(s){switch(s.label){case 0:return null==u?[3,1]:(t=u,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=s.sent(),s.label=3;case 3:return e=t,o=je(i),l=o.shortDate,f=o.longDate,d=ye(l,e,null!=c?c:this.service),[4,Oe({headers:{},body:r},this.sha256)];case 4:return p=s.sent(),(h=new this.sha256).update(n),y=ie,[4,h.digest()];case 5:return v=y.apply(void 0,[s.sent()]),b=[pe,f,d,a,v,p].join("\n"),[2,this.signString(b,{signingDate:i,signingRegion:e,signingService:c})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Object(s.b)(this,void 0,void 0,(function(){var t,n,r,u,c,l,f,d;return Object(s.d)(this,(function(s){switch(s.label){case 0:return[4,this.credentialProvider()];case 1:return t=s.sent(),this.validateResolvedCredentials(t),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=s.sent(),s.label=4;case 4:return n=r,u=je(o).shortDate,f=(l=this.sha256).bind,[4,this.getSigningKey(t,n,u,a)];case 5:return(c=new(f.apply(l,[void 0,s.sent()]))).update(e),d=ie,[4,c.digest()];case 6:return[2,d.apply(void 0,[s.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,u=n.signingRegion,c=n.signingService;return Object(s.b)(this,void 0,void 0,(function(){var t,n,r,l,f,d,p,h,v,y,b;return Object(s.d)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),this.validateResolvedCredentials(t),null==u?[3,2]:(r=u,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,l=Ee(e),f=je(o),d=f.longDate,p=f.shortDate,h=ye(p,n,null!=c?c:this.service),l.headers[ae]=d,t.sessionToken&&(l.headers[ce]=t.sessionToken),[4,Oe(l,this.sha256)];case 5:return v=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Object(s.h)(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",l.headers)&&this.applyChecksum&&(l.headers["x-amz-content-sha256"]=v),y=me(l,a,i),[4,this.getSignature(d,h,this.getSigningKey(t,n,p,c),this.createCanonicalRequest(l,y,v))];case 6:return b=m.sent(),l.headers.authorization="".concat("AWS4-HMAC-SHA256"," ")+"Credential=".concat(t.accessKeyId,"/").concat(h,", ")+"SignedHeaders=".concat(Te(y),", ")+"Signature=".concat(b),[2,l]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return"".concat(e.method,"\n").concat(this.getCanonicalPath(e),"\n").concat(function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},u=function(e){if(e.toLowerCase()===se)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]="".concat(ge(e),"=").concat(ge(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat(["".concat(ge(e),"=").concat(ge(n))])}),[]).join("&"))};try{for(var c=Object(s.h)(Object.keys(o).sort()),l=c.next();!l.done;l=c.next()){u(l.value)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e),"\n").concat(r.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),"\n\n").concat(r.join(";"),"\n").concat(n)},e.prototype.createStringToSign=function(e,t,n){return Object(s.b)(this,void 0,void 0,(function(){var r,o;return Object(s.d)(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"".concat("AWS4-HMAC-SHA256","\n").concat(e,"\n").concat(t,"\n").concat(ie(o))]}}))}))},e.prototype.getCanonicalPath=function(e){var t,n,r=e.path;if(this.uriEscapePath){var o=[];try{for(var i=Object(s.h)(r.split("/")),a=i.next();!a.done;a=i.next()){var u=a.value;0!==(null==u?void 0:u.length)&&("."!==u&&(".."===u?o.pop():o.push(u)))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var c="".concat((null==r?void 0:r.startsWith("/"))?"/":"").concat(o.join("/")).concat(o.length>0&&(null==r?void 0:r.endsWith("/"))?"/":"");return encodeURIComponent(c).replace(/%2F/g,"/")}return r},e.prototype.getSignature=function(e,t,n,r){return Object(s.b)(this,void 0,void 0,(function(){var o,i,a,u,c;return Object(s.d)(this,(function(s){switch(s.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=s.sent(),u=(a=this.sha256).bind,[4,n];case 2:return(i=new(u.apply(a,[void 0,s.sent()]))).update(o),c=ie,[4,i.digest()];case 3:return[2,c.apply(void 0,[s.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Object(s.b)(void 0,void 0,void 0,(function(){var i,a,u,c,l,f,d,p,h;return Object(s.d)(this,(function(v){switch(v.label){case 0:return[4,be(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=v.sent(),(a="".concat(n,":").concat(r,":").concat(o,":").concat(ie(i),":").concat(t.sessionToken))in he)return[2,he[a]];for(ve.push(a);ve.length>50;)delete he[ve.shift()];u="AWS4".concat(t.secretAccessKey),v.label=2;case 2:v.trys.push([2,7,8,9]),c=Object(s.h)([n,r,o,"aws4_request"]),l=c.next(),v.label=3;case 3:return l.done?[3,6]:(f=l.value,[4,be(e,u,f)]);case 4:u=v.sent(),v.label=5;case 5:return l=c.next(),[3,3];case 6:return[3,9];case 7:return d=v.sent(),p={error:d},[3,9];case 8:try{l&&!l.done&&(h=c.return)&&h.call(c)}finally{if(p)throw p.error}return[7];case 9:return[2,he[a]=u]}}))}))}(this.sha256,e,n,t,r||this.service)},e.prototype.validateResolvedCredentials=function(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")},e}(),je=function(e){var t,n=(t=e,xe(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}},Te=function(e){return Object.keys(e).sort().join(";")},Pe=function(e){return"function"==typeof e?ee(e,(function(e){return void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5}),(function(e){return void 0!==e.expiration})):c(e)},Ce=function(e){return new Date(Date.now()+e)},Re=function(e,t){var n=Date.parse(e);return function(e,t){return Math.abs(Ce(t).getTime()-e)>=3e5}(n,t)?n-Date.now():t},Me=function(e){var t,n,r;return v.b.isInstance(e)?null!==(n=null===(t=e.headers)||void 0===t?void 0:t.date)&&void 0!==n?n:null===(r=e.headers)||void 0===r?void 0:r.Date:void 0},ke={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},Ie=function(e){return{applyToStack:function(t){t.addRelativeTo(function(e){return function(t,n){return function(r){var o,i,a;return Object(s.b)(this,void 0,void 0,(function(){var u,c,l,f,d,p,h;return Object(s.d)(this,(function(y){switch(y.label){case 0:return v.a.isInstance(r.request)?(u=null===(a=null===(i=null===(o=n.endpointV2)||void 0===o?void 0:o.properties)||void 0===i?void 0:i.authSchemes)||void 0===a?void 0:a[0],[4,e.signer(u)]):[2,t(r)];case 1:return c=y.sent(),f=t,d=[Object(s.a)({},r)],h={},[4,c.sign(r.request,{signingDate:Ce(e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 2:return[4,f.apply(void 0,[s.a.apply(void 0,d.concat([(h.request=y.sent(),h)]))]).catch((function(t){var n,r=null!==(n=t.ServerTime)&&void 0!==n?n:Me(t.$response);throw r&&(e.systemClockOffset=Re(r,e.systemClockOffset)),t}))];case 3:return l=y.sent(),(p=Me(l.response))&&(e.systemClockOffset=Re(p,e.systemClockOffset)),[2,l]}}))}))}}}(e),ke)}}};var Le=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,De=function(e){var t=Object(s.e)(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(Le,"_")})).join("/")},Ne={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Be=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(s.b)(void 0,void 0,void 0,(function(){var o,i,a,u,c,l,f,d,p;return Object(s.d)(this,(function(h){switch(h.label){case 0:return o=r.request,v.a.isInstance(o)?(i=o.headers,a=(null===(d=null==t?void 0:t.userAgent)||void 0===d?void 0:d.map(De))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return u=h.sent().map(De),c=(null===(p=null==n?void 0:n.customUserAgent)||void 0===p?void 0:p.map(De))||[],l=Object(s.g)(Object(s.g)(Object(s.g)([],Object(s.e)(u),!1),Object(s.e)(a),!1),Object(s.e)(c),!1).join(" "),f=Object(s.g)(Object(s.g)([],Object(s.e)(u.filter((function(e){return e.startsWith("aws-sdk-")}))),!1),Object(s.e)(c),!1).join(" "),"browser"!==n.runtime?(f&&(i["x-amz-user-agent"]=i["x-amz-user-agent"]?"".concat(i["user-agent"]," ").concat(f):f),i["user-agent"]=l):i["x-amz-user-agent"]=l,[2,e(Object(s.a)(Object(s.a)({},r),{request:o}))]}}))}))}}),Ne)}}},Ue=n(1),Fe=n(31),ze=n(30);for(var qe=function(){function e(e){"function"==typeof e?this.configProvider=e().then((function(e){return e||{}})):(this.config=null!=e?e:{},this.configProvider=Promise.resolve(this.config))}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal;return Object(s.b)(this,void 0,void 0,(function(){var t,r,o,i,a,u,c,l,f,d,p,h;return Object(s.d)(this,(function(y){switch(y.label){case 0:return this.config?[3,2]:(t=this,[4,this.configProvider]);case 1:t.config=y.sent(),y.label=2;case 2:return r=this.config.requestTimeout,(null==n?void 0:n.aborted)?((o=new Error("Request aborted")).name="AbortError",[2,Promise.reject(o)]):(i=e.path,e.query&&(a=function(e){var t,n,r=[];try{for(var o=Object(s.h)(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,u=e[a];if(a=ge(a),Array.isArray(u))for(var c=0,l=u.length;c<l;c++)r.push("".concat(a,"=").concat(ge(u[c])));else{var f=a;(u||"string"==typeof u)&&(f+="=".concat(ge(u))),r.push(f)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query))&&(i+="?".concat(a)),u=e.port,c=e.method,l="".concat(e.protocol,"//").concat(e.hostname).concat(u?":".concat(u):"").concat(i),f="GET"===c||"HEAD"===c?void 0:e.body,d={body:f,headers:new Headers(e.headers),method:c},"undefined"!=typeof AbortController&&(d.signal=n),p=new Request(l,d),h=[fetch(p).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Object(s.h)(r.entries()),a=i.next();!a.done;a=i.next()){var u=a.value;o[u[0]]=u[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new v.b({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new v.b({headers:o,statusCode:e.status,body:t})}}))})),(b=r,void 0===b&&(b=0),new Promise((function(e,t){b&&setTimeout((function(){var e=new Error("Request did not complete within ".concat(b," ms"));e.name="TimeoutError",t(e)}),b)})))],n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),[2,Promise.race(h)])}var b}))}))},e}(),He={},Ge=new Array(64),$e=0,Ve="A".charCodeAt(0),We="Z".charCodeAt(0);$e+Ve<=We;$e++){var Ke=String.fromCharCode($e+Ve);He[Ke]=$e,Ge[$e]=Ke}for($e=0,Ve="a".charCodeAt(0),We="z".charCodeAt(0);$e+Ve<=We;$e++){Ke=String.fromCharCode($e+Ve);var Ye=$e+26;He[Ke]=Ye,Ge[Ye]=Ke}for($e=0;$e<10;$e++){He[$e.toString(10)]=$e+52;Ke=$e.toString(10),Ye=$e+52;He[Ke]=Ye,Ge[Ye]=Ke}He["+"]=62,Ge[62]="+",He["/"]=63,Ge[63]="/";function Ze(e){var t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,u=o,s=o+3;u<=s;u++)if("="!==e[u]){if(!(e[u]in He))throw new TypeError("Invalid character ".concat(e[u]," in base64 string."));i|=He[e[u]]<<6*(s-u),a+=6}else i>>=6;var c=o/4*3;i>>=a%8;for(var l=Math.floor(a/8),f=0;f<l;f++){var d=8*(l-f-1);r.setUint8(c+f,(i&255<<d)>>d)}}return new Uint8Array(n)}function Xe(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var u=Math.ceil(o/6);r<<=6*u-o;for(var s=1;s<=u;s++){var c=6*(u-s);t+=Ge[(r&63<<c)>>c]}t+="==".slice(0,4-u)}return t}var Je=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(s.b)(this,void 0,void 0,(function(){var t,n;return Object(s.d)(this,(function(r){switch(r.label){case 0:return[4,Qe(e)];case 1:return t=r.sent(),n=Ze(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(s.b)(this,void 0,void 0,(function(){var t,n,r,o,i,a,u;return Object(s.d)(this,(function(s){switch(s.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,s.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=s.sent(),i=o.done,(a=o.value)&&(u=t,(t=new Uint8Array(u.length+a.length)).set(u),t.set(a,u.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Qe(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var et=function(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error("Body Length computation failed for ".concat(e))},tt=n(9),nt=n.n(tt),rt=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(s.b)(void 0,void 0,void 0,(function(){var e,r,o,i,a,u,c,l,f;return Object(s.d)(this,(function(s){return e="undefined"!=typeof window&&(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?nt.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/".concat((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser","".concat(null!==(c=null===(u=null==e?void 0:e.browser)||void 0===u?void 0:u.name)&&void 0!==c?c:"unknown","_").concat(null!==(f=null===(l=null==e?void 0:e.browser)||void 0===l?void 0:l.version)&&void 0!==f?f:"unknown")]],t&&r.push(["api/".concat(t),n]),[2,r]}))}))}};var ot=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},it=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)};var at=function(e){if("string"==typeof e)return at(new URL(e));var t,n=e,r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,u=n.search;return u&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Object(s.h)(e.split("&")),i=o.next();!i.done;i=o.next()){var a=i.value,u=Object(s.e)(a.split("="),2),c=u[0],l=u[1],f=void 0===l?null:l;c=decodeURIComponent(c),f&&(f=decodeURIComponent(f)),c in r?Array.isArray(r[c])?r[c].push(f):r[c]=[r[c],f]:r[c]=f}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(u)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},ut={"us-east-1":{variants:[{hostname:"runtime-fips.lex.us-east-1.amazonaws.com",tags:["fips"]}]},"us-gov-west-1":{variants:[{hostname:"runtime-fips.lex.us-gov-west-1.amazonaws.com",tags:["fips"]}]},"us-west-2":{variants:[{hostname:"runtime-fips.lex.us-west-2.amazonaws.com",tags:["fips"]}]}},st={aws:{regions:["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ap-southeast-3","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1","us-east-1","us-east-1-fips","us-east-2","us-west-1","us-west-2","us-west-2-fips"],regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-fips.lex.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.aws",tags:["dualstack"]}]},"aws-cn":{regions:["cn-north-1","cn-northwest-1"],regionRegex:"^cn\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com.cn",tags:[]},{hostname:"runtime.lex-fips.{region}.amazonaws.com.cn",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.amazonwebservices.com.cn",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.amazonwebservices.com.cn",tags:["dualstack"]}]},"aws-iso":{regions:["us-iso-east-1","us-iso-west-1"],regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.c2s.ic.gov",tags:[]},{hostname:"runtime.lex-fips.{region}.c2s.ic.gov",tags:["fips"]}]},"aws-iso-b":{regions:["us-isob-east-1"],regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.sc2s.sgov.gov",tags:[]},{hostname:"runtime.lex-fips.{region}.sc2s.sgov.gov",tags:["fips"]}]},"aws-us-gov":{regions:["us-gov-east-1","us-gov-west-1","us-gov-west-1-fips"],regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",variants:[{hostname:"runtime.lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-fips.lex.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime.lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime.lex.{region}.api.aws",tags:["dualstack"]}]}},ct=function(e,t){return Object(s.b)(void 0,void 0,void 0,(function(){return Object(s.d)(this,(function(n){return[2,h(e,Object(s.a)(Object(s.a)({},t),{signingService:"lex",regionHash:ut,partitionHash:st}))]}))}))};function lt(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function ft(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}Object.create;Object.create;var dt=["in-region","cross-region","mobile","standard","legacy"],pt=function(e){var t=(void 0===e?{}:e).defaultsMode;return ee((function(){return lt(void 0,void 0,void 0,(function(){var e,n;return ft(this,(function(r){switch(r.label){case 0:return"function"!=typeof t?[3,2]:[4,t()];case 1:return n=r.sent(),[3,3];case 2:n=t,r.label=3;case 3:switch(null==(e=n)?void 0:e.toLowerCase()){case"auto":return[2,Promise.resolve(ht()?"mobile":"standard")];case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return[2,Promise.resolve(null==e?void 0:e.toLocaleLowerCase())];case void 0:return[2,Promise.resolve("legacy")];default:throw new Error('Invalid parameter for "defaultsMode", expect '.concat(dt.join(", "),", got ").concat(e))}return[2]}}))}))}))},ht=function(){var e,t,n="undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)?nt.a.parse(window.navigator.userAgent):void 0,r=null===(t=null==n?void 0:n.platform)||void 0===t?void 0:t.type;return"tablet"===r||"mobile"===r},vt=function(e){var t,n,r,o,i,a,u,c,l,f,d,p,h,v,y,b,m=pt(e),g=function(){return m().then(Ue.l)},w=function(e){var t,n,r,o,i;return{apiVersion:"2016-11-28",disableHostPrefix:null!==(t=null==e?void 0:e.disableHostPrefix)&&void 0!==t&&t,logger:null!==(n=null==e?void 0:e.logger)&&void 0!==n?n:{},regionInfoProvider:null!==(r=null==e?void 0:e.regionInfoProvider)&&void 0!==r?r:ct,serviceId:null!==(o=null==e?void 0:e.serviceId)&&void 0!==o?o:"Lex Runtime Service",urlParser:null!==(i=null==e?void 0:e.urlParser)&&void 0!==i?i:at}}(e);return Object(s.a)(Object(s.a)(Object(s.a)({},w),e),{runtime:"browser",defaultsMode:m,base64Decoder:null!==(t=null==e?void 0:e.base64Decoder)&&void 0!==t?t:Ze,base64Encoder:null!==(n=null==e?void 0:e.base64Encoder)&&void 0!==n?n:Xe,bodyLengthChecker:null!==(r=null==e?void 0:e.bodyLengthChecker)&&void 0!==r?r:et,credentialDefaultProvider:null!==(o=null==e?void 0:e.credentialDefaultProvider)&&void 0!==o?o:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:null!==(i=null==e?void 0:e.defaultUserAgentProvider)&&void 0!==i?i:rt({serviceId:w.serviceId,clientVersion:Fe.version}),maxAttempts:null!==(a=null==e?void 0:e.maxAttempts)&&void 0!==a?a:3,region:null!==(u=null==e?void 0:e.region)&&void 0!==u?u:(b="Region is missing",function(){return Promise.reject(b)}),requestHandler:null!==(c=null==e?void 0:e.requestHandler)&&void 0!==c?c:new qe(g),retryMode:null!==(l=null==e?void 0:e.retryMode)&&void 0!==l?l:function(){return Object(s.b)(void 0,void 0,void 0,(function(){return Object(s.d)(this,(function(e){switch(e.label){case 0:return[4,g()];case 1:return[2,e.sent().retryMode||x]}}))}))},sha256:null!==(f=null==e?void 0:e.sha256)&&void 0!==f?f:ze.Sha256,streamCollector:null!==(d=null==e?void 0:e.streamCollector)&&void 0!==d?d:Je,useDualstackEndpoint:null!==(p=null==e?void 0:e.useDualstackEndpoint)&&void 0!==p?p:function(){return Promise.resolve(!1)},useFipsEndpoint:null!==(h=null==e?void 0:e.useFipsEndpoint)&&void 0!==h?h:function(){return Promise.resolve(!1)},utf8Decoder:null!==(v=null==e?void 0:e.utf8Decoder)&&void 0!==v?v:ot,utf8Encoder:null!==(y=null==e?void 0:e.utf8Encoder)&&void 0!==y?y:it})},yt=function(e){function t(t){var n,r,o,i=this,a=function(e){var t=e.region,n=e.useFipsEndpoint;if(!t)throw new Error("Region is missing");return Object(s.a)(Object(s.a)({},e),{region:function(){return Object(s.b)(void 0,void 0,void 0,(function(){var e;return Object(s.d)(this,(function(n){switch(n.label){case 0:return"string"==typeof t?[2,d(t)]:[4,t()];case 1:return e=n.sent(),[2,d(e)]}}))}))},useFipsEndpoint:function(){return Object(s.b)(void 0,void 0,void 0,(function(){var e;return Object(s.d)(this,(function(r){switch(r.label){case 0:return"string"!=typeof t?[3,1]:(e=t,[3,3]);case 1:return[4,t()];case 2:e=r.sent(),r.label=3;case 3:return f(e)?[2,!0]:[2,"boolean"==typeof n?Promise.resolve(n):n()]}}))}))}})}(vt(t)),u=l(a),p=function(e){return Object(s.a)(Object(s.a)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}(function(e){var t,n=e.credentials?Pe(e.credentials):e.credentialDefaultProvider(e),r=e.signingEscapePath,o=void 0===r||r,i=e.systemClockOffset,a=void 0===i?e.systemClockOffset||0:i,u=e.sha256;return t=e.signer?c(e.signer):e.regionInfoProvider?function(){return c(e.region)().then((function(t){return Object(s.b)(void 0,void 0,void 0,(function(){var n,r,o,i;return Object(s.d)(this,(function(a){switch(a.label){case 0:return r=(n=e).regionInfoProvider,o=[t],i={},[4,e.useFipsEndpoint()];case 1:return i.useFipsEndpoint=a.sent(),[4,e.useDualstackEndpoint()];case 2:return[4,r.apply(n,o.concat([(i.useDualstackEndpoint=a.sent(),i)]))];case 3:return[2,[a.sent()||{},t]]}}))}))})).then((function(t){var r=Object(s.e)(t,2),i=r[0],a=r[1],c=i.signingRegion,l=i.signingService;e.signingRegion=e.signingRegion||c||a,e.signingName=e.signingName||l||e.serviceId;var f=Object(s.a)(Object(s.a)({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o});return new(e.signerConstructor||Ae)(f)}))}:function(t){return Object(s.b)(void 0,void 0,void 0,(function(){var r,i,a;return Object(s.d)(this,(function(c){if(!t)throw new Error("Unexpected empty auth scheme config");return r=t.signingScope,i=t.signingName,e.signingRegion=e.signingRegion||r,e.signingName=e.signingName||i||e.serviceId,a=Object(s.a)(Object(s.a)({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o}),[2,new(e.signerConstructor||Ae)(a)]}))}))},Object(s.a)(Object(s.a)({},e),{systemClockOffset:a,signingEscapePath:o,credentials:n,signer:t})}((o=c(null!==(r=(n=u).maxAttempts)&&void 0!==r?r:3),Object(s.a)(Object(s.a)({},n),{maxAttempts:o,retryStrategy:function(){return Object(s.b)(void 0,void 0,void 0,(function(){return Object(s.d)(this,(function(e){switch(e.label){case 0:return n.retryStrategy?[2,n.retryStrategy]:[4,c(n.retryMode)()];case 1:return e.sent()===m.ADAPTIVE?[2,new V(o)]:[2,new H(o)]}}))}))}}))));return(i=e.call(this,p)||this).config=p,i.middlewareStack.use(K(i.config)),i.middlewareStack.use(b(i.config)),i.middlewareStack.use(w(i.config)),i.middlewareStack.use(S(i.config)),i.middlewareStack.use(Object(_.a)(i.config)),i.middlewareStack.use(Ie(i.config)),i.middlewareStack.use(Be(i.config)),i}return Object(s.c)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Ue.a),bt={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},mt={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function gt(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(s.b)(void 0,void 0,void 0,(function(){var o,i,a;return Object(s.d)(this,(function(u){switch(u.label){case 0:return[4,n(r)];case 1:o=u.sent().response,u.label=2;case 2:return u.trys.push([2,4,,5]),[4,t(o,e)];case 3:return i=u.sent(),[2,{response:o,output:i}];case 4:throw a=u.sent(),Object.defineProperty(a,"$response",{value:o}),a;case 5:return[2]}}))}))}}}(e,n),bt),r.add(function(e,t){return function(n,r){return function(o){return Object(s.b)(void 0,void 0,void 0,(function(){var i,a,u;return Object(s.d)(this,(function(c){switch(c.label){case 0:if(!(i=(null===(u=r.endpointV2)||void 0===u?void 0:u.url)&&e.urlParser?function(){return Object(s.b)(void 0,void 0,void 0,(function(){return Object(s.d)(this,(function(t){return[2,e.urlParser(r.endpointV2.url)]}))}))}:e.endpoint))throw new Error("No valid endpoint provider available.");return[4,t(o.input,Object(s.a)(Object(s.a)({},e),{endpoint:i}))];case 1:return a=c.sent(),[2,n(Object(s.a)(Object(s.a)({},o),{request:a}))]}}))}))}}}(e,t),mt)}}}var wt=n(3),Ot=n(10),St=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Object(s.c)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(gt(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeServiceClient",commandName:"PostTextCommand",inputFilterSensitiveLog:wt.l,outputFilterSensitiveLog:wt.m},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return Object(Ot.d)(e,t)},t.prototype.deserialize=function(e,t){return Object(Ot.b)(e,t)},t}(Ue.b),_t=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Object(s.c)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(gt(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeServiceClient",commandName:"PostContentCommand",inputFilterSensitiveLog:wt.j,outputFilterSensitiveLog:wt.k},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return Object(Ot.c)(e,t)},t.prototype.deserialize=function(e,t){return Object(Ot.a)(e,t)},t}(Ue.b),Et={},xt=Uint8Array,At=Uint16Array,jt=Uint32Array,Tt=new xt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Pt=new xt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new xt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rt=function(e,t){for(var n=new At(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new jt(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Mt=Rt(Tt,2),kt=Mt[0],It=Mt[1];kt[28]=258,It[258]=28;for(var Lt=Rt(Pt,0),Dt=Lt[0],Nt=(Lt[1],new At(32768)),Bt=0;Bt<32768;++Bt){var Ut=(43690&Bt)>>>1|(21845&Bt)<<1;Ut=(61680&(Ut=(52428&Ut)>>>2|(13107&Ut)<<2))>>>4|(3855&Ut)<<4,Nt[Bt]=((65280&Ut)>>>8|(255&Ut)<<8)>>>1}var Ft=function(e,t,n){for(var r=e.length,o=0,i=new At(t);o<r;++o)e[o]&&++i[e[o]-1];var a,u=new At(t);for(o=0;o<t;++o)u[o]=u[o-1]+i[o-1]<<1;if(n){a=new At(1<<t);var s=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=u[e[o]-1]++<<l,d=f|(1<<l)-1;f<=d;++f)a[Nt[f]>>>s]=c}else for(a=new At(r),o=0;o<r;++o)e[o]&&(a[o]=Nt[u[e[o]-1]++]>>>15-e[o]);return a},zt=new xt(288);for(Bt=0;Bt<144;++Bt)zt[Bt]=8;for(Bt=144;Bt<256;++Bt)zt[Bt]=9;for(Bt=256;Bt<280;++Bt)zt[Bt]=7;for(Bt=280;Bt<288;++Bt)zt[Bt]=8;var qt=new xt(32);for(Bt=0;Bt<32;++Bt)qt[Bt]=5;var Ht=Ft(zt,9,1),Gt=Ft(qt,5,1),$t=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Vt=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Wt=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},Kt=function(e){return(e+7)/8|0},Yt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(2==e.BYTES_PER_ELEMENT?At:4==e.BYTES_PER_ELEMENT?jt:xt)(n-t);return r.set(e.subarray(t,n)),r},Zt=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xt=function(e,t,n){var r=new Error(t||Zt[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Xt),!n)throw r;return r},Jt=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new xt(0);var o=!t||n,i=!n||n.i;n||(n={}),t||(t=new xt(3*r));var a=function(e){var n=t.length;if(e>n){var r=new xt(Math.max(2*n,e));r.set(t),t=r}},u=n.f||0,s=n.p||0,c=n.b||0,l=n.l,f=n.d,d=n.m,p=n.n,h=8*r;do{if(!l){u=Vt(e,s,1);var v=Vt(e,s+1,3);if(s+=3,!v){var y=e[(j=Kt(s)+4)-4]|e[j-3]<<8,b=j+y;if(b>r){i&&Xt(0);break}o&&a(c+y),t.set(e.subarray(j,b),c),n.b=c+=y,n.p=s=8*b,n.f=u;continue}if(1==v)l=Ht,f=Gt,d=9,p=5;else if(2==v){var m=Vt(e,s,31)+257,g=Vt(e,s+10,15)+4,w=m+Vt(e,s+5,31)+1;s+=14;for(var O=new xt(w),S=new xt(19),_=0;_<g;++_)S[Ct[_]]=Vt(e,s+3*_,7);s+=3*g;var E=$t(S),x=(1<<E)-1,A=Ft(S,E,1);for(_=0;_<w;){var j,T=A[Vt(e,s,x)];if(s+=15&T,(j=T>>>4)<16)O[_++]=j;else{var P=0,C=0;for(16==j?(C=3+Vt(e,s,3),s+=2,P=O[_-1]):17==j?(C=3+Vt(e,s,7),s+=3):18==j&&(C=11+Vt(e,s,127),s+=7);C--;)O[_++]=P}}var R=O.subarray(0,m),M=O.subarray(m);d=$t(R),p=$t(M),l=Ft(R,d,1),f=Ft(M,p,1)}else Xt(1);if(s>h){i&&Xt(0);break}}o&&a(c+131072);for(var k=(1<<d)-1,I=(1<<p)-1,L=s;;L=s){var D=(P=l[Wt(e,s)&k])>>>4;if((s+=15&P)>h){i&&Xt(0);break}if(P||Xt(2),D<256)t[c++]=D;else{if(256==D){L=s,l=null;break}var N=D-254;if(D>264){var B=Tt[_=D-257];N=Vt(e,s,(1<<B)-1)+kt[_],s+=B}var U=f[Wt(e,s)&I],F=U>>>4;U||Xt(3),s+=15&U;M=Dt[F];if(F>3){B=Pt[F];M+=Wt(e,s)&(1<<B)-1,s+=B}if(s>h){i&&Xt(0);break}o&&a(c+131072);for(var z=c+N;c<z;c+=4)t[c]=t[c-M],t[c+1]=t[c+1-M],t[c+2]=t[c+2-M],t[c+3]=t[c+3-M];c=z}}n.l=l,n.p=L,n.b=c,n.f=u,l&&(u=1,n.m=d,n.d=f,n.n=p)}while(!u);return c==t.length?t:Yt(t,0,c)},Qt=new xt(0),en=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},tn=function(e,t,n){for(var r=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<r.length;++a){var u=r[a],s=i[a];if("function"==typeof u){t+=";"+s+"=";var c=u.toString();if(u.prototype)if(-1!=c.indexOf("[native code]")){var l=c.indexOf(" ",8)+1;t+=c.slice(l,c.indexOf("(",l))}else for(var f in t+=c,u.prototype)t+=";"+s+".prototype."+f+"="+u.prototype[f].toString();else t+=c}else n[s]=u}return[t,n]},nn=[],rn=function(e,t,n,r){var o;if(!nn[n]){for(var i="",a={},u=e.length-1,s=0;s<u;++s)i=(o=tn(e[s],i,a))[0],a=o[1];nn[n]=tn(e[u],i,a)}var c=en({},nn[n][1]);return function(e,t,n,r,o){var i=new Worker(Et[t]||(Et[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(e){var t=e.data,n=t.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],o(r,null)}else o(null,t)},i.postMessage(n,r),i}(nn[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,c,function(e){var t=[];for(var n in e)e[n].buffer&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(c),r)},on=function(){return[xt,At,jt,Tt,Pt,Ct,kt,Dt,Ht,Gt,Nt,Zt,Ft,$t,Vt,Wt,Kt,Yt,Xt,Jt,dn,un,sn]},an=function(){return[ln,fn]},un=function(e){return postMessage(e,[e.buffer])},sn=function(e){return e&&e.size&&new xt(e.size)},cn=function(e,t,n,r,o,i){var a=rn(n,r,o,(function(e,t){a.terminate(),i(e,t)}));return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},ln=function(e){31==e[0]&&139==e[1]&&8==e[2]||Xt(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},fn=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0};function dn(e,t){return Jt(e,t)}function pn(e,t,n){return n||(n=t,t={}),"function"!=typeof n&&Xt(7),cn(e,t,[on,an,function(){return[hn]}],(function(e){return un(hn(e.data[0]))}),3,n)}function hn(e,t){return Jt(e.subarray(ln(e),-8),t||new xt(fn(e)))}var vn="undefined"!=typeof TextDecoder&&new TextDecoder;try{vn.decode(Qt,{stream:!0}),1}catch(e){}var yn=function(e){for(var t="",n=0;;){var r=e[n++],o=(r>127)+(r>223)+(r>239);if(n+o>e.length)return[t,Yt(e,n-1)];o?3==o?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&o?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}};function bn(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(vn)return vn.decode(e);var o=yn(e),i=o[0];return o[1].length&&Xt(8),i}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var mn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},gn=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},wn=function(e){return mn(void 0,void 0,void 0,(function(){return gn(this,(function(t){return e instanceof Blob||e instanceof ReadableStream?[2,new Response(e).arrayBuffer().then((function(e){return new Uint8Array(e)}))]:[2,Promise.reject("Invalid content type")]}))}))};function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Sn,_n=(Sn=function(e,t){return(Sn=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])})(e,t)},function(e,t){function n(){this.constructor=e}Sn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),En=function(){return(En=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},xn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},An=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},jn=new o.ConsoleLogger("AWSLexProvider"),Tn=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n._botsCompleteCallback={},n}return _n(t,e),t.prototype.getProviderName=function(){return"AWSLexProvider"},t.prototype.configure=function(t){void 0===t&&(t={});var n=["name","alias","region"];return Object.keys(t).forEach((function(e){var r=t[e];if(!n.every((function(e){return e in r})))throw new Error("invalid bot configuration")})),e.prototype.configure.call(this,t)},t.prototype.reportBotStatus=function(e,t){var n=this;jn.debug("postContent state",e.dialogState),"ReadyForFulfillment"!==e.dialogState&&"Fulfilled"!==e.dialogState||("function"==typeof this._botsCompleteCallback[t]&&setTimeout((function(){return n._botsCompleteCallback[t](null,e)}),0),this._config&&"function"==typeof this._config[t].onComplete&&setTimeout((function(){return n._config[t].onComplete(null,e)}),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 conversation failed")}),0))},t.prototype.sendMessage=function(e,t){return xn(this,void 0,void 0,(function(){var n,r,i,a,u,s,c,l,f,d,p,h,v;return An(this,(function(y){switch(y.label){case 0:if(!this._config[e])return[2,Promise.reject("Bot "+e+" does not exist")];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,o.Credentials.get()];case 2:return n=y.sent(),[3,4];case 3:return y.sent(),[2,Promise.reject("No credentials")];case 4:if(this.lexRuntimeServiceClient=new yt({region:this._config[e].region,credentials:n,customUserAgent:Object(o.getAmplifyUserAgent)()}),"string"!=typeof t)return[3,9];r={botAlias:this._config[e].alias,botName:e,inputText:t,userId:n.identityId},jn.debug("postText to lex",t),y.label=5;case 5:return y.trys.push([5,7,,8]),i=new St(r),[4,this.lexRuntimeServiceClient.send(i)];case 6:return f=y.sent(),this.reportBotStatus(f,e),[2,f];case 7:return a=y.sent(),[2,Promise.reject(a)];case 8:return[3,21];case 9:return u=t.content,"voice"!==t.options.messageType?[3,13]:"object"!==On(u)?[2,Promise.reject("invalid content type")]:u instanceof Uint8Array?(c=u,[3,12]):[3,10];case 10:return[4,wn(u)];case 11:c=y.sent(),y.label=12;case 12:return s=c,r={botAlias:this._config[e].alias,botName:e,contentType:"audio/x-l16; sample-rate=16000; channel-count=1",userId:n.identityId,accept:"audio/mpeg",inputStream:s},[3,14];case 13:if("string"!=typeof u)return[2,Promise.reject("invalid content type")];r={botAlias:this._config[e].alias,botName:e,contentType:"text/plain; charset=utf-8",inputStream:u,userId:n.identityId,accept:"audio/mpeg"},y.label=14;case 14:jn.debug("postContent to lex",t),y.label=15;case 15:return y.trys.push([15,20,,21]),l=new _t(r),[4,this.lexRuntimeServiceClient.send(l)];case 16:return(f=y.sent()).audioStream?[4,wn(f.audioStream)]:[3,18];case 17:return p=y.sent(),[3,19];case 18:p=void 0,y.label=19;case 19:return d=p,h=En(En({},f),{audioStream:d}),this.reportBotStatus(h,e),[2,h];case 20:return v=y.sent(),[2,Promise.reject(v)];case 21:return[2]}}))}))},t.prototype.onComplete=function(e,t){if(!this._config[e])throw new Error("Bot "+e+" does not exist");this._botsCompleteCallback[e]=t},t}(u),Pn=function(){return(Pn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Cn=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Rn=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Mn=new o.ConsoleLogger("Interactions"),kn=new(function(){function e(e){void 0===e&&(e={}),this._options=e,Mn.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:{};Mn.debug("configure Interactions",{opt:n}),this._options=Pn(Pn({bots:{}},n),n.Interactions);var r=this._options.aws_bots_config,o=this._options.bots;return!Object.keys(o).length&&r&&Array.isArray(r)&&r.forEach((function(e){t._options.bots[e.name]=e})),Object.keys(o).forEach((function(e){var n,r=o[e],i=r.providerName||"AWSLexProvider";t._pluggables.AWSLexProvider||"AWSLexProvider"!==i||(t._pluggables.AWSLexProvider=new Tn),t._pluggables[i]?t._pluggables[i].configure(((n={})[r.name]=r,n)):Mn.debug("bot "+r.name+" was not configured as "+i+" provider was not found")})),this._options},e.prototype.addPluggable=function(e){var t=this;if(e&&"Interactions"===e.getCategory()){if(this._pluggables[e.getProviderName()])throw new Error("Pluggable "+e.getProviderName()+" already plugged");return Object.keys(this._options.bots).filter((function(n){return t._options.bots[n].providerName===e.getProviderName()})).forEach((function(n){var r,o=t._options.bots[n];e.configure(((r={})[o.name]=o,r))})),void(this._pluggables[e.getProviderName()]=e)}},e.prototype.send=function(e,t){return Cn(this,void 0,void 0,(function(){var n;return Rn(this,(function(r){switch(r.label){case 0:return this._options.bots&&this._options.bots[e]?(n=this._options.bots[e].providerName||"AWSLexProvider",this._pluggables[n]?[4,this._pluggables[n].sendMessage(e,t)]:[2,Promise.reject("Bot "+n+" does not have valid pluggin did you try addPluggable first?")]):[2,Promise.reject("Bot "+e+" does not exist")];case 1:return[2,r.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}());o.Amplify.register(kn);var In=function(e,t){return(In=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 Ln(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}In(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Dn=function(){return(Dn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Nn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Bn(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function Un(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}Object.create;function Fn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function zn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function qn(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Hn(e){return this instanceof Hn?(this.v=e,this):new Hn(e)}function Gn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof Hn?Promise.resolve(n.value.v).then(s,c):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function s(e){u("next",e)}function c(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function $n(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Fn(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}Object.create;var Vn=function(e){var t,n=c(e.useDualstackEndpoint),r=e.endpoint,o=e.useFipsEndpoint,i=e.urlParser;return Dn(Dn({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:r?c("string"==typeof r?i(r):r):function(){return function(e){return Bn(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,u;return Un(this,(function(s){switch(s.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=s.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.useDualstackEndpoint()];case 2:return o=s.sent(),[4,e.useFipsEndpoint()];case 3:return i=s.sent(),[4,e.regionInfoProvider(r,{useDualstackEndpoint:o,useFipsEndpoint:i})];case 4:if(!(a=(null!==(u=s.sent())&&void 0!==u?u:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser("".concat(n?"https:":"http:","//").concat(a))]}}))}))}(Dn(Dn({},e),{useDualstackEndpoint:n,useFipsEndpoint:o}))},isCustomEndpoint:!!r,useDualstackEndpoint:n})},Wn=function(e){return"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips"))},Kn=function(e){return Wn(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e},Yn=function(e,t){var n;void 0===e&&(e=[]);var r=t.useFipsEndpoint,o=t.useDualstackEndpoint;return null===(n=e.find((function(e){var t=e.tags;return r===t.includes("fips")&&o===t.includes("dualstack")})))||void 0===n?void 0:n.hostname},Zn=function(e,t){var n,r,o,i,a,u,s=t.useFipsEndpoint,c=void 0!==s&&s,l=t.useDualstackEndpoint,f=void 0!==l&&l,d=t.signingService,p=t.regionHash,h=t.partitionHash,v=function(e,t){var n,r=t.partitionHash;return null!==(n=Object.keys(r||{}).find((function(t){return r[t].regions.includes(e)})))&&void 0!==n?n:"aws"}(e,{partitionHash:h}),y=e in p?e:null!==(r=null===(n=h[v])||void 0===n?void 0:n.endpoint)&&void 0!==r?r:e,b={useFipsEndpoint:c,useDualstackEndpoint:f},m=function(e,t){var n=t.regionHostname,r=t.partitionHostname;return n||(r?r.replace("{region}",e):void 0)}(y,{regionHostname:Yn(null===(o=p[y])||void 0===o?void 0:o.variants,b),partitionHostname:Yn(null===(i=h[v])||void 0===i?void 0:i.variants,b)});if(void 0===m)throw new Error("Endpoint resolution failed for: ".concat({resolvedRegion:y,useFipsEndpoint:c,useDualstackEndpoint:f}));var g=function(e,t){var n=t.signingRegion,r=t.regionRegex,o=t.useFipsEndpoint;if(n)return n;if(o){var i=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),a=e.match(i);if(a)return a[0].slice(1,-1)}}(m,{signingRegion:null===(a=p[y])||void 0===a?void 0:a.signingRegion,regionRegex:h[v].regionRegex,useFipsEndpoint:c});return Dn(Dn({partition:v,signingService:d,hostname:m},g&&{signingRegion:g}),(null===(u=p[y])||void 0===u?void 0:u.signingService)&&{signingService:p[y].signingService})},Xn=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Dn(Dn({},this),{headers:Dn({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Dn(Dn({},e),((r={})[n]=Array.isArray(o)?qn([],zn(o),!1):o,r))}),{}))),n},e}();var Jn=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}();var Qn={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},er=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Bn(t,void 0,void 0,(function(){var t,o,i,a,u;return Un(this,(function(s){if(t=r.request,Xn.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")))try{a=e(o),t.headers=Dn(Dn({},t.headers),((u={})["content-length"]=String(a),u))}catch(e){}return[2,n(Dn(Dn({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),Qn)}}};var tr=function(){return(tr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.create;function nr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;!function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?"".concat(e.protocol,":"):e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/".concat(e.path):e.path:"/"}e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(tr(tr({},this),{headers:tr({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return tr(tr({},e),((r={})[n]=Array.isArray(o)?function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],nr(o),!1):o,r))}),{}))),n}}();!function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}();var rr,or={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ir=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Bn(void 0,void 0,void 0,(function(){var r,o;return Un(this,(function(i){return Xn.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),or)}}},ar={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},ur=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Bn(void 0,void 0,void 0,(function(){var r,o,i,a,u,s,c,l,f;return Un(this,(function(d){switch(d.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,u=t.outputFilterSensitiveLog,[4,e(n)];case 1:return s=d.sent(),a?("function"==typeof a.info&&(c=s.output,l=c.$metadata,f=Nn(c,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:u(f),metadata:l})),[2,s]):[2,s]}}))}))}}),ar)}}};!function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(rr||(rr={}));var sr,cr=rr.STANDARD,lr=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],fr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],dr=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],pr=[500,502,503,504],hr=["ECONNRESET","EPIPE","ETIMEDOUT"],vr=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||fr.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},yr=function(){function e(e){var t,n,r,o,i;this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=null!==(t=null==e?void 0:e.beta)&&void 0!==t?t:.7,this.minCapacity=null!==(n=null==e?void 0:e.minCapacity)&&void 0!==n?n:1,this.minFillRate=null!==(r=null==e?void 0:e.minFillRate)&&void 0!==r?r:.5,this.scaleConstant=null!==(o=null==e?void 0:e.scaleConstant)&&void 0!==o?o:.4,this.smooth=null!==(i=null==e?void 0:e.smooth)&&void 0!==i?i:.8;var a=this.getCurrentTimeInSeconds();this.lastThrottleTime=a,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}return e.prototype.getCurrentTimeInSeconds=function(){return Date.now()/1e3},e.prototype.getSendToken=function(){return Bn(this,void 0,void 0,(function(){return Un(this,(function(e){return[2,this.acquireTokenBucket(1)]}))}))},e.prototype.acquireTokenBucket=function(e){return Bn(this,void 0,void 0,(function(){var t;return Un(this,(function(n){switch(n.label){case 0:return this.enabled?(this.refillTokenBucket(),e>this.currentCapacity?(t=(e-this.currentCapacity)/this.fillRate*1e3,[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return this.currentCapacity=this.currentCapacity-e,[2]}}))}))},e.prototype.refillTokenBucket=function(){var e=this.getCurrentTimeInSeconds();if(this.lastTimestamp){var t=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+t),this.lastTimestamp=e}else this.lastTimestamp=e},e.prototype.updateClientSendingRate=function(e){var t;if(this.updateMeasuredRate(),vr(e)){var n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());var r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)},e.prototype.calculateTimeWindow=function(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))},e.prototype.cubicThrottle=function(e){return this.getPrecise(e*this.beta)},e.prototype.cubicSuccess=function(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)},e.prototype.enableTokenBucket=function(){this.enabled=!0},e.prototype.updateTokenBucketRate=function(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)},e.prototype.updateMeasuredRate=function(){var e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){var n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}},e.prototype.getPrecise=function(e){return parseFloat(e.toFixed(8))},e}(),br=new Uint8Array(16);function mr(){if(!sr&&!(sr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sr(br)}var gr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var wr=function(e){return"string"==typeof e&&gr.test(e)},Or=[],Sr=0;Sr<256;++Sr)Or.push((Sr+256).toString(16).substr(1));var _r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Or[e[t+0]]+Or[e[t+1]]+Or[e[t+2]]+Or[e[t+3]]+"-"+Or[e[t+4]]+Or[e[t+5]]+"-"+Or[e[t+6]]+Or[e[t+7]]+"-"+Or[e[t+8]]+Or[e[t+9]]+"-"+Or[e[t+10]]+Or[e[t+11]]+Or[e[t+12]]+Or[e[t+13]]+Or[e[t+14]]+Or[e[t+15]]).toLowerCase();if(!wr(n))throw TypeError("Stringified UUID is invalid");return n};for(var Er=function(e,t,n){var r=(e=e||{}).random||(e.rng||mr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return _r(r)},xr=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Ar=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return lr.includes(e.name)}(e)||vr(e)||function(e){var t;return dr.includes(e.name)||hr.includes((null==e?void 0:e.code)||"")||pr.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},jr=function(){function e(e,t){var n,r,o;this.maxAttemptsProvider=e,this.mode=rr.STANDARD,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Ar,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:xr,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:function(e,t){var n,r,o,i=e,a=null!==(n=null==t?void 0:t.noRetryIncrement)&&void 0!==n?n:1,u=null!==(r=null==t?void 0:t.retryCost)&&void 0!==r?r:5,s=null!==(o=null==t?void 0:t.timeoutRetryCost)&&void 0!==o?o:10,c=e,l=function(e){return"TimeoutError"===e.name?s:u},f=function(e){return l(e)<=c};return Object.freeze({hasRetryTokens:f,retrieveRetryTokens:function(e){if(!f(e))throw new Error("No retry token available");var t=l(e);return c-=t,t},releaseRetryTokens:function(e){c+=null!=e?e:a,c=Math.min(c,i)}})}(500)}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Bn(this,void 0,void 0,(function(){var e;return Un(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t,n){return Bn(this,void 0,void 0,(function(){var r,o,i,a,u,s,c,l;return Un(this,(function(f){switch(f.label){case 0:return o=0,i=0,[4,this.getMaxAttempts()];case 1:a=f.sent(),u=t.request,Xn.isInstance(u)&&(u.headers["amz-sdk-invocation-id"]=Er()),s=function(){var s,l,f,d,p,h,v,y;return Un(this,(function(b){switch(b.label){case 0:return b.trys.push([0,4,,7]),Xn.isInstance(u)&&(u.headers["amz-sdk-request"]="attempt=".concat(o+1,"; max=").concat(a)),(null==n?void 0:n.beforeRequest)?[4,n.beforeRequest()]:[3,2];case 1:b.sent(),b.label=2;case 2:return[4,e(t)];case 3:return s=b.sent(),l=s.response,f=s.output,(null==n?void 0:n.afterRequest)&&n.afterRequest(l),c.retryQuota.releaseRetryTokens(r),f.$metadata.attempts=o+1,f.$metadata.totalRetryDelay=i,[2,{value:{response:l,output:f}}];case 4:return d=b.sent(),p=Pr(d),o++,c.shouldRetry(p,o,a)?(r=c.retryQuota.retrieveRetryTokens(p),h=c.delayDecider(vr(p)?500:100,o),v=Tr(p.$response),y=Math.max(v||0,h),i+=y,[4,new Promise((function(e){return setTimeout(e,y)}))]):[3,6];case 5:return b.sent(),[2,"continue"];case 6:throw p.$metadata||(p.$metadata={}),p.$metadata.attempts=o,p.$metadata.totalRetryDelay=i,p;case 7:return[2]}}))},c=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(l=f.sent())?[2,l.value]:[3,2];case 4:return[2]}}))}))},e}(),Tr=function(e){if(Jn.isInstance(e)){var t=Object.keys(e.headers).find((function(e){return"retry-after"===e.toLowerCase()}));if(t){var n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n).getTime()-Date.now():1e3*r}}},Pr=function(e){return e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error("AWS SDK error wrapper for ".concat(e))},Cr=function(e){function t(t,n){var r=this,o=null!=n?n:{},i=o.rateLimiter,a=Nn(o,["rateLimiter"]);return(r=e.call(this,t,a)||this).rateLimiter=null!=i?i:new yr,r.mode=rr.ADAPTIVE,r}return Ln(t,e),t.prototype.retry=function(t,n){return Bn(this,void 0,void 0,(function(){var r=this;return Un(this,(function(o){return[2,e.prototype.retry.call(this,t,n,{beforeRequest:function(){return Bn(r,void 0,void 0,(function(){return Un(this,(function(e){return[2,this.rateLimiter.getSendToken()]}))}))},afterRequest:function(e){r.rateLimiter.updateClientSendingRate(e)}})]}))}))},t}(jr),Rr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Mr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Bn(void 0,void 0,void 0,(function(){var o;return Un(this,(function(i){switch(i.label){case 0:return[4,e.retryStrategy()];case 1:return(null==(o=i.sent())?void 0:o.mode)&&(n.userAgent=qn(qn([],zn(n.userAgent||[]),!1),[["cfg/retry-mode",o.mode]],!1)),[2,o.retry(t,r)]}}))}))}}}(e),Rr)}}},kr={},Ir={},Lr=0;Lr<256;Lr++){var Dr=Lr.toString(16).toLowerCase();1===Dr.length&&(Dr="0".concat(Dr)),kr[Lr]=Dr,Ir[Dr]=Lr}function Nr(e){for(var t="",n=0;n<e.byteLength;n++)t+=kr[e[n]];return t}var Br="X-Amz-Date".toLowerCase(),Ur=["authorization",Br,"date"],Fr="X-Amz-Signature".toLowerCase(),zr="X-Amz-Security-Token".toLowerCase(),qr={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Hr=/^proxy-/,Gr=/^sec-/,$r="AWS4-HMAC-SHA256-PAYLOAD",Vr={},Wr=[],Kr=function(e,t,n){return"".concat(e,"/").concat(t,"/").concat(n,"/").concat("aws4_request")},Yr=function(e,t,n){var r=new e(t);return r.update(n),r.digest()},Zr=function(e,t,n){var r,o,i=e.headers,a={};try{for(var u=Fn(Object.keys(i).sort()),s=u.next();!s.done;s=u.next()){var c=s.value;if(null!=i[c]){var l=c.toLowerCase();(l in qr||(null==t?void 0:t.has(l))||Hr.test(l)||Gr.test(l))&&(!n||n&&!n.has(l))||(a[l]=i[c].trim().replace(/\s+/g," "))}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return a},Xr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Jr)},Jr=function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())},Qr=function(e,t){var n=e.headers,r=e.body;return Bn(void 0,void 0,void 0,(function(){var e,o,i,a,u,s,c;return Un(this,(function(l){switch(l.label){case 0:try{for(e=Fn(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){s={error:e}}finally{try{o&&!o.done&&(c=e.return)&&c.call(e)}finally{if(s)throw s.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(f=r,"function"==typeof ArrayBuffer&&f instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(f))?((a=new t).update(r),u=Nr,[4,a.digest()]):[3,3];case 2:return[2,u.apply(void 0,[l.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var f}))}))},eo=function(e){var t=e.headers,n=e.query,r=Nn(e,["headers","query"]);return Dn(Dn({},r),{headers:Dn({},t),query:n?to(n):void 0})},to=function(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Dn(Dn({},t),((r={})[n]=Array.isArray(o)?qn([],zn(o),!1):o,r))}),{})},no=function(e){var t,n;e="function"==typeof e.clone?e.clone():eo(e);try{for(var r=Fn(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;Ur.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e},ro=function(e){return"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e},oo=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,u=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=u,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=c(r),this.credentialProvider=c(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Bn(this,void 0,void 0,(function(){var n,r,o,i,a,u,s,c,l,f,d,p,h,v,y,b,m,g,w,O,S,_,E,x;return Un(this,(function(A){switch(A.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,u=t.unhoistableHeaders,s=t.signableHeaders,c=t.signingRegion,l=t.signingService,[4,this.credentialProvider()];case 1:return f=A.sent(),this.validateResolvedCredentials(f),null==c?[3,2]:(p=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:p=A.sent(),A.label=4;case 4:return d=p,h=io(r),v=h.longDate,y=h.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(b=Kr(y,d,null!=l?l:this.service),m=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():eo(e),a=i.headers,u=i.query,s=void 0===u?{}:u;try{for(var c=Fn(Object.keys(a)),l=c.next();!l.done;l=c.next()){var f=l.value,d=f.toLowerCase();"x-amz-"!==d.slice(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(s[f]=a[f],delete a[f])}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Dn(Dn({},e),{headers:a,query:s})}(no(e),{unhoistableHeaders:u}),f.sessionToken&&(m.query["X-Amz-Security-Token"]=f.sessionToken),m.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",m.query["X-Amz-Credential"]="".concat(f.accessKeyId,"/").concat(b),m.query["X-Amz-Date"]=v,m.query["X-Amz-Expires"]=i.toString(10),g=Zr(m,a,s),m.query["X-Amz-SignedHeaders"]=ao(g),w=m.query,O="X-Amz-Signature",S=this.getSignature,_=[v,b,this.getSigningKey(f,d,y,l)],E=this.createCanonicalRequest,x=[m,g],[4,Qr(e,this.sha256)]);case 5:return[4,S.apply(this,_.concat([E.apply(this,x.concat([A.sent()]))]))];case 6:return w[O]=A.sent(),[2,m]}}))}))},e.prototype.sign=function(e,t){return Bn(this,void 0,void 0,(function(){return Un(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,u=t.signingRegion,s=t.signingService;return Bn(this,void 0,void 0,(function(){var e,t,o,c,l,f,d,p,h,v,y;return Un(this,(function(b){switch(b.label){case 0:return null==u?[3,1]:(t=u,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=b.sent(),b.label=3;case 3:return e=t,o=io(i),c=o.shortDate,l=o.longDate,f=Kr(c,e,null!=s?s:this.service),[4,Qr({headers:{},body:r},this.sha256)];case 4:return d=b.sent(),(p=new this.sha256).update(n),v=Nr,[4,p.digest()];case 5:return h=v.apply(void 0,[b.sent()]),y=[$r,l,f,a,h,d].join("\n"),[2,this.signString(y,{signingDate:i,signingRegion:e,signingService:s})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Bn(this,void 0,void 0,(function(){var t,n,r,u,s,c,l,f;return Un(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),this.validateResolvedCredentials(t),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,u=io(o).shortDate,l=(c=this.sha256).bind,[4,this.getSigningKey(t,n,u,a)];case 5:return(s=new(l.apply(c,[void 0,d.sent()]))).update(e),f=Nr,[4,s.digest()];case 6:return[2,f.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,u=n.signingRegion,s=n.signingService;return Bn(this,void 0,void 0,(function(){var t,n,r,c,l,f,d,p,h,v,y;return Un(this,(function(b){switch(b.label){case 0:return[4,this.credentialProvider()];case 1:return t=b.sent(),this.validateResolvedCredentials(t),null==u?[3,2]:(r=u,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=b.sent(),b.label=4;case 4:return n=r,c=no(e),l=io(o),f=l.longDate,d=l.shortDate,p=Kr(d,n,null!=s?s:this.service),c.headers[Br]=f,t.sessionToken&&(c.headers[zr]=t.sessionToken),[4,Qr(c,this.sha256)];case 5:return h=b.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Fn(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=h),v=Zr(c,a,i),[4,this.getSignature(f,p,this.getSigningKey(t,n,d,s),this.createCanonicalRequest(c,v,h))];case 6:return y=b.sent(),c.headers.authorization="".concat("AWS4-HMAC-SHA256"," ")+"Credential=".concat(t.accessKeyId,"/").concat(p,", ")+"SignedHeaders=".concat(ao(v),", ")+"Signature=".concat(y),[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return"".concat(e.method,"\n").concat(this.getCanonicalPath(e),"\n").concat(function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},u=function(e){if(e.toLowerCase()===Fr)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]="".concat(Xr(e),"=").concat(Xr(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat(["".concat(Xr(e),"=").concat(Xr(n))])}),[]).join("&"))};try{for(var s=Fn(Object.keys(o).sort()),c=s.next();!c.done;c=s.next()){u(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e),"\n").concat(r.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),"\n\n").concat(r.join(";"),"\n").concat(n)},e.prototype.createStringToSign=function(e,t,n){return Bn(this,void 0,void 0,(function(){var r,o;return Un(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"".concat("AWS4-HMAC-SHA256","\n").concat(e,"\n").concat(t,"\n").concat(Nr(o))]}}))}))},e.prototype.getCanonicalPath=function(e){var t,n,r=e.path;if(this.uriEscapePath){var o=[];try{for(var i=Fn(r.split("/")),a=i.next();!a.done;a=i.next()){var u=a.value;0!==(null==u?void 0:u.length)&&("."!==u&&(".."===u?o.pop():o.push(u)))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var s="".concat((null==r?void 0:r.startsWith("/"))?"/":"").concat(o.join("/")).concat(o.length>0&&(null==r?void 0:r.endsWith("/"))?"/":"");return encodeURIComponent(s).replace(/%2F/g,"/")}return r},e.prototype.getSignature=function(e,t,n,r){return Bn(this,void 0,void 0,(function(){var o,i,a,u,s;return Un(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=c.sent(),u=(a=this.sha256).bind,[4,n];case 2:return(i=new(u.apply(a,[void 0,c.sent()]))).update(o),s=Nr,[4,i.digest()];case 3:return[2,s.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Bn(void 0,void 0,void 0,(function(){var i,a,u,s,c,l,f,d,p;return Un(this,(function(h){switch(h.label){case 0:return[4,Yr(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=h.sent(),(a="".concat(n,":").concat(r,":").concat(o,":").concat(Nr(i),":").concat(t.sessionToken))in Vr)return[2,Vr[a]];for(Wr.push(a);Wr.length>50;)delete Vr[Wr.shift()];u="AWS4".concat(t.secretAccessKey),h.label=2;case 2:h.trys.push([2,7,8,9]),s=Fn([n,r,o,"aws4_request"]),c=s.next(),h.label=3;case 3:return c.done?[3,6]:(l=c.value,[4,Yr(e,u,l)]);case 4:u=h.sent(),h.label=5;case 5:return c=s.next(),[3,3];case 6:return[3,9];case 7:return f=h.sent(),d={error:f},[3,9];case 8:try{c&&!c.done&&(p=s.return)&&p.call(s)}finally{if(d)throw d.error}return[7];case 9:return[2,Vr[a]=u]}}))}))}(this.sha256,e,n,t,r||this.service)},e.prototype.validateResolvedCredentials=function(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")},e}(),io=function(e){var t,n=(t=e,ro(t).toISOString().replace(/\.\d{3}Z$/,"Z")).replace(/[\-:]/g,"");return{longDate:n,shortDate:n.slice(0,8)}},ao=function(e){return Object.keys(e).sort().join(";")},uo=function(e){return"function"==typeof e?ee(e,(function(e){return void 0!==e.expiration&&e.expiration.getTime()-Date.now()<3e5}),(function(e){return void 0!==e.expiration})):c(e)},so=function(e){return new Date(Date.now()+e)},co=function(e,t){var n=Date.parse(e);return function(e,t){return Math.abs(so(t).getTime()-e)>=3e5}(n,t)?n-Date.now():t},lo=function(e){var t,n,r;return Jn.isInstance(e)?null!==(n=null===(t=e.headers)||void 0===t?void 0:t.date)&&void 0!==n?n:null===(r=e.headers)||void 0===r?void 0:r.Date:void 0},fo={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},po=function(e){return{applyToStack:function(t){t.addRelativeTo(function(e){return function(t,n){return function(r){var o,i,a;return Bn(this,void 0,void 0,(function(){var u,s,c,l,f,d,p;return Un(this,(function(h){switch(h.label){case 0:return Xn.isInstance(r.request)?(u=null===(a=null===(i=null===(o=n.endpointV2)||void 0===o?void 0:o.properties)||void 0===i?void 0:i.authSchemes)||void 0===a?void 0:a[0],[4,e.signer(u)]):[2,t(r)];case 1:return s=h.sent(),l=t,f=[Dn({},r)],p={},[4,s.sign(r.request,{signingDate:so(e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 2:return[4,l.apply(void 0,[Dn.apply(void 0,f.concat([(p.request=h.sent(),p)]))]).catch((function(t){var n,r=null!==(n=t.ServerTime)&&void 0!==n?n:lo(t.$response);throw r&&(e.systemClockOffset=co(r,e.systemClockOffset)),t}))];case 3:return c=h.sent(),(d=lo(c.response))&&(e.systemClockOffset=co(d,e.systemClockOffset)),[2,c]}}))}))}}}(e),fo)}}};var ho=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,vo=function(e){var t=zn(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(ho,"_")})).join("/")},yo={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},bo=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Bn(void 0,void 0,void 0,(function(){var o,i,a,u,s,c,l,f,d;return Un(this,(function(p){switch(p.label){case 0:return o=r.request,Xn.isInstance(o)?(i=o.headers,a=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(vo))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return u=p.sent().map(vo),s=(null===(d=null==n?void 0:n.customUserAgent)||void 0===d?void 0:d.map(vo))||[],c=qn(qn(qn([],zn(u),!1),zn(a),!1),zn(s),!1).join(" "),l=qn(qn([],zn(u.filter((function(e){return e.startsWith("aws-sdk-")}))),!1),zn(s),!1).join(" "),"browser"!==n.runtime?(l&&(i["x-amz-user-agent"]=i["x-amz-user-agent"]?"".concat(i["user-agent"]," ").concat(l):l),i["user-agent"]=c):i["x-amz-user-agent"]=c,[2,e(Dn(Dn({},r),{request:o}))]}}))}))}}),yo)}}},mo=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Dn({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Dn({},e))})),n},o=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,qn([],zn(o(e)),!1))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,qn([],zn(o(e)),!1))})),t},i=function(n){void 0===n&&(n=!1);var r,i=[],a=[],u={};return e.forEach((function(e){var t=Dn(Dn({},e),{before:[],after:[]});t.name&&(u[t.name]=t),i.push(t)})),t.forEach((function(e){var t=Dn(Dn({},e),{before:[],after:[]});t.name&&(u[t.name]=t),a.push(t)})),a.forEach((function(e){if(e.toMiddleware){var t=u[e.toMiddleware];if(void 0===t){if(n)return;throw new Error("".concat(e.toMiddleware," is not found when adding ").concat(e.name||"anonymous"," middleware ").concat(e.relation," ").concat(e.toMiddleware))}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(r=i,r.sort((function(e,t){return go[t.step]-go[e.step]||wo[t.priority||"normal"]-wo[e.priority||"normal"]}))).map(o).reduce((function(e,t){return e.push.apply(e,qn([],zn(t),!1)),e}),[])},a={add:function(t,r){void 0===r&&(r={});var o=r.name,i=r.override,a=Dn({step:"initialize",priority:"normal",middleware:t},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '".concat(o,"'"));var u=e.findIndex((function(e){return e.name===o})),s=e[u];if(s.step!==a.step||s.priority!==a.priority)throw new Error('"'.concat(o,'" middleware with ').concat(s.priority," priority in ").concat(s.step," step cannot be ")+"overridden by same-name middleware with ".concat(a.priority," priority in ").concat(a.step," step."));e.splice(u,1)}n.add(o)}e.push(a)},addRelativeTo:function(e,r){var o=r.name,i=r.override,a=Dn({middleware:e},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '".concat(o,"'"));var u=t.findIndex((function(e){return e.name===o})),s=t[u];if(s.toMiddleware!==a.toMiddleware||s.relation!==a.relation)throw new Error('"'.concat(o,'" middleware ').concat(s.relation,' "').concat(s.toMiddleware,'" middleware cannot be overridden ')+"by same-name middleware ".concat(a.relation,' "').concat(a.toMiddleware,'" middleware.'));t.splice(u,1)}n.add(o)}t.push(a)},clone:function(){return r(mo())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=r(mo());return t.use(e),t},applyToStack:r,identify:function(){return i(!0).map((function(e){return e.name+": "+(e.tags||[]).join(",")}))},resolve:function(e,t){var n,r;try{for(var o=Fn(i().map((function(e){return e.middleware})).reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}};return a},go={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},wo={high:3,normal:2,low:1},Oo=function(){function e(e){this.middlewareStack=mo(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),So=function(){this.middlewareStack=mo()},_o="***SensitiveInformation***",Eo=function(e){if(null!=e){if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Lo.warn(Io("Expected number but observed string: ".concat(e))),t}if("number"==typeof e)return e;throw new TypeError("Expected number, got ".concat(typeof e,": ").concat(e))}},xo=(Math.ceil(Math.pow(2,127)*(2-Math.pow(2,-23))),function(e){if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError("Expected integer, got ".concat(typeof e,": ").concat(e))}}),Ao=function(e){return jo(e,32)},jo=function(e,t){var n=xo(e);if(void 0!==n&&To(n,t)!==n)throw new TypeError("Expected ".concat(t,"-bit integer, got ").concat(e));return n},To=function(e,t){switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},Po=function(e,t){if(null==e){if(t)throw new TypeError("Expected a non-null value for ".concat(t));throw new TypeError("Expected a non-null value")}return e},Co=function(e){if(null!=e){if("object"==typeof e&&!Array.isArray(e))return e;var t=Array.isArray(e)?"array":typeof e;throw new TypeError("Expected object, got ".concat(t,": ").concat(e))}},Ro=function(e){if(null!=e){if("string"==typeof e)return e;if(["boolean","number","bigint"].includes(typeof e))return Lo.warn(Io("Expected string, got ".concat(typeof e,": ").concat(e))),String(e);throw new TypeError("Expected string, got ".concat(typeof e,": ").concat(e))}},Mo=function(e){return"string"==typeof e?ko(e):Eo(e)},ko=function(e){switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error("Unable to parse float value: ".concat(e))}},Io=function(e){return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((function(e){return!e.includes("stackTraceWarning")})).join("\n")},Lo={warn:console.warn};new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var Do=function(e){function t(n){var r=e.call(this,n.message)||this;return Object.setPrototypeOf(r,t.prototype),r.name=n.name,r.$fault=n.$fault,r.$metadata=n.$metadata,r}return Ln(t,e),t}(Error),No=function(e,t){void 0===t&&(t={}),Object.entries(t).filter((function(e){return void 0!==zn(e,2)[1]})).forEach((function(t){var n=zn(t,2),r=n[0],o=n[1];null!=e[r]&&""!==e[r]||(e[r]=o)}));var n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},Bo=function(e){var t=e.output,n=e.parsedBody,r=e.exceptionCtor,o=e.errorCode,i=Uo(t),a=i.httpStatusCode?i.httpStatusCode+"":void 0,u=new r({name:n.code||n.Code||o||a||"UnknowError",$fault:"client",$metadata:i});throw No(u,n)},Uo=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"]}},Fo=function(e){switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}};n(23);function zo(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}var qo=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,qn([null],zn(arguments),!1)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};qo.prototype=Object.create(String.prototype,{constructor:{value:qo,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(qo,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Ln(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(qo);function Ho(e,t,n){var r,o,i,a;if(void 0===t&&void 0===n)i={},a=e;else{if(i=e,"function"==typeof t)return Go(i,t,a=n);a=t}try{for(var u=Fn(Object.keys(a)),s=u.next();!s.done;s=u.next()){var c=s.value;if(Array.isArray(a[c])){var l=zn(a[c],2),f=l[0],d=l[1];if("function"==typeof d){var p=void 0,h=void 0===f&&null!=(p=d()),v="function"==typeof f&&!!f(void 0)||"function"!=typeof f&&!!f;h?i[c]=p:v&&(i[c]=d())}else{h=void 0===f&&null!=d,v="function"==typeof f&&!!f(d)||"function"!=typeof f&&!!f;(h||v)&&(i[c]=d)}}else i[c]=a[c]}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i}var Go=function(e,t,n){return Ho(e,Object.entries(n).reduce((function(e,n){var r=zn(n,2),o=r[0],i=r[1];return Array.isArray(i)?e[o]=i:e[o]="function"==typeof i?[t,i()]:[t,i],e}),{}))},$o=function(e,t,n,r,o,i){if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");var a=r();if(a.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");return e=e.replace(o,i?a.split("/").map((function(e){return zo(e)})).join("/"):zo(a))};var Vo=n(33),Wo=n(32),Ko=n(11);Object.create;function Yo(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;for(var Zo={},Xo={},Jo=0;Jo<256;Jo++){var Qo=Jo.toString(16).toLowerCase();1===Qo.length&&(Qo="0".concat(Qo)),Zo[Jo]=Qo,Xo[Qo]=Jo}function ei(e){for(var t="",n=0;n<e.byteLength;n++)t+=Zo[e[n]];return t}var ti=function(){function e(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}return e.fromNumber=function(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw new Error("".concat(t," is too large (or, if negative, too small) to represent as an Int64"));for(var n=new Uint8Array(8),r=7,o=Math.abs(Math.round(t));r>-1&&o>0;r--,o/=256)n[r]=o;return t<0&&ni(n),new e(n)},e.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&ni(e),parseInt(ei(e),16)*(t?-1:1)},e.prototype.toString=function(){return String(this.valueOf())},e}();function ni(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}var ri,oi=function(){function e(e,t){this.toUtf8=e,this.fromUtf8=t}return e.prototype.format=function(e){var t,n,r,o,i=[];try{for(var a=Yo(Object.keys(e)),u=a.next();!u.done;u=a.next()){var s=u.value,c=this.fromUtf8(s);i.push(Uint8Array.from([c.byteLength]),c,this.formatHeaderValue(e[s]))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}var l=new Uint8Array(i.reduce((function(e,t){return e+t.byteLength}),0)),f=0;try{for(var d=Yo(i),p=d.next();!p.done;p=d.next()){var h=p.value;l.set(h,f),f+=h.byteLength}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return l},e.prototype.formatHeaderValue=function(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":var t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":var n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":var r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":var o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);var i=new Uint8Array(o.buffer);return i.set(e.value,3),i;case"string":var a=this.fromUtf8(e.value),u=new DataView(new ArrayBuffer(3+a.byteLength));u.setUint8(0,7),u.setUint16(1,a.byteLength,!1);var s=new Uint8Array(u.buffer);return s.set(a,3),s;case"timestamp":var c=new Uint8Array(9);return c[0]=8,c.set(ti.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!hi.test(e.value))throw new Error("Invalid UUID received: ".concat(e.value));var l=new Uint8Array(17);return l[0]=9,l.set(function(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2){var r=e.slice(n,n+2).toLowerCase();if(!(r in Xo))throw new Error("Cannot decode unrecognized sequence ".concat(r," as hexadecimal"));t[n/2]=Xo[r]}return t}(e.value.replace(/\-/g,"")),1),l}},e.prototype.parse=function(e){for(var t={},n=0;n<e.byteLength;){var r=e.getUint8(n++),o=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,r));switch(n+=r,e.getUint8(n++)){case 0:t[o]={type:ii,value:!0};break;case 1:t[o]={type:ii,value:!1};break;case 2:t[o]={type:ai,value:e.getInt8(n++)};break;case 3:t[o]={type:ui,value:e.getInt16(n,!1)},n+=2;break;case 4:t[o]={type:si,value:e.getInt32(n,!1)},n+=4;break;case 5:t[o]={type:ci,value:new ti(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:var i=e.getUint16(n,!1);n+=2,t[o]={type:li,value:new Uint8Array(e.buffer,e.byteOffset+n,i)},n+=i;break;case 7:var a=e.getUint16(n,!1);n+=2,t[o]={type:fi,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,a))},n+=a;break;case 8:t[o]={type:di,value:new Date(new ti(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:var u=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,t[o]={type:pi,value:"".concat(ei(u.subarray(0,4)),"-").concat(ei(u.subarray(4,6)),"-").concat(ei(u.subarray(6,8)),"-").concat(ei(u.subarray(8,10)),"-").concat(ei(u.subarray(10)))};break;default:throw new Error("Unrecognized header type tag")}}return t},e}();!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(ri||(ri={}));var ii="boolean",ai="byte",ui="short",si="integer",ci="long",li="binary",fi="string",di="timestamp",pi="uuid",hi=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var vi=function(){function e(e,t){this.headerMarshaller=new oi(e,t)}return e.prototype.encode=function(e){var t=e.headers,n=e.body,r=this.headerMarshaller.format(t),o=r.byteLength+n.byteLength+16,i=new Uint8Array(o),a=new DataView(i.buffer,i.byteOffset,i.byteLength),u=new Ko.Crc32;return a.setUint32(0,o,!1),a.setUint32(4,r.byteLength,!1),a.setUint32(8,u.update(i.subarray(0,8)).digest(),!1),i.set(r,12),i.set(n,r.byteLength+12),a.setUint32(o-4,u.update(i.subarray(8,o-4)).digest(),!1),i},e.prototype.decode=function(e){var t=function(e){var t=e.byteLength,n=e.byteOffset,r=e.buffer;if(t<16)throw new Error("Provided message too short to accommodate event stream message overhead");var o=new DataView(r,n,t),i=o.getUint32(0,!1);if(t!==i)throw new Error("Reported message length does not match received message length");var a=o.getUint32(4,!1),u=o.getUint32(8,!1),s=o.getUint32(t-4,!1),c=(new Ko.Crc32).update(new Uint8Array(r,n,8));if(u!==c.digest())throw new Error("The prelude checksum specified in the message (".concat(u,") does not match the calculated CRC32 checksum (").concat(c.digest(),")"));if(c.update(new Uint8Array(r,n+8,t-12)),s!==c.digest())throw new Error("The message checksum (".concat(c.digest(),") did not match the expected value of ").concat(s));return{headers:new DataView(r,n+8+4,a),body:new Uint8Array(r,n+8+4+a,i-a-16)}}(e),n=t.headers,r=t.body;return{headers:this.headerMarshaller.parse(n),body:r}},e.prototype.formatHeaders=function(e){return this.headerMarshaller.format(e)},e}();var yi=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventStreamCodec=new vi(t,n),this.utfEncoder=t}return e.prototype.deserialize=function(e,t){var n,r,o,i,a,u,s;return function(e,t){var n;return(n={})[Symbol.asyncIterator]=function(){return Gn(this,arguments,(function(){var n,r,o,i,a,u,s,c,l,f,d,p,h,v,y,b,m;return Un(this,(function(g){switch(g.label){case 0:g.trys.push([0,12,13,18]),n=$n(e),g.label=1;case 1:return[4,Hn(n.next())];case 2:if((r=g.sent()).done)return[3,11];if(o=r.value,i=t.eventStreamCodec.decode(o),"error"!==(a=i.headers[":message-type"].value))return[3,3];throw(u=new Error(i.headers[":error-message"].value||"UnknownError")).name=i.headers[":error-code"].value,u;case 3:return"exception"!==a?[3,5]:(s=i.headers[":exception-type"].value,(v={})[s]=i,c=v,[4,Hn(t.deserializer(c))]);case 4:if((l=g.sent()).$unknown)throw(f=new Error(t.toUtf8(i.body))).name=s,f;throw l[s];case 5:return"event"!==a?[3,9]:((y={})[i.headers[":event-type"].value]=i,d=y,[4,Hn(t.deserializer(d))]);case 6:return(p=g.sent()).$unknown?[3,10]:[4,Hn(p)];case 7:return[4,g.sent()];case 8:return g.sent(),[3,10];case 9:throw Error("Unrecognizable event type: ".concat(i.headers[":event-type"].value));case 10:return[3,1];case 11:return[3,18];case 12:return h=g.sent(),b={error:h},[3,18];case 13:return g.trys.push([13,,16,17]),r&&!r.done&&(m=n.return)?[4,Hn(m.call(n))]:[3,15];case 14:g.sent(),g.label=15;case 15:return[3,17];case 16:if(b)throw b.error;return[7];case 17:return[7];case 18:return[2]}}))}))},n}((n=e,o=0,i=0,a=null,u=null,s=function(e){if("number"!=typeof e)throw new Error("Attempted to allocate an event message where size was not a number: "+e);o=e,i=4,a=new Uint8Array(e),new DataView(a.buffer).setUint32(0,e,!1)},(r={})[Symbol.asyncIterator]=function(){return Gn(this,arguments,(function(){var e,t,r,c,l,f,d,p;return Un(this,(function(h){switch(h.label){case 0:e=n[Symbol.asyncIterator](),h.label=1;case 1:return[4,Hn(e.next())];case 2:return t=h.sent(),r=t.value,t.done?o?[3,4]:[4,Hn(void 0)]:[3,10];case 3:return[2,h.sent()];case 4:return o!==i?[3,7]:[4,Hn(a)];case 5:return[4,h.sent()];case 6:return h.sent(),[3,8];case 7:throw new Error("Truncated event message received.");case 8:return[4,Hn(void 0)];case 9:return[2,h.sent()];case 10:c=r.length,l=0,h.label=11;case 11:if(!(l<c))return[3,15];if(!a){if(f=c-l,u||(u=new Uint8Array(4)),d=Math.min(4-i,f),u.set(r.slice(l,l+d),i),l+=d,(i+=d)<4)return[3,15];s(new DataView(u.buffer).getUint32(0,!1)),u=null}return p=Math.min(o-i,c-l),a.set(r.slice(l,l+p),i),i+=p,l+=p,o&&o===i?[4,Hn(a)]:[3,14];case 12:return[4,h.sent()];case 13:h.sent(),a=null,o=0,i=0,h.label=14;case 14:return[3,11];case 15:return[3,1];case 16:return[2]}}))}))},r),{eventStreamCodec:this.eventStreamCodec,deserializer:t,toUtf8:this.utfEncoder})},e.prototype.serialize=function(e,t){var n,r=this;return(n={})[Symbol.asyncIterator]=function(){return Gn(this,arguments,(function(){var n,o,i,a,u,s;return Un(this,(function(c){switch(c.label){case 0:c.trys.push([0,7,8,13]),n=$n(e),c.label=1;case 1:return[4,Hn(n.next())];case 2:return(o=c.sent()).done?[3,6]:(i=o.value,[4,Hn(r.eventStreamCodec.encode(t(i)))]);case 3:return[4,c.sent()];case 4:c.sent(),c.label=5;case 5:return[3,1];case 6:return[3,13];case 7:return a=c.sent(),u={error:a},[3,13];case 8:return c.trys.push([8,,11,12]),o&&!o.done&&(s=n.return)?[4,Hn(s.call(n))]:[3,10];case 9:c.sent(),c.label=10;case 10:return[3,12];case 11:if(u)throw u.error;return[7];case 12:return[7];case 13:return[4,Hn(new Uint8Array(0))];case 14:return[4,c.sent()];case 15:return c.sent(),[2]}}))}))},n},e}(),bi=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.universalMarshaller=new yi({utf8Decoder:n,utf8Encoder:t})}return e.prototype.deserialize=function(e,t){var n,r,o=mi(e)?(n=e,(r={})[Symbol.asyncIterator]=function(){return Gn(this,arguments,(function(){var e,t,r,o;return Un(this,(function(i){switch(i.label){case 0:e=n.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Hn(e.read())];case 3:return t=i.sent(),r=t.done,o=t.value,r?[4,Hn(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Hn(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))},r):e;return this.universalMarshaller.deserialize(o,t)},e.prototype.serialize=function(e,t){var n,r=this.universalMarshaller.serialize(e,t);return"function"==typeof ReadableStream?(n=r[Symbol.asyncIterator](),new ReadableStream({pull:function(e){return Bn(this,void 0,void 0,(function(){var t,r,o;return Un(this,(function(i){switch(i.label){case 0:return[4,n.next()];case 1:return t=i.sent(),r=t.done,o=t.value,r?[2,e.close()]:(e.enqueue(o),[2])}}))}))}})):r},e}(),mi=function(e){return"function"==typeof ReadableStream&&e instanceof ReadableStream},gi=function(e){return new bi(e)};for(var wi=function(){function e(e){"function"==typeof e?this.configProvider=e().then((function(e){return e||{}})):(this.config=null!=e?e:{},this.configProvider=Promise.resolve(this.config))}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal;return Bn(this,void 0,void 0,(function(){var t,r,o,i,a,u,s,c,l,f,d,p;return Un(this,(function(h){switch(h.label){case 0:return this.config?[3,2]:(t=this,[4,this.configProvider]);case 1:t.config=h.sent(),h.label=2;case 2:return r=this.config.requestTimeout,(null==n?void 0:n.aborted)?((o=new Error("Request aborted")).name="AbortError",[2,Promise.reject(o)]):(i=e.path,e.query&&(a=function(e){var t,n,r=[];try{for(var o=Fn(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,u=e[a];if(a=Xr(a),Array.isArray(u))for(var s=0,c=u.length;s<c;s++)r.push("".concat(a,"=").concat(Xr(u[s])));else{var l=a;(u||"string"==typeof u)&&(l+="=".concat(Xr(u))),r.push(l)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query))&&(i+="?".concat(a)),u=e.port,s=e.method,c="".concat(e.protocol,"//").concat(e.hostname).concat(u?":".concat(u):"").concat(i),l="GET"===s||"HEAD"===s?void 0:e.body,f={body:l,headers:new Headers(e.headers),method:s},"undefined"!=typeof AbortController&&(f.signal=n),d=new Request(c,f),p=[fetch(d).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Fn(r.entries()),a=i.next();!a.done;a=i.next()){var u=a.value;o[u[0]]=u[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new Jn({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new Jn({headers:o,statusCode:e.status,body:t})}}))})),(v=r,void 0===v&&(v=0),new Promise((function(e,t){v&&setTimeout((function(){var e=new Error("Request did not complete within ".concat(v," ms"));e.name="TimeoutError",t(e)}),v)})))],n&&p.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),[2,Promise.race(p)])}var v}))}))},e}(),Oi={},Si=new Array(64),_i=0,Ei="A".charCodeAt(0),xi="Z".charCodeAt(0);_i+Ei<=xi;_i++){var Ai=String.fromCharCode(_i+Ei);Oi[Ai]=_i,Si[_i]=Ai}for(_i=0,Ei="a".charCodeAt(0),xi="z".charCodeAt(0);_i+Ei<=xi;_i++){Ai=String.fromCharCode(_i+Ei);var ji=_i+26;Oi[Ai]=ji,Si[ji]=Ai}for(_i=0;_i<10;_i++){Oi[_i.toString(10)]=_i+52;Ai=_i.toString(10),ji=_i+52;Oi[Ai]=ji,Si[ji]=Ai}Oi["+"]=62,Si[62]="+",Oi["/"]=63,Si[63]="/";function Ti(e){var t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,u=o,s=o+3;u<=s;u++)if("="!==e[u]){if(!(e[u]in Oi))throw new TypeError("Invalid character ".concat(e[u]," in base64 string."));i|=Oi[e[u]]<<6*(s-u),a+=6}else i>>=6;var c=o/4*3;i>>=a%8;for(var l=Math.floor(a/8),f=0;f<l;f++){var d=8*(l-f-1);r.setUint8(c+f,(i&255<<d)>>d)}}return new Uint8Array(n)}function Pi(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var u=Math.ceil(o/6);r<<=6*u-o;for(var s=1;s<=u;s++){var c=6*(u-s);t+=Si[(r&63<<c)>>c]}t+="==".slice(0,4-u)}return t}var Ci=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Bn(this,void 0,void 0,(function(){var t,n;return Un(this,(function(r){switch(r.label){case 0:return[4,Ri(e)];case 1:return t=r.sent(),n=Ti(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Bn(this,void 0,void 0,(function(){var t,n,r,o,i,a,u;return Un(this,(function(s){switch(s.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,s.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=s.sent(),i=o.done,(a=o.value)&&(u=t,(t=new Uint8Array(u.length+a.length)).set(u),t.set(a,u.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Ri(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Mi=function(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error("Body Length computation failed for ".concat(e))},ki=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Bn(void 0,void 0,void 0,(function(){var e,r,o,i,a,u,s,c,l;return Un(this,(function(f){return e="undefined"!=typeof window&&(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?nt.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/".concat((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser","".concat(null!==(s=null===(u=null==e?void 0:e.browser)||void 0===u?void 0:u.name)&&void 0!==s?s:"unknown","_").concat(null!==(l=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==l?l:"unknown")]],t&&r.push(["api/".concat(t),n]),[2,r]}))}))}};var Ii=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},Li=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)};var Di=function(e){if("string"==typeof e)return Di(new URL(e));var t,n=e,r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,u=n.search;return u&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Fn(e.split("&")),i=o.next();!i.done;i=o.next()){var a=zn(i.value.split("="),2),u=a[0],s=a[1],c=void 0===s?null:s;u=decodeURIComponent(u),c&&(c=decodeURIComponent(c)),u in r?Array.isArray(r[u])?r[u].push(c):r[u]=[r[u],c]:r[u]=c}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(u)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},Ni={},Bi={aws:{regions:["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-southeast-1","ap-southeast-2","ap-southeast-3","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"],regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",variants:[{hostname:"runtime-v2-lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-v2-lex-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime-v2-lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime-v2-lex.{region}.api.aws",tags:["dualstack"]}]},"aws-cn":{regions:["cn-north-1","cn-northwest-1"],regionRegex:"^cn\\-\\w+\\-\\d+$",variants:[{hostname:"runtime-v2-lex.{region}.amazonaws.com.cn",tags:[]},{hostname:"runtime-v2-lex-fips.{region}.amazonaws.com.cn",tags:["fips"]},{hostname:"runtime-v2-lex-fips.{region}.api.amazonwebservices.com.cn",tags:["dualstack","fips"]},{hostname:"runtime-v2-lex.{region}.api.amazonwebservices.com.cn",tags:["dualstack"]}]},"aws-iso":{regions:["us-iso-east-1","us-iso-west-1"],regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",variants:[{hostname:"runtime-v2-lex.{region}.c2s.ic.gov",tags:[]},{hostname:"runtime-v2-lex-fips.{region}.c2s.ic.gov",tags:["fips"]}]},"aws-iso-b":{regions:["us-isob-east-1"],regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",variants:[{hostname:"runtime-v2-lex.{region}.sc2s.sgov.gov",tags:[]},{hostname:"runtime-v2-lex-fips.{region}.sc2s.sgov.gov",tags:["fips"]}]},"aws-us-gov":{regions:["us-gov-east-1","us-gov-west-1"],regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",variants:[{hostname:"runtime-v2-lex.{region}.amazonaws.com",tags:[]},{hostname:"runtime-v2-lex-fips.{region}.amazonaws.com",tags:["fips"]},{hostname:"runtime-v2-lex-fips.{region}.api.aws",tags:["dualstack","fips"]},{hostname:"runtime-v2-lex.{region}.api.aws",tags:["dualstack"]}]}},Ui=function(e,t){return Bn(void 0,void 0,void 0,(function(){return Un(this,(function(n){return[2,Zn(e,Dn(Dn({},t),{signingService:"lex",regionHash:Ni,partitionHash:Bi}))]}))}))},Fi=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,p,h,v,y,b,m,g=pt(e),w=function(){return g().then(Fo)},O=function(e){var t,n,r,o,i;return{apiVersion:"2020-08-07",disableHostPrefix:null!==(t=null==e?void 0:e.disableHostPrefix)&&void 0!==t&&t,logger:null!==(n=null==e?void 0:e.logger)&&void 0!==n?n:{},regionInfoProvider:null!==(r=null==e?void 0:e.regionInfoProvider)&&void 0!==r?r:Ui,serviceId:null!==(o=null==e?void 0:e.serviceId)&&void 0!==o?o:"Lex Runtime V2",urlParser:null!==(i=null==e?void 0:e.urlParser)&&void 0!==i?i:Di}}(e);return Dn(Dn(Dn({},O),e),{runtime:"browser",defaultsMode:g,base64Decoder:null!==(t=null==e?void 0:e.base64Decoder)&&void 0!==t?t:Ti,base64Encoder:null!==(n=null==e?void 0:e.base64Encoder)&&void 0!==n?n:Pi,bodyLengthChecker:null!==(r=null==e?void 0:e.bodyLengthChecker)&&void 0!==r?r:Mi,credentialDefaultProvider:null!==(o=null==e?void 0:e.credentialDefaultProvider)&&void 0!==o?o:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:null!==(i=null==e?void 0:e.defaultUserAgentProvider)&&void 0!==i?i:ki({serviceId:O.serviceId,clientVersion:Vo.version}),eventStreamPayloadHandlerProvider:null!==(a=null==e?void 0:e.eventStreamPayloadHandlerProvider)&&void 0!==a?a:function(){return{handle:(e="event stream request is not supported in browser.",function(){throw new Error(e)})};var e},eventStreamSerdeProvider:null!==(u=null==e?void 0:e.eventStreamSerdeProvider)&&void 0!==u?u:gi,maxAttempts:null!==(s=null==e?void 0:e.maxAttempts)&&void 0!==s?s:3,region:null!==(c=null==e?void 0:e.region)&&void 0!==c?c:(m="Region is missing",function(){return Promise.reject(m)}),requestHandler:null!==(l=null==e?void 0:e.requestHandler)&&void 0!==l?l:new wi(w),retryMode:null!==(f=null==e?void 0:e.retryMode)&&void 0!==f?f:function(){return Bn(void 0,void 0,void 0,(function(){return Un(this,(function(e){switch(e.label){case 0:return[4,w()];case 1:return[2,e.sent().retryMode||cr]}}))}))},sha256:null!==(d=null==e?void 0:e.sha256)&&void 0!==d?d:Wo.Sha256,streamCollector:null!==(p=null==e?void 0:e.streamCollector)&&void 0!==p?p:Ci,useDualstackEndpoint:null!==(h=null==e?void 0:e.useDualstackEndpoint)&&void 0!==h?h:function(){return Promise.resolve(!1)},useFipsEndpoint:null!==(v=null==e?void 0:e.useFipsEndpoint)&&void 0!==v?v:function(){return Promise.resolve(!1)},utf8Decoder:null!==(y=null==e?void 0:e.utf8Decoder)&&void 0!==y?y:Ii,utf8Encoder:null!==(b=null==e?void 0:e.utf8Encoder)&&void 0!==b?b:Li})},zi=function(e){function t(t){var n,r,o,i=this,a=function(e){var t=e.region,n=e.useFipsEndpoint;if(!t)throw new Error("Region is missing");return Dn(Dn({},e),{region:function(){return Bn(void 0,void 0,void 0,(function(){var e;return Un(this,(function(n){switch(n.label){case 0:return"string"==typeof t?[2,Kn(t)]:[4,t()];case 1:return e=n.sent(),[2,Kn(e)]}}))}))},useFipsEndpoint:function(){return Bn(void 0,void 0,void 0,(function(){var e;return Un(this,(function(r){switch(r.label){case 0:return"string"!=typeof t?[3,1]:(e=t,[3,3]);case 1:return[4,t()];case 2:e=r.sent(),r.label=3;case 3:return Wn(e)?[2,!0]:[2,"boolean"==typeof n?Promise.resolve(n):n()]}}))}))}})}(Fi(t)),u=Vn(a),s=function(e){return Dn(Dn({},e),{eventStreamMarshaller:e.eventStreamSerdeProvider(e)})}(function(e){return Dn(Dn({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}(function(e){var t=e.signer,n=e.eventStreamPayloadHandlerProvider(tr(tr({},e),{eventSigner:t}));return tr(tr({},e),{eventSigner:t,eventStreamPayloadHandler:n})}(function(e){var t,n=e.credentials?uo(e.credentials):e.credentialDefaultProvider(e),r=e.signingEscapePath,o=void 0===r||r,i=e.systemClockOffset,a=void 0===i?e.systemClockOffset||0:i,u=e.sha256;return t=e.signer?c(e.signer):e.regionInfoProvider?function(){return c(e.region)().then((function(t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i;return Un(this,(function(a){switch(a.label){case 0:return r=(n=e).regionInfoProvider,o=[t],i={},[4,e.useFipsEndpoint()];case 1:return i.useFipsEndpoint=a.sent(),[4,e.useDualstackEndpoint()];case 2:return[4,r.apply(n,o.concat([(i.useDualstackEndpoint=a.sent(),i)]))];case 3:return[2,[a.sent()||{},t]]}}))}))})).then((function(t){var r=zn(t,2),i=r[0],a=r[1],s=i.signingRegion,c=i.signingService;e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||c||e.serviceId;var l=Dn(Dn({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o});return new(e.signerConstructor||oo)(l)}))}:function(t){return Bn(void 0,void 0,void 0,(function(){var r,i,a;return Un(this,(function(s){if(!t)throw new Error("Unexpected empty auth scheme config");return r=t.signingScope,i=t.signingName,e.signingRegion=e.signingRegion||r,e.signingName=e.signingName||i||e.serviceId,a=Dn(Dn({},e),{credentials:n,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o}),[2,new(e.signerConstructor||oo)(a)]}))}))},Dn(Dn({},e),{systemClockOffset:a,signingEscapePath:o,credentials:n,signer:t})}((o=c(null!==(r=(n=u).maxAttempts)&&void 0!==r?r:3),Dn(Dn({},n),{maxAttempts:o,retryStrategy:function(){return Bn(void 0,void 0,void 0,(function(){return Un(this,(function(e){switch(e.label){case 0:return n.retryStrategy?[2,n.retryStrategy]:[4,c(n.retryMode)()];case 1:return e.sent()===rr.ADAPTIVE?[2,new Cr(o)]:[2,new jr(o)]}}))}))}}))))));return(i=e.call(this,s)||this).config=s,i.middlewareStack.use(Mr(i.config)),i.middlewareStack.use(er(i.config)),i.middlewareStack.use(ir(i.config)),i.middlewareStack.use(ur(i.config)),i.middlewareStack.use(Object(_.a)(i.config)),i.middlewareStack.use(po(i.config)),i.middlewareStack.use(bo(i.config)),i}return Ln(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Oo),qi={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Hi={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Gi(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Bn(void 0,void 0,void 0,(function(){var o,i,a;return Un(this,(function(u){switch(u.label){case 0:return[4,n(r)];case 1:o=u.sent().response,u.label=2;case 2:return u.trys.push([2,4,,5]),[4,t(o,e)];case 3:return i=u.sent(),[2,{response:o,output:i}];case 4:throw a=u.sent(),Object.defineProperty(a,"$response",{value:o}),a;case 5:return[2]}}))}))}}}(e,n),qi),r.add(function(e,t){return function(n,r){return function(o){return Bn(void 0,void 0,void 0,(function(){var i,a,u;return Un(this,(function(s){switch(s.label){case 0:if(!(i=(null===(u=r.endpointV2)||void 0===u?void 0:u.url)&&e.urlParser?function(){return Bn(void 0,void 0,void 0,(function(){return Un(this,(function(t){return[2,e.urlParser(r.endpointV2.url)]}))}))}:e.endpoint))throw new Error("No valid endpoint provider available.");return[4,t(o.input,Dn(Dn({},e),{endpoint:i}))];case 1:return a=s.sent(),[2,n(Dn(Dn({},o),{request:a}))]}}))}))}}}(e,t),Hi)}}}var $i,Vi,Wi,Ki,Yi,Zi,Xi,Ji=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Do),Qi=function(e){function t(n){var r=e.call(this,Dn({name:"AccessDeniedException",$fault:"client"},n))||this;return r.name="AccessDeniedException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),ea=function(e){function t(n){var r=e.call(this,Dn({name:"ConflictException",$fault:"client"},n))||this;return r.name="ConflictException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),ta=function(e){function t(n){var r=e.call(this,Dn({name:"InternalServerException",$fault:"server"},n))||this;return r.name="InternalServerException",r.$fault="server",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),na=function(e){function t(n){var r=e.call(this,Dn({name:"ResourceNotFoundException",$fault:"client"},n))||this;return r.name="ResourceNotFoundException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),ra=function(e){function t(n){var r=e.call(this,Dn({name:"ThrottlingException",$fault:"client"},n))||this;return r.name="ThrottlingException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),oa=function(e){function t(n){var r=e.call(this,Dn({name:"ValidationException",$fault:"client"},n))||this;return r.name="ValidationException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji);!function(e){e.CONFIRMED="Confirmed",e.DENIED="Denied",e.NONE="None"}($i||($i={})),function(e){e.COMPOSITE="Composite",e.LIST="List",e.SCALAR="Scalar"}(Vi||(Vi={})),function(e){e.FAILED="Failed",e.FULFILLED="Fulfilled",e.FULFILLMENT_IN_PROGRESS="FulfillmentInProgress",e.IN_PROGRESS="InProgress",e.READY_FOR_FULFILLMENT="ReadyForFulfillment",e.WAITING="Waiting"}(Wi||(Wi={})),function(e){e.MIXED="MIXED",e.NEGATIVE="NEGATIVE",e.NEUTRAL="NEUTRAL",e.POSITIVE="POSITIVE"}(Ki||(Ki={})),function(e){e.CUSTOM_PAYLOAD="CustomPayload",e.IMAGE_RESPONSE_CARD="ImageResponseCard",e.PLAIN_TEXT="PlainText",e.SSML="SSML"}(Yi||(Yi={})),function(e){e.DEFAULT="Default",e.SPELL_BY_LETTER="SpellByLetter",e.SPELL_BY_WORD="SpellByWord"}(Zi||(Zi={})),function(e){e.CLOSE="Close",e.CONFIRM_INTENT="ConfirmIntent",e.DELEGATE="Delegate",e.ELICIT_INTENT="ElicitIntent",e.ELICIT_SLOT="ElicitSlot",e.NONE="None"}(Xi||(Xi={}));var ia,aa,ua,sa,ca,la=function(e){function t(n){var r=e.call(this,Dn({name:"BadGatewayException",$fault:"server"},n))||this;return r.name="BadGatewayException",r.$fault="server",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji),fa=function(e){function t(n){var r=e.call(this,Dn({name:"DependencyFailedException",$fault:"client"},n))||this;return r.name="DependencyFailedException",r.$fault="client",Object.setPrototypeOf(r,t.prototype),r}return Ln(t,e),t}(Ji);!function(e){e.AUDIO="AUDIO",e.TEXT="TEXT"}(ia||(ia={})),function(e){e.DTMF="DTMF",e.SPEECH="Speech",e.TEXT="Text"}(aa||(aa={})),function(e){e.DTMF_START_DETECTED="DTMF_START_DETECTED",e.TEXT_DETECTED="TEXT_DETECTED",e.VOICE_START_DETECTED="VOICE_START_DETECTED"}(ua||(ua={})),function(e){e.visit=function(e,t){return void 0!==e.ConfigurationEvent?t.ConfigurationEvent(e.ConfigurationEvent):void 0!==e.AudioInputEvent?t.AudioInputEvent(e.AudioInputEvent):void 0!==e.DTMFInputEvent?t.DTMFInputEvent(e.DTMFInputEvent):void 0!==e.TextInputEvent?t.TextInputEvent(e.TextInputEvent):void 0!==e.PlaybackCompletionEvent?t.PlaybackCompletionEvent(e.PlaybackCompletionEvent):void 0!==e.DisconnectionEvent?t.DisconnectionEvent(e.DisconnectionEvent):t._(e.$unknown[0],e.$unknown[1])}}(sa||(sa={})),function(e){e.visit=function(e,t){return void 0!==e.PlaybackInterruptionEvent?t.PlaybackInterruptionEvent(e.PlaybackInterruptionEvent):void 0!==e.TranscriptEvent?t.TranscriptEvent(e.TranscriptEvent):void 0!==e.IntentResultEvent?t.IntentResultEvent(e.IntentResultEvent):void 0!==e.TextResponseEvent?t.TextResponseEvent(e.TextResponseEvent):void 0!==e.AudioResponseEvent?t.AudioResponseEvent(e.AudioResponseEvent):void 0!==e.HeartbeatEvent?t.HeartbeatEvent(e.HeartbeatEvent):void 0!==e.AccessDeniedException?t.AccessDeniedException(e.AccessDeniedException):void 0!==e.ResourceNotFoundException?t.ResourceNotFoundException(e.ResourceNotFoundException):void 0!==e.ValidationException?t.ValidationException(e.ValidationException):void 0!==e.ThrottlingException?t.ThrottlingException(e.ThrottlingException):void 0!==e.InternalServerException?t.InternalServerException(e.InternalServerException):void 0!==e.ConflictException?t.ConflictException(e.ConflictException):void 0!==e.DependencyFailedException?t.DependencyFailedException(e.DependencyFailedException):void 0!==e.BadGatewayException?t.BadGatewayException(e.BadGatewayException):t._(e.$unknown[0],e.$unknown[1])}}(ca||(ca={}));var da=function(e){return Dn(Dn({},e),e.content&&{content:_o})},pa=function(e){return Dn(Dn(Dn({},e),e.sessionState&&{sessionState:_o}),e.requestAttributes&&{requestAttributes:_o})},ha=function(e){return Dn({},e)},va=function(e){return Dn(Dn({},e),e.text&&{text:_o})},ya=function(e){return Dn(Dn({},e),e.messages&&{messages:e.messages.map((function(e){return da(e)}))})},ba=function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i,a;return Un(this,(function(u){switch(u.label){case 0:return r=[Dn({},e)],a={},[4,gu(e.body,t)];case 1:switch(n=Dn.apply(void 0,r.concat([(a.body=u.sent(),a)])),o=wu(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.lexruntimev2#AccessDeniedException":return[3,2];case"BadGatewayException":case"com.amazonaws.lexruntimev2#BadGatewayException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimev2#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimev2#DependencyFailedException":return[3,8];case"InternalServerException":case"com.amazonaws.lexruntimev2#InternalServerException":return[3,10];case"ResourceNotFoundException":case"com.amazonaws.lexruntimev2#ResourceNotFoundException":return[3,12];case"ThrottlingException":case"com.amazonaws.lexruntimev2#ThrottlingException":return[3,14];case"ValidationException":case"com.amazonaws.lexruntimev2#ValidationException":return[3,16]}return[3,18];case 2:return[4,wa(n,t)];case 3:throw u.sent();case 4:return[4,Oa(n,t)];case 5:throw u.sent();case 6:return[4,Sa(n,t)];case 7:throw u.sent();case 8:return[4,_a(n,t)];case 9:throw u.sent();case 10:return[4,Ea(n,t)];case 11:throw u.sent();case 12:return[4,xa(n,t)];case 13:throw u.sent();case 14:return[4,Aa(n,t)];case 15:throw u.sent();case 16:return[4,ja(n,t)];case 17:throw u.sent();case 18:i=n.body,Bo({output:e,parsedBody:i,exceptionCtor:Ji,errorCode:o}),u.label=19;case 19:return[2]}}))}))},ma=function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i,a;return Un(this,(function(u){switch(u.label){case 0:return r=[Dn({},e)],a={},[4,gu(e.body,t)];case 1:switch(n=Dn.apply(void 0,r.concat([(a.body=u.sent(),a)])),o=wu(e,n.body),o){case"AccessDeniedException":case"com.amazonaws.lexruntimev2#AccessDeniedException":return[3,2];case"BadGatewayException":case"com.amazonaws.lexruntimev2#BadGatewayException":return[3,4];case"ConflictException":case"com.amazonaws.lexruntimev2#ConflictException":return[3,6];case"DependencyFailedException":case"com.amazonaws.lexruntimev2#DependencyFailedException":return[3,8];case"InternalServerException":case"com.amazonaws.lexruntimev2#InternalServerException":return[3,10];case"ResourceNotFoundException":case"com.amazonaws.lexruntimev2#ResourceNotFoundException":return[3,12];case"ThrottlingException":case"com.amazonaws.lexruntimev2#ThrottlingException":return[3,14];case"ValidationException":case"com.amazonaws.lexruntimev2#ValidationException":return[3,16]}return[3,18];case 2:return[4,wa(n,t)];case 3:throw u.sent();case 4:return[4,Oa(n,t)];case 5:throw u.sent();case 6:return[4,Sa(n,t)];case 7:throw u.sent();case 8:return[4,_a(n,t)];case 9:throw u.sent();case 10:return[4,Ea(n,t)];case 11:throw u.sent();case 12:return[4,xa(n,t)];case 13:throw u.sent();case 14:return[4,Aa(n,t)];case 15:throw u.sent();case 16:return[4,ja(n,t)];case 17:throw u.sent();case 18:i=n.body,Bo({output:e,parsedBody:i,exceptionCtor:Ji,errorCode:o}),u.label=19;case 19:return[2]}}))}))},ga=Ho,wa=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new Qi(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},Oa=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new la(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},Sa=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new ea(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},_a=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new fa(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},Ea=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new ta(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},xa=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new na(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},Aa=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new ra(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},ja=function(e,t){return Bn(void 0,void 0,void 0,(function(){var t,n,r;return Un(this,(function(o){return t=ga({}),null!=(n=e.body).message&&(t.message=Ro(n.message)),r=new oa(Dn({$metadata:vu(e)},t)),[2,No(r,e.body)]}))}))},Ta=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zn(t,2),o=r[0],i=r[1];return null===i?e:Dn(Dn({},e),((n={})[o]=i,n))}),{})},Pa=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return function(e,t){return Dn(Dn(Dn({},null!=e.contextAttributes&&{contextAttributes:Ta(e.contextAttributes,t)}),null!=e.name&&{name:e.name}),null!=e.timeToLive&&{timeToLive:Ca(e.timeToLive,t)})}(e,t)}))},Ca=function(e,t){return Dn(Dn({},null!=e.timeToLiveInSeconds&&{timeToLiveInSeconds:e.timeToLiveInSeconds}),null!=e.turnsToLive&&{turnsToLive:e.turnsToLive})},Ra=function(e,t){return Dn(Dn(Dn(Dn({},null!=e.slotElicitationStyle&&{slotElicitationStyle:e.slotElicitationStyle}),null!=e.slotToElicit&&{slotToElicit:e.slotToElicit}),null!=e.subSlotToElicit&&{subSlotToElicit:Ma(e.subSlotToElicit,t)}),null!=e.type&&{type:e.type})},Ma=function(e,t){return Dn(Dn({},null!=e.name&&{name:e.name}),null!=e.subSlotToElicit&&{subSlotToElicit:Ma(e.subSlotToElicit,t)})},ka=function(e,t){return Dn(Dn(Dn(Dn({},null!=e.confirmationState&&{confirmationState:e.confirmationState}),null!=e.name&&{name:e.name}),null!=e.slots&&{slots:Fa(e.slots,t)}),null!=e.state&&{state:e.state})},Ia=function(e,t){return Dn({},null!=e.slotHints&&{slotHints:Ba(e.slotHints,t)})},La=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return function(e,t){return Dn({},null!=e.phrase&&{phrase:e.phrase})}(e)}))},Da=function(e,t){return Dn(Dn(Dn(Dn(Dn(Dn({},null!=e.activeContexts&&{activeContexts:Pa(e.activeContexts,t)}),null!=e.dialogAction&&{dialogAction:Ra(e.dialogAction,t)}),null!=e.intent&&{intent:ka(e.intent,t)}),null!=e.originatingRequestId&&{originatingRequestId:e.originatingRequestId}),null!=e.runtimeHints&&{runtimeHints:Ia(e.runtimeHints,t)}),null!=e.sessionAttributes&&{sessionAttributes:qa(e.sessionAttributes,t)})},Na=function(e,t){return Dn(Dn(Dn(Dn({},null!=e.shape&&{shape:e.shape}),null!=e.subSlots&&{subSlots:Fa(e.subSlots,t)}),null!=e.value&&{value:Ha(e.value,t)}),null!=e.values&&{values:Ga(e.values,t)})},Ba=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=Ua(a,t),r))}),{})},Ua=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=function(e,t){return Dn(Dn({},null!=e.runtimeHintValues&&{runtimeHintValues:La(e.runtimeHintValues,t)}),null!=e.subSlotHints&&{subSlotHints:Ua(e.subSlotHints,t)})}(a,t),r))}),{})},Fa=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=Na(a,t),r))}),{})},za=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return e}))},qa=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zn(t,2),o=r[0],i=r[1];return null===i?e:Dn(Dn({},e),((n={})[o]=i,n))}),{})},Ha=function(e,t){return Dn(Dn(Dn({},null!=e.interpretedValue&&{interpretedValue:e.interpretedValue}),null!=e.originalValue&&{originalValue:e.originalValue}),null!=e.resolvedValues&&{resolvedValues:za(e.resolvedValues)})},Ga=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return Na(e,t)}))},$a=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zn(t,2),o=r[0],i=r[1];return null===i?e:Dn(Dn({},e),((n={})[o]=Ro(i),n))}),{})},Va=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{contextAttributes:null!=e.contextAttributes?$a(e.contextAttributes,t):void 0,name:Ro(e.name),timeToLive:null!=e.timeToLive?Wa(e.timeToLive,t):void 0}}(e,t)}))},Wa=function(e,t){return{timeToLiveInSeconds:Ao(e.timeToLiveInSeconds),turnsToLive:Ao(e.turnsToLive)}},Ka=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{text:Ro(e.text),value:Ro(e.value)}}(e)}))},Ya=function(e,t){return{score:Mo(e.score)}},Za=function(e,t){return{slotElicitationStyle:Ro(e.slotElicitationStyle),slotToElicit:Ro(e.slotToElicit),subSlotToElicit:null!=e.subSlotToElicit?Xa(e.subSlotToElicit,t):void 0,type:Ro(e.type)}},Xa=function(e,t){return{name:Ro(e.name),subSlotToElicit:null!=e.subSlotToElicit?Xa(e.subSlotToElicit,t):void 0}},Ja=function(e,t){return{buttons:null!=e.buttons?Ka(e.buttons):void 0,imageUrl:Ro(e.imageUrl),subtitle:Ro(e.subtitle),title:Ro(e.title)}},Qa=function(e,t){return{confirmationState:Ro(e.confirmationState),name:Ro(e.name),slots:null!=e.slots?lu(e.slots,t):void 0,state:Ro(e.state)}},eu=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{intent:null!=e.intent?Qa(e.intent,t):void 0,nluConfidence:null!=e.nluConfidence?Ya(e.nluConfidence):void 0,sentimentResponse:null!=e.sentimentResponse?ou(e.sentimentResponse,t):void 0}}(e,t)}))},tu=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{content:Ro(e.content),contentType:Ro(e.contentType),imageResponseCard:null!=e.imageResponseCard?Ja(e.imageResponseCard):void 0}}(e)}))},nu=function(e,t){return{slotHints:null!=e.slotHints?su(e.slotHints,t):void 0}},ru=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{phrase:Ro(e.phrase)}}(e)}))},ou=function(e,t){return{sentiment:Ro(e.sentiment),sentimentScore:null!=e.sentimentScore?iu(e.sentimentScore,t):void 0}},iu=function(e,t){return{mixed:Mo(e.mixed),negative:Mo(e.negative),neutral:Mo(e.neutral),positive:Mo(e.positive)}},au=function(e,t){return{activeContexts:null!=e.activeContexts?Va(e.activeContexts,t):void 0,dialogAction:null!=e.dialogAction?Za(e.dialogAction,t):void 0,intent:null!=e.intent?Qa(e.intent,t):void 0,originatingRequestId:Ro(e.originatingRequestId),runtimeHints:null!=e.runtimeHints?nu(e.runtimeHints,t):void 0,sessionAttributes:null!=e.sessionAttributes?du(e.sessionAttributes,t):void 0}},uu=function(e,t){return{shape:Ro(e.shape),subSlots:null!=e.subSlots?lu(e.subSlots,t):void 0,value:null!=e.value?pu(e.value,t):void 0,values:null!=e.values?hu(e.values,t):void 0}},su=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=cu(a,t),r))}),{})},cu=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=function(e,t){return{runtimeHintValues:null!=e.runtimeHintValues?ru(e.runtimeHintValues,t):void 0,subSlotHints:null!=e.subSlotHints?cu(e.subSlotHints,t):void 0}}(a,t),r))}),{})},lu=function(e,t){return Object.entries(e).reduce((function(e,n){var r,o=zn(n,2),i=o[0],a=o[1];return null===a?e:Dn(Dn({},e),((r={})[i]=uu(a,t),r))}),{})},fu=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:Ro(e)}))},du=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zn(t,2),o=r[0],i=r[1];return null===i?e:Dn(Dn({},e),((n={})[o]=Ro(i),n))}),{})},pu=function(e,t){return{interpretedValue:Ro(e.interpretedValue),originalValue:Ro(e.originalValue),resolvedValues:null!=e.resolvedValues?fu(e.resolvedValues):void 0}},hu=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:uu(e,t)}))},vu=function(e){var t,n;return{httpStatusCode:e.statusCode,requestId:null!==(n=null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"])&&void 0!==n?n:e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},yu=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)}))},bu=function(e){return!(null==e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size)},mu=function(e,t){return yu(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},gu=function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r;return Un(this,(function(o){switch(o.label){case 0:return[4,mu(e,t)];case 1:return(n=o.sent()).message=null!==(r=n.message)&&void 0!==r?r:n.Message,[2,n]}}))}))},wu=function(e,t){var n,r,o=function(e){var t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):void 0},Ou=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ln(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Gi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeV2Client",commandName:"RecognizeTextCommand",inputFilterSensitiveLog:va,outputFilterSensitiveLog:ya},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,s,c,l;return Un(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:return n=f.sent(),r=n.hostname,o=n.protocol,i=void 0===o?"https":o,a=n.port,u=n.path,s={"content-type":"application/json"},c="".concat((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text",c=$o(c,e,"botId",(function(){return e.botId}),"{botId}",!1),c=$o(c,e,"botAliasId",(function(){return e.botAliasId}),"{botAliasId}",!1),c=$o(c,e,"localeId",(function(){return e.localeId}),"{localeId}",!1),c=$o(c,e,"sessionId",(function(){return e.sessionId}),"{sessionId}",!1),l=JSON.stringify(Dn(Dn(Dn({},null!=e.requestAttributes&&{requestAttributes:qa(e.requestAttributes,t)}),null!=e.sessionState&&{sessionState:Da(e.sessionState,t)}),null!=e.text&&{text:e.text})),[2,new Xn({protocol:i,hostname:r,port:a,method:"POST",headers:s,path:c,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i;return Un(this,(function(a){switch(a.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ba(e,t)]:(n=ga({$metadata:vu(e)}),o=Po,i=Co,[4,mu(e.body,t)]);case 1:return null!=(r=o.apply(void 0,[i.apply(void 0,[a.sent()]),"body"])).interpretations&&(n.interpretations=eu(r.interpretations,t)),null!=r.messages&&(n.messages=tu(r.messages,t)),null!=r.requestAttributes&&(n.requestAttributes=du(r.requestAttributes,t)),null!=r.sessionId&&(n.sessionId=Ro(r.sessionId)),null!=r.sessionState&&(n.sessionState=au(r.sessionState,t)),[2,n]}}))}))}(e,t)},t}(So),Su=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Ln(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Gi(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"LexRuntimeV2Client",commandName:"RecognizeUtteranceCommand",inputFilterSensitiveLog:pa,outputFilterSensitiveLog:ha},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r,o,i,a,u,s,c,l;return Un(this,(function(f){switch(f.label){case 0:return[4,t.endpoint()];case 1:return n=f.sent(),r=n.hostname,o=n.protocol,i=void 0===o?"https":o,a=n.port,u=n.path,s=ga({},bu,{"x-amz-content-sha256":"UNSIGNED-PAYLOAD","content-type":e.requestContentType||"application/octet-stream","x-amz-lex-session-state":e.sessionState,"x-amz-lex-request-attributes":e.requestAttributes,"response-content-type":e.responseContentType}),c="".concat((null==u?void 0:u.endsWith("/"))?u.slice(0,-1):u||"")+"/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance",c=$o(c,e,"botId",(function(){return e.botId}),"{botId}",!1),c=$o(c,e,"botAliasId",(function(){return e.botAliasId}),"{botAliasId}",!1),c=$o(c,e,"localeId",(function(){return e.localeId}),"{localeId}",!1),c=$o(c,e,"sessionId",(function(){return e.sessionId}),"{sessionId}",!1),void 0!==e.inputStream&&(l=e.inputStream),[2,new Xn({protocol:i,hostname:r,port:a,method:"POST",headers:s,path:c,body:l})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Bn(void 0,void 0,void 0,(function(){var n,r;return Un(this,(function(o){return 200!==e.statusCode&&e.statusCode>=300?[2,ma(e,t)]:(n=ga({$metadata:vu(e),inputMode:[,e.headers["x-amz-lex-input-mode"]],contentType:[,e.headers["content-type"]],messages:[,e.headers["x-amz-lex-messages"]],interpretations:[,e.headers["x-amz-lex-interpretations"]],sessionState:[,e.headers["x-amz-lex-session-state"]],requestAttributes:[,e.headers["x-amz-lex-request-attributes"]],sessionId:[,e.headers["x-amz-lex-session-id"]],inputTranscript:[,e.headers["x-amz-lex-input-transcript"]]}),r=e.body,n.audioStream=r,[2,n])}))}))}(e,t)},t}(So),_u=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Eu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},xu=function(e){return _u(void 0,void 0,void 0,(function(){var t,n,r;return Eu(this,(function(o){switch(o.label){case 0:if(void 0===e)return[2,void 0];o.label=1;case 1:return o.trys.push([1,3,,4]),a=e,t=Uint8Array.from(window.atob(a),(function(e){return e.charCodeAt(0)})),[4,(i=t,mn(void 0,void 0,void 0,(function(){return gn(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e,t){pn(i,(function(n,r){n?t(n):e(bn(r))}))}))];case 1:return[2,e.sent()]}}))})))];case 2:return n=o.sent(),[2,JSON.parse(n)];case 3:return r=o.sent(),[2,Promise.reject("unable to decode and decompress "+r)];case 4:return[2]}var i,a}))}))};function Au(e){return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ju=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 r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tu=function(){return(Tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Pu=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Cu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ru=new o.ConsoleLogger("AWSLexV2Provider"),Mu=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n._botsCompleteCallback={},n}return ju(t,e),t.prototype.getProviderName=function(){return"AWSLexV2Provider"},t.prototype.configure=function(t){void 0===t&&(t={});var n=["name","botId","aliasId","localeId","providerName","region"];return Object.keys(t).forEach((function(e){var r=t[e];if(!n.every((function(e){return e in r})))throw new Error("invalid bot configuration")})),e.prototype.configure.call(this,t)},t.prototype.sendMessage=function(e,t){return Pu(this,void 0,void 0,(function(){var n,r,i;return Cu(this,(function(a){switch(a.label){case 0:if(!this._config[e])return[2,Promise.reject("Bot "+e+" does not exist")];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,o.Credentials.get()];case 2:return n=a.sent(),[3,4];case 3:return a.sent(),[2,Promise.reject("No credentials")];case 4:return this._lexRuntimeServiceV2Client=new zi({region:this._config[e].region,credentials:n,customUserAgent:Object(o.getAmplifyUserAgent)()}),i={botAliasId:this._config[e].aliasId,botId:this._config[e].botId,localeId:this._config[e].localeId,sessionId:n.identityId},"string"!=typeof t?[3,6]:[4,this._handleRecognizeTextCommand(e,t,i)];case 5:return r=a.sent(),[3,8];case 6:return[4,this._handleRecognizeUtteranceCommand(e,t,i)];case 7:r=a.sent(),a.label=8;case 8:return[2,r]}}))}))},t.prototype.onComplete=function(e,t){if(!this._config[e])throw new Error("Bot "+e+" does not exist");this._botsCompleteCallback[e]=t},t.prototype._reportBotStatus=function(e,t){var n,r,o,i,a,u,s=this,c=null==e?void 0:e.sessionState;Ru.debug("postContent state",null===(n=null==c?void 0:c.intent)||void 0===n?void 0:n.state);var l="function"==typeof(null===(r=this._config)||void 0===r?void 0:r[t].onComplete),f="function"==typeof(null===(o=this._botsCompleteCallback)||void 0===o?void 0:o[t]);if((l||f)&&("ReadyForFulfillment"!==(null===(i=null==c?void 0:c.intent)||void 0===i?void 0:i.state)&&"Fulfilled"!==(null===(a=null==c?void 0:c.intent)||void 0===a?void 0:a.state)||(f&&setTimeout((function(){var n;return null===(n=s._botsCompleteCallback)||void 0===n?void 0:n[t](null,e)}),0),l&&setTimeout((function(){return s._config[t].onComplete(null,e)}),0)),"Failed"===(null===(u=null==c?void 0:c.intent)||void 0===u?void 0:u.state))){var d=new Error("Bot conversation failed");f&&setTimeout((function(){return s._botsCompleteCallback[t](d)}),0),l&&setTimeout((function(){return s._config[t].onComplete(d)}),0)}},t.prototype._formatUtteranceCommandOutput=function(e){return Pu(this,void 0,void 0,(function(){var t,n,r;return Cu(this,(function(o){switch(o.label){case 0:return t=[Tu({},e)],n={},[4,xu(e.messages)];case 1:return n.messages=o.sent(),[4,xu(e.sessionState)];case 2:return n.sessionState=o.sent(),[4,xu(e.interpretations)];case 3:return n.interpretations=o.sent(),[4,xu(e.requestAttributes)];case 4:return n.requestAttributes=o.sent(),[4,xu(e.inputTranscript)];case 5:return n.inputTranscript=o.sent(),e.audioStream?[4,wn(e.audioStream)]:[3,7];case 6:return r=o.sent(),[3,8];case 7:r=void 0,o.label=8;case 8:return[2,Tu.apply(void 0,t.concat([(n.audioStream=r,n)]))]}}))}))},t.prototype._handleRecognizeTextCommand=function(e,t,n){return Pu(this,void 0,void 0,(function(){var r,o,i,a;return Cu(this,(function(u){switch(u.label){case 0:Ru.debug("postText to lex2",t),r=Tu(Tu({},n),{text:t}),u.label=1;case 1:return u.trys.push([1,3,,4]),o=new Ou(r),[4,this._lexRuntimeServiceV2Client.send(o)];case 2:return i=u.sent(),this._reportBotStatus(i,e),[2,i];case 3:return a=u.sent(),[2,Promise.reject(a)];case 4:return[2]}}))}))},t.prototype._handleRecognizeUtteranceCommand=function(e,t,n){return Pu(this,void 0,void 0,(function(){var r,o,i,a,u,s,c,l,f;return Cu(this,(function(d){switch(d.label){case 0:return r=t.content,o=t.options.messageType,Ru.debug("postContent to lex2",t),"voice"!==o?[3,4]:"object"!==Au(r)?[2,Promise.reject("invalid content type")]:r instanceof Uint8Array?(u=r,[3,3]):[3,1];case 1:return[4,wn(r)];case 2:u=d.sent(),d.label=3;case 3:return a=u,i=Tu(Tu({},n),{requestContentType:"audio/x-l16; sample-rate=16000; channel-count=1",inputStream:a}),[3,5];case 4:if("string"!=typeof r)return[2,Promise.reject("invalid content type")];i=Tu(Tu({},n),{requestContentType:"text/plain; charset=utf-8",inputStream:r}),d.label=5;case 5:return d.trys.push([5,8,,9]),s=new Su(i),[4,this._lexRuntimeServiceV2Client.send(s)];case 6:return c=d.sent(),[4,this._formatUtteranceCommandOutput(c)];case 7:return l=d.sent(),this._reportBotStatus(l,e),[2,l];case 8:return f=d.sent(),[2,Promise.reject(f)];case 9:return[2]}}))}))},t}(u);t.default=kn},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const o=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),o=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const o=e[++n];t+=String.fromCharCode((31&r)<<6|63&o)}else if(240<=r&&r<365){const o="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)}])}));
116
- //# sourceMappingURL=aws-amplify-interactions.min.js.map