1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4991],{4004:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i((s+a)*3/4-a),l=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(e,t,n){for(var i,o=[],s=t;s<n;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},6690:(e,t,r)=>{"use strict";r.d(t,{C:()=>o,J:()=>i});var n=r(27161);function i(e){let t=e?.split("_")[0];if(!e||0>e.indexOf("_")||!t||"string"!=typeof t)throw new n.l({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}function o(e){if(!e||!e.includes(":"))throw new n.l({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}},7809:(e,t,r)=>{"use strict";r.d(t,{U9:()=>s,YZ:()=>c});var n=r(80457),i=r(76186),o=r(93483);let s="undefined"!=typeof Symbol?Symbol("amplify_default"):"@@amplify_default",a=new n.C("Hub");class u{constructor(e){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}_remove(e,t){let r=this.listeners.get(e);if(!r)return void a.warn(`No listeners for ${e}`);this.listeners.set(e,[...r.filter(({callback:e})=>e!==t)])}dispatch(e,t,r,n){"string"==typeof e&&this.protectedChannels.indexOf(e)>-1&&n!==s&&a.warn(`WARNING: ${e} is protected and dispatching on it can have unintended consequences`);let i={channel:e,payload:{...t},source:r,patternInfo:[]};try{this._toListeners(i)}catch(e){a.error(e)}}listen(e,t,r="noname"){if("function"!=typeof t)throw new o.x({name:i.d1,message:"No callback supplied to Hub"});let n=this.listeners.get(e);return n||(n=[],this.listeners.set(e,n)),n.push({name:r,callback:t}),()=>{this._remove(e,t)}}_toListeners(e){let{channel:t,payload:r}=e,n=this.listeners.get(t);n&&n.forEach(n=>{a.debug(`Dispatching to ${t} with `,r);try{n.callback(e)}catch(e){a.error(e)}})}}let c=new u("__default__");new u("internal-hub")},8102:(e,t,r)=>{"use strict";r.d(t,{F:()=>i,Y:()=>o});var n=r(41069);let i=async e=>{if(!e||e.statusCode<300)return;let t=await o(e),r=(e=>{let[t]=e.toString().split(/[,:]+/);return t.includes("#")?t.split("#")[1]:t})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError");return Object.assign(Error(t.message??t.Message??"Unknown error"),{name:r,$metadata:(0,n.j)(e)})},o=async e=>{if(!e.body)throw Error("Missing response payload");return Object.assign(await e.body.json(),{$metadata:(0,n.j)(e)})}},8159:(e,t,r)=>{"use strict";r.d(t,{T:()=>s});var n=r(8102),i=r(15900),o=r(27161);let s=()=>async e=>{if(e.statusCode>=300){let t=await (0,n.F)(e);throw(0,i.e)(t),new o.l({name:t.name,message:t.message,metadata:t.$metadata})}return(0,n.Y)(e)}},10480:(e,t,r)=>{"use strict";r.d(t,{$:()=>n});let n=Symbol("oauth-listener")},11737:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=5960464477539062e-23*(23===i),f=n?0:o-1,g=n?1:-1,p=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?t+=d/u:t+=d*Math.pow(2,1-h),t*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=g,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+f]=255&s,f+=g,s/=256,c-=8);e[r+f-g]|=128*p}},13233:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var n=r(37229),i=r(19251);let o=(0,n.q)(i.F,[()=>(e,t)=>async function(t){return t.headers["cache-control"]="no-store",e(t)}])},14576:(e,t,r)=>{"use strict";r.d(t,{Eh:()=>h,G6:()=>l,$y:()=>c,Cq:()=>d});var n,i=r(36970);let o={convert(e,t){let r=e;return t?.urlSafe&&(r=r.replace(/-/g,"+").replace(/_/g,"/")),(0,i.nW)()(r)}};var s=r(83261);!function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"}(n||(n={}));let a={[n.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[n.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[n.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[n.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[n.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},u=(0,s.p)(a);function c(e){u(!!e&&!!e.userPoolId&&!!e.userPoolClientId,n.AuthUserPoolException)}function l(e){u(!!e?.loginWith?.oauth?.domain&&!!e?.loginWith?.oauth?.redirectSignOut&&!!e?.loginWith?.oauth?.redirectSignIn&&!!e?.loginWith?.oauth?.responseType,n.OAuthNotConfigureException)}function h(e){u(!!e?.identityPoolId,n.InvalidIdentityPoolIdException)}function d(e){let t=e.split(".");if(3!==t.length)throw Error("Invalid token");try{let r=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(o.convert(r).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),i=JSON.parse(n);return{toString:()=>e,payload:i}}catch(e){throw Error("Invalid token payload")}}},15050:(e,t,r)=>{"use strict";var n,i,o,s,a,u,c,l,h,d,f,g,p,y;r.d(t,{BM:()=>u,b7:()=>i,dT:()=>n}),function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"}(n||(n={})),function(e){e.AI="ai",e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"}(i||(i={})),function(e){e.CreateConversation="1",e.GetConversation="2",e.ListConversations="3",e.DeleteConversation="4",e.SendMessage="5",e.ListMessages="6",e.OnMessage="7",e.Generation="8",e.UpdateConversation="9"}(o||(o={})),function(e){e.Record="1",e.IdentifyUser="2"}(s||(s={})),function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"}(a||(a={})),function(e){e.SignUp="1",e.ConfirmSignUp="2",e.ResendSignUpCode="3",e.SignIn="4",e.FetchMFAPreference="6",e.UpdateMFAPreference="7",e.SetUpTOTP="10",e.VerifyTOTPSetup="11",e.ConfirmSignIn="12",e.DeleteUserAttributes="15",e.DeleteUser="16",e.UpdateUserAttributes="17",e.FetchUserAttributes="18",e.ConfirmUserAttribute="22",e.SignOut="26",e.UpdatePassword="27",e.ResetPassword="28",e.ConfirmResetPassword="29",e.FederatedSignIn="30",e.RememberDevice="32",e.ForgetDevice="33",e.FetchDevices="34",e.SendUserAttributeVerificationCode="35",e.SignInWithRedirect="36",e.StartWebAuthnRegistration="37",e.CompleteWebAuthnRegistration="38",e.ListWebAuthnCredentials="39",e.DeleteWebAuthnCredential="40"}(u||(u={})),function(e){e.Subscribe="1",e.GraphQl="2"}(c||(c={})),function(e){e.SearchByText="0",e.SearchByCoordinates="1",e.SearchForSuggestions="2",e.SearchByPlaceId="3",e.SaveGeofences="4",e.GetGeofence="5",e.ListGeofences="6",e.DeleteGeofences="7"}(l||(l={})),function(e){e.SyncMessages="1",e.IdentifyUser="2",e.NotifyMessageInteraction="3"}(h||(h={})),(d||(d={})).None="0",function(e){e.Convert="1",e.Identify="2",e.Interpret="3"}(f||(f={})),(g||(g={})).Subscribe="1",function(e){e.InitializePushNotifications="1",e.IdentifyUser="2"}(p||(p={})),function(e){e.UploadData="1",e.DownloadData="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6",e.GetUrl="7",e.GetDataAccess="8",e.ListCallerAccessGrants="9"}(y||(y={}))},15279:(e,t,r)=>{"use strict";r.d(t,{C6:()=>i,Cl:()=>o,Tt:()=>s,YH:()=>u,fX:()=>c,sH:()=>a});
1var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})}function u(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){var c=[a,u];if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&c[0]?n.return:c[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,c[1])).done)return i;switch(n=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}Object.create;function c(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,"function"==typeof SuppressedError&&SuppressedError},15781:(e,t,r)=>{"use strict";r.d(t,{H:()=>h});var n=r(7809);let i=e=>{for(let t of Reflect.ownKeys(e)){let r=e[t];(r&&"object"==typeof r||"function"==typeof r)&&i(r)}return Object.freeze(e)};var o=r(10480),s=r(57728);r(86207),r(94699);let a=new(r(80457)).C("Auth");class u{configure(e,t){this.authConfig=e,this.authOptions=t,e&&e.Cognito?.userPoolEndpoint&&a.warn(c("Amazon Cognito User Pool")),e&&e.Cognito?.identityPoolEndpoint&&a.warn(c("Amazon Cognito Identity Pool"))}async fetchAuthSession(e={}){let t,r,n=await this.getTokens(e);return n?(r=n.accessToken?.payload?.sub,t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:n,authenticated:!0,forceRefresh:e.forceRefresh})):t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:e.forceRefresh}),{tokens:n,credentials:t?.credentials,identityId:t?.identityId,userSub:r}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(e){return await this.authOptions?.tokenProvider?.getTokens(e)??void 0}}let c=e=>`You are using a custom Amazon ${e} endpoint, ensure the endpoint is correct.`;class l{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new u}configure(e,t){let r=(0,s.M)(e);this.resourcesConfig=r,t&&(this.libraryOptions=t),this.resourcesConfig=i(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),n.YZ.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",n.U9),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[o.$](e){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?e(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=e}notifyOAuthListener(){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth&&this.oAuthListener&&(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}let h=new l},15900:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var n=r(98330),i=r(27161);function o(e){if(!e||"Error"===e.name||e instanceof TypeError)throw new i.l({name:n.m.Unknown,message:"An unknown error has occurred.",underlyingError:e})}},17278:(e,t,r)=>{"use strict";r.d(t,{_:()=>n});let n=e=>(t,r)=>o(r,i(e),JSON.stringify(t)),i=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProvi
1derService.${e}`}),o=({url:e},t,r)=>({headers:t,url:e,body:r,method:"POST"})},17385:(e,t,r)=>{"use strict";r.d(t,{R:()=>o});let n={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},i={partitions:[n,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},o=e=>{let{partitions:t}=i;for(let{regions:r,outputs:n,regionRegex:i}of t){let t=new RegExp(i);if(r.includes(e)||t.test(e))return n.dnsSuffix}return n.outputs.dnsSuffix}},17683:(e,t,r)=>{"use strict";r.d(t,{H0:()=>o,OW:()=>s,X4:()=>c,f3:()=>l});var n=r(27161),i=r(75402);function o(e){if(!e||!e.accessToken)throw new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function s(e){if(!e||!e.idToken)throw new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}let a=new n.l({name:i.Cs,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 2 Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 3 E.g { responseType: 'code' }`}),u=new n.l({name:i.zz,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function c(e){var t,r;if(h(t=e)&&!t?.refreshToken)throw a;if(!(h(r=e)&&r?.refreshToken))throw u}let l={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function h(e){return e?.accessToken||e?.idToken}},19194:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(60626),i=r(15050);let o=(e,t)=>(0,n.fE)({category:i.b7.Auth,action:e,...t})},19251:(e,t,r)=>{"use strict";let n;r.d(t,{F:()=>y});var i=r(40543);let o=(e,t)=>{let r,n;if(t?.aborted)return Promise.resolve();let i=new Promise(t=>{n=t,r=setTimeout(t,e)});return t?.addEventListener("abort",function e(i){clearTimeout(r),t?.removeEventListener("abort",e),n()}),i},s=(e,t)=>{"[object Object]"===Object.prototype.toString.call(e)&&(e.$metadata={...e.$metadata??{},attempts:t})},a={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},u=new Uint8Array(16),c=[];for(let e=0;e<256;++e)c.push((e+256).toString(16).slice(1));let l=function(e,t,r){if(a.randomUUID&&!t&&!e)return a.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(u)}();if(i.length<16)throw Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase()}(i)};r(86207),r(94699);var h=r(37229),d=r(93483),f=r(98330);let g=e=>{let t;return()=>(t||(t=e()),t)},p=async({url:e,method:t,headers:r,body:n},{abortSignal:i,cache:o,withCrossDomainCredentials:s})=>{let a;try{a=await fetch(e,{method:t,headers:r,body:["HEAD","GET","DELETE"].includes(t.toUpperCase())?void 0:n,signal:i,cache:o,credentials:s?"include":"same-origin"})}catch(e){if(e instanceof TypeError)throw new d.x({name:f.m.NetworkError,message:"A network error has occurred.",underlyingError:e});throw e}let u={};a.headers?.forEach((e,t)=>{u[t.toLowerCase()]=e});let c={statusCode:a.status,headers:u,body:null},l=Object.assign(a.body??{},{text:g(()=>a.text()),blob:g(()=>a.blob()),json:g(()=>a.json())});return{...c,body:l}},y=(0,h.q)(p,[({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>r=>async function(n){if(0===t.trim().length)return await r(n);{let i=e.toLowerCase();return n.headers[i]=n.headers[i]?`${n.headers[i]} ${t}`:t,await r(n)}},()=>e=>async function(t){return t.headers[i.jy]||(t.headers[i.jy]=l()),e(t)},({maxAttempts:e=i.K7,retryDecider:t,computeDelay:r,abortSignal:n})=>{if(e<1)throw Error("maxAttempts must be greater than 0");return(i,a)=>async function(u){let c,l,h=a.attemptsCount??0,d=()=>
3{if(l)return s(l,h),l;throw s(c,h),c};for(;!n?.aborted&&h<e;){try{l=await i(u),c=void 0}catch(e){c=e,l=void 0}h=(a.attemptsCount??0)>h?a.attemptsCount??0:h+1,a.attemptsCount=h;let{isCredentialsExpiredError:s,retryable:f}=await t(l,c,a);if(!f)return d();if(a.isCredentialsExpired=!!s,!n?.aborted&&h<e){let e=r(h);await o(e,n)}}if(!n?.aborted)return d();throw Error("Request aborted.")}},({maxAttempts:e=i.K7})=>(t,r)=>async function(n){let o=r.attemptsCount??0;return n.headers[i.Q8]=`attempt=${o+1}; max=${e}`,t(n)}])},24035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=r(31079);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=o(e,n)),t&&(i.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},27161:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var n=r(93483);class i extends n.x{constructor(e){super(e),this.constructor=i,Object.setPrototypeOf(this,i.prototype)}}},31410:(e,t,r)=>{"use strict";r.d(t,{C:()=>a});var n=r(47922),i=r(8102),o=r(53205),s=r(60626);let a={service:r(48704).M,retryDecider:(0,n.D)(i.F),computeDelay:o.y,get userAgentValue(){return(0,s.fE)()},cache:"no-store"}},36970:(e,t,r)=>{"use strict";r.d(t,{MY:()=>i,nW:()=>s,xA:()=>o});var n=r(93483);let i=()=>{if("object"==typeof window&&"object"==typeof window.crypto)return window.crypto;if("object"==typeof crypto)return crypto;throw new n.x({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},o=()=>{if("undefined"!=typeof window&&"function"==typeof window.btoa)return window.btoa;if("function"==typeof btoa)return btoa;throw new n.x({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},s=()=>
3{if("undefined"!=typeof window&&"function"==typeof window.atob)return window.atob;if("function"==typeof atob)return atob;throw new n.x({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})}},37154:(e,t,r)=>{"use strict";r.d(t,{Uv:()=>h,Qm:()=>f});var n,i=r(14576),o=r(27161);let s={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var a=r(83261);(n||(n={})).InvalidAuthTokens="InvalidAuthTokens";let u={[n.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},c=(0,a.p)(u),l="CognitoIdentityServiceProvider";class h{getKeyValueStorage(){if(!this.keyValueStorage)throw new o.l({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{let e=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e.accessToken);if(!t)throw new o.l({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});let r=(0,i.Cq)(t),n=await this.getKeyValueStorage().getItem(e.idToken),s=n?(0,i.Cq)(n):void 0,a=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,u=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",c=Number.parseInt(u),l=await this.getKeyValueStorage().getItem(e.signInDetails),h={accessToken:r,idToken:s,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return l&&(h.signInDetails=JSON.parse(l)),h}catch(e){return null}}async storeTokens(e){c(void 0!==e,n.InvalidAuthTokens);let t=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),t);let r=await this.getAuthKeys();await this.getKeyValueStorage().setItem(r.accessToken,e.accessToken.toString()),e.idToken?await this.getKeyValueStorage().setItem(r.idToken,e.idToken.toString()):await this.getKeyValueStorage().removeItem(r.idToken),e.refreshToken?await this.getKeyValueStorage().setItem(r.refreshToken,e.refreshToken):await this.getKeyValueStorage().removeItem(r.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(r.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(r.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(r.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetails?await this.getKeyValueStorage().setItem(r.signInDetails,JSON.stringify(e.signInDetails)):await this.getKeyValueStorage().removeItem(r.signInDetails),await this.getKeyValueStorage().setItem(r.clockDrift,`${e.clockDrift}`)}async clearTokens(){let e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(e.oauthMetadata)])}async getDeviceMetadata(e){let t=await this.getAuthKeys(e),r=await this.getKeyValueStorage().getItem(t.deviceKey),n=await this.getKeyValueStorage().getItem(t.deviceGroupKey),i=await this.getKeyValueStorage().getItem(t.randomPasswordKey);return i&&n&&r?{deviceKey:r,deviceGroupKey:n,randomPassword:i}:null}async clearDeviceMetadata(e){let t=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(t.deviceKey),this.getKeyValueStorage().removeItem(t.deviceGroupKey),this.getKeyValueStorage().removeItem(t.randomPasswordKey)])}async getAuthKeys(e){(0,i.$y)(this.authConfig?.Cognito);let t=e??await this.getLastAuthUser();return d(l,`${this.authConfig.Cognito.userPoolClientId}.${t}`)}getLastAuthUserKey(){(0,i.$y)(this.authConfig?.Cognito);let e=this.authConfig.Cognito.userPoolClientId;return`${l}.${e}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(e){let{oauthMetadata:t}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(t,JSON.stringify(e))}async getOAuthMetadata(){let{oauthMetadata:e}=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e);return t&&JSON.parse(t)}}let d=(e,t)=>f(s)(`${e}`,t);function f(e){let t=Object.values({...e});return(e,r)=>t.reduce((t,n)=>({...t,[n]:`${e}.${r}.${n}`}),{})}},37229:(e,t,r)=>{"use strict";r.d(t,{q:()=>n});let n=(e,t)=>(r,n)=>{let i={},o=t=>e(t,n);for(let e=t.length-1;e>=0;e--)o=(0,t[e])(n)(o,i);return o(r)}},39779:(e,t,r)=>{"use strict";function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}r.d(t,{E:()=>q});var i=function e(t,r){function i(e,i,o){if("undefined"!=typeof document){"number"==typeof(o=n({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decode
3URIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+s}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},i=0;i<r.length;i++){var o=r[i].split("="),s=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(n[a]=t.read(s,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){i(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});class o{constructor(e={}){let{path:t,domain:r,expires:n,sameSite:i,secure:o}=e;if(this.domain=r,this.path=t||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?n:365,this.secure=!Object.prototype.hasOwnProperty.call(e,"secure")||o,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!i||!["strict","lax","none"].includes(i))throw Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===i&&!this.secure)throw Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=i}}async setItem(e,t){i.set(e,t,this.getData())}async getItem(e){return i.get(e)??null}async removeItem(e){i.remove(e,this.getData())}async clear(){let e=Object.keys(i.get()).map(e=>this.removeItem(e));await Promise.all(e)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}var s=r(94839),a=r(15781),u=r(57728),c=r(80457);r(86207),r(94699);var l=r(60626),h=r(41069),d=r(8102),f=r(67891),g=r(53205),p=r(47922);let y="cognito-identity",m={service:y,retryDecider:(0,p.D)(d.F),computeDelay:g.y,cache:"no-store"};var w=r(19251);let v=(0,r(37229).q)(w.F,[()=>e=>async function(t){return t.headers["cache-control"]="no-store",e(t)}]),I=e=>(t,r)=>S(r,A(e),JSON.stringify(t)),A=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),S=({url:e},t,r)=>({headers:t,url:e,body:r,method:"POST"}),E=e=>(0,f.A)(v,I("GetCredentialsForIdentity"),C,{...m,...e,userAgentValue:(0,l.fE)()}),C=async e=>{if(e.statusCode>=300)throw await (0,d.F)(e);let t=await (0,d.Y)(e);return{IdentityId:t.IdentityId,Credentials:b(t.Credentials),$metadata:(0,h.j)(e)}},b=({Expiration:e,...t}={})=>({...t,Expiration:e&&new Date(1e3*e)});var T=r(14576),P=r(27161),_=r(15900),k=r(6690),R=r(17683),O=r(17385),U=r(80865);let x=({endpointOverride:e})=>t=>e?{url:new U.o(e)}:(({region:e})=>({url:new U.o(`https://${y}.${e}.${(0,O.R)(e)}`)}))(t),M=async e=>{if(e.statusCode>=300)throw await (0,d.F)(e);return{IdentityId:(await (0,d.Y)(e)).IdentityId,$metadata:(0,h.j)(e)}};function N(e){let t=(0,T.Cq)(e).payload.iss,r={};if(!t)throw new P.l({name:"InvalidIdTokenException",message:"Invalid Idtoken."});return r[t.replace(/(^\w+:|^)\/\//,"")]=e,r}async function L({tokens:e,authConfig:t,identityIdStore:r}){r.setAuthConfig({Cognito:t});let n=await r.loadIdentityId();if(n)return n.id;let i=e?.idToken?N(e.idToken.toString()):{},o=await D(i,t);return r.storeIdentityId({id:o,type:e?"primary":"guest"}),o}async function D(e,t){let r,n,i=t?.identityPoolId,o=(0,k.C)(i),s=(n={endpointResolver:x({endpointOverride:t.identityPoolEndpoint})},(0,f.A)(v,I("GetId"),M,{...m,...n,userAgentValue:(0,l.fE)()}));try{r=(await s({region:o},{IdentityPoolId:i,Logins:e})).IdentityId}catch(e){throw(0,_.e)(e),new P.l(e)}if(!r)throw new P.l({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return r}let K=new c.C("CognitoCredentialsProvider");class V{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){K.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){K.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){let t=e.authenticated,{tokens:r}=e,{authConfig:n}=e;try{(0,T.Eh)(n?.Cognito)}catch{return}if(!t&&!n.Cognito.allowGuestAccess)return;let{forceRefresh:i}=e,o=this.hasTokenChanged(r),s=await L({tokens:r,authConfig:n.Cognito,identityIdStore:this._identityIdStore});return((i||o)&&this.clearCredentials(),t)?((0,R.OW)(r),this.credsForOIDCTokens(n.Cognito,r,s)):this.getGuestCredentials(s,n.Cognito)}async getGuestCredentials(e,t){let r;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!1===this._credentialsAndIdentityId.isAuthenticatedCreds)return K.info("returning stored credentials as they neither past TTL n
3or expired."),this._credentialsAndIdentityId;this.clearCredentials();let n=(0,k.C)(t.identityPoolId),i=E({endpointResolver:x({endpointOverride:t.identityPoolEndpoint})});try{r=await i({region:n},{IdentityId:e})}catch(e){throw(0,_.e)(e),new P.l(e)}if(r?.Credentials?.AccessKeyId&&r?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let t={credentials:{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration},identityId:e};return r.IdentityId&&(t.identityId=r.IdentityId,this._identityIdStore.storeIdentityId({id:r.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...t,isAuthenticatedCreds:!1},t}throw new P.l({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(e,t,r){let n;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!0===this._credentialsAndIdentityId.isAuthenticatedCreds)return K.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let i=t.idToken?N(t.idToken.toString()):{},o=(0,k.C)(e.identityPoolId),s=E({endpointResolver:x({endpointOverride:e.identityPoolEndpoint})});try{n=await s({region:o},{IdentityId:r,Logins:i})}catch(e){throw(0,_.e)(e),new P.l(e)}if(n?.Credentials?.AccessKeyId&&n?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let e={credentials:{accessKeyId:n.Credentials.AccessKeyId,secretAccessKey:n.Credentials.SecretKey,sessionToken:n.Credentials.SessionToken,expiration:n.Credentials.Expiration},identityId:r};return n.IdentityId&&(e.identityId=n.IdentityId,this._identityIdStore.storeIdentityId({id:n.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...e,isAuthenticatedCreds:!0,associatedIdToken:t.idToken?.toString()},e}throw new P.l({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return void 0===this._nextCredentialsRefresh||this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(e){return!!e&&!!this._credentialsAndIdentityId?.associatedIdToken&&e.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}var $=r(37154);let B={identityId:"identityId"},j=new c.C("DefaultIdentityIdStore");class G{setAuthConfig(e){(0,T.Eh)(e.Cognito),this.authConfig=e,this._authKeys=F("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=e}async loadIdentityId(){(0,T.Eh)(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{let e=await this.keyValueStorage.getItem(this._authKeys.identityId);if(e)return this._hasGuestIdentityId=!0,{id:e,type:"guest"};return null}}catch(e){return j.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(e){(0,T.Eh)(this.authConfig?.Cognito),"guest"===e.type?(this.keyValueStorage.setItem(this._authKeys.identityId,e.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=e.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}let F=(e,t)=>(0,$.Qm)(B)(`com.amplify.${e}`,t),Y=new V(new G(s.ZL));var W=r(56349);let q={configure(e,t){let r=(0,u.M)(e),n=new o({sameSite:"lax"}),i=(null==t?void 0:t.ssr)?n:s.ZL,c=(null==t?void 0:t.ssr)?new V(new G(n)):Y;if(!r.Auth||(null==t?void 0:t.Auth))return void a.H.configure(r,t);if(!a.H.libraryOptions.Auth){W.Q.setAuthConfig(r.Auth),W.Q.setKeyValueStorage(i),a.H.configure(r,{...t,Auth:{tokenProvider:W.Q,credentialsProvider:c}});return}if(t){let e=a.H.libraryOptions.Auth;void 0!==t.ssr&&(W.Q.setKeyValueStorage(i),e.credentialsProvider=c),a.H.configure(r,{Auth:e,...t});return}a.H.configure(r)},getConfig:()=>a.H.getConfig()}},40543:(e,t,r)=>{"use strict";r.d(t,{K7:()=>n,Q8:()=>o,jy:()=>i,mU:()=>s});let n=3,i="amz-sdk-invocation-id",o="amz-sdk-request",s=3e5},41069:(e,t,r)=>{"use strict";r.d(t,{j:()=>n});let n=e=>{let{headers:t,statusCode:r}=e;return{...i(e)?e.$metadata:{},httpStatusCode:r,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},i=e=>"object"==typeof e?.$metadata},45598:(e,t,r)=>{"use strict";r.d(t,{f:()=>i});var n=r(94839);let i=new(r(77365)).S(n.ZL)},47922:(e,t,r)=>{"use strict";r.d(t,{D:()=>o});var n=r(98330);let i=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],o=e=>async(t,r)=>{let n=r??await e(t)??void 0,o=n?.code||n?.name,s=t?.statusCode;return{retryable:c(r)||u(s,o)||(e=>!!e&&i.includes(e))(o)||l(s,o)}},s=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],a=["TimeoutError","RequestTimeout","RequestTimeoutException"],u=(e,t)=>
3429===e||!!t&&s.includes(t),c=e=>[n.m.NetworkError,"ERR_NETWORK"].includes(e?.name),l=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&a.includes(t)},48704:(e,t,r)=>{"use strict";r.d(t,{M:()=>n});let n="cognito-idp"},51777:(e,t,r)=>{"use strict";r.d(t,{z:()=>n});let n=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))}},53205:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var n=r(40543);let i=e=>{let t=(function(e=3e5){return t=>{let r=2**t*100+100*Math.random();return!(r>e)&&r}})(n.mU)(e);return!1===t?n.mU:t}},56349:(e,t,r)=>{"use strict";r.d(t,{Q:()=>b,o:()=>T});var n=r(94839),i=r(14576),o=r(6690),s=r(17683),a=r(27161),u=r(67891),c=r(17278),l=r(8159),h=r(13233),d=r(31410),f=r(66827);let g=(e=>{let t;return async(...r)=>t||(t=new Promise((n,i)=>{e(...r).then(e=>{n(e)}).catch(e=>{i(e)}).finally(()=>{t=void 0})}))})(async({tokens:e,authConfig:t,username:r})=>{let n;(0,i.$y)(t?.Cognito);let{userPoolId:g,userPoolClientId:p,userPoolEndpoint:y}=t.Cognito,m=(0,o.J)(g);(0,s.X4)(e);let w=e.refreshToken,v={REFRESH_TOKEN:w};e.deviceMetadata?.deviceKey&&(v.DEVICE_KEY=e.deviceMetadata.deviceKey);let I=function({username:e,userPoolId:t,userPoolClientId:r}){if("undefined"==typeof window)return;let n=window.AmazonCognitoAdvancedSecurityData;if(void 0===n)return;let i=n.getData(e,t,r);return i?{EncodedData:i}:{}}({username:r,userPoolId:g,userPoolClientId:p}),A=(n={endpointResolver:(0,f.o)({endpointOverride:y})},(0,u.A)(h.e,(0,c._)("InitiateAuth"),(0,l.T)(),{...d.C,...n})),{AuthenticationResult:S}=await A({region:m},{ClientId:p,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:v,UserContextData:I}),E=(0,i.Cq)(S?.AccessToken??""),C=S?.IdToken?(0,i.Cq)(S.IdToken):void 0,{iat:b}=E.payload;if(!b)throw new a.l({name:"iatNotFoundException",message:"iat not found in access token"});return{accessToken:E,idToken:C,clockDrift:1e3*b-new Date().getTime(),refreshToken:w,username:r}});var p=r(37154),y=r(7809),m=r(98243);function w({expiresAt:e,clockDrift:t,tolerance:r=5e3}){return Date.now()+t+r>e}var v=r(98330),I=r(15900),A=r(45598),S=r(99890);class E{constructor(){this.waitForInflightOAuth=(0,m.B)()?async()=>{if(await A.f.loadOAuthInFlight())return this.inflightPromise||(this.inflightPromise=new Promise((e,t)=>{(0,S.I)(e)})),this.inflightPromise}:async()=>{}}setAuthConfig(e){A.f.setAuthConfig(e.Cognito),this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}getTokenStore(){if(!this.tokenStore)throw new a.l({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new a.l({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(e){let t;try{(0,i.$y)(this.authConfig?.Cognito)}catch(e){return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,t=await this.getTokenStore().loadTokens();let r=await this.getTokenStore().getLastAuthUser();if(null===t)return null;let n=!!t?.idToken&&w({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),o=w({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(e?.forceRefresh||n||o)&&null===(t=await this.refreshTokens({tokens:t,username:r}))?null:{accessToken:t?.accessToken,idToken:t?.idToken,signInDetails:t?.signInDetails}}async refreshTokens({tokens:e,username:t}){try{let{signInDetails:r}=e,n=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:t});return n.signInDetails=r,await this.setTokens({tokens:n}),y.YZ.dispatch("auth",{event:"tokenRefresh"},"Auth",y.U9),n}catch(e){return this.handleErrors(e)}}handleErrors(e){if((0,I.e)(e),e.name!==v.m.NetworkError&&this.clearTokens(),y.YZ.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",y.U9),e.name.startsWith("NotAuthorizedException"))return null;throw e}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}setOAuthMetadata(e){return this.getTokenStore().setOAuthMetadata(e)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class C{constructor(){this.authTokenStore=new p.Uv,this.authTokenStore.setKeyValueStorage(n.ZL),this.tokenOrchestrator=new E,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(g)}getTokens({forceRefresh:e}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:e})}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}}let b=new C,{tokenOrchestrator:T}=b},57728:(e,t,r)=>{"use strict";r.d(t,{M:()=>l});var n=r(80457),i=r(93483);let o=new n.C("parseAWSExports"),s={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},a=e=>e?.split(",")??[],u={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"},c={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"},l=e=>Object.keys(e).some(e=>e.startsWith("aws_"))?((e={})=>
3{if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new i.x({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});let{aws_appsync_apiKey:t,aws_appsync_authenticationType:r,aws_appsync_graphqlEndpoint:n,aws_appsync_region:u,aws_bots_config:c,aws_cognito_identity_pool_id:l,aws_cognito_sign_up_verification_method:h,aws_cognito_mfa_configuration:d,aws_cognito_mfa_types:f,aws_cognito_password_protection_settings:g,aws_cognito_verification_mechanisms:p,aws_cognito_signup_attributes:y,aws_cognito_social_providers:m,aws_cognito_username_attributes:w,aws_mandatory_sign_in:v,aws_mobile_analytics_app_id:I,aws_mobile_analytics_app_region:A,aws_user_files_s3_bucket:S,aws_user_files_s3_bucket_region:E,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:C,aws_user_pools_id:b,aws_user_pools_web_client_id:T,geo:P,oauth:_,predictions:k,aws_cloud_logic_custom:R,Notifications:O,modelIntrospection:U}=e,x={};I&&(x.Analytics={Pinpoint:{appId:I,region:A}});let{InAppMessaging:M,Push:N}=O??{};if(M?.AWSPinpoint||N?.AWSPinpoint){if(M?.AWSPinpoint){let{appId:e,region:t}=M.AWSPinpoint;x.Notifications={InAppMessaging:{Pinpoint:{appId:e,region:t}}}}if(N?.AWSPinpoint){let{appId:e,region:t}=N.AWSPinpoint;x.Notifications={...x.Notifications,PushNotification:{Pinpoint:{appId:e,region:t}}}}}if(Array.isArray(c)&&(x.Interactions={LexV1:Object.fromEntries(c.map(e=>[e.name,e]))}),n){let e=s[r];e||o.debug(`Invalid authentication type ${r}. Falling back to IAM.`),x.API={GraphQL:{endpoint:n,apiKey:t,region:u,defaultAuthMode:e??"iam"}},U&&(x.API.GraphQL.modelIntrospection=U)}let L=d?{status:d&&d.toLowerCase(),totpEnabled:f?.includes("TOTP")??!1,smsEnabled:f?.includes("SMS")??!1}:void 0,D=g?{minLength:g.passwordPolicyMinLength,requireLowercase:g.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:g.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:g.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:g.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,K=Array.from(new Set([...p??[],...y??[]])).reduce((e,t)=>({...e,[t.toLowerCase()]:{required:!0}}),{}),V=w?.includes("EMAIL")??!1,$=w?.includes("PHONE_NUMBER")??!1;(l||b)&&(x.Auth={Cognito:{identityPoolId:l,allowGuestAccess:"enable"!==v,signUpVerificationMethod:h,userAttributes:K,userPoolClientId:T,userPoolId:b,mfa:L,passwordFormat:D,loginWith:{username:!(V||$),email:V,phone:$}}});let B=!!_&&Object.keys(_).length>0,j=!!m&&m.length>0;if(x.Auth&&B&&(x.Auth.Cognito.loginWith={...x.Auth.Cognito.loginWith,oauth:{...(({domain:e,scope:t,redirectSignIn:r,redirectSignOut:n,responseType:i})=>({domain:e,scopes:t,redirectSignIn:a(r),redirectSignOut:a(n),responseType:i}))(_),...j&&{providers:m.map(e=>{let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)})}}}),S&&(x.Storage={S3:{bucket:S,region:E,dangerouslyConnectToHttpEndpointForTesting:C}}),P){let{amazon_location_service:e}=P;x.Geo={LocationService:{maps:e.maps,geofenceCollections:e.geofenceCollections,searchIndices:e.search_indices,region:e.region}}}if(R&&(x.API={...x.API,REST:R.reduce((e,t)=>{let{name:r,endpoint:n,region:i,service:o}=t;return{...e,[r]:{endpoint:n,...o?{service:o}:void 0,...i?{region:i}:void 0}}},{})}),k){let{VoiceId:e}=k?.convert?.speechGenerator?.defaults??{};x.Predictions=e?{...k,convert:{...k.convert,speechGenerator:{...k.convert.speechGenerator,defaults:{voiceId:e}}}}:k}return x})(e):!function(e){let{version:t}=e;return!!t&&t.startsWith("1")}(e)?e:function(e){let t={};if(e.storage&&(t.Storage=function(e){if(!e)return;let{bucket_name:t,aws_region:r,buckets:n}=e;return{S3:{bucket:t,region:r,buckets:n&&function(e){let t={};return e.forEach(({name:e,bucket_name:r,aws_region:n,paths:i})=>{if(e in t)throw Error(`Duplicate friendly name found: ${e}. Name must be unique.`);let o=i?Object.entries(i).reduce((e,[t,r])=>(void 0!==r&&(e[t]=r),e),{}):void 0;t[e]={bucketName:r,region:n,paths:o}}),t}(n)}}}(e.storage)),e.auth&&(t.Auth=function(e){var t;if(!e)return;let{user_pool_id:r,user_pool_client_id:n,identity_pool_id:i,password_policy:o,mfa_configuration:s,mfa_methods:a,unauthenticated_identities_enabled:u,oauth:l,username_attributes:h,standard_required_attributes:d,groups:f}=e,g={Cognito:{userPoolId:r,userPoolClientId:n,groups:f}};return i&&(g.Cognito={...g.Cognito,identityPoolId:i}),o&&(g.Cognito.passwordFormat={requireLowercase:o.require_lowercase,requireNumbers:o.require_numbers,requireUppercase:o.require_uppercase,requireSpecialCharacters:o.require_symbols,minLength:o.min_length??6}),s&&(g.Cognito.mfa={status:"OPTIONAL"===(t=s)?"optional":"REQUIRED"===t?"on":"off",smsEnabled:a?.includes("SMS"),totpEnabled:a?.includes("TOTP")}),u&&(g.Cognito.allowGuestAccess=u),l&&(g.Cognito.loginWith={oauth:{domain:l.domain,redirectSignIn:l.redirect_sign_in_uri,redirectSignOut:l.redirect_sign_out_uri,responseType:"token"===l.response_type?"token":"code",scopes:l.scopes,providers:function(e=[]){return e.reduce((e,t)=>
3(void 0!==c[t]&&e.push(c[t]),e),[])}(l.identity_providers)}}),h&&(g.Cognito.loginWith={...g.Cognito.loginWith,email:h.includes("email"),phone:h.includes("phone_number"),username:h.includes("username")}),d&&(g.Cognito.userAttributes=d.reduce((e,t)=>({...e,[t]:{required:!0}}),{})),g}(e.auth)),e.analytics&&(t.Analytics=function(e){if(!e?.amazon_pinpoint)return;let{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}(e.analytics)),e.geo&&(t.Geo=function(e){if(!e)return;let{aws_region:t,geofence_collections:r,maps:n,search_indices:i}=e;return{LocationService:{region:t,searchIndices:i,geofenceCollections:r,maps:n}}}(e.geo)),e.data&&(t.API=function(e){if(!e)return;let{aws_region:t,default_authorization_type:r,url:n,api_key:i,model_introspection:o}=e;return{GraphQL:{endpoint:n,defaultAuthMode:u[r],region:t,apiKey:i,modelIntrospection:o}}}(e.data)),e.custom){let r=function(e){if(!e?.events)return;let{url:t,aws_region:r,api_key:n,default_authorization_type:i}=e.events;return{Events:{endpoint:t,defaultAuthMode:u[i],region:r,apiKey:n}}}(e.custom);r&&"Events"in r&&(t.API={...t.API,...r})}return e.notifications&&(t.Notifications=function(e){if(!e)return;let{aws_region:t,channels:r,amazon_pinpoint_app_id:n}=e,i=r.includes("IN_APP_MESSAGING"),o=r.includes("APNS")||r.includes("FCM");if(!(i||o))return;let s={};return i&&(s.InAppMessaging={Pinpoint:{appId:n,region:t}}),o&&(s.PushNotification={Pinpoint:{appId:n,region:t}}),s}(e.notifications)),t}(e)},60626:(e,t,r)=>{"use strict";let n;r.d(t,{fE:()=>I});var i=r(15050);let o="6.15.3";var s=r(80024);let a=(e,t)=>!!Object.keys(e).find(e=>e.startsWith(t));var u=r(80024),c=r(80024),l=r(80024);let h=[{platform:i.dT.Expo,detectionMethod:function(){return"undefined"!=typeof global&&void 0!==global.expo}},{platform:i.dT.ReactNative,detectionMethod:function(){return"undefined"!=typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:i.dT.NextJs,detectionMethod:function(){return"undefined"!=typeof window&&window.next&&"object"==typeof window.next}},{platform:i.dT.Nuxt,detectionMethod:function(){return"undefined"!=typeof window&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:i.dT.Angular,detectionMethod:function(){let e=!!("undefined"!=typeof document&&document.querySelector("[ng-version]")),t="undefined"!=typeof window&&void 0!==window.ng;return e||t}},{platform:i.dT.React,detectionMethod:function(){let e=e=>e.startsWith("_react")||e.startsWith("__react");return"undefined"!=typeof document&&Array.from(document.querySelectorAll("[id]")).some(t=>Object.keys(t).find(e))}},{platform:i.dT.VueJs,detectionMethod:function(){return"undefined"!=typeof window&&a(window,"__VUE")}},{platform:i.dT.Svelte,detectionMethod:function(){return"undefined"!=typeof window&&a(window,"__SVELTE")}},{platform:i.dT.WebUnknown,detectionMethod:function(){return"undefined"!=typeof window}},{platform:i.dT.NextJsSSR,detectionMethod:function(){return"undefined"!=typeof global&&(a(global,"__next")||a(global,"__NEXT"))}},{platform:i.dT.NuxtSSR,detectionMethod:function(){return"undefined"!=typeof global&&void 0!==global.__NUXT_PATHS__}},{platform:i.dT.ReactSSR,detectionMethod:function(){return void 0!==s&&void 0!==u.env&&!!Object.keys(u.env).find(e=>e.includes("react"))}},{platform:i.dT.VueJsSSR,detectionMethod:function(){return"undefined"!=typeof global&&a(global,"__VUE")}},{platform:i.dT.AngularSSR,detectionMethod:function(){return void 0!==s&&"object"==typeof l.env&&l.env.npm_lifecycle_script?.startsWith("ng ")||!1}},{platform:i.dT.SvelteSSR,detectionMethod:function(){return void 0!==s&&void 0!==c.env&&!!Object.keys(c.env).find(e=>e.includes("svelte"))}}],d=[],f=!1,g=()=>{if(!n){if(n=h.find(e=>e.detectionMethod())?.platform||i.dT.ServerSideUnknown,f)for(;d.length;)d.pop()?.();else d.forEach(e=>{e()});p(i.dT.ServerSideUnknown,10),p(i.dT.WebUnknown,10)}return n};function p(e,t){n!==e||f||setTimeout(()=>{n=void 0,f=!0,setTimeout(g,1e3)},t)}let y={},m="aws-amplify",w=e=>e.replace(/\+.*/,"");class v{constructor(){this.userAgent=`${m}/${w(o)}`}get framework(){return g()}get isReactNative(){return this.framework===i.dT.ReactNative||this.framework===i.dT.Expo}observeFrameworkChanges(e){f||d.push(e)}}new v;let I=e=>(({category:e,action:t}={})=>{let r=[[m,w(o)]];if(e&&r.push([e,t]),r.push(["framework",g()]),e&&t){let n=y[e]?.[t]?.additionalDetails;
3n&&n.forEach(e=>{r.push(e)})}return r})(e).map(([e,t])=>e&&t?`${e}/${t}`:e).join(" ")},61748:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},64105:(e,t,r)=>{"use strict";r.d(t,{C:()=>k});var n=r(80457),i=r(15781),o=r(94839);function s(){return i.H.Auth.clearCredentials()}var a=r(7809),u=r(14576),c=r(15050),l=r(19194),h=r(27161),d=r(77365),f=r(56349),g=r(6690),p=r(17683);r(86207);let y=async e=>{await e.clearOAuthData(),f.o.clearTokens(),await s(),a.YZ.dispatch("auth",{event:"signedOut"},"Auth",a.U9)};var m=r(51777),w=r(92265);let v=async(e,t=!1,r)=>{(0,u.G6)(e);let{loginWith:n,userPoolClientId:i}=e,{domain:o,redirectSignOut:s}=n.oauth,a=(0,w.M)(s,r),c=`https://${o}/logout?${Object.entries({client_id:i,logout_uri:encodeURIComponent(a)}).map(([e,t])=>`${e}=${t}`).join("&")}`;return(0,m.z)(c)},I=async(e,t,r,n)=>{let{isOAuthSignIn:i}=await t.loadOAuthSignIn(),o=await r.getOAuthMetadata();if(await y(t),i||o?.oauthSignIn)return v(e,!1,n)};var A=r(75402),S=r(67891),E=r(13233),C=r(17278),b=r(8159),T=r(31410),P=r(66827);let _=new n.C("Auth");async function k(e){let t,r=i.H.getConfig().Auth?.Cognito;(0,u.$y)(r),e?.global?await O(r):await R(r);try{(0,u.G6)(r),t=!0}catch(e){t=!1}if(t){let t=new d.S(o.ZL);t.setAuthConfig(r);let{type:n}=await I(r,t,f.o,e?.oauth?.redirectUrl)??{};if("error"===n)throw new h.l({name:A.mh,message:"An error occurred when attempting to log out from OAuth provider."})}else f.o.clearTokens(),await s(),a.YZ.dispatch("auth",{event:"signedOut"},"Auth",a.U9)}async function R(e){try{let{userPoolEndpoint:t,userPoolId:r,userPoolClientId:n}=e,i=await f.o.getTokenStore().loadTokens();if((0,p.X4)(i),U(i.accessToken)){let e,o=(e={endpointResolver:(0,P.o)({endpointOverride:t})},(0,S.A)(E.e,(0,C._)("RevokeToken"),(0,b.T)(),{...T.C,...e}));await o({region:(0,g.J)(r),userAgentValue:(0,l.A)(c.BM.SignOut)},{ClientId:n,Token:i.refreshToken})}}catch(e){_.debug("Client signOut error caught but will proceed with token removal")}}async function O(e){try{let t,{userPoolEndpoint:r,userPoolId:n}=e,i=await f.o.getTokenStore().loadTokens();(0,p.H0)(i);let o=(t={endpointResolver:(0,P.o)({endpointOverride:r})},(0,S.A)(E.e,(0,C._)("GlobalSignOut"),(0,b.T)(),{...T.C,...t}));await o({region:(0,g.J)(n),userAgentValue:(0,l.A)(c.BM.SignOut)},{AccessToken:i.accessToken.toString()})}catch(e){_.debug("Global signOut error caught but will proceed with token removal")}}let U=e=>!!e?.payload?.origin_jti},66827:(e,t,r)=>{"use strict";r.d(t,{o:()=>s});var n=r(80865),i=r(17385),o=r(48704);let s=({endpointOverride:e})=>t=>e?{url:new n.o(e)}:(({region:e})=>({url:new n.o(`https://${o.M}.${e}.${(0,i.R)(e)}`)}))(t)},67891:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(e,t,r,n)=>async(i,o)=>{let s={...n,...i},a=await s.endpointResolver(s,o),u=await t(o,a);return r(await e(u,{...s}))}},71390:(e,t,r)=>{"use strict";var n=r(4004),i=r(11737),o=r(61748);function s(){return u.TYPED_ARRAY_SUPPORT?0x7fffffff:0x3fffffff}function a(e,t){if(s()<t)throw RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw Error("If encoding is specified then the first argument must be a string");return h(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!u.isEncoding(r))throw TypeError('"encoding" must be a valid string encoding');var n=0|g(t,r),i=(e=a(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r,n=0|f(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t){return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):d(e,t)}if("Buffer"===t.type&&o(t.data))return d(e,t.data)}throw TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw TypeError('"size" argument must be a number');if(e<0)throw RangeError('"size" argument must not be negative')}function h(e,t){if(l(t),e=a(e,t<0?0:0|f(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|f(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=s())throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&
3(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(e).length;default:if(n)return _(e).length;t=(""+t).toLowerCase(),n=!0}}function p(e,t,r){var i,o,s,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n,i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var o="",s=t;s<r;++s){o+=(n=e[s])<16?"0"+n.toString(16):n.toString(16)}return o}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,s=r,0===o&&s===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),isNaN(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t){if(t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return w(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else -1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var h=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){h=!1;break}if(h)return o}return -1}t.hp=u,t.IS=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return(l(e),e<=0)?a(null,e):void 0!==t?"string"==typeof r?a(null,e).fill(t,r):a(null,e).fill(t):a(null,e)},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!!(null!=e&&e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.IS;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r),h=0;h<a;++h)if(c[h]!==l[h]){o=c[h],s=l[h];break}return o<s?-1:+(s<o)},u.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(l=c);break;case 2:(192&(o=e[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=h}var d=n,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var g="",p=0;p<f;)g+=String.fromCharCode.apply(String,d.slice(p,p+=4096));return g}function I(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function A(e,t,r,n,i,o){if(!u.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function S(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function E(e,t,r,n){t<0&&(t=0xffffffff+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>
3>(n?i:3-i)*8&255}function C(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function b(e,t,r,n,o){return o||C(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function T(e,t,r,n,o){return o||C(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,c,l,h,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))break;e[r+s]=a}return s}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,O(_(e,this.length-i),this,i,o);case"ascii":return s=t,a=r,O(k(e),this,s,a);case"latin1":case"binary":return function(e,t,r,n){return O(k(t),e,r,n)}(this,e,t,r);case"base64":return u=t,c=r,O(R(e),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=t,h=r,O(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-l),this,l,h);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return(t||I(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;A(this,e,t,r,i,0)}var o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;A(this,e,t,r,i,0)}var o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):S(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):S(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,4,0xffffffff,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):E(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,4,0xffffffff,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):E(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t|=0,!n){var i=Math.pow(2,8*r-1);A(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t|=0,!n){var i=Math.pow(2,8*r-1);A(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):S(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):S(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,4,0x7fffffff,-0x80000000),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):E(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e*=1,t|=0,r||A(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):E(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return b(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return b(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return T(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return T(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("sourceStart out of bounds");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i,o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=u.isBuffer(e)?e:_(new u(e,n).toString()),a=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}
3else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function k(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function R(e){return n.toByteArray(function(e){var t;if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}},71915:(e,t,r)=>{"use strict";r.d(t,{$:()=>i});var n=r(15781);let i=e=>{let t;return t=n.H,t.Auth.fetchAuthSession(e)}},75402:(e,t,r)=>{"use strict";r.d(t,{$6:()=>u,Cs:()=>l,RW:()=>s,jK:()=>a,mh:()=>c,yA:()=>h,z0:()=>o,zz:()=>i});var n=r(27161);let i="UserUnAuthenticatedException",o="UserAlreadyAuthenticatedException",s=new n.l({name:"InvalidRedirectException",message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new n.l({name:"InvalidAppSchemeException",message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});let a=new n.l({name:"InvalidPreferredRedirectUrlException",message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."}),u=new n.l({name:"InvalidOriginException",message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),c="OAuthSignOutException",l="TokenRefreshException",h="UnexpectedSignInInterruptionException"},76186:(e,t,r)=>{"use strict";r.d(t,{OU:()=>n,YJ:()=>i,d1:()=>o});let n="Logging",i="x-amz-user-agent",o="NoHubcallbackProvidedException"},77365:(e,t,r)=>{"use strict";r.d(t,{S:()=>u});var n=r(14576),i=r(37154),o=r(17683);let s="amplify-signin-with-hostedUI",a="CognitoIdentityServiceProvider";class u{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(e.inflightOAuth),this.keyValueStorage.removeItem(e.oauthPKCE),this.keyValueStorage.removeItem(e.oauthState)])}async clearOAuthData(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(s),this.keyValueStorage.removeItem(e.oauthSignIn)}loadOAuthState(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){(0,n.$y)(this.cognitoConfig);let t=c(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthState,e)}loadPKCE(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){(0,n.$y)(this.cognitoConfig);let t=c(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthPKCE,e)}setAuthConfig(e){this.cognitoConfig=e}async loadOAuthInFlight(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){(0,n.$y)(this.cognitoConfig);let t=c(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(t.inflightOAuth,`${e}`)}async loadOAuthSignIn(){(0,n.$y)(this.cognitoConfig);let e=c(a,this.cognitoConfig.userPoolClientId),t=await this.keyValueStorage.getItem(s),[r,i]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:"true"===r||"true"===t,preferPrivateSession:"true"===i}}async storeOAuthSignIn(e,t=!1){(0,n.$y)(this.cognitoConfig);let r=c(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(r.oauthSignIn,`${e},${t}`)}}let c=(e,t)=>(0,i.Qm)(o.f3)(e,t)},80457:(e,t,r)=>{"use strict";r.d(t,{C:()=>s});var n,i=r(76186);!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"}(n||(n={}));let o={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class s{constructor(e,t=n.WARN){this.name=e,this.level=t,this._pluggables=[]}_padding(e){return e<10?"0"+e:""+e}_ts(){let e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()}configure(e){return e&&(this._config=e),this._config}_log(e,...t){let r=this.level;s.LOG_LEVEL&&(r=s.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);let i=o[r];if(!(o[e]>=i))return;let a=console.log.bind(console);e===n.ERROR&&console.error&&(a=console.error.bind(console)),e===n.WARN&&console.warn&&(a=console.warn.bind(console)),s.BIND_ALL_LOG_LEVELS&&(e===n.INFO&&console.info&&(a=console.info.bind(console)),e===n.DEBUG&&console.debug&&(a=console.debug.bind(console)));let u=`[${e}] ${this._ts()} ${this.name}`,c="";if(1===t.length&&"string"==typeof t[0])a(c=`${u} - ${t[0]}`);else if(1===t.length)c=`${u} ${t[0]}`,a(u,t[0]);else if("string"==typeof t[0]){let e=t.slice(1);1===e.length&&(e=e[0]),c=`${u} - ${t[0]} ${e}`,a(`${u} - ${t[0]}`,e)}else c=`${u} ${t}`,a(u,t);for(let e of this._pluggables){let t={message:c,timestamp:Date.now()};e.pushLogs([t])}}log(...e){this._log(n.INFO,...e)}info(...e){this._log(n.INFO,...e)}warn(...e){this._log(n.WARN,...e)}error(...e){this._log(n.ERROR,...e)}debug(...e){this._log(n.DEBUG,...e)}verbose(...e){this._log(n.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===i.OU&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}s.LOG_LEVEL=null,s.BIND_ALL_LOG_LEVELS=!1},80865:(e,t,r)=>{"use strict";r.d(t,{o:()=>n});let n=URL},83261:(e,t,r)=>{"use strict";r.d(t,{p:()=>i});var n=r(93483);let i=(e,t=n.x)=>(r,n,i)=>{let{message:o,recoverySuggestion:s}=e[n];if(!r)throw new t({name:n,message:i?`${o} ${i}`:o,recoverySuggestion:s})}},86207:(e,t,r)=>{"use strict";r.d(t,{I:()=>l});var n=r(15279),i=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
376c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),o=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],s=function(){function e(){this.state=Int32Array.from(o),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw Error("Attempted to update an already finished hash.");var t=0,r=e.byteLength;if(this.bytesHashed+=r,8*this.bytesHashed>0x1fffffffffffff)throw Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=e[t++],r--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(t.setUint8(this.bufferLength++,128),r%64>=56){for(var n=this.bufferLength;n<64;n++)t.setUint8(n,0);this.hashBuffer(),this.bufferLength=0}for(var n=this.bufferLength;n<56;n++)t.setUint8(n,0);t.setUint32(56,Math.floor(e/0x100000000),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(32),n=0;n<8;n++)i[4*n]=this.state[n]>>>24&255,i[4*n+1]=this.state[n]>>>16&255,i[4*n+2]=this.state[n]>>>8&255,i[4*n+3]=this.state[n]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=0;h<64;h++){if(h<16)this.temp[h]=(255&e[4*h])<<24|(255&e[4*h+1])<<16|(255&e[4*h+2])<<8|255&e[4*h+3];else{var d=this.temp[h-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,g=((d=this.temp[h-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[h]=(f+this.temp[h-7]|0)+(g+this.temp[h-16]|0)}var p=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(l+(i[h]+this.temp[h]|0)|0)|0,y=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&n^r&o^n&o)|0;l=c,c=u,u=a,a=s+p|0,s=o,o=n,n=r,r=p+y|0}t[0]+=r,t[1]+=n,t[2]+=o,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=l},e}(),a=r(71390).hp,u=void 0!==a&&a.from?function(e){return a.from(e,"utf8")}:e=>new TextEncoder().encode(e);function c(e){return e instanceof Uint8Array?e:"string"==typeof e?u(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var l=function(){function e(e){this.secret=e,this.hash=new s,this.reset()}return e.prototype.update=function(e){if(!("string"==typeof e?0===e.length:0===e.byteLength)&&!this.error)try{this.hash.update(c(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,n.sH)(this,void 0,void 0,function(){return(0,n.YH)(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new s,this.secret){this.outer=new s;var e=function(e){var t=c(e);if(t.byteLength>64){var r=new s;r.update(t),t=r.digest()}var n=new Uint8Array(64);return n.set(t),n}(this.secret),t=new Uint8Array(64);t.set(e);for(var r=0;r<64;r++)e[r]^=54,t[r]^=92;this.hash.update(e),this.outer.update(t);for(var r=0;r<e.byteLength;r++)e[r]=0}},e}()},92265:(e,t,r)=>{"use strict";r.d(t,{M:()=>i});var n=r(75402);function i(e,t){if(t){let r=e?.find(e=>e===t);if(!r)throw n.jK;return r}{let t=e?.find(o)??e?.find(s),r=e?.find(u)??e?.find(a);if(t)return t;if(r)throw n.$6;throw n.RW}}let o=e=>e.startsWith(String(window.location.origin+(window.location.pathname||"/"))),s=e=>e.includes(String(window.location.hostname)),a=e=>e.startsWith("http://"),u=e=>e.startsWith("https://")},93483:(e,t,r)=>{"use strict";r.d(t,{x:()=>n});class n extends Error{constructor({message:e,name:t,recoverySuggestion:r,underlyingError:i,metadata:o}
3){if(super(e),this.name=t,this.underlyingError=i,this.recoverySuggestion=r,o){let{extendedRequestId:e,httpStatusCode:t,requestId:r}=o;this.metadata={extendedRequestId:e,httpStatusCode:t,requestId:r}}this.constructor=n,Object.setPrototypeOf(this,n.prototype)}}},94699:(e,t,r)=>{"use strict";let n={},i={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),n[e]=t,i[t]=e}},94839:(e,t,r)=>{"use strict";r.d(t,{ZL:()=>p});var n=r(98330),i=r(93483);class o extends i.x{constructor(){super({name:n.m.PlatformNotSupported,message:"Function not supported on current platform"})}}class s{constructor(e){this.storage=e}async setItem(e,t){if(!this.storage)throw new o;this.storage.setItem(e,t)}async getItem(e){if(!this.storage)throw new o;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new o;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new o;this.storage.clear()}}var a=r(80457);class u{constructor(){this.storage=new Map}get length(){return this.storage.size}key(e){return e>this.length-1?null:Array.from(this.storage.keys())[e]}setItem(e,t){this.storage.set(e,t)}getItem(e){return this.storage.get(e)??null}removeItem(e){this.storage.delete(e)}clear(){this.storage.clear()}}let c=new a.C("CoreStorageUtils"),l=()=>{try{if("undefined"!=typeof window&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw Error("sessionStorage is not defined")}catch(e){return c.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new u}};class h extends s{constructor(){super((()=>{try{if("undefined"!=typeof window&&window.localStorage)return window.localStorage}catch(e){c.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new u})())}}class d extends s{constructor(){super(l())}}class f{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new o;return this._storage}setItem(e,t){this.storage.setItem(e,t)}getItem(e){return this.storage.getItem(e)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}}class g extends f{constructor(){super(l())}}let p=new h;new d,new g,new s(new u)},97706:(e,t,r)=>{"use strict";r.d(t,{$:()=>z});var n,i,o,s,a=r(15781),u=r(14576),c=r(98243),l=r(15050),h=r(10480),d=r(19194),f=r(45598),g=r(80865),p=r(76186),y=r(7809),m=r(93483),w=r(56349);async function v(e){if(e.AccessToken){let t,r,n,i=(0,u.Cq)(e.AccessToken),o=1e3*(i.payload.iat||0),s=new Date().getTime();e.RefreshToken&&(r=e.RefreshToken),e.IdToken&&(t=(0,u.Cq)(e.IdToken)),e?.NewDeviceMetadata&&(n=e.NewDeviceMetadata);let a={accessToken:i,idToken:t,refreshToken:r,clockDrift:o>0?o-s:0,deviceMetadata:n,username:e.username};e?.signInDetails&&(a.signInDetails=e.signInDetails),await w.o.setTokens({tokens:a})}else throw new m.x({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}var I=r(17683);let A=async e=>{var t;let r=e.getConfig().Auth?.Cognito;(0,u.$y)(r);let n=await e.Auth.getTokens({forceRefresh:!1});(0,I.H0)(n);let{"cognito:username":i,sub:o}=n.idToken?.payload??{},s={username:i,userId:o},a=(t=n,t?.signInDetails);return a&&(s.signInDetails=a),s},S=async()=>A(a.H);var E=r(75402),C=r(27161);let b=async()=>{try{y.YZ.dispatch("auth",{event:"signedIn",data:await S()},"Auth",y.U9)}catch(e){if(e.name===E.zz)throw new C.l({name:E.yA,message:"Unable to get user session following successful sign-in.",recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."});throw e}};var T=r(99890),P=r(80457);!function(e){e.EmptySignInUsername="EmptySignInUsername",e.EmptySignInPassword="EmptySignInPassword",e.CustomAuthSignInPassword="CustomAuthSignInPassword",e.EmptySignUpUsername="EmptySignUpUsername",e.EmptySignUpPassword="EmptySignUpPassword",e.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",e.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",e.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",e.EmptyChallengeResponse="EmptyChallengeResponse",e.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",e.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",e.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",e.EmptyResetPasswordUsername="EmptyResetPasswordUsername",e.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",e.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",e.IncorrectMFAMethod="IncorrectMFAMethod",e.EmptyUpdatePassword="EmptyUpdatePassword"}(n||(n={})),n.EmptyChallengeResponse,n.EmptyConfirmResetPasswordUsername,n.EmptyConfirmSignUpCode,n.EmptyConfirmSignUpUsername,n.EmptyConfirmResetPasswordConfirmationCode,n.EmptyConfirmResetPasswordNewPassword,n.EmptyResendSignUpCodeUsername,n.EmptyResetPasswordUsername,n.EmptySignInPassword,n.EmptySignInUsername,n.EmptySignUpPassword,n.EmptySignUpUsername,n.CustomAuthSignInPassword,n.IncorrectMFAMethod,n.EmptyVerifyTOTPSetupCode,n.EmptyUpdatePassword,n.EmptyConfirmUserAttributeCode,function(e){e.DEFAULT_MSG="Authentication
3Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in",e.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings"}(i||(i={})),function(e){e.SignInException="SignInException",e.OAuthSignInError="OAuthSignInException"}(o||(o={})),new P.C("AuthError");let _={oauthSignInError:{message:i.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:i.DEFAULT_MSG,log:` 4 Error: Amplify has not been configured correctly. 5 This error is typically caused by one of the following scenarios: 6 7 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point 8 See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information 9 10 2. There might be multiple conflicting versions of amplify packages in your node_modules. 11 Refer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) 12 `},missingAuthConfig:{message:i.DEFAULT_MSG,log:` 13 Error: Amplify has not been configured correctly. 14 The configuration object is missing required auth properties. 15 This error is typically caused by one of the following scenarios: 16 17 1. Did you run \`amplify push\` after adding auth via \`amplify add auth\`? 18 See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information 19 20 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages. 21 `},emptyUsername:{message:i.EMPTY_USERNAME},invalidUsername:{message:i.INVALID_USERNAME},emptyPassword:{message:i.EMPTY_PASSWORD},emptyCode:{message:i.EMPTY_CODE},signUpError:{message:i.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:i.NO_MFA},invalidMFA:{message:i.INVALID_MFA},emptyChallengeResponse:{message:i.EMPTY_CHALLENGE},noUserSession:{message:i.NO_USER_SESSION},deviceConfig:{message:i.DEVICE_CONFIG},networkError:{message:i.NETWORK_ERROR},autoSignInError:{message:i.AUTOSIGNIN_ERROR},default:{message:i.DEFAULT_MSG}},k=(e,t)=>new C.l({message:e??"An error has occurred during the oauth process.",name:o.OAuthSignInError,recoverySuggestion:t??_.oauthSignInError.log});!function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError",e.OAuthSignInError="oauthSignInError"}(s||(s={}));let R=async e=>{let t=await f.f.loadOAuthState(),r=e===t?t:void 0;if(!r)throw new C.l({name:s.OAuthSignInError,message:null===e?"`signInWithRedirect` has been canceled.":"An error occurred while validating the state.",recoverySuggestion:null===e?void 0:"Try to initiate an OAuth flow from Amplify"});return r},O=async({currentUrl:e,userAgentValue:t,clientId:r,redirectUri:n,responseType:i,domain:o,preferPrivateSession:s})=>{let a=new g.o(e),u=a.searchParams.get("error"),c=a.searchParams.get("error_description");if(u)throw k(c??u);return"code"===i?U({currentUrl:e,userAgentValue:t,clientId:r,redirectUri:n,domain:o,preferPrivateSession:s}):x({currentUrl:e,redirectUri:n,preferPrivateSession:s})},U=async({currentUrl:e,userAgentValue:t,clientId:r,redirectUri:n,domain:i,preferPrivateSession:o})=>{let s=new g.o(e),a=s.searchParams.get("code"),c=s.searchParams.get("state");if(!a||!c)throw k("User cancelled OAuth flow.");let l=await R(c),h=await f.f.loadPKCE(),d=Object.entries({grant_type:"authorization_code",code:a,client_id:r,redirect_uri:n,...h?{code_verifier:h}:{}}
21).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&"),{access_token:y,refresh_token:m,id_token:w,error:I,error_message:A,token_type:S,expires_in:E}=await (await fetch("https://"+i+"/oauth2/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[p.YJ]:t},body:d})).json();if(I)throw k(A??I);let C=(y&&(0,u.Cq)(y).payload.username)??"username";return await v({username:C,AccessToken:y,IdToken:w,RefreshToken:m}),M({redirectUri:n,state:l,preferPrivateSession:o})},x=async({currentUrl:e,redirectUri:t,preferPrivateSession:r})=>{let{id_token:n,access_token:i,state:o,token_type:s,expires_in:a,error_description:c,error:l}=(new g.o(e).hash??"#").substring(1).split("&").map(e=>e.split("=")).reduce((e,[t,r])=>({...e,[t]:r}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(l)throw k(c??l);if(!i)throw k("No access token returned from OAuth flow.");let h=await R(o),d=(i&&(0,u.Cq)(i).payload.username)??"username";return await v({username:d,AccessToken:i,IdToken:n}),M({redirectUri:t,state:h,preferPrivateSession:r})},M=async({redirectUri:e,state:t,preferPrivateSession:r})=>{await w.o.setOAuthMetadata({oauthSignIn:!0}),await f.f.clearOAuthData(),await f.f.storeOAuthSignIn(!0,r),(0,T.i)(),D(e),N(t)&&y.YZ.dispatch("auth",{event:"customOAuthState",data:(L(t).match(/.{2}/g)||[]).map(e=>String.fromCharCode(parseInt(e,16))).join("")},"Auth",y.U9),y.YZ.dispatch("auth",{event:"signInWithRedirect"},"Auth",y.U9),await b()},N=e=>/-/.test(e),L=e=>e.split("-").splice(1).join("-"),D=e=>{"undefined"!=typeof window&&void 0!==window.history&&window.history.replaceState(window.history.state,"",e)};var K=r(92265);let V=async e=>{(0,T.i)(),await f.f.clearOAuthInflightData(),y.YZ.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:e}},"Auth",y.U9)},$=async e=>{try{(0,u.$y)(e),(0,u.G6)(e),f.f.setAuthConfig(e)}catch(e){return}if(await f.f.loadOAuthInFlight())try{let t=window.location.href,{loginWith:r,userPoolClientId:n}=e,{domain:i,redirectSignIn:o,responseType:s}=r.oauth,a=(0,K.M)(o);await O({currentUrl:t,clientId:n,domain:i,redirectUri:a,responseType:s,userAgentValue:(0,d.A)(l.BM.SignInWithRedirect)})}catch(e){await V(e)}};(0,c.B)()&&a.H[h.$]($);let B={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"};var j=r(51777),G=r(86207);async function F(){let e;try{e=await S()}catch(e){}if(e&&e.userId&&e.username)throw new C.l({name:E.z0,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})}var Y=r(36970);let W={convert(e,t={urlSafe:!1,skipPadding:!1}){let r="string"==typeof e?e:Array.from(e,e=>String.fromCodePoint(e)).join(""),n=(0,Y.xA)()(r);return t.urlSafe&&(n=n.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(n=n.replace(/=/g,"")),n}},q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";async function z(e){let t=a.H.getConfig().Auth?.Cognito;(0,u.$y)(t),(0,u.G6)(t),f.f.setAuthConfig(t),await F();let r="COGNITO";return"string"==typeof e?.provider?r=B[e.provider]:e?.provider?.custom&&(r=e.provider.custom),H({oauthConfig:t.loginWith.oauth,clientId:t.userPoolClientId,provider:r,customState:e?.customState,preferPrivateSession:e?.options?.preferPrivateSession,options:{loginHint:e?.options?.loginHint,lang:e?.options?.lang,nonce:e?.options?.nonce}})}let H=async({oauthConfig:e,provider:t,clientId:r,customState:n,preferPrivateSession:i,options:o})=>{let{domain:s,redirectSignIn:a,responseType:u,scopes:h}=e,{loginHint:g,lang:p,nonce:y}=o??{},m=(e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[],n=new Uint8Array(e);for(let e of((0,Y.MY)().getRandomValues(n),n))r.push(t[e%t.length]);return r.join("")})(32),w=n?`${m}-${n.split("").map(e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("")}`:m,{value:v,method:I,toCodeChallenge:A}=(e=>{let t,r=new Uint8Array(e);(0,Y.MY)().getRandomValues(r);let n="";for(let e of r)n+=q.charAt(e%q.length);return{value:n,method:"S256",toCodeChallenge:()=>t||(t=function(e){let t=new G.I;return t.update(e),W.convert(t.digestSync(),{urlSafe:!0}).replace(/=/g,"")}(n))}})(128),S=(0,K.M)(e.redirectSignIn);(0,c.B)()&&f.f.storeOAuthInFlight(!0),f.f.storeOAuthState(w),f.f.storePKCE(v);let E=Object.entries({redirect_uri:S,response_type:u,client_id:r,identity_provider:t,scope:h.join(" "),...g&&{login_hint:g},...p&&{lang:p},...y&&{nonce:y},state:w,..."code"===u&&{code_challenge:A(),code_challenge_method:I}}).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&"),C=`https://${s}/oauth2/authorize?${E}`;(e=>{async function t(r){if(r.persisted&&await e.loadOAuthInFlight()){let e=k("User cancelled OAuth flow.");await V(e)}window.removeEventListener("pageshow",t)}window.addEventListener("pageshow",t)})(f.f);let{type:b,error:T,url:P}=await (0,j.z)(C)??{};try{if("error"===b)throw k(String(T));"success"===b&&P&&await O({currentUrl:P,clientId:r,domain:s,redirectUri:S,responseType:u,userAgentValue:(0,d.A)(l.BM.SignInWithRedirect),preferPrivateSession:i})}catch(e){throw await V(e),e}}},98243:(e,t,r)=>{"use strict";r.d(t,{B:()=>n});let n=()=>"undefined"!=typeof window&&void 0!==window.document},98330:(e,t,r)=>{"use strict";var n;r.d(t,{m:()=>n}),function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"}(n||(n={}))},99150:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});
21class n extends Error{}function i(e,t){let r;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),o=e.split(".")[i];if("string"!=typeof o)throw new n(`Invalid token specified: missing part #${i+1}`);try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var r;return r=t,decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(e){return atob(t)}}(o)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new n(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"},99890:(e,t,r)=>{"use strict";r.d(t,{I:()=>i,i:()=>o});let n=[],i=e=>{n.push(e)},o=()=>{for(;n.length;)n.pop()?.()}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.