@aws-amplify/core 4.3.9-unstable.3 → 4.3.9
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.
- package/CHANGELOG.md +11 -0
- package/dist/aws-amplify-core.js +4 -7
- package/dist/aws-amplify-core.js.map +1 -1
- package/dist/aws-amplify-core.min.js +1 -1
- package/dist/aws-amplify-core.min.js.map +1 -1
- package/lib/Providers/AWSCloudWatchProvider.js +4 -5
- package/lib/Providers/AWSCloudWatchProvider.js.map +1 -1
- package/lib-esm/Providers/AWSCloudWatchProvider.js +4 -5
- package/lib-esm/Providers/AWSCloudWatchProvider.js.map +1 -1
- package/package.json +2 -2
- package/src/Providers/AWSCloudWatchProvider.ts +5 -6
|
@@ -42,5 +42,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
42
42
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
43
43
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
44
44
|
PERFORMANCE OF THIS SOFTWARE.
|
|
45
|
-
***************************************************************************** */():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=ks({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var Ts=function(e,t){return(Ts=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 js(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}Ts(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Rs=function(){return(Rs=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 Ms(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ns(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}}Object.create;function zs(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;var Bs,Us,Fs,Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Cu,Pu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du=n(21),qu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Gu=new Set(["cn-north-1","cn-northwest-1"]),Hu=new Set(["us-iso-east-1"]),Wu=new Set(["us-isob-east-1"]),$u=new Set(["us-gov-east-1","us-gov-west-1"]),Ku={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:qu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Gu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Hu.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Wu.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(Rs({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:lo},Vu=Rs(Rs({},Ku),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Ku.serviceId,clientVersion:Du.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),Yu=function(e){function t(t){var n=this,r=Rs(Rs({},Vu),t),o=yo(r),i=ni(go(o)),a=si(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(_o(n.config)),n.middlewareStack.use(Eo(n.config)),n.middlewareStack.use(Ao(n.config)),n.middlewareStack.use(di(n.config)),n}return js(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Bs||(Bs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Us||(Us={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Fs||(Fs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Vs||(Vs={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Ys||(Ys={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Js||(Js={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(fu||(fu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(lu||(lu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(hu||(hu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(pu||(pu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(vu||(vu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Fu||(Fu={}));var Zu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Ns(this,(function(m){switch(m.label){case 0:return r=[Rs({},e)],v={},[4,Ac(e.body,t)];case 1:switch(n=Rs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Oc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xu(n,t)];case 3:return o=Rs.apply(void 0,[Rs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 4:return s=[{}],[4,Qu(n,t)];case 5:return o=Rs.apply(void 0,[Rs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 6:return u=[{}],[4,ec(n,t)];case 7:return o=Rs.apply(void 0,[Rs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 8:return c=[{}],[4,tc(n,t)];case 9:return o=Rs.apply(void 0,[Rs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 10:return f=[{}],[4,rc(n,t)];case 11:return o=Rs.apply(void 0,[Rs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 12:return l=[{}],[4,oc(n,t)];case 13:return o=Rs.apply(void 0,[Rs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 14:return d=[{}],[4,ic(n,t)];case 15:return o=Rs.apply(void 0,[Rs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 16:return h=[{}],[4,ac(n,t)];case 17:return o=Rs.apply(void 0,[Rs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Rs(Rs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Sc(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ju=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Ns(this,(function(m){switch(m.label){case 0:return r=[Rs({},e)],v={},[4,Ac(e.body,t)];case 1:switch(n=Rs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Oc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xu(n,t)];case 3:return o=Rs.apply(void 0,[Rs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 4:return s=[{}],[4,Qu(n,t)];case 5:return o=Rs.apply(void 0,[Rs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 6:return u=[{}],[4,tc(n,t)];case 7:return o=Rs.apply(void 0,[Rs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 8:return c=[{}],[4,nc(n,t)];case 9:return o=Rs.apply(void 0,[Rs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 10:return f=[{}],[4,rc(n,t)];case 11:return o=Rs.apply(void 0,[Rs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 12:return l=[{}],[4,oc(n,t)];case 13:return o=Rs.apply(void 0,[Rs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 14:return d=[{}],[4,ic(n,t)];case 15:return o=Rs.apply(void 0,[Rs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 16:return h=[{}],[4,ac(n,t)];case 17:return o=Rs.apply(void 0,[Rs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Rs(Rs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Sc(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=lc(n,t),[2,Rs({name:"ExternalServiceException",$fault:"client",$metadata:Sc(e)},r)]}))}))},Qu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=pc(n,t),[2,Rs({name:"InternalErrorException",$fault:"server",$metadata:Sc(e)},r)]}))}))},ec=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=gc(n,t),[2,Rs({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Sc(e)},r)]}))}))},tc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=vc(n,t),[2,Rs({name:"InvalidParameterException",$fault:"client",$metadata:Sc(e)},r)]}))}))},nc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=mc(n,t),[2,Rs({name:"LimitExceededException",$fault:"client",$metadata:Sc(e)},r)]}))}))},rc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=yc(n,t),[2,Rs({name:"NotAuthorizedException",$fault:"client",$metadata:Sc(e)},r)]}))}))},oc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=bc(n,t),[2,Rs({name:"ResourceConflictException",$fault:"client",$metadata:Sc(e)},r)]}))}))},ic=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=wc(n,t),[2,Rs({name:"ResourceNotFoundException",$fault:"client",$metadata:Sc(e)},r)]}))}))},ac=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=_c(n,t),[2,Rs({name:"TooManyRequestsException",$fault:"client",$metadata:Sc(e)},r)]}))}))},sc=function(e,t){return Rs(Rs(Rs({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cc(e.Logins,t)})},uc=function(e,t){return Rs(Rs(Rs({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cc(e.Logins,t)})},cc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zs(t,2),o=r[0],i=r[1];return null===i?e:Rs(Rs({},e),((n={})[o]=i,n))}),{})},fc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},lc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},dc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?fc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},hc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},pc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=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"]}},Ec=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},xc=function(e,t,n,r,o){return Ms(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Ns(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Ac=function(e,t){return function(e,t){return Ec(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Oc=function(e,t){var n,r,o=function(e){var t=e;return 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):""},kc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return js(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:uu.filterSensitiveLog,outputFilterSensitiveLog:cu.filterSensitiveLog},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 Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(uc(e,t)),[2,xc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o;return Ns(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ju(e,t)]:[4,Ac(e.body,t)];case 1:return n=i.sent(),{},r=hc(n,t),o=Rs({$metadata:Sc(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Lc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return js(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:ou.filterSensitiveLog,outputFilterSensitiveLog:au.filterSensitiveLog},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 Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(sc(e,t)),[2,xc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o;return Ns(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Zu(e,t)]:[4,Ac(e.body,t)];case 1:return n=i.sent(),{},r=dc(n,t),o=Rs({$metadata:Sc(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ic=function(){return(Ic=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)},Cc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Pc=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}},Tc=new g("Credentials"),jc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ni.refreshGoogleToken,this._refreshHandlers.facebook=zi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Ic(Ic({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Tc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Tc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Tc.debug("getting old cred promise"):(Tc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Cc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Pc(this,(function(s){switch(s.label){case 0:if(Tc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Tc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Tc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Tc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),Tc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){Tc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return Tc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(Tc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(Tc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(Tc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Ai(n,[],1e4).then((function(e){return Tc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Tc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return Tc.debug("no credentials for expiration check"),!0;Tc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Cc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Pc(this,(function(u){switch(u.label){case 0:return Tc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(Tc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Tc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Yu({region:n,customUserAgent:_()}),a=void 0,a=r?ks({identityId:r,client:i})():function(){return Cc(s,void 0,void 0,(function(){var e;return Pc(this,(function(n){switch(n.label){case 0:return[4,i.send(new kc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,ks({client:i,identityId:e})()]}}))}))}().catch((function(e){return Cc(s,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return Cc(s,void 0,void 0,(function(){var n=this;return Pc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(Tc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return Cc(n,void 0,void 0,(function(){var e;return Pc(this,(function(n){switch(n.label){case 0:return[4,i.send(new kc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,ks({client:i,identityId:e})()]}}))}))}().catch((function(e){return Cc(n,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return Tc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return Tc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Yu({region:u,customUserAgent:_()}),f=void 0;r?f=ks({identityId:r,logins:i,client:c})():f=Ps({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Tc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return Tc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return Tc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Yu({region:o,customUserAgent:_()}),c=Cc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Pc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new kc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Lc({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(Tc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&Tc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return Cc(t,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return Cc(o,void 0,void 0,(function(){var o,s,u,c,f;return Pc(this,(function(l){switch(l.label){case 0:if(Tc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){Tc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return Tc.debug("Failed to load credentials",e),Tc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Tc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Cc(this,void 0,void 0,(function(){return Pc(this,(function(e){return this._credentials=null,this._credentials_source=null,Tc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return Cc(this,void 0,void 0,(function(){var e,t;return Pc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),Tc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return Cc(this,void 0,void 0,(function(){var t,n;return Pc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),Tc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return Cc(this,void 0,void 0,(function(){var e;return Pc(this,(function(t){return e=this._config.identityPoolId,Tc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),Rc=new jc(null);b.register(Rc);var Mc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Nc=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}},zc=function(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},Bc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(zc(arguments[t]));return e},Uc=new g("AWSCloudWatch"),Fc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){Uc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Bc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r,o;return Nc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,Uc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Mc(this,void 0,void 0,(function(){var n,r,o,i;return Nc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,Uc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r;return Nc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return Uc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,Uc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Mc(this,void 0,void 0,(function(){var e=this;return Nc(this,(function(t){switch(t.label){case 0:return[4,Rc.get().then((function(t){if(!t)return!1;var n=Rc.shear(t);return Uc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return Uc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Mc(this,void 0,void 0,(function(){var e,t;return Nc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())?(this._nextSequenceToken=e.uploadSequenceToken||"",[2,this._nextSequenceToken]):(this._nextSequenceToken="",[2,""]);case 4:throw t=n.sent(),Uc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Mc(this,void 0,void 0,(function(){var e,t,n,r,o;return Nc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),Uc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";Uc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r;return Nc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken="",this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),Uc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Mc(e,void 0,void 0,(function(){var e;return Nc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),Uc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),Dc={},qc={addEventListener:function(e,t){}},Gc=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Hc(e){return(Hc="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 Wc=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Hc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),$c=n(5);function Kc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Vc=function(){return(Vc=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)},Yc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?$c.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=$c.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Kc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Kc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Vc(Vc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=$c.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Vc(Vc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Vc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=$c.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Zc=Object(U.b)().isBrowser,Jc=function(){function e(e){void 0===e&&(e={}),this.cookies=new Yc,this.store=Zc?window.localStorage:Object.create(null),this.cookies=e.req?new Yc(e.req.headers.cookie):new Yc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Zc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),Xc="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,Qc=Xc?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",ef=Xc?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",tf="x-amz-user-agent",nf=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),rf=n(22),of=n.n(rf).a,af=function(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.")},sf=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return of.from([{online:!0}]);var n=Object(U.h)()?self:window;return new of((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=af(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function uf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function cf(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var ff={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=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)},o=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)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=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)},o=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)}}])}));
|
|
45
|
+
***************************************************************************** */():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=ks({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var Ts=function(e,t){return(Ts=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 js(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}Ts(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Rs=function(){return(Rs=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 Ms(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ns(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}}Object.create;function zs(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;var Bs,Us,Fs,Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Cu,Pu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du=n(21),qu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Gu=new Set(["cn-north-1","cn-northwest-1"]),Hu=new Set(["us-iso-east-1"]),Wu=new Set(["us-isob-east-1"]),$u=new Set(["us-gov-east-1","us-gov-west-1"]),Ku={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:qu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Gu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Hu.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Wu.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(Rs({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:lo},Vu=Rs(Rs({},Ku),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Ku.serviceId,clientVersion:Du.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),Yu=function(e){function t(t){var n=this,r=Rs(Rs({},Vu),t),o=yo(r),i=ni(go(o)),a=si(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(_o(n.config)),n.middlewareStack.use(Eo(n.config)),n.middlewareStack.use(Ao(n.config)),n.middlewareStack.use(di(n.config)),n}return js(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Bs||(Bs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Us||(Us={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Fs||(Fs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Vs||(Vs={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Ys||(Ys={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Js||(Js={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(fu||(fu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(lu||(lu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(hu||(hu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(pu||(pu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(vu||(vu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return Rs({},e)}}(Fu||(Fu={}));var Zu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Ns(this,(function(m){switch(m.label){case 0:return r=[Rs({},e)],v={},[4,Ac(e.body,t)];case 1:switch(n=Rs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Oc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xu(n,t)];case 3:return o=Rs.apply(void 0,[Rs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 4:return s=[{}],[4,Qu(n,t)];case 5:return o=Rs.apply(void 0,[Rs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 6:return u=[{}],[4,ec(n,t)];case 7:return o=Rs.apply(void 0,[Rs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 8:return c=[{}],[4,tc(n,t)];case 9:return o=Rs.apply(void 0,[Rs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 10:return f=[{}],[4,rc(n,t)];case 11:return o=Rs.apply(void 0,[Rs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 12:return l=[{}],[4,oc(n,t)];case 13:return o=Rs.apply(void 0,[Rs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 14:return d=[{}],[4,ic(n,t)];case 15:return o=Rs.apply(void 0,[Rs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 16:return h=[{}],[4,ac(n,t)];case 17:return o=Rs.apply(void 0,[Rs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Rs(Rs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Sc(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ju=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Ns(this,(function(m){switch(m.label){case 0:return r=[Rs({},e)],v={},[4,Ac(e.body,t)];case 1:switch(n=Rs.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=Oc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Xu(n,t)];case 3:return o=Rs.apply(void 0,[Rs.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 4:return s=[{}],[4,Qu(n,t)];case 5:return o=Rs.apply(void 0,[Rs.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 6:return u=[{}],[4,tc(n,t)];case 7:return o=Rs.apply(void 0,[Rs.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 8:return c=[{}],[4,nc(n,t)];case 9:return o=Rs.apply(void 0,[Rs.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 10:return f=[{}],[4,rc(n,t)];case 11:return o=Rs.apply(void 0,[Rs.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 12:return l=[{}],[4,oc(n,t)];case 13:return o=Rs.apply(void 0,[Rs.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 14:return d=[{}],[4,ic(n,t)];case 15:return o=Rs.apply(void 0,[Rs.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 16:return h=[{}],[4,ac(n,t)];case 17:return o=Rs.apply(void 0,[Rs.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Sc(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Rs(Rs({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Sc(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=lc(n,t),[2,Rs({name:"ExternalServiceException",$fault:"client",$metadata:Sc(e)},r)]}))}))},Qu=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=pc(n,t),[2,Rs({name:"InternalErrorException",$fault:"server",$metadata:Sc(e)},r)]}))}))},ec=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=gc(n,t),[2,Rs({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Sc(e)},r)]}))}))},tc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=vc(n,t),[2,Rs({name:"InvalidParameterException",$fault:"client",$metadata:Sc(e)},r)]}))}))},nc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=mc(n,t),[2,Rs({name:"LimitExceededException",$fault:"client",$metadata:Sc(e)},r)]}))}))},rc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=yc(n,t),[2,Rs({name:"NotAuthorizedException",$fault:"client",$metadata:Sc(e)},r)]}))}))},oc=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=bc(n,t),[2,Rs({name:"ResourceConflictException",$fault:"client",$metadata:Sc(e)},r)]}))}))},ic=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=wc(n,t),[2,Rs({name:"ResourceNotFoundException",$fault:"client",$metadata:Sc(e)},r)]}))}))},ac=function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n=e.body,r=_c(n,t),[2,Rs({name:"TooManyRequestsException",$fault:"client",$metadata:Sc(e)},r)]}))}))},sc=function(e,t){return Rs(Rs(Rs({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cc(e.Logins,t)})},uc=function(e,t){return Rs(Rs(Rs({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:cc(e.Logins,t)})},cc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=zs(t,2),o=r[0],i=r[1];return null===i?e:Rs(Rs({},e),((n={})[o]=i,n))}),{})},fc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},lc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},dc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?fc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},hc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},pc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=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"]}},Ec=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},xc=function(e,t,n,r,o){return Ms(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Ns(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Ac=function(e,t){return function(e,t){return Ec(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Oc=function(e,t){var n,r,o=function(e){var t=e;return 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):""},kc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return js(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:uu.filterSensitiveLog,outputFilterSensitiveLog:cu.filterSensitiveLog},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 Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(uc(e,t)),[2,xc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o;return Ns(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ju(e,t)]:[4,Ac(e.body,t)];case 1:return n=i.sent(),{},r=hc(n,t),o=Rs({$metadata:Sc(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Lc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return js(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:ou.filterSensitiveLog,outputFilterSensitiveLog:au.filterSensitiveLog},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 Ms(void 0,void 0,void 0,(function(){var n,r;return Ns(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(sc(e,t)),[2,xc(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ms(void 0,void 0,void 0,(function(){var n,r,o;return Ns(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Zu(e,t)]:[4,Ac(e.body,t)];case 1:return n=i.sent(),{},r=dc(n,t),o=Rs({$metadata:Sc(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ic=function(){return(Ic=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)},Cc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Pc=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}},Tc=new g("Credentials"),jc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=Ni.refreshGoogleToken,this._refreshHandlers.facebook=zi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Ic(Ic({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Tc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return Tc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Tc.debug("getting old cred promise"):(Tc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Cc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Pc(this,(function(s){switch(s.label){case 0:if(Tc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Tc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Tc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Tc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),Tc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){Tc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return Tc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(Tc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(Tc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(Tc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Ai(n,[],1e4).then((function(e){return Tc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Tc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return Tc.debug("no credentials for expiration check"),!0;Tc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Cc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Pc(this,(function(u){switch(u.label){case 0:return Tc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(Tc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Tc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Yu({region:n,customUserAgent:_()}),a=void 0,a=r?ks({identityId:r,client:i})():function(){return Cc(s,void 0,void 0,(function(){var e;return Pc(this,(function(n){switch(n.label){case 0:return[4,i.send(new kc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,ks({client:i,identityId:e})()]}}))}))}().catch((function(e){return Cc(s,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return Cc(s,void 0,void 0,(function(){var n=this;return Pc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(Tc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return Cc(n,void 0,void 0,(function(){var e;return Pc(this,(function(n){switch(n.label){case 0:return[4,i.send(new kc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,ks({client:i,identityId:e})()]}}))}))}().catch((function(e){return Cc(n,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return Tc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return Tc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Yu({region:u,customUserAgent:_()}),f=void 0;r?f=ks({identityId:r,logins:i,client:c})():f=Ps({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Tc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return Tc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return Tc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Yu({region:o,customUserAgent:_()}),c=Cc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Pc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new kc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Lc({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(Tc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&Tc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return Cc(t,void 0,void 0,(function(){return Pc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return Cc(o,void 0,void 0,(function(){var o,s,u,c,f;return Pc(this,(function(l){switch(l.label){case 0:if(Tc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){Tc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return Tc.debug("Failed to load credentials",e),Tc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Tc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Cc(this,void 0,void 0,(function(){return Pc(this,(function(e){return this._credentials=null,this._credentials_source=null,Tc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return Cc(this,void 0,void 0,(function(){var e,t;return Pc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),Tc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return Cc(this,void 0,void 0,(function(){var t,n;return Pc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),Tc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return Cc(this,void 0,void 0,(function(){var e;return Pc(this,(function(t){return e=this._config.identityPoolId,Tc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),Rc=new jc(null);b.register(Rc);var Mc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Nc=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){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,s])}}},zc=function(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},Bc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(zc(arguments[t]));return e},Uc=new g("AWSCloudWatch"),Fc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Mc(this,void 0,void 0,(function(){var t,n;return Nc(this,(function(r){switch(r.label){case 0:Uc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Uc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){Uc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Bc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r,o;return Nc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,Uc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Mc(this,void 0,void 0,(function(){var n,r,o,i;return Nc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,Uc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r;return Nc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return Uc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,Uc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Mc(this,void 0,void 0,(function(){var e=this;return Nc(this,(function(t){switch(t.label){case 0:return[4,Rc.get().then((function(t){if(!t)return!1;var n=Rc.shear(t);return Uc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return Uc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Mc(this,void 0,void 0,(function(){var e,t;return Nc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),Uc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Mc(this,void 0,void 0,(function(){var e,t,n,r,o;return Nc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),Uc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";Uc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Mc(this,void 0,void 0,(function(){var t,n,r;return Nc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),Uc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Mc(e,void 0,void 0,(function(){var e;return Nc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),Uc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),Dc={},qc={addEventListener:function(e,t){}},Gc=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Hc(e){return(Hc="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 Wc=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Hc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),$c=n(5);function Kc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Vc=function(){return(Vc=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)},Yc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?$c.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=$c.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Kc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Kc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Vc(Vc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=$c.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Vc(Vc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Vc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=$c.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Zc=Object(U.b)().isBrowser,Jc=function(){function e(e){void 0===e&&(e={}),this.cookies=new Yc,this.store=Zc?window.localStorage:Object.create(null),this.cookies=e.req?new Yc(e.req.headers.cookie):new Yc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Zc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),Xc="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,Qc=Xc?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",ef=Xc?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",tf="x-amz-user-agent",nf=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),rf=n(22),of=n.n(rf).a,af=function(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.")},sf=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return of.from([{online:!0}]);var n=Object(U.h)()?self:window;return new of((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=af(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function uf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function cf(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var ff={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=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)},o=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)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=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)},o=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)}}])}));
|
|
46
46
|
//# sourceMappingURL=aws-amplify-core.min.js.map
|