1/*! For license information please see component---src-pages-book-a-guide-js-cab5f5d1914d6b6f6bec.js.LICENSE.txt */ 2(self.webpackChunkguidesly_marketplace=self.webpackChunkguidesly_marketplace||[]).push([[2289,8293],{99443:function(e,t,n){"use strict";n.d(t,{N:function(){return H}});var r=n(15215),i=n(22924),o=n(34549),a=n(78868),s=n(17467),c=n(71805),u=n(3976),l=n(92685),d=n(54769),f=n(64988),p=n(32658),h=n(88319),v=n(16807),g=n(18025),m=n(88835),y=function(e){var t=window.open(e,"_self");return t?Promise.resolve(t):Promise.reject()},b=n(48287),_=n(37070),E=n(35166);function w(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function S(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var T=64,I=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),N=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],A=Math.pow(2,53)-1,C=function(){function e(){this.state=Int32Array.from(N),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>A)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===T&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%T>=56){for(var r=this.bufferLength;r<T;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=0;l<T;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(f+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var h=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&s^~a&c)|0)+(u+(I[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;u=c,c=s,s=a,a=o+h|0,o=i,i=r,r=n,n=h+v|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=a,t[5]+=s,t[6]+=c,t[7]+=u},e}();var O="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function k(e){return e instanceof Uint8Array?e:"string"==typeof e?O(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var D=function(){function e(e){this.secret=e,this.hash=new C,this.reset()}return e.prototype.update=function(e){var t;if(("string"==typeof(t=e)?0!==t.length:0!==t.byteLength)&&!this.error)try{this.hash.update(k(e))}catch(n){this.error=n}},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 w(this,void 0,void 0,(function(){return S(this,(function(e){return[2,this.digestSync()]}))}))},e.prototype.reset=function(){if(this.hash=new C,this.secret){this.outer=new C;var e=function(e){var t=k(e);if(t.byteLength>T){var n=new C;n.update(t),t=n.digest()}
2var r=new Uint8Array(T);return r.set(t),r}(this.secret),t=new Uint8Array(T);t.set(e);for(var n=0;n<T;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}();var R="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",P=function(e,t,n){a.Y.dispatch("auth",{event:e,data:t,message:n},"Auth",R)},x=new o.C("OAuth"),M=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||y,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},e.prototype.oauthSignIn=function(e,t,n,o,a,s){void 0===e&&(e="code"),void 0===a&&(a=i.qB.Cognito);var c=this._generateState(32),u=s?c+"-"+(0,p.r)(s):c;!function(e){window.sessionStorage.setItem("oauth_state",e)}(u);var l,d=this._generateRandom(128);l=d,window.sessionStorage.setItem("ouath_pkce_key",l);var f=this._generateChallenge(d),h=this._scopes.join(" "),v="https://"+t+"/oauth2/authorize?"+Object.entries((0,r.__assign)((0,r.__assign)({redirect_uri:n,response_type:e,client_id:o,identity_provider:a,scope:h,state:u},"code"===e?{code_challenge:f}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map((function(e){var t=(0,r.__read)(e,2),n=t[0],i=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(i)})).join("&");x.debug("Redirecting to "+v),this._urlOpener(v,n)},e.prototype._handleCodeFlow=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,o,a,s,u,l,d,f,p,h,v,g,y,b,w;return(0,r.__generator)(this,(function(S){switch(S.label){case 0:return t=((0,m.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,i=(0,r.__read)(t,2),o=i[0],a=i[1];return(0,r.__assign)((0,r.__assign)({},e),((n={})[o]=a,n))}),{code:void 0}).code,n=(0,m.parse)(e).pathname||"/",o=(0,m.parse)(this._config.redirectSignIn).pathname||"/",t&&n===o?(a="https://"+this._config.domain+"/oauth2/token",P("codeFlow",{},"Retrieving tokens from "+a),s=(0,i.fz)(this._config)?this._cognitoClientId:this._config.clientID,u=(0,i.fz)(this._config)?this._config.redirectSignIn:this._config.redirectUri,T=window.sessionStorage.getItem("ouath_pkce_key"),window.sessionStorage.removeItem("ouath_pkce_key"),l=T,d=(0,r.__assign)({grant_type:"authorization_code",code:t,client_id:s,redirect_uri:u},l?{code_verifier:l}:{}),x.debug("Calling token endpoint: "+a+" with",d),f=Object.entries(d).map((function(e){var t=(0,r.__read)(e,2),n=t[0],i=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(i)})).join("&"),p={category:_.b7.Auth,action:_.BM.FederatedSignIn},[4,fetch(a,{method:"POST",headers:(w={"Content-Type":"application/x-www-form-urlencoded"},w[E.Y]=(0,c.fE)(p),w),body:f})]):[2];case 1:return[4,S.sent().json()];case 2:if(h=S.sent(),v=h.access_token,g=h.refresh_token,y=h.id_token,b=h.error)throw new Error(b);return[2,{accessToken:v,refreshToken:g,idToken:y}]}var T}))}))},e.prototype._handleImplicitFlow=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,i;return(0,r.__generator)(this,(function(o){return t=((0,m.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,i=(0,r.__read)(t,2),o=i[0],a=i[1];return(0,r.__assign)((0,r.__assign)({},e),((n={})[o]=a,n))}),{id_token:void 0,access_token:void 0}),n=t.id_token,i=t.access_token,P("implicitFlow",{},"Got tokens from "+e),x.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:i,idToken:n,refreshToken:null}]}))}))},e.prototype.handleAuthResponse=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,o,a,s,c;return(0,r.__generator)(this,(function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),t=e?(0,r.__assign)((0,r.__assign)({},((0,m.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=(0,r.__read)(t,2),i=n[0],o=n[1];return e[i]=o,e}),{})),((0,m.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=(0,r.__read)(t,2),i=n[0],o=n[1];return e[i]=o,e}),{})):{},n=t.error,i=t.error_description,n)throw new Error(i);
2return o=this._validateState(t),x.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(a=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,r.__assign.apply(void 0,[r.__assign.apply(void 0,a.concat([u.sent()])),{state:o}])];case 2:return s=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,r.__assign.apply(void 0,[r.__assign.apply(void 0,s.concat([u.sent()])),{state:o}])];case 4:return[3,6];case 5:throw c=u.sent(),x.debug("Error handling auth response.",c),c;case 6:return[2]}}))}))},e.prototype._validateState=function(e){if(e){var t,n=(t=window.sessionStorage.getItem("oauth_state"),window.sessionStorage.removeItem("oauth_state"),t),r=e.state;if(n&&n!==r)throw new Error("Invalid state in OAuth flow");return r}},e.prototype.signOut=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t,n;return(0,r.__generator)(this,(function(o){return e="https://"+this._config.domain+"/logout?",t=(0,i.fz)(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=(0,i.fz)(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map((function(e){var t=(0,r.__read)(e,2);return t[0]+"="+t[1]})).join("&"),P("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),x.debug("Signing out from "+e),[2,this._urlOpener(e,n)]}))}))},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(61*Math.random())];return t},e.prototype._generateChallenge=function(e){var t=new D;t.update(e);var n=t.digestSync(),r=b.Buffer.from(n).toString("base64");return this._base64URL(r)},e.prototype._base64URL=function(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!=typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var n=0;n<e;n+=1)t[n]=66*Math.random()|0;return this._bufferToString(t)},e.prototype._bufferToString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<e.byteLength;r+=1){var i=e[r]%62;n.push(t[i])}return n.join("")},e}(),L=n(27314),U=new o.C("AuthError"),F=function(e){function t(n){var r=this,i=B[n],o=i.message,a=i.log;return(r=e.call(this,o)||this).constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="AuthError",r.log=a||o,U.error(r.log),r}return(0,r.__extends)(t,e),t}(Error),j=function(e){function t(n){var r=e.call(this,n)||this;return r.constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="NoUserPoolError",r}return(0,r.__extends)(t,e),t}(F),B={noConfig:{message:L.f.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly.\n This error is typically caused by one of the following scenarios:\n\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n \n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n "},missingAuthConfig:{message:L.f.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly. \n The configuration object is missing required auth properties.\n This error is typically caused by one of the following scenarios:\n\n 1. Did you run `amplify push` after adding auth via `amplify add auth`?\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n 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.\n "},emptyUsername:{message:L.f.EMPTY_USERNAME},invalidUsername:{message:L.f.INVALID_USERNAME},emptyPassword:{message:L.f.EMPTY_PASSWORD},emptyCode:{message:L.f.EMPTY_CODE},signUpError:{message:L.f.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:L.f.NO_MFA},invalidMFA:{message:L.f.INVALID_MFA},emptyChallengeResponse:{message:L.f.EMPTY_CHALLENGE},noUserSession:{message:L.f.NO_USER_SESSION},deviceConfig:{message:L.f.DEVICE_CONFIG}
2,networkError:{message:L.f.NETWORK_ERROR},autoSignInError:{message:L.f.AUTOSIGNIN_ERROR},default:{message:L.f.DEFAULT_MSG}},V=new o.C("AuthClass"),G="aws.cognito.signin.user.admin",q="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Y=function(e,t,n){a.Y.dispatch("auth",{event:e,data:t,message:n},"Auth",q)},K=function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.autoSignInInitiated=!1,this.inflightSessionPromise=null,this.inflightSessionPromiseCounter=0,this.Credentials=s.J,this.wrapRefreshSessionCallback=function(e){return function(t,n){return n?Y("tokenRefresh",void 0,"New token retrieved"):Y("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,n)}},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),a.Y.listen("auth",(function(e){switch(e.payload.event){case"verify":case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}})),(0,g.mX)(),(0,g.An)(c.OD.framework),c.OD.observeFrameworkChanges((function(){(0,g.An)(c.OD.framework)}))}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};V.debug("configure Auth");var n=Object.assign({},this._config,(0,u.s)(e).Auth,e);this._config=n;var r=this._config,o=r.userPoolId,a=r.userPoolWebClientId,s=r.cookieStorage,c=r.oauth,p=r.region,h=r.identityPoolId,g=r.mandatorySignIn,m=r.refreshHandlers,y=r.identityPoolRegion,b=r.clientMetadata,_=r.endpoint,E=r.storage;if(E){if(!this._isValidAuthStorage(E))throw V.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=E}else this._storage=s?new v.W6(s):e.ssr?new l.l:(new d.i).getStorage();if(this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),o){var w={UserPoolId:o,ClientId:a,endpoint:_};w.Storage=this._storage,this.userPool=new v.NE(w,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:g,region:p,userPoolId:o,identityPoolId:h,refreshHandlers:m,storage:this._storage,identityPoolRegion:y});var S=c?(0,i.fz)(this._config.oauth)?c:c.awsCognito:void 0;if(S){var T=Object.assign({cognitoClientId:a,UserPoolId:o,domain:S.domain,scopes:S.scope,redirectSignIn:S.redirectSignIn,redirectSignOut:S.redirectSignOut,responseType:S.responseType,Storage:this._storage,urlOpener:S.urlOpener,clientMetadata:b},S.options);this._oAuthHandler=new M({scopes:T.scopes,config:T,cognitoClientId:T.cognitoClientId});var I={};!function(e){if((0,f.gy)().isBrowser&&window.location)e({url:window.location.href});else if(!(0,f.gy)().isNode)throw new Error("Not supported")}((function(e){var n=e.url;I[n]||(I[n]=!0,t._handleAuthResponse(n))}))}(Y("configured",null,"The Auth category has been configured successfully"),this.autoSignInInitiated||"function"!=typeof this._storage.getItem)||(this.isTrueStorageValue("amplify-polling-started")&&(Y("autoSignIn_failure",null,i.Wo.AutoSignInError),this._storage.removeItem("amplify-auto-sign-in")),this._storage.removeItem("amplify-polling-started"));return this._config},e.prototype.signUp=function(e){for(var t,n,r,o=this,a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];if(!this.userPool)return this.rejectNoUserPool();var c,u=null,l=null,d=[],f=null,p={enabled:!1},h={},g={};if(e&&"string"==typeof e){u=e,l=a?a[0]:null;var m=a?a[1]:null,y=a?a[2]:null;m&&d.push(new v.HB({Name:"email",Value:m})),y&&d.push(new v.HB({Name:"phone_number",Value:y}))}else{if(!e||"object"!=typeof e)return this.rejectAuthError(i.Wo.SignUpError);u=e.username,l=e.password,e&&e.clientMetadata?c=e.clientMetadata:this._config.clientMetadata&&(c=this._config.clientMetadata);var b=e.attributes;b&&Object.keys(b).map((function(e){d.push(new v.HB({Name:e,Value:b[e]}))}));var _=e.validationData;_&&(f=[],Object.keys(_).map((function(e){f.push(new v.HB({Name:e,Value:_[e]}))}))),(p=null!==(t=e.autoSignIn)&&void 0!==t?t:{enabled:!1}).enabled&&(this._storage.setItem("amplify-auto-sign-in","true"),h=null!==(n=p.validationData)&&void 0!==n?n:{},g=null!==(r=p.clientMetaData)&&void 0!==r?r:{})}return u?l?(V.debug("signUp attrs:",d),V.debug("signUp validation data:",f),new Promise((function(e,t){o.userPool.signUp(u,l,d,f,(function(n,r){n?(Y("signUp_failure",n,u+" failed to signup"),t(n)):(Y("signUp",r,u+" has signed up successfully"),p.enabled&&o.handleAutoSignIn(u,l,h,g,r),e(r))}),c)}))):this.rejectAuthError(i.Wo.EmptyPassword):this.rejectAuthError(i.Wo.EmptyUsername)}
2,e.prototype.handleAutoSignIn=function(e,t,n,r,i){this.autoSignInInitiated=!0;var o=new v.By({Username:e,Password:t,ValidationData:n,ClientMetadata:r});i.userConfirmed?this.signInAfterUserConfirmed(o):"link"===this._config.signUpVerificationMethod?this.handleLinkAutoSignIn(o):this.handleCodeAutoSignIn(o)},e.prototype.handleCodeAutoSignIn=function(e){var t=this,n=function(r){"confirmSignUp"===r.payload.event&&t.signInAfterUserConfirmed(e,n)};a.Y.listen("auth",n)},e.prototype.handleLinkAutoSignIn=function(e){var t=this;this._storage.setItem("amplify-polling-started","true");var n=Date.now(),r=setInterval((function(){Date.now()-n>18e4?(clearInterval(r),Y("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),t._storage.removeItem("amplify-auto-sign-in")):t.signInAfterUserConfirmed(e,null,r)}),5e3)},e.prototype.signInAfterUserConfirmed=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,(function(){var i,o,s=this;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:i=this.createCognitoUser(e.getUsername()),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.authenticateUser(e,this.authCallbacks(i,(function(r){Y("autoSignIn",r,e.getUsername()+" has signed in successfully"),t&&a.Y.remove("auth",t),n&&(clearInterval(n),s._storage.removeItem("amplify-polling-started")),s._storage.removeItem("amplify-auto-sign-in")}),(function(e){V.error(e),s._storage.removeItem("amplify-auto-sign-in")})))];case 2:return r.sent(),[3,4];case 3:return o=r.sent(),V.error(o),[3,4];case 4:return[2]}}
2))}))},e.prototype.confirmSignUp=function(e,t,n){var r=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.Wo.EmptyUsername);if(!t)return this.rejectAuthError(i.Wo.EmptyCode);var o,a=this.createCognitoUser(e),s=!n||"boolean"!=typeof n.forceAliasCreation||n.forceAliasCreation;return n&&n.clientMetadata?o=n.clientMetadata:this._config.clientMetadata&&(o=this._config.clientMetadata),new Promise((function(n,c){a.confirmRegistration(t,s,(function(t,o){t?c(t):(Y("confirmSignUp",o,e+" has been confirmed successfully"),r.isTrueStorageValue("amplify-auto-sign-in")&&!r.autoSignInInitiated&&(Y("autoSignIn_failure",null,i.Wo.AutoSignInError),r._storage.removeItem("amplify-auto-sign-in")),n(o))}),o)}))},e.prototype.isTrueStorageValue=function(e){var t=this._storage.getItem(e);return!!t&&"true"===t},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.Wo.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(e,r){n.resendConfirmationCode((function(t,n){t?r(t):e(n)}),t)}))},e.prototype.signIn=function(e,t,n){if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var r=null,o=null,a={};if("string"==typeof e)r=e,o=t;else{if(!(0,i.O9)(e))return this.rejectAuthError(i.Wo.InvalidUsername);void 0!==t&&V.warn("The password should be defined under the first parameter object!"),r=e.username,o=e.password,a=e.validationData}if(!r)return this.rejectAuthError(i.Wo.EmptyUsername);var s=new v.By({Username:r,Password:o,ValidationData:a,ClientMetadata:n});return o?this.signInWithPassword(s):this.signInWithoutPassword(s)},e.prototype.authCallbacks=function(e,t,n){var i=this,o=this;return{onSuccess:function(a){return(0,r.__awaiter)(i,void 0,void 0,(function(){var i,s,c,u;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:V.debug(a),delete e.challengeName,delete e.challengeParam,r.label=1;case 1:return r.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return r.sent(),[4,this.Credentials.set(a,"session")];case 3:return i=r.sent(),V.debug("succeed to get cognito credentials",i),[3,9];case 4:return s=r.sent(),V.debug("cannot get cognito credentials",s),[3,9];case 5:return r.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return c=r.sent(),o.user=c,Y("signIn",c,"A user "+e.getUsername()+" has been signed in"),t(c),[3,8];case 7:return u=r.sent(),V.error("Failed to get the signed in user",u),n(u),[3,8];case 8:return[7];case 9:return[2]}}
2))}))},onFailure:function(t){V.debug("signIn failure",t),Y("signIn_failure",t,e.getUsername()+" failed to signin"),n(t)},customChallenge:function(n){V.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=n,t(e)},mfaRequired:function(n,r){V.debug("signIn MFA required"),e.challengeName=n,e.challengeParam=r,t(e)},mfaSetup:function(n,r){V.debug("signIn mfa setup",n),e.challengeName=n,e.challengeParam=r,t(e)},newPasswordRequired:function(n,r){V.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:n,requiredAttributes:r},t(e)},totpRequired:function(n,r){V.debug("signIn totpRequired"),e.challengeName=n,e.challengeParam=r,t(e)},selectMFAType:function(n,r){V.debug("signIn selectMFAType",n),e.challengeName=n,e.challengeParam=r,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var n=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise((function(r,i){n.authenticateUser(e,t.authCallbacks(n,(function(e){t.pendingSignIn=null,r(e)}),(function(e){t.pendingSignIn=null,i(e)})))})),this.pendingSignIn},e.prototype.signInWithoutPassword=function(e){var t=this,n=this.createCognitoUser(e.getUsername());return n.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise((function(r,i){n.initiateAuth(e,t.authCallbacks(n,r,i))}))},e.prototype.getMFAOptions=function(e){return new Promise((function(t,n){e.getMFAOptions((function(e,r){if(e)return V.debug("get MFA Options failed",e),void n(e);V.debug("get MFA options success",r),t(r)}))}))},e.prototype.getPreferredMFA=function(e,t){var n=this,i=this;return new Promise((function(o,a){var s=n._config.clientMetadata,c=!!t&&t.bypassCache;e.getUserData((function(t,s){return(0,r.__awaiter)(n,void 0,void 0,(function(){var n,c;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!t)return[3,5];if(V.debug("getting preferred mfa failed",t),!this.isSessionInvalid(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),a(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return a(t),[2];case 5:return(c=i._getMfaTypeFromUserData(s))?(o(c),[2]):(a("invalid MFA Type"),[2])}}))}))}),{bypassCache:c,clientMetadata:s})}))},e.prototype._getMfaTypeFromUserData=function(e){var t=null,n=e.PreferredMfaSetting;if(n)t=n;else{var r=e.UserMFASettingList;if(r)0===r.length?t="NOMFA":V.debug("invalid case for getPreferredMFA",e);else t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){var n=this;return new Promise((function(i,o){e.getUserData((function(t,a){return(0,r.__awaiter)(n,void 0,void 0,(function(){var n;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!t)return[3,5];if(V.debug("getting user data failed",t),!this.isSessionInvalid(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),o(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return o(t),[2];case 5:i(a),r.label=6;case 6:return[2]}}
2))}))}),t)}))},e.prototype.setPreferredMFA=function(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function(){var n,o,a,s,c,u,l=this;return(0,r.__generator)(this,(function(d){switch(d.label){case 0:return n=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:n})];case 1:switch(o=d.sent(),a=null,s=null,t){case"TOTP":case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return s={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return a={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return c=o.UserMFASettingList,[4,this._getMfaTypeFromUserData(o)];case 5:if("NOMFA"===(u=d.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===u)a={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==u)return[2,this.rejectAuthError(i.Wo.InvalidMFA)];s={PreferredMfa:!1,Enabled:!1}}return c&&0!==c.length&&c.forEach((function(e){"SMS_MFA"===e?a={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(s={PreferredMfa:!1,Enabled:!1})})),[3,7];case 6:return V.debug("no validmfa method provided"),[2,this.rejectAuthError(i.Wo.NoMFA)];case 7:return this,[2,new Promise((function(t,i){e.setUserMfaPreference(a,s,(function(o,a){if(o)return V.debug("Set user mfa preference error",o),i(o);V.debug("Set user mfa success",a),V.debug("Caching the latest user data into local"),e.getUserData((function(n,o){return(0,r.__awaiter)(l,void 0,void 0,(function(){var o;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!n)return[3,5];if(V.debug("getting user data failed",n),!this.isSessionInvalid(n))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return r.sent(),[3,4];case 3:return o=r.sent(),i(new Error("Session is invalid due to: "+n.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return[2,i(n)];case 5:return[2,t(a)]}}))}))}),{bypassCache:!0,clientMetadata:n})}))}))]}}))}))},e.prototype.disableSMS=function(e){return new Promise((function(t,n){e.disableMFA((function(e,r){if(e)return V.debug("disable mfa failed",e),void n(e);V.debug("disable mfa succeed",r),t(r)}))}))},e.prototype.enableSMS=function(e){return new Promise((function(t,n){e.enableMFA((function(e,r){if(e)return V.debug("enable mfa failed",e),void n(e);V.debug("enable mfa succeed",r),t(r)}))}))},e.prototype.setupTOTP=function(e){return new Promise((function(t,n){e.associateSoftwareToken({onFailure:function(e){V.debug("associateSoftwareToken failed",e),n(e)},associateSecretCode:function(e){V.debug("associateSoftwareToken success",e),t(e)}})}))},e.prototype.verifyTotpToken=function(e,t){var n;V.debug("verification totp token",e,t),e&&"function"==typeof e.getSignInUserSession&&(n=e.getSignInUserSession());var r=null==n?void 0:n.isValid();return new Promise((function(n,i){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){V.debug("verifyTotpToken failed",e),i(e)},onSuccess:function(t){r||Y("signIn",e,"A user "+e.getUsername()+" has been signed in"),Y("verify",e,"A user "+e.getUsername()+" has been verified"),V.debug("verifyTotpToken success",t),n(t)}})}))},e.prototype.confirmSignIn=function(e,t,n,o){var a=this;if(void 0===o&&(o=this._config.clientMetadata),!t)return this.rejectAuthError(i.Wo.EmptyCode);var s=this;return new Promise((function(i,c){e.sendMFACode(t,{onSuccess:function(t){return(0,r.__awaiter)(a,void 0,void 0,(function(){var n,o,a,c;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:V.debug(t),r.label=1;case 1:return r.trys.push([1,4,5,10]),[4,this.Credentials.clear()];case 2:return r.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=r.sent(),V.debug("succeed to get cognito credentials",n),[3,10];case 4:return o=r.sent(),V.debug("cannot get cognito credentials",o),[3,10];case 5:s.user=e,r.label=6;case 6:return r.trys.push([6,8,,9]),[4,this.currentUserPoolUser()];case 7:return a=r.sent(),e.attributes=a.attributes,[3,9];case 8:return c=r.sent(),V.debug("cannot get updated Cognito User",c),[3,9];case 9:return Y("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 10:return[2]}}
2))}))},onFailure:function(e){V.debug("confirm signIn failure",e),c(e)}},n,o)}))},e.prototype.completeNewPassword=function(e,t,n,o){var a=this;if(void 0===n&&(n={}),void 0===o&&(o=this._config.clientMetadata),!t)return this.rejectAuthError(i.Wo.EmptyPassword);var s=this;return new Promise((function(i,c){e.completeNewPasswordChallenge(t,n,{onSuccess:function(t){return(0,r.__awaiter)(a,void 0,void 0,(function(){var n,o;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:V.debug(t),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return r.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=r.sent(),V.debug("succeed to get cognito credentials",n),[3,6];case 4:return o=r.sent(),V.debug("cannot get cognito credentials",o),[3,6];case 5:return s.user=e,Y("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 6:return[2]}}))}))},onFailure:function(e){V.debug("completeNewPassword failure",e),Y("completeNewPassword_failure",e,a.user+" failed to complete the new password flow"),c(e)},mfaRequired:function(t,n){V.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=n,i(e)},mfaSetup:function(t,n){V.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)},totpRequired:function(t,n){V.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)}},o)}))},e.prototype.sendCustomChallengeAnswer=function(e,t,n){var r=this;if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!t)return this.rejectAuthError(i.Wo.EmptyChallengeResponse);return new Promise((function(i,o){e.sendCustomChallengeAnswer(t,r.authCallbacks(e,i,o),n)}))},e.prototype.deleteUserAttributes=function(e,t){var n=this;return new Promise((function(r,i){n.userSession(e).then((function(n){e.deleteAttributes(t,(function(e,t){return e?i(e):r(t)}))}))}))},e.prototype.deleteUser=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t,n=this;return(0,r.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._storageSync];case 1:return i.sent(),[3,3];case 2:throw e=i.sent(),V.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return t=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise((function(e,i){return(0,r.__awaiter)(n,void 0,void 0,(function(){var n,o=this;return(0,r.__generator)(this,(function(a){if(this.userPool){if(!(n=this.userPool.getCurrentUser()))return V.debug("Failed to get user from user pool"),[2,i(new Error("No current user."))];n.getSession((function(a,s){return(0,r.__awaiter)(o,void 0,void 0,(function(){var o,s=this;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!a)return[3,5];if(V.debug("Failed to get the user session",a),!this.isSessionInvalid(a))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(n)];case 2:return r.sent(),[3,4];case 3:return o=r.sent(),i(new Error("Session is invalid due to: "+a.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return[2,i(a)];case 5:n.deleteUser((function(r,o){if(r)i(r);else{Y("userDeleted",o,"The authenticated user has been deleted."),n.signOut(),s.user=null;try{s.cleanCachedItems()}catch(a){V.debug("failed to clear cached items")}t?s.oAuthSignOutRedirect(e,i):(Y("signOut",s.user,"A user has been signed out"),e(o))}})),r.label=6;case 6:return[2]}}
2))}))}))}else V.debug("no Congito User pool"),i(new Error("Cognito User pool does not exist"));return[2]}))}))}))]}}))}))},e.prototype.updateUserAttributes=function(e,t,n){var r=this;void 0===n&&(n=this._config.clientMetadata);var i=[],o=this;return new Promise((function(a,s){o.userSession(e).then((function(o){for(var c in t)if("sub"!==c&&c.indexOf("_verified")<0){var u={Name:c,Value:t[c]};i.push(u)}e.updateAttributes(i,(function(e,n,i){if(e)return Y("updateUserAttributes_failure",e,"Failed to update attributes"),s(e);var o=r.createUpdateAttributesResultList(t,null==i?void 0:i.CodeDeliveryDetailsList);return Y("updateUserAttributes",o,"Attributes successfully updated"),a(n)}),n)}))}))},e.prototype.createUpdateAttributesResultList=function(e,t){var n={};return Object.keys(e).forEach((function(e){n[e]={isUpdated:!0};var r=null==t?void 0:t.find((function(t){return t.AttributeName===e}));r&&(n[e].isUpdated=!1,n[e].codeDeliveryDetails=r)})),n},e.prototype.userAttributes=function(e){var t=this;return new Promise((function(n,r){t.userSession(e).then((function(t){e.getUserAttributes((function(e,t){e?r(e):n(t)}))}))}))},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then((function(e){var n=t.attributesToObject(e),r={},i={};return n.email&&(n.email_verified?i.email=n.email:r.email=n.email),n.phone_number&&(n.phone_number_verified?i.phone_number=n.phone_number:r.phone_number=n.phone_number),{verified:i,unverified:r}}))},e.prototype.isErrorWithMessage=function(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"message")},e.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Access Token has been revoked"===e.message},e.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has been revoked"===e.message},e.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&"User is disabled."===e.message},e.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&"User does not exist."===e.message},e.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has expired"===e.message},e.prototype.isPasswordResetRequiredError=function(e){return this.isErrorWithMessage(e)&&"Password reset required for the user"===e.message},e.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI")},e.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)||this.isPasswordResetRequiredError(e)},e.prototype.cleanUpInvalidSession=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t=this;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:e.signOut(),this.user=null,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return n.sent(),[3,4];case 3:return n.sent(),V.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise((function(e,n){t.oAuthSignOutRedirect(e,n)}))]:(Y("signOut",this.user,"A user has been signed out"),[2])}}))}))},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise((function(n,i){t._storageSync.then((function(){return(0,r.__awaiter)(t,void 0,void 0,(function(){var t,o,s,c,u,l,d=this;return(0,r.__generator)(this,(function(f){switch(f.label){case 0:return this.isOAuthInProgress()?(V.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise((function(e){var t=setTimeout((function(){V.debug("OAuth signIn in progress timeout"),a.Y.remove("auth",n),e()}),1e4);function n(r){var i=r.payload.event;"cognitoHostedUI"!==i&&"cognitoHostedUI_failure"!==i||(V.debug("OAuth signIn resolved: "+i),clearTimeout(t),a.Y.remove("auth",n),e())}a.Y.listen("auth",n)}))]):[3,2];case 1:f.sent(),f.label=2;case 2:if(!(t=this.userPool.getCurrentUser()))return V.debug("Failed to get user from user pool"),i("No current user"),[2];f.label=3;case 3:return f.trys.push([3,7,,8]),[4,this._userSession(t)];case 4:return o=f.sent(),(s=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,6];case 5:f.sent(),f.label=6;case 6:return c=this._config.clientMetadata,u=o.getAccessToken().decodePayload().scope,(void 0===u?"":u).split(" ").includes(G)?(t.getUserData((function(e,o){return(0,r.__awaiter)(d,void 0,void 0,(function(){var a,s,c,u,l,d,f;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!e)return[3,7];if(V.debug("getting user data failed",e),!this.isSessionInvalid(e))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return r.sent(),[3,4];
2case 3:return a=r.sent(),i(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+a.message)),[2];case 4:return i(e),[3,6];case 5:n(t),r.label=6;case 6:return[2];case 7:for(s=o.PreferredMfaSetting||"NOMFA",c=[],u=0;u<o.UserAttributes.length;u++)l={Name:o.UserAttributes[u].Name,Value:o.UserAttributes[u].Value},d=new v.HB(l),c.push(d);return f=this.attributesToObject(c),Object.assign(t,{attributes:f,preferredMFA:s}),[2,n(t)]}}))}))}),{bypassCache:s,clientMetadata:c}),[3,8]):(V.debug("Unable to get the user data because the "+G+" is not in the scopes of the access token"),[2,n(t)]);case 7:return l=f.sent(),i(l),[3,8];case 8:return[2]}}))}))})).catch((function(e){return V.debug("Failed to sync cache info into memory",e),i(e)}))})):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,o,a;return(0,r.__generator)(this,(function(s){switch(s.label){case 0:V.debug("getting current authenticated user"),t=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._storageSync];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),V.debug("Failed to sync cache info into memory",n),n;case 4:try{(i=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")))&&(t=(0,r.__assign)((0,r.__assign)({},i.user),{token:i.token}))}catch(c){V.debug("cannot load federated user from auth storage")}return t?(this.user=t,V.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:V.debug("get current authenticated userpool user"),o=null,s.label=6;case 6:return s.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return o=s.sent(),[3,9];case 8:return"No userPool"===(a=s.sent())&&V.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),V.debug("The user is not authenticated by the error",a),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=o,[2,this.user]}}))}))},e.prototype.currentSession=function(){var e=this;return V.debug("Getting current session"),this.userPool?new Promise((function(t,n){e.currentUserPoolUser().then((function(r){e.userSession(r).then((function(e){t(e)})).catch((function(e){V.debug("Failed to get the current session",e),n(e)}))})).catch((function(e){V.debug("Failed to get the current user",e),n(e)}))})):Promise.reject(new Error("No User Pool in the configuration."))},e.prototype._userSession=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,o=this;return(0,r.__generator)(this,(function(a){switch(a.label){case 0:if(!e)return V.debug("the user is null"),[2,this.rejectAuthError(i.Wo.NoUserSession)];t=this._config.clientMetadata,0===this.inflightSessionPromiseCounter&&(this.inflightSessionPromise=new Promise((function(n,i){e.getSession((function(t,a){return(0,r.__awaiter)(o,void 0,void 0,(function(){var o;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!t)return[3,5];if(V.debug("Failed to get the session from user",e),!this.isSessionInvalid(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return r.sent(),[3,4];case 3:return o=r.sent(),i(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return i(t),[2];case 5:return V.debug("Succeed to get the user session",a),n(a),[2]}}))}))}),{clientMetadata:t})}))),this.inflightSessionPromiseCounter++,a.label=1;case 1:return a.trys.push([1,,3,4]),[4,this.inflightSessionPromise];case 2:return n=a.sent(),e.signInUserSession=n,[2,n];case 3:return this.inflightSessionPromiseCounter--,[7];case 4:return[2]}}
2))}))},e.prototype.userSession=function(e){return this._userSession(e)},e.prototype.currentUserCredentials=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t,n=this;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:V.debug("Getting current user credentials"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),[3,4];case 3:throw e=r.sent(),V.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(i){V.debug("failed to get or parse item aws-amplify-federatedInfo",i)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then((function(e){return V.debug("getting session success",e),n.Credentials.set(e,"session")})).catch((function(){return V.debug("getting guest credentials"),n.Credentials.set(null,"guest")}))]}}))}))},e.prototype.currentCredentials=function(){return V.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,n){return void 0===n&&(n=this._config.clientMetadata),new Promise((function(r,i){e.getAttributeVerificationCode(t,{onSuccess:function(e){return r(e)},onFailure:function(e){return i(e)}},n)}))},e.prototype.verifyUserAttributeSubmit=function(e,t,n){return n?new Promise((function(r,i){e.verifyAttribute(t,n,{onSuccess:function(e){r(e)},onFailure:function(e){i(e)}})})):this.rejectAuthError(i.Wo.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then((function(n){return t.verifyUserAttribute(n,e)}))},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var n=this;return n.currentUserPoolUser().then((function(r){return n.verifyUserAttributeSubmit(r,e,t)}))},e.prototype.cognitoIdentitySignOut=function(e,t){return(0,r.__awaiter)(this,void 0,void 0,(function(){var n,i,o=this;return(0,r.__generator)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._storageSync];case 1:return a.sent(),[3,3];case 2:throw n=a.sent(),V.debug("Failed to sync cache info into memory",n),n;case 3:return i=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise((function(n,a){if(e&&e.global){V.debug("user global sign out",t);var s=o._config.clientMetadata;t.getSession((function(e,s){return(0,r.__awaiter)(o,void 0,void 0,(function(){var o,s=this;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!e)return[3,5];if(V.debug("failed to get the user session",e),!this.isSessionInvalid(e))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return r.sent(),[3,4];case 3:return o=r.sent(),a(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return[2,a(e)];case 5:return t.globalSignOut({onSuccess:function(e){if(V.debug("global sign out success"),!i)return n();s.oAuthSignOutRedirect(n,a)},onFailure:function(e){return V.debug("global sign out failed",e),a(e)}}),[2]}}))}))}),{clientMetadata:s})}else V.debug("user sign out",t),t.signOut((function(){if(!i)return n();o.oAuthSignOutRedirect(n,a)}))}))]}}))}))},e.prototype.oAuthSignOutRedirect=function(e,t){(0,f.gy)().isBrowser?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout((function(){return e(Error("Signout timeout fail"))}),3e3)},e.prototype.signOut=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return n.sent(),[3,3];case 2:return n.sent(),V.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(t=this.userPool.getCurrentUser())?[4,this.cognitoIdentitySignOut(e,t)]:[3,5]:[3,7];case 4:return n.sent(),[3,6];case 5:V.debug("no current Cognito user"),n.label=6;case 6:return[3,8];case 7:V.debug("no Cognito User pool"),n.label=8;case 8:return Y("signOut",this.user,"A user has been signed out"),this.user=null,[2]}}))}))},e.prototype.cleanCachedItems=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}}))}))},e.prototype.changePassword=function(e,t,n,r){var i=this;return void 0===r&&(r=this._config.clientMetadata),new Promise((function(o,a){i.userSession(e).then((function(i){e.changePassword(t,n,(function(e,t){return e?(V.debug("change password failure",e),a(e)):o(t)}),r)}))}))},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.Wo.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(r,i){n.forgotPassword({onSuccess:function(){r()},onFailure:function(t){V.debug("forgot password failure",t),Y("forgotPassword_failure",t,e+" forgotPassword failed"),i(t)},inputVerificationCode:function(t){Y("forgotPassword",n,e+" has initiated forgot password flow"),r(t)}},t)}))},e.prototype.forgotPasswordSubmit=function(e,t,n,r){if(void 0===r&&(r=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.Wo.EmptyUsername);if(!t)return this.rejectAuthError(i.Wo.EmptyCode);if(!n)return this.rejectAuthError(i.Wo.EmptyPassword);var o=this.createCognitoUser(e);return new Promise((function(i,a){o.confirmPassword(t,n,{onSuccess:function(t){Y("forgotPasswordSubmit",o,e+" forgotPasswordSubmit successful"),i(t)}
2,onFailure:function(t){Y("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),a(t)}},r)}))},e.prototype.currentUserInfo=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t,n,i,o,a,s;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return(e=this.Credentials.getCredSource())&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch((function(e){return V.error(e)}))];case 1:if(!(s=r.sent()))return[2,null];r.label=2;case 2:return r.trys.push([2,8,,9]),[4,this.userAttributes(s)];case 3:t=r.sent(),n=this.attributesToObject(t),i=null,r.label=4;case 4:return r.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return i=r.sent(),[3,7];case 6:return o=r.sent(),V.debug("Failed to retrieve credentials while getting current user info",o),[3,7];case 7:return[2,{id:i?i.identityId:void 0,username:s.getUsername(),attributes:n}];case 8:return a=r.sent(),V.error("currentUserInfo error",a),[2,{}];case 9:return"federated"===e?[2,(s=this.user)||{}]:[2]}}))}))},e.prototype.federatedSignIn=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,(function(){var o,a,s,c,u,l,d,f,p,h,v;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(void 0===e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return(0,i.Ze)(e)||(0,i.qr)(e)||(0,i.f$)(e)||void 0===e?(o=e||{provider:i.qB.Cognito},u=(0,i.Ze)(o)?o.provider:o.customProvider,(0,i.Ze)(o),a=o.customState,this._config.userPoolId&&(s=(0,i.fz)(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,c=(0,i.fz)(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,c,s,u,a)),[3,4]):[3,1];case 1:u=e;try{(l=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user))&&V.warn("There is already a signed in user: "+l+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(g){}return d=t.token,f=t.identity_id,p=t.expires_at,[4,this.Credentials.set({provider:u,token:d,identity_id:f,user:n,expires_at:p},"federation")];case 2:return h=r.sent(),[4,this.currentAuthenticatedUser()];case 3:return v=r.sent(),Y("signIn",v,"A user "+v.username+" has been signed in"),V.debug("federated sign in credentials",h),[2,h];case 4:return[2]}}
2))}))},e.prototype._handleAuthResponse=function(e){return(0,r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,o,a,s,c,u,l,d,h,g,y,b;return(0,r.__generator)(this,(function(_){switch(_.label){case 0:if(this.oAuthFlowInProgress)return V.debug("Skipping URL "+e+" current flow in progress"),[2];_.label=1;case 1:if(_.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(Y("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||((0,f.gy)().isBrowser?window.location.href:""),n=!!((0,m.parse)(t).query||"").split("&").map((function(e){return e.split("=")})).find((function(e){var t=(0,r.__read)(e,1)[0];return"code"===t||"error"===t})),i=!!((0,m.parse)(t).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).find((function(e){var t=(0,r.__read)(e,1)[0];return"access_token"===t||"error"===t})),!n&&!i)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),_.label=2;case 2:return _.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return o=_.sent(),a=o.accessToken,s=o.idToken,c=o.refreshToken,u=o.state,l=new v.p4({IdToken:new v.Yw({IdToken:s}),RefreshToken:new v.c9({RefreshToken:c}),AccessToken:new v.pD({AccessToken:a})}),d=void 0,this._config.identityPoolId?[4,this.Credentials.set(l,"session")]:[3,5];case 4:d=_.sent(),V.debug("AWS credentials",d),_.label=5;case 5:return h=/-/.test(u),(g=this.createCognitoUser(l.getIdToken().decodePayload()["cognito:username"])).setSignInUserSession(l),window&&void 0!==window.history&&window.history.replaceState(window.history.state,"",this._config.oauth.redirectSignIn),Y("signIn",g,"A user "+g.getUsername()+" has been signed in"),Y("cognitoHostedUI",g,"A user "+g.getUsername()+" has been signed in via Cognito Hosted UI"),h&&(y=u.split("-").splice(1).join("-"),Y("customOAuthState",(0,p.l)(y),"State for user "+g.getUsername())),[2,d];case 6:return b=_.sent(),V.debug("Error in cognito hosted auth response",b),window&&void 0!==window.history&&window.history.replaceState(window.history.state,"",this._config.oauth.redirectSignIn),Y("signIn_failure",b,"The OAuth response flow failed"),Y("cognitoHostedUI_failure",b,"A failure occurred when returning to the Cognito Hosted UI"),Y("customState_failure",b,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}}
2))}))},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t=this,n={};return e&&e.map((function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?n[e.Name]=t.isTruthyString(e.Value)||!0===e.Value:n[e.Name]=e.Value})),n},e.prototype.isTruthyString=function(e){return"function"==typeof e.toLowerCase&&"true"===e.toLowerCase()},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var n=this._config.authenticationFlowType,r=new v.TU(t);return n&&r.setAuthenticationFlowType(n),r},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem&&"function"==typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?i.Wo.NoConfig:i.Wo.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new F(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new j(e))},e.prototype.rememberDevice=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:return t=n.sent(),V.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise((function(t,n){e.setDeviceStatusRemembered({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?n(new F(i.Wo.DeviceConfig)):"NetworkError"===e.code?n(new F(i.Wo.NetworkError)):n(e)}})}))]}}))}))},e.prototype.forgetDevice=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:return t=n.sent(),V.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise((function(t,n){e.forgetDevice({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?n(new F(i.Wo.DeviceConfig)):"NetworkError"===e.code?n(new F(i.Wo.NetworkError)):n(e)}})}))]}}))}))},e.prototype.fetchDevices=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){var e,t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:throw t=n.sent(),V.debug("The user is not authenticated by the error",t),new Error("The user is not authenticated");case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise((function(t,n){var r={onSuccess:function(e){var n=e.Devices.map((function(e){var t=e.DeviceAttributes.find((function(e){return"device_name"===e.Name}))||{};return{id:e.DeviceKey,name:t.Value}}));t(n)},onFailure:function(e){"InvalidParameterException"===e.code?n(new F(i.Wo.DeviceConfig)):"NetworkError"===e.code?n(new F(i.Wo.NetworkError)):n(e)}};e.listDevices(60,null,r)}))]}}))}))},e}(),H=new K(null);h.H.register(H)},27314:function(e,t,n){"use strict";var r;n.d(t,{f:function(){return r}}),function(e){e.DEFAULT_MSG="Authentication Error",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_E
2RROR="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"}(r||(r={}))},16682:function(e,t,n){"use strict";n.r(t),n.d(t,{Auth:function(){return r.N},AuthErrorStrings:function(){return a.f},CognitoHostedUIIdentityProvider:function(){return i.qB},CognitoUser:function(){return o.TU},CookieStorage:function(){return o.W6},GRAPHQL_AUTH_MODE:function(){return i.Tv},appendToCognitoUserAgent:function(){return o.XB}});var r=n(99443),i=n(22924),o=n(16807),a=n(27314);t.default=r.N},22924:function(e,t,n){"use strict";var r,i,o;function a(e){return e&&!!["provider"].find((function(t){return e.hasOwnProperty(t)}))}function s(e){return e&&!!["customProvider"].find((function(t){return e.hasOwnProperty(t)}))}function c(e){return e&&!!["customState"].find((function(t){return e.hasOwnProperty(t)}))}function u(e){return void 0!==e.redirectSignIn}function l(e){return!!e.username}n.d(t,{O9:function(){return l},Tv:function(){return o},Wo:function(){return i},Ze:function(){return a},f$:function(){return c},fz:function(){return u},qB:function(){return r},qr:function(){return s}}),function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(r||(r={})),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"}(i||(i={})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(o||(o={}))},86951:function(e,t,n){"use strict";n.d(t,{Y:function(){return u}});var r=n(15215),i=n(34549),o=n(88319),a=n(10565),s=n(62965),c=new i.C("Cache"),u=new(function(e){function t(t){var n=this,r=t?Object.assign({},a.sb,t):a.sb;return(n=e.call(this,r)||this).config.storage=r.storage,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n),n}return(0,r.__extends)(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=(0,a.YM)(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),n=JSON.parse(t);return(0,a.YM)()>=n.expires},t.prototype._removeItem=function(e,t){var n=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(n),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(n){this._decreaseCurSizeInBytes(t.byteSize),c.error("Failed to set item "+n)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,n=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>n?t:n},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],n=0;n<this.config.storage.length;n+=1)t.push(this.config.storage.key(n));for(n=0;n<t.length;n+=1){var r=t[n];0===r.indexOf(this.config.keyPrefix)&&r!==this.cacheCurSizeKey&&(this._isExpired(r)?this._removeItem(r):e.push(r))}return e},t.prototype._popOutItems=function(e,t){for(var n=[],r=t,i=0;i<e.length;i+=1){var o=this.config.storage.getItem(e[i]);if(null!=o){var a=JSON.parse(o);n.push(a)}}n.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}));for(i=0;i<n.length;i+=1)if(this._removeItem(n[i].key,n[i].byteSize),(r-=n[i].byteSize)<=0)return},t.prototype.setItem=function(e,t,n){c.log("Set item: key is "+e+", value is "+t+" with options: "+n);var r=this.config.keyPrefix+e;if(r!==this.config.keyPrefix&&r!==this.cacheCurSizeKey)if(void 0!==t){var i={priority:n&&void 0!==n.priority?n.priority:this.config.defaultPriority,expires:n&&void 0!==n.expires?n.expires:this.config.defaultTTL+(0,a.YM)()};if(i.priority<1||i.priority>5)c.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var o=this.fillCacheItem(r,t,i);if(o.byteSize>this.config.itemMaxSize)c.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var s=this.config.storage.getItem(r);if(s&&this._removeItem(r,JSON.parse(s).byteSize),this._isCacheFull(o.byteSize)){var u=this._findValidKeys();if(this._isCacheFull(o.byteSize)){var l=this._sizeToPop(o.byteSize);this._popOutItems(u,l)}}this._setItem(r,o)}catch(d){c.warn("setItem failed! "+d)}}}else c.warn("The value of item should not be undefined!");else c.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){c.log("Get item: key is "+e+" with options "+t);var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return c.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(n=this.config.storage.getItem(r))){if(!this._isExpired(r)){var i=JSON.parse(n);return(i=this._refreshItem(i,r)).data}this._removeItem(r,JSON.parse(n).byteSize),n=null}if(t&&void 0!==t.callback){var o=t.callback();return null!==o&&this.setItem(e,o,t),o}return null}catch(a){return c.warn("getItem failed! "+a),null}},t.prototype.removeItem=function(e){c.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var n=this.config.storage.getItem(t);n&&this._removeItem(t,JSON.parse(n).byteSize)}catch(r){c.warn("removeItem failed! "+r)}},t.prototype.clear=function(){c.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&e.push(n)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(r){c.warn("clear failed! "+r)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&n!==this.cacheCurSizeKey&&e.push(n.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==a.sb.keyPrefix||(c.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=a.YM.toString()),new t(e)},t}
2(s.y));o.H.register(u)},62965:function(e,t,n){"use strict";n.d(t,{y:function(){return o}});var r=n(10565),i=new(n(34549).C)("StorageCache"),o=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){(0,r.Fq)(this.config.capacityInBytes)||(i.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=r.sb.capacityInBytes),(0,r.Fq)(this.config.itemMaxSize)||(i.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=r.sb.itemMaxSize),(0,r.Fq)(this.config.defaultTTL)||(i.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=r.sb.defaultTTL),(0,r.Fq)(this.config.defaultPriority)||(i.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=r.sb.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(i.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=r.sb.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(i.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=r.sb.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(i.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=r.sb.warningThreshold);this.config.capacityInBytes>5242880&&(i.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=r.sb.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,n){var i={key:e,data:t,timestamp:(0,r.YM)(),visitedTime:(0,r.YM)(),priority:n.priority,expires:n.expires,type:typeof t,byteSize:0};return i.byteSize=(0,r.Ne)(JSON.stringify(i)),i.byteSize=(0,r.Ne)(JSON.stringify(i)),i},e.prototype.configure=function(e){return e?(e.keyPrefix&&i.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}()},10565:function(e,t,n){"use strict";n.d(t,{E:function(){return c},Fq:function(){return a},Ne:function(){return i},YM:function(){return o},sb:function(){return r}});var r={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(n(54769).i)).getStorage()};function i(e){var t=0;t=e.length;for(var n=e.length;n>=0;n-=1){var r=e.charCodeAt(n);r>127&&r<=2047?t+=1:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&(n-=1)}return t}function o(){return(new Date).getTime()}function a(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var s={},c=function(){function e(){}return e.clear=function(){s={}},e.getItem=function(e){return s[e]||null},e.setItem=function(e,t){s[e]=t},e.removeItem=function(e){delete s[e]},e}()},12442:function(e,t,n){"use strict";n.r(t),n.d(t,{BrowserStorageCache:function(){return r.Y},Cache:function(){return r.Y},InMemoryCache:function(){return l}});var r=n(86951),i=n(15215),o=n(10565),a=function(e){this.key=e||"",this.prevNode=null,this.nextNode=null},s=function(){function e(){this.head=new a,this.tail=new a,this.hashtable={},this.length=0,this.head.nextNode=this.tail,this.tail.prevNode=this.head}return e.prototype.insertNodeToHead=function(e){var t=this.head.nextNode;this.head.nextNode=e,e.nextNode=t,e.prevNode=this.head,t.prevNode=e,this.length=this.length+1},e.prototype.removeNode=function(e){e.prevNode.nextNode=e.nextNode,e.nextNode.prevNode=e.prevNode,e.prevNode=null,e.nextNode=null,this.length=this.length-1},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.refresh=function(e){var t=this.hashtable[e];this.removeNode(t),this.insertNodeToHead(t)},e.prototype.insertItem=function(e){var t=new a(e);this.hashtable[e]=t,this.insertNodeToHead(t)},e.prototype.getLastItem=function(){return this.tail.prevNode.key},e.prototype.removeItem=function(e){var t=this.hashtable[e];this.removeNode(t),delete this.hashtable[e]},e.prototype.getSize=function(){return this.length},e.prototype.containsKey=function(e){return e in this.hashtable},e.prototype.clearList=function(){var e,t;try{for(var n=(0,i.__values)(Object.keys(this.hashtable)),r=n.next();!r.done;r=n.next()){var o=r.value;this.hashtable.hasOwnProperty(o)&&delete this.hashtable[o]}}catch(a){e={error:a}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.head.nextNode=this.tail,this.tail.prevNode=this.head,this.length=0},e.prototype.getKeys=function(){return Object.keys(this.hashtable)},e.prototype.isHeadNode=function(e){return this.hashtable[e].prevNode===this.head},e.prototype.isTailNode=function(e){return this.hashtable[e].nextNode===this.tail},e}(),c=n(62965),u=new(n(34549).C)("InMemoryCache"),l=new(function(e){function t(t){var n=this,r=t?Object.assign({},o.sb,t):o.sb;n=e.call(this,r)||this,u.debug("now we start!"),n.cacheList=[],n.curSizeInBytes=0,n.maxPriority=5,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n);for(var i=0;i<n.maxPriority;i+=1)n.cacheList[i]=new s;return n}return(0,i.__extends)(t,e),t.prototype._decreaseCurSizeInBytes=function(e){this.curSizeInBytes-=e},t.prototype._increaseCurSizeInBytes=function(e){this.curSizeInBytes+=e},t.prototype._isExpired=function(e){var t=o.E.getItem(e),n=JSON.parse(t);return(0,o.YM)()>=n.expires},t.prototype._removeItem=function(e,t){this.cacheList[t].removeItem(e),this._decreaseCurSizeInBytes(JSON.parse(o.E.getItem(e)).byteSize),o.E.removeItem(e)},t.prototype._setItem=function(e,t,n){this.cacheList[n].insertItem(e),this._increaseCurSizeInBytes(t.byteSize),o.E.setItem(e,JSON.stringify(t))},t.prototype._isCacheFull=function(e){return this.curSizeInBytes+e>this.config.capacityInBytes},t.prototype.containsKey=function(e){for(var t=this.config.keyPrefix+e,n=0;n<this.maxPriority;n+=1)if(this.cacheList[n].containsKey(t))return n+1;return-1},t.prototype.setItem=function(e,t,n){var r=this.config.keyPrefix+e;if(r!==this.config.keyPrefix&&r!==this.cacheCurSizeKey)if(void 0!==t){var i={priority:n&&void 0!==n.priority?n.priority:this.config.defaultPriority,expires:n&&void 0!==n.expires?n.expires:this.config.defaultTTL+(0,o.YM)()};if(i.priority<1||i.priority>5)u.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var a=this.fillCacheItem(r,t,i);if(a.byteSize>this.config.itemMaxSize)u.warn("Item with key: "+e+" you are trying to put into is too big!");else{var s=this.containsKey(e);-1!==s&&this._removeItem(r,s-1);for(var c=this.maxPriority-1;
2this._isCacheFull(a.byteSize)&&c>=0;)if(this.cacheList[c].isEmpty())c-=1;else{var l=this.cacheList[c].getLastItem();this._removeItem(l,c)}this._setItem(r,a,Number(a.priority)-1)}}}else u.warn("The value of item should not be undefined!");else u.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return u.warn("Invalid key: should not be empty or 'CurSize'"),null;var i=this.containsKey(e);if(-1!==i){if(!this._isExpired(r)){n=o.E.getItem(r);var a=JSON.parse(n);return this.cacheList[a.priority-1].refresh(r),a.data}this._removeItem(r,i-1)}if(t&&void 0!==t.callback){var s=t.callback();return null!==s&&this.setItem(e,s,t),s}return null},t.prototype.removeItem=function(e){var t=this.config.keyPrefix+e,n=this.containsKey(e);-1!==n&&this._removeItem(t,n-1)},t.prototype.clear=function(){for(var e,t,n=0;n<this.maxPriority;n+=1)try{for(var r=(e=void 0,(0,i.__values)(this.cacheList[n].getKeys())),o=r.next();!o.done;o=r.next()){var a=o.value;this._removeItem(a,n)}}catch(s){e={error:s}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.getAllKeys=function(){for(var e,t,n=[],r=0;r<this.maxPriority;r+=1)try{for(var o=(e=void 0,(0,i.__values)(this.cacheList[r].getKeys())),a=o.next();!a.done;a=o.next()){var s=a.value;n.push(s.substring(this.config.keyPrefix.length))}}catch(c){e={error:c}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return n},t.prototype.getCacheCurSize=function(){return this.curSizeInBytes},t.prototype.createInstance=function(e){return new t(e)},t}(c.y))},88319:function(e,t,n){"use strict";n.d(t,{H:function(){return s},N:function(){return a}});var r=n(34549),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=new r.C("Amplify"),a=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Notifications=null,this.Logger=r.C,this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}(),s=new a},17467:function(e,t,n){"use strict";n.d(t,{J:function(){return be},j:function(){return ye}});var r,i=n(34549),o=n(54769),a=n(64988),s=n(59136),c=n(766),u=n(88319),l={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},d={partitions:[l,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},p=function(e){var t,n,r=d.partitions;try{for(var i=f(r),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.regions,c=a.outputs,u=a.regionRegex,p=new RegExp(u);if(s.includes(e)||p.test(e))return c.dnsSuffix}}catch(h){t={error:h}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return l.outputs.dnsSuffix},h=function(){return h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},h.apply(this,arguments)}
2,v=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},g=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},m=function(e,t){if(null==t?void 0:t.aborted)return Promise.resolve();var n,r,i=new Promise((function(t){r=t,n=setTimeout(t,e)}));return null==t||t.addEventListener("abort",(function e(i){clearTimeout(n),null==t||t.removeEventListener("abort",e),r()})),i},y=function(e,t){var n;"[object Object]"===Object.prototype.toString.call(e)&&(e.$metadata=h(h({},null!==(n=e.$metadata)&&void 0!==n?n:{}),{attempts:t}))},b=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},E=function(e,t){return function(n,r){for(var i={},o=function(t){return e(t,r)},a=t.length-1;a>=0;a--){o=(0,t[a])(r)(o,i)}return o(n)}},w=(n(86071),function(e){var t;return function(){return t||(t=e()),t}}),S=function(){return S=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},S.apply(this,arguments)},T=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},I=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},N=function(e){return!["HEAD","GET","DELETE"].includes(e.toUpperCase())},A=E((function(e,t){var n=e.url,r=e.method,i=e.headers,o=e.body,a=t.abortSignal;return T(void 0,void 0,void 0,(function(){var e,t,s,c,u,l,d;return I(this,(function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,fetch(n,{method:r,headers:i,body:N(r)?o:void 0,signal:a})];case 1:return e=f.sent(),[3,3];case 2:if((t=f.sent())instanceof TypeError)throw new Error("Network error");throw t;case 3:return s={},null===(l=e.headers)||void 0===l||l.forEach((function(e,t){s[t.toLowerCase()]=e})),c={statusCode:e.status,headers:s,body:null},u=Object.assign(null!==(d=e.body)&&void 0!==d?d:{},{text:w((function(){return e.text()})),blob:w((function(){return e.blob()})),json:w((function(){return e.json()}))}),[2,S(S({},c),{body:u})]}}))}))}),[function(e){var t=e.userAgentHeader,n=void 0===t?"x-amz-user-agent":t,r=e.userAgentValue,i=void 0===r?"":r;return function(e){return function(t){return b(this,void 0,void 0,(function(){var r;return _(this,(function(o){switch(o.label){case 0:return 0!==i.trim().length?[3,2]:[4,e(t)];case 1:return[2,o.sent()];case 2:return r=n.toLowerCase(),t.headers[r]=t.headers[r]?"".concat(t.headers[r]," ").concat(i):i,[4,e(t)];case 3:return[2,o.sent()]}}))}))}}},function(e){var t=e.maxAttempts,n=void 0===t?3:t,r=e.retryDecider,i=e.computeDelay,o=e.abortSignal;if(n<1)throw new Error("maxAttempts must be greater than 0");return function(e,t){return function(a){var s;return v(this,void 0,void 0,(function(){var c,u,l,d,f,p;return g(this,(function(h){switch(h.label){case 0:u=null!==(s=t.attemptsCount)&&void 0!==s?s:0,d=function(){if(l)return y(l,u),l;throw y(c,u),c},h.label=1;case 1:if((null==o?void 0:o.aborted)||!(u<n))return[3,11];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,e(a)];case 3:return l=h.sent(),c=void 0,[3,5];case 4:return f=h.sent(),c=f,l=void 0,[3,5];case 5:return u=t.attemptsCount>u?t.attemptsCount:u+1,t.attemptsCount=u,[4,r(l,c)];case 6:return h.sent()?!(null==o?void 0:o.aborted)&&u<n?(p=i(u),[4,m(p,o)]):[3,8]:[3,9];case 7:h.sent(),h.label=8;case 8:return[3,1];case 9:return[2,d()];case 10:return[3,1];case 11:if(null==o?void 0:o.aborted)throw new Error("Request aborted.");return[2,d()]}}))}))}}}]),C=function(){return C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)},O=function(e){var t,n,r=e.headers,i=e.statusCode;return C(C({},k(e)?e.$metadata:{}),{httpStatusCode:i,requestId:null!==(n=null!==(t=r["x-amzn-requestid"])&&void 0!==t?t:r["x-amzn-request-id"])&&void 0!==n?n:r["x-amz-request-id"],extendedRequestId:r["x-amz-id-2"],cfId:r["x-amz-cf-id"]})},k=function(e){return"object"==typeof(null==e?void 0:e.$metadata)}
2,D=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},R=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},P=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},x=function(e){return D(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u;return R(this,(function(l){switch(l.label){case 0:return!e||e.statusCode<300?[2]:[4,M(e)];case 1:return t=l.sent(),n=function(e){var t=P(e.toString().split(/[\,\:]+/),1)[0];return t.includes("#")?t.split("#")[1]:t}(null!==(s=null!==(a=null!==(o=e.headers["x-amzn-errortype"])&&void 0!==o?o:t.code)&&void 0!==a?a:t.__type)&&void 0!==s?s:"UnknownError"),r=null!==(u=null!==(c=t.message)&&void 0!==c?c:t.Message)&&void 0!==u?u:"Unknown error",i=new Error(r),[2,Object.assign(i,{name:n,$metadata:O(e)})]}}))}))},M=function(e){return D(void 0,void 0,void 0,(function(){var t;return R(this,(function(n){switch(n.label){case 0:if(!e.body)throw new Error("Missing response payload");return[4,e.body.json()];case 1:return t=n.sent(),[2,Object.assign(t,{$metadata:O(e)})]}}))}))},L=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],U=function(e){return L.includes(e)},F=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},j=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},B=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],V=["TimeoutError","RequestTimeout","RequestTimeoutException"],G=function(e,t){return 429===e||B.includes(t)},q=function(e){return"Network error"===(null==e?void 0:e.name)},Y=function(e,t){return[500,502,503,504].includes(e)||V.includes(t)},K=3e5,H=n(71805),z=n(85294),W=function(e,t,n,r){return new(n||(n=Prom
2ise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},J=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Q=E(A,[function(){return function(e,t){return function(t){return W(this,void 0,void 0,(function(){return J(this,(function(n){return t.headers["cache-control"]="no-store",[2,e(t)]}))}))}}}]),Z={service:"cognito-identity",endpointResolver:function(e){var t=e.region;return{url:new URL("https://cognito-identity.".concat(t,".").concat(p(t)))}},retryDecider:(r=x,function(e,t){return F(void 0,void 0,void 0,(function(){var n,i,o,a;return j(this,(function(s){switch(s.label){case 0:return null==t?[3,1]:(i=t,[3,3]);case 1:return[4,r(e)];case 2:i=s.sent(),s.label=3;case 3:return n=(null!==(a=i)&&void 0!==a?a:{}).name,o=null==e?void 0:e.statusCode,[2,q(t)||G(o,n)||U(n)||Y(o,n)]}}))}))}),computeDelay:function(e){var t=(0,c.yN)(K)(e);return!1===t?K:t},userAgentValue:(0,H.fE)()};(0,z.e9)((function(){Z.userAgentValue=(0,H.fE)()}));var $=function(e){return{"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.".concat(e)}},X=function(e,t,n){return{headers:t,url:e.url,body:n,method:"POST"}},ee=function(){return ee=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ee.apply(this,arguments)},te=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},ne=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},re=function(e,t,n,r){return function(i,o){return te(void 0,void 0,void 0,(function(){var a,s,c,u;return ne(this,(function(l){switch(l.label){case 0:return[4,(a=ee(ee({},r),i)).endpointResolver(a,o)];case 1:return s=l.sent(),[4,t(o,s)];case 2:return c=l.sent(),[4,e(c,ee({},a))];case 3:return u=l.sent(),[4,n(u)];case 4:return[2,l.sent()]}}))}))}}
2,ie=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},oe=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ae=re(Q,(function(e,t){var n=$("GetId"),r=JSON.stringify(e);return X(t,n,r)}),(function(e){return ie(void 0,void 0,void 0,(function(){return oe(this,(function(t){switch(t.label){case 0:return e.statusCode>=300?[4,x(e)]:[3,2];case 1:throw t.sent();case 2:return[4,M(e)];case 3:return[2,{IdentityId:t.sent().IdentityId,$metadata:O(e)}]}}))}))}),Z),se=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},ce=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ue=function(e){return void 0===e&&(e={}),{AccessKeyId:e.AccessKeyId,SecretKey:e.SecretKey,SessionToken:e.SessionToken,Expiration:new Date(1e3*e.Expiration)}},le=re(Q,(function(e,t){var n=$("GetCredentialsForIdentity"),r=JSON.stringify(e);return X(t,n,r)}),(function(e){return se(void 0,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return e.statusCode>=300?[4,x(e)]:[3,2];case 1:throw n.sent();case 2:return[4,M(e)];case 3:return[2,{IdentityId:(t=n.sent()).IdentityId,Credentials:ue(t.Credentials),$metadata:O(e)}]}}))}))}),Z),de=n(3976),fe=n(78868),pe=function(){return pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pe.apply(this,arguments)},he=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},ve=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ge=new i.C("Credentials"),me="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",ye=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=s.j.refreshGoogleToken,this._refreshHandlers.facebook=s.k.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t,n,r,i=this._config.refreshHandlers;return i&&(this._refreshHandlers=pe(pe({},this._refreshHandlers),i)),this._storage=this._config.storage,this._storage||(this._storage=(new o.i).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),t="credentials_configured",n=null,r="Credentials has been configured successfully",fe.Y.dispatch("core",{event:t,data:n,message:r},"Credentials",me),this._config},e.prototype.get=function(){return ge.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"".concat("CognitoIdentityId-").concat(e)},e.prototype._pickupCredentials=function(){return ge.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?ge.debug("getting old cred promise"):(ge.debug("getting new cred promise"),this._gettingCredPromise=(0,a.VN)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return he(this,void 0,void 0,(function(){var e,t,n,r,i,o,a;return ve(this,(function(s){switch(s.label){case 0:if(ge.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return ge.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(ge.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?u.H.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,this._setCredentialsForGuest()];if(this._isExpired(e)||!this._isPastTTL())return[3,6];ge.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return i=s.sent(),o=i.refreshToken,[4,new Promise((function(e,t){r.refreshSession(o,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),ge.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){ge.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,i=e.identity_id,o=e.expires_at;o=1970===new Date(o).getFullYear()?1e3*o:o;var a=this;return ge.debug("checking if federated jwt token expired"),o>(new Date).getTime()?(ge.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):a._refreshHandlers[t]&&"function"==typeof a._refreshHandlers[t]?(ge.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:a._refreshHandlers[t],provider:t,user:n})):(ge.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,i=e.user;return(0,c.hu)(n,[],1e4).then((function(e){return ge.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:i,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),ge.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return ge.debug("no credentials for expiration check"),!0;ge.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){var e;return he(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u,l,d=this;return ve(this,(function(f){switch(f.label){case 0:return ge.debug("setting credentials for guest"),(null===(e=this._config)||void 0===e?void 0:e.identityPoolId)||(this._config=Object.assign({},this._config,(0,de.s)(this._config||{}).Auth)),t=this._config,n=t.identityPoolId,r=t.region,i=t.mandatorySignIn,o=t.identityPoolRegion,i?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:n?o||r?(s=this,[4,this._getGuestIdentityId()]):(ge.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(ge.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return a=s._identityId=f.sent(),c={region:null!=o?o:r},u=function(){return he(d,void 0,void 0,(function(){var e,t;return ve(this,(function(r){switch(r.label){case 0:return a?[3,2]:[4,ae(c,{IdentityPoolId:n})];case 1:e=r.sent().IdentityId,this._identityId=e,r.label=2;case 2:return[4,le(c,{IdentityId:this._identityId})];case 3:return t=r.sent().Credentials,[2,{identityId:this._identityId,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}}))}))},l=u().catch((function(e){return he(d,void 0,void 0,(function(){return ve(this,(function(t){throw e}))}))})),[2,this._loadCredentials(l,"guest",!1,null).then((function(e){return e})).catch((function(e){return he(d,void 0,void 0,(function(){var t,r=this;return ve(this,(function(i){switch(i.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '".concat(a,"' not found.")?[3,2]:(ge.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return i.sent(),t=function(){return he(r,void 0,void 0,(function(){var e,t;return ve(this,(function(r){switch(r.label){case 0:return[4,ae(c,{IdentityPoolId:n})];case 1:return e=r.sent().IdentityId,this._identityId=e,[4,le(c,{IdentityId:e})];case 2:return t=r.sent().Credentials,[2,{identityId:e,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}}))}))},l=t().catch((function(e){return he(r,void 0,void 0,(function(){return ve(this,(function(t){throw e}))}))})),[2,this._loadCredentials(l,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=this,n=e.provider,r=e.token,i=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[n]||n;if(!o)return Promise.reject("You must specify a federated provider");var a={};a[o]=r;var s=this._config,c=s.identityPoolId,u=s.region,l=s.identityPoolRegion;if(!c)return ge.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");
2if(!l&&!u)return ge.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var d={region:null!=l?l:u},f=he(t,void 0,void 0,(function(){var e,t;return ve(this,(function(n){switch(n.label){case 0:return i?[3,2]:[4,ae(d,{IdentityPoolId:c,Logins:a})];case 1:e=n.sent().IdentityId,i=e,n.label=2;case 2:return[4,le(d,{IdentityId:i,Logins:a})];case 3:return t=n.sent().Credentials,[2,{identityId:i,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}}))})).catch((function(e){return he(t,void 0,void 0,(function(){return ve(this,(function(t){throw e}))}))}));return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;ge.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,a=r.identityPoolId,s=r.identityPoolRegion;if(!a)return ge.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!s&&!i)return ge.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c={};c["cognito-idp."+i+".amazonaws.com/"+o]=n;var u={region:null!=s?s:i},l=he(t,void 0,void 0,(function(){var e,t,n,r,i,o,s,l,d,f;return ve(this,(function(p){switch(p.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=p.sent())?[3,3]:[4,ae(u,{IdentityPoolId:a,Logins:c})];case 2:n=p.sent().IdentityId,t=n,p.label=3;case 3:return[4,le(u,{IdentityId:e||t,Logins:c})];case 4:return r=p.sent(),i=r.Credentials,o=i.AccessKeyId,s=i.Expiration,l=i.SecretKey,d=i.SessionToken,f=r.IdentityId,this._identityId=f,e?(ge.debug("The guest identity ".concat(e," has been successfully linked to the logins")),e===f&&ge.debug("The guest identity ".concat(e," has become the primary identity")),[4,this._removeGuestIdentityId()]):[3,6];case 5:p.sent(),p.label=6;case 6:return[2,{accessKeyId:o,secretAccessKey:l,sessionToken:d,expiration:s,identityId:f}]}}))})).catch((function(e){return he(t,void 0,void 0,(function(){return ve(this,(function(t){throw e}))}))}));return this._loadCredentials(l,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this;return new Promise((function(a,s){e.then((function(e){return he(i,void 0,void 0,(function(){var i,s,c,u,l;return ve(this,(function(d){switch(d.label){case 0:if(ge.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),o._credentials=e,o._credentials.authenticated=n,o._credentials_source=t,o._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,c=r.token,u=r.expires_at,l=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:c,user:i,expires_at:u,identity_id:l}))}catch(f){ge.debug("Failed to put federated info into auth storage",f)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:d.sent(),d.label=2;case 2:return a(o._credentials),[2]}}))}))})).catch((function(t){if(t)return ge.debug("Failed to load credentials",e),ge.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(ge.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return he(this,void 0,void 0,(function(){return ve(this,(function(e){return this._credentials=null,this._credentials_source=null,ge.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return he(this,void 0,void 0,(function(){var e,t;return ve(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),ge.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}
2))}))},e.prototype._setGuestIdentityId=function(e){return he(this,void 0,void 0,(function(){var t,n;return ve(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),ge.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return he(this,void 0,void 0,(function(){var e;return ve(this,(function(t){return e=this._config.identityPoolId,ge.debug("removing ".concat(this._getCognitoIdentityIdStorageKey(e)," from storage")),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),be=new ye(null);u.H.register(be)},78868:function(e,t,n){"use strict";n.d(t,{Y:function(){return u}});var r=n(34549),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},a=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},s=new r.C("Hub"),c="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var u=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype._remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void s.warn("No listeners for ".concat(e));this.patterns=a([],o(this.patterns.filter((function(e){return e!==n}))),!1)}else{var r=this.listeners[e];if(!r)return void s.warn("No listeners for ".concat(e));this.listeners[e]=a([],o(r.filter((function(e){return e.callback!==t}))),!1)}},e.prototype.remove=function(e,t){this._remove(e,t)},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===c||s.warn("WARNING: ".concat(e," is protected and dispatching on it can have unintended consequences")));var o={channel:e,payload:i({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(a){s.error(a)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))s.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:n,callback:r})}return function(){i._remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){s.debug("Dispatching to ".concat(t," with "),n);try{r.callback(e)}catch(i){s.error(i)}})),this.patterns.length>0){if(!n.message)return void s.warn("Cannot perform pattern matching without a message
2key");var a=n.message;this.patterns.forEach((function(t){var n=a.match(t.pattern);if(n){var r=o(n).slice(1),c=i(i({},e),{patternInfo:r});try{t.callback(c)}catch(u){s.error(u)}}}))}},e}())("__default__")},64988:function(e,t,n){"use strict";n.d(t,{CI:function(){return c},Im:function(){return i},Jw:function(){return p},L_:function(){return v},VN:function(){return l},_P:function(){return a},gy:function(){return f},k8:function(){return s},kX:function(){return u},p7:function(){return d},q_:function(){return o},qo:function(){return h}});var r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],i=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,n){if(!e||!e.sort)return!1;var r=n&&"desc"===n?-1:1;return e.sort((function(e,n){var i=e[t],o=n[t];return void 0===o?void 0===i?0:1*r:void 0===i||i<o?-1*r:i>o?1*r:0})),!0},a=function(e,t){var n=Object.assign({},e);return t&&("string"==typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},s=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},c=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},u=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(62*Math.random())];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},d=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},f=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node}},p=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!v(e))return e;var r={};for(var i in e){if(e.hasOwnProperty(i))r[t.includes(i)?i:i[0].toLowerCase()+i.slice(1)]=n.includes(i)?e[i]:p(e[i],t,n)}return r},h=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!v(e))return e;var r={};for(var i in e){if(e.hasOwnProperty(i))r[t.includes(i)?i:i[0].toUpperCase()+i.slice(1)]=n.includes(i)?e[i]:h(e[i],t,n)}return r},v=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)}},34549:function(e,t,n){"use strict";n.d(t,{C:function(){return u}});var r,i=n(7025),o=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},c={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var u=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,i,a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];var u=this.level;if(e.LOG_LEVEL&&(u=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(u=window.LOG_LEVEL),c[t]>=c[u]){var l=console.log.bind(console);t===r.ERROR&&console.error&&(l=console.error.bind(console)),t===r.WARN&&console.warn&&(l=console.warn.bind(console));var d="[".concat(t,"] ").concat(this._ts()," ").concat(this.name),f="";if(1===a.length&&"string"==typeof a[0])l(f="".concat(d," - ").concat(a[0]));else if(1===a.length)f="".concat(d," ").concat(a[0]),l(d,a[0]);else if("string"==typeof a[0]){var p=a.slice(1);1===p.length&&(p=p[0]),f="".concat(d," - ").concat(a[0]," ").concat(p),l("".concat(d," - ").concat(a[0]),p)}else f="".concat(d," ").concat(a),l(d,a);try{for(var h=o(this._pluggables),v=h.next();!v.done;v=h.next()){var g=v.value,m={message:f,timestamp:Date.now()};g.pushLogs([m])}}catch(y){n={error:y}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],a(e),!1))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.INFO],a(e),!1))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.WARN],a(e),!1))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.ERROR],a(e),!1))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.DEBUG],a(e),!1))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,s([r.VERBOSE],a(e),!1))},e.prototype.addPluggable=function(e){e&&e.getCategoryName()===i.OU&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}()},59136:function(e,t,n){"use strict";n.d(t,{k:function(){return m},j:function(){return g}});var r=n(34549),i=n(64988),o=n(766),a=function(e,t,n,r){return new(n||(n=Prom
2ise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},c=new r.C("CognitoCredentials"),u=new Promise((function(e,t){return(0,i.gy)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(c.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(c.debug("not in the browser, directly resolved"),e())})),l=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(c.debug("need to wait for the Google SDK loaded"),[4,u]);case 1:e.sent(),this.initialized=!0,c.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return(0,i.gy)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(c.debug("google Auth undefined"),n(new o.OI("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(c.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new o.OI("Failed to reload google auth response"))}))):n(new o.OI("User is not signed in with Google"))})).catch((function(e){c.debug("Failed to refresh google token",e),n(new o.OI("Failed to refresh google token"))}))})):(c.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),d=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},f=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},p=new r.C("CognitoCredentials"),h=new Promise((function(e,t){return(0,i.gy)().isBrowser?window.FB?(p.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(p.debug("not in the browser, directly resolved"),e())})),v=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return d(this,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(p.debug("need to wait for the Facebook SDK loaded"),[4,h]);case 1:e.sent(),this.initialized=!0,p.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if((0,i.gy)().isBrowser&&(e=window.FB),!e){var t="no fb sdk available";return p.debug(t),Promise.reject(new o.OI(t))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,a=1e3*r.expires
2In+(new Date).getTime();if(!i){s="the jwtToken is undefined";p.debug(s),n(new o.OI(s))}t({token:i,expires_at:a})}else{var s="no response from facebook when refreshing the jwt token";p.debug(s),n(new o.OI(s))}}),{scope:"public_profile,email"})}))},e}(),g=new l,m=new v},85294:function(e,t,n){"use strict";n.d(t,{yl:function(){return p},e9:function(){return h}});var r=n(37070),i=function(){return void 0!==n.g},o=function(){return"undefined"!=typeof window},a=function(){return"undefined"!=typeof document},s=function(){return"undefined"!=typeof process},c=function(e,t){return!!Object.keys(e).find((function(e){return e.startsWith(t)}))};var u,l=[{platform:r.dT.Expo,detectionMethod:function(){return i()&&void 0!==n.g.expo}},{platform:r.dT.ReactNative,detectionMethod:function(){return"undefined"!=typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:r.dT.NextJs,detectionMethod:function(){return o()&&window.next&&"object"==typeof window.next}},{platform:r.dT.Nuxt,detectionMethod:function(){return o()&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:r.dT.Angular,detectionMethod:function(){var e=Boolean(a()&&document.querySelector("[ng-version]")),t=Boolean(o()&&void 0!==window.ng);return e||t}},{platform:r.dT.React,detectionMethod:function(){var e=function(e){return e.startsWith("_react")||e.startsWith("__react")};return a()&&Array.from(document.querySelectorAll("[id]")).some((function(t){return Object.keys(t).find(e)}))}},{platform:r.dT.VueJs,detectionMethod:function(){return o()&&c(window,"__VUE")}},{platform:r.dT.Svelte,detectionMethod:function(){return o()&&c(window,"__SVELTE")}},{platform:r.dT.WebUnknown,detectionMethod:function(){return o()}},{platform:r.dT.NextJsSSR,detectionMethod:function(){return i()&&(c(n.g,"__next")||c(n.g,"__NEXT"))}},{platform:r.dT.NuxtSSR,detectionMethod:function(){return i()&&void 0!==n.g.__NUXT_PATHS__}},{platform:r.dT.ReactSSR,detectionMethod:function(){return s()&&void 0!=={}&&!!Object.keys({}).find((function(e){return e.includes("react")}))}},{platform:r.dT.VueJsSSR,detectionMethod:function(){return i()&&c(n.g,"__VUE")}},{platform:r.dT.AngularSSR,detectionMethod:function(){var e;return s()&&"object"==typeof{}&&(null===(e={}.npm_lifecycle_script)||void 0===e?void 0:e.startsWith("ng "))||!1}},{platform:r.dT.SvelteSSR,detectionMethod:function(){return s()&&void 0!=={}&&!!Object.keys({}).find((function(e){return e.includes("svelte")}))}}];var d=[],f=!1,p=function(){if(!u){if(u=(null===(e=l.find((function(e){return e.detectionMethod()})))||void 0===e?void 0:e.platform)||r.dT.ServerSideUnknown,f)for(;d.length;)d.pop()();else d.forEach((function(e){return e()}));v(r.dT.ServerSideUnknown,10),v(r.dT.WebUnknown,10)}var e;return u},h=function(e){f||d.push(e)};function v(e,t){u!==e||f||setTimeout((function(){u=void 0,f=!0,setTimeout(p,1e3)}),t)}},71805:function(e,t,n){"use strict";n.d(t,{OD:function(){return c},fE:function(){return l},Ij:function(){return u}});var r=n(37070),i="5.3.17",o=n(85294),a=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s="aws-amplify",c=new(function(){function e(){this.userAgent="".concat(s,"/").concat(i)}return Object.defineProperty(e.prototype,"framework",{get:function(){return(0,o.yl)()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReactNative",{get:function(){return this.framework===r.dT.ReactNative||this.framework===r.dT.Expo},enumerable:!1,configurable:!0}),e.prototype.observeFrameworkChanges=function(e){(0,o.e9)(e)},e}()),u=function(e){var t=void 0===e?{}:e,n=t.category,r=t.action,a=(t.framework,[[s,i]]);return n&&a.push([n,r]),a.push(["framework",(0,o.yl)()]),a},l=function(e){return u(e).map((function(e){var t=a(e,2),n=t[0],r=t[1];return"".concat(n,"/").concat(r)})).join(" ")}},37070:function(e,t,n){"use strict";var r,i,o,a,s,c,u,l,d,f,p,h,v;n.d(t,{AY:function(){return d},BM:function(){return s},CG:function(){return h},CW:function(){return c},Fu:function(){return a},ID:function(){return u},Mv:function(){return p},b7:function(){return i},dT:function(){return r},r5:function(){return l},rQ:function(){return f},sZ:function(){return v},zJ:function(){return o}}),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"}(r||(r={})),function(e){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.Record="1",e.UpdateEndpoint="2"}(o||(o={})),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.FederatedSignIn="30"}(s||(s={})),function(e){e.Subscribe="1",e.GraphQl="2"}(c||(c={})),function(e){e.None="0"}(u||(u={})),function(e){e.None="0"}(l||(l={})),function(e){e.None="0"}(d||(d={})),function(e){e.Convert="1",e.Identify="2",e.Interpret="3"}(f||(f={})),function(e){e.Subscribe="1"}(p||(p={})),function(e){e.None="0"}(h||(h={})),function(e){e.Put="1",e.Get="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6"}(v||(v={}))},13385:function(e,t,n){"use strict";n.d(t,{l:function(){return P}});var r=n(10465),i=function(e){return Object.keys(e).map((function(e){return e.toLowerCase()})).sort().join(";")},o="X-Amz-Date",a="X-Amz-Security-Token",s="host",c=o.toLowerCase(),u=a.toLowerCase(),l="aws4_request",d="AWS4-HMAC-SHA256",f=function(e){var t,n,r=e.credentials,i=e.signingDate,o=void 0===i?new Date:i,a=e.signingRegion,s=e.signingService,c=e.uriEscapePath,u=void 0===c||c,d=r.accessKeyId,f=r.secretAccessKey,p=r.sessionToken,h=function(e){var t=e.toISOString().replace(/[:\-]|\.\d{3}/g,"");return{longDate:t,shortDate:t.slice(0,8)}}(o),v=h.longDate,g=h.shortDate;return{accessKeyId:d,credentialScope:(t=a,n=s,"".concat(g,"/").concat(t,"/").concat(n,"/").concat(l)),longDate:v,secretAccessKey:f,sessionToken:p,shortDate:g,signingRegion:a,signingService:s,uriEscapePath:u}},p=n(51063),h=n(60102),v=function(e,t){var n=new p.Sha256(e);return n.update(t),n.digestSync()},g=function(e,t){var n=v(e,t);return(0,h.n)(n)},m=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},y=function(e){return Object.entries(e).map((function(e){var t,n=m(e,2),r=n[0],i=n[1];return{key:r.toLowerCase(),value:null!==(t=null==i?void 0:i.trim().replace(/\s+/g," "))&&void 0!==t?t:""}})).sort((function(e,t){return e.key<t.key?-1:1})).map((function(e){return"".concat(e.key,":").concat(e.value,"\n")})).join("")},b=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,E)},E=function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())},w=function(e,t){return void 0===t&&(t=!0),e?t?encodeURIComponent(e).replace(/%2F/g,"/"):e:"/"},S=function(e){return null==e?"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855":T(e)?g(null,e):"UNSIGNED-PAYLOAD"},T=function(e){return"string"==typeof e||ArrayBuffer.isView(e)||I(e)},I=function(e){return"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)},N=function(e,t){var n=t.credentialScope,r=t.longDate,o=t.secretAccessKey,a=t.shortDate,s=t.signingRegion,c=t.signingService,u=function(e,t){var n,r=e.body,o=e.headers,a=e.method,s=e.url;return void 0===t&&(t=!0),[a,w(s.pathname,t),(n=s.searchParams,Array.from(n).sort((function(e,t){var n=b(e,2),r=n[0],i=n[1],o=b(t,2),a=o[0],s=o[1];return r===a?i<s?-1:1:r<a?-1:1})).map((function(e){var t=b(e,2),n=t[0],r=t[1];return"".concat(_(n),"=").concat(_(r))})).join("&")),y(o),i(o),S(r)].join("\n")}(e,t.uriEscapePath),f=function(e,t,n){return[d,e,t,n].join("\n")}(r,n,g(null,u)),p=g(function(e,t,n,r){var i="".concat("AWS4").concat(e),o=v(i,t),a=v(o,n),s=v(a,r);return v(s,l)}
2(o,a,s,c),f);return p},A=function(){return A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},A.apply(this,arguments)},C=function(){return C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)},O=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},k=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},D=function(){return D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},D.apply(this,arguments)},R=/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(.cn)?$/,P=function(){function e(){}return e.sign=function(e,t,n){if(e.headers=e.headers||{},e.body&&!e.data)throw new Error('The attribute "body" was found on the request object. Please use the attribute "data" instead.');var r=D(D({},e),{body:e.data,url:new URL(e.url)}),o=function(e,t){var n=f(t),r=n.accessKeyId,o=n.credentialScope,a=n.longDate,l=n.sessionToken,p=A({},e.headers);p[s]=e.url.host,p[c]=a,l&&(p[u]=l);var h=A(A({},e),{headers:p}),v=N(h,n),g="Credential=".concat(r,"/").concat(o),m="SignedHeaders=".concat(i(p)),y="Signature=".concat(v);return p.authorization="".concat(d," ").concat(g,", ").concat(m,", ").concat(y),h}(r,x(r,t,n));return o.url=o.url.toString(),o.headers.Authorization=o.headers.authorization,o.headers["X-Amz-Security-Token"]=o.headers["x-amz-security-token"],delete o.headers.authorization,delete o.headers["x-amz-security-token"],o},e.signUrl=function(e,t,n,r){var i="object"==typeof e?e.url:e,c="object"==typeof e?e.method:"GET",u={body:"object"==typeof e?e.body:void 0,method:c,url:new URL(i)},l=x(u,t,n,r),p=function(e,t){var n,r,i,c,u=e.body,l=e.method,p=void 0===l?"GET":l,h=e.url,v=t.expiration,g=O(t,["expiration"]),m=f(g),y=m.accessKeyId,b=m.credentialScope,_=m.longDate,E=m.sessionToken,w=new URL(h);Object.entries(C(C((n={},n["X-Amz-Algorithm"]=d,n["X-Amz-Credential"]="".concat(y,"/").concat(b),n[o]=_,n["X-Amz-SignedHeaders"]=s,n),v&&(r={},r["X-Amz-Expires"]=v.toString(),r)),E&&(i={},i[a]=E,i))).forEach((function(e){var t=k(e,2),n=t[0],r=t[1];w.searchParams.append(n,r)}));var S={body:u,headers:(c={},c[s]=h.host,c),method:p,url:w},T=N(S,m);return w.searchParams.append("X-Amz-Signature",T),w}(u,l);return t.session_token&&!L(l.signingService)&&p.searchParams.append(a,t.session_token),p.toString()},e}(),x=function(e,t,n,i){var o=null!=t?t:{},a=o.access_key,s=o.secret_key,c=o.session_token,u=M(e.url),l=u.region,d=u.service,f=null!=n?n:{},p=f.region,h=void 0===p?l:p,v=f.service,g=void 0===v?d:v,m=D({accessKeyId:a,secretAccessKey:s},L(g)?{sessionToken:c}:{});return D({credentials:m,signingDate:r.E.getDateWithClockOffset(),signingRegion:h,signingService:g},i&&{expiration:i})},M=function(e){var t,n=(null!==(t=e.host.match(R))&&void 0!==t?t:[]).slice(1,3);return"es"===n[1]&&(n=n.reverse()),{service:n[0],region:n[1]}},L=function(e){return"iotdevicegateway"!==e}},54769:function(e,t,n){"use strict";n.d(t,{X:function(){return i},i:function(){return o}});var r={},i=function(){function e(){}return e.setItem=function(e,t){return r[e]=t,r[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0},e.removeItem=function(e){return delete r[e]},e.clear=function(){return r={}},e}(),o=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=i}}return e.prototype.getStorage=function(){return this.storageWindow},e}()},92685:function(e,t,n){"use strict";n.d(t,{l:function(){return l}});var r=n(57427);function i(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(r){}return e}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?r.q(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=r.q(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),i(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=i(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var i;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=o(o({},this.cookies),((i={})[e]=t,i)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=r.l(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=o(o({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0}
2);this.cookies=o({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=r.l(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),s=n(64988),c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)},u=(0,s.gy)().isBrowser,l=function(){function e(e){void 0===e&&(e={}),this.cookies=new a,this.store=u?window.localStorage:Object.create(null),this.cookies=e.req?new a(decodeURIComponent(e.req.headers.cookie)):new a,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!1,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){this.setLocalItem(e,t);var n=e.split(".").pop();["LastAuthUser","accessToken","refreshToken","idToken"].includes(null!=n?n:"")&&this.setUniversalItem(e,t,{expires:new Date(Date.now()+31536e6)})},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t,n){void 0===n&&(n={}),this.cookies.set(e,t,c(c({},n),{path:"/",sameSite:!0,secure:!u||"localhost"!==window.location.hostname}))},e}()},7025:function(e,t,n){"use strict";n.d(t,{FE:function(){return u},OU:function(){return a},hp:function(){return c},pb:function(){return o},wK:function(){return i},wl:function(){return r},xU:function(){return s}});var r=26,i=1048576,o=256e3,a="Logging",s="AWSCloudWatch",c="No credentials",u=["ResourceNotFoundException","InvalidSequenceTokenException"]},10465:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var r=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i={clockOffset:0,getDateWithClockOffset:function(){return i.clockOffset?new Date((new Date).getTime()+i.clockOffset):new Date},getClockOffset:function(){return i.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=i.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=r(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6];return new Date(Date.UTC(Number(n),Number(i)-1,Number(o),Number(a),Number(s),Number(c)))},isClockSkewed:function(e){return Math.abs(e.getTime()-i.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){i.clockOffset=e}}},2917:function(e,t,n){"use strict";var r=n(64988),i=n(28117),o=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=function(){function e(){}return e.prototype.networkMonitor=function(t){if((0,r.gy)().isNode)return i.default.from([{online:!0}]);var n=(0,r.p7)()?self:window;return new i.default((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},i=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",i),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",i),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,i=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var a=o(e._observers),s=a.next();!s.done;s=a.next()){i(s.value)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},e._observers=[],e}();t.A=a},766:function(e,t,n){"use strict";n.d(t,{L5:function(){return p},OI:function(){return d},gD:function(){return f},hu:function(){return g},yN:function(){return v}});var r,i=n(34549),o=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}
2),a=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},c=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},u=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},l=new i.C("Util"),d=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return o(t,e),t}(Error),f=function(e){return e&&e.nonRetryable};function p(e,t,n,r){return a(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise((function(o,d){return a(i,void 0,void 0,(function(){var i,a,p,h,v,g,m;return s(this,(function(y){switch(y.label){case 0:i=0,a=!1,h=function(){},r&&r.then((function(){a=!0,clearTimeout(p),h()})),g=function(){var r,g,m,y;return s(this,(function(s){switch(s.label){case 0:i++,l.debug("".concat(e.name," attempt #").concat(i," with this vars: ").concat(JSON.stringify(t))),s.label=1;case 1:return s.trys.push([1,3,,7]),r={},g=o,[4,e.apply(void 0,u([],c(t),!1))];case 2:return[2,(r.value=g.apply(void 0,[s.sent()]),r)];case 3:return m=s.sent(),v=m,l.debug("error on ".concat(e.name),m),f(m)?(l.debug("".concat(e.name," non retryable error"),m),[2,{value:d(m)}]):(y=n(i,t,m),l.debug("".concat(e.name," retrying in ").concat(y," ms")),!1===y||a?[2,{value:d(m)}]:[3,4]);case 4:return[4,new Promise((function(e){h=e,p=setTimeout(h,y)}))];case 5:s.sent(),s.label=6;case 6:return[3,7];case 7:return[2]}}
2))},y.label=1;case 1:return a?[3,3]:[5,g()];case 2:return"object"==typeof(m=y.sent())?[2,m.value]:[3,1];case 3:return d(v),[2]}}))}))}))]}))}))}var h=3e5;function v(e){void 0===e&&(e=h);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var g=function(e,t,n,r){return void 0===n&&(n=h),p(e,t,v(n),r)}},32658:function(e,t,n){"use strict";function r(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function i(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}n.d(t,{l:function(){return i},r:function(){return r}})},35166:function(e,t,n){"use strict";n.d(t,{Y:function(){return i},b:function(){return r}});var r="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",i="x-amz-user-agent"},66562:function(e,t,n){"use strict";n.r(t),n.d(t,{AWSCloudWatchProvider:function(){return Rr},AWS_CLOUDWATCH_BASE_BUFFER_SIZE:function(){return Nr.wl},AWS_CLOUDWATCH_CATEGORY:function(){return Nr.OU},AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE:function(){return Nr.wK},AWS_CLOUDWATCH_MAX_EVENT_SIZE:function(){return Nr.pb},AWS_CLOUDWATCH_PROVIDER_NAME:function(){return Nr.xU},Amplify:function(){return r.H},AmplifyClass:function(){return r.N},AnalyticsAction:function(){return Br.zJ},ApiAction:function(){return Br.Fu},AppState:function(){return Lr},AsyncStorage:function(){return Ur},AuthAction:function(){return Br.BM},BackgroundManagerNotOpenError:function(){return zr},BackgroundProcessManager:function(){return Hr},BackgroundProcessManagerState:function(){return yr},Category:function(){return Br.b7},ClientDevice:function(){return c},ConsoleLogger:function(){return o.C},Constants:function(){return Xr},Credentials:function(){return Ir.J},CredentialsClass:function(){return Ir.j},DataStoreAction:function(){return Br.CW},DateUtils:function(){return Jr.E},FacebookOAuth:function(){return Pr.k},Framework:function(){return Br.dT},GeoAction:function(){return Br.ID},GoogleOAuth:function(){return Pr.j},Hub:function(){return d.Y},I18n:function(){return y},INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER:function(){return Vr.b},InAppMessagingAction:function(){return Br.r5},InteractionsAction:function(){return Br.AY},Linking:function(){return Mr},Logger:function(){return o.C},MemoryStorage:function(){return xr.X},Mutex:function(){return Wr},NO_CREDS_ERROR_STRING:function(){return Nr.hp},NonRetryableError:function(){return Qr.OI},Platform:function(){return i.OD},PredictionsAction:function(){return Br.rQ},PubSubAction:function(){return Br.Mv},PushNotificationAction:function(){return Br.CG},RETRY_ERROR_CODES:function(){return Nr.FE},Reachability:function(){return Zr.A},ServiceWorker:function(){return Fr},Signer:function(){return gt.l},StorageAction:function(){return Br.sZ},StorageHelper:function(){return xr.i},USER_AGENT_HEADER:function(){return Vr.Y},UniversalStorage:function(){return jr.l},browserOrNode:function(){return vt.gy},default:function(){return ei},filenameToContentType:function(){return vt.k8},generateRandomString:function(){return vt.kX},getAmplifyUserAgent:function(){return i.fE},getAmplifyUserAgentObject:function(){return i.Ij},invalidParameter:function(){return l},isEmpty:function(){return vt.Im},isNonRetryableError:function(){return Qr.gD},isStrictObject:function(){return vt.L_},isTextFile:function(){return vt.CI},isWebWorker:function(){return vt.p7},jitteredBackoff:function(){return Qr.yN},jitteredExponentialRetry:function(){return Qr.hu},makeQuerablePromise:function(){return vt.VN},missingConfig:function(){return u},objectLessAttributes:function(){return vt._P},parseAWSExports:function(){return mt.s},retry:function(){return Qr.L5},sortByField:function(){return vt.q_},transferKeyToLowerCase:function(){return vt.Jw},transferKeyToUpperCase:function(){return vt.qo},urlSafeDecode:function(){return $r.l},urlSafeEncode:function(){return $r.r}});var r=n(88319),i=n(71805),o=n(34549),a=new o.C("ClientDevice_Browser");function s(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return a.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return a.warn("No navigator object available to get browser client info"),{};var t=e.platform,n=e.product,r=e.vendor,i=e.userAgent,o=e.language,s=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var n=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var r=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var i=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};
2var o=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(o)return{type:o[1],version:o[2]};var a=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);if(a)return{type:a[1],version:a[2]};return{type:"",version:""}}(i),c=(u=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),u&&u[1]||"");var u;return{platform:t,make:n||r,model:s.type,version:s.version,appVersion:[s.type,s.version].join("/"),language:o,timezone:c}}()}var c=function(){function e(){}return e.clientInfo=function(){return s()},e.dimension=function(){return"undefined"==typeof window?(a.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}();function u(e){return new Error("Missing config value of "+e)}function l(e){return new Error("Invalid parameter value of "+e)}var d=n(78868),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},f.apply(this,arguments)},p=new o.C("I18n"),h=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!=typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),p.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return void 0!==t?t:e;var n=this._lang,r=this.getByLanguage(e,n);return r||(n.indexOf("-")>0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),this._dict[e]=f(f({},n),t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),v=new o.C("I18n"),g=null,m=null,y=function(){function e(){}return e.configure=function(t){return v.debug("configure I18n"),t?(g=Object.assign({},g,t.I18n||t),e.createInstance(),g):g},e.getModuleName=function(){return"I18n"},e.createInstance=function(){v.debug("create I18n instance"),m||(m=new h(g))},e.setLanguage=function(t){return e.checkConfig(),m.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?m.get(t,n):void 0===n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),m.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),m.putVocabularies(t)},e.checkConfig=function(){return m||(m=new h(g)),!0},e}();r.H.register(y);var b,_,E,w,S,T,I,N,A,C,O,k,D,R,P,x,M,L,U,F,j,B,V,G,q,Y,K,H,z,W,J,Q,Z,$,X,ee,te,ne,re,ie,oe,ae,se,ce,ue,le,de,fe,pe,he,ve,ge,me,ye,be,_e,Ee,we,Se,Te,Ie,Ne,Ae,Ce,Oe,ke,De,Re,Pe,xe,Me,Le,Ue,Fe,je,Be,Ve,Ge,qe,Ye,Ke,He,ze,We,Je,Qe,Ze,$e,Xe,et,tt,nt,rt,it,ot,at,st,ct,ut,lt,dt,ft,pt,ht,vt=n(64988),gt=n(13385),mt=n(3976),yt=n(46528);!function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(b||(b={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(_||(_={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(E||(E={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(w||(w={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(S||(S={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(T||(T={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(I||(I={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(N||(N={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(A||(A={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(C||(C={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(O||(O={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(k||(k={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(D||(D={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(R||(R={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(P||(P={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(x||(x={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(M||(M={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(L||(L={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(U||(U={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(F||(F={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(j||(j={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(B||(B={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(V||(V={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(G||(G={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(q||(q={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Y||(Y={})),function(e){e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.PENDING="PENDING",e.PENDING_CANCEL="PENDING_CANCEL",e.RUNNING="RUNNING"}(K||(K={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(H||(H={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(z||(z={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(W||(W={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(J||(J={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Q||(Q={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Z||(Z={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}($||($={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(X||(X={})),function(e){e.LastEventTime="LastEventTime",e.LogStreamName="LogStreamName"}(ee||(ee={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(te||(te={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ne||(ne={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(re||(re={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ie||(ie={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(oe||(oe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ae||(ae={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(se||(se={})),function(e){e.Cancelled="Cancelled",e.Complete="Complete",e.Failed="Failed",e.Running="Running",e.Scheduled="Scheduled"}(ce||(ce={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ue||(ue={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(le||(le={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(de||(de={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(fe||(fe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(pe||(pe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(he||(he={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ve||(ve={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ge||(ge={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(me||(me={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ye||(ye={})),function(e){e.ByLogStream="ByLogStream",e.Random="Random"}(be||(be={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(_e||(_e={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ee||(Ee={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(we||(we={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Se||(Se={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Te||(Te={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ie||(Ie={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ne||(Ne={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ae||(Ae={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ce||(Ce={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Oe||(Oe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ke||(ke={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(De||(De={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Re||(Re={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Pe||(Pe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(xe||(xe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Me||(Me={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Le||(Le={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ue||(Ue={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Fe||(Fe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(je||(je={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Be||(Be={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ve||(Ve={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ge||(Ge={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(qe||(qe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ye||(Ye={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ke||(Ke={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(He||(He={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ze||(ze={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(We||(We={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Je||(Je={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Qe||(Qe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Ze||(Ze={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}($e||($e={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(Xe||(Xe={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(et||(et={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(tt||(tt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(nt||(nt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(rt||(rt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(it||(it={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ot||(ot={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(at||(at={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(st||(st={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ct||(ct={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ut||(ut={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(lt||(lt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(dt||(dt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ft||(ft={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(pt||(pt={})),function(e){e.filterSensitiveLog=function(e){return(0,yt.Cl)({},e)}}(ht||(ht={}));var bt=n(87203),_t=n(15215),Et={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},wt={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function St(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var i,o;return(0,_t.__generator)(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:return i=a.sent().response,[4,t(i,e)];case 2:return o=a.sent(),[2,{response:i,output:o}]}}))}))}}}(e,n),Et),r.add(function(e,t){return function(n,r){return function(r){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var i;return(0,_t.__generator)(this,(function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return i=o.sent(),[2,n((0,_t.__assign)((0,_t.__assign)({},r),{request:i}))]}}))}))}}}(e,t),wt)}}}var Tt=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,(0,_t.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,(0,_t.__assign)({},e))})),n},i=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,_t.__spread)(i(e)))}
2)),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,(0,_t.__spread)(i(e)))})),t},o=function(){var n,r=[],o=[],a={};return e.forEach((function(e){var t=(0,_t.__assign)((0,_t.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),r.push(t)})),t.forEach((function(e){var t=(0,_t.__assign)((0,_t.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),o.push(t)})),o.forEach((function(e){if(e.toMiddleware){var t=a[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return It[t.step]-It[e.step]||Nt[t.priority||"normal"]-Nt[e.priority||"normal"]}))).map(i).reduce((function(e,t){return e.push.apply(e,(0,_t.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},a={add:function(t,r){void 0===r&&(r={});var i=r.name,o=r.override,a=(0,_t.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var s=e.findIndex((function(e){return e.name===i})),c=e[s];if(c.step!==a.step||c.priority!==a.priority)throw new Error('"'+i+'" middleware with '+c.priority+" priority in "+c.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(s,1)}n.add(i)}e.push(a)},addRelativeTo:function(e,r){var i=r.name,o=r.override,a=(0,_t.__assign)({middleware:e},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var s=t.findIndex((function(e){return e.name===i})),c=t[s];if(c.toMiddleware!==a.toMiddleware||c.relation!==a.relation)throw new Error('"'+i+'" middleware '+c.relation+' "'+c.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(s,1)}n.add(i)}t.push(a)},clone:function(){return r(Tt())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var i=!1,o=function(e){return!e.name||e.name!==r||(i=!0,n.delete(r),!1)};return e=e.filter(o),t=t.filter(o),i}(r):function(r){var i=!1,o=function(e){return e.middleware!==r||(i=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(o),t=t.filter(o),i}(r)},removeByTag:function(r){var i=!1,o=function(e){var t=e.tags,o=e.name;return!t||!t.includes(r)||(o&&n.delete(o),i=!0,!1)};return e=e.filter(o),t=t.filter(o),i},concat:function(e){var t=r(Tt());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var i=(0,_t.__values)(o().reverse()),a=i.next();!a.done;a=i.next()){e=(0,a.value)(e,t)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e}};return a},It={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Nt={high:3,normal:2,low:1},At=function(){function e(e){this.middlewareStack=Tt(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then((function(e){return e.output}));o(e).then((function(e){return i(null,e.output)}),(function(e){return i(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),Ct=function(){this.middlewareStack=Tt()},Ot=function(){var e=Object.getPrototypeOf(this).constructor,t=new(Function.bind.apply(String,(0,_t.__spread)([null],arguments)));return Object.setPrototypeOf(t,e.prototype),t};Ot.prototype=Object.create(String.prototype,{constructor:{value:Ot,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(Ot,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}(0,_t.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(Ot);var kt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogGroupCommand",inputFilterSensitiveLog:k.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.mD)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt.hb)(e,t)},t}(Ct),Dt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogGroupsCommand",inputFilterSensitiveLog:Z.filterSensitiveLog,outputFilterSensitiveLog:X.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.CV)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt.rd)(e,t)},t}(Ct),Rt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogStreamCommand",inputFilterSensitiveLog:D.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.J$)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt.m4)(e,t)},t}(Ct),Pt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogStreamsCommand",inputFilterSensitiveLog:te.filterSensitiveLog,outputFilterSensitiveLog:re.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.XG)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt.gU)(e,t)},t}(Ct),xt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"GetLogEventsCommand",inputFilterSensitiveLog:Ae.filterSensitiveLog,outputFilterSensitiveLog:Oe.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.In)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt.hG)(e,t)},t}(Ct),Mt=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return(0,yt.C6)(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(St(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"PutLogEventsCommand",inputFilterSensitiveLog:He.filterSensitiveLog,outputFilterSensitiveLog:We.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return(0,bt.vB)(e,t)},t.prototype.deserialize=function(e,t){return(0,bt._I)(e,t)},t}(Ct),Lt=n(36634),Ut=n(84834),Ft=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,jt)},jt=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Bt=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var i=new Error("Request aborted");return i.name="AbortError",Promise.reject(i)}var o=e.path;if(e.query){var a=function(e){var t,n,r=[];try{for(var i=(0,_t.__values)(Object.keys(e).sort()),o=i.next();!o.done;o=i.next()){var a=o.value,s=e[a];if(a=Ft(a),Array.isArray(s))for(var c=0,u=s.length;c<u;c++)r.push(a+"="+Ft(s[c]));else{var l=a;(s||"string"==typeof s)&&(l+="="+Ft(s)),r.push(l)}}}catch(d){t={error:d}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.join("&")}(e.query);a&&(o+="?"+a)}var s=e.port,c=e.method,u=e.protocol+"//"+e.hostname+(s?":"+s:"")+o,l={body:"GET"===c||"HEAD"===c?void 0:e.body,headers:new Headers(e.headers),method:c};"undefined"!=typeof AbortController&&(l.signal=n);
2var d,f=new Request(u,l),p=[fetch(f).then((function(e){var t,n,r=e.headers,i={};try{for(var o=(0,_t.__values)(r.entries()),a=o.next();!a.done;a=o.next()){var s=a.value;i[s[0]]=s[1]}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new Ut.cS({headers:i,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new Ut.cS({headers:i,statusCode:e.status,body:t})}}))})),(d=r,void 0===d&&(d=0),new Promise((function(e,t){d&&setTimeout((function(){var e=new Error("Request did not complete within "+d+" ms");e.name="TimeoutError",t(e)}),d)})))];return n&&p.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(p)},e}(),Vt={},Gt=new Array(64),qt=0,Yt="A".charCodeAt(0),Kt="Z".charCodeAt(0);qt+Yt<=Kt;qt++){var Ht=String.fromCharCode(qt+Yt);Vt[Ht]=qt,Gt[qt]=Ht}for(qt=0,Yt="a".charCodeAt(0),Kt="z".charCodeAt(0);qt+Yt<=Kt;qt++){Ht=String.fromCharCode(qt+Yt);var zt=qt+26;Vt[Ht]=zt,Gt[zt]=Ht}for(qt=0;qt<10;qt++){Vt[qt.toString(10)]=qt+52;Ht=qt.toString(10),zt=qt+52;Vt[Ht]=zt,Gt[zt]=Ht}Vt["+"]=62,Gt[62]="+",Vt["/"]=63,Gt[63]="/";var Wt=6,Jt=8;function Qt(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),i=0;i<e.length;i+=4){for(var o=0,a=0,s=i,c=i+3;s<=c;s++)"="!==e[s]?(o|=Vt[e[s]]<<(c-s)*Wt,a+=Wt):o>>=Wt;var u=i/4*3;o>>=a%Jt;for(var l=Math.floor(a/Jt),d=0;d<l;d++){var f=(l-d-1)*Jt;r.setUint8(u+d,(o&255<<f)>>f)}}return new Uint8Array(n)}function Zt(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var i=null!==(e=r.result)&&void 0!==e?e:"",o=i.indexOf(","),a=o>-1?o+1:i.length;t(i.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var $t={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Xt=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var i;return(0,_t.__generator)(this,(function(o){return(null===(i=null==e?void 0:e.retryStrategy)||void 0===i?void 0:i.mode)&&(n.userAgent=(0,_t.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),$t)}}},en=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],tn=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],nn=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],rn=[500,502,503,504],on=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||tn.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},an=n(68414),sn=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},cn=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return en.includes(e.name)}(e)||on(e)||function(e){var t;return nn.includes(e.name)||rn.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},un="standard",ln=function(){function e(e,t){var n,r,i,o,a,s,c,u;this.maxAttemptsProvider=e,this.mode=un,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:cn,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:sn,this.retryQuota=null!==(i=null==t?void 0:t.retryQuota)&&void 0!==i?i:(a=o=500,s=o,c=function(e){return"TimeoutError"===e.name?10:5},u=function(e){return c(e)<=s},Object.freeze({hasRetryTokens:u,retrieveRetryTokens:function(e){if(!u(e))throw new Error("No retry token available");var t=c(e);return s-=t,t},releaseRetryTokens:function(e){s+=null!=e?e:1,s=Math.min(s,a)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var e;return(0,_t.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvi
2der()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,u;return(0,_t.__generator)(this,(function(l){switch(l.label){case 0:return r=0,i=0,[4,this.getMaxAttempts()];case 1:o=l.sent(),a=t.request,Ut.Kd.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=(0,an.v4)()),s=function(){var s,u,l,d,f;return(0,_t.__generator)(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,5]),Ut.Kd.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+o),[4,e(t)];case 1:return s=p.sent(),u=s.response,l=s.output,c.retryQuota.releaseRetryTokens(n),l.$metadata.attempts=r+1,l.$metadata.totalRetryDelay=i,[2,{value:{response:u,output:l}}];case 2:return d=p.sent(),r++,c.shouldRetry(d,r,o)?(n=c.retryQuota.retrieveRetryTokens(d),f=c.delayDecider(on(d)?500:100,r),i+=f,[4,new Promise((function(e){return setTimeout(e,f)}))]):[3,4];case 3:return p.sent(),[2,"continue"];case 4:throw d.$metadata||(d.$metadata={}),d.$metadata.attempts=r,d.$metadata.totalRetryDelay=i,d;case 5:return[2]}}
2))},c=this,l.label=2;case 2:return[5,s()];case 3:return"object"==typeof(u=l.sent())?[2,u.value]:[3,2];case 4:return[2]}}))}))},e}(),dn=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var fn=n(46880),pn=n.n(fn);var hn="logs.{region}.amazonaws.com",vn=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),gn=new Set(["cn-north-1","cn-northwest-1"]),mn=new Set(["us-iso-east-1"]),yn=new Set(["us-isob-east-1"]),bn=new Set(["us-gov-east-1","us-gov-west-1"]);var _n,En,wn,Sn,Tn={apiVersion:"2014-03-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"logs.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"logs.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"logs.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"logs.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"logs.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"logs.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"logs.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"logs.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"logs.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"logs.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"logs.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"logs.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"logs.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"logs.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"logs.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"logs.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"logs-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"logs-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"logs-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"logs-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"logs.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"logs.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"logs.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"logs.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"logs.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"logs.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"logs.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"logs.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"logs.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"logs.us-west-2.amazonaws.com",partition:"aws"};break;default:vn.has(e)&&(n={hostname:hn.replace("{region}",e),partition:"aws"}),gn.has(e)&&(n={hostname:"logs.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),mn.has(e)&&(n={hostname:"logs.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),yn.has(e)&&(n={hostname:"logs.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),bn.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:hn.replace("{region}",e),partition:"aws"})}return Promise.resolve((0,yt.Cl)({signingService:"logs"},n))},serviceId:"CloudWatch Logs",urlParser:function(e){var t,n=new URL(e),r=n.hostname,i=n.pathname,o=n.port,a=n.protocol,s=n.search;return s&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var i=(0,_t.__values)(e.split("&")),o=i.next();!o.done;o=i.next()){var a=o.value,s=(0,_t.__read)(a.split("="),2),c=s[0],u=s[1],l=void 0===u?null:u;c=decodeURIComponent(c),l&&(l=decodeURIComponent(l)),c in r?Array.isArray(r[c])?r[c].push(l):r[c]=[r[c],l]:r[c]=l}}catch(d){t={error:d}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(s)),{hostname:r,port:o?parseInt(o):void 0,protocol:a,path:i,query:t}}},In=(0,yt.Cl)((0,yt.Cl)({},Tn),{runtime:"browser",base64Decoder:Qt,base64Encoder:function(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,i=0,o=n,a=Math.min(n+3,e.length);o<a;o++)r|=e[o]<<(a-o-1)*Jt,i+=Jt;var s=Math.ceil(i/Wt);r<<=s*Wt-i;for(var c=1;c<=s;c++){var u=(s-c)*Wt;t+=Gt[(r&63<<u)>>u]}t+="==".slice(0,4-s)}return t},bodyLengthChecker:function(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0},credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:(En={serviceId:Tn.serviceId,clientVersion:"3.6.1"},wn=En.serviceId,Sn=En.clientVersion,function(){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var e,t,n,r,i,o,a,s,c;return(0,_t.__generator)(this,(function(u){return e=(null===(n=null===window||void 0===window?void 0:window.navigator)||void 0===n?void 0:n.userAgent)?pn().parse(window.navigator.userAgent):void 0,t=[["aws-sdk-js",Sn],["os/"+((null===(r=null==e?void 0:e.os)||void 0===r?void 0:r.name)||"other"),null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.version],["lang/js"],["md/browser",(null!==(a=null===(o=null==e?void 0:e.browser)||void 0===o?void 0:o.name)&&void 0!==a?a:"unknown")+"_"+(null!==(c=null===(s=null==e?void 0:e.browser)||void 0===s?void 0:s.version)&&void 0!==c?c:"unknown")]],wn&&t.push(["api/"+wn,Sn]),[2,t]}))}
2))}),maxAttempts:3,region:(_n="Region is missing",function(){return Promise.reject(_n)}),requestHandler:new Bt,sha256:Lt.Sha256,streamCollector:function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var t,n;return(0,_t.__generator)(this,(function(r){switch(r.label){case 0:return[4,Zt(e)];case 1:return t=r.sent(),n=Qt(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return(0,_t.__generator)(this,(function(c){switch(c.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,c.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return i=c.sent(),o=i.done,(a=i.value)&&(s=t,(t=new Uint8Array(s.length+a.length)).set(s),t.set(a,s.length)),r=o,[3,1];case 3:return[2,t]}}))}))}(e)},utf8Decoder:function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},utf8Encoder:function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var a="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}),Nn=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var i=Promise.resolve(t);return function(){return i}}return t},An=function(e){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,i,o;return(0,_t.__generator)(this,(function(a){switch(a.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=a.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(i=(null!==(o=a.sent())&&void 0!==o?o:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+i)]}}))}))},Cn=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},On="content-length";var kn={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Dn=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return(0,_t.__awaiter)(t,void 0,void 0,(function(){var t,i,o,a,s;return(0,_t.__generator)(this,(function(c){return t=r.request,Ut.Kd.isInstance(t)&&(i=t.body,o=t.headers,i&&-1===Object.keys(o).map((function(e){return e.toLowerCase()})).indexOf(On)&&void 0!==(a=e(i))&&(t.headers=(0,_t.__assign)((0,_t.__assign)({},t.headers),((s={})[On]=String(a),s)))),[2,n((0,_t.__assign)((0,_t.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),kn)}}};var Rn={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Pn=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var r,i;return(0,_t.__generator)(this,(function(o){return Ut.Kd.isInstance(n.request)?(r=n.request,(void 0===(i=(e.requestHandler.metadata||{}).handlerProtocol)?"":i).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),Rn)}}},xn={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Mn=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var r,i,o,a,s,c,u,l,d;return(0,_t.__generator)(this,(function(f){switch(f.label){case 0:return r=t.clientName,i=t.commandName,o=t.inputFilterSensitiveLog,a=t.logger,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return c=f.sent(),a?("function"==typeof a.info&&(u=c.output,l=u.$metadata,d=(0,_t.__rest)(u,["$metadata"]),a.info({clientName:r,commandName:i,input:o(n.input),output:s(d),metadata:l})),[2,c]):[2,c]}}))}))}}),xn)}}},Ln=n(60102),Un="X-Amz-Date",Fn="X-Amz-Signature",jn="X-Amz-Security-Token",Bn="authorization",Vn=Un.toLowerCase(),Gn=[Bn,Vn,"date"],qn=Fn.toLowerCase(),Yn="x-amz-content-sha256",Kn=jn.toLowerCase(),Hn={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},zn=/^proxy-/,Wn=/^sec-/,Jn="AWS4-HMAC-SHA256",Qn="AWS4-HMAC-SHA256-PAYLOAD",Zn="aws4_request",$n={},Xn=[];function er(e,t,n){return e+"/"+t+"/"+n+"/"+Zn}function tr(e,t,n){var r=new e(t);return r.update(n),r.digest()}function nr(e,t,n){var r,i,o=e.headers,a={};try{for(var s=(0,_t.__values)(Object.keys(o).sort()),c=s.next();!c.done;c=s.next()){var u=c.value,l=u.toLowerCase();(l in Hn||(null==t?void 0:t.has(l))||zn.test(l)||Wn.test(l))&&(!n||n&&
2!n.has(l))||(a[l]=o[u].trim().replace(/\s+/g," "))}}catch(d){r={error:d}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}function rr(e,t){var n=e.headers,r=e.body;return(0,_t.__awaiter)(this,void 0,void 0,(function(){var e,i,o,a,s,c,u;return(0,_t.__generator)(this,(function(l){switch(l.label){case 0:try{for(e=(0,_t.__values)(Object.keys(n)),i=e.next();!i.done;i=e.next())if((o=i.value).toLowerCase()===Yn)return[2,n[o]]}catch(f){c={error:f}}finally{try{i&&!i.done&&(u=e.return)&&u.call(e)}finally{if(c)throw c.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(d=r,"function"==typeof ArrayBuffer&&d instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(d))?((a=new t).update(r),s=Ln.n,[4,a.digest()]):[3,3];case 2:return[2,s.apply(void 0,[l.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var d}))}))}function ir(e){var t=e.headers,n=e.query,r=(0,_t.__rest)(e,["headers","query"]);return(0,_t.__assign)((0,_t.__assign)({},r),{headers:(0,_t.__assign)({},t),query:n?or(n):void 0})}function or(e){return Object.keys(e).reduce((function(t,n){var r,i=e[n];return(0,_t.__assign)((0,_t.__assign)({},t),((r={})[n]=Array.isArray(i)?(0,_t.__spread)(i):i,r))}),{})}function ar(e){var t,n;e="function"==typeof e.clone?e.clone():ir(e);try{for(var r=(0,_t.__values)(Object.keys(e.headers)),i=r.next();!i.done;i=r.next()){var o=i.value;Gn.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function sr(e){return function(e){if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var cr=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,i=e.service,o=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=i,this.sha256=o,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=dr(r),this.credentialProvider=fr(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),(0,_t.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,u,l,d,f,p,h,v,g,m,y,b,_,E,w,S,T,I;return(0,_t.__generator)(this,(function(N){switch(N.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,i=t.expiresIn,o=void 0===i?3600:i,a=t.unsignableHeaders,s=t.unhoistableHeaders,c=t.signableHeaders,u=t.signingRegion,l=t.signingService,[4,this.credentialProvider()];case 1:return d=N.sent(),null==u?[3,2]:(p=u,[3,4]);case 2:return[4,this.regionProvider()];case 3:p=N.sent(),N.label=4;case 4:return f=p,h=ur(r),v=h.longDate,g=h.shortDate,o>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=er(g,f,null!=l?l:this.service),y=function(e,t){var n,r,i;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():ir(e),a=o.headers,s=o.query,c=void 0===s?{}:s;try{for(var u=(0,_t.__values)(Object.keys(a)),l=u.next();!l.done;l=u.next()){var d=l.value,f=d.toLowerCase();"x-amz-"!==f.substr(0,6)||(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(f))||(c[d]=a[d],delete a[d])}}catch(p){n={error:p}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return(0,_t.__assign)((0,_t.__assign)({},e),{headers:a,query:c})}(ar(e),{unhoistableHeaders:s}),d.sessionToken&&(y.query[jn]=d.sessionToken),y.query["X-Amz-Algorithm"]=Jn,y.query["X-Amz-Credential"]=d.accessKeyId+"/"+m,y.query[Un]=v,y.query["X-Amz-Expires"]=o.toString(10),b=nr(y,a,c),y.query["X-Amz-SignedHeaders"]=lr(b),_=y.query,E=Fn,w=this.getSignature,S=[v,m,this.getSigningKey(d,f,g,l)],T=this.createCanonicalRequest,I=[y,b],[4,rr(e,this.sha256)]);case 5:return[4,w.apply(this,S.concat([T.apply(this,I.concat([N.sent()]))]))];case 6:return _[E]=N.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return(0,_t.__awaiter)(this,void 0,void 0,(function(){return(0,_t.__generator)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))}
2,e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,i=t.signingDate,o=void 0===i?new Date:i,a=t.priorSignature,s=t.signingRegion,c=t.signingService;return(0,_t.__awaiter)(this,void 0,void 0,(function(){var e,t,i,u,l,d,f,p,h,v,g;return(0,_t.__generator)(this,(function(m){switch(m.label){case 0:return null==s?[3,1]:(t=s,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,i=ur(o),u=i.shortDate,l=i.longDate,d=er(u,e,null!=c?c:this.service),[4,rr({headers:{},body:r},this.sha256)];case 4:return f=m.sent(),(p=new this.sha256).update(n),v=Ln.n,[4,p.digest()];case 5:return h=v.apply(void 0,[m.sent()]),g=[Qn,l,d,a,h,f].join("\n"),[2,this.signString(g,{signingDate:o,signingRegion:e,signingService:c})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signingRegion,a=n.signingService;return(0,_t.__awaiter)(this,void 0,void 0,(function(){var t,n,r,s,c,u,l,d;return(0,_t.__generator)(this,(function(f){switch(f.label){case 0:return[4,this.credentialProvider()];case 1:return t=f.sent(),null==o?[3,2]:(r=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=f.sent(),f.label=4;case 4:return n=r,s=ur(i).shortDate,l=(u=this.sha256).bind,[4,this.getSigningKey(t,n,s,a)];case 5:return(c=new(l.apply(u,[void 0,f.sent()]))).update(e),d=Ln.n,[4,c.digest()];case 6:return[2,d.apply(void 0,[f.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signableHeaders,a=n.unsignableHeaders,s=n.signingRegion,c=n.signingService;return(0,_t.__awaiter)(this,void 0,void 0,(function(){var t,n,r,u,l,d,f,p,h,v,g;return(0,_t.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==s?[3,2]:(r=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,u=ar(e),l=ur(i),d=l.longDate,f=l.shortDate,p=er(f,n,null!=c?c:this.service),u.headers[Vn]=d,t.sessionToken&&(u.headers[Kn]=t.sessionToken),[4,rr(u,this.sha256)];case 5:return h=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var i=(0,_t.__values)(Object.keys(t)),o=i.next();!o.done;o=i.next())if(e===o.value.toLowerCase())return!0}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1}(Yn,u.headers)&&this.applyChecksum&&(u.headers[Yn]=h),v=nr(u,a,o),[4,this.getSignature(d,p,this.getSigningKey(t,n,f,c),this.createCanonicalRequest(u,v,h))];case 6:return g=m.sent(),u.headers[Bn]=Jn+" Credential="+t.accessKeyId+"/"+p+", SignedHeaders="+lr(v)+", Signature="+g,[2,u]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,i=void 0===r?{}:r,o=[],a={},s=function(e){if(e.toLowerCase()===qn)return"continue";o.push(e);var t=i[e];"string"==typeof t?a[e]=Ft(e)+"="+Ft(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Ft(e)+"="+Ft(n)])}),[]).join("&"))};try{for(var c=(0,_t.__values)(Object.keys(i).sort()),u=c.next();!u.done;u=c.next())s(u.value)}catch(l){t={error:l}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return o.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var r,i;return(0,_t.__generator)(this,(function(o){switch(o.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return i=o.sent(),[2,Jn+"\n"+e+"\n"+t+"\n"+(0,Ln.n)(i)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var i,o,a,s,c;return(0,_t.__generator)(this,(function(u){switch(u.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return i=u.sent(),s=(a=this.sha256).bind,[4,n];case 2:return(o=new(s.apply(a,[void 0,u.sent()]))).update(i),c=Ln.n,[4,o.digest()];case 3:return[2,c.apply(void 0,[u.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,i){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var o,a,s,c,u,l,d,f,p;return(0,_t.__generator)(this,(function(h){switch(h.label){case 0:return[4,tr(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=h.sent(),(a=n+":"+r+":"+i+":"+(0,Ln.n)(o)+":"+t.sessionToken)in $n)return[2,$n[a]];for(Xn.push(a);Xn.length>50;)delete $n[Xn.shift()];s="AWS4"+t.secretAccessKey,h.label=2;case 2:h.trys.push([2,7,8,9]),c=(0,_t.__values)([n,r,i,Zn]),u=c.next(),h.label=3;case 3:return u.done?[3,6]:(l=u.value,[4,tr(e,s,l)]);case 4:s=h.sent(),h.label=5;case 5:return u=c.next(),[3,3];case 6:return[3,9];case 7:return d=h.sent(),f={error:d},[3,9];
2case 8:try{u&&!u.done&&(p=c.return)&&p.call(c)}finally{if(f)throw f.error}return[7];case 9:return[2,$n[a]=s]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),ur=function(e){var t=sr(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},lr=function(e){return Object.keys(e).sort().join(";")},dr=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},fr=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function pr(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var hr=function(e){return new Date(Date.now()+e)};function vr(e){return function(t,n){return function(r){return(0,_t.__awaiter)(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,d,f;return(0,_t.__generator)(this,(function(p){switch(p.label){case 0:return Ut.Kd.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return o=p.sent(),[3,3];case 2:o=e.signer,p.label=3;case 3:return i=o,s=t,c=[(0,_t.__assign)({},r)],f={},[4,i.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,s.apply(void 0,[_t.__assign.apply(void 0,c.concat([(f.request=p.sent(),f)]))])];case 5:return a=p.sent(),u=a.response.headers,(l=u&&(u.date||u.Date))&&(d=Date.parse(l),h=d,v=e.systemClockOffset,Math.abs(hr(v).getTime()-h)>=3e5&&(e.systemClockOffset=d-Date.now())),[2,a]}var h,v}))}))}}}var gr={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0};var mr,yr,br="user-agent",_r=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Er=function(e){var t=(0,_t.__read)(e,2),n=t[0],r=t[1],i=n.indexOf("/"),o=n.substring(0,i),a=n.substring(i+1);return"api"===o&&(a=a.toLowerCase()),[o,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(_r,"_")})).join("/")},wr={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Sr=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return(0,_t.__awaiter)(void 0,void 0,void 0,(function(){var i,o,a,s,c,u,l,d;return(0,_t.__generator)(this,(function(f){switch(f.label){case 0:return i=r.request,Ut.Kd.isInstance(i)?(o=i.headers,a=(null===(l=null==t?void 0:t.userAgent)||void 0===l?void 0:l.map(Er))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return s=f.sent().map(Er),c=(null===(d=null==n?void 0:n.customUserAgent)||void 0===d?void 0:d.map(Er))||[],o["x-amz-user-agent"]=(0,_t.__spread)(s,a,c).join(" "),u=(0,_t.__spread)(s.filter((function(e){return e.startsWith("aws-sdk-")})),c).join(" "),"browser"!==n.runtime&&u&&(o[br]=o[br]?o[br]+" "+u:u),[2,e((0,_t.__assign)((0,_t.__assign)({},r),{request:i}))]}}))}))}}),wr)}}},Tr=function(e){function t(t){var n,r,i,o=this,a=function(e){if(!e.region)throw new Error("Region is missing");return(0,_t.__assign)((0,_t.__assign)({},e),{region:Cn(e.region)})}((0,yt.Cl)((0,yt.Cl)({},In),t)),s=function(e){var t;return(0,_t.__assign)((0,_t.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?Nn(e):function(){return An(e)},isCustomEndpoint:!!e.endpoint})}(a),c=function(e){var t,n=this,r=pr(e.credentials||e.credentialDefaultProvider(e)),i=e.signingEscapePath,o=void 0===i||i,a=e.systemClockOffset,s=void 0===a?e.systemClockOffset||0:a,c=e.sha256;return t=e.signer?pr(e.signer):function(){return pr(e.region)().then((function(t){return(0,_t.__awaiter)(n,void 0,void 0,(function(){return(0,_t.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=(0,_t.__read)(t,2),i=n[0],a=n[1],s=i.signingRegion,u=i.signingService;return e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||u||e.serviceId,new cr({credentials:r,region:e.signingRegion,service:e.signingName,sha256:c,uriEscapePath:o})}))},(0,_t.__assign)((0,_t.__assign)({},e),{systemClockOffset:s,signingEscapePath:o,credentials:r,signer:t})}(s),u=function(e){return(0,_t.__assign)((0,_t.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}((r=dn((n=c).maxAttempts),(0,_t.__assign)((0,_t.__assign)({},n),{maxAttempts:r,retryStrategy:n.retryStrategy||new ln(r)})));return(o=e.call(this,u)||this).config=u,o.middlewareStack.use((i=o.config,{applyToStack:function(e){e.addRelativeTo(vr(i),gr)}})),o.middlewareStack.use(Xt(o.config)),o.middlewareStack.use(Dn(o.config)),o.middlewareStack.use(Pn(o.config)),o.middlewareStack.use(Mn(o.config)),o.middlewareStack.use(Sr(o.config)),o}return(0,yt.C6)(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(At),Ir=n(17467),Nr=n(7025),Ar=function(e,t,n,r){return new(n||(n=Prom
2ise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Cr=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Or=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},kr=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Dr=new o.C("AWSCloudWatch"),Rr=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,(0,mt.s)(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Ar(this,void 0,void 0,(function(){var t,n;return Cr(this,(function(r){switch(r.label){case 0:Dr.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new kt(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(Nr.hp);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Dr.error("error creating log group - ".concat(n)),n;case 5:return[2]}}
2))}))},e.prototype.getLogGroups=function(e){return Ar(this,void 0,void 0,(function(){var t,n;return Cr(this,(function(r){switch(r.label){case 0:Dr.debug("getting list of log groups"),t=new Dt(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(Nr.hp);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Dr.error("error getting log group - ".concat(n)),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Ar(this,void 0,void 0,(function(){var t,n;return Cr(this,(function(r){switch(r.label){case 0:Dr.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new Rt(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(Nr.hp);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Dr.error("error creating log stream - ".concat(n)),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Ar(this,void 0,void 0,(function(){var t,n;return Cr(this,(function(r){switch(r.label){case 0:Dr.debug("getting list of log streams"),t=new Pt(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(Nr.hp);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Dr.error("error getting log stream - ".concat(n)),n;case 5:return[2]}}
2))}))},e.prototype.getLogEvents=function(e){return Ar(this,void 0,void 0,(function(){var t,n;return Cr(this,(function(r){switch(r.label){case 0:Dr.debug("getting log events from stream - ",e.logStreamName),t=new xt(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(Nr.hp);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Dr.error("error getting log events - ".concat(n)),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){Dr.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=kr(kr([],Or(this._dataTracker.logEvents),!1),Or(e),!1)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Ar(this,void 0,void 0,(function(){var t,n,r,i;return Cr(this,(function(o){switch(o.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];o.label=1;case 1:return o.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!o.sent())throw new Error(Nr.hp);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=o.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return o.sent(),[2,null];case 5:throw r=o.sent(),i="failure during log group search: ".concat(r),Dr.error(i),r;case 6:return[2]}}
2))}))},e.prototype._validateLogStreamExists=function(e,t){return Ar(this,void 0,void 0,(function(){var n,r,i,o;return Cr(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(Nr.hp);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw i=a.sent(),o="failure during log stream search: ".concat(i),Dr.error(o),i;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Ar(this,void 0,void 0,(function(){var t,n,r;return Cr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!i.sent())throw new Error(Nr.hp);return Dr.debug("sending log events to stream - ",e.logStreamName),t=new Mt(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,i.sent()];case 3:return n=i.sent(),r="failure during log push: ".concat(n),Dr.error(r),[3,4];case 4:return[2]}}
2))}))},e.prototype._initCloudWatchLogs=function(){return new Tr({region:this._config.region,credentials:this._config.credentials,customUserAgent:(0,i.Ij)(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Ar(this,void 0,void 0,(function(){var e=this;return Cr(this,(function(t){switch(t.label){case 0:return[4,Ir.J.get().then((function(t){if(!t)return!1;var n=Ir.J.shear(t);return Dr.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return Dr.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Ar(this,void 0,void 0,(function(){var e,t;return Cr(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),Dr.error("failure while getting next sequence token: ".concat(t)),t;case 5:return[2]}}
2))}))},e.prototype._safeUploadLogEvents=function(){return Ar(this,void 0,void 0,(function(){var e,t,n,r,i;return Cr(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=o.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=o.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(i=o.sent(),Dr.error("error during _safeUploadLogEvents: ".concat(i)),!Nr.FE.includes(i.name))throw this._dataTracker.eventUploadInProgress=!1,i;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+Nr.wl:0;if(r>Nr.pb){var i="Log entry exceeds maximum size for CloudWatch logs. Log size: ".concat(r,". Truncating log message.");Dr.warn(i),n.message=n.message.substring(0,r)}if(t+r>Nr.wK)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Ar(this,void 0,void 0,(function(){var t,n,r;return Cr(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=i.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=i.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=i.sent(),Dr.error("error when retrying log submission with new sequence token: ".concat(r)),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}
2))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Ar(e,void 0,void 0,(function(){var e;return Cr(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),Dr.error("error when calling _safeUploadLogEvents in the timer interval - ".concat(e)),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=Nr.xU,e.CATEGORY=Nr.OU,e}(),Pr=n(59136),xr=n(54769),Mr={},Lr={addEventListener:function(e,t){}},Ur=(0,vt.gy)().isBrowser?(new xr.i).getStorage():void 0,Fr=function(){function e(){this._logger=new o.C("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!1,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering ".concat(e)),this._logger.debug("registering service worker with scope ".concat(t)),new Promise((function(r,i){if(!navigator||!("serviceWorker"in navigator))return i(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: ".concat(e)),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed ".concat(e)),i(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!(0,vt.gy)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: ".concat(JSON.stringify(e))),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: ".concat(JSON.stringify(r))),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"==typeof e?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: ".concat(n)),r.H.Analytics&&"function"==typeof r.H.Analytics.record&&r.H.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: ".concat(t))}))},e}(),jr=n(92685),Br=n(37070),Vr=n(35166),Gr=(mr=function(e,t){return mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},mr(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}mr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),qr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Yr=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Kr=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
2if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hr=function(){function e(){this._state=yr.Open,this.jobs=new Set}return e.prototype.add=function(t,n){var r,i;"string"==typeof t?(r=void 0,i=t):(r=t,i=n);var o=this.closedFailure(i);if(o)return o;if(void 0===r)return this.addHook(i);if("function"==typeof r)return this.addFunction(r,i);if(r instanceof e)return this.addManager(r,i);throw new Error("If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.")},e.prototype.addCleaner=function(e,t){var n=this,r=this.addHook(t),i=r.resolve,o=function(){return qr(n,void 0,void 0,(function(){return Yr(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return t.sent(),i(),[2]}}))}))};return r.onTerminate.then(o),o},e.prototype.addFunction=function(e,t){var n,r=e(new Promise((function(e){n=e})));return"function"==typeof(null==r?void 0:r.then)&&this.registerPromise(r,n,t),r},e.prototype.addManager=function(e,t){var n=this;this.addCleaner((function(){return qr(n,void 0,void 0,(function(){return Yr(this,(function(t){switch(t.label){case 0:return[4,e.close()];case 1:return[2,t.sent()]}}))}))}),t)},e.prototype.addHook=function(e){var t,n,r,i=new Promise((function(e,r){t=e,n=r})),o=new Promise((function(e){r=e}));return this.registerPromise(i,r,e),{resolve:t,reject:n,onTerminate:o}},e.prototype.registerPromise=function(e,t,n){var r=this,i={promise:e,terminate:t,description:n};this.jobs.add(i),e.then((function(){r.jobs.delete(i)})).catch((function(){r.jobs.delete(i)}))},Object.defineProperty(e.prototype,"length",{get:function(){return this.jobs.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pending",{get:function(){return Array.from(this.jobs).map((function(e){return e.description}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._state===yr.Open},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isClosing",{get:function(){return this._state===yr.Closing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isClosed",{get:function(){return this._state===yr.Closed},enumerable:!1,configurable:!0}),e.prototype.closedFailure=function(e){if(!this.isOpen)return Promise.reject(new zr(["The manager is ".concat(this.state,"."),'You tried to add "'.concat(e,'".'),"Pending jobs: [\n".concat(this.pending.map((function(e){return" "+e})).join(",\n"),"\n]")].join("\n")))},e.prototype.close=function(){return qr(this,void 0,void 0,(function(){var e,t,n,r,i;return Yr(this,(function(o){switch(o.label){case 0:if(!this.isOpen)return[3,2];this._state=yr.Closing;try{for(e=Kr(Array.from(this.jobs)),t=e.next();!t.done;t=e.next()){n=t.value;try{n.terminate()}catch(a){console.warn("Failed to send termination signal to job. Error: ".concat(a.message),n)}}}catch(s){r={error:s}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return this._closingPromise=Promise.allSettled(Array.from(this.jobs).map((function(e){return e.promise}))),[4,this._closingPromise];case 1:o.sent(),this._state=yr.Closed,o.label=2;case 2:return[2,this._closingPromise]}}))}))},e.prototype.open=function(){return qr(this,void 0,void 0,(function(){return Yr(this,(function(e){switch(e.label){case 0:return this.isClosing?[4,this.close()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._state=yr.Open,[2]}}))}))},e}(),zr=function(e){function t(t){return e.call(this,"BackgroundManagerNotOpenError: ".concat(t))||this}return Gr(t,e),t}(Error);!function(e){e.Open="Open",e.Closing="Closing",e.Closed="Closed"}(yr||(yr={}));var Wr=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));
2return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(r){throw t(),r}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),Jr=n(10465),Qr=n(766),Zr=n(2917),$r=n(32658),Xr={userAgent:i.OD.userAgent},ei=r.H},3976:function(e,t,n){"use strict";n.d(t,{s:function(){return a}});var r=n(34549),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=new r.C("Parser"),a=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=i(i({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),o.debug("parse config",e,"to amplifyconfig",n),n}},4926:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(62234),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i<r.BLOCK_SIZE;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<r.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(r.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],d=0;d<r.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var f=this.temp[d-2],p=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,h=((f=this.temp[d-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(h+this.temp[d-16]|0)}var v=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&c^~s&u)|0)+(l+(r.KEY[d]+this.temp[d]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;l=u,u=c,c=s,s=a+v|0,a=o,o=i,i=n,n=v+g|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=a,t[4]+=s,t[5]+=c,t[6]+=u,t[7]+=l},e}();t.RawSha256=i},62234:function(e,t){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},51063:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(15215).__exportStar)(n(37531),t)},37531:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(15215),i=n(62234),o=n(4926),a=n(65388),s=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(t){this.error=t}},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,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},15838:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215),i=r.__importDefault(n(28117)),o=n(51139),a=r.__importStar(n(88835)),s=n(68414),c=n(48287),u=n(66562),l=n(12442),d=n(16682),f=n(68560),p=n(81568),h=n(31933),v=n(79262),g=n(92438),m=new u.Logger("AWSAppSyncRealTimeProvider"),y=function(e,t,n){u.Hub.dispatch("api",{event:e,data:t,message:n},"PubSub",h.AMPLIFY_SYMBOL)},b=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com(?:\.cn)?\/graphql$/i,_=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.socketStatus=h.SOCKET_STATUS.CLOSED,n.keepAliveTimeout=h.DEFAULT_KEEP_ALIVE_TIMEOUT,n.subscriptionObserverMap=new Map,n.promiseArray=[],n.connectionStateMonitor=new v.ConnectionStateMonitor,n.reconnectionMonitor=new g.ReconnectionMonitor,n.connectionStateMonitorSubscription=n.connectionStateMonitor.connectionStateObservable.subscribe((function(e){y(h.CONNECTION_STATE_CHANGE,{provider:n,connectionState:e},"Connection state is "+e),n.connectionState=e,e===p.ConnectionState.ConnectionDisrupted&&n.reconnectionMonitor.record(g.ReconnectEvent.START_RECONNECT),[p.ConnectionState.Connected,p.ConnectionState.ConnectedPendingDisconnect,p.ConnectionState.ConnectedPendingKeepAlive,p.ConnectionState.ConnectedPendingNetwork,p.ConnectionState.ConnectionDisruptedPendingNetwork,p.ConnectionState.Disconnected].includes(e)&&n.reconnectionMonitor.record(g.ReconnectEvent.HALT_RECONNECT)})),n}return r.__extends(t,e),t.prototype.close=function(){this.socketStatus=h.SOCKET_STATUS.CLOSED,this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CONNECTION_FAILED),this.connectionStateMonitorSubscription.unsubscribe(),this.reconnectionMonitor.close()},t.prototype.getNewWebSocket=function(e,t){return new WebSocket(e,t)},t.prototype.getProviderName=function(){return"AWSAppSyncRealTimeProvider"},t.prototype.newClient=function(){throw new Error("Not used here")},t.prototype.publish=function(e,t,n){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){throw new Error("Operation not supported")}))}))},t.prototype.isCustomDomain=function(e){return null===e.match(b)},t.prototype.subscribe=function(e,t,n){var a=this,c=null==t?void 0:t.appSyncGraphqlEndpoint;return new i.default((function(e){if(t&&c){var u,l=!1,d=s.v4(),f=function(){l||(l=!0,a._startSubscriptionWithAWSAppSyncRealTime({options:t,observer:e,subscriptionId:d,customUserAgentDetails:n}).catch((function(e){m.debug(p.CONTROL_MSG.REALTIME_SUBSCRIPTION_INIT_ERROR+": "+e),a.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSED)})).finally((function(){l=!1})))};
2return u=new i.default((function(e){a.reconnectionMonitor.addObserver(e)})).subscribe((function(){f()})),f(),function(){return r.__awaiter(a,void 0,void 0,(function(){var e,t;return r.__generator(this,(function(n){switch(n.label){case 0:null==u||u.unsubscribe(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this._waitForSubscriptionToBeConnected(d)];case 2:if(n.sent(),!(e=(this.subscriptionObserverMap.get(d)||{}).subscriptionState))return[2];if(e!==h.SUBSCRIPTION_STATUS.CONNECTED)throw new Error("Subscription never connected");return this._sendUnsubscriptionMessage(d),[3,5];case 3:return t=n.sent(),m.debug("Error while unsubscribing "+t),[3,5];case 4:return this._removeSubscriptionObserver(d),[7];case 5:return[2]}}))}))}}e.error({errors:[r.__assign({},new o.GraphQLError("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()}))},Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t,n=e.options,i=e.observer,o=e.subscriptionId,a=e.customUserAgentDetails;return r.__awaiter(this,void 0,void 0,(function(){var e,s,c,l,d,f,p,g,m,y,b,_,E,w,S,T,I,N,A,C,O,k,D,R=this;return r.__generator(this,(function(P){switch(P.label){case 0:return e=n.appSyncGraphqlEndpoint,s=n.authenticationType,c=n.query,l=n.variables,d=n.apiKey,f=n.region,p=n.graphql_headers,g=void 0===p?function(){return{}}:p,m=n.additionalHeaders,y=void 0===m?{}:m,b=h.SUBSCRIPTION_STATUS.PENDING,_={query:c,variables:l},this.subscriptionObserverMap.set(o,{observer:i,query:null!=c?c:"",variables:null!=l?l:{},subscriptionState:b,startAckTimeoutId:void 0}),E=JSON.stringify(_),S=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:d,appSyncGraphqlEndpoint:e,authenticationType:s,payload:E,canonicalUri:"",region:f,additionalHeaders:y})];case 1:return T=[r.__assign.apply(void 0,S.concat([P.sent()]))],[4,g()];case 2:w=r.__assign.apply(void 0,[r.__assign.apply(void 0,[r.__assign.apply(void 0,T.concat([P.sent()])),y]),(D={},D[u.USER_AGENT_HEADER]=u.getAmplifyUserAgent(a),D)]),I={id:o,payload:{data:E,extensions:{authorization:r.__assign({},w)}},type:h.MESSAGE_TYPES.GQL_START},N=JSON.stringify(I),P.label=3;case 3:return P.trys.push([3,5,,6]),this.connectionStateMonitor.record(v.CONNECTION_CHANGE.OPENING_CONNECTION),[4,this._initializeWebSocketConnection({apiKey:d,appSyncGraphqlEndpoint:e,authenticationType:s,region:f,additionalHeaders:y})];case 4:return P.sent(),[3,6];case 5:return A=P.sent(),this._logStartSubscriptionError(o,i,A),[2];case 6:return C=null!==(t=this.subscriptionObserverMap.get(o))&&void 0!==t?t:{},O=C.subscriptionFailedCallback,k=C.subscriptionReadyCallback,this.subscriptionObserverMap.set(o,{observer:i,subscriptionState:b,query:null!=c?c:"",variables:null!=l?l:{},subscriptionReadyCallback:k,subscriptionFailedCallback:O,startAckTimeoutId:setTimeout((function(){R._timeoutStartSubscriptionAck.call(R,o)}),h.START_ACK_TIMEOUT)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(N),[2]}}))}))},t.prototype._logStartSubscriptionError=function(e,t,n){var i;m.debug({err:n});var a=String(null!==(i=n.message)&&void 0!==i?i:"");if(Promise.resolve(this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSED)),this.connectionState!==p.ConnectionState.ConnectionDisruptedPendingNetwork){u.isNonRetryableError(n)?t.error({errors:[r.__assign({},new o.GraphQLError(p.CONTROL_MSG.CONNECTION_FAILED+": "+a))]}):m.debug(p.CONTROL_MSG.CONNECTION_FAILED+": "+a);var s=(this.subscriptionObserverMap.get(e)||{}).subscriptionFailedCallback;"function"==typeof s&&s()}},t.prototype._waitForSubscriptionToBeConnected=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,n=this;return r.__generator(this,(function(r){return(t=this.subscriptionObserverMap.get(e))&&t.subscriptionState===h.SUBSCRIPTION_STATUS.PENDING?[2,new Promise((function(r,i){var o=t.observer,a=t.subscriptionState,s=t.variables,c=t.query;n.subscriptionObserverMap.set(e,{observer:o,subscriptionState:a,variables:s,query:c,subscriptionReadyCallback:r,subscriptionFailedCallback:i})}))]:[2]}))}))},t.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===h.SOCKET_STATUS.READY){var t={id:e,type:h.MESSAGE_TYPES.GQL_STOP},n=JSON.stringify(t);this.awsRealTimeSocket.send(n)}}catch(r){m.debug({err:r})}},t.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},t.prototype._closeSocketIfRequired=function(){if(!(this.subscriptionObserverMap.size>0))if(this.awsRealTimeSocket)if(this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSING_CONNECTION),this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{m.debug("closing WebSocket..."),this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId);var e=this.awsRealTimeSocket;e.onclose=null,e.onerror=null,e.close(1e3),this.awsRealTimeSocket=void 0,this.socketStatus=h.SOCKET_STATUS.CLOSED,this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSED)}else this.socketStatus=h.SOCKET_STATUS.CLOSED},t.prototype._handleIncomingSubscriptionMessage=function(e){var t=this;if("string"==typeof e.data){m.debug("subscription message from AWS AppSync RealTime: "+e.data);var n=JSON.parse(String(e.data)),i=n.id,a=void 0===i?"":i,s=n.payload,c=n.type,u=this.subscriptionObserverMap.get(a)||{},l=u.observer,d=void 0===l?null:l,f=u.query,g=void 0===f?"":f,b=u.variables,_=void 0===b?{}:b,E=u.startAckTimeoutId,w=u.subscriptionReadyCallback,S=u.subscriptionFailedCallback;if(m.debug({id:a,observer:d,query:g,variables:_}),c===h.MESSAGE_TYPES.GQL_DATA&&s&&s.data)d?d.next(s):m.debug("observer not found for id: "+a);else{if(c===h.MESSAGE_TYPES.GQL_START_ACK){m.debug("subscription ready for "+JSON.stringify({query:g,variables:_})),"function"==typeof w&&w(),E&&clearTimeout(E),y(p.CONTROL_MSG.SUBSCRIPTION_ACK,{query:g,variables:_},"Connection established for subscription");var T=h.SUBSCRIPTION_STATUS.CONNECTED;return d&&this.subscriptionObserverMap.set(a,{observer:d,query:g,variables:_,startAckTimeoutId:void 0,subscriptionState:T,subscriptionReadyCallback:w,subscriptionFailedCallback:S}),void this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CONNECTION_ESTABLISHED)}if(c===h.MESSAGE_TYPES.GQL_CONNECTION_KEEP_ALIVE)return this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId),this.keepAliveTimeoutId=setTimeout((function(){return t._errorDisconnect(p.CONTROL_MSG.TIMEOUT_DISCONNECT)}),this.keepAliveTimeout),this.keepAliveAlertTimeoutId=setTimeout((function(){t.connectionStateMonitor.record(v.CONNECTION_CHANGE.KEEP_ALIVE_MISSED)}),h.DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT),void this.connectionStateMonitor.record(v.CONNECTION_CHANGE.KEEP_ALIVE);
2if(c===h.MESSAGE_TYPES.GQL_ERROR){T=h.SUBSCRIPTION_STATUS.FAILED;d&&(this.subscriptionObserverMap.set(a,{observer:d,query:g,variables:_,startAckTimeoutId:E,subscriptionReadyCallback:w,subscriptionFailedCallback:S,subscriptionState:T}),m.debug(p.CONTROL_MSG.CONNECTION_FAILED+": "+JSON.stringify(s)),d.error({errors:[r.__assign({},new o.GraphQLError(p.CONTROL_MSG.CONNECTION_FAILED+": "+JSON.stringify(s)))]}),E&&clearTimeout(E),"function"==typeof S&&S())}}}},t.prototype._errorDisconnect=function(e){m.debug("Disconnect error: "+e),this.awsRealTimeSocket&&(this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSED),this.awsRealTimeSocket.close()),this.socketStatus=h.SOCKET_STATUS.CLOSED},t.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e);if(t){var n=t.observer,r=t.query,i=t.variables;if(!n)return;this.subscriptionObserverMap.set(e,{observer:n,query:r,variables:i,subscriptionState:h.SUBSCRIPTION_STATUS.FAILED}),this.connectionStateMonitor.record(v.CONNECTION_CHANGE.CLOSED),m.debug("timeoutStartSubscription",JSON.stringify({query:r,variables:i}))}},t.prototype._initializeWebSocketConnection=function(e){var t=this,n=e.appSyncGraphqlEndpoint,i=e.authenticationType,o=e.apiKey,a=e.region,s=e.additionalHeaders;if(this.socketStatus!==h.SOCKET_STATUS.READY)return new Promise((function(e,u){return r.__awaiter(t,void 0,void 0,(function(){var t,l,d,f,p,v,g,y,b;return r.__generator(this,(function(r){switch(r.label){case 0:if(this.promiseArray.push({res:e,rej:u}),this.socketStatus!==h.SOCKET_STATUS.CLOSED)return[3,5];r.label=1;case 1:return r.trys.push([1,4,,5]),this.socketStatus=h.SOCKET_STATUS.CONNECTING,t="{}",[4,this._awsRealTimeHeaderBasedAuth({authenticationType:i,payload:t,canonicalUri:"/connect",apiKey:o,appSyncGraphqlEndpoint:n,region:a,additionalHeaders:s})];case 2:return l=r.sent(),d=l?JSON.stringify(l):"",f=c.Buffer.from(d).toString("base64"),p=c.Buffer.from(t).toString("base64"),v=null!=n?n:"",v=this.isCustomDomain(v)?v.concat("/realtime"):v.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta"),g=this.isSSLEnabled?"wss://":"ws://",v=v.replace("https://",g).replace("http://",g),y=v+"?header="+f+"&payload="+p,[4,this._initializeRetryableHandshake(y)];case 3:return r.sent(),this.promiseArray.forEach((function(e){var t=e.res;m.debug("Notifying connection successful"),t()})),this.socketStatus=h.SOCKET_STATUS.READY,this.promiseArray=[],[3,5];case 4:return b=r.sent(),m.debug("Connection exited with",b),this.promiseArray.forEach((function(e){return(0,e.rej)(b)})),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=void 0,this.socketStatus=h.SOCKET_STATUS.CLOSED,[3,5];case 5:return[2]}}
2))}))}))},t.prototype._initializeRetryableHandshake=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return m.debug("Initializaling retryable Handshake"),[4,u.jitteredExponentialRetry(this._initializeHandshake.bind(this),[e],h.MAX_DELAY_MS)];case 1:return t.sent(),[2]}}))}))},t.prototype._initializeHandshake=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,n,i,o,a=this;return r.__generator(this,(function(s){switch(s.label){case 0:m.debug("Initializing handshake "+e),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,new Promise((function(t,n){var r=a.getNewWebSocket(e,"graphql-ws");r.onerror=function(){m.debug("WebSocket connection error")},r.onclose=function(){n(new Error("Connection handshake error"))},r.onopen=function(){return a.awsRealTimeSocket=r,t()}}))];case 2:return s.sent(),[4,new Promise((function(e,t){if(a.awsRealTimeSocket){var n=!1;a.awsRealTimeSocket.onerror=function(e){m.debug("WebSocket error "+JSON.stringify(e))},a.awsRealTimeSocket.onclose=function(e){m.debug("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},a.awsRealTimeSocket.onmessage=function(i){if("string"==typeof i.data){m.debug("subscription message from AWS AppSyncRealTime: "+i.data+" ");var o=JSON.parse(i.data),s=o.type,c=o.payload,u=(void 0===c?{}:c).connectionTimeoutMs,l=void 0===u?h.DEFAULT_KEEP_ALIVE_TIMEOUT:u;if(s===h.MESSAGE_TYPES.GQL_CONNECTION_ACK)return n=!0,a.awsRealTimeSocket&&(a.keepAliveTimeout=l,a.awsRealTimeSocket.onmessage=a._handleIncomingSubscriptionMessage.bind(a),a.awsRealTimeSocket.onerror=function(e){m.debug(e),a._errorDisconnect(p.CONTROL_MSG.CONNECTION_CLOSED)},a.awsRealTimeSocket.onclose=function(e){m.debug("WebSocket closed "+e.reason),a._errorDisconnect(p.CONTROL_MSG.CONNECTION_CLOSED)}),void e("Cool, connected to AWS AppSyncRealTime");if(s===h.MESSAGE_TYPES.GQL_CONNECTION_ERROR){var d=o.payload,f=(void 0===d?{}:d).errors,v=r.__read(void 0===f?[]:f,1)[0],g=void 0===v?{}:v,y=g.errorType,b=void 0===y?"":y,_=g.errorCode;t({errorType:b,errorCode:void 0===_?0:_})}}};var i={type:h.MESSAGE_TYPES.GQL_CONNECTION_INIT};a.awsRealTimeSocket.send(JSON.stringify(i)),setTimeout((function(){n||(a.connectionStateMonitor.record(v.CONNECTION_CHANGE.CONNECTION_FAILED),t(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after "+h.CONNECTION_INIT_TIMEOUT+" ms")))}),h.CONNECTION_INIT_TIMEOUT)}}))];case 3:return s.sent(),[3,5];case 4:throw t=s.sent(),i=(n=t).errorType,o=n.errorCode,h.NON_RETRYABLE_CODES.includes(o)?new u.NonRetryableError(i):i?new Error(i):t;case 5:return[2]}}
2))}))},t.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,n=e.payload,i=e.canonicalUri,o=e.appSyncGraphqlEndpoint,s=e.apiKey,c=e.region,u=e.additionalHeaders;return r.__awaiter(this,void 0,void 0,(function(){var e,l,d;return r.__generator(this,(function(r){switch(r.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeOPENIDHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeCUPHeader.bind(this),AWS_LAMBDA:this._customAuthHeader},t&&e[t]?[3,1]:(m.debug("Authentication type "+t+" not supported"),[2,void 0]);case 1:return l=e[t],d=a.parse(null!=o?o:"").host,m.debug("Authenticating with "+t),[4,l({payload:n,canonicalUri:i,appSyncGraphqlEndpoint:o,apiKey:s,region:c,host:d,additionalHeaders:u})];case 2:return[2,r.sent()]}}))}))},t.prototype._awsRealTimeCUPHeader=function(e){var t=e.host;return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return[4,d.Auth.currentSession()];case 1:return[2,{Authorization:e.sent().getAccessToken().getJwtToken(),host:t}]}}))}))},t.prototype._awsRealTimeOPENIDHeader=function(e){var t=e.host;return r.__awaiter(this,void 0,void 0,(function(){var e,n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,l.Cache.getItem("federatedInfo")];case 1:return(n=r.sent())?(e=n.token,[3,4]):[3,2];case 2:return[4,d.Auth.currentAuthenticatedUser()];case 3:(i=r.sent())&&(e=i.token),r.label=4;case 4:if(!e)throw new Error("No federated jwt");return[2,{Authorization:e,host:t}]}}))}))},t.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,n=e.host;return r.__awaiter(this,void 0,void 0,(function(){var e,i;return r.__generator(this,(function(r){return e=new Date,i=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),[2,{host:n,"x-amz-date":i,"x-api-key":t}]}))}))},t.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,n=e.canonicalUri,i=e.appSyncGraphqlEndpoint,o=e.region;return r.__awaiter(this,void 0,void 0,(function(){var e,a,s;return r.__generator(this,(function(c){switch(c.label){case 0:return e={region:o,service:"appsync"},[4,this._ensureCredentials()];case 1:if(!c.sent())throw new Error("No credentials");return[4,u.Credentials.get().then((function(e){var t=e;return{secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken}}))];case 2:return a=c.sent(),s={url:""+i+n,data:t,method:"POST",headers:r.__assign({},h.AWS_APPSYNC_REALTIME_HEADERS)},[2,u.Signer.sign(s,a,e).headers]}}))}))},t.prototype._customAuthHeader=function(e){var t=e.host,n=e.additionalHeaders;if(!n||!n.Authorization)throw new Error("No auth token specified");return{Authorization:n.Authorization,host:t}},t.prototype._ensureCredentials=function(){return u.Credentials.get().then((function(e){if(!e)return!1;var t=u.Credentials.shear(e);return m.debug("set credentials for AWSAppSyncRealTimeProvider",t),!0})).catch((function(e){return m.warn("ensure credentials error",e),!1}))},t}(f.AbstractPubSubProvider);t.AWSAppSyncRealTimeProvider=_},53576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215),i=n(56605),o=n(66562),a=function(e){function t(t){return void 0===t&&(t={}),e.call(this,t)||this}return r.__extends(t,e),Object.defineProperty(t.prototype,"region",{get:function(){return this.options.aws_pubsub_region},enumerable:!0,configurable:!0}),t.prototype.getProviderName=function(){return"AWSIoTProvider"},Object.defineProperty(t.prototype,"endpoint",{get:function(){var e=this;return r.__awaiter(e,void 0,void 0,(function(){var e,t,n,i,a,s;return r.__generator(this,(function(r){switch(r.label){case 0:return e=this.options.aws_pubsub_endpoint,t={service:"iotdevicegateway",region:this.region},[4,o.Credentials.get()];case 1:return n=r.sent(),i=n.accessKeyId,a=n.secretAccessKey,s=n.sessionToken,[2,o.Signer.signUrl(e,{access_key:i,secret_key:a,session_token:s},t)]}}))}))},enumerable:!0,configurable:!0}),t}(i.MqttOverWSProvider);t.AWSIoTProvider=a},56605:function(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215),i=r.__importStar(n(10775)),o=n(68414),a=r.__importDefault(n(28117)),s=n(68560),c=n(81568),u=n(66562),l=n(79262),d=n(92438),f=n(31933),p=new u.ConsoleLogger("MqttOverWSProvider");function h(e,t){for(var n=e.split("/"),r=n.length,i=t.split("/"),o=0;o<r;++o){var a=n[o],s=i[o];if("#"===a)return i.length>=r;if("+"!==a&&a!==s)return!1}return r===i.length}t.mqttTopicMatch=h;var v=function(){function e(){this.promises=new Map}return e.prototype.get=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o=this;return r.__generator(this,(function(r){return(n=this.promises.get(e))?[2,n]:t?(i=t(e),this.promises.set(e,i),i.catch((function(){return o.promises.delete(e)})),[2,i]):[2,void 0]}))}))},Object.defineProperty(e.prototype,"allClients",{get:function(){return Array.from(this.promises.keys())},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){this.promises.delete(e)},e}(),g="undefined"!=typeof Symbol?Symbol("topic"):"@@topic",m=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,r.__assign(r.__assign({},t),{clientId:t.clientId||o.v4()}))||this;return n._clientsQueue=new v,n.connectionStateMonitor=new l.ConnectionStateMonitor,n.reconnectionMonitor=new d.ReconnectionMonitor,n._topicObservers=new Map,n._clientIdObservers=new Map,n.connectionStateMonitor.connectionStateObservable.subscribe((function(e){var t,r,i;t=f.CONNECTION_STATE_CHANGE,r={provider:n,connectionState:e},i="Connection state is "+e,u.Hub.dispatch("pubsub",{event:t,data:r,message:i},"PubSub",f.AMPLIFY_SYMBOL),n.connectionState=e,e===c.ConnectionState.ConnectionDisrupted?n.reconnectionMonitor.record(d.ReconnectEvent.START_RECONNECT):e!==c.ConnectionState.Connecting&&n.reconnectionMonitor.record(d.ReconnectEvent.HALT_RECONNECT)})),n}return r.__extends(t,e),Object.defineProperty(t.prototype,"clientId",{get:function(){return this.options.clientId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endpoint",{get:function(){return Promise.resolve(this.options.aws_pubsub_endpoint)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientsQueue",{get:function(){return this._clientsQueue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype.getProviderName=function(){return"MqttOverWSProvider"},t.prototype.onDisconnect=function(e){var t=e.clientId,n=e.errorCode,i=r.__rest(e,["clientId","errorCode"]);if(0!==n){if(p.warn(t,JSON.stringify(r.__assign({errorCode:n},i),null,2)),!t)return;if(!this._clientIdObservers.get(t))return;this.disconnect(t)}},t.prototype.newClient=function(e){var t=e.url,n=e.clientId;return r.__awaiter(this,void 0,void 0,(function(){var e,o=this;return r.__generator(this,(function(a){switch(a.label){case 0:return p.debug("Creating new MQTT client",n),this.connectionStateMonitor.record(l.CONNECTION_CHANGE.OPENING_CONNECTION),(e=new i.Client(t,n)).onMessageArrived=function(e){var t=e.destinationName,n=e.payloadString;o._onMessage(t,n)},e.onConnectionLost=function(e){var t=e.errorCode,i=r.__rest(e,["errorCode"]);o.onDisconnect(r.__assign({clientId:n,errorCode:t},i)),o.connectionStateMonitor.record(l.CONNECTION_CHANGE.CLOSED)},[4,new Promise((function(t,r){e.connect({useSSL:o.isSSLEnabled,mqttVersion:3,onSuccess:function(){return t(!0)},onFailure:function(){n&&o._clientsQueue.remove(n),o.connectionStateMonitor.record(l.CONNECTION_CHANGE.CLOSED),t(!1)}})}))];case 1:return a.sent()&&this.connectionStateMonitor.record(l.CONNECTION_CHANGE.CONNECTION_ESTABLISHED),[2,e]}}))}))},t.prototype.connect=function(e,t){return void 0===t&&(t={}),r.__awaiter(this,void 0,void 0,(function(){var n=this;return r.__generator(this,(function(i){switch(i.label){case 0:return[4,this.clientsQueue.get(e,(function(e){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(i){switch(i.label){case 0:return[4,this.newClient(r.__assign(r.__assign({},t),{clientId:e}))];
2case 1:return(n=i.sent())&&this._topicObservers.forEach((function(e,t){n.subscribe(t)})),[2,n]}}))}))}))];case 1:return[2,i.sent()]}}))}))},t.prototype.disconnect=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:return[4,this.clientsQueue.get(e)];case 1:return(t=n.sent())&&t.isConnected()&&t.disconnect(),this.clientsQueue.remove(e),this.connectionStateMonitor.record(l.CONNECTION_CHANGE.CLOSED),[2]}}))}))},t.prototype.publish=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o;return r.__generator(this,(function(r){switch(r.label){case 0:return n=[].concat(e),i=JSON.stringify(t),[4,this.clientsQueue.get(this.clientId)];case 1:return(o=r.sent())?(p.debug("Publishing to topic(s)",n.join(","),i),n.forEach((function(e){return o.send(e,i)}))):p.debug("Publishing to topic(s) failed",n.join(","),i),[2]}}))}))},t.prototype._onMessage=function(e,t){try{var n=[];this._topicObservers.forEach((function(t,r){h(r,e)&&n.push(t)}));var r=JSON.parse(t);"object"==typeof r&&(r[g]=e),n.forEach((function(e){e.forEach((function(e){return e.next(r)}))}))}catch(i){p.warn("Error handling message",i,t)}},t.prototype.subscribe=function(e,t){var n=this;void 0===t&&(t={});var i,o=[].concat(e);return p.debug("Subscribing to topic(s)",o.join(",")),new a.default((function(e){o.forEach((function(t){var r=n._topicObservers.get(t);r||(r=new Set,n._topicObservers.set(t,r)),r.add(e)}));var s=t.clientId,c=void 0===s?n.clientId:s,u=n._clientIdObservers.get(c);return u||(u=new Set),u&&(u.add(e),n._clientIdObservers.set(c,u)),r.__awaiter(n,void 0,void 0,(function(){var e,n=this;return r.__generator(this,(function(s){switch(s.label){case 0:return e=function(){return r.__awaiter(n,void 0,void 0,(function(){var e,n,i,a,s;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),void 0!==(e=t.url)?[3,2]:[4,this.endpoint];case 1:return i=r.sent(),[3,3];case 2:i=e,r.label=3;case 3:return n=i,[4,this.connect(c,{url:n})];case 4:return void 0!==(a=r.sent())&&o.forEach((function(e){a.subscribe(e)})),[3,6];case 5:return s=r.sent(),p.debug("Error forming connection",s),[3,6];case 6:return[2]}}
2))}))},[4,e()];case 1:return s.sent(),i=new a.default((function(e){n.reconnectionMonitor.addObserver(e)})).subscribe((function(){e()})),[2]}}))})),function(){return r.__awaiter(n,void 0,void 0,(function(){var t,n,a,s=this;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this.clientsQueue.get(c)];case 1:return t=r.sent(),null==i||i.unsubscribe(),t&&(null===(n=this._clientIdObservers.get(c))||void 0===n||n.delete(e),0===(null===(a=this._clientIdObservers.get(c))||void 0===a?void 0:a.size)&&(this.disconnect(c),this.connectionStateMonitor.record(l.CONNECTION_CHANGE.CLOSING_CONNECTION),this._clientIdObservers.delete(c)),o.forEach((function(n){var r=s._topicObservers.get(n)||new Set;r.delete(e),0===r.size&&(s._topicObservers.delete(n),t.isConnected()&&t.unsubscribe(n))}))),[2,null]}}))}))}}))},t}(s.AbstractPubSubProvider);t.MqttOverWSProvider=m},68560:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215),i=new(n(66562).ConsoleLogger)("AbstractPubSubProvider"),o=function(){function e(e){this._config=e}return e.prototype.configure=function(e){return this._config=r.__assign(r.__assign({},e),this._config),i.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"PubSub"},Object.defineProperty(e.prototype,"options",{get:function(){return r.__assign({},this._config)},enumerable:!0,configurable:!0}),e}();t.AbstractPubSubProvider=o},31933:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_DELAY_MS=5e3,t.NON_RETRYABLE_CODES=[400,401,403],t.CONNECTION_STATE_CHANGE="ConnectionStateChange",function(e){e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_START="start",e.GQL_START_ACK="start_ack",e.GQL_DATA="data",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_STOP="stop",e.GQL_COMPLETE="complete",e.GQL_ERROR="error"}(t.MESSAGE_TYPES||(t.MESSAGE_TYPES={})),function(e){e[e.PENDING=0]="PENDING",e[e.CONNECTED=1]="CONNECTED",e[e.FAILED=2]="FAILED"}(t.SUBSCRIPTION_STATUS||(t.SUBSCRIPTION_STATUS={})),function(e){e[e.CLOSED=0]="CLOSED",e[e.READY=1]="READY",e[e.CONNECTING=2]="CONNECTING"}(t.SOCKET_STATUS||(t.SOCKET_STATUS={})),t.AMPLIFY_SYMBOL="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",t.AWS_APPSYNC_REALTIME_HEADERS={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},t.CONNECTION_INIT_TIMEOUT=15e3,t.START_ACK_TIMEOUT=15e3,t.DEFAULT_KEEP_ALIVE_TIMEOUT=3e5,t.DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT=65e3,t.RECONNECT_DELAY=5e3,t.RECONNECT_INTERVAL=6e4},30888:function(e,t,n){"use strict";n(68560).AbstractPubSubProvider,n(15838).AWSAppSyncRealTimeProvider;var r=n(53576);t.BD=r.AWSIoTProvider;var i=n(56605);i.MqttOverWSProvider,i.mqttTopicMatch},81568:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.CONNECTION_CLOSED="Connection closed",e.CONNECTION_FAILED="Connection failed",e.REALTIME_SUBSCRIPTION_INIT_ERROR="AppSync Realtime subscription init error",e.SUBSCRIPTION_ACK="Subscription ack",e.TIMEOUT_DISCONNECT="Timeout disconnect"}(t.CONTROL_MSG||(t.CONTROL_MSG={})),function(e){e.Connected="Connected",e.ConnectedPendingNetwork="ConnectedPendingNetwork",e.ConnectionDisrupted="ConnectionDisrupted",e.ConnectionDisruptedPendingNetwork="ConnectionDisruptedPendingNetwork",e.Connecting="Connecting",e.ConnectedPendingDisconnect="ConnectedPendingDisconnect",e.Disconnected="Disconnected",e.ConnectedPendingKeepAlive="ConnectedPendingKeepAlive"}(t.ConnectionState||(t.ConnectionState={}))},79262:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215),i=r.__importDefault(n(28117)),o=n(81568),a=n(79407);t.CONNECTION_CHANGE={KEEP_ALIVE_MISSED:{keepAliveState:"unhealthy"},KEEP_ALIVE:{keepAliveState:"healthy"},CONNECTION_ESTABLISHED:{connectionState:"connected"},CONNECTION_FAILED:{intendedConnectionState:"disconnected",connectionState:"disconnected"},CLOSING_CONNECTION:{intendedConnectionState:"disconnected"},OPENING_CONNECTION:{intendedConnectionState:"connected",connectionState:"connecting"},CLOSED:{connectionState:"disconnected"},ONLINE:{networkState:"connected"},OFFLINE:{networkState:"disconnected"}};var s=function(){function e(){var e=this;this._networkMonitoringSubscription=void 0,this._linkedConnectionState={networkState:"connected",connectionState:"disconnected",intendedConnectionState:"disconnected",keepAliveState:"healthy"},this._initialNetworkStateSubscription=a.ReachabilityMonitor().subscribe((function(n){var r,i=n.online;e.record(i?t.CONNECTION_CHANGE.ONLINE:t.CONNECTION_CHANGE.OFFLINE),null===(r=e._initialNetworkStateSubscription)||void 0===r||r.unsubscribe()})),this._linkedConnectionStateObservable=new i.default((function(t){t.next(e._linkedConnectionState),e._linkedConnectionStateObserver=t}))}return e.prototype.enableNetworkMonitoring=function(){var e,n=this;null===(e=this._initialNetworkStateSubscription)||void 0===e||e.unsubscribe(),void 0===this._networkMonitoringSubscription&&(this._networkMonitoringSubscription=a.ReachabilityMonitor().subscribe((function(e){var r=e.online;n.record(r?t.CONNECTION_CHANGE.ONLINE:t.CONNECTION_CHANGE.OFFLINE)})))},e.prototype.disableNetworkMonitoring=function(){var e;null===(e=this._networkMonitoringSubscription)||void 0===e||e.unsubscribe(),this._networkMonitoringSubscription=void 0},Object.defineProperty(e.prototype,"connectionStateObservable",{get:function(){var e,t=this;return this._linkedConnectionStateObservable.map((function(e){return t.connectionStatesTranslator(e)})).filter((function(t){var n=t!==e;return e=t,n}))},enumerable:!0,configurable:!0}),e.prototype.record=function(e){"connected"===e.intendedConnectionState?this.enableNetworkMonitoring():"disconnected"===e.intendedConnectionState&&this.disableNetworkMonitoring();var t=r.__assign(r.__assign({},this._linkedConnectionState),e);this._linkedConnectionState=r.__assign({},t),this._linkedConnectionStateObserver.next(this._linkedConnectionState)},e.prototype.connectionStatesTranslator=function(e){var t=e.connectionState,n=e.networkState,r=e.intendedConnectionState,i=e.keepAliveState;return"connected"===t&&"disconnected"===n?o.ConnectionState.ConnectedPendingNetwork:"c
2onnected"===t&&"disconnected"===r?o.ConnectionState.ConnectedPendingDisconnect:"disconnected"===t&&"connected"===r&&"disconnected"===n?o.ConnectionState.ConnectionDisruptedPendingNetwork:"disconnected"===t&&"connected"===r?o.ConnectionState.ConnectionDisrupted:"connected"===t&&"unhealthy"===i?o.ConnectionState.ConnectedPendingKeepAlive:"connecting"===t?o.ConnectionState.Connecting:"disconnected"===t?o.ConnectionState.Disconnected:o.ConnectionState.Connected},e}();t.ConnectionStateMonitor=s},79407:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66562);t.ReachabilityMonitor=function(){return(new r.Reachability).networkMonitor()}},92438:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(31933);!function(e){e.START_RECONNECT="START_RECONNECT",e.HALT_RECONNECT="HALT_RECONNECT"}(r=t.ReconnectEvent||(t.ReconnectEvent={}));var o=function(){function e(){this.reconnectObservers=[]}return e.prototype.addObserver=function(e){this.reconnectObservers.push(e)},e.prototype.record=function(e){var t=this;e===r.START_RECONNECT&&void 0===this.reconnectSetTimeoutId&&void 0===this.reconnectIntervalId&&(this.reconnectSetTimeoutId=setTimeout((function(){t._triggerReconnect(),t.reconnectIntervalId=setInterval((function(){t._triggerReconnect()}),i.RECONNECT_INTERVAL)}),i.RECONNECT_DELAY)),e===r.HALT_RECONNECT&&(this.reconnectIntervalId&&(clearInterval(this.reconnectIntervalId),this.reconnectIntervalId=void 0),this.reconnectSetTimeoutId&&(clearTimeout(this.reconnectSetTimeoutId),this.reconnectSetTimeoutId=void 0))},e.prototype.close=function(){this.reconnectObservers.forEach((function(e){var t;null===(t=e.complete)||void 0===t||t.call(e)}))},e.prototype._triggerReconnect=function(){this.reconnectObservers.forEach((function(e){var t;null===(t=e.next)||void 0===t||t.call(e)}))},e}();t.ReconnectionMonitor=o},10775:function(e,t,n){var r;r=function(){var e=function(e){var t=function(){try{if(e.localStorage)return e.localStorage}catch(n){var t={};return{setItem:function(e,n){t[e]=n},getItem:function(e){return t[e]},removeItem:function(e){delete t[e]}}}}(),n=1,r=2,i=3,o=4,a=5,s=6,c=7,u=8,l=9,d=10,f=11,p=12,h=13,v=14,g=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){if(!t.hasOwnProperty(n)){var r="Unknown property, "+n+". Valid properties are:";for(var i in t)t.hasOwnProperty(i)&&(r=r+" "+i);throw new Error(r)}if(typeof e[n]!==t[n])throw new Error(_(y.INVALID_TYPE,[typeof e[n],n]))}},m=function(e,t){return function(){return e.apply(t,arguments)}},y={OK:{code:0,text:"AMQJSC0000I OK."},CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key={0} value={1}."},INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},b={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},_=function(e,t){var n=e.text;if(t)for(var r,i,o=0;o<t.length;o++)if(r="{"+o+"}",(i=n.indexOf(r))>0){var a=n.substring(0,i),s=n.substring(i+r.length);n=a+t[o]+s}return n},E=[0,6,77,81,73,115,100,112,3],w=[0,4,77,81,84,84,4],S=function(e,t){for(var n in this.type=e,t)t.hasOwnProperty(n)&&(this[n]=t[n])};function T(e,t){var n,u=t,d=e[t],p=d>>4,h=d&=15;t+=1;var v=0,g=1;do{if(t==e.length)return[null,u];v+=(127&(n=e[t++]))*g,g*=128}while(128&n);var m=t+v;if(m>e.length)return[null,u];var y=new S(p);
2switch(p){case r:1&e[t++]&&(y.sessionPresent=!0),y.returnCode=e[t++];break;case i:var b=h>>1&3,_=A(e,t),E=k(e,t+=2,_);t+=_,b>0&&(y.messageIdentifier=A(e,t),t+=2);var w=new x(e.subarray(t,m));1&~h||(w.retained=!0),8&~h||(w.duplicate=!0),w.qos=b,w.destinationName=E,y.payloadMessage=w;break;case o:case a:case s:case c:case f:y.messageIdentifier=A(e,t);break;case l:y.messageIdentifier=A(e,t),t+=2,y.returnCode=e.subarray(t,m)}return[y,m]}function I(e,t,n){return t[n++]=e>>8,t[n++]=e%256,n}function N(e,t,n,r){return O(e,n,r=I(t,n,r)),r+t}function A(e,t){return 256*e[t]+e[t+1]}function C(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r>2047?(55296<=r&&r<=56319&&(n++,t++),t+=3):r>127?t+=2:t++}return t}function O(e,t,n){for(var r=n,i=0;i<e.length;i++){var o=e.charCodeAt(i);if(55296<=o&&o<=56319){var a=e.charCodeAt(++i);if(isNaN(a))throw new Error(_(y.MALFORMED_UNICODE,[o,a]));o=a-56320+(o-55296<<10)+65536}o<=127?t[r++]=o:o<=2047?(t[r++]=o>>6&31|192,t[r++]=63&o|128):o<=65535?(t[r++]=o>>12&15|224,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>18&7|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128)}return t}function k(e,t,n){for(var r,i="",o=t;o<t+n;){var a=e[o++];if(a<128)r=a;else{var s=e[o++]-128;if(s<0)throw new Error(_(y.MALFORMED_UTF,[a.toString(16),s.toString(16),""]));if(a<224)r=64*(a-192)+s;else{var c=e[o++]-128;if(c<0)throw new Error(_(y.MALFORMED_UTF,[a.toString(16),s.toString(16),c.toString(16)]));if(a<240)r=4096*(a-224)+64*s+c;else{var u=e[o++]-128;if(u<0)throw new Error(_(y.MALFORMED_UTF,[a.toString(16),s.toString(16),c.toString(16),u.toString(16)]));if(!(a<248))throw new Error(_(y.MALFORMED_UTF,[a.toString(16),s.toString(16),c.toString(16),u.toString(16)]));r=262144*(a-240)+4096*s+64*c+u}}}r>65535&&(r-=65536,i+=String.fromCharCode(55296+(r>>10)),r=56320+(1023&r)),i+=String.fromCharCode(r)}return i}S.prototype.encode=function(){var e,t=(15&this.type)<<4,r=0,o=[],a=0;switch(void 0!==this.messageIdentifier&&(r+=2),this.type){case n:switch(this.mqttVersion){case 3:r+=E.length+3;break;case 4:r+=w.length+3}r+=C(this.clientId)+2,void 0!==this.willMessage&&(r+=C(this.willMessage.destinationName)+2,(e=this.willMessage.payloadBytes)instanceof Uint8Array||(e=new Uint8Array(l)),r+=e.byteLength+2),void 0!==this.userName&&(r+=C(this.userName)+2),void 0!==this.password&&(r+=C(this.password)+2);break;case u:t|=2;for(var c=0;c<this.topics.length;c++)o[c]=C(this.topics[c]),r+=o[c]+2;r+=this.requestedQos.length;break;case d:for(t|=2,c=0;c<this.topics.length;c++)o[c]=C(this.topics[c]),r+=o[c]+2;break;case s:t|=2;break;case i:this.payloadMessage.duplicate&&(t|=8),t=t|=this.payloadMessage.qos<<1,this.payloadMessage.retained&&(t|=1),r+=(a=C(this.payloadMessage.destinationName))+2;var l=this.payloadMessage.payloadBytes;r+=l.byteLength,l instanceof ArrayBuffer?l=new Uint8Array(l):l instanceof Uint8Array||(l=new Uint8Array(l.buffer))}var f=function(e){var t=new Array(1),n=0;do{var r=e%128;(e>>=7)>0&&(r|=128),t[n++]=r}while(e>0&&n<4);return t}(r),p=f.length+1,h=new ArrayBuffer(r+p),v=new Uint8Array(h);if(v[0]=t,v.set(f,1),this.type==i)p=N(this.payloadMessage.destinationName,a,v,p);else if(this.type==n){switch(this.mqttVersion){case 3:v.set(E,p),p+=E.length;break;case 4:v.set(w,p),p+=w.length}var g=0;this.cleanSession&&(g=2),void 0!==this.willMessage&&(g|=4,g|=this.willMessage.qos<<3,this.willMessage.retained&&(g|=32)),void 0!==this.userName&&(g|=128),void 0!==this.password&&(g|=64),v[p++]=g,p=I(this.keepAliveInterval,v,p)}switch(void 0!==this.messageIdentifier&&(p=I(this.messageIdentifier,v,p)),this.type){case n:p=N(this.clientId,C(this.clientId),v,p),void 0!==this.willMessage&&(p=N(this.willMessage.destinationName,C(this.willMessage.destinationName),v,p),p=I(e.byteLength,v,p),v.set(e,p),p+=e.byteLength),void 0!==this.userName&&(p=N(this.userName,C(this.userName),v,p)),void 0!==this.password&&(p=N(this.password,C(this.password),v,p));break;case i:v.set(l,p);break;case u:for(c=0;c<this.topics.length;c++)p=N(this.topics[c],o[c],v,p),v[p++]=this.requestedQos[c];break;case d:for(c=0;c<this.topics.length;c++)p=N(this.topics[c],o[c],v,p)}return h};var D=function(e,t){this._client=e,this._keepAliveInterval=1e3*t,this.isReset=!1;var n=new S(p).encode(),r=function(e){return function(){return i.apply(e)}},i=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(n),this.timeout=setTimeout(r(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(y.PING_TIMEOUT.code,_(y.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0,clearTimeout(this.timeout),this._keepAliveInterval>0&&(this.timeout=setTimeout(r(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},R=function(e,t,n,r){t||(t=30),this.timeout=setTimeout(function(e,t,n){return function(){return e.apply(t,n)}}(n,e,r),1e3*t),this.cancel=function(){clearTimeout(this.timeout)}},P=function(n,r,i,o,a){if(!("WebSocket"in e)||null===e.WebSocket)throw new Error(_(y.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in e)||null===e.ArrayBuffer)throw new Error(_(y.UNSUPPORTED,["ArrayBuffer"]));for(var s in this._trace("Paho.Client",n,r,i,o,a),this.host=r,this.port=i,this.path=o,this.uri=n,this.clientId=a,this._wsuri=null,this._localKey=r+":"+i+("/mqtt"!=o?":"+o:"")+":"+a+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0,t)0!==s.indexOf("Sent:"+this._localKey)&&0!==s.indexOf("Received:"+this._localKey)||this.restore(s)};P.prototype.host=null,P.prototype.port=null,P.prototype.path=null,P.prototype.uri=null,P.prototype.clientId=null,P.prototype.socket=null,P.prototype.connected=!1,P.prototype.maxMessageIdentifier=65536,P.prototype.connectOptions=null,P.prototype.hostIndex=null,P.prototype.onConnected=null,P.prototype.onConnectionLost=null,P.prototype.onMessageDelivered=null,P.prototype.onMessageArrived=null,P.prototype.traceFunction=null,P.prototype._msg_queue=null,P.prototype._buffered_msg_queue=null,P.prototype._connectTimeout=null,P.prototype.sendPinger=null,P.prototype.receivePinger=null,P.prototype._reconnectInterval=1,P.prototype._reconnecting=!1,P.prototype._reconnectTimeout=null,P.prototype.disconnectedPublishing=!1,P.prototype.disconnectedBufferSize=5e3,P.prototype.receiveBuffer=null,P.prototype._traceBuffer=null,P.prototype._MAX_TRACE_ENTRIES=100,P.prototype.connect=function(e){var t=this._traceMask(e,"password");if(this._trace("Client.connect",t,this.socket,this.connected),this.connected)throw new Error(_(y.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(_(y.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=e,this._reconnectInterval=1,this._reconnecting=!1,e.uris?(this.hostIndex=0,this._doConnect(e.uris[0])):this._doConnect(this.uri)},P.prototype.subscribe=function(e,t){if(this._trace("Client.subscribe",e,t),!this.connected)throw new Error(_(y.INVALID_STATE,["not connected"]));var n=new S(u);n.topics=e.constructor===Array?e:[e],void 0===t.qos&&(t.qos=0),n.requestedQos=[];for(var r=0;r<n.topics.length;r++)n.requestedQos[r]=t.qos;t.onSuccess&&(n.onSuccess=function(e){t.onSuccess({invocationContext:t.invocationContext,grantedQos:e})}),t.onFailure&&(n.onFailure=function(e){t.onFailure({invocationContext:t.invocationContext,errorCode:e,errorMessage:_(e)})}),t.timeout&&(n.timeOut=new R(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:y.SUBSCRIBE_TIMEOUT.code,errorMessage:_(y.SUBSCRIBE_TIMEOUT)}])),this._requires_ack(n),this._schedule_message(n)},P.prototype.unsubscribe=function(e,t){if(this._trace("Client.unsubscribe",e,t),!this.connected)throw new Error(_(y.INVALID_STATE,["not connected"]));var n=new S(d);n.topics=e.constructor===Array?e:[e],t.onSuccess&&(n.callback=function(){t.onSuccess({invocationContext:t.invocationContext})}),t.timeout&&(n.timeOut=new R(this,t.timeout,t.onFailure,[{invocationContext:t.invocationContext,errorCode:y.UNSUBSCRIBE_TIMEOUT.code,errorMessage:_(y.UNSUBSCRIBE_TIMEOUT)}])),this._requires_ack(n),this._schedule_message(n)},P.prototype.send=function(e){this._trace("Client.send",e);var t=new S(i);if(t.payloadMessage=e,this.connected)e.qos>0?this._requires_ack(t):this.onMessageDelivered&&(this._notify_msg_sent[t]=this.onMessageDelivered(t.payloadMessage)),this._schedule_message(t);else{if(!this._reconnecting||!this.disconnectedPublishing)throw new Error(_(y.INVALID_STATE,["not connected"]));if(Object.keys(this._sentMessages).length+this._buffered_msg_queue.length>this.disconnectedBufferSize)throw new Error(_(y.BUFFER_FULL,[this.disconnectedBufferSize]));e.qos>0?this._requires_ack(t):(t.sequence=++this._sequence,this._buffered_msg_queue.unshift(t))}},P.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(_(y.INVALID_STATE,["not connecting or connected"]));var e=new S(v);this._notify_msg_sent[e]=m(this._disconnected,this),this._schedule_message(e)},P.prototype.getTraceLog=function(){if(null!==this._traceBuffer){for(var e in this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length),this._sentMessages)this._trace("_sentMessages ",e,this._sentMessages[e]);for(var e in this._receivedMessages)this._trace("_receivedMessages ",e,this._receivedMessages[e]);return this._traceBuffer}},P.prototype.startTrace=function(){null===this._traceBuffer&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,"@VERSION@-@BUILDLEVEL@")},P.prototype.stopTrace=function(){delete this._traceBuffer},P.prototype._doConnect=function(e){if(this.connectOptions.useSSL){var t=e.split(":");t[0]="wss",e=t.join(":")}this._wsuri=e,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(e,["mqttv3.1"]):this.socket=new WebSocket(e,["mqtt"]),this.socket.b
2inaryType="arraybuffer",this.socket.onopen=m(this._on_socket_open,this),this.socket.onmessage=m(this._on_socket_message,this),this.socket.onerror=m(this._on_socket_error,this),this.socket.onclose=m(this._on_socket_close,this),this.sendPinger=new D(this,this.connectOptions.keepAliveInterval),this.receivePinger=new D(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new R(this,this.connectOptions.timeout,this._disconnected,[y.CONNECT_TIMEOUT.code,_(y.CONNECT_TIMEOUT)])},P.prototype._schedule_message=function(e){this._msg_queue.unshift(e),this.connected&&this._process_queue()},P.prototype.store=function(e,n){var r={type:n.type,messageIdentifier:n.messageIdentifier,version:1};if(n.type!==i)throw Error(_(y.INVALID_STORED_DATA,[e+this._localKey+n.messageIdentifier,r]));n.pubRecReceived&&(r.pubRecReceived=!0),r.payloadMessage={};for(var o="",a=n.payloadMessage.payloadBytes,s=0;s<a.length;s++)a[s]<=15?o=o+"0"+a[s].toString(16):o+=a[s].toString(16);r.payloadMessage.payloadHex=o,r.payloadMessage.qos=n.payloadMessage.qos,r.payloadMessage.destinationName=n.payloadMessage.destinationName,n.payloadMessage.duplicate&&(r.payloadMessage.duplicate=!0),n.payloadMessage.retained&&(r.payloadMessage.retained=!0),0===e.indexOf("Sent:")&&(void 0===n.sequence&&(n.sequence=++this._sequence),r.sequence=n.sequence),t.setItem(e+this._localKey+n.messageIdentifier,JSON.stringify(r))},P.prototype.restore=function(e){var n=t.getItem(e),r=JSON.parse(n),o=new S(r.type,r);if(r.type!==i)throw Error(_(y.INVALID_STORED_DATA,[e,n]));for(var a=r.payloadMessage.payloadHex,s=new ArrayBuffer(a.length/2),c=new Uint8Array(s),u=0;a.length>=2;){var l=parseInt(a.substring(0,2),16);a=a.substring(2,a.length),c[u++]=l}var d=new x(c);d.qos=r.payloadMessage.qos,d.destinationName=r.payloadMessage.destinationName,r.payloadMessage.duplicate&&(d.duplicate=!0),r.payloadMessage.retained&&(d.retained=!0),o.payloadMessage=d,0===e.indexOf("Sent:"+this._localKey)?(o.payloadMessage.duplicate=!0,this._sentMessages[o.messageIdentifier]=o):0===e.indexOf("Received:"+this._localKey)&&(this._receivedMessages[o.messageIdentifier]=o)},P.prototype._process_queue=function(){for(var e=null;e=this._msg_queue.pop();)this._socket_send(e),this._notify_msg_sent[e]&&(this._notify_msg_sent[e](),delete this._notify_msg_sent[e])},P.prototype._requires_ack=function(e){var t=Object.keys(this._sentMessages).length;if(t>this.maxMessageIdentifier)throw Error("Too many messages:"+t);for(;void 0!==this._sentMessages[this._message_identifier];)this._message_identifier++;e.messageIdentifier=this._message_identifier,this._sentMessages[e.messageIdentifier]=e,e.type===i&&this.store("Sent:",e),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},P.prototype._on_socket_open=function(){var e=new S(n,this.connectOptions);e.clientId=this.clientId,this._socket_send(e)},P.prototype._on_socket_message=function(e){this._trace("Client._on_socket_message",e.data);for(var t=this._deframeMessages(e.data),n=0;n<t.length;n+=1)this._handleMessage(t[n])},P.prototype._deframeMessages=function(e){var t=new Uint8Array(e),n=[];if(this.receiveBuffer){var r=new Uint8Array(this.receiveBuffer.length+t.length);r.set(this.receiveBuffer),r.set(t,this.receiveBuffer.length),t=r,delete this.receiveBuffer}try{for(var i=0;i<t.length;){var o=T(t,i),a=o[0];if(i=o[1],null===a)break;n.push(a)}i<t.length&&(this.receiveBuffer=t.subarray(i))}catch(c){var s="undefined"==c.hasOwnProperty("stack")?c.stack.toString():"No Error Stack Available";return void this._disconnected(y.INTERNAL_ERROR.code,_(y.INTERNAL_ERROR,[c.message,s]))}return n},P.prototype._handleMessage=function(e){this._trace("Client._handleMessage",e);
2try{switch(e.type){case r:if(this._connectTimeout.cancel(),this._reconnectTimeout&&this._reconnectTimeout.cancel(),this.connectOptions.cleanSession){for(var n in this._sentMessages){var u=this._sentMessages[n];t.removeItem("Sent:"+this._localKey+u.messageIdentifier)}for(var n in this._sentMessages={},this._receivedMessages){var d=this._receivedMessages[n];t.removeItem("Received:"+this._localKey+d.messageIdentifier)}this._receivedMessages={}}if(0!==e.returnCode){this._disconnected(y.CONNACK_RETURNCODE.code,_(y.CONNACK_RETURNCODE,[e.returnCode,b[e.returnCode]]));break}this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);var p=[];for(var v in this._sentMessages)this._sentMessages.hasOwnProperty(v)&&p.push(this._sentMessages[v]);if(this._buffered_msg_queue.length>0)for(var g=null;g=this._buffered_msg_queue.pop();)p.push(g),this.onMessageDelivered&&(this._notify_msg_sent[g]=this.onMessageDelivered(g.payloadMessage));p=p.sort((function(e,t){return e.sequence-t.sequence}));for(var m=0,E=p.length;m<E;m++)if((u=p[m]).type==i&&u.pubRecReceived){var w=new S(s,{messageIdentifier:u.messageIdentifier});this._schedule_message(w)}else this._schedule_message(u);this.connectOptions.onSuccess&&this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});var T=!1;this._reconnecting&&(T=!0,this._reconnectInterval=1,this._reconnecting=!1),this._connected(T,this._wsuri),this._process_queue();break;case i:this._receivePublish(e);break;case o:(u=this._sentMessages[e.messageIdentifier])&&(delete this._sentMessages[e.messageIdentifier],t.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(u.payloadMessage));break;case a:(u=this._sentMessages[e.messageIdentifier])&&(u.pubRecReceived=!0,w=new S(s,{messageIdentifier:e.messageIdentifier}),this.store("Sent:",u),this._schedule_message(w));break;case s:d=this._receivedMessages[e.messageIdentifier],t.removeItem("Received:"+this._localKey+e.messageIdentifier),d&&(this._receiveMessage(d),delete this._receivedMessages[e.messageIdentifier]);var I=new S(c,{messageIdentifier:e.messageIdentifier});this._schedule_message(I);break;case c:u=this._sentMessages[e.messageIdentifier],delete this._sentMessages[e.messageIdentifier],t.removeItem("Sent:"+this._localKey+e.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(u.payloadMessage);break;case l:(u=this._sentMessages[e.messageIdentifier])&&(u.timeOut&&u.timeOut.cancel(),128===e.returnCode[0]?u.onFailure&&u.onFailure(e.returnCode):u.onSuccess&&u.onSuccess(e.returnCode),delete this._sentMessages[e.messageIdentifier]);break;case f:(u=this._sentMessages[e.messageIdentifier])&&(u.timeOut&&u.timeOut.cancel(),u.callback&&u.callback(),delete this._sentMessages[e.messageIdentifier]);break;case h:this.sendPinger.reset();break;default:this._disconnected(y.INVALID_MQTT_MESSAGE_TYPE.code,_(y.INVALID_MQTT_MESSAGE_TYPE,[e.type]))}}catch(A){var N="undefined"==A.hasOwnProperty("stack")?A.stack.toString():"No Error Stack Available";return void this._disconnected(y.INTERNAL_ERROR.code,_(y.INTERNAL_ERROR,[A.message,N]))}},P.prototype._on_socket_error=function(e){this._reconnecting||this._disconnected(y.SOCKET_ERROR.code,_(y.SOCKET_ERROR,[e.data]))},P.prototype._on_socket_close=function(){this._reconnecting||this._disconnected(y.SOCKET_CLOSE.code,_(y.SOCKET_CLOSE))},P.prototype._socket_send=function(e){if(1==e.type){var t=this._traceMask(e,"password");this._trace("Client._socket_send",t)}else this._trace("Client._socket_send",e);this.socket.send(e.encode()),this.sendPinger.reset()},P.prototype._receivePublish=function(e){switch(e.payloadMessage.qos){case"undefined":case 0:this._receiveMessage(e);break;case 1:var t=new S(o,{messageIdentifier:e.messageIdentifier});this._schedule_message(t),this._receiveMessage(e);break;case 2:this._receivedMessages[e.messageIdentifier]=e,this.store("Received:",e);var n=new S(a,{messageIdentifier:e.messageIdentifier});this._schedule_message(n);break;default:throw Error("Invaild qos="+e.payloadMessage.qos)}},P.prototype._receiveMessage=function(e){this.onMessageArrived&&this.onMessageArrived(e.payloadMessage)},P.prototype._connected=function(e,t){this.onConnected&&this.onConnected(e,t)},P.prototype._reconnect=function(){this._trace("Client._reconnect"),this.connected||(this._reconnecting=!0,this.sendPinger.cancel(),this.receivePinger.cancel(),this._reconnectInterval<128&&(this._reconnectInterval=2*this._reconnectInterval),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))},P.prototype._disconnected=function(e,t){if(this._trace("Client._disconnected",e,t),void 0!==e&&this._reconnecting)this._reconnectTimeout=new R(this,this._reconnectInterval,this._reconnect);else if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,1===this.socket.readyState&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(void 0===e&&(e=y.OK.code,t=_(y.OK)),this.connected){if(this.connected=!1,this.onConnectionLost&&this.onConnectionLost({errorCode:e,errorMessage:t,reconnect:this.connectOptions.reconnect,uri:this._wsuri}),e!==y.OK.code&&this.connectOptions.reconnect)return this._reconnectInterval=1,void this._reconnect()}else 4===this.connectOptions.mqttVersion&&!1===this.connectOptions.mqttVersionExplicit?(this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri)):this.connectOptions.onFailure&&this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:e,errorMessage:t})},P.prototype._trace=function(){if(this.traceFunction){var e=Array.prototype.slice.call(arguments);for(var t in e)void 0!==e[t]&&e.splice(t,1,JSON.stringify(e[t]));var n=e.join("");this.traceFunction({severity:"Debug",message:n})}if(null!==this._traceBuffer){t=0;for(var r=arguments.length;t<r;t++)this._traceBuffer.length==this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),0===t||void 0===arguments[t]?this._traceBuffer.push(arguments[t]):this._traceBuffer.push(" "+JSON.stringify(arguments[t]))}},P.prototype._traceMask=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r==t?"******":e[r]);return n};var x=function(e){var t,n;if(!("string"==typeof e||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)))throw _(y.INVALID_ARGUMENT,[e,"newPayload"]);t=e;var r=0,i=!1,o=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return"string"==typeof t?t:k(t,0,t.length)}},payloadBytes:{enumerable:!0,get:function(){if("string"==typeof t){var e=new ArrayBuffer(C(t)),n=new Uint8Array(e);return O(t,n,0),n}return t}},destinationName:{enumerable:!0,get:function(){return n},set:function(e){if("string"!=typeof e)throw new Error(_(y.INVALID_ARGUMENT,[e,"newDestinationName"]));n=e}},qos:{enumerable:!0,get:function(){return r},set:function(e){if(0!==e&&1!==e&&2!==e)throw new Error("Invalid argument:"+e);r=e}},retained:{enumerable:!0,get:function(){return i},set:function(e){if("boolean"!=typeof e)throw new Error(_(y.INVALID_ARGUMENT,[e,"newRetained"]));i=e}},topic:{enumerable:!0,get:function(){return n},set:function(e){n=e}},duplicate:{enumerable:!0,get:function(){return o}
2,set:function(e){o=e}}})};return{Client:function(e,t,n,r){var i;if("string"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"host"]));if(2==arguments.length){r=t;var o=(i=e).match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(!o)throw new Error(_(y.INVALID_ARGUMENT,[e,"host"]));e=o[4]||o[2],t=parseInt(o[7]),n=o[8]}else{if(3==arguments.length&&(r=n,n="/mqtt"),"number"!=typeof t||t<0)throw new Error(_(y.INVALID_TYPE,[typeof t,"port"]));if("string"!=typeof n)throw new Error(_(y.INVALID_TYPE,[typeof n,"path"]));var a=-1!==e.indexOf(":")&&"["!==e.slice(0,1)&&"]"!==e.slice(-1);i="ws://"+(a?"["+e+"]":e)+":"+t+n}for(var s=0,c=0;c<r.length;c++){var u=r.charCodeAt(c);55296<=u&&u<=56319&&c++,s++}if("string"!=typeof r||s>65535)throw new Error(_(y.INVALID_ARGUMENT,[r,"clientId"]));var l=new P(i,e,t,n,r);Object.defineProperties(this,{host:{get:function(){return e},set:function(){throw new Error(_(y.UNSUPPORTED_OPERATION))}},port:{get:function(){return t},set:function(){throw new Error(_(y.UNSUPPORTED_OPERATION))}},path:{get:function(){return n},set:function(){throw new Error(_(y.UNSUPPORTED_OPERATION))}},uri:{get:function(){return i},set:function(){throw new Error(_(y.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return l.clientId},set:function(){throw new Error(_(y.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return l.onConnected},set:function(e){if("function"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"onConnected"]));l.onConnected=e}},disconnectedPublishing:{get:function(){return l.disconnectedPublishing},set:function(e){l.disconnectedPublishing=e}},disconnectedBufferSize:{get:function(){return l.disconnectedBufferSize},set:function(e){l.disconnectedBufferSize=e}},onConnectionLost:{get:function(){return l.onConnectionLost},set:function(e){if("function"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"onConnectionLost"]));l.onConnectionLost=e}},onMessageDelivered:{get:function(){return l.onMessageDelivered},set:function(e){if("function"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"onMessageDelivered"]));l.onMessageDelivered=e}},onMessageArrived:{get:function(){return l.onMessageArrived},set:function(e){if("function"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"onMessageArrived"]));l.onMessageArrived=e}},trace:{get:function(){return l.traceFunction},set:function(e){if("function"!=typeof e)throw new Error(_(y.INVALID_TYPE,[typeof e,"onTrace"]));l.traceFunction=e}}}),this.connect=function(e){if(g(e=e||{},{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),void 0===e.keepAliveInterval&&(e.keepAliveInterval=60),e.mqttVersion>4||e.mqttVersion<3)throw new Error(_(y.INVALID_ARGUMENT,[e.mqttVersion,"connectOptions.mqttVersion"]));if(void 0===e.mqttVersion?(e.mqttVersionExplicit=!1,e.mqttVersion=4):e.mqttVersionExplicit=!0,void 0!==e.password&&void 0===e.userName)throw new Error(_(y.INVALID_ARGUMENT,[e.password,"connectOptions.password"]));if(e.willMessage){if(!(e.willMessage instanceof x))throw new Error(_(y.INVALID_TYPE,[e.willMessage,"connectOptions.willMessage"]));if(e.willMessage.stringPayload=null,void 0===e.willMessage.destinationName)throw new Error(_(y.INVALID_TYPE,[typeof e.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(void 0===e.cleanSession&&(e.cleanSession=!0),e.hosts){if(!(e.hosts instanceof Array))throw new Error(_(y.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));if(e.hosts.length<1)throw new Error(_(y.INVALID_ARGUMENT,[e.hosts,"connectOptions.hosts"]));for(var t=!1,r=0;r<e.hosts.length;r++){if("string"!=typeof e.hosts[r])throw new Error(_(y.INVALID_TYPE,[typeof e.hosts[r],"connectOptions.hosts["+r+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(e.hosts[r])){if(0===r)t=!0;else if(!t)throw new Error(_(y.INVALID_ARGUMENT,[e.hosts[r],"connectOptions.hosts["+r+"]"]))}else if(t)throw new Error(_(y.INVALID_ARGUMENT,[e.hosts[r],"connectOptions.hosts["+r+"]"]))}
2if(t)e.uris=e.hosts;else{if(!e.ports)throw new Error(_(y.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(!(e.ports instanceof Array))throw new Error(_(y.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));if(e.hosts.length!==e.ports.length)throw new Error(_(y.INVALID_ARGUMENT,[e.ports,"connectOptions.ports"]));for(e.uris=[],r=0;r<e.hosts.length;r++){if("number"!=typeof e.ports[r]||e.ports[r]<0)throw new Error(_(y.INVALID_TYPE,[typeof e.ports[r],"connectOptions.ports["+r+"]"]));var o=e.hosts[r],a=e.ports[r],s=-1!==o.indexOf(":");i="ws://"+(s?"["+o+"]":o)+":"+a+n,e.uris.push(i)}}}l.connect(e)},this.subscribe=function(e,t){if("string"!=typeof e&&e.constructor!==Array)throw new Error("Invalid argument:"+e);if(g(t=t||{},{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("subscribeOptions.timeout specified with no onFailure callback.");if(void 0!==t.qos&&0!==t.qos&&1!==t.qos&&2!==t.qos)throw new Error(_(y.INVALID_ARGUMENT,[t.qos,"subscribeOptions.qos"]));l.subscribe(e,t)},this.unsubscribe=function(e,t){if("string"!=typeof e&&e.constructor!==Array)throw new Error("Invalid argument:"+e);if(g(t=t||{},{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),t.timeout&&!t.onFailure)throw new Error("unsubscribeOptions.timeout specified with no onFailure callback.");l.unsubscribe(e,t)},this.send=function(e,t,n,r){var i;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof x)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(i=e).destinationName)throw new Error(_(y.INVALID_ARGUMENT,[i.destinationName,"Message.destinationName"]));l.send(i)}else(i=new x(t)).destinationName=e,arguments.length>=3&&(i.qos=n),arguments.length>=4&&(i.retained=r),l.send(i)},this.publish=function(e,t,n,r){var i;if(0===arguments.length)throw new Error("Invalid argument.length");if(1==arguments.length){if(!(e instanceof x)&&"string"!=typeof e)throw new Error("Invalid argument:"+typeof e);if(void 0===(i=e).destinationName)throw new Error(_(y.INVALID_ARGUMENT,[i.destinationName,"Message.destinationName"]));l.send(i)}else(i=new x(t)).destinationName=e,arguments.length>=3&&(i.qos=n),arguments.length>=4&&(i.retained=r),l.send(i)},this.disconnect=function(){l.disconnect()},this.getTraceLog=function(){return l.getTraceLog()},this.startTrace=function(){l.startTrace()},this.stopTrace=function(){l.stopTrace()},this.isConnected=function(){return l.connected}},Message:x}}(void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});return e},e.exports=r()},28904:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},58145:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90304:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39116:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},35660:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var n=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,r=t.getRandomValues,i=t.subtle;return n.map((function(e){return i[e]})).concat(r).every((function(e){return"function"==typeof e}))}return!1}},18086:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15215);r.__exportStar(n(28904),t),r.__exportStar(n(58145),t),r.__exportStar(n(90304),t),r.__exportStar(n(39116),t),r.__exportStar(n(35660),t)},14955:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},69258:function(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(71195),i=n(32038),o=n(82947),a=n(23469),s=n(18086),c=n(77226),u=function(){function e(e){(0,a.supportsWebCrypto)((0,c.locateWindow)())?this.hash=new i.Sha256(e):(0,s.isMsWindow)((0,c.locateWindow)())?this.hash=new r.Sha256(e):this.hash=new o.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=u},71195:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(85787),i=n(14955),o=n(84006),a=n(77226),s=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=(0,a.locateWindow)().msCrypto.subtle.importKey("raw",c(e),i.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n(new Error("ImportKey completed without importing key."))},r.onerror=function(){n(new Error("ImportKey failed to import key."))}}))}(e).then((function(e){return(0,a.locateWindow)().msCrypto.subtle.sign(i.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve((0,a.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,r.isEmptyData)(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(c(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n(new Error("Error encountered finalizing hash"))},e.finish()}))}))},e}();function c(e){return"string"==typeof e?(0,o.fromUtf8)(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=s},36634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,(0,n(15215).__exportStar)(n(69258),t);var r=n(71195);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var i=n(32038);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return i.Sha256}})},85787:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},32038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(65388),i=n(14955),o=n(77226),a=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){(0,o.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(e),i.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!(0,r.isEmptyData)(e)){var t=(0,r.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return(0,o.locateWindow)().crypto.subtle.sign(i.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,r.isEmptyData)(this.toHash)?Promise.resolve(i.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,o.locateWindow)().crypto.subtle.digest(i.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();t.Sha256=a},20538:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(44326),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i<r.BLOCK_SIZE;
2i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<r.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(r.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],d=0;d<r.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var f=this.temp[d-2],p=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,h=((f=this.temp[d-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(h+this.temp[d-16]|0)}var v=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&c^~s&u)|0)+(l+(r.KEY[d]+this.temp[d]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;l=u,u=c,c=s,s=a+v|0,a=o,o=i,i=n,n=v+g|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=a,t[4]+=s,t[5]+=c,t[6]+=u,t[7]+=l},e}();t.RawSha256=i},44326:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},82947:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(15215).__exportStar)(n(64279),t)},64279:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(15215),i=n(44326),o=n(20538),a=n(65388),s=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(t){this.error=t}},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,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},23469:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(15215).__exportStar(n(13526),t)},13526:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(15215),i=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function o(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&i.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!o(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=o,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}
2))}))}},51024:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(84006),i="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?i(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},65388:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(51024);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var i=n(70165);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return i.isEmptyData}});var o=n(15413);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return o.numToUint8}});var a=n(82110);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},70165:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},15413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},82110:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},84834:function(e,t,n){"use strict";n.d(t,{Kd:function(){return o},cS:function(){return r}});var r=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),i=n(15215),o=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e((0,i.__assign)((0,i.__assign)({},this),{headers:(0,i.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return(0,i.__assign)((0,i.__assign)({},e),((r={})[n]=Array.isArray(o)?(0,i.__spread)(o):o,r))}),{}))),n},e}()},60102:function(e,t,n){"use strict";n.d(t,{n:function(){return s}});for(var r={},i={},o=0;o<256;o++){var a=o.toString(16).toLowerCase();1===a.length&&(a="0"+a),r[o]=a,i[a]=o}function s(e){for(var t="",n=0;n<e.byteLength;n++)t+=r[e[n]];return t}},77226:function(e,t,n){"use strict";n.r(t),n.d(t,{locateWindow:function(){return i}});const r={};function i(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}},84006:function(e,t,n){"use strict";n.r(t),n.d(t,{fromUtf8:function(){return r},toUtf8:function(){return i}});const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const i=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),i=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const i=e[++n];t+=String.fromCharCode((31&r)<<6|63&i)}else if(240<=r&&r<365){const i="%"+[r,e[++n],e[++n],e[++n]].map((e=>e.toString(16))).join("%");t+=decodeURIComponent(i)}
2else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)},79163:function(e,t,n){"use strict";n.d(t,{OD:function(){return r},$t:function(){return i}});var r={userAgent:"aws-amplify/5.0.4",isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},i=function(){return r.userAgent}},18025:function(e,t,n){"use strict";n.d(t,{mX:function(){return a},An:function(){return s},XB:function(){return o},fE:function(){return c}});var r=n(79163);function i(){}i.prototype.userAgent=(0,r.$t)();var o=function(e){e&&(i.prototype.userAgent&&!i.prototype.userAgent.includes(e)&&(i.prototype.userAgent=i.prototype.userAgent.concat(" ",e)),i.prototype.userAgent&&""!==i.prototype.userAgent||(i.prototype.userAgent=e))},a=function(){i.category="auth"},s=function(e){i.framework=e},c=function(e){var t=i.category?" "+i.category:"",n=i.framework?" framework/"+i.framework:"";return""+i.prototype.userAgent+t+n}},16807:function(e,t,n){"use strict";n.d(t,{By:function(){return i},pD:function(){return C},Yw:function(){return k},c9:function(){return D},TU:function(){return G},HB:function(){return U},NE:function(){return te},p4:function(){return P},W6:function(){return re},XB:function(){return q.XB}});var r,i=function(){function e(e){var t=e||{},n=t.ValidationData,r=t.Username,i=t.Password,o=t.AuthParameters,a=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=a||{},this.username=r,this.password=i}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),o=n(48287);if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(45682)}catch(ie){}function a(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(ie){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(ie){}}throw new Error("Native crypto module could not be used to get secure random number.")}var s,c=function(){function e(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var n=[],r=0;r<t;r+=4)n.push(a());return new e(n,t)},t.toString=function(){return function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")}(this)},e}(),u=n(77776),l=d;function d(e,t){null!=e&&this.fromString(e,t)}function f(){return new d(null)}var p="undefined"!=typeof navigator;p&&"Microsoft Internet Explorer"==navigator.appName?(d.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;i=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),n[r++]=1073741823&c}return i},s=30):p&&"Netscape"!=navigator.appName?(d.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},s=26):(d.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;i=((c=a*c+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return i},s=28),d.prototype.DB=s,d.prototype.DM=(1<<s)-1,d.prototype.DV=1<<s;d.prototype.FV=Math.pow(2,52),d.prototype.F1=52-s,d.prototype.F2=2*s-52;var h,v,g="0123456789abcdefghijklmnopqrstuvwxyz",m=new Array;for(h="0".charCodeAt(0),v=0;v<=9;++v)m[h++]=v;for(h="a".charCodeAt(0),v=10;v<36;++v)m[h++]=v;for(h="A".charCodeAt(0),v=10;v<36;++v)m[h++]=v;function y(e){return g.charAt(e)}function b(e,t){var n=m[e.charCodeAt(t)];return null==n?-1:n}function _(e){var t=f();return t.fromInt(e),t}function E(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function w(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>
vendor: 8,869 bytes, line 2
2>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function S(e){return o.Buffer.from((new c).random(e).toString(),"hex")}w.prototype.convert=function(e){var t=f();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(d.ZERO)>0&&this.m.subTo(t,t),t},w.prototype.revert=function(e){var t=f();return e.copyTo(t),this.reduce(t),t},w.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},w.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},w.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},d.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},d.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},d.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=b(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}this.clamp(),i&&d.ZERO.subTo(this,this)},d.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},d.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},d.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},d.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<<r;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},d.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},d.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},d.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&d.ZERO.subTo(t,t)},d.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},d.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=f());var o=f(),a=this.s,s=e.s,c=this.DB-E(r[r.t-1]);c>0?(r.lShiftTo(c,o),i.lShiftTo(c,n)):(r.copyTo(o),i.copyTo(n));var u=o.t,l=o[u-1];if(0!=l){var p=l*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),h=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,m=n.t,y=m-u,b=null==t?f():t;for(o.dlShiftTo(y,b),n.compareTo(b)>=0&&(n[n.t++]=1,n.subTo(b,n)),d.ONE.dlShiftTo(u,b),b.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--y>=0;){var _=n[--m]==l?this.DM:Math.floor(n[m]*h+(n[m-1]+g)*v);if((n[m]+=o.am(0,_,n,y,0,u))<_)for(o.dlShiftTo(y,b),n.subTo(b,n);n[m]<--_;)n.subTo(b,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&d.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&d.ZERO.subTo(n,n)}}},d.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},d.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},d.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(i=!0,o=y(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=y(n));return i?o:"0"},d.prototype.negate=function(){var e=f();return d.ZERO.subTo(this,e),e},d.prototype.abs=function(){return this.s<0?this.negate():this},d.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},d.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+E(this[this.t-1]^this.s&this.DM)},d.prototype.mod=function(e){var t=f();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(d.ZERO)>0&&e.subTo(t,t),t},d.prototype.equals=function(e){return 0==this.compareTo(e)},d.prototype.add=function(e){var t=f();return this.addTo(e,t),t},d.prototype.subtract=function(e){var t=f();return this.subTo(e,t),t},d.prototype.multiply=function(e){var t=f();return this.multiplyTo(e,t),t},d.prototype.divide=function(e){var t=f();return this.divRemTo(e,t,null),t},d.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=_(1),a=new w(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var s=new Array,c=3,u=r-1,l=(1<<r)-1;if(s[1]=a.convert(this),r>1){var d=f();for(a.sqrTo(s[1],d);c<=l;)s[c]=f(),a.mulTo(d,s[c-2],s[c]),c+=2}var p,h,v=e.t-1,g=!0,m=f();for(i=E(e[v])-1;v>=0;){for(i>=u?p=e[v]>>i-u&l:(p=(e[v]&(1<<i+1)-1)<<u-i,v>0&&(p|=e[v-1]>>this.DB+i-u)),c=r;!(1&p);)p>>=1,--c;if((i-=c)<0&&(i+=this.DB,--v),g)s[p].copyTo(o),g=!1;else{for(;c>1;)a.sqrTo(o,m),a.sqrTo(m,o),c-=2;c>0?a.sqrTo(o,m):(h=o,o=m,m=h),a.mulTo(m,s[p],o)}for(;v>=0&&!(e[v]&1<<i);)a.sqrTo(o,m),h=o,o=m,m=h,--i<0&&(i=this.DB-1,--v)}var y=a.revert(o);return n(null,y),y},d.ZERO=_(0),d.ONE=_(1);var T=/^[89a-f]/i,I=function(){function e(e){this.N=new l("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",16),this.g=new l("2",16),this.k=new l(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue((function(){})),this.infoBits=o.Buffer.from("Caldera Derived Key","utf8"),this.poolName=e}var t=e.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,(function(n,r){n&&e(n,null),t.largeAValue=r,e(null,t.largeAValue)}))},t.generateRandomSmallA=function(){var e=S(128).toString("hex");return new l(e,16)},t.generateRandomString=function(){return S(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,t,n){var r=this;this.randomPassword=this.generateRandomString();var i=""+e+t+":"+this.randomPassword,o=this.hash(i),a=S(16).toString("hex");this.SaltToHashDevices=this.padHex(new l(a,16)),this.g.modPow(new l(this.hexHash(this.SaltToHashDevices+o),16),this.N,(function(e,t){e&&n(e,null),r.verifierDevices=r.padHex(t),n(null,null)}))},t.calculateA=function(e,t){var n=this;this.g.modPow(e,this.N,(function(e,r){e&&t(e,null),r.mod(n.N).equals(l.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,r)}
2))},t.calculateU=function(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new l(this.UHexHash,16)},t.hash=function(e){var t=new u.Sha256;t.update(e);var n=t.digestSync(),r=o.Buffer.from(n).toString("hex");return new Array(64-r.length).join("0")+r},t.hexHash=function(e){return this.hash(o.Buffer.from(e,"hex"))},t.computehkdf=function(e,t){var n=o.Buffer.concat([this.infoBits,o.Buffer.from(String.fromCharCode(1),"utf8")]),r=new u.Sha256(t);r.update(e);var i=r.digestSync(),a=new u.Sha256(i);return a.update(n),a.digestSync().slice(0,16)},t.getPasswordAuthenticationKey=function(e,t,n,r,i){var a=this;if(n.mod(this.N).equals(l.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,n),this.UValue.equals(l.ZERO))throw new Error("U cannot be zero.");var s=""+this.poolName+e+":"+t,c=this.hash(s),u=new l(this.hexHash(this.padHex(r)+c),16);this.calculateS(u,n,(function(e,t){e&&i(e,null);var n=a.computehkdf(o.Buffer.from(a.padHex(t),"hex"),o.Buffer.from(a.padHex(a.UValue),"hex"));i(null,n)}))},t.calculateS=function(e,t,n){var r=this;this.g.modPow(e,this.N,(function(i,o){i&&n(i,null),t.subtract(r.k.multiply(o)).modPow(r.smallAValue.add(r.UValue.multiply(e)),r.N,(function(e,t){e&&n(e,null),n(null,t.mod(r.N))}))}))},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},t.padHex=function(e){if(!(e instanceof l))throw new Error("Not a BigInteger");var t=e.compareTo(l.ZERO)<0,n=e.abs().toString(16);if(n=n.length%2!=0?"0"+n:n,n=T.test(n)?"00"+n:n,t){var r=n.split("").map((function(e){var t=15&~parseInt(e,16);return"0123456789ABCDEF".charAt(t)})).join("");(n=new l(r,16).add(l.ONE).toString(16)).toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},e}(),N=function(){function e(e){this.jwtToken=e||"",this.payload=this.decodePayload()}var t=e.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(o.Buffer.from(e,"base64").toString("utf8"))}catch(ie){return{}}},e}();function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var C=function(e){var t,n;function r(t){var n=(void 0===t?{}:t).AccessToken;return e.call(this,n||"")||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,A(t,n),r}(N);function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}var k=function(e){var t,n;function r(t){var n=(void 0===t?{}:t).IdToken;return e.call(this,n||"")||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,O(t,n),r}(N),D=function(){function e(e){var t=(void 0===e?{}:e).RefreshToken;this.token=t||""}return e.prototype.getToken=function(){return this.token},e}(),R=n(79163),P=function(){function e(e){var t=void 0===e?{}:e,n=t.IdToken,r=t.RefreshToken,i=t.AccessToken,o=t.ClockDrift;if(null==i||null==n)throw new Error("Id token and Access Token must be present.");this.idToken=n,this.refreshToken=r,this.accessToken=i,this.clockDrift=void 0===o?this.calculateClockDrift():o}var t=e.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},t.isValid=function(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},e}(),x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],M=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],L=function(){function e(){}return e.prototype.getNowString=function(){var e=new Date,t=M[e.getUTCDay()],n=x[e.getUTCMonth()],r=e.getUTCDate(),i=e.getUTCHours();i<10&&(i="0"+i);var o=e.getUTCMinutes();o<10&&(o="0"+o);var a=e.getUTCSeconds();return a<10&&(a="0"+a),t+" "+n+" "+r+" "+i+":"+o+":"+a+" UTC "+e.getUTCFullYear()},e}(),U=function(){function e(e){var t=void 0===e?{}:e,n=t.Name,r=t.Value;this.Name=n||"",this.Value=r||""}var t=e.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}(),F={},j=function(){function e(){}return e.setItem=function(e,t){return F[e]=t,F[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(F,e)?F[e]:void 0},e.removeItem=function(e){return delete F[e]},e.clear=function(){return F={}},e}(),B=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=j}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),V="undefined"!=typeof navigator?R.OD.isReactNative?"react-native":navigator.userAgent:"nodejs",G=function(){function e(e){if(null==e||null==e.Username||null==e.Pool)throw new Error("Username and Pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new B).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=e.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,t){var n=this,r=e.getAuthParameters();r.USERNAME=this.username;var i=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:i};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",o,(function(e,r){if(e)return t.onFailure(e);var i=r.ChallengeName,o=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))}))},t.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invali
2d."))},t.authenticateUserDefaultAuth=function(e,t){var n,r,i=this,a=new I(this.pool.getUserPoolName()),s=new L,c={};null!=this.deviceKey&&(c.DEVICE_KEY=this.deviceKey),c.USERNAME=this.username,a.getLargeAValue((function(d,f){d&&t.onFailure(d),c.SRP_A=f.toString(16),"CUSTOM_AUTH"===i.authenticationFlowType&&(c.CHALLENGE_NAME="SRP_A");var p=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),h={AuthFlow:i.authenticationFlowType,ClientId:i.pool.getClientId(),AuthParameters:c,ClientMetadata:p};i.getUserContextData(i.username)&&(h.UserContextData=i.getUserContextData(i.username)),i.client.request("InitiateAuth",h,(function(c,d){if(c)return t.onFailure(c);var f=d.ChallengeParameters;i.username=f.USER_ID_FOR_SRP,i.userDataKey=i.keyPrefix+"."+i.username+".userData",n=new l(f.SRP_B,16),r=new l(f.SALT,16),i.getCachedDeviceKeyAndPassword(),a.getPasswordAuthenticationKey(i.username,e.getPassword(),n,r,(function(e,n){e&&t.onFailure(e);var r=s.getNowString(),c=o.Buffer.concat([o.Buffer.from(i.pool.getUserPoolName(),"utf8"),o.Buffer.from(i.username,"utf8"),o.Buffer.from(f.SECRET_BLOCK,"base64"),o.Buffer.from(r,"utf8")]),l=new u.Sha256(n);l.update(c);var h=l.digestSync(),v=o.Buffer.from(h).toString("base64"),g={};g.USERNAME=i.username,g.PASSWORD_CLAIM_SECRET_BLOCK=f.SECRET_BLOCK,g.TIMESTAMP=r,g.PASSWORD_CLAIM_SIGNATURE=v,null!=i.deviceKey&&(g.DEVICE_KEY=i.deviceKey);var m={ChallengeName:"PASSWORD_VERIFIER",ClientId:i.pool.getClientId(),ChallengeResponses:g,Session:d.Session,ClientMetadata:p};i.getUserContextData()&&(m.UserContextData=i.getUserContextData()),function e(t,n){return i.client.request("RespondToAuthChallenge",t,(function(r,o){return r&&"ResourceNotFoundException"===r.code&&-1!==r.message.toLowerCase().indexOf("device")?(g.DEVICE_KEY=null,i.deviceKey=null,i.randomPassword=null,i.deviceGroupKey=null,i.clearCachedDeviceKeyAndPassword(),e(t,n)):n(r,o)}))}(m,(function(e,n){return e?t.onFailure(e):i.authenticateUserInternal(n,a,t)}))}))}))}))},t.authenticateUserPlainUsernamePassword=function(e,t){var n=this,r={};if(r.USERNAME=this.username,r.PASSWORD=e.getPassword(),r.PASSWORD){var i=new I(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var o=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),a={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:o};this.getUserContextData(this.username)&&(a.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",a,(function(e,r){return e?t.onFailure(e):n.authenticateUserInternal(r,i,t)}))}else t.onFailure(new Error("PASSWORD parameter is required"))},t.authenticateUserInternal=function(e,t,n){var r=this,i=e.ChallengeName,a=e.ChallengeParameters;if("SMS_MFA"===i)return this.Session=e.Session,n.mfaRequired(i,a);if("SELECT_MFA_TYPE"===i)return this.Session=e.Session,n.selectMFAType(i,a);if("MFA_SETUP"===i)return this.Session=e.Session,n.mfaSetup(i,a);if("SOFTWARE_TOKEN_MFA"===i)return this.Session=e.Session,n.totpRequired(i,a);if("CUSTOM_CHALLENGE"===i)return this.Session=e.Session,n.customChallenge(a);if("NEW_PASSWORD_REQUIRED"===i){this.Session=e.Session;var s=null,c=null,u=[],l=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(a&&(s=JSON.parse(e.ChallengeParameters.userAttributes),c=JSON.parse(e.ChallengeParameters.requiredAttributes)),c)for(var d=0;d<c.length;d++)u[d]=c[d].substr(l.length);return n.newPasswordRequired(s,u)}if("DEVICE_SRP_AUTH"===i)return this.Session=e.Session,void this.getDeviceResponse(n);this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=i,this.cacheTokens();var f=e.AuthenticationResult.NewDeviceMetadata;if(null==f)return n.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(i){if(i)return n.onFailure(i);var a={Salt:o.Buffer.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:o.Buffer.from(t.getVerifierDevices(),"hex").toString("base64")};r.verifierDevices=a.PasswordVerifier,r.deviceGroupKey=f.DeviceGroupKey,r.randomPassword=t.getRandomPassword(),r.client.request("ConfirmDevice",{DeviceKey:f.DeviceKey,AccessToken:r.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:a,DeviceName:V},(function(t,i){return t?n.onFailure(t):(r.deviceKey=e.AuthenticationResult.
vendor: 7,840 bytes, line 2
2NewDeviceMetadata.DeviceKey,r.cacheDeviceKeyAndPassword(),!0===i.UserConfirmationNecessary?n.onSuccess(r.signInUserSession,i.UserConfirmationNecessary):n.onSuccess(r.signInUserSession))}))}))},t.completeNewPasswordChallenge=function(e,t,n,r){var i=this;if(!e)return n.onFailure(new Error("New password is required."));var o=new I(this.pool.getUserPoolName()),a=o.getNewPasswordRequiredChallengeUserAttributePrefix(),s={};t&&Object.keys(t).forEach((function(e){s[a+e]=t[e]})),s.NEW_PASSWORD=e,s.USERNAME=this.username;var c={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:s,Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",c,(function(e,t){return e?n.onFailure(e):i.authenticateUserInternal(t,o,n)}))},t.getDeviceResponse=function(e,t){var n=this,r=new I(this.deviceGroupKey),i=new L,a={};a.USERNAME=this.username,a.DEVICE_KEY=this.deviceKey,r.getLargeAValue((function(s,c){s&&e.onFailure(s),a.SRP_A=c.toString(16);var d={ChallengeName:"DEVICE_SRP_AUTH",ClientId:n.pool.getClientId(),ChallengeResponses:a,ClientMetadata:t,Session:n.Session};n.getUserContextData()&&(d.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",d,(function(t,a){if(t)return e.onFailure(t);var s=a.ChallengeParameters,c=new l(s.SRP_B,16),d=new l(s.SALT,16);r.getPasswordAuthenticationKey(n.deviceKey,n.randomPassword,c,d,(function(t,r){if(t)return e.onFailure(t);var c=i.getNowString(),l=o.Buffer.concat([o.Buffer.from(n.deviceGroupKey,"utf8"),o.Buffer.from(n.deviceKey,"utf8"),o.Buffer.from(s.SECRET_BLOCK,"base64"),o.Buffer.from(c,"utf8")]),d=new u.Sha256(r);d.update(l);var f=d.digestSync(),p=o.Buffer.from(f).toString("base64"),h={};h.USERNAME=n.username,h.PASSWORD_CLAIM_SECRET_BLOCK=s.SECRET_BLOCK,h.TIMESTAMP=c,h.PASSWORD_CLAIM_SIGNATURE=p,h.DEVICE_KEY=n.deviceKey;var v={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:h,Session:a.Session};n.getUserContextData()&&(v.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",v,(function(t,r){return t?e.onFailure(t):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))}))}))}))}))},t.confirmRegistration=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",i,(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.sendCustomChallengeAnswer=function(e,t,n){var r=this,i={};i.USERNAME=this.username,i.ANSWER=e;var o=new I(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(i.DEVICE_KEY=this.deviceKey);var a={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:i,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,(function(e,n){return e?t.onFailure(e):r.authenticateUserInternal(n,o,t)}))},t.sendMFACode=function(e,t,n,r){var i=this,a={};a.USERNAME=this.username,a.SMS_MFA_CODE=e;var s=n||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===s&&(a.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(a.DEVICE_KEY=this.deviceKey);var c={ChallengeName:s,ChallengeResponses:a,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",c,(function(e,n){if(e)return t.onFailure(e);if("DEVICE_SRP_AUTH"!==n.ChallengeName){if(i.signInUserSession=i.getCognitoUserSession(n.AuthenticationResult),i.cacheTokens(),null==n.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(i.signInUserSession);var r=new I(i.pool.getUserPoolName());r.generateHashDevice(n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,n.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(e){if(e)return t.onFailure(e);var a={Salt:o.Buffer.from(r.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:o.Buffer.from(r.getVerifierDevices(),"hex").toString("base64")};i.verifierDevices=a.PasswordVerifier,i.deviceGroupKey=n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,i.randomPassword=r.getRandomPassword(),i.client.request("ConfirmDevice",{DeviceKey:n.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:i.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:a,DeviceName:V},(function(e,r){return e?t.onFailure(e):(i.deviceKey=n.AuthenticationResult.NewDeviceMetadata.DeviceKey,i.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?t.onSuccess(i.signInUserSession,r.UserConfirmationNecessary):t.onSuccess(i.signInUserSession))}))}))}else i.getDeviceResponse(t)}))},t.changePassword=function(e,t,n,r){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:r},(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.enableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var t=[];t.push({DeliveryMedium:"SMS",AttributeName:"phone_number"}),this.client.request("SetUserSettings",{MFAOptions:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t){return t?e(t,null):e(null,"SUCCESS")}))},t.setUserMfaPreference=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.disableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("SetUserSettings",{MFAOptions:[],AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t){return t?e(t,null):e(null,"SUCCESS")}))},t.deleteUser=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:t},(function(t){return t?e(t,null):(n.clearCachedUser(),e(null,"SUCCESS"))}))},t.updateAttributes=function(e,t,n){var r=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:n},(function(e,n){return e?t(e,null):r.getUserData((function(){return t(null,"SUCCESS",n)}),{bypassCache:!0})}))},t.getUserAttributes=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,n){if(t)return e(t,null);for(var r=[],i=0;i<n.UserAttributes.length;i++){var o={Name:n.UserAttributes[i].Name,Value:n.UserAttributes[i].Value},a=new U(o);r.push(a)}return e(null,r)}))},t.getMFAOptions=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()}
2,(function(t,n){return t?e(t,null):e(null,n.MFAOptions)}))},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var t=this;return void 0===e&&(e={}),new Promise((function(n){var r=t.signInUserSession.getRefreshToken();r&&r.getToken()?t.refreshSession(r,n,e.clientMetadata):n()}))},t.getUserData=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var r=this.getUserDataFromCache();if(r)if(this.isFetchUserDataAndTokenRequired(t))this.fetchUserData().then((function(e){return n.refreshSessionIfPossible(t).then((function(){return e}))})).then((function(t){return e(null,t)})).catch(e);else try{return void e(null,JSON.parse(r))}catch(ie){return this.clearCachedUserData(),void e(ie,null)}else this.fetchUserData().then((function(t){e(null,t)})).catch(e)},t.getUserDataFromCache=function(){return this.storage.getItem(this.userDataKey)},t.isFetchUserDataAndTokenRequired=function(e){var t=(e||{}).bypassCache;return void 0!==t&&t},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then((function(t){return e.cacheUserData(t),t}))},t.deleteAttributes=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?t(e,null):n.getUserData((function(){return t(null,"SUCCESS")}),{bypassCache:!0})}))},t.resendConfirmationCode=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.client.request("ResendConfirmationCode",n,(function(t,n){return t?e(t,null):e(null,n)}))},t.getSession=function(e,t){if(void 0===t&&(t={}),null==this.username)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var n="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,r=n+".idToken",i=n+".accessToken",o=n+".refreshToken",a=n+".clockDrift";if(this.storage.getItem(r)){var s=new k({IdToken:this.storage.getItem(r)}),c=new C({AccessToken:this.storage.getItem(i)}),u=new D({RefreshToken:this.storage.getItem(o)}),l=parseInt(this.storage.getItem(a),0)||0,d=new P({IdToken:s,AccessToken:c,RefreshToken:u,ClockDrift:l});if(d.isValid())return this.signInUserSession=d,e(null,this.signInUserSession);if(!u.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(u,e,t.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,t,n){var r=this,i=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(t):t,o={};o.REFRESH_TOKEN=e.getToken();var a="CognitoIdentityServiceProvider."+this.pool.getClientId(),s=a+".LastAuthUser";if(this.storage.getItem(s)){this.username=this.storage.getItem(s);var c=a+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(c),o.DEVICE_KEY=this.deviceKey}var u={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:o,ClientMetadata:n};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",u,(function(t,n){if(t)return"NotAuthorizedException"===t.code&&r.clearCachedUser(),i(t,null);if(n){var o=n.AuthenticationResult;return Object.prototype.hasOwnProperty.call(o,"RefreshToken")||(o.RefreshToken=e.getToken()),r.signInUserSession=r.getCognitoUserSession(o),r.cacheTokens(),i(null,r.signInUserSession)}}))},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+"."+this.username+".clockDrift",o=e+".LastAuthUser";this.storage.setItem(t,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(n,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(r,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(i,""+this.signInUserSession.getClockDrift()),this.storage.setItem(o,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()}
2,t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(n,this.randomPassword),this.storage.setItem(r,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(n),this.deviceGroupKey=this.storage.getItem(r))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+".LastAuthUser",o=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r),this.storage.removeItem(i),this.storage.removeItem(o)},t.getCognitoUserSession=function(e){var t=new k(e),n=new C(e),r=new D(e);return new P({IdToken:t,AccessToken:n,RefreshToken:r})},t.forgotPassword=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.getUserContextData()&&(n.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",n,(function(t,n){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(n):e.onSuccess(n)}))},t.confirmPassword=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",i,(function(e){return e?n.onFailure(e):n.onSuccess("SUCCESS")}))},t.getAttributeVerificationCode=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},(function(e,n){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(n):t.onSuccess("SUCCESS")}))},t.verifyAttribute=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?n.onFailure(e):n.onSuccess("SUCCESS")}))},t.getDevice=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},(function(t,n){return t?e.onFailure(t):e.onSuccess(n)}))},t.forgetSpecificDevice=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},(function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")}))},t.forgetDevice=function(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(n){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(n)}})},t.setDeviceStatusRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},(function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")}))},t.setDeviceStatusNotRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},(function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")}))},t.listDevices=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));var r={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};t&&(r.PaginationToken=t),this.client.request("ListDevices",r,(function(e,t){return e?n.onFailure(e):n.onSuccess(t)}))},t.globalSignOut=function(e){var t=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(n){return n?e.onFailure(n):(t.clearCachedUser(),e.onSuccess("SUCCESS"))}))},t.signOut=function(e){var t=this;
2e&&"function"==typeof e?this.getSession((function(n,r){if(n)return e(n);t.revokeTokens((function(n){t.cleanClientData(),e(n)}))})):this.cleanClientData()},t.revokeTokens=function(e){if(void 0===e&&(e=function(){}),"function"!=typeof e)throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession)return e(new Error("User is not authenticated"));if(!this.signInUserSession.getAccessToken())return e(new Error("No Access token available"));var t=this.signInUserSession.getRefreshToken().getToken(),n=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(n)&&t)return this.revokeToken({token:t,callback:e});e()},t.isSessionRevocable=function(e){if(e&&"function"==typeof e.decodePayload)try{return!!e.decodePayload().origin_jti}catch(ie){}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var t=e.token,n=e.callback;this.client.requestWithRetry("RevokeToken",{Token:t,ClientId:this.pool.getClientId()},(function(e){if(e)return n(e);n()}))},t.sendMFASelectionAnswer=function(e,t){var n=this,r={};r.USERNAME=this.username,r.ANSWER=e;var i={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",i,(function(r,i){return r?t.onFailure(r):(n.Session=i.Session,"SMS_MFA"===e?t.mfaRequired(i.ChallengeName,i.ChallengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(i.ChallengeName,i.ChallengeParameters):void 0)}))},t.getUserContextData=function(){return this.pool.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var t=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,n){return t?e.onFailure(t):e.associateSecretCode(n.SecretCode)})):this.client.request("AssociateSoftwareToken",{Session:this.Session},(function(n,r){return n?e.onFailure(n):(t.Session=r.Session,e.associateSecretCode(r.SecretCode))}))},t.verifySoftwareToken=function(e,t,n){var r=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:t},(function(e,t){return e?n.onFailure(e):n.onSuccess(t)})):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:t},(function(e,t){if(e)return n.onFailure(e);r.Session=t.Session;var i={};i.USERNAME=r.username;var o={ChallengeName:"MFA_SETUP",ClientId:r.pool.getClientId(),ChallengeResponses:i,Session:r.Session};r.getUserContextData()&&(o.UserContextData=r.getUserContextData()),r.client.request("RespondToAuthChallenge",o,(function(e,t){return e?n.onFailure(e):(r.signInUserSession=r.getCognitoUserSession(t.AuthenticationResult),r.cacheTokens(),n.onSuccess(r.signInUserSession))}))}))},e}(),q=(n(86071),n(18025));function Y(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,z(e,t)}function K(e){var t="function"==typeof Map?new Map:void 0;return K=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return H(e,arguments,W(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),z(n,e)},K(e)}function H(e,t,n){return H=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&z(i,n.prototype),i},H.apply(null,arguments)}function z(e,t){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},z(e,t)}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},W(e)}var J=function(e){function t(t,n,r,i){var o;return(o=e.call(this,t)||this).code=n,o.name=r,o.statusCode=i,o}return Y(t,e),t}(K(Error)),Q=function(){function e(e,t,n){this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/";var r=(n||{}).credentials;this.fetchOptions=r?{credentials:r}:{}}var t=e.prototype;return t.promisifyRequest=function(e,t){var n=this;return new Promise((function(r,i){n.request(e,t,(function(e,t){e?i(new J(e.message,e.code,e.name,e.statusCode)):r(t)}))}
2))},t.requestWithRetry=function(e,t,n){var r=this;(function(e,t,n){void 0===n&&(n=ee);return X(e,t,function(e){var t=100,n=100;return function(r){var i=Math.pow(2,r)*t+n*Math.random();return!(i>e)&&i}}(n))})((function(t){return new Promise((function(n,i){r.request(e,t,(function(e,t){e?i(e):n(t)}))}))}),[t],5e3).then((function(e){return n(null,e)})).catch((function(e){return n(e)}))},t.request=function(e,t,n){var r,i={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":(0,q.fE)(),"Cache-Control":"no-store"},o=Object.assign({},this.fetchOptions,{headers:i,method:"POST",mode:"cors",body:JSON.stringify(t)});fetch(this.endpoint,o).then((function(e){return r=e,e}),(function(e){if(e instanceof TypeError)throw new Error("Network error");throw e})).then((function(e){return e.json().catch((function(){return{}}))})).then((function(e){if(r.ok)return n(null,e);e;var t=(e.__type||e.code).split("#").pop(),i=new Error(e.message||e.Message||null);return i.name=t,i.code=t,n(i)})).catch((function(e){if(r&&r.headers&&r.headers.get("x-amzn-errortype"))try{var t=r.headers.get("x-amzn-errortype").split(":")[0],i=new Error(r.status?r.status.toString():null);return i.code=t,i.name=t,i.statusCode=r.status,n(i)}catch(o){return n(e)}else e instanceof Error&&"Network error"===e.message&&(e.code="NetworkError");return n(e)}))},e}(),Z={debug:function(){}},$=function(e){return e&&e.nonRetryable};function X(e,t,n,r){if(void 0===r&&(r=1),"function"!=typeof e)throw Error("functionToRetry must be a function");return Z.debug(e.name+" attempt #"+r+" with args: "+JSON.stringify(t)),e.apply(void 0,t).catch((function(i){if(Z.debug("error on "+e.name,i),$(i))throw Z.debug(e.name+" non retryable error",i),i;var o=n(r,t,i);if(Z.debug(e.name+" retrying in "+o+" ms"),!1!==o)return new Promise((function(e){return setTimeout(e,o)})).then((function(){return X(e,t,n,r+1)}));throw i}))}var ee=3e5;var te=function(){function e(e,t){var n=e||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,a=n.fetchOptions,s=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(r.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(r))throw new Error("Invalid UserPoolId format.");var c=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new Q(c,o,a),this.advancedSecurityDataCollectionFlag=!1!==s,this.storage=e.Storage||(new B).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var a=this,s={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(s.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",s,(function(t,n){if(t)return i(t,null);var r={Username:e,Pool:a,Storage:a.storage},o={user:new G(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)}))},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new G(n)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),ne=n(12215),re=function(){function e(e){if(void 0===e&&(e={}),e.domain&&(this.domain=e.domain),e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),ne.set(e,t,n),ne.get(e)},t.getItem=function(e){return ne.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),ne.remove(e,t)},t.clear=function(){for(var e=ne.get(),t=Object.keys(e).length,n=0;n<t;++n)this.removeItem(Object.keys(e)[n]);return{}},e}()},65889:function(e,t,n){"use strict";
vendor: 4,725 bytes, line 2
2Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(72453),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i<r.BLOCK_SIZE;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<r.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(r.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],d=0;d<r.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var f=this.temp[d-2],p=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,h=((f=this.temp[d-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(h+this.temp[d-16]|0)}var v=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&c^~s&u)|0)+(l+(r.KEY[d]+this.temp[d]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;l=u,u=c,c=s,s=a+v|0,a=o,o=i,i=n,n=v+g|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=a,t[4]+=s,t[5]+=c,t[6]+=u,t[7]+=l},e}();t.RawSha256=i},72453:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},77776:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(15215).__exportStar)(n(18566),t)},18566:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(15215),i=n(72453),o=n(65889),a=n(65388),s=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(t){this.error=t}},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,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},46880:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
vendor: 6,564 bytes, line 2
2),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),a=Math.max(i,o),s=0,c=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]<c[1][a])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var s=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(n=null)&&a(t.prototype,n),r&&a(t,r),e}();t.default=s,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),o=c(n(94)),a=c(n(95)),s=c(n(17));
vendor: 3,458 bytes, line 2
2function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,o+=1):"object"==typeof a&&(n[t]=a,r+=1)})),r>0){var a=Object.keys(n),c=s.default.find(a,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var l=s.default.find(a,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(o>0){var f=Object.keys(i),p=s.default.find(f
vendor: 15,352 bytes, line 2
2,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})},5
27427:function(e,t){"use strict";t.q=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var r={},i=t||{},a=e.split(";"),s=i.decode||n,c=0;c<a.length;c++){var u=a[c],l=u.indexOf("=");if(!(l<0)){var d=u.substring(0,l).trim();if(null==r[d]){var f=u.substring(l+1,u.length).trim();'"'===f[0]&&(f=f.slice(1,-1)),r[d]=o(f,s)}}}return r},t.l=function(e,t,n){var o=n||{},a=o.encode||r;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var s=a(t);if(s&&!i.test(s))throw new TypeError("argument val is invalid");var c=e+"="+s;if(null!=o.maxAge){var u=o.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(u)}if(o.domain){if(!i.test(o.domain))throw new TypeError("option domain is invalid");c+="; Domain="+o.domain}if(o.path){if(!i.test(o.path))throw new TypeError("option path is invalid");c+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invali
2d");c+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(c+="; HttpOnly");o.secure&&(c+="; Secure");if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return c};var n=decodeURIComponent,r=encodeURIComponent,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function o(e,t){try{return t(e)}catch(n){return e}}},86071:function(e,t,n){"use strict";e.exports=n.g.fetch},53180:function(e,t,n){"use strict";var r=n(96540),i=n(74353),o=n.n(i),a=n(17096),s=n(85395),c=n(87722),u=n(57742);t.A=e=>{var t,n;let{handleDayClick:i,modifiers:l,isPrevious:d,setCalendarShow:f,setShow:p,to:h}=e;const v="undefined"!=typeof window&&window.matchMedia("only screen and (max-width: 768px)").matches,g=(0,r.useContext)(s.A),{0:m,1:y}=(0,r.useState)({from:("rate"===h||!g.startDate)&&l.availability.length>0?l.availability[0]:g.startDate,active:"start"}),b=()=>{g.setResetClick(!1),g.setShowPicker(!1)},_=new Date((new Date).setFullYear((new Date).getFullYear()+1)).setHours(0,0,0,0),E=new Date(_),w=(new Date).setHours(0,0,0,0),S=new Date(m.from),T=new Date((new Date).setFullYear((new Date).getFullYear()-1)).setHours(0,0,0,0),{active:I,from:N}=m;return r.createElement("div",null,r.createElement(c.Ay,{icon:u.x,className:"CloseIcon",size:20,onClick:()=>{p(!1),b()}}),r.createElement("div",{className:"Header"},r.createElement("div",{className:"Content"},r.createElement("p",{className:"title"},g.selectedRateCardTitle?g.selectedRateCardTitle:null!==(t=g.selectedRates)&&void 0!==t&&t.rctitle?null===(n=g.selectedRates)||void 0===n?void 0:n.rctitle:"All Trips Offered"," "),r.createElement("p",{className:"subtitle"},N?o()(N).format("MMM D,\tYYYY"):"Choose a date")),r.createElement("div",{className:"Dates"},r.createElement("div",{className:"start"===I?"Active":"Disable",onClick:()=>y({...m,active:"start"})},r.createElement("p",{className:"title1"},"Your Trip Date"),r.createElement("p",{className:"choosenDate"}," ",N?o()(N).format("MMM D,\tYYYY"):"Pick a date")))),r.createElement("div",{className:"custom"},r.createElement(a.hv,{defaultMonth:m.from?S:null,numberOfMonths:v?1:2,fromMonth:d?new Date(T):new Date(w),toMonth:d?new Date:E,modifiers:l,modifiersStyles:{unavailablity:{color:"lightgrey",cursor:"pointer",fontWeight:"bold",border:"3px solid transparent",pointerEvents:"none"},availability:{color:"black",borderRadius:"50%",fontWeight:600,cursor:"pointer",pointerEvents:"auto"},scheduleDisable:{color:"lightgrey",cursor:"pointer",fontWeight:"bold",border:"3px solid transparent",pointerEvents:"none"}},selected:o()(m.from).toDate(),onDayClick:e=>{y({...m,from:e}),h&&"bio"===h&&e&&i(o()(e).toDate(),l),null===e&&(f&&f(!1),p(!1))}}),r.createElement("div",null,r.createElement("div",{className:"btnCont"},r.createElement("p",{className:"clear",onClick:()=>{y({...m,from:null}),g.setStartDate(null),g.setResetData(!0),b()}},"Clear dates"),r.createElement("button",{className:"btn--blue--solid",onClick:()=>{(null==m?void 0:m.from)&&i(o()(m.from).toDate(),l,"s"),null===m.from&&f&&f(!1),p(!1),b()},style:{padding:"0px 20px",fontSize:"14px"}},"Save")))))}},18160:function(e,t,n){"use strict";n.d(t,{G4:function(){return o},HW:function(){return s},bJ:function(){return a},jS:function(){return r},zd:function(){return i}});const r=e=>{if(e.rate)return Number(e.rate).toFixed(2)},i=(e,t)=>{let n=parseInt(e.rcguest&&e.rcguest.split(" ")[0]),r=parseInt(t),i=r-n;const o=e.rate;return r>n?"P"===e.additional_perperson_rate_type&&i>=1?""+(e.additional_perperson_rate/100*o*i).toFixed(2):"V"===e.additional_perperson_rate_type&&i>=1?""+(e.additional_perperson_rate*i).toFixed(2):void 0:0},o=(e,t,n)=>{let o=Number(r(e))+Number(i(e,n));return t.charge_percentage?(Number(t.charge_percentage)/100*o).toFixed(2):Number(t.charge_value).toFixed(2)},a=(e,t,n,a)=>{const s=a&&"uponCash"!==a?Number(a):0;let c=0;t&&t.length>0&&t.map((t=>{c+=Number(o(e,t,n))}));let u=Number(r(e)),l=Number(i(e,n));return Number((u+l+c+s).toFixed(2))},s=(e,t,n,o,a,s)=>{var c=o;""!==c&&null!=c||(c=0);var u=0;return"P"===a?u=c/100*((e,t)=>{let n=Number(r(e)),o=Number(i(e,t));return Number((n+o).toFixed(2))})(e,n):"V"===a&&(u=c/100),Number(u.toFixed(2))}},45137:function(e,t,n){"use strict";n.d(t,{i:function(){return i}});
2var r=n(28007);const i=()=>(0,r.GR)("1161072351").allSite.edges[0].node},3395:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return kt}});var r=n(96540),i=n(41693),o=n(46217),a=n(77528),s=n(73053),c=n(87110),u=n(57039),l=n(28007),d=n(72795),f=n(45137),p=n(63189),h=n.n(p);var v=e=>{const t=(0,c.gW)(),n=(0,i.useLocation)(),o=(0,i.useParams)();(0,r.useEffect)((()=>{const n=t.find((t=>{let{node:n}=t;return n.guideid==e.id}));let r="";if(n&&(r=""+n.node.company,n.node.iscompanyduplicate&&n.node.guidename&&(r=r+"/"+n.node.guidename)),r){r=r.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g,""),r=r.replace(/ /g,"-");const e="/book-a-guide/guide-details/"+r;(0,l.oo)(e,{replace:!0})}}),[]),(0,r.useEffect)((()=>{n.pathname.includes("guide-details-2")&&(0,l.oo)("/book-a-guide/guide-details/"+o.id,{replace:!0})}),[]),(0,r.useEffect)((async()=>{var e;const t=await(async()=>{const e=await h()({method:"get",url:"/v1/redirects",headers:{"Content-Type":"application/json",key:"7961374a-62f0-46a8-b220-5b2621844bc2"}});return await e})(),n=null==t||null===(e=t.data)||void 0===e?void 0:e.filter((e=>e.source_url===window.location.pathname)),r=null==n?void 0:n.sort(((e,t)=>new Date(t.created_date)-new Date(e.created_date)));(null==r?void 0:r.length)>0&&(0,l.oo)(r[0].destination_url,{replace:!0})}),[]);const p={"@context":"https://schema.org","@type":"Organization",description:"Book your personalized fishing trip today. Our guides are vetted & trusted.",logo:"https://guidesly.com/images/Guidesly_logo.svg",url:(0,f.i)().siteMetadata.siteUrl};return r.createElement(s.A,null,r.createElement(a.A,{lang:"en",title:"Book guides",schemaMarkup:p}),r.createElement("img",{src:u.A,alt:"loading",className:d.Rhj}))},g=n(62193),m=n.n(g),y=n(95093),b=n.n(y),_=n(51761),E=n(98783),w=n(44479),S=n(61105),T=n(89090),I=n(85395),N=n(2058),A=n(40539),C=n(2589),O=(n(13272),n(20669)),k=n(18160),D="https://js.stripe.com/v3",R=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,P="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",x=null,M=function(e){return null!==x||(x=new Promise((function(t,n){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(P),window.Stripe)t(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(D,'"]')),t=0;t<e.length;t++){var n=e[t];if(R.test(n.src))return n}return null}();r&&e?console.warn(P):r||(r=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(D).concat(t);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(n),n}(e)),r.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(i){return void n(i)}else t(null)}))),x},L=Promise.resolve().then((function(){return M(null)})),U=!1;L.catch((function(e){U||console.warn(e)}));var F=n(22926),j=n(86663);var B=n(87722),V=n(10118),G=n(70720),q=n.n(G),Y=n(17800),K=n(57742),H=n(99174);var z=e=>{let{show:t,size:n,onHide:i,header:o,children:a,style1:s}=e;return r.createElement(Y.A,{show:t,size:n||"sm","aria-labelledby":"contained-modal-title-vcenter",centered:!0,onHide:i,animated:!0,contentClassName:s||null},r.createElement(Y.A.Body,{style:{padding:"10px 20px"}},r.createElement("div",null,r.createElement(B.In,{icon:K.x,onClick:i,style:{cursor:"pointer"}}),r.createElement("p",{class:H.QXQ,style:{padding:"15px 0px 0px",fontSize:"16px"}},o)),a))},W=n(60436),J=n(73246),Q=n(23524),Z=n(51015),$=n(42877),X=n.n($),ee=n(26988),te=n(53180);var ne=e=>{var t,n,i;let{options:o,showTooltip:a,setShowTooltip:s,values:c,handleRemove:u,handleFilter:l,placeholder:d,handleSelected:f,heading:p,head:h,selectedHourCard:v={},rateCardOrder:g,expandedState:m,setExpandedState:y,showRCModal:_,setShowRCModal:T,setNewRates:N,newRates:A}=e;const C=(0,r.useContext)(I.A),O=(0,r.useRef)(),{0:k,1:D}=(0,r.useState)([]),{0:R,1:P}=(0,r.useState)([]),{0:x,1:M}=(0,r.useState)({}),{0:L,1:U}=(0,r.useState)(!1),{0:F,1:j}=(0,r.useState)(!1),{0:B,1:V}=(0,r.useState)([]),{0:G,1:q}=(0,r.useState)({}),{0:Y,1:K}=(0,r.useState)([]);(0,r.useEffect)((()=>{c&&(M(c),q({ratecard:c,check:null}),N(c))}),[c]),(0,r.useEffect)((()=>{D(o)}),[o]),(0,r.useEffect)((()=>(document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)})),[]);const W=e=>{O.current.contains(e.target)||U(!1)};(0,r.useEffect)((()=>{J.availDate=Y}),[Y]);let J={unavailablity:[{before:new Date,after:new Date}
2],availability:Y,scheduleDisable:C.notAvail,today:new Date};const Q=(e,t,n)=>{"greater"===t&&(C.setCount(e.maximum),s(!0),setTimeout((()=>s(!1)),7e3)),C.setSelectedRateCardTitle(e.title),M(e),e.tripDate=n||C.startDate,f(e),U(!1)},Z=(e,t)=>{C.startDate&&""!==C.startDate||((e,t)=>{var n;const r=b()(new Date).add(null===(n=C.schrecords)||void 0===n?void 0:n.booking_acceptance_days,"days").format("YYYY/MM/DD"),i=[];for(let a of C.schrecords.schedule){let t=a.date.replace(/-/g,", "),n=b()(t,"YYYY,MM,DD").toDate();var o=b()(t,"YYYY,MM,DD").format("YYYY/MM/DD");a.available_rates.some((t=>t.guide_ratecard_id===Number(e.id)&&b()(o).isSameOrAfter(r)))&&i.push(n)}K(i),j(!0)})(e),q({ratecard:e,check:t})};(0,r.useEffect)((()=>{if(k.length>0){var e;let t=[];const n=[];t=k&&(null===(e=k.map((e=>null==e?void 0:e.guide_ratecard_id)))||void 0===e?void 0:e.filter(((e,t,n)=>n.indexOf(e)===t))),t.length>0&&t.map((e=>{var t,r;let i=null==C||null===(t=C.schrecords)||void 0===t||null===(r=t.ratecards)||void 0===r?void 0:r.filter((t=>t.id===(null==e?void 0:e.toString())));n.push(i[0])})),V(n)}}),[k]),(0,r.useEffect)((()=>{let e=[];Object.keys(v).length>0?e.push(v):Object.keys(x).length>0&&(e=X()(x.rates,"rate","asc")),P(e)}),[v,x]),(0,r.useEffect)((()=>{var e;const t=C.selectedTripType.length>0&&(null===(e=C.selectedTripType)||void 0===e?void 0:e.split(/(?=[A-Z])/).join(" "));t&&!t.includes(x.ratetype)&&M({})}),[C.selectedTripType]);const $=(e,t,n,i)=>{var o,a,s;return r.createElement("label",{key:n,className:"disable"===i?"rowContainer1":"rowContainerP"},r.createElement(w.A,null,r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,style:{padding:"0px 5px",display:"flex",position:"relative"}},r.createElement("img",{src:null!=G&&G.ratecard&&(null==G||null===(o=G.ratecard)||void 0===o?void 0:o.id)===(null==e?void 0:e.id)?"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg":"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",onClick:()=>C.count>(null==e?void 0:e.maximum)?Z(e,"greater"):Z(e),style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",cursor:"pointer"},width:"20",height:"20"}),r.createElement("input",{type:"radio",name:"selectType",onChange:()=>C.count>(null==e?void 0:e.maximum)?Z(e,"greater"):Z(e),checked:!(null==G||!G.ratecard||(null==G||null===(a=G.ratecard)||void 0===a?void 0:a.id)!==(null==e?void 0:e.id)),disabled:"disable"===i,style:{margin:"4px 5px 0px 0px",cursor:"pointer",display:"none"}}),r.createElement("span",{className:"disable"===i?"disnormal":"normal",style:{color:(null!=G&&G.ratecard&&(null==G||null===(s=G.ratecard)||void 0===s||s.id,null==e||e.id),"black"),marginTop:"-3px"}},r.createElement("span",{style:{display:"block",fontSize:"13px"}},null==e?void 0:e.title),r.createElement("span",{className:"dsctext"},null==e?void 0:e.ratetype),null!=e&&e.has_vehicle?r.createElement("span",{variant:"caption",className:"dsctext"},null==e?void 0:e.length,"' ",null==e?void 0:e.manufacturer_name," ","-"," ",(e=>{let t=1;for(const n of null==e?void 0:e.rates)n.max_occurrence>t&&(t=n.max_occurrence);return null!=e&&e.is_shared_trip?t:null==e?void 0:e.maximum})(e)," Max capacity"):null!=e&&e.is_shared_trip?null:r.createElement("span",{variant:"caption",className:"dsctext"}," Max ",null==e?void 0:e.maximum," ",(null==e?void 0:e.maximum)>1?"guests":"guest")))))};return r.createElement("div",{ref:O},r.createElement("div",{className:E.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Trip Type "),r.createElement("span",{className:E.TripDate},null!==(t=null==x?void 0:x.title)&&void 0!==t?t:"Add Trip")),r.createElement("div",null,r.createElement("span",{className:E.EditText,onClick:()=>T(!_)},"Edit"))),r.createElement(z,{show:_,onHide:()=>T(!_),size:"md",style1:E.modal,header:"Trip Type"},r.createElement(r.Fragment,null,r.createElement("div",{className:H.Bs0+" "+E.listScroll,style:{width:"100%",margin:"0px"}},B.map(((e,t)=>{var n,r,i,o;const a=null==C||null===(n=C.schrecords)||void 0===n||null===(r=n.schedule)||void 0===r?void 0:r.filter((e=>e.date===b()(C.startDate).format("YYYY-MM-DD")));a.length>0&&(null==a||null===(i=a[0])||void 0===i||null===(o=i.available_rates)||void 0===o||o.filter((t=>t.guide_ratecard_id.toString()===(null==e?void 0:e.id))));if(a.length>0&&a[0].available_rates.find((t=>t.guide_ratecard_id.toString()===(null==e?void 0:e.id))))return $(e,0,t);
2if(C.startDate&&""!=C.startDate)return $(e,0,t,"disable");null==e||e.rates;return $(e,0,t)})),0===B.length?r.createElement("p",{className:"text"},"No Records Found"):null),r.createElement("div",{className:E.displayButtons,style:{border:"0px"}},r.createElement("p",{onClick:()=>{q({ratecard:x,check:null}),T(!1)}},"Cancel"),r.createElement("button",{onClick:()=>{Q(G.ratecard,G.check),T(!1)},disabled:null==G||null===(n=G.ratecard)||void 0===n||!n.id,style:null!=G&&null!==(i=G.ratecard)&&void 0!==i&&i.id?null:{opacity:.7}},"Save")))),C.schrecords&&Object.keys(C.schrecords).length>0&&r.createElement(ee.A,{show:F,onHide:()=>j(!F),size:"lg",header:"Message",style1:"dynamicModal"},r.createElement("div",{style:{padding:"5%"},className:"datePicketModal"},r.createElement(te.A,{handleDayClick:async function(e,t,n){void 0===t&&(t={}),e.setHours(0,0,0,0),void 0===n&&C.setSelectedRates({});const r=b()(e,"ddd MMM DD YYYY h:mm:ss").format("YYYY-MM-DD");t.availability&&(await C.setStartDate(r),j(!1),Q(G.ratecard,G.check,r),T(!1)),!t.scheduleDisable&&t.unavailablity},modifiers:J,setShow:j,show:F}))))},re=n(33363),ie=n(99685);var oe=e=>{var t,n;let{searchParams:i,options:o,handleFilter:a,values:s,showTooltip:c,setShowTooltip:u,setShowMeetingModal:l,setSelectedTrip:d,placeholder:f,handleSelectedRatecard:p,handleSelectedItems:h,subtext:v,heading:g,head:m,expandedState:y,setExpandedState:_,setNewRates:T,newRates:N,showRCModal:A,setShowRCModal:C,meetingspotOptions:O}=e;const k=(0,r.useContext)(I.A),D=(0,r.useRef)(),{0:R,1:P}=(0,r.useState)([]),{0:x,1:M}=(0,r.useState)([]),{0:L,1:U}=(0,r.useState)([]),{0:F,1:j}=(0,r.useState)(null),{0:V,1:G}=(0,r.useState)(!1),{0:q,1:Y}=(0,r.useState)({}),{0:H,1:W}=(0,r.useState)({}),{0:$,1:X}=(0,r.useState)({rate:null,data:null}),{0:oe,1:ae}=(0,r.useState)(!1),{0:se,1:ce}=(0,r.useState)(!1),{0:ue,1:le}=(0,r.useState)({}),{0:de,1:fe}=(0,r.useState)([]),{0:pe,1:he}=(0,r.useState)([]),ve="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg",ge="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg";(0,r.useEffect)((()=>{if(Object.keys(k.schrecords).length>0&&k.startDate&&""!=k.startDate){var e;const o=null===(e=k.schrecords)||void 0===e?void 0:e.schedule.filter((e=>e.date===b()(k.startDate).format("YYYY-MM-DD")));if(o.length>0){var t,n;let e;var r;if(!i.tripDate&&i.ratecardID&&!i.rateID&&Object.keys(s).length)e=null==s?void 0:s.id,Y(s);else e=(null==q?void 0:q.id)||(null==ue||null===(r=ue.ratecard)||void 0===r?void 0:r.id)||"";const a=(null===(t=o[0])||void 0===t?void 0:t.available_rates.length)>0&&(null===(n=o[0])||void 0===n?void 0:n.available_rates.filter((t=>t.guide_ratecard_id.toString()===e)));if(a.length>0){const e=a.length>0&&a.filter((e=>{var t;return e.id===(H.id||(null===(t=k.selectedRates)||void 0===t?void 0:t.id))}));e.length>0?(_e(e[0],"use"),X({rate:e[0],data:k.startDate})):(W({}),X({rate:{},data:null}),ce(!0))}else M([]),Y({}),W({}),X({rate:{},data:null}),k.setSelectedRateCardTitle(null),le({}),C(!0)}}else k.resetClick||me()}),[k.startDate]),(0,r.useEffect)((()=>{k.resetData&&(me(),k.setResetData(!1))}),[k.resetData]);const me=()=>{let e={};W(e),X({rate:e,data:null}),M([]),Y(e),k.setSelectedRates({}),k.setSelectedRateCardTitle(null),k.setSelectedMeetingPoint(null),k.setMeetingPoint(null),h({},""),le({})};(0,r.useEffect)((()=>{const e=[];if(k.meetingPoint&&Object.keys(k.schrecords).length>0&&(!k.startDate||""===k.startDate)&&0===Object.keys(q).length){for(let n of k.schrecords.ratecards)for(let r of n.poi_guids){var t;if(r===(null===(t=k.meetingPoint)||void 0===t?void 0:t.poiguid))for(let t of n.rates)e.push(t)}P(e)}}),[k.meetingPoint]),(0,r.useEffect)((()=>{q&&Object.keys(q).length>0&&M(q),H&&Object.keys(H).length>0&&_e(H,"use")}),[x]),(0,r.useEffect)((()=>{(!k.startDate&&Object.keys(k.selectedRates).length&&Object.keys(H).length||k.showPicker&&Object.keys(k.selectedRates).length&&Object.keys(H).length)&&Ee(H,q)}),[k.selectedRates,H,k.showPicker]);(0,r.useEffect)((()=>{if(Object.keys(k.selectedRates).length>0){const e=k.schrecords.ratecards.filter((e=>{var t,n;return e.id===(null===(t=k.selectedRates)||void 0===t||null===(n=t.guide_ratecard_id)||void 0===n?void 0:n.toString())}));Y(e[0]),C(!1),k.selectedRates.rctime&&W(k.selectedRates)}}),[k.selectedRates]),(0,r.useEffect)((()=>{const e=k.schrecords.ratecards;if(k.startDate&&1===e.length){let t=k.schrecords.schedule.filter((e=>e.date===b()(k.startDate).format("YYYY-MM-DD")));t.length>0&&t[0].available_rates.some((t=>t.guide_ratecard_id===Number(e[0].id)))&&(Y(e[0]),p(e[0]))}else k.startDate||1!==e.length||(Y(e[0]),p(e[0]))}),[k.schrecords.ratecards]),(0,r.useEffect)((()=>{const e=null!=q&&q.is_shared_trip?null==H?void 0:H.maximum:null==q?void 0:q.maximum;q&&Object.keys(q).length>0&&k.count>e&&(Y({}),M({}),h({}),W({}))}),[k.count]),(0,r.useEffect)((()=>{j(s)}),[s]),(0,r.useEffect)((()=>(document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)})),[]);const ye=e=>{D.current.contains(e.target)||G(!1)};(0,r.useEffect)((()=>{k.selectedRateCard&&be(k.selectedRateCard)}),[k.selectedRateCard]);const be=async e=>{var t,n;Y(e),d(e),h(e,null,"rc"),W({}),null!=e&&null!==(t=e.poi_guids)&&void 0!==t&&t.includes(null===(n=k.selectedMeetingPoint)||void 0===n?void 0:n.poiguid)||(k.setSelectedMeetingPoint(null),k.setMeetingPoint(null)),ce(!0)};(0,r.useEffect)((()=>{T(q)}),[q]);const _e=(e,t)=>
2{let n=k.schrecords.schedule.filter((e=>e.date===b()(k.startDate).format("YYYY-MM-DD")));var r,i,o=e;n.length>0&&(o.additional_perperson_rate_type=null==q?void 0:q.additional_perperson_rate_type,o.additional_perperson_rate=null==q?void 0:q.additional_perperson_rate,o.rctitle=null==q?void 0:q.title,o.coverpicture=null==q?void 0:q.coverpicture,o.rctime=(0,J.cR)(o)+" @ "+(0,J.rd)(o.start_time),o.rctriptype=null==q?void 0:q.ratetype,o.rcmanufacturer_name=null==q?void 0:q.manufacturer_name,o.rcguest=(null==q?void 0:q.guests)+" person capacity",o.is_shared_trip=null==q?void 0:q.is_shared_trip,o.custom_deposit_percentage=null!=q&&q.custom_deposit_percentage?(null==q?void 0:q.custom_deposit_percentage)/100:.15,o.maximum=null!=q&&q.is_shared_trip?(r=e,null===(i=n[0].available_rates.find((e=>e.id===r.id)))||void 0===i?void 0:i.maximum):null==q?void 0:q.maximum,o.activity_type=null==q?void 0:q.activity_type,o.guests=null==q?void 0:q.guests,X({rate:e,data:o}),t&&"use"===t&&(W(e),k.setSelectedRates(e),h(o,(null==q?void 0:q.tripDate)||(null==k?void 0:k.startDate)),!se&&Ae()),""!==k.startDate&&k.startDate||(W(e),k.setSelectedRates(e),h(o,(null==q?void 0:q.tripDate)||(null==k?void 0:k.startDate))),G(!1))},Ee=(e,t,n)=>{k.setSelectedRateCardTitle(t.title),(0,ie.b)({rates:e,ratecard:t,check:n,setAvailDate:fe,setDateModal:ae,setSelectedData:le,context:k})};(0,r.useEffect)((()=>{Se.availDate=de}),[de]);const we=(e,t,n,r)=>{"greater"===n&&(k.setCount(t.maximum),u(!0),setTimeout((()=>u(!1)),7e3));var i=e;i.additional_perperson_rate_type=t.additional_perperson_rate_type,i.additional_perperson_rate=t.additional_perperson_rate,i.rctitle=t.title,i.coverpicture=null==t?void 0:t.coverpicture,i.rctime=(0,J.cR)(e)+" @ "+(0,J.rd)(e.start_time),i.rctriptype=t.ratetype,i.activity_type=null==t?void 0:t.activity_type,i.rcmanufacturer_name=t.manufacturer_name,i.is_shared_trip=null==t?void 0:t.is_shared_trip,i.custom_deposit_percentage=null!=t&&t.custom_deposit_percentage?(null==t?void 0:t.custom_deposit_percentage)/100:.15,i.rcguest=t.guests+" person capacity",i.maximum=null!=t&&t.is_shared_trip?null==e?void 0:e.maximum:null==t?void 0:t.maximum,i.guests=t.guests,X({rate:e,data:r}),W(e),d(e),h(i,r),Y(t),G(!1)};let Se={unavailablity:[{before:new Date,after:new Date}],availability:de,scheduleDisable:k.notAvail};(0,r.useEffect)((()=>{var e=JSON.parse(JSON.stringify(o));if(k.triplength.length>0){var t=[];for(var n of k.triplength)"others"===n?o.map((e=>{["2","4","6","8","10","12"].includes(e.duration_hours.toString())||t.push(e)})):o.map((e=>{n===e.duration_hours.toString()&&t.push(e)}));e=t}if(k.filtersearchselectedTime.length>0){t=[];for(var r of k.filtersearchselectedTime)"Morning"===r?e.map((e=>{e.start_time<"10:00:00"&&t.push(e)})):"Afternoon"===r?e.map((e=>{e.start_time<"15:00:00"&&e.start_time>"10:00:00"&&t.push(e)})):e.map((e=>{e.start_time>"15:00:00"&&t.push(e)}));e=t}if(k.selectedTripType.length>0){t=[];const n=k.schrecords.ratecards.filter((e=>e.ratetype===k.selectedTripType));n.map((n=>{e.map((e=>{parseInt(n.id)===e.guide_ratecard_id&&t.push(e)}))})),e=t}P(e)}),[k.triplength,k.filtersearchselectedTime,k.selectedTripType,o]),(0,r.useEffect)((()=>{var e,t;q&&1==(null==q||null===(e=q.rates)||void 0===e?void 0:e.length)&&W(null==q||null===(t=q.rates)||void 0===t?void 0:t[0])}),[q]),(0,r.useEffect)((()=>{if(q&&Object.keys(q).length>0){const e=k.schrecords.schedule.length>0&&k.schrecords.ratecards.filter((e=>e.id===q.id)),t=R.filter((e=>e.guide_ratecard_id.toString()===q.id));if(M(e[0]),t.length>0){const e=t.sort((0,re.firstBy)((function(e,t){return e.duration_hours-t.duration_hours})).thenBy((function(e,t){return new Date("1970/01/01 "+(0,J.rd)(e.start_time))-new Date("1970/01/01 "+(0,J.rd)(t.start_time))})));U(e)}}}),[q]);const Te=e=>r.createElement(Q.A,Object.assign({id:"button-tooltip"},e),"Your group size is larger than the max guests capacity. You can still select this option, but your group size will lower.");(0,r.useEffect)((()=>{if(R.length>0){let e=[];const t=[];e=null==R?void 0:R.map((e=>null==e?void 0:e.guide_ratecard_id)).filter(((e,t,n)=>n.indexOf(e)===t)),e.length>0&&e.map((e=>{let n=k.schrecords.ratecards.filter((t=>
2t.id===(null==e?void 0:e.toString())));t.push(n[0])})),he(t)}}),[R]);const Ie=(e,t)=>r.createElement(r.Fragment,null,r.createElement("input",{type:"radio",name:"selectType1",checked:H.id===e.id,id:t,style:{margin:"4px 5px 0px 0px",cursor:"pointer",display:"none"}}),r.createElement("label",{for:t,style:{color:"unset",cursor:"pointer",width:"100%"}},((e,t,n)=>{var i;return null===(i=k.schrecords.ratecards.filter((t=>t.id===e.guide_ratecard_id.toString()))[0])||void 0===i||i.guests,r.createElement(w.A,null,r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,style:{padding:"0px 5px",textAlign:"left",margin:n?"auto":"0px",marginTop:"-3px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement("span",{style:{fontWeight:500,color:"black"}},(0,J.rd)(e.start_time)," ","(",(0,J.cR)(e)," trip) - $",(0,J.BZ)(e.rate)))))})(e))),Ne=(e,t,n,i,o)=>r.createElement("div",{style:{margin:"5px",padding:"0px"},key:n,className:"personalRates"},r.createElement("div",{style:{display:"flex",position:"relative",marginBottom:"5px",marginLeft:"5px"}},r.createElement("span",{style:{fontWeight:"600",fontSize:"13px",width:"90%"}},null==e?void 0:e.title),k.count>(null==e?void 0:e.maximum)&&r.createElement(Z.A,{placement:"top",delay:{show:250,hide:400},overlay:Te},r.createElement(B.In,{icon:K.pqE,className:"alert",size:23}))),r.createElement(w.A,null,(null==t?void 0:t.length)>0&&t.map(((t,n)=>{var a,s,c,u,l;return k.startDate&&""!==k.startDate?i.length>0&&i[0].available_rates.find((e=>e.id===t.id&&e.guide_ratecard_id===t.guide_ratecard_id))?r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,className:"personalRates1"},r.createElement("div",{key:n,className:(null==$||null===(c=$.rate)||void 0===c?void 0:c.id)===t.id?"selectedRate":(e.maximum,"unselectedRate"),style:{display:"flex",border:"none"},onClick:n=>{n.preventDefault(),k.count>e.maximum?we(t,e,"greater"):we(t,e)}},r.createElement("img",{src:(null==$||null===(u=$.rate)||void 0===u?void 0:u.id)===t.id?ve:ge,onClick:n=>{n.preventDefault(),k.count>e.maximum?we(t,e,"greater"):we(t,e)},style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",cursor:"pointer"},width:"20",height:"20"}),Ie(t,n))):"disable"===o?r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,className:"personalRates1"},r.createElement("div",{key:n,className:"DisableRate",style:{display:"flex"},onClick:n=>{n.preventDefault(),k.count>e.maximum?we(t,e,"greater"):we(t,e)}},r.createElement("img",{src:(null==$||null===(l=$.rate)||void 0===l?void 0:l.id)===t.id?ve:ge,onClick:n=>{n.preventDefault(),k.count>e.maximum?we(t,e,"greater"):we(t,e)},style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",cursor:"pointer"},width:"20",height:"20"}),Ie(t,n))):void 0:r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,className:"personalRates1"},r.createElement("div",{key:n,className:(null==$||null===(a=$.rate)||void 0===a?void 0:a.id)===t.id?"selectedRate":(e.maximum,"unselectedRate"),style:{display:"flex",border:"none"},onClick:n=>{n.preventDefault(),k.count>e.maximum?Ee(t,e,"greater"):Ee(t,e)}},r.createElement("img",{src:(null==$||null===(s=$.rate)||void 0===s?void 0:s.id)===t.id?ve:ge,onClick:n=>{n.preventDefault(),k.count>e.maximum?Ee(t,e,"greater"):Ee(t,e)},style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",cursor:"pointer"},width:"20",height:"20"}),Ie(t,n)))})))),Ae=()=>{var e,t,n;if(q&&Object.keys(q).length>0&&(null==q||null===(e=q.poi_guids)||void 0===e||!e.includes(null===(t=k.selectedMeetingPoint)||void 0===t?void 0:t.poiguid))||!k.setSelectedMeetingPoint)if(1===(null==q||null===(n=q.poi_guids)||void 0===n?void 0:n.length)){var r,i;const e=null===(r=k.schrecords)||void 0===r||null===(i=r.poi)||void 0===i?void 0:i.filter((e=>e.poiguid===(null==q?void 0:q.poi_guids[0])));e.length>0&&(k.setSelectedMeetingPoint(e[0]),k.setMeetingPoint(e[0]))}else k.setSelectedMeetingPoint(O[0]),k.setMeetingPoint(O[0])};return r.createElement("div",{className:"RateCard"},r.createElement(ne,{options:R,values:x,placeholder:(null==x?void 0:x.length)>0?"Change Trip":"Choose a Trip",heading:"Trips Available",head:!0,handleFilter:a,handleSelected:be,selectedHourCard:H,handleRemove:e=>{"remove"===e?(h({}),W({})):(Y({}),M([]),h({}),W({}),d({})),k.setSelectedRateCardTitle(null)},setShowTooltip:u,showTooltip:c,expandedState:y,showRCModal:A,setShowRCModal:C,newRates:N,setNewRates:T}),r.createElement("div",{ref:D},r.createElement("div",{className:E.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Start Time & Length "),r.createElement("span",{className:E.TripDate},null!=H&&H.title?r.createElement("span",null,(0,J.rd)(null==H?void 0:H.start_time)," ","(",(0,J.cR)(H)," trip) "," ","-"," ","$",(0,J.BZ)(null==H?void 0:H.rate)):"Add Trip Time")),r.createElement("div",null,r.createElement("span",{className:E.EditText,onClick:()=>ce(!se)},"Edit"))),r.createElement(z,{show:se,onHide:()=>ce(!se),size:"md",style1:E.modal,header:"Start Time & Length"},r.createElement(r.Fragment,null,r.createElement("div",{style:{maxHeight:"310px",overflowY:"auto"},className:E.listScroll},r.createElement("div",null,q&&Object.keys(q).length>0?r.createElement(r.Fragment,null,k.startDate&&r.createElement(w.A,null,L.map(((e,t)=>{const n=k.schrecords.schedule.filter((e=>e.date===b()(k.startDate).format("YYYY-MM-DD")));var i,o;if(n.length>0&&n[0].available_rates.find((t=>t.guide_ratecard_id===e.guide_ratecard_id&&t.id===e.id)))return r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,className:"borderlineItem",style:{padding:"10px 0px"}},r.createElement("div",{key:t,className:(null==$||null===(i=$.rate)||void 0===i?void 0:i.id)===e.id?"selectedRate":"unselectedRate",style:{display:"flex",borderBottom:"0px"},onClick:()=>_e(e)},r.createElement("img",{src:(null==$||null===(o=$.rate)||void 0===o?void 0:o.id)===e.id?ve:ge,onClick:()=>_e(e),style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",curs
2or:"pointer"},width:"20",height:"20"}),Ie(e,t)))})),0===L.length?r.createElement("p",{className:"norc"},"No Trips Available"):null),!k.startDate&&r.createElement(w.A,null,Object.keys(q).length>0&&q.rates.map(((e,t)=>{var n,i;return r.createElement(S.A,{xs:12,sm:12,md:12,lg:12,className:"borderlineItem",style:{padding:"0px"}},r.createElement("div",{key:t,className:(null==$||null===(n=$.rate)||void 0===n?void 0:n.id)===e.id?"selectedRate":"unselectedRate",style:{display:"flex",border:"none"},onClick:()=>{var t,n;t=q,_e(n=e),k.count>t.maximum?Ee(n,t,"greater"):Ee(n,t)}},r.createElement("img",{src:(null==$||null===(i=$.rate)||void 0===i?void 0:i.id)===e.id?ve:ge,style:{padding:0,borderRadius:0,margin:0,marginRight:10,height:20,width:20,border:"1px solid #d4d4d4",cursor:"pointer"},width:"20",height:"20"}),Ie(e,t)))})))):r.createElement(r.Fragment,null,pe.length>0&&pe.map(((e,t)=>{const n=null==e?void 0:e.rates,r=k.schrecords.schedule.filter((e=>e.date===b()(k.startDate).format("YYYY-MM-DD")));if(r.length>0&&r[0].available_rates.find((t=>t.guide_ratecard_id.toString()===e.id)))return Ne(e,n,t,r);if(k.startDate&&""!=k.startDate)return Ne(e,n,t,r,"disable");{const n=null==e?void 0:e.rates;return Ne(e,n,t,r)}})),0===pe.length?r.createElement("p",{className:"text"},"No Ratecards Available"):null))),r.createElement("div",{className:E.displayButtons,style:{border:"0px"}},r.createElement("p",{onClick:()=>{ce(!1)}},"Cancel"),r.createElement("button",{onClick:()=>{W(null==$?void 0:$.rate),d(null==$?void 0:$.rate),h(null==$?void 0:$.rate,null==q?void 0:q.tripDate),ce(!1),Ae()},disabled:null==$||null===(t=$.rate)||void 0===t||!t.id,style:null!=$&&null!==(n=$.rate)&&void 0!==n&&n.id?null:{opacity:.7}},"Save")))),k.schrecords&&Object.keys(k.schrecords).length>0&&r.createElement(ee.A,{show:oe,onHide:()=>{ae(!oe),k.setResetClick(!1),k.setShowPicker(!1)},size:"lg",header:"Message",style1:"dynamicModal"},r.createElement("div",{style:{padding:"5%"}},r.createElement(te.A,{handleDayClick:function(e,t,n){void 0===t&&(t={}),e.setHours(0,0,0,0),void 0===n&&k.setSelectedRates({});const r=b()(e,"ddd MMM DD YYYY h:mm:ss").format("YYYY-MM-DD");t.availability&&(k.setStartDate(r),ae(!1),we(ue.rates,ue.ratecard,ue.check,r),ce(!1)),!t.scheduleDisable&&t.unavailablity},modifiers:Se,setShow:ae,show:oe})))))},ae=n(70485),se=n(54346);var ce=e=>{var t,n;let{handleInfo:i,setPolicy:o,bookingDetails:a,searchParams:s,activateBtn:c,setGuestError:u,handleGuestDecrement:l,handleGuestIncrement:d,handleShowInput:f,setQueryObj:p,queryObj:v,expandedState:g,setExpandedState:m,setNewRates:y,newRates:_}=e;const{0:w,1:S}=(0,r.useState)(!1),T=(0,r.useContext)(I.A),N=(0,r.useRef)(),{0:A,1:C}=(0,r.useState)([]),{0:O,1:k}=(0,r.useState)([]),{0:D,1:R}=(0,r.useState)({}),{0:P,1:x}=(0,r.useState)([]),{0:M,1:L}=(0,r.useState)(T.startDate),{0:U,1:F}=(0,r.useState)([]),{0:j,1:G}=(0,r.useState)([]),{0:q,1:Y}=(0,r.useState)(""),{0:K,1:H}=(0,r.useState)((0,J.$I)()),{0:Q,1:Z}=(0,r.useState)((0,J.I0)()),{0:$,1:X}=(0,r.useState)({}),{0:ne,1:re}=(0,r.useState)(!1),{0:ie,1:ce}=(0,r.useState)(!1),{0:ue,1:le}=(0,r.useState)(!1),{0:de,1:fe}=(0,r.useState)(!1),{0:pe,1:he}=(0,r.useState)(T.count?Number(T.count):0),{0:ve,1:ge}=(0,r.useState)(0),{0:me,1:ye}=(0,r.useState)(!1),{0:be,1:_e}=(0,r.useState)(!1),{0:Ee}=(0,r.useState)("undefined"!=typeof window&&window.innerWidth<=568),we={Adults:{count:pe,setCount:he,min:0},Children:{count:ve,setCount:ge,min:0}},Se="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg",Te="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg";(0,r.useEffect)((()=>{he(Number(T.count)||0),ge(0)}),[T.count]),(0,r.useEffect)((()=>{Object.keys(T.schrecords).length>0&&T.schrecords.guide_addon_fees.length>0&&C(T.schrecords.guide_addon_fees)}),[T.selectedRates]),(0,r.useEffect)((()=>{h().get("/v1/master_data?type=TRIPTYPE").then((e=>{k(e.data)})).catch((e=>console.log(e)))}),[]),(0,r.useEffect)((()=>{let e=[];
2if(s&&s.rateID&&T.schrecords.schedule){e=T.schrecords.schedule.filter((e=>e.date===s.tripDate));const t=e&&e.length>0&&e[0].data;t&&t!=T.startDate&&Ce({})}let t=[],n=[],r=[];if(T.schrecords.ratecards){if(T.startDate)for(var i of T.schrecords.ratecards){const e=T.schrecords.schedule.filter((e=>e.date===b()(T.startDate).format("YYYY-MM-DD")));if(e&&e.length>0&&e[0].available_rates.length>0){if(e.length>0&&e[0].available_rates.find((e=>e.guide_ratecard_id.toString()===i.id)))for(var o of i.rates)t.push(o),n.push(i)}else for(var o of i.rates)t.push(o),n.push(i)}else for(var i of T.schrecords.ratecards)for(var o of i.rates)t.push(o),n.push(i);if(null!=n&&n.length&&(!_||0===_.length)){for(let t of n)for(let e of null==t?void 0:t.poi_guids){var a;const t=null===(a=T.schrecords)||void 0===a?void 0:a.poi.filter((t=>(null==t?void 0:t.poiguid)===e));(null==t?void 0:t.length)>0&&r.push(t[0])}const e=(0,W.A)(new Set(r));e.sort(((e,t)=>e.poi_order-t.poi_order)),x(e)}}F(t),G((0,W.A)(new Set(n)))}),[T.schrecords,T.startDate]),(0,r.useEffect)((()=>{L(T.startDate)}),[T.startDate]),(0,r.useEffect)((()=>{var e,t,n,r;if(0===T.count)T.setCount(1);else if(T.schrecords&&T.schrecords.schedule&&T.schrecords.schedule.length>0)for(let a=0;a<T.schrecords.schedule.length;a++){var i=T.schrecords.schedule[a];if(i.available_rates&&i.available_rates.length>=0&&i.date===b()(M).format("YYYY-MM-DD")){if(!s||""===s){var o=new Date(b()(i.date).year(),b()(i.date).month(),b()(i.date).date());Oe(o,Ie,"s")}break}}if(s&&T.loadcount<=1&&void 0!==s.tripDate){T.setStartDate(b()(s.tripDate).format("YYYY-MM-DD")),L(b()(s.tripDate).format("YYYY-MM-DD"));o=new Date(b()(s.tripDate).year(),b()(s.tripDate).month(),b()(s.tripDate).date());Oe(o,Ie,"s",!0)}(null===(e=T.schrecords)||void 0===e||null===(t=e.poi)||void 0===t?void 0:t.length)>0&&(x(null===(n=T.schrecords)||void 0===n?void 0:n.poi),Ne(null===(r=T.schrecords)||void 0===r?void 0:r.poi))}),[T.schrecords]);const Ie={unavailablity:[{before:new Date,after:new Date}],scheduleDisable:T.notAvail,availability:T.schedule,today:new Date};(0,r.useEffect)((()=>{var e;if(_&&(null===(e=Object.keys(_))||void 0===e?void 0:e.length)>0){var t,n;const e=null===(t=T.schrecords)||void 0===t||null===(n=t.poi)||void 0===n?void 0:n.filter((e=>{var t;return null==_||null===(t=_.poi_guids)||void 0===t?void 0:t.includes(e.poiguid)}));x(e),Ne(e)}else{var r,i;const e=[];if((null===(r=T.schrecords)||void 0===r||null===(i=r.ratecards)||void 0===i?void 0:i.length)>0)for(let n of null===(o=T.schrecords)||void 0===o?void 0:o.ratecards){var o;for(let t of n.poi_guids){var a,s;const n=null===(a=T.schrecords)||void 0===a||null===(s=a.poi)||void 0===s?void 0:s.filter((e=>e.poiguid===t));n.length>0&&e.push(n[0])}}const t=(0,W.A)(new Set(e));t.sort(((e,t)=>e.poi_order-t.poi_order)),x(t)}}),[_]);const Ne=e=>{T.setSelectedMeetingPoint(e[0]),T.setMeetingPoint(e[0])},Ae=e=>{var t,n,r;const i=T.schrecords&&(null===(t=T.schrecords)||void 0===t?void 0:t.schedule)&&(null===(n=T.schrecords)||void 0===n?void 0:n.schedule.find((e=>b()(e.date).format("YYYY-MM-DD")===b()(T.startDate).format("YYYY-MM-DD"))));return(null==i?void 0:i.available_rates)&&(null==i||null===(r=i.available_rates.find((t=>t.id===(null==e?void 0:e.id))))||void 0===r?void 0:r.maximum)};(0,r.useEffect)((()=>{if(s&&Object.keys(T.schrecords).length>0){let p,h;var e;if(null!=s&&s.ratecardID)p=null==s||null===(e=s.ratecardID)||void 0===e?void 0:e.toString(),h=T.schrecords.ratecards.filter((e=>e.id===p)),R(h[0]);if(null!=s&&s.rateID){var t;const e=h&&h.length>0&&(null===(t=h[0])||void 0===t?void 0:t.rates.filter((e=>e.id===Number(null==s?void 0:s.rateID))));if(e.length>0){var n,r,i,o,a,c,u;X(e[0]);var l=e[0];l.additional_perperson_rate_type=h[0].additional_perperson_rate_type,l.additional_perperson_rate=h[0].additional_perperson_rate,l.rctitle=h[0].title,l.coverpicture=null===(n=h[0])||void 0===n?void 0:n.coverpicture,l.rctime=(0,J.lU)(e[0])+" @ "+ke(e[0].start_time),l.rctriptype=h[0].ratetype,l.rcmanufacturer_name=h[0].manufacturer_name,l.is_shared_trip=null===(r=h[0])||void 0===r?void 0:r.is_shared_trip,l.custom_deposit_percentage=null!==(i=h[0])&&void 0!==i&&i.custom_deposit_percentage?h[0].custom_deposit_percentage/100:.15,l.activity_type=null===(o=h[0])||void 0===o?void 0:o.activity_type,l.rcguest=(null===(a=h[0])||void 0===a?void 0:a.guests)+" person capacity",l.maximum=null!==(c=h[0])&&void 0!==c&&c.is_shared_trip?Ae(e[0]):h[0].maximum,l.guests=null===(u=h[0])||void 0===u?void 0:u.guests,T.setSelectedRates(l)}}if(!s.tripDate&&s.ratecardID&&!s.rateID){var d;const e=b()(new Date).add(null===(d=T.schrecords)||void 0===d?void 0:d.booking_acceptance_days,"days").format("YYYY/MM/DD");e:for(let t of T.schrecords.schedule){const n=t.available_rates.length>0;var f=b()(t.date,"YYYY,MM,DD").format("YYYY/MM/DD");if(n&&b()(f).isSameOrAfter(e))for(let e of t.available_rates)if(e.guide_ratecard_id==(null==s?void 0:s.ratecardID)){T.setStartDate(t.date),L(t.date);break e}}}}}
2),[T.schrecords]),(0,r.useEffect)((()=>{if(Y(T.selectedTripType),T.filtersearchselectedTime){for(var e of K)for(var t of T.filtersearchselectedTime)e.value===t&&(e.checked=!0);H((0,W.A)(K))}if(T.triplength){for(var e of Q)for(var t of T.triplength)e.value===t&&(e.checked=!0);Z((0,W.A)(Q))}}),[T.selectedTripType,T.triplength,T.filtersearchselectedTime]);const Ce=(e,t,n)=>{var r;if(t)R(e),p({...v,tripDate:b()(t).format("YYYY-MM-DD"),ratecardID:null==e?void 0:e.guide_ratecard_id,rateID:null==e?void 0:e.id,meetingPoint:null===(r=T.selectedMeetingPoint)||void 0===r?void 0:r.poiguid}),T.setSelectedRates(e);else if("rc"===n){var i;R(e),X(e),p({...v,ratecardID:null==e?void 0:e.id,meetingPoint:null===(i=T.selectedMeetingPoint)||void 0===i?void 0:i.poiguid})}else{var o;R(e),X(e),p({...v,tripDate:t,ratecardID:null==e?void 0:e.guide_ratecard_id,rateID:null==e?void 0:e.id,meetingPoint:null===(o=T.selectedMeetingPoint)||void 0===o?void 0:o.poiguid}),T.setSelectedRates(e)}},Oe=function(e,t,n,r){void 0===t&&(t={}),e.setHours(0,0,0,0),void 0===n&&(R({}),T.setSelectedRates({}));const i=b()(e,"ddd MMM DD YYYY h:mm:ss").format("YYYY-MM-DD");t.availability&&(T.setStartDate(i),L(e),S(!1)),!t.scheduleDisable&&t.unavailablity},ke=(new Date(T.startDate),new Date(T.endDate),e=>{if(e)return b()(e,["HH:mm:ss"]).format("h:mm A")}),De=(e,t)=>{const n=null!=$&&$.is_shared_trip?Ae($)||Ae(D):D&&D.maximum;return u(!1),T.count>n&&u(!0),r.createElement("div",{key:e,className:se.tI,style:{padding:"10px 0px",borderBottom:"none"}},r.createElement("div",{className:se.XT},r.createElement("div",{style:{fontSize:"14px",fontWeight:"normal"}},e),r.createElement("div",{style:{fontSize:"12px",fontWeight:"normal"}},t)),r.createElement("div",{className:se.OF},r.createElement("button",{type:"button",id:"group-size-decrement",className:se.ZE,disabled:pe+ve===1,onClick:()=>we[e].count>we[e].min&&we[e].setCount(Number(we[e].count)-1)},r.createElement(B.In,{icon:V.Rdt})),r.createElement("span",{className:se.form__guest__count},we[e].count),r.createElement("button",{type:"button",id:"group-size-increment",disabled:n<=pe+ve,className:se.ZE,onClick:()=>we[e].setCount(Number(we[e].count)+1)},r.createElement(B.In,{icon:V.tY4}))))},Re=e=>{const t=e;var n=T.selectedGuide.meeting_points.filter((e=>{if(e.poiguid==t)return e}));T.setSelectedMeetingPoint(n[0])},Pe=null!=$&&$.is_shared_trip?Ae($)||Ae(D):(null==$?void 0:$.maximum)||(null==D?void 0:D.maximum);return r.createElement(r.Fragment,null,r.createElement("div",{ref:N},r.createElement("div",{className:E.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Date "),r.createElement("span",{className:E.TripDate},T.startDate?b()(T.startDate).format("MMM D, YYYY"):"Choose Trip Date")),r.createElement("div",null,r.createElement("span",{className:E.EditText,onClick:e=>{re(!ne);const t=(e.target.attributes["aria-label"]||{}).value||"";"Next Month"!==t&&"Previous Month"!==t&&S(!w),T.startDate||T.setSelectedRateCardTitle(null)}},"Edit"))),r.createElement("div",{className:E.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Guests "),r.createElement("span",{className:E.TripDate},T.count>1?T.count+" guests":T.count+" guest")),r.createElement("div",null,r.createElement("span",{className:E.EditText,onClick:()=>fe(!de)},"Edit"))),T.showCountError?r.createElement("span",{className:ae.aJv,style:{display:"block"}},"Please select number of guests*"):null),r.createElement(ee.A,{show:ne,onHide:()=>re(!ne),size:"xl",header:"Message",style1:"dynamicModal"},r.createElement("div",{style:{padding:"5%"}},r.createElement(te.A,{handleDayClick:Oe,modifiers:Ie,setCalendarShow:S,show:ne,setShow:re}))),r.createElement(z,{show:de,onHide:()=>fe(!de),size:"md",style1:E.modal,header:"Guests"},r.createElement(r.Fragment,null,r.createElement("p",{style:{fontSize:"12px"}},"This trip has a maximum of ",Pe," total ",1===Pe?"guest":"guests"," allowed."),r.createElement("div",null,De("Adults","Ages 13 or above"),De("Children","Ages 2-12")),r.createElement("div",{className:E.displayButtons},r.createElement("p",{onClick:()=>fe(!de)},"Cancel"),r.createElement("button",{onClick:()=>{pe+ve>0&&T.setCount(pe+ve),fe(!de)}}
2,"Save")))),(()=>{const e=Object.keys(T.schrecords).length>0&&T.schrecords.schedule.filter((e=>e.date===b()(T.startDate).format("YYYY-MM-DD")));return e.length>0&&0===e[0].available_rates.length?r.createElement("p",{className:ae.aJv,style:{marginTop:"5px",textAlign:"center"}},"Trips unavailable for your selected date. "):null})(),r.createElement("div",{className:ae.nJH,style:{padding:"0px",marginTop:0}},r.createElement("div",{style:{width:"100%",position:"relative"}},U.length>0?r.createElement(oe,{options:U,expandedState:g,subtext:!1,values:D,heading:"Available Trips",head:!0,showTooltip:ie,setShowTooltip:ce,setSelectedTrip:X,handleFilter:()=>{le(!ue)},placeholder:D&&0!==Object.keys(D).length?D.title+" @ "+ke(D.start_time)+" - $ "+D.rate:"All Trips Availabilities",handleSelectedItems:Ce,handleSelectedRatecard:e=>{R(e)},newRates:_,setNewRates:y,searchParams:s,setShowMeetingModal:ye,showRCModal:be,setShowRCModal:_e,meetingspotOptions:P}):r.createElement("p",{className:ae.LDO}," No Ratecards Available"))),r.createElement("div",{className:E.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Meeting Location"),r.createElement("span",{className:E.TripDate},null!==(t=T.meetingPoint)&&void 0!==t&&t.description?null===(n=T.meetingPoint)||void 0===n?void 0:n.description:"Add Meeting Location")),r.createElement("div",null,r.createElement("span",{className:E.EditText,onClick:()=>{ye(!me)}},"Edit"))),r.createElement(z,{show:me,onHide:()=>ye(!me),size:"md",style1:E.modal,header:"Meeting Location"},r.createElement(r.Fragment,null,r.createElement("div",{style:{maxHeight:"310px",overflowY:"auto",paddingBottom:"15px"},className:E.listScroll},P.map(((e,t)=>{var n;return r.createElement("div",{key:t,style:{display:"flex",paddingTop:5,paddingBottom:5}},r.createElement("img",{src:e.poiguid===(null===(n=T.selectedMeetingPoint)||void 0===n?void 0:n.poiguid)?Se:Te,onClick:()=>Re(e.poiguid),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("p",{onClick:()=>Re(e.poiguid),style:{fontSize:"14px",cursor:"pointer",margin:"-3px 0px 0px",width:"calc(100% - 30px)"}},e.description))}))),r.createElement("div",{className:E.displayButtons,style:{borderColor:"#42642f"}},r.createElement("p",{onClick:()=>{ye(!me)}},"Cancel"),r.createElement("button",{onClick:()=>(()=>{var e;if(T.selectedMeetingPoint&&T.setMeetingPoint(T.selectedMeetingPoint),p({...v,meetingPoint:null===(e=T.selectedMeetingPoint)||void 0===e?void 0:e.poiguid}),ye(!me),j.length&&D&&0===Object.keys(D).length){const e=[],n=[];for(let r of j){var t;if(null!==(t=r.poi_guids)&&void 0!==t&&t.includes(T.selectedMeetingPoint.poiguid)){n.push(r);for(let t of r.rates)e.push(t)}}F(e),G(n),_e(!0)}})()},"Save")))),r.createElement("div",{style:{padding:"10px 25px"}},r.createElement("img",{src:T.checkbox2?Se:Te,onClick:e=>((e,t)=>{const n=e.target.checked;n?T.setCheckbox2(n):T.setCheckbox2("")})({target:{checked:!T.checkbox2}}),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("label",{htmlFor:"cb2",className:E.checkboxLabel},"Need guide equipment")))};var ue=e=>{var t,n,i,o,a,s,c,u,l,d,f,p,h,v,g;let{Styles:m,context:y,newRates:b,setNewRates:_,queryObj:E,setQueryObj:w,searchParams:S,isMobile:I,setGuestError:N}=e;return r.createElement(r.Fragment,null,r.createElement("p",null,r.createElement("strong",null,"Your Trip Details")),I&&r.createElement("div",{className:m.tripDataMobile},r.createElement("div",{className:m.tripImages},Boolean(b&&(null==b?void 0:b.title))?b.title&&(null==b?void 0:b.coverpicture)&&""!==(null==b?void 0:b.coverpicture)&&r.createElement("div",null,r.createElement("img",{src:G.GUIDESLY_GUIDEPIC_IP+"/"+(0,T.kb)(null==b?void 0:b.coverpicture),alt:null!==(t=b.title)&&void 0!==t?t:null===(n=y.selectedGuide)||void 0===n?void 0:n.company,width:"100%",height:"100%",loading:"lazy"})):(null===(i=y.selectedRates)||void 0===i?void 0:i.rctitle)&&(null===(o=y.selectedRates)||void 0===o?void 0:o.coverpicture)&&""!==(null===(a=y.selectedRates)||void 0===a?void 0:a.coverpicture)&&r.createElement("div",null,r.createElement("img",{src:G.GUIDESLY_GUIDEPIC_IP+"/"+(0,T.kb)(null===(s=y.selectedRates)||void 0===s?void 0:s.coverpicture),alt:null!==(c=null===(u=y.selectedRates)||void 0===u?void 0:u.rctitle)&&void 0!==c?c:null===(l=y.selectedGuide)||void 0===l?void 0:l.company,width:"100%",height:"100%",loading:"lazy"})),r.createElement("div",null,Boolean(b&&(null==b?void 0:b.title))?r.createElement("p",{className:m.tripCardTitle},null==b?void 0:b.title):r.createElement("p",{className:m.tripCardTitle},null===(d=y.selectedRates)||void 0===d?void 0:d.rctitle),r.createElement("p",{className:m.tripCardCompany},null===(f=y.selectedGuide)||void 0===f?void 0:f.company),r.createElement("p",{className:m.tripCardrating},r.createElement("span",null,(null===(p=y.selectedGuide)||void 0===p?void 0:p.rating)&&r.createElement(r.Fragment,null,r.createElement(B.Ay,{icon:V.d49,size:14}),Number(null===(h=y.selectedGuide)||void 0===h?void 0:h.rating).toFixed(1))),r.createElement("span",{className:m.techlabel},null!==(v=y.selectedGuide)&&void 0!==v&&v.display_location?null===(g=y.selectedGuide)||void 0===g?void 0:g.display_location:""))))),r.createElement("div",{className:m.information,style:{padding:"10px 0px"},id:"tripData"},r.createElement(ce,{handleGuestIncrement:()=>{let e=y.count;y.setCount(e+1)},handleGuestDecrement:()=>{let e=y.count;e>1&&y.setCount(e-1)},handleShowInput:()=>{y.setShowInput(!0)},queryObj:E,setQueryObj:w,searchParams:S,newRates:b,setNewRates:_,setGuestError:N})))},le=n(81208);var de=e=>{var t,n;let{Styles:i,context:o,validatePhone:a,inCorrect:s,setIsValidEmail:c,inValidPhone:u,setAddonCheck:l,addOnCheck:d,consumerAddOn:f}=e;return r.createElement(r.Fragment,null,(null==f?void 0:f.length)>0&&r.createElement(r.Fragment,null,r.createElement("div",{className:i.hrLine}),r.createElement("p",null," ",r.createElement("strong",null,"Optional Add-Ons ")),r.createElement("div",{className:i.information1,id:"optionalAddons"},f&&f.map(((e,t)=>{var n,i,o,a,s;return r.createElement("div",{key:t},r.createElement("img",{src:d[e.id]?"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg":"https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",onClick:()=>l({...d,[e.id]:!d[e.id]}),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:19,width:19,border:"1px solid grey",cursor:"pointer"},width:"19",height:"19"}),r.createElement("span",{style:{marginRight:5}},e.title),r.createElement("span",{style:{marginRight:5}},"- $"+(a=e.charge_value,Number.isInteger(a)||"str"===s?Number(a).toLocaleStr
2ing(void 0):Number(a).toLocaleString(void 0,{minimumFractionDigits:0}))),r.createElement("span",null,null!=e&&null!==(n=e.duration)&&void 0!==n&&n.is_entire_trip?"Per Entire Trip":null!=e&&null!==(i=e.duration)&&void 0!==i&&i.days?"Per Day":null!=e&&null!==(o=e.duration)&&void 0!==o&&o.hours?"Per Hour":"Per 30 Minutes"))})))),r.createElement("div",{className:i.hrLine}),r.createElement("p",null," ",r.createElement("strong",null,"My Info ")),r.createElement("div",{className:i.information,id:"myInfo"},r.createElement(le.A,null,r.createElement("div",{className:i.RowData},r.createElement(le.A.Control,{type:"text",onChange:e=>{let t=e.target.value;t=t.replace(/[0-9!@#$%^&*()_+{}\[\]:;<>,.?~\\/-/'"|]/g,""),""===t||0===t.trim().length?o.setRequiredFn(!0):o.setRequiredFn(!1),o.setFirstName(t)},value:o.firstname,minLength:"3",maxLength:"20",autoComplete:"given-name",id:"firstName",className:i.inputField}),r.createElement("span",{className:o.firstname?i.floatingLabel1:i.floatingLabel},"First Name"),r.createElement("span",{className:i.ErrorCont},o.requireFn?r.createElement("span",{className:i.errorMsg},"First Name is required*"):null)),r.createElement("div",{className:i.RowData},r.createElement(le.A.Control,{type:"text",onChange:e=>{let t=e.target.value;t=t.replace(/[0-9!@#$%^&*()_+{}\[\]:;<>,.?~\\/-/'"]/g,""),o.setRequiredLn(!1),0===t.trim().length?o.setRequiredLn(!0):o.setRequiredLn(!1),o.setLastName(t)},value:o.lastname,minLength:"3",autoComplete:"family-name",maxLength:"20",className:i.inputField}),r.createElement("span",{className:o.lastname?i.floatingLabel1:i.floatingLabel},"Last Name"),r.createElement("span",{className:i.ErrorCont},o.requireLn?r.createElement("span",{className:i.errorMsg},"Last Name is required*"):null)),r.createElement("div",{className:i.RowData},r.createElement(le.A.Control,{type:"email",onBlur:e=>(e=>{const t=e;var n=new RegExp(/^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/);if(0===t.length)c(!1),o.setRequiredEmail(!1);else{if(!n.test(t))return c(!0),void o.setRequiredEmail(!0);o.setRequiredEmail(!1),c(!1)}})(e.target.value),required:!0,id:"email",autoComplete:"email",onChange:e=>{const t=e.target.value;o.setEmail(t),""===t?o.setRequiredEmail(!0):o.setRequiredEmail(!1)},value:o.email,className:i.inputField}),r.createElement("span",{className:o.email?i.floatingLabel1:i.floatingLabel},"Email"),r.createElement("span",{className:i.ErrorCont},o.requireEmail?r.createElement("span",{className:i.errorMsg},"Email is required*"):null)),r.createElement("div",{className:i.RowData,style:{borderBottom:"none"}},r.createElement("p",{className:i.label},"Phone"),r.createElement(C.Ay,{type:"tel",placeholder:"(555) 555-5555",country:(null===(t=(0,T.X0)())||void 0===t?void 0:t.country)||"US",value:o.phone?o.phone:"",defaultCountry:(null===(n=(0,T.X0)())||void 0===n?void 0:n.country)||"US",countryCallingCodeEditable:!1,initialValueFormat:"national",onChange:e=>{let t=e;a(t),o.setFormattedPhone(t),o.setPhone(t)},minLength:8,maxLength:15,required:!0,autoComplete:"phone",isInvalid:u,style:{width:"100%"}}),r.createElement("span",{className:i.ErrorCont},o.requirePhone?r.createElement("span",{className:i.errorMsg},"Phone is required*"):null,s?r.createElement("span",{className:i.errorMsg},"Please provide a valid Phone number*"):null)))))};var fe=e=>{var t,n,i;let{Styles:o,context:a,AddPromo:s,addPerson:c,setTip:u,tip:l,handleRemove:d,matesfee:f}=e;const p=(0,r.useRef)(null),{0:v,1:g}=(0,r.useState)(!1),{0:m,1:y}=(0,r.useState)(!1),{0:b,1:_}=(0,r.useState)(0),E="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/checked.svg",w="https://guidesly-assets.s3.us-east-2.amazonaws.com/web/static/images/uncheck.svg",S=c(a.selectedRates,f,a.count),I=e=>{u({tipAmt:(S*e).toFixed(2),tiptype:"Predefined"})};(0,r.useEffect)((()=>{var e;null!==(e=a.selectedGuide)&&void 0!==e&&e.is_new_guide&&S&&S>0&&b<=0&&(a.setPromo({...a.promo,promoCode:"NEWGUIDELISTING2023"}),N("NEWGUIDELISTING2023",!1),_(b+1))}),[S]);const N=(e,t)=>{var n;const r={code:e,trip_cost:S,guideguid:null===(n=a.selectedGuide)||void 0===n?void 0:n.guideguid};let i=(0,T.HW)().token;a.setLoadingMask(!0),h().post("/v1/payment/verify_code",r,{headers:{Authorization:"Bearer "+i}}).then((n=>{a.setLoadingMask(!1);const r=n.data;r.code=e,!1===n.data.valid?null!=n.data.error?a.setPromo({...a.promo,error:n.data.error.message}
2):t&&a.setPromo({...a.promo,error:"This code is invalid."}):a.setPromo({...a.promo,error:"",applied:!0,response:r,promoCode:r.code,show:!1}),r.valid&&t&&y(!1)})).catch((e=>{a.setLoadingMask(!1),console.log(e)}))};return r.createElement(r.Fragment,null,r.createElement("div",{className:o.hrLine}),r.createElement("p",null," ",r.createElement("strong",null,"Tips & Discounts")),r.createElement("div",{className:o.information,style:{padding:"10px 0px"}},r.createElement("div",{className:o.TripDateHolder},r.createElement("div",null,r.createElement("p",null,"Pre Tip "),r.createElement("span",{className:o.TripDate},!isNaN(a.tip)&&a.tip?"$"+a.tip+" ("+("Custom Tip"===a.tip?Number.parseFloat(100*a.tip/S).toFixed(2):Math.round(100*a.tip/S))+"%)":"Cash Tip Upon Trip"===a.tipType?"Cash Tip Upon Trip":"Custom Tip"===a.tipType?"$0":"Add Tip Amount")),r.createElement("div",null,r.createElement("span",{className:o.EditText,onClick:()=>{g(!v)}},"Edit"))),!a.promo.applied&&r.createElement("p",{className:o.promo,onClick:()=>y(!m)},"Enter a coupon"),a.promo.applied&&r.createElement("div",{className:o.TripDateHolder,style:{display:"block"}},r.createElement("div",null,r.createElement("p",null,"Coupon Applied ")),r.createElement(r.Fragment,null,r.createElement("div",{style:{display:"flex",flexDirection:"row",width:"100%"}},r.createElement("div",{style:{display:"flex",flexDirection:"column",width:"65%"}},r.createElement("p",{className:o.PromoBtn},r.createElement(B.Ay,{icon:K.TcI})," ",r.createElement("span",{style:{padding:"0px 5px"}},a.promo.response.code)," ",r.createElement("span",{onClick:d,style:{cursor:"pointer"}},r.createElement(B.Ay,{icon:K.x}))),r.createElement("p",{style:{marginBottom:"5px",fontSize:"12px"}},null===a.promo.response.percent_off?r.createElement(r.Fragment,null,"$ ",a.promo.response.amount_off/100," off"):r.createElement(r.Fragment,null,a.promo.response.percent_off,"% off"))),r.createElement("div",{style:{display:"flex",flexDirection:"row",width:"35%",justifyContent:"flex-end"}},r.createElement("div",{style:{display:"flex",alignItems:"center",fontSize:"14px"}},null===a.promo.response.percent_off||void 0===a.promo.response.percent_off?r.createElement(r.Fragment,null," -$",s(a.selectedRates,f,a.count,a.promo.response.amount_off,"V",a.tip)):r.createElement(r.Fragment,null,"-$",s(a.selectedRates,f,a.count,a.promo.response.percent_off,"P",a.tip).toFixed(2)))))))),r.createElement("div",{className:o.hrLine}),r.createElement(z,{show:v,onHide:()=>g(!v),size:"md",style1:o.modal,header:"Pre Tip"},r.createElement(r.Fragment,null,r.createElement("div",{style:{maxHeight:"310px",overflowY:"auto",paddingBottom:"15px"}},r.createElement("div",{style:{display:"flex",paddingTop:5,paddingBottom:5,margin:"2px 0px"}},r.createElement("img",{src:l.tipAmt===(.18*S).toFixed(2)?E:w,onClick:()=>I(.18),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("div",{onClick:()=>I(.18),className:o.tipText,style:{marginTop:"-3px"}},"18%")),r.createElement("div",{style:{display:"flex",paddingTop:5,paddingBottom:5,margin:"2px 0px"}},r.createElement("img",{src:l.tipAmt===(.2*S).toFixed(2)?E:w,onClick:()=>I(.2),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("div",{onClick:()=>I(.2),className:o.tipText,style:{marginTop:"-3px"}},"20% ")),r.createElement("div",{style:{display:"flex",paddingTop:5,paddingBottom:5,margin:"2px 0px 0px"}},r.createElement("img",{src:l.tipAmt===(.25*S).toFixed(2)?E:w,onClick:()=>I(.25),style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("div",{onClick:()=>I(.25),className:o.tipText,style:{marginTop:"-3px"}},"25%")),r.createElement("div",{style:{display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4}},r.createElement("img",{src:l.tipAmt!==(.18*S).toFixed(2)&&l.tipAmt!==(.2*S).toFixed(2)&&l.tipAmt!==(.25*S).toFixed(2)&&"uponCash"!==l.tipAmt&&""!==l.tipAmt||"Custom Tip"===a.tipType?E:w,onClick:()=>{p.current.focus(),u({tipAmt:p.current.value,tiptype:"Custom Tip"})},style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("div",{className:o.tipText,style:{marginTop:"-3px"}},"Custom Tip - ",r.createElement("input",{ref:p,className:"customTipValue "+o.customTipValue,style:{height:"30px"},onChange:e=>{u({tipAmt:e.target.value>0?Number(e.target.value):0,tiptype:"Custom Tip"}),e.stopPropagation(),e.preventDefault()},type:"number",placeholder:"Custom Amount",maxlength:"4"}))),r.createElement("div",{style:{display:"flex",paddingTop:5,paddingBottom:5}},r.createElement("img",{src:"uponCash"===l.tipAmt?E:w,onClick:()=>
2{u({tipAmt:"uponCash",tiptype:"Cash Tip Upon Trip"})},style:{padding:0,margin:0,borderRadius:0,marginRight:10,height:20,width:20,border:"1px solid grey",cursor:"pointer"},width:"20",height:"20"}),r.createElement("div",{style:{marginTop:"-3px"},className:o.tipText,onClick:()=>{u({tipAmt:"uponCash",tiptype:"Cash Tip Upon Trip"})}},"Cash Tip Upon Trip"))),r.createElement("div",{className:o.displayButtons,style:{borderColor:"#42642f"}},r.createElement("p",{onClick:()=>g(!1)},"Cancel"),r.createElement("button",{onClick:()=>{a.setTip(null==l?void 0:l.tipAmt),a.setTipType(null==l?void 0:l.tiptype),g(!v)}},"Save")))),r.createElement(z,{show:m,onHide:()=>y(!m),size:"md",style1:o.modal,header:"Coupons"},r.createElement(r.Fragment,null,r.createElement("div",{style:{paddingBottom:"15px"}},r.createElement(le.A.Group,{className:o.promoCont+" "},r.createElement(le.A.Control,{type:"text",value:a.promo.promoCode,className:""+o.inputField,onChange:e=>(e=>{const t=e.target.value;t.length>=1&&a.setPromo({...a.promo,show:!0,promoCode:t}),0===t.length&&a.setPromo({...a.promo,show:!1,promoCode:t})})(e),style:{height:"40px !important"}}),r.createElement("span",{className:null!==(t=a.promo)&&void 0!==t&&t.promoCode?o.floatingLabel1:o.floatingLabel,style:{left:"10px"}},"Add Promotion or Gift Code")),""!==a.promo.error?r.createElement("p",{className:o.feedback,style:{textAlign:"center"}},a.promo.error," "):null),r.createElement("div",{className:o.displayButtons,style:{borderColor:"#42642f"}},r.createElement("p",{onClick:()=>y(!m)},"Cancel"),r.createElement("button",{onClick:()=>N(a.promo.promoCode,!0),disabled:0===(null===(n=a.promo)||void 0===n||null===(i=n.promoCode)||void 0===i?void 0:i.length)},"Apply")))))},pe=n(48519),he=n(71248),ve=n(57640);var ge=e=>{var t,n,i,o,a,s,c,u,l,d,f,p,h,v,g,m,y,_,w,S,N,A;let{matesfee:C,newRates:O,paytype:D,tripCal:R,addonAmt:P,consumerAddOn:x,addOnCheck:M}=e;const L=(0,r.useContext)(I.A),{0:U,1:F}=(0,r.useState)(!1),{0:j}=(0,r.useState)("undefined"!=typeof window&&window.innerWidth<=568),{0:V,1:G}=(0,r.useState)([]);let K=0;C.forEach((e=>{e.active&&(K+=Number((0,k.G4)(L.selectedRates,e,L.count)))})),(0,r.useEffect)((()=>{let e=null==L?void 0:L.selectedRates,t=[];if(x&&M&&e){const o=x.filter((e=>M[e.id]));for(let a of o){var n,r,i;let o={};o.title=a.title,null!==(n=a.duration)&&void 0!==n&&n.is_entire_trip?o.value=parseFloat(a.charge_value):null!==(r=a.duration)&&void 0!==r&&r.days?e.duration_days?o.value=parseFloat(a.charge_value*e.duration_days):o.value=parseFloat(a.charge_value*((0,J.Os)(e.duration_hours)/24)):null!==(i=a.duration)&&void 0!==i&&i.hours?e.duration_days?o.value=parseFloat(a.charge_value*e.duration_days*24):o.value=parseFloat(a.charge_value*(0,J.Os)(e.duration_hours)):e.duration_days?o.value=parseFloat(a.charge_value*e.duration_days*48):o.value=parseFloat(a.charge_value*(0,J.Os)(e.duration_hours)*2),t.push(o)}G(t)}}),[M]);let H="$"+Number((null==R?void 0:R.chargetoday)||0).toFixed(2),z="$"+Number((null==R?void 0:R.total)||0).toFixed(2),W="$"+(Number((null==R?void 0:R.total)||0)-Number((null==R?void 0:R.chargetoday)||0)).toFixed(2);const $=null===L.promo.response.percent_off||void 0===L.promo.response.percent_off?(0,k.HW)(L.selectedRates,C,L.count,L.promo.response.amount_off,"V",L.tip):(0,k.HW)(L.selectedRates,C,L.count,L.promo.response.percent_off,"P",L.tip);return r.createElement(r.Fragment,null,r.createElement("div",{className:E.rightContainer},r.createElement(ve.nD,{allowZeroExpanded:!0},r.createElement(ve.As,{key:1},r.createElement(ve.IZ,null,r.createElement(ve.SR,null,!j&&r.createElement("div",{className:E.tripData},r.createElement("div",{className:E.tripImages},Boolean(O&&(null==O?void 0:O.title))?O.title&&(null==O?void 0:O.coverpicture)&&""!==(null==O?void 0:O.coverpicture)&&r.createElement("div",null,r.createElement("img",{src:q().GUIDESLY_GUIDEPIC_IP+"/filters:format(jpeg,png)/"+(0,T.kb)(null==O?void 0:O.coverpicture),alt:null!==(t=O.title)&&void 0!==t?t:null===(n=L.selectedGuide)||void 0===n?void 0:n.company})):(null===(i=L.selectedRates)||void 0===i?void 0:i.rctitle)&&(null===(o=L.selectedRates)||void 0===o?void 0:o.coverpicture)&&""!==(null===(a=L.selectedRates)||void 0===a?void 0:a.coverpicture)&&r.createElement("div",null,r.createElement("img",{src:q().GUIDESLY_GUIDEPIC_IP+"/filters:format(jpeg,png)/"+(0,T.kb)(null===(s=L.selectedRates)||void 0===s?void 0:s.coverpicture),alt:null!==(c=null===(u=L.selectedRates)||void 0===u?void 0:u.rctitle)&&void 0!==c?c:null===(l=L.selectedGuide)||void 0===l?void 0:l.company})),r.createElement("div",null,Boolean(O&&(null==O?void 0:O.title))?r.createElement("p",{className:E.tripCardTitle},null==O?void 0:O.title):r.createElement("p",{className:E.tripCardTitle},null===(d=L.selectedRates)||void 0===d?void 0:d.rctitle),r.createElement("p",{className:E.tripCardCompany},null===(f=L.selectedGuide)||void 0===f?void 0:f.company),r.createElement("p",{className:E.tripCardrating},r.createElement("span",null,(null===(p=L.selectedGuide)||void 0===p?void 0:p.rating)&&r.createElement(r.Fragment,null,r.createElement(B.Ay,{icon:he.d,size:14}),Number(null===(h=L.selectedGuide)||void 0===h?void 0:h.rating).toFixed(1))),r.createElement("span",{className:E.techlabel},null!==(v=L.selectedGuide)&&void 0!==v&&v.display_location?null===(g=L.selectedGuide)||void 0===g?void 0:g.display_location:""))))))),r.createElement(ve.IT,null,r.createElement("div",{className:E.trip
2Details},r.createElement("div",{className:E.boats},r.createElement("p",null,null!=L.selectedRates.name&&""!=L.selectedRates.name&&L.selectedRates.maximum?L.selectedRates.name+" - Max "+L.selectedRates.maximum+" guests":null!=L.selectedRates.manufacturer_name&&L.selectedRates.maximum?L.selectedRates.manufacturer_name+" - Max "+L.selectedRates.maximum+" guests":L.selectedRates.maximum?"Max "+L.selectedRates.maximum+" guests":null)),r.createElement("div",{className:E.meetingP},r.createElement("p",null,"Meeting Point:"),r.createElement("p",null,null===(m=L.selectedGuide)||void 0===m||null===(y=m.meeting_points[0])||void 0===y?void 0:y.name),r.createElement("p",null,null===(_=L.selectedGuide)||void 0===_||null===(w=_.meeting_points[0])||void 0===w?void 0:w.description)),r.createElement("div",{className:E.waterBody},r.createElement("p",null,"Preferred Waterbody: ",null!==(S=L.selectedGuide)&&void 0!==S&&S.guiderivers?null===(N=L.selectedGuide)||void 0===N||null===(A=N.guiderivers[0])||void 0===A?void 0:A.rivername:"")))))),r.createElement("div",{className:E.tripSummaryDetails},r.createElement("p",{className:E.priceDetails},"Price Details"),r.createElement("div",{className:""+E.cardRow},r.createElement("p",null,"Base Trip Cost"),Object.keys(L.selectedRates).length>0&&L.selectedRates.rate?r.createElement("div",{className:E.rightText},"$"+(0,J.BZ)((0,k.jS)(L.selectedRates))):r.createElement("div",{className:E.rightText},"$0")),0==(0,k.zd)(L.selectedRates,L.count)?null:r.createElement("div",{className:E.cardRow},r.createElement("p",null,"Additional Guest Fee"),r.createElement("div",{className:E.rightText},Object.keys(L.selectedRates).length>0?r.createElement("div",{className:E.rightText},"$"+(0,J.BZ)((0,k.zd)(L.selectedRates,L.count))):r.createElement("div",{className:E.rightText},"$0"))),r.createElement("div",null,Object.keys(L.selectedRates).length>0&&0!=P&&r.createElement("div",{className:E.cardRow},r.createElement("p",null,"Add-Ons ",r.createElement("span",null,r.createElement(Z.A,{key:"top",placement:"top",overlay:r.createElement(Q.A,{id:"tooltip-top"},V.length>0&&V.map((e=>r.createElement("div",{style:{textAlign:"left"}},r.createElement("span",null,e.title),r.createElement("span",null,": $"+(0,J.BZ)(Number(e.value||0).toFixed(2)))))))},r.createElement("img",{style:{width:16,height:16},src:pe.A})))),r.createElement("div",{className:E.rightText},"$"+(0,J.BZ)(P.toFixed(2))))),r.createElement("div",{className:E.cardRow},r.createElement("p",null,"Tip ","Cash Tip Upon Trip"===L.tipType?" - Cash Tip Upon Trip":""),Object.keys(L.selectedRates).length>0&&L.selectedRates.rate&&"Cash Tip Upon Trip"!==L.tipType?r.createElement("div",{className:E.rightText,"data-alyx-tip":"tip"},"$"+(0,J.BZ)(Number(L.tip||0).toFixed(2))):r.createElement("div",{className:E.rightText},"Cash Tip Upon Trip"===L.tipType?"":"$0")),r.createElement("div",null,Object.keys(L.selectedRates).length>0&&0!=K&&r.createElement("div",{className:E.cardRow},r.createElement("p",null,"Fees ",!j&&r.createElement("span",null,r.createElement(Z.A,{key:"top",placement:"top",overlay:r.createElement(Q.A,{id:"tooltip-top"},Object.keys(L.selectedRates).length>0&&C.length>0&&C.map((e=>r.createElement("div",{style:{textAlign:"left"}},r.createElement("span",null,e.title),r.createElement("span",null,": $"+(0,J.BZ)((0,k.G4)(L.selectedRates,e,L.count)))))))},r.createElement("img",{style:{width:16,height:16},src:pe.A})))),r.createElement("div",{className:E.rightText},"$"+(0,J.BZ)(K.toFixed(2))))),L.promo.applied&&r.createElement("div",{className:E.cardRow},r.createElement("p",null,"Coupon Applied"),r.createElement("div",{className:E.rightText,"data-alyx-tip":"coupon applied"},"-$"+$.toFixed(2))),r.createElement("div",{className:E.cardRow+" "+E.blue},r.createElement("p",null,"Total (USD)"),Object.keys(L.selectedRates).length>0&&L.selectedRates.rate?r.createElement("p",null,z):r.createElement("p",null,"$0.00"))),r.createElement("div",{style:{padding:"10px 7% 10px"}},r.createElement("div",{className:E.cardRow+" "+E.chargedToday},r.createElement("p",null,"Due now"),Object.keys(L.selectedRates).length>0&&L.selectedRates.rate?r.createElement(r.Fragment,null,r.createElement("p",null,H)):r.createElement("p",null,"$0.00")),"partial"===D&&r.createElement("div",{className:""+E.cardRow},r.createElement("p",null,"Due on ",L.startDate?b()(L.startDate).format("MMM D, YYYY"):""),Object.keys(L.selectedRates).length>0&&L.selectedRates.rate?r.createElement("p",null,W):r.createElement("p",null,"$0.00"))),j&&Object.keys(L.selectedRates).length>0&&0!=K&&r.createElement("p",{className:E.moreInfo,onClick:()=>F(!0)}
2,"More info")),r.createElement(Y.A,{show:U,onHide:()=>F(!1),"aria-labelledby":"example-custom-modal-styling-title",animation:!0,dialogClassName:E.moreInfoModal},r.createElement(Y.A.Header,{closeButton:!0},r.createElement("p",{className:E.priceDetailsModal},"Price Details")),r.createElement(Y.A.Body,null,Object.keys(L.selectedRates).length>0&&C.length>0&&C.map(((e,t)=>r.createElement("div",{key:e.title+"-"+t,className:E.cardRow},r.createElement("p",null,e.title," ",e.charge_percentage?" ("+e.charge_percentage+"%)":null),r.createElement("div",{className:E.rightText},"$"+(0,J.BZ)((0,k.G4)(L.selectedRates,e,L.count)))))))))};var me=e=>{let{paymentStarted:t,setLoadingMask:n,path:i,setErrorTitle:o,setErrorMsg:a,setError:s,setPaymentStarted:c,setPaymentType:u,setPaymentInfo:l}=e;const d=(0,F.useStripe)(),f=(0,F.useElements)();(0,r.useEffect)((()=>{t&&p(i)}),[t]);const p=async e=>{if(!d||!f)return;await d.confirmPayment({elements:f,confirmParams:{return_url:e}}).then((e=>{var t,r;(n(!1),null!=e&&e.error)&&(l(!0),c(!1),s(!0),"validation_error"!=(null==e||null===(t=e.error)||void 0===t?void 0:t.type)&&o("Payment Failed"),a(null==e||null===(r=e.error)||void 0===r?void 0:r.message))})).catch((e=>{c(!1),n(!1),console.log(e,"stripe")}))};return r.createElement(F.PaymentElement,{id:"payment-element",options:{layout:"tabs"},onChange:e=>u(e.value)})};var ye=e=>{let{activateBtn:t,stylename:n,tripCal:i,paytype:o,setError:a,setErrorMsg:s,path:c,guestError:u,setErrorTitle:d,processPaymentToken:f,userContext:p,inCorrect:v,isValidEmail:g,setIsGuestLogin:m,paymentType:y,clientSecret:b,paymentInfo:_,setPaymentInfo:E}=e;const w=(0,F.useStripe)(),S=((0,F.useElements)(),(0,r.useContext)(I.A)),{0:N,1:A}=(0,r.useState)(null),{0:C,1:O}=(0,r.useState)(S),{0:k,1:D}=(0,r.useState)(!1);var R;(0,r.useEffect)((async()=>{var e;w&&i.chargetoday&&(null===(e=R=w.paymentRequest({country:"US",currency:"usd",total:{label:"Guidesly",amount:+Number(100*i.chargetoday).toFixed(2)},requestPayerName:!0,requestPayerEmail:!0}))||void 0===e||e.canMakePayment().then((async e=>{e&&A(R)})).catch((e=>{console.log(e,"payErr")})))}),[i,y]),(0,r.useEffect)((()=>{w&&i.chargetoday&&U()}),[N,C]);const P=e=>{const t=null===S.startDate||0===Object.keys(S.selectedRates).length,n=""===S.firstname||!S.firstname||""===S.lastname||!S.lastname||""===S.email||!S.email||""===S.phone||!S.phone||v||g;if(n||t||u){var r,i,o;if(D(!1),u)null===(r=document.getElementById("tripData"))||void 0===r||r.scrollIntoView({behavior:"auto",block:"center",inline:"center"});if(!u&&t)a(!0),d("There was a problem"),null===S.startDate?s("Trip Detail section is not complete, please select trip date"):null===S.selectedRateCardTitle?s("Trip Detail section is not complete, please select trip type"):s("Trip Detail section is not complete, please select trip time and length"),null===(i=document.getElementById("tripData"))||void 0===i||i.scrollIntoView({behavior:"auto",block:"center",inline:"center"});if(n&&!t&&!u)S.firstname&&""!==S.firstname||S.setRequiredFn(!0),S.lastname&&""!==S.lastname||S.setRequiredLn(!0),S.email&&""!==S.email||S.setRequiredEmail(!0),S.phone&&""!==S.phone||S.setRequiredPhone(!0),a(!0),d("There was a problem"),s("My Info section is not complete"),D(!1),null===(o=document.getElementById("myInfo"))||void 0===o||o.scrollIntoView({behavior:"auto",block:"center",inline:"center"});return!1}return!0},x=async e=>{await M(),await f(e)},M=async()=>{if(a(!1),s(""),d(""),p.isguest){const e={email:S.email,firstname:S.firstname,lastname:S.lastname,phone:S.phone};m(!0),S.setLoadingMask(!0);const{status:t,data:n}=await h().post("v1/auth/loginguest",e);200===t?(0,T.gV)(n):401===t?(window.localStorage.clear(),(0,l.oo)("/")):(a(!0),d("ERROR"),s(n[0].msg)),S.setLoadingMask(!1)}const e={...S,allGuides:[],schrecords:{ratecards:S.schrecords.ratecards},guideImages:[],availDate:[],guideReviews:[],schedule:[]};(0,T.Fh)(e),O(e)},L={paymentRequest:N,style:{paymentRequestButton:{type:"default",theme:"dark",height:"84px"}}},U=()=>{null==N||N.on("paymentmethod",(async(e,t)=>{var n,r=(0,T.pP)(),o=(Number(null!==(n=i.chargetoday)&&void 0!==n?n:500).toFixed(2),await f("apple_google_pay",r));if(o){const{paymentIntent:t,error:n}=await w.confirmCardPayment(b,{payment_method:e.paymentMethod.id,return_url:c},{handleActions:!1});if(n)e.complete("fail");else if(e.complete("success"),"requires_action"===t.status){const{error:e}=await w.confirmCardPayment(b)}else{var a=c;a=a+"?trip_reserve_id="+o.tripReserve+"&booking_ref="+o.book_ref,console.log("payment success...redirecting to path...",a),(0,T.Fh)({}),(0,l.oo)(a)}}}))};return r.createElement(r.Fragment,null,r.createElement("button",{id:"custom-payment-request-button",onClick:e=>(async e=>{E(!1),D(!0),P()?(D(!0),x()):(e.preventDefault(),D(!1))})(e),disabled:t,className:n,style:"apple_pay"!=(null==y?void 0:y.type)&&"google_pay"!=(null==y?void 0:y.type)?{display:"block"}:{display:"none"}},"Confirm & Pay ",_?"":k?r.createElement("span",{style:{marginLeft:"25px",top:"2px"},className:"dot-pulse"}):""),N&&("apple_pay"===(null==y?void 0:y.type)||"google_pay"===(null==y?void 0:y.type))&&r.createElement("div",{id:"PayBtnD"},r.createElement(F.PaymentRequestButtonElement,{options:L,onClick:async e=>{var t;((0,T.Fh)(S),P())?(console.log("context date...",null===(t=(0,T.pP)())||void 0===t?void 0:t.startDate),await M()):e.preventDefault()}})))};var be=()=>{var e,t,n,o,p,v;const g={"@context":"https://schema.org","@type":"Organization",description:"Book your personalized fishing trip today. Our guides are vetted & trusted.",logo:"https://guidesly.com/images/Guidesly_logo.svg",url:(0,f.i)().siteMetadata.siteUrl},{0:y,1:D}=(0,r.useState)((()=>function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];U=!0;var r=Date.now();return L.then((function(e){return function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.54.2",startTime:t})}(r,n),r}(e,t,r)}))}(""+G.GUIDESLY_STRIPE_KEY))),R=(0,i.useLocation)(),P=(0,j.parse)(R.search),x=(0,c.gW)();var M=(0,r.useContext)(I.A);const B=(0,r.useContext)(N.A),V=(0,r.useContext)(A.A),q=(0,i.useParams)(),{0:Y,1:K}=(0,r.useState)(!1),{0:H,1:z}=(0,r.useState)(""),{0:W,1:Q}=(0,r.useState)(""),Z="undefined"!=typeof window,{0:$}=(0,r.useState)((0,T.HW)().guid),{0:X,1:ee}=(0,r.useState)(!1),{0:te,1:ne}=(0,r.useState)(!1),{0:re,1:ie}=(0,r.useState)(!1),{0:oe,1:ae}=(0,r.useState)(!1),{0:se,1:ce}=(0,r.useState)([]),{0:le,1:pe}=(0,r.useState)(""),{0:he,1:ve}=(0,r.useState)(!1),{0:be,1:_e}=(0,r.useState)(!1),{0:Ee,1:we}=(0,r.useState)({tip:null,tiptype:null}),{0:Se,1:Te}=(0,r.useState)([]),{0:Ie,1:Ne}=(0,r.useState)(""),{0:Ae,1:Ce}=(0,r.useState)({subtotal:0,chargetoday:0,total:0}),{0:Oe,1:ke}=(0,r.useState)("partial"),{0:De,1:Re}=(0,r.useState)(null),{0:Pe,1:xe}=(0,r.useState)(null),{0:Me,1:Le}=(0,r.useState)(!1),{0:Ue,1:Fe}=(0,r.useState)(null),{0:je,1:Be}=(0,r.useState)(null),{0:Ve,1:Ge}=(0,r.useState)({}),{0:qe,1:Ye}=(0,r.useState)([]),{0:Ke,1:He}=(0,r.useState)(0),{0:ze,1:We}=(0,r.useState)(!1),Je=Z&&(/Mobi|Android|iPad|iPhone|iPod/i.test(navigator.userAgent)||window.innerWidth<=568||((window.screen||{}).width||0)<=568);
2let Qe=(0,T.HW)(),Ze=!0===Qe.isconsumer&&!1===Qe.isguide;const{0:$e,1:Xe}=(0,r.useState)({tripDate:P.tripDate||null,guests:P.guests||1,ratecardID:P.ratecardID||null,rateID:P.rateID||null,meetingPoint:P.meetingPoint||null,promoCode:P.promoCode||null}),{selectedMeetingPoint:et,setSelectedMeetingPoint:tt}=M;(0,r.useEffect)((()=>{var e;if(null!==(e=M)&&void 0!==e&&e.selectedRates){var t,n,r,i,o;const e=(null===(t=M)||void 0===t?void 0:t.selectedRates)&&(null===(n=M)||void 0===n||null===(r=n.selectedRates)||void 0===r?void 0:r.guide_ratecard_id);if(null!==(i=M)&&void 0!==i&&null!==(o=i.schrecords)&&void 0!==o&&o.ratecards){var a,s,c;const t=null===(a=M)||void 0===a||null===(s=a.schrecords)||void 0===s||null===(c=s.ratecards)||void 0===c?void 0:c.filter((t=>t.id==e));if(t){var u;let e=null==t||null===(u=t[0])||void 0===u?void 0:u.consumer_addon_fees,n=null==e?void 0:e.filter((e=>!1!==e.active));Ye(n);let r={};n&&n.forEach((e=>{r[e.id]=!1})),Ge(r)}}}}),[null===(e=M)||void 0===e?void 0:e.selectedRates]),(0,r.useEffect)((()=>{var e;let t=0;if(Ve&&(null===(e=Object.keys(Ve))||void 0===e?void 0:e.length)>0){var n;const e=qe.filter((e=>Ve[e.id]));let a=null===(n=M)||void 0===n?void 0:n.selectedRates;if(e.length>0&&a){for(let n of e){var r,i,o;null!==(r=n.duration)&&void 0!==r&&r.is_entire_trip?t+=parseFloat(n.charge_value):null!==(i=n.duration)&&void 0!==i&&i.days?a.duration_days?t+=parseFloat(n.charge_value*a.duration_days):t+=parseFloat(n.charge_value*((0,J.Os)(a.duration_hours)/24)):null!==(o=n.duration)&&void 0!==o&&o.hours?a.duration_days?t+=parseFloat(n.charge_value*a.duration_days*24):t+=parseFloat(n.charge_value*(0,J.Os)(a.duration_hours)):a.duration_days?t+=parseFloat(n.charge_value*a.duration_days*48):t+=parseFloat(n.charge_value*(0,J.Os)(a.duration_hours)*2)}He(t)}else He(0)}}),[Ve]),(0,r.useEffect)((()=>(Z&&Ne(String(navigator.appVersion).substring(0,3)),()=>{Z&&window.localStorage.removeItem("userContext")})),[]),(0,r.useEffect)((()=>{Ae.chargetoday&&Ae.chargetoday>0&&!Me&&(Le(!0),M.setLoadingMask(!0),h().post("v2/payment/create_payment_intent",JSON.stringify({charge_amount:Number(Ae.chargetoday)})).then((e=>{var t;Re(null==e||null===(t=e.data)||void 0===t?void 0:t.client_secret),xe(e.data.pi_id),M.setLoadingMask(!1)})).catch((e=>{M.setLoadingMask(!1),console.log("Stripe payment intent failed")})))}),[Ae.chargetoday]);(0,r.useEffect)((()=>{if(Z&&(!(0,T.M3)()||Ze)){var e,t;if(null!==(e=window)&&void 0!==e&&e.zE)null===(t=window)||void 0===t||t.zE("messenger","hide");return()=>{var e,t;null!==(e=window)&&void 0!==e&&e.zE&&(null===(t=window)||void 0===t||t.zE("messenger","show"))}}}),[]),(0,r.useEffect)((()=>{nt()}),[$e]);const nt=()=>{if($e&&Z){const e=(0,c.KL)($e),t=new URLSearchParams(e).toString();t&&window.history.replaceState({},"","?"+t)}};(0,r.useEffect)((()=>{Z&&document.addEventListener("wheel",(function(e){"number"===document.activeElement.type&&document.activeElement.blur()}))}),[]),(0,r.useEffect)((()=>{if((0,T.M3)()){M.setFirstName((0,T.HW)().firstname),M.setLastName((0,T.HW)().lastname),M.setEmail((0,T.HW)().email);const n=(0,T.HW)().cellphone;if(n){var e=null==n?void 0:n.replace(/\s/g,"");if(M.setPhone(e),e&&e.length<=10){e="+1".concat(e),M.setPhone(e)}var t=(0,C.iM)(e);M.setFormattedPhone(t),it(t)}}(0,T.HW)().firstname&&M.setRequiredFn(!1),(0,T.HW)().lastname&&M.setRequiredLn(!1),(0,T.HW)().email&&M.setRequiredEmail(!1),(0,T.HW)().cellphone&&M.setRequiredPhone(!1)}),[(0,T.M3)()]),(0,r.useEffect)((()=>{var e,t;const n=null===(e=M)||void 0===e||null===(t=e.selectedRates)||void 0===t?void 0:t.guide_ratecard_id;if(Object.keys(M.schrecords).length>0&&n){var r,i,o;const e=null===(r=M)||void 0===r||null===(i=r.schrecords)||void 0===i?void 0:i.ratecards.filter((e=>e.id==n));if(!m()(e)&&null!==(o=e[0])&&void 0!==o&&o.addon_fees){var a;const t=null===(a=e[0])||void 0===a?void 0:a.addon_fees.filter((e=>e.active));ce(t)}else ce([])}else ce([])}),[M.selectedRates]),(0,r.useEffect)((()=>{M.startDate&&M.count&&Xe({...$e,tripDate:b()(M.startDate).format("YYYY-MM-DD"),guests:Number(M.count)})}),[M.startDate,M.count]),(0,r.useEffect)((()=>
2{if(R.search&&Object.keys(M.schrecords).length>0)if(P.guests&&(M.setCount(P.guests),P.guests>=5&&M.setShowInput(!0)),P.tripDate&&(M.setStartDate(null==P?void 0:P.tripDate),Xe({...$e,tripDate:null==P?void 0:P.tripDate})),P.meetingPoint){var e;const o=P.meetingPoint,a=null===(e=M.schrecords)||void 0===e?void 0:e.poi.filter((e=>e.poiguid===o));var t,n,r,i;if(a&&a.length>0)M.setMeetingPoint(a[0]),tt(a[0]);else if(tt((null===(t=M.selectedGuide)||void 0===t?void 0:t.meeting_points[0])||[]),M.setMeetingPoint((null===(n=M.selectedGuide)||void 0===n?void 0:n.meeting_points[0])||[]),(null===(r=M.selectedGuide)||void 0===r?void 0:r.meeting_points.length)>0)Xe({...$e,meetingPoint:null===(i=M.selectedGuide)||void 0===i?void 0:i.meeting_points[0].poiguid})}else{var o,a,s,c;if(tt((null===(o=M.selectedGuide)||void 0===o?void 0:o.meeting_points[0])||[]),M.setMeetingPoint((null===(a=M.selectedGuide)||void 0===a?void 0:a.meeting_points[0])||[]),(null===(s=M.selectedGuide)||void 0===s?void 0:s.meeting_points.length)>0)Xe({...$e,meetingPoint:null===(c=M.selectedGuide)||void 0===c?void 0:c.meeting_points[0].poiguid})}}),[M.schrecords]),(0,r.useEffect)((()=>(ot(),(0,T.M3)()||B.isguest||(B.setIsguest(!0),ve(!0)),()=>{ve(!1),B.setIsguest(!1),rt()})),[]),(0,r.useEffect)((()=>{M.loadGuide&&rt()}),[M.selectedRates]);const rt=()=>{M.setPromo({...M.promo,applied:!1,response:"",show:!1,promoCode:""})},it=e=>{let t=e,n=!(!t||!(0,C.g0)(t));if(""===t||!n)return M.setRequiredPhone(!1),ie(!0),void ee(!0);M.setRequiredPhone(!1),ie(!1),ee(!1)},ot=()=>{""===M.phone&&""===M.formattedPhone&&ee(!0),""===M.email&&ne(te)};(0,r.useEffect)((()=>{if(0===M.loadcount){M.setLoadingMask(!0),M.setLoadCount(M.loadcount+1);const e=b()(new Date,"ddd MMM DD YYYY h:mm:ss").format("YYYY-MM-DD"),t=b()(new Date((new Date).setFullYear((new Date).getFullYear()+1))).format("YYYY-MM-DD");h().get("/v1/guide/getGBSAvailability_v2?id="+q.id+"&start_date="+e+"&end_date="+t+"¤t_date="+b()().format("YYYY-MM-DD h:mm:s a")+"&mp=true").then((e=>{var t,n,r;M.setLoadingMask(!1),M.setSchRecords(e.data);const{details:i}=e.data;var o,a,s;if((M.selectedGuide||M.setSelectedGuide(i),M.setLoadGuide(!0),V.setIsLoad(!0),M.setGuideImages(null==i?void 0:i.media),null!=e.data.details)&&(V.setInitLoc(null==i||null===(o=i.geojson.features[0].geometry)||void 0===o?void 0:o.coordinates),V.setInitLocCp(null==i||null===(a=i.geojson.features[0].geometry)||void 0===a?void 0:a.coordinates),V.setGeoLocation({lat:Number(null==i?void 0:i.centroidlatitude),lng:Number(null==i?void 0:i.centroidlongitude)}),V.setGeoLocationCp({lat:Number(null==i?void 0:i.centroidlatitude),lng:Number(null==i?void 0:i.centroidlongitude)}),null!=i&&null!==(s=i.geojson.features[0].geometry)&&void 0!==s&&s.coordinates[0])){var c,u=null==i||null===(c=i.geojson.features[0].geometry)||void 0===c?void 0:c.coordinates[0].map((e=>({lat:e[1],lng:e[0]})));M.setPath(u),M.setMarkers(u)}let l=[],d=[];const f=null!=e&&null!==(t=e.data)&&void 0!==t&&t.booking_acceptance_days||0===(null==e||null===(n=e.data)||void 0===n?void 0:n.booking_acceptance_days)?null==e||null===(r=e.data)||void 0===r?void 0:r.booking_acceptance_days:2,p=b()(new Date).add(f,"days").format("YYYY/MM/DD");for(var h of e.data.schedule){var v=h.date.replace(/-/g,","),g=b()(v,"YYYY,MM,DD").toDate(),m=h.available_rates.length>0,y=b()(v,"YYYY,MM,DD").format("YYYY/MM/DD");m&&b()(y).isSameOrAfter(p)?l.push(g):d.push(g)}M.setNotAvail(d),M.setSchedule(l)}
2)).catch((e=>{e.response&&(M.setLoadingMask(!1),401===e.response.status&&(window.localStorage.clear(),(0,l.oo)("/")))}))}}),[M.loadGuide]),(0,r.useEffect)((()=>{if(M.selectedGuide&&Object.keys(M.selectedGuide).length>0){M.setGuideTab(!0),M.setPersonalTab(!0);const e=JSON.parse(window.localStorage.getItem("gatsbyUser"))||{};M.selectedGuide&&M.setLoadGuide(!0);let t=[],n={meetingPoint:null};M.selectedGuide&&M.selectedGuide.meeting_points.length>0&&(t=M.selectedGuide.meeting_points.filter((e=>1===e.poi_order)),0===t.length&&(t=M.selectedGuide.meeting_points.sort(((e,t)=>e.poi_order-t.poi_order))),n={...n,meetingPoint:t[0].poiguid}),Xe({...$e,meetingPoint:n.meetingPoint}),M.selectedGuide&&null!==M.selectedGuide.guiderivers&&1===M.selectedGuide.guiderivers.length&&(M.setSelectedRiver1(M.selectedGuide.guiderivers[0]),M.setSelectedRiver2(M.selectedGuide.guiderivers[0]));let r="",i="";M.selectedGuide&&M.selectedGuide.guiderivers&&(r=M.selectedGuide.guiderivers.find((e=>1===e.row_number))),M.selectedGuide&&M.selectedGuide.guiderivers&&(i=M.selectedGuide.guiderivers.length>1?M.selectedGuide.guiderivers.find((e=>2===e.row_number)):M.selectedGuide.guiderivers[0]),M.setSelectedRiver1(r),M.setSelectedRiver2(i),null!==e&&(0,T.M3)()&&(e.firstname?M.setFirstName(e.firstname):M.firstname?M.setRequiredFn(!1):M.setRequiredFn(!0),e.lastname?M.setLastName(e.lastname):M.lastname?M.setRequiredLn(!1):M.setRequiredLn(!0),e.email?M.setEmail(e.email):M.email?M.setRequiredEmail(!1):M.setRequiredEmail(!0),(0,T.HW)().cellphone&&""!=(0,T.HW)().cellphone?M.setRequiredPhone(!1):M.setRequiredPhone(!0))}M.setShowPaymentInfo(!1)}),[M.selectedGuide]),(0,r.useEffect)((()=>{M.selectedGuide&&Object.keys(M.selectedGuide).length>0&&(M.setGuideTab(!0),M.setPersonalTab(!0),M.setPaymentTab(!0),ae(!1),M.setShowPaymentInfo(!0),M.setShowPersonalInfo(!0))}),[M.selectedGuide]),(0,r.useEffect)((()=>{M.setTip("uponCash"),M.setTipType("Cash Tip Upon Trip"),we({tipAmt:"uponCash",tiptype:"Cash Tip Upon Trip"})}),[se,NaN!==M.selectedRates]);var at=0;(0,r.useEffect)((()=>{var e;at=null===M.promo.response.percent_off||void 0===M.promo.response.percent_off?(0,k.HW)(M.selectedRates,se,M.count,M.promo.response.amount_off,"V",M.tip):(0,k.HW)(M.selectedRates,se,M.count,M.promo.response.percent_off,"P",M.tip)||0;const t=Ke?(0,k.bJ)(M.selectedRates,se,M.count)+parseFloat(Ke):(0,k.bJ)(M.selectedRates,se,M.count);let n=0;n=at>t?(at-t).toFixed(2):(t-at).toFixed(2);const r=(Number(n)+Number("uponCash"===M.tip?0:M.tip)).toFixed(2),i=null===(e=M.selectedRates)||void 0===e?void 0:e.custom_deposit_percentage,o=((Number(r)-Number("uponCash"===M.tip?0:M.tip))*i).toFixed(2);Ce({subtotal:Number(t),chargetoday:Number(o),total:Number(r)})}),[M.tip,M.selectedRates,se,M.count,M.promo,Ke]);var st=!1;const ct=()=>{var e,t;let n=b()(M.startDate);n=b()(n.subtract(null===(e=M.selectedGuide)||void 0===e?void 0:e.allowed_cancellation_days,"days")).format("MMM Do, YYYY");let r=b()(b()(M.startDate).subtract(null===(t=M.selectedGuide)||void 0===t?void 0:t.allowed_cancellation_days,"days")).format("YYYY-MM-DD");return{date:n,enable:b()(b()().format("YYYY-MM-DD")).isSameOrBefore(r)}},ut={clientSecret:De,appearance:{theme:"Minimal",rules:{".Input":{borderColor:"transparent"},".Input:focus":{borderColor:"transparent",boxShadow:"0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02)"},".Input--invalid":{color:"red",borderColor:"red",boxShadow:"0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02), 0 0 0 1px red"},".Error":{color:"red"}}}};return r.createElement(s.A,null,null!=M.selectedGuide?r.createElement(a.A,{lang:"en",title:"Book "+M.selectedGuide.guidename+" on Guidesly",description:"Schedule your trip with "+M.selectedGuide.guidename+" in the "+M.selectedGuide.city+" area.",schemaMarkup:g,isCDN:!0,image:"/"+(0,T.kb)(M.selectedGuide.guidepic)}):r.createElement(a.A,{lang:"en",title:"Book guides",schemaMarkup:g}),r.createElement("div",{className:E.TopContainer,style:M.loadingMask?{pointerEvents:"none"}:{minHeight:"100vh"}},M.loadingMask?r.createElement("div",null,r.createElement("img",{src:u.A,alt:"loading",className:d.Rhj})):null,r.createElement(_.A,null,r.createElement("div",{className:E.paymentContainer},r.createElement("div",{className:E.breadCrumb},r.createElement("span",{onClick:()=>(0,l.oo)("/search"),className:E.GuideList},"Guides "),">"," ",r.createElement("span",{onClick:()=>(()=>{const e=Z?""+(0,c.TT)(M.selectedGuide,x)+window.location.search:""+(0,c.TT)(M.selectedGuide,x)+R.search;(0,l.oo)(e)})(),className:E.guideUrl},(null!==(t=M.selectedGuide)&&void 0!==t&&t.show_title&&M.selectedGuide.title?M.selectedGuide.title:"")+" "+(null===(n=M.selectedGuide)||void 0===n?void 0:n.guidename)," ")," ",">"," Checkout"),r.createElement(w.A,{style:{justifyContent:"space-between"}},r.createElement(S.A,{xs:12,sm:12,md:6,lg:6,className:E.leftContainer},r.createElement(ue,{isMobile:Je,Styles:E,context:M,newRates:Se,setNewRates:Te,queryObj:$e,setQueryObj:Xe,searchParams:P,selectedMeetingPoint:et,setSelectedMeetingPoint:tt,setGuestError:_e}
2),r.createElement(de,{Styles:E,context:M,validatePhone:it,inCorrect:re,setIsValidEmail:ne,inValidPhone:X,consumerAddOn:qe,setAddonCheck:Ge,addOnCheck:Ve}),r.createElement(fe,{Styles:E,context:M,AddPromo:k.HW,addPerson:k.bJ,tip:Ee,setTip:we,handleRemove:rt,matesfee:se}),Je&&r.createElement(ge,{matesfee:se,activateBtn:st,newRates:Se,tripCal:Ae,addonAmt:Ke,consumerAddOn:qe,addOnCheck:Ve}),De&&r.createElement(F.Elements,{options:ut,stripe:y},r.createElement(me,{paymentStarted:oe,setPaymentStarted:ae,setLoadingMask:M.setLoadingMask,path:G.WEB_SITE+"/book-a-guide/booking-confirmation?trip_reserve_id="+(null==Ue?void 0:Ue.tripReserve)+"&booking_ref="+(null==Ue?void 0:Ue.book_ref),setErrorTitle:z,setErrorMsg:Q,setError:K,setPaymentType:Be,setPaymentInfo:We})),(null===(o=M.selectedGuide)||void 0===o?void 0:o.allowed_cancellation_days)&&ct().enable&&r.createElement("div",{className:E.information+" "+E.cancellationPolicy},r.createElement("p",{className:E.priceDetails},"Cancellation Policy"),r.createElement("p",null,r.createElement("b",null,"Free cancellation before ",ct().date,". "),null!==(p=M.selectedGuide)&&void 0!==p&&p.cancellation_text?null===(v=M.selectedGuide)||void 0===v?void 0:v.cancellation_text:"Cancel before this guide’s cancellation window to get a full refund."))),r.createElement(S.A,{xs:12,sm:12,md:5,lg:5,className:E.leftContainer},be?r.createElement("div",{className:E.errorContainer},r.createElement("div",null,"You have reached maximum limit of guests in the following trips.")):null,r.createElement("div",{className:E.AddSticky},Y?r.createElement("div",{className:E.errorContainer},H&&r.createElement("p",null,r.createElement("b",null,H)),r.createElement("div",null,W)):null,!Je&&r.createElement(ge,{matesfee:se,activateBtn:st,newRates:Se,paytype:Oe,tripCal:Ae,addonAmt:Ke,consumerAddOn:qe,addOnCheck:Ve}),De&&r.createElement(F.Elements,{stripe:y},r.createElement(ye,{processPaymentToken:async(e,t)=>{var n,r,i,o,a,s,u,d,f,p,v,g,m;M.setLoadingMask(!0);var y=null,_={};if(t&&(console.log("hascontext user date...",null==t?void 0:t.startDate),M=t,console.log("context user date...",null==t?void 0:t.startDate)),!M.startDate||!b()(M.startDate).isValid())return K(!0),M.setLoadingMask(!1),ae(!1),z("Invalid Date"),Q("Oops, there seems to be an issue with the booking. Kindly re-select date in order to proceed."),null;var E=0;E=null===M.promo.response.percent_off||void 0===M.promo.response.percent_off?(0,k.HW)(M.selectedRates,se,M.count,M.promo.response.amount_off,"V",M.tip):(0,k.HW)(M.selectedRates,se,M.count,M.promo.response.percent_off,"P",M.tip)||0;const w=null===(n=M.schrecords)||void 0===n||null===(r=n.ratecards)||void 0===r?void 0:r.filter((e=>{var t;return Number(e.id)===Number(null===(t=M.selectedRates)||void 0===t?void 0:t.guide_ratecard_id)})),S=null!=w&&null!==(i=w[0])&&void 0!==i&&i.waiver?null==w||null===(o=w[0])||void 0===o||null===(a=o.waiver)||void 0===a?void 0:a.id:null,I={guideguid:M.selectedGuide.guideguid,customerid:$,date:b()(new Date).format("YYYY-MM-DD"),tripdate:M.startDate,status:M.loadGuide?""+M.selectedGuide.status:null,typedescription:M.selectedTime+", "+Ae.total,starttime:b()(null===(s=M.selectedRates)||void 0===s?void 0:s.start_time,["HH:mm:ss"]).format("h:mm a"),triptype:null===(u=M.selectedRates)||void 0===u?void 0:u.rctriptype,promo_code:null!==(d=null===(f=M.promo)||void 0===f||null===(p=f.response)||void 0===p?void 0:p.code)&&void 0!==d?d:"",promo_amount:E,guidegear:!0,rateCardId:null===(v=M.selectedRates)||void 0===v?void 0:v.guide_ratecard_id,hourCardId:null===(g=M.selectedRates)||void 0===g?void 0:g.id,notes:M.notes,tripcost:Ae.total,trip_original_cost:Ae.subtotal,secondperson:M.count>1,secondfee:M.extraPerson,river1:M.selectedRiver1.riverid,river1name:M.selectedRiver1.rivername,river2:M.selectedRiver2.riverid,river2name:M.selectedRiver2.rivername,customer_firstname:M.firstname,customer_lastname:M.lastname,customer_phone:String(M.phone).replace(/\D+/g,"").slice(-10),customer_country_phone_code:"+"+(0,C.lq)(String(M.phone)).countryCallingCode,customer_country_iso_code:null===(m=(0,C.lq)(String(M.phone)))||void 0===m?void 0:m.country,customer_email:M.email,customer_zipcode:le,guestcount:M.count,mealguid:M.meal.guid,poiguid:(M.meetingPoint||{}).poiguid,meal:M.meal.name,meetingPoint:(M.meetingPoint||{}).name,guide_addon_fees:(()=>{let e=[];
2if(Object.keys(se).length>0){let t=se;return t.charge_price=(0,k.G4)(M.selectedRates,se,M.count),e.push(t),e}return e})(),tip_amount:M.tip&&"uponCash"!==M.tip?Number(M.tip).toFixed(2):0,cash_tip_upon_trip:M.tip&&"uponCash"===M.tip,tip_type:""!=M.tipType?M.tipType:null,need_guide_equipment:M.checkbox2||!1,is_full_payment:"full"===Oe,waiver_id:S},N={device:(0,J.ZQ)(),deviceVersion:Ie,deviceFamily:Je?"Mobile":"Web",userLocation:V.geoLocation?V.geoLocation:null};_.charge_amount="full"===Oe?Ae.total:Ae.chargetoday,_.trip=I,_.tip_amount=M.tip&&"uponCash"!==M.tip?Number(M.tip).toFixed(2):0,_.cash_tip_upon_trip=M.tip&&"uponCash"===M.tip,_.deviceData=N,_.trip.consumer_add_on=Ve&&Object.keys(Ve).filter((e=>Ve[e])),_.trip.consumer_addon_charge=parseFloat(Ke);let A={pi_id:Pe,pi_client_secret:De};["cards","apple_pay","google_pay"].includes(null==je?void 0:je.type)||(A={...A,payment_method_types:[je.type]}),_.paymentIntent={...A};const D=(0,T.HW)().token;try{var R,P,L=await h().put("v2/payment/trip_payment_reserve",_,{headers:{Authorization:"Bearer "+D}});const t={tripReserve:null===(R=L.data)||void 0===R?void 0:R.trip_payment_reserve_guid,book_ref:null===(P=L.data)||void 0===P?void 0:P.booking_ref};Fe(t),y=t,"apple_pay"!=e&&"google_pay"!=e&&"apple_google_pay"!=e&&ae(!0),j=L.data,O.$s("booking_confirmation",j)}catch(B){if(M.setLoadingMask(!1),B.response){var U,F;if(401===B.response.status&&(window.localStorage.clear(),z("ERROR"),Q("Auth Error: Token Expired. Try Logging in Again"),setTimeout((()=>{(0,l.oo)((0,c.TT)(M.selectedGuide,x))}),5e3)),500===B.response.status)ae(!1),K(!0),null!=B.response.data&&null!=B.response.data&&"22P02"===(null===(U=B.response.data.error)||void 0===U?void 0:U.code)||void 0===(null===(F=B.response.data.error)||void 0===F?void 0:F.decline_code)?(z("There was a problem"),Q("Something went wrong! If this happens again, kindly contact our customer support to assist you.")):(z(""+B.response.data.error.code),Q(B.response.data.error.decline_code));422===B.response.status&&(ae(!1),K(!0),z(""+B.response.data.code),Q(B.response.data.message))}}var j;return y},activateBtn:st,stylename:E.confirmButton,tripCal:Ae,paytype:Oe,clientSecret:De,setError:K,setErrorMsg:Q,setErrorTitle:z,userContext:B,isValidEmail:te,inCorrect:re,setIsGuestLogin:ve,paymentType:je,path:G.WEB_SITE+"/book-a-guide/booking-confirmation",guestError:be,paymentInfo:ze,setPaymentInfo:We})),r.createElement("p",{className:E.checkboxLabel},"By selecting the button above, I agree to the ",r.createElement("span",null,"Guide’s cancellation policy,")," ",r.createElement(l.N_,{to:"/terms-of-service"},"Guidesly’s Terms of Service")," and I acknowledge the ",r.createElement(l.N_,{to:"/privacy-policy"},"privacy policy"),"."))))))))},_e=n(37458),Ee=n(14270);var we=e=>{let{filename:t,setOpen:n,urls:i}=e;const o=(0,r.useRef)();(0,r.useEffect)((()=>(document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)})),[]);const a=e=>{o.current.contains(e.target)||n(!1)};return r.createElement("div",{className:"cL_6T",onClick:()=>{n(!1)},role:"presentation",ref:o},r.createElement(l.N_,{to:i.ics,download:!1,target:"_blank"},"Apple Calendar"),r.createElement(l.N_,{to:i.google,target:"_blank"},"Google"),r.createElement(l.N_,{to:i.ics,download:!1,target:"_blank"},"Outlook"),r.createElement(l.N_,{to:i.yahoo,target:"_blank"},"Yahoo"))};const Se=e=>{const t=Math.floor((+new Date(e.endsAt)-+new Date(e.startsAt))/60/1e3);return""+("0"+Math.floor(t/60)).slice(-2)+("0"+t%60).slice(-2)},Te=e=>e&&new Date(e).toISOString().replace(/[-:]|\.\d{3}/g,""),Ie=(e,t)=>Object.keys(t).reduce(((e,n,r)=>{const i=t[n];return null!==i?e+(0===r?"?":"&")+n+"="+encodeURIComponent(i):e}),e),Ne=e=>Ie("https://calendar.google.com/calendar/render",{action:"TEMPLATE",dates:Te(e.startsAt)+"/"+Te(e.endsAt),location:e.location,text:e.name,details:e.details}),Ae=e=>Ie("https://outlook.live.com/owa",{rru:"addevent",startdt:e.startsAt,enddt:e.endsAt,subject:e.name,location:e.location,body:e.details,allday:!1,uid:(new Date).getTime().toString(),path:"/calendar/view/Month"}),Ce=e=>Ie("https://calendar.yahoo.com",{v:60,view:"d",type:20,title:e.name,st:Te(e.startsAt),dur:Se(e),desc:e.details,in_loc:e.location}),Oe=e=>{const t=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT"];return"undefined"!=typeof document&&t.push("URL:"+document.URL),t.push("DTSTART:"+Te(e.startsAt),"DTEND:"+Te(e.endsAt),"SUMMARY:"+e.name,"DESCRIPTION:"+e.details,"LOCATION:"+e.location,"END:VEVENT","END:VCALENDAR"),encodeURI("data:text/calendar;charset=utf8,"+t.join("\n"))};var ke,De,Re=e=>{let{event:t,filename:n="download"}=e;const{0:i,1:o}=(0,r.useState)(!1),a=(0,r.useMemo)((()=>(e=>
2e?{google:Ne(e),outlook:Ae(e),yahoo:Ce(e),ics:Oe(e)}:{})(t)),[t]);return r.createElement("div",{className:"cL_bSs"},t&&r.createElement("button",{type:"button",className:"cL_bSt",onClick:()=>{o(!i)}},r.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 1024 1024"},r.createElement("path",{d:"M704 192v-64h-32v64h-320v-64h-32v64h-192v704h768v-704h-192z M864 864h-704v-480h704v480z M864 352h-704v-128h160v64h32v-64h320v64h32v-64h160v128z"}))," ","Add to My Calendar"),i&&r.createElement(we,{filename:n,setOpen:o,urls:a}))},Pe=n(88319),xe=n(15215),Me=n(64988),Le=n(34549),Ue=n(35166),Fe=n(37070),je=n(28117),Be=n(74786),Ve=n(88835),Ge=n(68414),qe=n(48287),Ye=n(78868),Ke=n(71805),He=n(766),ze=n(17467),We=n(13385),Je=n(86951),Qe=n(99443),Ze=new Le.C("AbstractPubSubProvider"),$e=function(){function e(e){this._config=e}return e.prototype.configure=function(e){return this._config=(0,xe.__assign)((0,xe.__assign)({},e),this._config),Ze.debug("configure "+this.getProviderName(),this._config),this.options},e.prototype.getCategory=function(){return"PubSub"},Object.defineProperty(e.prototype,"options",{get:function(){return(0,xe.__assign)({},this._config)},enumerable:!0,configurable:!0}),e}();!function(e){e.CONNECTION_CLOSED="Connection closed",e.CONNECTION_FAILED="Connection failed",e.REALTIME_SUBSCRIPTION_INIT_ERROR="AppSync Realtime subscription init error",e.SUBSCRIPTION_ACK="Subscription ack",e.TIMEOUT_DISCONNECT="Timeout disconnect"}(ke||(ke={})),function(e){e.Connected="Connected",e.ConnectedPendingNetwork="ConnectedPendingNetwork",e.ConnectionDisrupted="ConnectionDisrupted",e.ConnectionDisruptedPendingNetwork="ConnectionDisruptedPendingNetwork",e.Connecting="Connecting",e.ConnectedPendingDisconnect="ConnectedPendingDisconnect",e.Disconnected="Disconnected",e.ConnectedPendingKeepAlive="ConnectedPendingKeepAlive"}(De||(De={}));var Xe,et,tt,nt=[400,401,403],rt="ConnectionStateChange";!function(e){e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_START="start",e.GQL_START_ACK="start_ack",e.GQL_DATA="data",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_STOP="stop",e.GQL_COMPLETE="complete",e.GQL_ERROR="error"}(Xe||(Xe={})),function(e){e[e.PENDING=0]="PENDING",e[e.CONNECTED=1]="CONNECTED",e[e.FAILED=2]="FAILED"}(et||(et={})),function(e){e[e.CLOSED=0]="CLOSED",e[e.READY=1]="READY",e[e.CONNECTING=2]="CONNECTING"}(tt||(tt={}));var it,ot="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",at={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},st=3e5,ct=n(2917),ut=function(){return(new ct.A).networkMonitor()},lt={KEEP_ALIVE_MISSED:{keepAliveState:"unhealthy"},KEEP_ALIVE:{keepAliveState:"healthy"},CONNECTION_ESTABLISHED:{connectionState:"connected"},CONNECTION_FAILED:{intendedConnectionState:"disconnected",connectionState:"disconnected"},CLOSING_CONNECTION:{intendedConnectionState:"disconnected"},OPENING_CONNECTION:{intendedConnectionState:"connected",connectionState:"connecting"},CLOSED:{connectionState:"disconnected"},ONLINE:{networkState:"connected"},OFFLINE:{networkState:"disconnected"}},dt=function(){function e(){var e=this;this._networkMonitoringSubscription=void 0,this._linkedConnectionState={networkState:"connected",connectionState:"disconnected",intendedConnectionState:"disconnected",keepAliveState:"healthy"},this._initialNetworkStateSubscription=ut().subscribe((function(t){var n,r=t.online;e.record(r?lt.ONLINE:lt.OFFLINE),null===(n=e._initialNetworkStateSubscription)||void 0===n||n.unsubscribe()})),this._linkedConnectionStateObservable=new je.default((function(t){t.next(e._linkedConnectionState),e._linkedConnectionStateObserver=t}))}return e.prototype.enableNetworkMonitoring=function(){var e,t=this;null===(e=this._initialNetworkStateSubscription)||void 0===e||e.unsubscribe(),void 0===this._networkMonitoringSubscription&&(this._networkMonitoringSubscription=ut().subscribe((function(e){var n=e.online;t.record(n?lt.ONLINE:lt.OFFLINE)})))},e.prototype.disableNetworkMonitoring=function(){var e;null===(e=this._networkMonitoringSubscription)||void 0===e||e.unsubscribe(),this._networkMonitoringSubscription=void 0},Object.defineProperty(e.prototype,"connectionStateObservable",{get:function(){var e,t=this;return this._linkedConnectionStateObservable.map((function(e){return t.connectionStatesTranslator(e)})).filter((function(t){var n=t!==e;return e=t,n}))},enumerable:!0,configurable:!0}),e.prototype.record=function(e){"connected"===e.intendedConnectionState?this.enableNetworkMonitoring():"disconnected"===e.intendedConnectionState&&this.disableNetworkMonitoring();var t=(0,xe.__assign)((0,xe.__assign)({},this._linkedConnectionState),e);this._linkedConnectionState=(0,xe.__assign)({},t),this._linkedConnectionStateObserver.next(this._linkedConnectionState)},e.prototype.connectionStatesTranslator=function(e){var t=e.connectionState,n=e.networkState,r=e.intendedConnectionState,i=e.keepAliveState;return"connected"===t&&"disconnected"===n?De.ConnectedPendingNetwork:"c
2onnected"===t&&"disconnected"===r?De.ConnectedPendingDisconnect:"disconnected"===t&&"connected"===r&&"disconnected"===n?De.ConnectionDisruptedPendingNetwork:"disconnected"===t&&"connected"===r?De.ConnectionDisrupted:"connected"===t&&"unhealthy"===i?De.ConnectedPendingKeepAlive:"connecting"===t?De.Connecting:"disconnected"===t?De.Disconnected:De.Connected},e}();!function(e){e.START_RECONNECT="START_RECONNECT",e.HALT_RECONNECT="HALT_RECONNECT"}(it||(it={}));var ft=function(){function e(){this.reconnectObservers=[]}return e.prototype.addObserver=function(e){this.reconnectObservers.push(e)},e.prototype.record=function(e){var t=this;e===it.START_RECONNECT&&void 0===this.reconnectSetTimeoutId&&void 0===this.reconnectIntervalId&&(this.reconnectSetTimeoutId=setTimeout((function(){t._triggerReconnect(),t.reconnectIntervalId=setInterval((function(){t._triggerReconnect()}),6e4)}),5e3)),e===it.HALT_RECONNECT&&(this.reconnectIntervalId&&(clearInterval(this.reconnectIntervalId),this.reconnectIntervalId=void 0),this.reconnectSetTimeoutId&&(clearTimeout(this.reconnectSetTimeoutId),this.reconnectSetTimeoutId=void 0))},e.prototype.close=function(){this.reconnectObservers.forEach((function(e){var t;null===(t=e.complete)||void 0===t||t.call(e)}))},e.prototype._triggerReconnect=function(){this.reconnectObservers.forEach((function(e){var t;null===(t=e.next)||void 0===t||t.call(e)}))},e}(),pt=new Le.C("AWSAppSyncRealTimeProvider"),ht=function(e,t,n){Ye.Y.dispatch("api",{event:e,data:t,message:n},"PubSub",ot)},vt=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com(?:\.cn)?\/graphql$/i,gt=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n.socketStatus=tt.CLOSED,n.keepAliveTimeout=st,n.subscriptionObserverMap=new Map,n.promiseArray=[],n.connectionStateMonitor=new dt,n.reconnectionMonitor=new ft,n.connectionStateMonitorSubscription=n.connectionStateMonitor.connectionStateObservable.subscribe((function(e){ht(rt,{provider:n,connectionState:e},"Connection state is "+e),n.connectionState=e,e===De.ConnectionDisrupted&&n.reconnectionMonitor.record(it.START_RECONNECT),[De.Connected,De.ConnectedPendingDisconnect,De.ConnectedPendingKeepAlive,De.ConnectedPendingNetwork,De.ConnectionDisruptedPendingNetwork,De.Disconnected].includes(e)&&n.reconnectionMonitor.record(it.HALT_RECONNECT)})),n}return(0,xe.__extends)(t,e),t.prototype.close=function(){this.socketStatus=tt.CLOSED,this.connectionStateMonitor.record(lt.CONNECTION_FAILED),this.connectionStateMonitorSubscription.unsubscribe(),this.reconnectionMonitor.close()},t.prototype.getNewWebSocket=function(e,t){return new WebSocket(e,t)},t.prototype.getProviderName=function(){return"AWSAppSyncRealTimeProvider"},t.prototype.newClient=function(){throw new Error("Not used here")},t.prototype.publish=function(e,t,n){return(0,xe.__awaiter)(this,void 0,void 0,(function(){return(0,xe.__generator)(this,(function(e){throw new Error("Operation not supported")}))}))},t.prototype.isCustomDomain=function(e){return null===e.match(vt)},t.prototype.subscribe=function(e,t,n){var r=this,i=null==t?void 0:t.appSyncGraphqlEndpoint;return new je.default((function(e){if(t&&i){var o,a=!1,s=(0,Ge.v4)(),c=function(){a||(a=!0,r._startSubscriptionWithAWSAppSyncRealTime({options:t,observer:e,subscriptionId:s,customUserAgentDetails:n}).catch((function(e){pt.debug(ke.REALTIME_SUBSCRIPTION_INIT_ERROR+": "+e),r.connectionStateMonitor.record(lt.CLOSED)})).finally((function(){a=!1})))};return o=new je.default((function(e){r.reconnectionMonitor.addObserver(e)})).subscribe((function(){c()})),c(),function(){return(0,xe.__awaiter)(r,void 0,void 0,(function(){var e,t;return(0,xe.__generator)(this,(function(n){switch(n.label){case 0:null==o||o.unsubscribe(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this._waitForSubscriptionToBeConnected(s)];case 2:if(n.sent(),!(e=(this.subscriptionObserverMap.get(s)||{}).subscriptionState))return[2];if(e!==et.CONNECTED)throw new Error("Subscription never connected");return this._sendUnsubscriptionMessage(s),[3,5];case 3:return t=n.sent(),pt.debug("Error while unsubscribing "+t),[3,5];case 4:return this._removeSubscriptionObserver(s),[7];case 5:return[2]}}
2))}))}}e.error({errors:[(0,xe.__assign)({},new Be.e("Subscribe only available for AWS AppSync endpoint"))]}),e.complete()}))},Object.defineProperty(t.prototype,"isSSLEnabled",{get:function(){return!this.options.aws_appsync_dangerously_connect_to_http_endpoint_for_testing},enumerable:!0,configurable:!0}),t.prototype._startSubscriptionWithAWSAppSyncRealTime=function(e){var t,n=e.options,r=e.observer,i=e.subscriptionId,o=e.customUserAgentDetails;return(0,xe.__awaiter)(this,void 0,void 0,(function(){var e,a,s,c,u,l,d,f,p,h,v,g,m,y,b,_,E,w,S,T,I,N,A,C=this;return(0,xe.__generator)(this,(function(O){switch(O.label){case 0:return e=n.appSyncGraphqlEndpoint,a=n.authenticationType,s=n.query,c=n.variables,u=n.apiKey,l=n.region,d=n.graphql_headers,f=void 0===d?function(){return{}}:d,p=n.additionalHeaders,h=void 0===p?{}:p,v=et.PENDING,g={query:s,variables:c},this.subscriptionObserverMap.set(i,{observer:r,query:null!=s?s:"",variables:null!=c?c:{},subscriptionState:v,startAckTimeoutId:void 0}),m=JSON.stringify(g),b=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:u,appSyncGraphqlEndpoint:e,authenticationType:a,payload:m,canonicalUri:"",region:l,additionalHeaders:h})];case 1:return _=[xe.__assign.apply(void 0,b.concat([O.sent()]))],[4,f()];case 2:y=xe.__assign.apply(void 0,[xe.__assign.apply(void 0,[xe.__assign.apply(void 0,_.concat([O.sent()])),h]),(A={},A[Ue.Y]=(0,Ke.fE)(o),A)]),E={id:i,payload:{data:m,extensions:{authorization:(0,xe.__assign)({},y)}},type:Xe.GQL_START},w=JSON.stringify(E),O.label=3;case 3:return O.trys.push([3,5,,6]),this.connectionStateMonitor.record(lt.OPENING_CONNECTION),[4,this._initializeWebSocketConnection({apiKey:u,appSyncGraphqlEndpoint:e,authenticationType:a,region:l,additionalHeaders:h})];case 4:return O.sent(),[3,6];case 5:return S=O.sent(),this._logStartSubscriptionError(i,r,S),[2];case 6:return T=null!==(t=this.subscriptionObserverMap.get(i))&&void 0!==t?t:{},I=T.subscriptionFailedCallback,N=T.subscriptionReadyCallback,this.subscriptionObserverMap.set(i,{observer:r,subscriptionState:v,query:null!=s?s:"",variables:null!=c?c:{},subscriptionReadyCallback:N,subscriptionFailedCallback:I,startAckTimeoutId:setTimeout((function(){C._timeoutStartSubscriptionAck.call(C,i)}),15e3)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(w),[2]}}))}))},t.prototype._logStartSubscriptionError=function(e,t,n){var r;pt.debug({err:n});var i=String(null!==(r=n.message)&&void 0!==r?r:"");if(Promise.resolve(this.connectionStateMonitor.record(lt.CLOSED)),this.connectionState!==De.ConnectionDisruptedPendingNetwork){(0,He.gD)(n)?t.error({errors:[(0,xe.__assign)({},new Be.e(ke.CONNECTION_FAILED+": "+i))]}):pt.debug(ke.CONNECTION_FAILED+": "+i);var o=(this.subscriptionObserverMap.get(e)||{}).subscriptionFailedCallback;"function"==typeof o&&o()}},t.prototype._waitForSubscriptionToBeConnected=function(e){return(0,xe.__awaiter)(this,void 0,void 0,(function(){var t,n=this;return(0,xe.__generator)(this,(function(r){return(t=this.subscriptionObserverMap.get(e))&&t.subscriptionState===et.PENDING?[2,new Promise((function(r,i){var o=t.observer,a=t.subscriptionState,s=t.variables,c=t.query;n.subscriptionObserverMap.set(e,{observer:o,subscriptionState:a,variables:s,query:c,subscriptionReadyCallback:r,subscriptionFailedCallback:i})}))]:[2]}))}))},t.prototype._sendUnsubscriptionMessage=function(e){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===tt.READY){var t={id:e,type:Xe.GQL_STOP},n=JSON.stringify(t);this.awsRealTimeSocket.send(n)}}catch(r){pt.debug({err:r})}},t.prototype._removeSubscriptionObserver=function(e){this.subscriptionObserverMap.delete(e),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},t.prototype._closeSocketIfRequired=function(){if(!(this.subscriptionObserverMap.size>0))if(this.awsRealTimeSocket)if(this.connectionStateMonitor.record(lt.CLOSING_CONNECTION),this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{pt.debug("closing WebSocket..."),this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId);var e=this.awsRealTimeSocket;e.onclose=null,e.onerror=null,e.close(1e3),this.awsRealTimeSocket=void 0,this.socketStatus=tt.CLOSED,this.connectionStateMonitor.record(lt.CLOSED)}else this.socketStatus=tt.CLOSED},t.prototype._handleIncomingSubscriptionMessage=function(e){var t=this;if("string"==typeof e.data){pt.debug("subscription message from AWS AppSync RealTime: "+e.data);
2var n=JSON.parse(String(e.data)),r=n.id,i=void 0===r?"":r,o=n.payload,a=n.type,s=this.subscriptionObserverMap.get(i)||{},c=s.observer,u=void 0===c?null:c,l=s.query,d=void 0===l?"":l,f=s.variables,p=void 0===f?{}:f,h=s.startAckTimeoutId,v=s.subscriptionReadyCallback,g=s.subscriptionFailedCallback;if(pt.debug({id:i,observer:u,query:d,variables:p}),a===Xe.GQL_DATA&&o&&o.data)u?u.next(o):pt.debug("observer not found for id: "+i);else{if(a===Xe.GQL_START_ACK){pt.debug("subscription ready for "+JSON.stringify({query:d,variables:p})),"function"==typeof v&&v(),h&&clearTimeout(h),ht(ke.SUBSCRIPTION_ACK,{query:d,variables:p},"Connection established for subscription");var m=et.CONNECTED;return u&&this.subscriptionObserverMap.set(i,{observer:u,query:d,variables:p,startAckTimeoutId:void 0,subscriptionState:m,subscriptionReadyCallback:v,subscriptionFailedCallback:g}),void this.connectionStateMonitor.record(lt.CONNECTION_ESTABLISHED)}if(a===Xe.GQL_CONNECTION_KEEP_ALIVE)return this.keepAliveTimeoutId&&clearTimeout(this.keepAliveTimeoutId),this.keepAliveAlertTimeoutId&&clearTimeout(this.keepAliveAlertTimeoutId),this.keepAliveTimeoutId=setTimeout((function(){return t._errorDisconnect(ke.TIMEOUT_DISCONNECT)}),this.keepAliveTimeout),this.keepAliveAlertTimeoutId=setTimeout((function(){t.connectionStateMonitor.record(lt.KEEP_ALIVE_MISSED)}),65e3),void this.connectionStateMonitor.record(lt.KEEP_ALIVE);if(a===Xe.GQL_ERROR){m=et.FAILED;u&&(this.subscriptionObserverMap.set(i,{observer:u,query:d,variables:p,startAckTimeoutId:h,subscriptionReadyCallback:v,subscriptionFailedCallback:g,subscriptionState:m}),pt.debug(ke.CONNECTION_FAILED+": "+JSON.stringify(o)),u.error({errors:[(0,xe.__assign)({},new Be.e(ke.CONNECTION_FAILED+": "+JSON.stringify(o)))]}),h&&clearTimeout(h),"function"==typeof g&&g())}}}},t.prototype._errorDisconnect=function(e){pt.debug("Disconnect error: "+e),this.awsRealTimeSocket&&(this.connectionStateMonitor.record(lt.CLOSED),this.awsRealTimeSocket.close()),this.socketStatus=tt.CLOSED},t.prototype._timeoutStartSubscriptionAck=function(e){var t=this.subscriptionObserverMap.get(e);if(t){var n=t.observer,r=t.query,i=t.variables;if(!n)return;this.subscriptionObserverMap.set(e,{observer:n,query:r,variables:i,subscriptionState:et.FAILED}),this.connectionStateMonitor.record(lt.CLOSED),pt.debug("timeoutStartSubscription",JSON.stringify({query:r,variables:i}))}},t.prototype._initializeWebSocketConnection=function(e){var t=this,n=e.appSyncGraphqlEndpoint,r=e.authenticationType,i=e.apiKey,o=e.region,a=e.additionalHeaders;if(this.socketStatus!==tt.READY)return new Promise((function(e,s){return(0,xe.__awaiter)(t,void 0,void 0,(function(){var t,c,u,l,d,f,p,h,v;return(0,xe.__generator)(this,(function(g){switch(g.label){case 0:if(this.promiseArray.push({res:e,rej:s}),this.socketStatus!==tt.CLOSED)return[3,5];g.label=1;case 1:return g.trys.push([1,4,,5]),this.socketStatus=tt.CONNECTING,t="{}",[4,this._awsRealTimeHeaderBasedAuth({authenticationType:r,payload:t,canonicalUri:"/connect",apiKey:i,appSyncGraphqlEndpoint:n,region:o,additionalHeaders:a})];case 2:return c=g.sent(),u=c?JSON.stringify(c):"",l=qe.Buffer.from(u).toString("base64"),d=qe.Buffer.from(t).toString("base64"),f=null!=n?n:"",f=this.isCustomDomain(f)?f.concat("/realtime"):f.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta"),p=this.isSSLEnabled?"wss://":"ws://",f=f.replace("https://",p).replace("http://",p),h=f+"?header="+l+"&payload="+d,[4,this._initializeRetryableHandshake(h)];case 3:return g.sent(),this.promiseArray.forEach((function(e){var t=e.res;pt.debug("Notifying connection successful"),t()})),this.socketStatus=tt.READY,this.promiseArray=[],[3,5];case 4:return v=g.sent(),pt.debug("Connection exited with",v),this.promiseArray.forEach((function(e){return(0,e.rej)(v)})),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=void 0,this.socketStatus=tt.CLOSED,[3,5];case 5:return[2]}}
2))}))}))},t.prototype._initializeRetryableHandshake=function(e){return(0,xe.__awaiter)(this,void 0,void 0,(function(){return(0,xe.__generator)(this,(function(t){switch(t.label){case 0:return pt.debug("Initializaling retryable Handshake"),[4,(0,He.hu)(this._initializeHandshake.bind(this),[e],5e3)];case 1:return t.sent(),[2]}}))}))},t.prototype._initializeHandshake=function(e){return(0,xe.__awaiter)(this,void 0,void 0,(function(){var t,n,r,i,o=this;return(0,xe.__generator)(this,(function(a){switch(a.label){case 0:pt.debug("Initializing handshake "+e),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,new Promise((function(t,n){var r=o.getNewWebSocket(e,"graphql-ws");r.onerror=function(){pt.debug("WebSocket connection error")},r.onclose=function(){n(new Error("Connection handshake error"))},r.onopen=function(){return o.awsRealTimeSocket=r,t()}}))];case 2:return a.sent(),[4,new Promise((function(e,t){if(o.awsRealTimeSocket){var n=!1;o.awsRealTimeSocket.onerror=function(e){pt.debug("WebSocket error "+JSON.stringify(e))},o.awsRealTimeSocket.onclose=function(e){pt.debug("WebSocket closed "+e.reason),t(new Error(JSON.stringify(e)))},o.awsRealTimeSocket.onmessage=function(r){if("string"==typeof r.data){pt.debug("subscription message from AWS AppSyncRealTime: "+r.data+" ");var i=JSON.parse(r.data),a=i.type,s=i.payload,c=(void 0===s?{}:s).connectionTimeoutMs,u=void 0===c?st:c;if(a===Xe.GQL_CONNECTION_ACK)return n=!0,o.awsRealTimeSocket&&(o.keepAliveTimeout=u,o.awsRealTimeSocket.onmessage=o._handleIncomingSubscriptionMessage.bind(o),o.awsRealTimeSocket.onerror=function(e){pt.debug(e),o._errorDisconnect(ke.CONNECTION_CLOSED)},o.awsRealTimeSocket.onclose=function(e){pt.debug("WebSocket closed "+e.reason),o._errorDisconnect(ke.CONNECTION_CLOSED)}),void e("Cool, connected to AWS AppSyncRealTime");if(a===Xe.GQL_CONNECTION_ERROR){var l=i.payload,d=(void 0===l?{}:l).errors,f=(0,xe.__read)(void 0===d?[]:d,1)[0],p=void 0===f?{}:f,h=p.errorType,v=void 0===h?"":h,g=p.errorCode;t({errorType:v,errorCode:void 0===g?0:g})}}};var r={type:Xe.GQL_CONNECTION_INIT};o.awsRealTimeSocket.send(JSON.stringify(r)),setTimeout((function(){n||(o.connectionStateMonitor.record(lt.CONNECTION_FAILED),t(new Error("Connection timeout: ack from AWSAppSyncRealTime was not received after 15000 ms")))}),15e3)}}))];case 3:return a.sent(),[3,5];case 4:throw t=a.sent(),r=(n=t).errorType,i=n.errorCode,nt.includes(i)?new He.OI(r):r?new Error(r):t;case 5:return[2]}}
2))}))},t.prototype._awsRealTimeHeaderBasedAuth=function(e){var t=e.authenticationType,n=e.payload,r=e.canonicalUri,i=e.appSyncGraphqlEndpoint,o=e.apiKey,a=e.region,s=e.additionalHeaders;return(0,xe.__awaiter)(this,void 0,void 0,(function(){var e,c,u;return(0,xe.__generator)(this,(function(l){switch(l.label){case 0:return e={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeOPENIDHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeCUPHeader.bind(this),AWS_LAMBDA:this._customAuthHeader},t&&e[t]?[3,1]:(pt.debug("Authentication type "+t+" not supported"),[2,void 0]);case 1:return c=e[t],u=Ve.parse(null!=i?i:"").host,pt.debug("Authenticating with "+t),[4,c({payload:n,canonicalUri:r,appSyncGraphqlEndpoint:i,apiKey:o,region:a,host:u,additionalHeaders:s})];case 2:return[2,l.sent()]}}))}))},t.prototype._awsRealTimeCUPHeader=function(e){var t=e.host;return(0,xe.__awaiter)(this,void 0,void 0,(function(){return(0,xe.__generator)(this,(function(e){switch(e.label){case 0:return[4,Qe.N.currentSession()];case 1:return[2,{Authorization:e.sent().getAccessToken().getJwtToken(),host:t}]}}))}))},t.prototype._awsRealTimeOPENIDHeader=function(e){var t=e.host;return(0,xe.__awaiter)(this,void 0,void 0,(function(){var e,n,r;return(0,xe.__generator)(this,(function(i){switch(i.label){case 0:return[4,Je.Y.getItem("federatedInfo")];case 1:return(n=i.sent())?(e=n.token,[3,4]):[3,2];case 2:return[4,Qe.N.currentAuthenticatedUser()];case 3:(r=i.sent())&&(e=r.token),i.label=4;case 4:if(!e)throw new Error("No federated jwt");return[2,{Authorization:e,host:t}]}}))}))},t.prototype._awsRealTimeApiKeyHeader=function(e){var t=e.apiKey,n=e.host;return(0,xe.__awaiter)(this,void 0,void 0,(function(){var e,r;return(0,xe.__generator)(this,(function(i){return e=new Date,r=e.toISOString().replace(/[:\-]|\.\d{3}/g,""),[2,{host:n,"x-amz-date":r,"x-api-key":t}]}))}))},t.prototype._awsRealTimeIAMHeader=function(e){var t=e.payload,n=e.canonicalUri,r=e.appSyncGraphqlEndpoint,i=e.region;return(0,xe.__awaiter)(this,void 0,void 0,(function(){var e,o,a;return(0,xe.__generator)(this,(function(s){switch(s.label){case 0:return e={region:i,service:"appsync"},[4,this._ensureCredentials()];case 1:if(!s.sent())throw new Error("No credentials");return[4,ze.J.get().then((function(e){var t=e;return{secret_key:t.secretAccessKey,access_key:t.accessKeyId,session_token:t.sessionToken}}))];case 2:return o=s.sent(),a={url:""+r+n,data:t,method:"POST",headers:(0,xe.__assign)({},at)},[2,We.l.sign(a,o,e).headers]}}))}))},t.prototype._customAuthHeader=function(e){var t=e.host,n=e.additionalHeaders;if(!n||!n.Authorization)throw new Error("No auth token specified");return{Authorization:n.Authorization,host:t}},t.prototype._ensureCredentials=function(){return ze.J.get().then((function(e){if(!e)return!1;var t=ze.J.shear(e);return pt.debug("set credentials for AWSAppSyncRealTimeProvider",t),!0})).catch((function(e){return pt.warn("ensure credentials error",e),!1}))},t}($e),mt=(0,Me.gy)().isNode,yt=new Le.C("PubSub"),bt=function(){function e(e){this._options=null!=e?e:{},yt.debug("PubSub Options",this._options),this._pluggables=[],this.subscribe=this.subscribe.bind(this)}return Object.defineProperty(e.prototype,"awsAppSyncRealTimeProvider",{get:function(){return this._awsAppSyncRealTimeProvider||(this._awsAppSyncRealTimeProvider=new gt(this._options)),this._awsAppSyncRealTimeProvider},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"InternalPubSub"},e.prototype.configure=function(e){var t=this,n=e?e.PubSub||e:{};return yt.debug("configure PubSub",{opt:n}),this._options=Object.assign({},this._options,n),this._pluggables.map((function(e){return e.configure(t._options)})),this._options},e.prototype.addPluggable=function(e){return(0,xe.__awaiter)(this,void 0,void 0,(function(){return(0,xe.__generator)(this,(function(t){return e&&"PubSub"===e.getCategory()?(this._pluggables.push(e),[2,e.configure(this._options)]):[2]}))}))},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.getProviderByName=function(e){return e===Ue.b?this.awsAppSyncRealTimeProvider:this._pluggables.find((function(t){return t.getProviderName()===e}))},e.prototype.getProviders=function(e){void 0===e&&(e={});var t=e.provider;if(!t)return this._pluggables;var n=this.getProviderByName(t);if(!n)throw new Error("Could not find provider named "+String(t));return[n]},e.prototype.publish=function(e,t,n){return(0,xe.__awaiter)(this,void 0,void 0,(function(){return(0,xe.__generator)(this,(function(r){return[2,Promise.all(this.getProviders(n).map((function(r){return r.publish(e,t,n)})))]}))}))},e.prototype.subscribe=function(e,t,n){if(mt&&this._options&&this._options.ssr)throw new Error("Subscriptions are not supported for Server-Side Rendering (SSR)");yt.debug("subscribe options",t);var r=this.getProviders(t),i=(0,xe.__assign)({category:Fe.b7.PubSub,action:Fe.Mv.Subscribe},n);return new je.default((function(n){var o=r.map((function(n){return{provider:n,observable:n.subscribe(e,t,i)}})).map((function(e){var t=e.provider;return e.observable.subscribe({start:console.error,next:function(e){return n.next({provider:t,value:e})},error:function(e){return n.error({provider:t,error:e})}})}));return function(){return o.forEach((function(e){return e.unsubscribe()}))}}))},e}(),_t=new bt;Pe.H.register(_t);var Et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,xe.__extends)(t,e),t.prototype.getModuleName=function(){return"PubSub"},t.prototype.subscribe=function(t,n){return e.prototype.subscribe.call(this,t,n)},t}
2(bt),wt=new Et;Pe.H.register(wt);var St=n(30888);Pe.H.configure({Auth:{identityPoolId:G.AWS_IDENTITYPOOLID,region:G.AWS_REGION,userPoolId:G.AWS_USERPOOLID,userPoolWebClientId:G.AWS_WEBCLIENTID}}),Pe.H.addPluggable(new St.BD({aws_pubsub_region:G.AWS_REGION,aws_pubsub_endpoint:"wss://"+G.AWS_IOT_ENDPOINT+"/mqtt"}));var Tt=e=>{let{pID:t,bookingID:n,getBookingDetails:i}=e;const{0:o,1:a}=(0,r.useState)(null);let s=De;return(0,r.useEffect)((()=>{const e="BookingConfirmation_"+t,r=wt.subscribe(e).subscribe({next:e=>{a(null==e?void 0:e.value)},error:e=>console.error(e,"err"),complete:()=>console.log("Done")});return Ye.Y.listen("pubsub",(e=>{const{payload:t}=e;t.event===rt&&(s===De.Connecting&&t.data.connectionState===De.Connected&&i(n),s=t.data.connectionState)})),()=>{r.unsubscribe()}}),[]),o},It=n(28549);const Nt="undefined"!=typeof window,At={name:null,waiver_id:null,accept:!1};var Ct=()=>{var e,t,n,o,c,f,p,v,g,y,N,A,C,O,D,R,P,x,M,L,U,F,B,V,G,Y,K,H,z,$,X,ee,te,ne,re,ie,oe,ae,se,ce,ue,le,de,fe,he,ve,ge,me,ye,be,_e,we,Se,Te,Ie,Ne,Ae,Ce,Oe,ke,De,Pe,xe,Me,Le,Ue,Fe;const je=(0,i.useLocation)(),Be=(0,r.useContext)(I.A),Ve=(0,j.parse)(null==je?void 0:je.search),{0:Ge,1:qe}=(0,r.useState)({}),{0:Ye,1:Ke}=(0,r.useState)(!0),{0:He,1:ze}=(0,r.useState)(!1),{0:We,1:Je}=(0,r.useState)(null),{0:Qe,1:Ze}=(0,r.useState)({items:[],value:"",error:null}),{0:$e,1:Xe}=(0,r.useState)(null),{0:et,1:tt}=(0,r.useState)(!1),{0:nt,1:rt}=(0,r.useState)(!1),{0:it,1:ot}=(0,r.useState)(0),{0:at,1:st}=(0,r.useState)(null),ct=null==Ve?void 0:Ve.payment_intent,ut=(Ve.trip_reserve_id,Ve.booking_ref),{0:lt,1:dt}=(0,r.useState)(null),{0:ft,1:pt}=(0,r.useState)(null),{0:ht,1:vt}=(0,r.useState)(null),{0:gt,1:mt}=(0,r.useState)(At),yt=(0,T.HW)().token,bt=Nt&&window.innerWidth<=600;(0,r.useEffect)((()=>{var e;(Ke(!0),Ve.trip_reserve_id&&dt(Ve.trip_reserve_id),Nt)&&(null===(e=window)||void 0===e||e.scrollTo(0,0))}),[]);const _t=e=>{Ke(!0),h().get("/v1/trip/details?ref_id="+e,{headers:{Authorization:"Bearer "+yt}}).then((e=>{var t,n,r,i;let o=e.data;St(o);const{waiver_data:a,waiver_id:s}=e.data;if(a){const e={},t=a.file_path,n="https://guidesly-assets.s3.us-east-2.amazonaws.com/"+(0,T.kb)(a.file_path),r=t.split(".").pop();e.fileName=a.file_name,e.uri=n,e.fileData=n,e.fileType=r,vt([e])}const c={name:null!=a&&a.trips&&(null==a||null===(t=a.trips)||void 0===t?void 0:t.length)>0?null==a||null===(n=a.trips[0])||void 0===n?void 0:n.signature:null,waiver_id:s,accept:!!(null!=a&&a.trips&&(null==a||null===(r=a.trips)||void 0===r?void 0:r.length)>0&&null!=a&&null!==(i=a.trips[0])&&void 0!==i&&i.signature)};mt(c)}))},Et=Tt({pID:ct,bookingID:ut,getBookingDetails:_t});(0,r.useEffect)((()=>{if("Success"==(null==Et?void 0:Et.status)&&!ft){const{trip_data:e}=Et;pt(null==Et?void 0:Et.status),e&&St(e)}}),[Et]);const wt=(e,t,n)=>{var r,i,o;if(e&&(t||n))return null!==(r=e.duration)&&void 0!==r&&r.is_entire_trip?parseFloat(e.charge_value):null!==(i=e.duration)&&void 0!==i&&i.days?t?parseFloat(e.charge_value*t):parseFloat(e.charge_value*((0,J.Os)(n)/24)):null!==(o=e.duration)&&void 0!==o&&o.hours?t?parseFloat(e.charge_value*t*24):parseFloat(e.charge_value*(0,J.Os)(n)):t?parseFloat(e.charge_value*t*48):parseFloat(e.charge_value*(0,J.Os)(n)*2)},St=e=>{if(e){var t;if(Be.setTripguid(e),Be.setBookingDetails(e),Xe(null==e?void 0:e.booking_ref),(null==e||null===(t=e.add_on_fees)||void 0===t?void 0:t.length)>0){let t=0,n=0;for(let r of e.add_on_fees)r.active&&null!=r&&r.charge_amount&&"finance"==r.category?t+=(null==r?void 0:r.charge_amount)||0:r.active&&"finance"!=r.category&&(n=parseFloat(n)+parseFloat(wt(r,null==e?void 0:e.duration_days,null==e?void 0:e.duration_hours)||0));Je(t),ot(n)}Be.setFirstName(e.customer_firstname),Be.setLastName(e.customer_lastname),Be.setEmail(e.customer_email),Be.setPhone(e.customer_phone),Be.setCount(e.guests),Be.setStartDate(b()(e.tripdate,["YYYY-MM-DD"]).format("YYYY-MM-DD")),Be.setSelectedTime(e.starttime),Be.setMeetingPoint({name:e.poi_address}),Be.setNotes(Ct.notes),Dt(null==e?void 0:e.guideguid)}};let Ct={};null!==JSON.parse(window.localStorage.getItem("bookingObj"))&&(Ct=JSON.parse(window.localStorage.getItem("bookingObj"))),(0,r.useEffect)((()=>{var e,t;Be.setGuideTab(!1),Be.setPersonalTab(!1),Be.setPaymentTab(!1),Be.setConfirmationTab(!0),Rt(),null===(null===(e=Be.bookingDetails)||void 0===e||null===(t=e.waiver_data)||void 0===t?void 0:t.trips)&&rt(!0)}),[Be.startDate,Be.bookingDetails]),(0,r.useEffect)((()=>(null!==Ct&&void 0!==Ct.tripCharge&&Be.setPromo(Ct.tripCharge),()=>{Be.setPromo({...Be.promo,applied:!1,response:"",show:!1,promoCode:""})})),[]);const{0:Ot,1:kt}=(0,r.useState)([]);(0,r.useEffect)((()=>{var e;const t=null==Be||null===(e=Be.selectedRates)||void 0===e?void 0:e.guide_ratecard_id;if(Object.keys(Be.schrecords).length>0&&t){var n,r,i;const e=null==Be||null===(n=Be.schrecords)||void 0===n||null===(r=n.ratecards)||void 0===r?void 0:r.filter((e=>e.id==t));if(!m()(e)&&null!==(i=e[0])&&void 0!==i&&i.addon_fees){var o,a;const t=null===(o=e[0])||void 0===o||null===(a=o.addon_fees)||void 0===a?void 0:a.filter((e=>e.active));kt(t)}else kt([])}else kt([])}),[Be.selectedRates]);const Dt=e=>
2{Ke(!0),h().get("/v1/guide/details?guide_guid="+e).then((e=>{Be.setSelectedGuide(e.data),Be.setLoadGuide(!0),Ke(!1)})).catch((e=>{console.log(e),Ke(!1)}))},Rt=()=>{var e;if(null!==Be.bookingDetails&&null!==(e=Be.bookingDetails)&&void 0!==e&&e.starttime){var t,n,r,i,o;let e=b()(null===(t=Be.bookingDetails)||void 0===t?void 0:t.starttime,"h:m:s").hour(),u=b()(null===(n=Be.bookingDetails)||void 0===n?void 0:n.starttime,"h:m:s").minute(),l=0,d=0;var a,s,c;if(Number.isInteger(null===(r=Be.selectedRates)||void 0===r?void 0:r.duration_hours))l=e+b().duration(null===(a=Be.bookingDetails)||void 0===a?void 0:a.duration_hours,"hours").hours(),d=u;else l=e+b().duration(null===(s=Be.bookingDetails)||void 0===s?void 0:s.duration_hours,"hours").hours(),d=u+b().duration(null===(c=Be.bookingDetails)||void 0===c?void 0:c.duration_hours,"minutes").minutes();let f=b()(Be.startDate).set({hour:e,minute:u}).toISOString(),p=b()(Be.startDate).set({hour:l,minute:d}).toISOString();const h={name:"Fishing Trip Details",details:"Your booking has been confirmed with "+(Be.loadGuide&&(null===(i=Be.selectedGuide)||void 0===i?void 0:i.guidename))+", on "+new Date(Be.startDate).toLocaleDateString()+".",location:Be.meetingPoint&&(null===(o=Be.meetingPoint)||void 0===o?void 0:o.name),startsAt:Be.startDate?f:null,endsAt:Be.startDate?p:null};qe(h)}},Pt=!Qe||!Qe.items||0===Qe.items.length;let xt=[];null!==Be.bookingDetails&&(xt=[{apple:"Apple Calendar"},{google:"Google"},{outlookcom:"Outlook.com"},{yahoo:"Yahoo!"}]);const Mt=e=>{let t=null;return Lt(e)&&(t=e+" has already been added."),Ut(e)||(t=e+" is not a valid email address."),!t||(Ze({items:Qe.items,value:Qe.value,error:t}),!1)},Lt=e=>!!Qe.items&&Qe.items.includes(e),Ut=e=>/[\w\d\.-]+@[\w\d\.-]+\.[\w\d\.-]+/.test(e);let Ft=0;Ot.forEach((e=>{e.active&&(Ft+=Number((0,k.G4)(Be.selectedRates,e,Be.count)))}));null===Be.promo.response.percent_off||void 0===Be.promo.response.percent_off?(0,k.HW)(Be.selectedRates,Ot,Be.count,Be.promo.response.amount_off,"V",Be.tip):(0,k.HW)(Be.selectedRates,Ot,Be.count,Be.promo.response.percent_off,"P",Be.tip);let jt=(null===(e=Be.bookingDetails)||void 0===e||null===(t=e.add_on_fees)||void 0===t||null===(n=t.filter((e=>"finance"===e.category&&!0===e.active)))||void 0===n?void 0:n.length)>0,Bt=(null===(o=Be.bookingDetails)||void 0===o||null===(c=o.add_on_fees)||void 0===c||null===(f=c.filter((e=>"finance"!=e.category&&!0===e.active)))||void 0===f?void 0:f.length)>0;return r.createElement(s.A,null,r.createElement(a.A,{title:"Trip Summary"}),r.createElement("div",{className:Ee.jy},r.createElement(_.A,null,!0===Ye?r.createElement("img",{src:u.A,alt:"loading",className:d.Rhj}):null,et&&r.createElement("div",{className:E.confirmContainer,style:{paddingTop:"20px"}},r.createElement("div",{className:E.thanksSection},r.createElement("h3",{style:{color:"red"}},at),r.createElement("p",null,"Any queries, Please contact our ",r.createElement(l.N_,{to:"/contact-us"},"customer support"),"."))),r.createElement("div",{className:E.confirmContainer},r.createElement("div",{className:E.thanksSection},r.createElement("h3",{className:Ye&&"loading "},"Thanks, ",Be.firstname," ",Be.lastname,"! Your trip is booked with Guidesly."),r.createElement("p",{className:Ye&&"loading "},"We have emailed you all the details for your trip.")),r.createElement(w.A,null,r.createElement(S.A,{xs:12,sm:12,md:4,lg:4,className:Ee.fv},!0===Ye?r.createElement("div",{className:"loading "+Ee.Wh}):r.createElement("img",{className:Ee.Wh,src:q().GUIDESLY_GUIDEPIC_IP+"/"+(0,T.kb)(null!==(p=Be.bookingDetails)&&void 0!==p&&p.coverpicture?null===(v=Be.bookingDetails)||void 0===v?void 0:v.coverpicture:null===(g=Be.selectedGuide)||void 0===g?void 0:g.guidepic),alt:null===(y=Be.selectedGuide)||void 0===y?void 0:y.guidename,width:"100%",height:"100%",loading:"lazy"})),r.createElement(S.A,{xs:12,sm:12,md:8,lg:8,className:Ee.wv},r.createElement(w.A,{className:Ee.Q_},r.createElement(S.A,{xs:12,sm:12,md:7,lg:7},r.createElement("div",{className:Ee.Ez},r.createElement("p",{className:Ye&&"loading"},"Booking ID : ",$e," "),r.createElement("p",{className:Ye&&"loading"},"Payment Details"),r.createElement("div",{className:Ee.lA},r.createElement("div",{className:Ye&&"loading"},"Base Trip Cost"),r.createElement("div",{className:Ye?"loading "+Ee.j_:Ee.j_},!(null===(N=Be.bookingDetails)||void 0===N||!N.bookingrate)&&"$"+(0,J.BZ)(null===(A=Number(null===(C=Be.bookingDetails)||void 0===C?void 0:C.bookingrate))||void 0===A?void 0:A.toFixed(2)))),it>0&&r.createElement("div",{className:Ee.lA},r.createElement("div",{className:Ye&&"loading"},"Add-Ons ",(null===(O=Be.bookingDetails)||void 0===O||null===(D=O.add_on_fees)||void 0===D?void 0:D.length)&&Bt&&r.createElement("span",null,r.createElement(Z.A,{key:"top",placement:"top",overlay:r.createElement(Q.A,{id:"tooltip-top"},(null===(R=Be.bookingDetails)||void 0===R?void 0:R.add_on_fees.length)>0&&(null===(P=Be.bookingDetails)||void 0===P?void 0:P.add_on_fees.map((e=>{var t,n,i;if(null!=e&&e.active&&"finance"!=e.category)return r.createElement("div",{style:{textAlign:"left"}},r.createElement("span",null,""+e.title),r.createElement("span",null,": $"+(0,J.BZ)(null===(t=wt(e,null===(n=Be.bookingDetails)||void 0===n?void 0:n.duration_days,null===(i=Be.bookingDetails)||void 0===i?void 0:i.duration_hours))||void 0===t?void 0:t.toFixed(2))))}))))},r.createElement("img",{style:{width:16,height:16},src:pe.A})))),r.createElement("div",{className:Ye?"loading "+Ee.j_:Ee.j_},!!it&&"$"+(0,J.BZ)(null===(x=Number(it))||void 0===x?void 0:x.toFixed(2)))),0!=(null===(M=Be.bookingDetails)||void 0===M?void 0:M.additional_guest_charge)&&null!=(null===(L=Be.bookingDetails)||void 0===L?void 0:L.additional_guest_charge)&&r.createElement("div",{className:Ee.lA},r.createElement("div",null,"Additional Guest Fee"),r.createElement("div",{className:Ee.j_},r.createElement("div",{className:Ee.j_},"$"+(0,J.BZ)(null===(U=Be.bookingDetails)||void 0===U?void 0:U.additional_guest_charge)))),r.createElement("div",{className:Ee.lA},r.createElement("div",{className:Ye&&"loading "},"Tip ","Cash Tip Upon Trip"===(null===(F=Be.bookingDetails)||void 0===F?void 0:F.tip_type)?" - Cash Tip Upon Trip":""),null!==(B=Be.bookingDetails)&&void 0!==B&&B.tip_amount&&0!=(null===(V=Be.bookingDetails)||void 0===V?void 0:V.tip_amount)&&"Cash Tip Upon Trip"!==(null===(G=Be.bookingDetails)||void 0===G?void 0:G.t
2ip_type)?r.createElement("div",{className:Ye?"loading ":Ee.j_,"data-alyx-tip":"tip"},"$"+(0,J.BZ)(null===(Y=Be.bookingDetails)||void 0===Y||null===(K=Y.tip_amount)||void 0===K?void 0:K.toFixed(2))):r.createElement("div",{className:Ye?"loading ":Ee.j_},"Cash Tip Upon Trip"===(null===(H=Be.bookingDetails)||void 0===H?void 0:H.tip_type)?"":"$0")),null!=We&&0!=We&&r.createElement("div",{className:Ee.lA},r.createElement("div",{className:Ye&&"loading"},"Fees ",(null===(z=Be.bookingDetails)||void 0===z||null===($=z.add_on_fees)||void 0===$?void 0:$.length)&&jt&&r.createElement("span",null,r.createElement(Z.A,{key:"top",placement:"top",overlay:r.createElement(Q.A,{id:"tooltip-top"},(null===(X=Be.bookingDetails)||void 0===X?void 0:X.add_on_fees.length)>0&&(null===(ee=Be.bookingDetails)||void 0===ee?void 0:ee.add_on_fees.map((e=>{if(null!=e&&e.active&&"finance"==e.category)return r.createElement("div",{style:{textAlign:"left"}},r.createElement("span",null,e.charge_value?""+e.title:e.title+" ("+e.charge_percentage+"%)"),r.createElement("span",null,": $"+(0,J.BZ)(null==e?void 0:e.charge_amount)))}))))},r.createElement("img",{style:{width:16,height:16},src:pe.A})))),r.createElement("div",{className:Ye?"loading ":Ee.j_},"$"+(0,J.BZ)(null===(te=We||0)||void 0===te?void 0:te.toFixed(2)))),(null===(ne=Be.bookingDetails)||void 0===ne?void 0:ne.promo_amount)>0&&r.createElement("div",{className:Ee.lA},r.createElement("span",null,"Coupon Applied"),r.createElement("div",{className:Ye?"loading ":Ee.j_,"data-alyx-tip":"coupon applied"},"-$"+(null===(re=Be.bookingDetails)||void 0===re||null===(ie=re.promo_amount)||void 0===ie?void 0:ie.toFixed(2)))),r.createElement("div",{className:Ee.Vt}),r.createElement("div",{className:Ee.lA},r.createElement("span",{className:Ye&&"loading ",style:{color:"blue"}},"Total (USD)"),r.createElement("div",{className:Ye?"loading ":Ee.j_,style:{color:"blue"}},"$",null==Be.bookingDetails?null:(0,J.BZ)(null===(oe=Number(null===(ae=Be.bookingDetails)||void 0===ae?void 0:ae.tripcost))||void 0===oe?void 0:oe.toFixed(2)))),r.createElement("div",{className:Ee.lA},r.createElement("span",{className:Ye&&"loading "},(Be.tip&&0!=Be.tip&&Be.tip,"Due on "+(Be.startDate?b()(Be.startDate).format("MMM D, YYYY"):""))),r.createElement("div",{className:Ye?"loading ":Ee.j_},"$",null==Be.bookingDetails?null:(0,J.BZ)((Number(null===(se=Be.bookingDetails)||void 0===se?void 0:se.tripcost)-Number(null===(ce=Be.bookingDetails)||void 0===ce?void 0:ce.deposit_charge)).toFixed(2)))),r.createElement("hr",null),r.createElement("div",{className:Ee.lA},r.createElement("div",{className:Ye&&"loading ",style:{color:"blue"}},"Paid today"),r.createElement("div",{className:Ye?"loading ":Ee.j_,style:{color:"blue",fontWeight:"bolder",fontSize:20}},"$",null==Be.bookingDetails?null:(0,J.BZ)(null===(ue=Number(null===(le=Be.bookingDetails)||void 0===le?void 0:le.deposit_charge))||void 0===ue?void 0:ue.toFixed(2)))))),r.createElement(S.A,{className:!0===Ye?"loading "+Ee.RN+" ":Ee.RN,xs:12,sm:12,md:5,lg:5,style:{padding:"2%",margin:"auto",maxWidth:250,minHeight:130}},Be.loadGuide&&r.createElement(r.Fragment,null,r.createElement("div",{style:{fontSize:18,fontWeight:""}},r.createElement("span",null,r.createElement("img",{width:"40",height:"40",style:{position:"relative",top:10,marginRight:10},src:"https://dlsmyzcs6vrg4.cloudfront.net/scripts/mastercard.png"})),r.createElement("span",{style:{position:"relative",top:10}},Be.paymentCardDetails.brand," "," ending with")),r.createElement("div",{style:{marginTop:2}},r.createElement("div",null," •••• •••• •••• ",null!==(de=null===(fe=Be.paymentCardDetails)||void 0===fe?void 0:fe.last4)&&void 0!==de?de:null===(he=Be.bookingDetails)||void 0===he?void 0:he.last4)),r.createElement("div",null,"was charged $",null==Be.bookingDetails?null:(0,J.BZ)(null===(ve=Number(null===(ge=Be.bookingDetails)||void 0===ge?void 0:ge.deposit_charge))||void 0===ve?void 0:ve.toFixed(2))),r.createElement("div",null,"on ",b()(new Date).format("MMMM, DD, YYYY"))))))),r.createElement("div",{className:Ee.I2},r.createElement(w.A,null,r.createElement(S.A,{xs:12,sm:12,md:6,lg:6,style:{padding:"3%",fontWeight:"bolder",fontSize:18}},"Forward this confirmation to a friend"),r.createElement(S.A,{xs:12,sm:12,md:6,lg:6,style:{marginTop:"2%"}},r.createElement("div",null,Qe.items&&Qe.items.map((e=>r.createElement("div",{className:Ee.GI,key:e},e,r.createElement("div",null,r.createElement("button",{type:"button",disabled:Ye,className:Ee.Cv,onClick:()=>(e=>{var t;Ze({items:null==Qe||null===(t=Qe.items)||void 0===t?void 0:t.filter((t=>t!==e))})})(e)},"×"))))),r.createElement("div",{style:{marginBottom:"2%"}},r.createElement("input",{variant:"outlined",required:!0,id:"email","aria-describedby":"Email Address",placeholder:"Email Address",value:Qe.value,onKeyDown:e=>
2{if(["Enter","Tab",","," "].includes(e.key)){e.preventDefault();var t=Qe.value.trim();t&&Mt(t)&&(Qe.items?Ze({items:[].concat((0,W.A)(Qe.items),[Qe.value]),value:""}):Ze({items:[Qe.value],value:""}))}},onChange:e=>{Qe.items?Ze({items:Qe.items,value:e.target.value,error:null}):Ze({value:e.target.value,error:null})},onPaste:e=>{e.preventDefault();var t=e.clipboardData.getData("text").match(/[\w\d\.-]+@[\w\d\.-]+\.[\w\d\.-]+/g);if(t){var n=null==t?void 0:t.filter((e=>!Lt(e)));Ze({items:[].concat((0,W.A)(Qe.items),(0,W.A)(n))})}},style:{height:56,width:"60%",borderRadius:0,borderTopLeftRadius:10,borderBottomLeftRadius:10,padding:10}}),r.createElement("button",{onClick:()=>{var e={};const t=(0,T.HW)().token,n={type:"email",source:"trip_confirmation",ref_id:Be.tripguide.booking_ref,emails:Qe.items};e.event=n,h().post("/v1/send_notification",e,{headers:{Authorization:"Bearer "+t}}).then((e=>{Ke(!1),alert("Email sent")})).catch((e=>{Ke(!1),e.response&&401===e.response.status&&(window.localStorage.clear(),(0,i.navigate)("/"))}))},disabled:Pt,style:{height:57,maxWidth:"40%",marginLeft:0,borderRadius:0,borderTopRightRadius:10,borderBottomRightRadius:10,color:"white",position:"relative",top:-1},className:Ee.e},"Forward")))))),r.createElement("div",{className:Ee.wt},r.createElement("p",{className:Ee.NS},"Trip Details"),r.createElement(w.A,null,r.createElement(S.A,{xs:12,sm:12,md:4,lg:4},r.createElement("div",{className:!0===Ye?"loading "+Ee.ig:Ee.ig},Be.loadGuide&&r.createElement(r.Fragment,null,r.createElement("p",{className:Ee.Cr},null===(me=Be.selectedGuide)||void 0===me?void 0:me.title," ",null===(ye=Be.selectedGuide)||void 0===ye?void 0:ye.guidename),r.createElement("p",null,null===(be=Be.selectedGuide)||void 0===be?void 0:be.company),r.createElement("p",null,null===(_e=Be.selectedGuide)||void 0===_e?void 0:_e.guidelocation))),r.createElement("div",{className:!0===Ye?"loading "+Ee.ig:Ee.ig},Be.loadGuide&&r.createElement(r.Fragment,null,r.createElement("p",{className:Ee.Cr},null===(we=Be.bookingDetails)||void 0===we?void 0:we.title),r.createElement("p",null,b()(b()(Be.startDate).format("YYYY-MM-DD")).format("dddd MMMM D, YYYY")),r.createElement("p",null,null===(Se=Be.bookingDetails)||void 0===Se?void 0:Se.starttime," ",!(null===(Te=Be.bookingDetails)||void 0===Te||!Te.starttime)&&(0,J.cR)(Be.bookingDetails)," Trip"),r.createElement("p",null,null===(Ie=Be.bookingDetails)||void 0===Ie?void 0:Ie.triptype),r.createElement("p",null,null===(Ne=Be.bookingDetails)||void 0===Ne?void 0:Ne.guests," ","1"===(null===(Ae=Be.bookingDetails)||void 0===Ae?void 0:Ae.guests)||1===(null===(Ce=Be.bookingDetails)||void 0===Ce?void 0:Ce.guests)?"Guest":"Guests")))),r.createElement(S.A,{xs:12,sm:12,md:4,lg:4},r.createElement("div",{className:!0===Ye?"loading "+Ee.ig:Ee.ig},Be.loadGuide&&r.createElement(r.Fragment,null,r.createElement("p",null,"Meeting Point:"),r.createElement("p",{className:Ee.Cr},Be.meetingPoint&&(null===(Oe=Be.meetingPoint)||void 0===Oe?void 0:Oe.name))))),r.createElement(S.A,{xs:12,sm:12,md:4,lg:4},Be.loadGuide&&r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("button",{onClick:()=>window.print(),className:Ee.e},"Print")),r.createElement("div",null,r.createElement(Re,{event:Ge},"Add to Calendar")),(null==Be||null===(ke=Be.bookingDetails)||void 0===ke?void 0:ke.waiver_id)&&r.createElement(r.Fragment,null,bt?r.createElement("button",{onClick:()=>rt(!0),className:Ee.e,style:{marginTop:"30px"}},"Waiver Agreement (optional)"):r.createElement("div",{className:Ee.yS},!(null!==(De=Be.bookingDetails)&&void 0!==De&&null!==(Pe=De.waiver_data)&&void 0!==Pe&&Pe.trips)&&r.createElement("input",{type:"checkbox",checked:nt,onChange:e=>{rt(e.target.checked)}}),null!==(xe=Be.bookingDetails)&&void 0!==xe&&null!==(Me=xe.waiver_data)&&void 0!==Me&&Me.trips?r.createElement("p",null,"You have Agreed to ",r.createElement("span",{onClick:()=>rt(!0)},"Waiver Agreement Form")):r.createElement("p",null,"Agree to ",r.createElement("span",{onClick:()=>rt(!0)},"Waiver Agreement Form")," (optional)"))))))),r.createElement(It.A,{docs:ht,signature:gt,setSignature:mt,showWaiver:nt,setShowWaiver:rt,callback:()=>_t(ut),validate:null===(Le=Be.bookingDetails)||void 0===Le||null===(Ue=Le.waiver_data)||void 0===Ue?void 0:Ue.trips,intialSign:At,handleClear:()=>rt(!nt),setLoading:Ke,tripguid:null==Be||null===(Fe=Be.bookingDetails)||void 0===Fe?void 0:Fe.tripguid})))))};var Ot=()=>{const{0:e,1:t}=(0,r.useState)(null);return(0,r.useEffect)((()=>{t((0,_e.loadStripe)(G.GUIDESLY_STRIPE_KEY))}),[]),r.createElement(F.Elements,{stripe:e}
2,r.createElement(Ct,null))},kt=()=>r.createElement("div",null,r.createElement(a.A,{lang:"en",title:"Guidesly Book a Guide",dscription:"Book a Fishing Guide or Fishing Charter Today!",isCDN:!0,image:"/web/static/images/guideslypro/landing1.png"}),r.createElement(i.Router,null,r.createElement(v,{path:"/book-a-guide/guide-details/:id"}),r.createElement(v,{path:"/book-a-guide/guide-details-2/:id"}),r.createElement(be,{path:"/book-a-guide/personal-details/:id"}),r.createElement(o.A,{path:"/book-a-guide/booking-confirmation",component:Ot})))},99685:function(e,t,n){"use strict";n.d(t,{b:function(){return o}});var r=n(95093),i=n.n(r);const o=e=>{var t;let{rates:n,ratecard:r,check:o,setAvailDate:a,setDateModal:s,setSelectedData:c,context:u}=e;const l=[],d=[],f=i()(new Date).add(null===(t=u.schrecords)||void 0===t?void 0:t.booking_acceptance_days,"days").format("YYYY/MM/DD");for(let h of u.schrecords.schedule){let e=h.date.replace(/-/g,", "),t=i()(e,"YYYY,MM,DD").toDate();var p=i()(e,"YYYY,MM,DD").format("YYYY/MM/DD");h.available_rates.some((e=>e.id===Number(n.id)&&i()(p).isSameOrAfter(f)))?l.push(t):d.push(t)}u.setNotAvail(d),a(l),s(!0),c({rates:n,ratecard:r,check:o})}},12215:function(e,t,n){var r,i;!function(o){if(void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),!0,e.exports=o(),!!0){var a=window.Cookies,s=window.Cookies=o();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2}
2)+/g,decodeURIComponent)}return function n(r){function i(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(u){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(s[0]);if(c=(r.read||r)(c,u)||t(c),n)try{c=JSON.parse(c)}catch(l){}if(i[u]=c,e===u)break}catch(l){}}return e?i[e]:i}}return i.set=o,i.get=function(e){return a(e,!1)},i.getJSON=function(e){return a(e,!0)},i.remove=function(t,n){o(t,"",e(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}((function(){}))}))},10755:function(e,t,n){"use strict";n.d(t,{$S:function(){return v},AB:function(){return r},IH:function(){return c}
2,JC:function(){return S},Js:function(){return b},KM:function(){return p},Kk:function(){return f},Kl:function(){return d},Lk:function(){return l},Lx:function(){return i},Nv:function(){return w},OK:function(){return T},PP:function(){return C},Pz:function(){return h},Tb:function(){return O},Xc:function(){return s},YY:function(){return y},_T:function(){return A},cj:function(){return E},f_:function(){return R},kL:function(){return u},kM:function(){return I},me:function(){return g},oR:function(){return o},tr:function(){return m},uE:function(){return _},vK:function(){return a},wC:function(){return D},wx:function(){return N},zJ:function(){return k}});var r="P_QN",i="P_QJ",o="P_QW",a="P_Pc",s="P_QD",c="P_QF",u="P_bS",l="P_cy",d="P_jr",f="P_hH",p="P_g4",h="P_hc",v="P_hb",g="P_g7",m="P_hd",y="P_hh",b="P_QT",_="P_hg",E="P_QR",w="P_QS",S="P_hf",T="P_g9",I="P_g8",N="P_dS",A="P_QG",C="P_kY",O="P_QK",k="P_QH",D="P_QV",R="P_p9"},33363:function(e){e.exports=function(){function e(e){return e}function t(e){return"string"==typeof e?e.toLowerCase():e}function n(r,i){var o="function"==typeof this&&!this.firstBy&&this,a=function(n,r){if(r="object"==typeof r?r:{direction:r},"function"!=typeof n){var i=n;n=function(e){return e[i]?e[i]:""}}if(1===n.length){var o=n,a=r.ignoreCase?t:e,s=r.cmp||function(e,t){return e<t?-1:e>t?1:0};n=function(e,t){return s(a(o(e)),a(o(t)))}}return r.direction in{"-1":"",desc:""}?function(e,t){return-n(e,t)}:n}(r,i),s=o?function(e,t){return o(e,t)||a(e,t)}:a;return s.thenBy=n,s}return n.firstBy=n,n}()},88835:function(e,t,n){"use strict";var r=n(9655),i=n(32268);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=b(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(47186);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var _=c.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var E=a.exec(b);if(E){var w=(E=E[0]).toLowerCase();this.protocol=w,b=b.substr(E.length)}if(n||E||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||E&&g[E]||(b=b.substr(2),this.slashes=!0)}if(!g[E]&&(S||E&&!m[E])){for(var T,I,N=-1,A=0;A<f.length;A++){-1!==(C=b.indexOf(f[A]))&&(-1===N||C<N)&&(N=C)}-1!==(I=-1===N?b.lastIndexOf("@"):b.lastIndexOf("@",N))&&(T=b.slice(0,I),b=b.slice(I+1),this.auth=decodeURIComponent(T)),N=-1;for(A=0;A<d.length;A++){var C;-1!==(C=b.indexOf(d[A]))&&(-1===N||C<N)&&(N=C)}-1===N&&(N=b.length),this.host=b.slice(0,N),b=b.slice(N),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var k=this.hostname.split(/\./),D=(A=0,k.length);A<D;A++){var R=k[A];if(R&&!R.match(p)){for(var P="",x=0,M=R.length;x<M;x++)R.charCodeAt(x)>127?P+="x":P+=R[x];if(!P.match(p)){var L=k.slice(0,A),U=k.slice(A+1),F=R.match(h);F&&(L.push(F[1]),U.unshift(F[2])),U.length&&(b="/"+U.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(A=0,D=l.length;A<D;A++){var V=l[A];if(-1!==b.indexOf(V)){var G=encodeURIComponent(V);G===V&&(G=escape(V)),b=b.split(V).join(G)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var Y=b.indexOf("?");if(-1!==Y?(this.search=b.substr(Y),this.query=b.substr(Y+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,Y)):t&&(this.search="",this.query={}),b&&(this.pathname=b),m[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var K=this.search||"";this.path=j+K}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];"protocol"!==l&&(n[l]=e[l])}return m[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!m[e.protocol]){for(var d=Object.keys(e),f=0;f<d.length;f++){var p=d[f];
2n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var v=n.pathname||"",y=n.search||"";n.path=v+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),E=_||b||n.host&&e.pathname,w=E,S=n.pathname&&n.pathname.split("/")||[],T=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!m[n.protocol]);if(T&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),E=E&&(""===h[0]||""===S[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=h;else if(h.length)S||(S=[]),S.pop(),S=S.concat(h),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)n.hostname=n.host=S.shift(),(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var I=S.slice(-1)[0],N=(n.host||e.host||S.length>1)&&("."===I||".."===I)||""===I,A=0,C=S.length;C>=0;C--)"."===(I=S[C])?S.splice(C,1):".."===I?(S.splice(C,1),A++):A&&(S.splice(C,1),A--);if(!E&&!w)for(;A--;A)S.unshift("..");!E||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),N&&"/"!==S.join("/").substr(-1)&&S.push("");var O,k=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(n.hostname=n.host=k?"":S.length?S.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift()));return(E=E||n.host&&S.length)&&!k&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},32268:function(e){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},28117:function(e,t,n){"use strict";n.r(t),n.d(t,{Observable:function(){return i}});var r=n(16064),i=n.n(r)();t.default=i},16064:function(e,t,n){e.exports=n(43619).Observable},43619:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}t.Observable=void 0;var o=function(){return"function"==typeof Symbol},a=function(e){return o()&&Boolean(Symbol[e])},s=function(e){return a(e)?Symbol[e]:"@@"+e};o()&&!a("observable")&&(Symbol.observable=Symbol("observable"));var c=s("iterator"),u=s("observable"),l=s("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:w}function p(e){return e instanceof w}function h(e){h.log?h.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(t){h(t)}}))}function g(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(r){h(r)}}function m(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function y(e,t,n){e._state="running";var r=e._observer;try{var i=d(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(m(e),!i)throw n;i.call(r,n);break;case"complete":m(e),i&&i.call(r)}}catch(o){h(o)}"closed"===e._state?g(e):"running"===e._state&&(e._state="ready")}function b(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(y(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void y(e,t,n);e._queue.push({type:t,value:n})}}var _=function(){function e(t,r){n(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new E(this);try{this._cleanup=r.call(void 0,i)}catch(o){i.error(o)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(m(this),g(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),E=function(){function e(t){n(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),w=function(){function e(t){if(n(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new _(e,this._subscriber)}}
vendor: 4,463 bytes, line 2
2,{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(n){r(n),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(r){return n.error(r)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(r){return n.error(r)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(s){return n.error(s)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=f(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=f(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(s){return r.error(s)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:u,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,u);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(a("iterator")&&(r=d(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value;if(e.next(c),e.closed)return}}catch(u){i=!0,o=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=w,o()&&Object.defineProperty(w,Symbol("extensions"),{value:{symbol:u,hostReportError:h},configurable:!0})},45682:function(){},46528:function(e,t,n){"use strict";n.d(t,{C6:function(){return i},Cl:function(){return o},YH:function(){return s},sH:function(){return a},zs:function(){return c}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};
2function a(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(c){s=[6,c],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}Object.create;function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;"function"==typeof SuppressedError&&SuppressedError},96369:function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{A:function(){return r}})},92901:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(20816);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},64467:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(20816);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},76562:function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{A:function(){return r}})},80045:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(98587);function i(e,t){if(null==e)return{};var n,i,o=(0,r.A)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},5544:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(96369);var i=n(27800),o=n(76562);function a(e,t){return(0,r.A)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||(0,i.A)(e,t)||(0,o.A)()}},20816:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(82284);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:String(t)}},74786:function(e,t,n){"use strict";n.d(t,{e:function(){return y},y:function(){return _}});var r=n(34856),i=n(18838),o=n(98160),a=n(3143);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){var t="function"==typeof Map?new Map:void 0;return p=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return h(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,e)},p(e)}function h(e,t,n){return h=v()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&g(i,n.prototype),i},h.apply(null,arguments)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(y,e);var t,n,a,s,p,h=(t=y,n=v(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return d(this,e)});function y(e,t,n,i,a,s,l){var p,v,g,m;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),(m=h.call(this,e)).name="GraphQLError",m.originalError=null!=s?s:void 0,m.nodes=b(Array.isArray(t)?t:t?[t]:void 0);for(var _=[],E=0,w=null!==(S=m.nodes)&&void 0!==S?S:[];E<w.length;E++){var S,T=w[E].loc;null!=T&&_.push(T)}_=b(_),m.source=null!=n?n:null===(p=_)||void 0===p?void 0:p[0].source,m.positions=null!=i?i:null===(v=_)||void 0===v?void 0:v.map((function(e){return e.start})),m.locations=i&&n?i.map((function(e){return(0,o.g)(n,e)})):null===(g=_)||void 0===g?void 0:g.map((function(e){return(0,o.g)(e.source,e.start)})),m.path=null!=a?a:void 0;var I=null==s?void 0:s.extensions;return null==l&&(0,r.A)(I)?m.extensions=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?c(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},I):m.extensions=null!=l?l:{},Object.defineProperties(f(m),{message:{enumerable:!0},locations:{enumerable:null!=m.locations},path:{enumerable:null!=m.path},extensions:{enumerable:null!=m.extensions&&Object.keys(m.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(f(m),"stack",{value:s.stack,writable:!0,configurable:!0}),d(m)):(Error.captureStackTrace?Error.captureStackTrace(f(m),y):Object.defineProperty(f(m),"stack",{value:Error().stack,writable:!0,configurable:!0}),m)}return a=y,(s=[{key:"toString",value:function(){return _(this)}},{key:i.Kp,get:function(){return"Object"}}])&&l(a.prototype,s),p&&l(a,p),y}(p(Error));function b(e){return void 0===e||0===e.length?void 0:e}function _(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n<r.length;n++){var i=r[n];i.loc&&(t+="\n\n"+(0,a.V)(i.loc))}else if(e.source&&e.locations)for(var o=0,s=e.locations;o<s.length;o++){var c=s[o];t+="\n\n"+(0,a.C)(e.source,c)}return t}},51139:function(e,t,n){"use strict";n.r(t),n.d(t,{BREAK:function(){return Z},BreakingChangeType:function(){return ma},DEFAULT_DEPRECATION_REASON:function(){return Tn},DangerousChangeType:function(){return ya},DirectiveLocation:function(){return A},ExecutableDefinitionsRule:function(){return lr},FieldsOnCorrectTypeRule:function(){return br},FragmentsOnCompositeTypesRule:function(){return gr},GraphQLBoolean:function(){return Zt},GraphQLDeprecatedDirective:function(){return In},GraphQLDirective:function(){return En},GraphQLEnumType:function(){return Rt},GraphQLError:function(){return a.e},GraphQLFloat:function(){return Wt},GraphQLID:function(){return $t},GraphQLIncludeDirective:function(){return wn},GraphQLInputObjectType:function(){return xt},GraphQLInt:function(){return zt},GraphQLInterfaceType:function(){return Ot},GraphQLList:function(){return ut},GraphQLNonNull:function(){return lt},GraphQLObjectType:function(){return wt},GraphQLScalarType:function(){return Et},GraphQLSchema:function(){return Rn},GraphQLSkipDirective:function(){return Sn},GraphQLSpecifiedByDirective:function(){return Nn},GraphQLString:function(){return Qt},GraphQLUnionType:function(){return kt},Kind:function(){return c},KnownArgumentNamesRule:function(){return Pr},KnownDirectivesRule:function(){return Cr},KnownFragmentNamesRule:function(){return Er},KnownTypeNamesRule:function(){return hr},Lexer:function(){return R},Location:function(){return f},LoneAnonymousOperationRule:function(){return fr},LoneSchemaDefinitionRule:function(){return oi},NoDeprecatedCustomRule:function(){return _o},NoFragmentCyclesRule:function(){return Tr},NoSchemaIntrospectionCustomRule:function(){return Eo},NoUndefinedVariablesRule:function(){return Nr},NoUnusedFragmentsRule:function(){return wr},NoUnusedVariablesRule:function(){return Ar},OverlappingFieldsCanBeMergedRule:function(){return zr},PossibleFragmentSpreadsRule:function(){return Sr},PossibleTypeExtensionsRule:function(){return pi},ProvidedRequiredArgumentsRule:function(){return Vr},ScalarLeafsRule:function(){return yr},SchemaMetaFieldDef:function(){return pn},SingleFieldSubscriptionsRule:function(){return pr},Source:function(){return I},Token:function(){return p},TokenKind:function(){return v},TypeInfo:function(){return $n},TypeKind:function(){return dn},TypeMetaFieldDef:function(){return hn},TypeNameMetaFieldDef:function(){return vn},UniqueArgumentNamesRule:function(){return Mr},UniqueDirectiveNamesRule:function(){return di},UniqueDirectivesPerLocationRule:function(){return Or},UniqueEnumValueNamesRule:function(){return ci},UniqueFieldDefinitionNamesRule:function(){return ui},UniqueFragmentNamesRule:function(){return _r},UniqueInputFieldNamesRule:function(){return ii},UniqueOperationNamesRule:function(){return dr},UniqueOperationTypesRule:function(){return ai},UniqueTypeNamesRule:function(){return si}
2,UniqueVariableNamesRule:function(){return Ir},ValidationContext:function(){return _i},ValuesOfCorrectTypeRule:function(){return Lr},VariablesAreInputTypesRule:function(){return mr},VariablesInAllowedPositionRule:function(){return Yr},__Directive:function(){return on},__DirectiveLocation:function(){return an},__EnumValue:function(){return ln},__Field:function(){return cn},__InputValue:function(){return un},__Schema:function(){return rn},__Type:function(){return sn},__TypeKind:function(){return fn},assertAbstractType:function(){return ct},assertCompositeType:function(){return at},assertDirective:function(){return _n},assertEnumType:function(){return He},assertInputObjectType:function(){return We},assertInputType:function(){return et},assertInterfaceType:function(){return Ge},assertLeafType:function(){return it},assertListType:function(){return Qe},assertNamedType:function(){return mt},assertNonNullType:function(){return $e},assertNullableType:function(){return ht},assertObjectType:function(){return Be},assertOutputType:function(){return nt},assertScalarType:function(){return Fe},assertSchema:function(){return Dn},assertType:function(){return Le},assertUnionType:function(){return Ye},assertValidName:function(){return oe},assertValidSchema:function(){return Mn},assertWrappingType:function(){return ft},astFromValue:function(){return tn},buildASTSchema:function(){return Bo},buildClientSchema:function(){return ko},buildSchema:function(){return Vo},coerceInputValue:function(){return Oi},concatAST:function(){return ca},createSourceEventStream:function(){return bo},defaultFieldResolver:function(){return io},defaultTypeResolver:function(){return ro},doTypesOverlap:function(){return jt},execute:function(){return Li},executeSync:function(){return Ui},extendSchema:function(){return xo},findBreakingChanges:function(){return ba},findDangerousChanges:function(){return _a},findDeprecatedUsages:function(){return Pa},formatError:function(){return wo},getDescription:function(){return jo},getDirectiveValues:function(){return xi},getIntrospectionQuery:function(){return Io},getLocation:function(){return uo.g},getNamedType:function(){return yt},getNullableType:function(){return vt},getOperationAST:function(){return No},getOperationRootType:function(){return Ii},getVisitFn:function(){return ee},graphql:function(){return ao},graphqlSync:function(){return so},introspectionFromSchema:function(){return Oo},introspectionTypes:function(){return gn},isAbstractType:function(){return st},isCompositeType:function(){return ot},isDefinitionNode:function(){return tr},isDirective:function(){return bn},isEnumType:function(){return Ke},isEqualType:function(){return Ut},isExecutableDefinitionNode:function(){return nr},isInputObjectType:function(){return ze},isInputType:function(){return Xe},isInterfaceType:function(){return Ve},isIntrospectionType:function(){return mn},isLeafType:function(){return rt},isListType:function(){return Je},isNamedType:function(){return gt},isNonNullType:function(){return Ze},isNullableType:function(){return pt},isObjectType:function(){return je},isOutputType:function(){return tt},isRequiredArgument:function(){return Ct},isRequiredInputField:function(){return Lt},isScalarType:function(){return Ue},isSchema:function(){return kn},isSelectionNode:function(){return rr},isSpecifiedDirective:function(){return Cn},isSpecifiedScalarType:function(){return en},isType:function(){return Me},isTypeDefinitionNode:function(){return sr},isTypeExtensionNode:function(){return ur},isTypeNode:function(){return or},isTypeSubTypeOf:function(){return Ft},isTypeSystemDefinitionNode:function(){return ar},isTypeSystemExtensionNode:function(){return cr},isUnionType:function(){return qe},isValidNameError:function(){return ae},isValueNode:function(){return ir},isWrappingType:function(){return dt},lexicographicSortSchema:function(){return Ko},locatedError:function(){return re},parse:function(){return Y},parseType:function(){return H},parseValue:function(){return K},print:function(){return Se},printError:function(){return a.y},printIntrospectionSchema:function(){return Qo},printLocation:function(){return lo.V},printSchema:function(){return Jo},printSourceLocation:function(){return lo.C},printType:function(){return ea},responsePathAsArray:function(){return Ti},separateOperations:function(){return ua},specifiedDirectives:function(){return An},specifiedRules:function(){return vi},specifiedScalarTypes:function(){return Xt},stripIgnoredCharacters:function(){return fa},subscribe:function(){return go},syntaxError:function(){return s},typeFromAST:function(){return Zn},validate:function(){return Ei}
2,validateSchema:function(){return xn},valueFromAST:function(){return Ai},valueFromASTUntyped:function(){return Re},version:function(){return r},versionInfo:function(){return i},visit:function(){return $},visitInParallel:function(){return X},visitWithTypeInfo:function(){return er}});var r="15.8.0",i=Object.freeze({major:15,minor:8,patch:0,preReleaseTag:null});function o(e){return"function"==typeof(null==e?void 0:e.then)}var a=n(74786);function s(e,t,n){return new a.e("Syntax Error: ".concat(n),void 0,e,[t])}var c=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function u(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}var l="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function d(e){var t=e.prototype.toJSON;"function"==typeof t||u(0),e.prototype.inspect=t,l&&(e.prototype[l]=t)}var f=function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();d(f);var p=function(){function e(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function h(e){return null!=e&&"string"==typeof e.kind}d(p);var v=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),g=n(18838);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var y=10,b=2;function _(e){return E(e,[])}function E(e,t){switch(m(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(l)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:E(i,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>b)return"[Array]";for(var n=Math.min(y,e.length),r=e.length-n,i=[],o=0;o<n;++o)i.push(E(e[o],t));1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);if(0===n.length)return"{}";if(t.length>b)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]";var r=n.map((function(n){return n+": "+E(e[n],t)}));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function w(e,t){if(!Boolean(e))throw new Error(t)}var S=function(e,t){return e instanceof t};function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var I=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||w(0,"Body must be a string. Received: ".concat(_(e),".")),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||w(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||w(0,"column in locationOffset is 1-indexed and must be positive.")}var t,n,r;return t=e,(n=[{key:g.Kp,get:function(){return"Source"}}])&&T(t.prototype,n),r&&T(t,r),e}();function N(e){return S(e,I)}var A=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",
vendor: 26,308 bytes, line 2
2ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function C(e){var t=e.split(/\r\n|[\n\r]/g),n=k(e);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(var i=0;i<t.length&&O(t[i]);)++i;for(var o=t.length;o>i&&O(t[o-1]);)--o;return t.slice(i,o).join("\n")}function O(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function k(e){for(var t,n=!0,r=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:n=!1,r=!0,i=0;break;case 9:case 32:++i;break;default:r&&!n&&(null===o||i<o)&&(o=i),r=!1}return null!==(t=o)&&void 0!==t?t:0}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!r||o||a||n,c="";return!s||r&&i||(c+="\n"+t),c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n"),'"""'+c.replace(/"""/g,'\\"""')+'"""'}var R=function(){function e(e){var t=new p(v.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==v.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=M(this,e)}while(e.kind===v.COMMENT);return e},e}();function P(e){return e===v.BANG||e===v.DOLLAR||e===v.AMP||e===v.PAREN_L||e===v.PAREN_R||e===v.SPREAD||e===v.COLON||e===v.EQUALS||e===v.AT||e===v.BRACKET_L||e===v.BRACKET_R||e===v.BRACE_L||e===v.PIPE||e===v.BRACE_R}function x(e){return isNaN(e)?v.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function M(e,t){for(var n=e.source,r=n.body,i=r.length,o=t.end;o<i;){var a=r.charCodeAt(o),c=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===r.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new p(v.BANG,o,o+1,c,u,t);case 35:return U(n,o,c,u,t);case 36:return new p(v.DOLLAR,o,o+1,c,u,t);case 38:return new p(v.AMP,o,o+1,c,u,t);case 40:return new p(v.PAREN_L,o,o+1,c,u,t);case 41:return new p(v.PAREN_R,o,o+1,c,u,t);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new p(v.SPREAD,o,o+3,c,u,t);break;case 58:return new p(v.COLON,o,o+1,c,u,t);case 61:return new p(v.EQUALS,o,o+1,c,u,t);case 64:return new p(v.AT,o,o+1,c,u,t);case 91:return new p(v.BRACKET_L,o,o+1,c,u,t);case 93:return new p(v.BRACKET_R,o,o+1,c,u,t);case 123:return new p(v.BRACE_L,o,o+1,c,u,t);case 124:return new p(v.PIPE,o,o+1,c,u,t);case 125:return new p(v.BRACE_R,o,o+1,c,u,t);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?V(n,o,c,u,t,e):B(n,o,c,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return F(n,o,a,c,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return q(n,o,c,u,t)}throw s(n,o,L(a))}var l=e.line,d=1+o-e.lineStart;return new p(v.EOF,i,i,l,d,t)}function L(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(x(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(x(e),".")}function U(e,t,n,r,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new p(v.COMMENT,t,s,n,r,i,a.slice(t+1,s))}function F(e,t,n,r,i,o){var a=e.body,c=n,u=t,l=!1;if(45===c&&(c=a.charCodeAt(++u)),48===c){if((c=a.charCodeAt(++u))>=48&&c<=57)throw s(e,u,"Invalid number, unexpected digit after 0: ".concat(x(c),"."))}else u=j(e,u,c),c=a.charCodeAt(u);if(46===c&&(l=!0,c=a.charCodeAt(++u),u=j(e,u,c),c=a.charCodeAt(u)),69!==c&&101!==c||(l=!0,43!==(c=a.charCodeAt(++u))&&45!==c||(c=a.charCodeAt(++u)),u=j(e,u,c),c=a.charCodeAt(u)),46===c||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(c))throw s(e,u,"Invalid number, expected digit but got: ".concat(x(c),"."));return new p(l?v.FLOAT:v.INT,t,u,r,i,o,a.slice(t,u))}function j(e,t,n){var r=e.body,i=t,o=n;if(o>=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw s(e,i,"Invalid number, expected digit but got: ".concat(x(o),"."))}function B(e,t,n,r,i){for(var o,a,c,u,l=e.body,d=t+1,f=d,h=0,g="";d<l.length&&!isNaN(h=l.charCodeAt(d))&&10!==h&&13!==h;){if(34===h)return g+=l.slice(f,d),new p(v.STRING,t,d+1,n,r,i,g);if(h<32&&9!==h)throw s(e,d,"Invalid character within String: ".concat(x(h),"."));if(++d,92===h){switch(g+=l.slice(f,d-1),h=l.charCodeAt(d)){case 34:g+='"';break;case 47:g+="/";break;case 92:g+="\\";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+="\n";break;case 114:g+="\r";break;case 116:g+="\t";break;case 117:var m=(o=l.charCodeAt(d+1),a=l.charCodeAt(d+2),c=l.charCodeAt(d+3),u=l.charCodeAt(d+4),G(o)<<12|G(a)<<8|G(c)<<4|G(u));if(m<0){var y=l.slice(d+1,d+5);throw s(e,d,"Invalid character escape sequence: \\u".concat(y,"."))}g+=String.fromCharCode(m),d+=4;break;default:throw s(e,d,"Invalid character escape sequence: \\".concat(String.fromCharCode(h),"."))}f=++d}}throw s(e,d,"Unterminated string.")}function V(e,t,n,r,i,o){for(var a=e.body,c=t+3,u=c,l=0,d="";c<a.length&&!isNaN(l=a.charCodeAt(c));){if(34===l&&34===a.charCodeAt(c+1)&&34===a.charCodeAt(c+2))return d+=a.slice(u,c),new p(v.BLOCK_STRING,t,c+3,n,r,i,C(d));if(l<32&&9!==l&&10!==l&&13!==l)throw s(e,c,"Invalid character within String: ".concat(x(l),"."));10===l?(++c,++o.line,o.lineStart=c):13===l?(10===a.charCodeAt(c+1)?c+=2:++c,++o.line,o.lineStart=c):92===l&&34===a.charCodeAt(c+1)&&34===a.charCodeAt(c+2)&&34===a.charCodeAt(c+3)?(d+=a.slice(u,c)+'"""',u=c+=4):++c}throw s(e,c,"Unterminated string.")}function G(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function q(e,t,n,r,i){for(var o=e.body,a=o.length,s=t+1,c=0;s!==a&&!isNaN(c=o.charCodeAt(s))&&(95===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new p(v.NAME,t,s,n,r,i,o.slice(t,s))}function Y(e,t){return new z(e,t).parseDocument()}function K(e,t){var n=new z(e,t);n.expectToken(v.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(v.EOF),r}function H(e,t){var n=new z(e,t);n.expectToken(v.SOF);var r=n.parseTypeReference();return n.expectToken(v.EOF),r}var z=function(){function e(e,t){var n=N(e)?e:new I(e);this._lexer=new R(n),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(v.NAME);return{kind:c.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:c.DOCUMENT,definitions:this.many(v.SOF,this.parseDefinition,v.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(v.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(v.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(v.BRACE_L))return{kind:c.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(v.NAME)&&(t=this.parseName()),{kind:c.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(v.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(v.PAREN_L,this.parseVariableDefinition,v.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:c.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(v.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(v.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(v.DOLLAR),{kind:c.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:c.SELECTION_SET,selections:this.many(v.BRACE_L,this.parseSelection,v.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(v.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(v.COLON)?(e=r,t=this.parseName()):t=r,{kind:c.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(v.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(v.PAREN_L,t,v.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(v.COLON),{kind:c.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:c.ARGUMENT,name:this.parseName(),value:(this.expectToken(v.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(v.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(v.NAME)?{kind:c.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:c.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:c.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case v.BRACKET_L:return this.parseList(e);case v.BRACE_L:return this.parseObject(e);case v.INT:return this._lexer.advance(),{kind:c.INT,value:t.value,loc:this.loc(t)};case v.FLOAT:return this._lexer.advance(),{kind:c.FLOAT,value:t.value,loc:this.loc(t)};case v.STRING:case v.BLOCK_STRING:return this.parseStringLiteral();case v.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:c.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:c.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:c.NULL,loc:this.loc(t)};default:return{kind:c.ENUM,value:t.value,loc:this.loc(t)}}case v.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:c.STRING,value:e.value,block:e.kind===v.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:c.LIST,values:this.any(v.BRACKET_L,(function(){return t.parseValueLiteral(e)}),v.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:c.OBJECT,fields:this.any(v.BRACE_L,(function(){return t.parseObjectField(e)}),v.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(v.COLON),{kind:c.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(v.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(v.AT),{kind:c.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(v.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(v.BRACKET_R),e={kind:c.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(v.BANG)?{kind:c.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:c.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===v.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(v.STRING)||this.peek(v.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var n=this.parseDirectives(!0),r=this.many(v.BRACE_L,this.parseOperationTypeDefinition,v.BRACE_R);return{kind:c.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(v.COLON);var n=this.parseNamedType();return{kind:c.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:c.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:c.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(v.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(v.AMP)||this.peek(v.NAME));return t}return this.delimitedMany(v.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(v.BRACE_L)&&this._lexer.lookahead().kind===v.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(v.BRACE_L,this.parseFieldDefinition,v.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(v.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:c.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(v.PAREN_L,this.parseInputValueDef,v.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(v.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(v.EQUALS)&&(r=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:c.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:c.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:c.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(v.EQUALS)?this.delimitedMany(v.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:c.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(v.BRACE_L,this.parseEnumValueDefinition,v.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:c.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:c.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(v.BRACE_L,this.parseInputValueDef,v.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===v.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(v.BRACE_L,this.parseOperationTypeDefinition,v.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:c.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:c.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:c.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:c.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:c.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:c.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:c.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(v.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:c.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(v.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==A[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new f(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw s(this._lexer.source,t.start,"Expected ".concat(J(e),", found ").concat(W(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==v.NAME||t.value!==e)throw s(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(W(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===v.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return s(this._lexer.source,t.start,"Unexpected ".concat(W(t),"."))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n},e}();function W(e){var t=e.value;return J(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function J(e){return P(e)?'"'.concat(e,'"'):e}var Q={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Z=Object.freeze({});function $(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q,r=void 0,i=Array.isArray(e),o=[e],a=-1,s=[],c=void 0,u=void 0,l=void 0,d=[],f=[],p=e;do{var v=++a===o.length,g=v&&0!==s.length;if(v){if(u=0===f.length?void 0:d[d.length-1],c=l,l=f.pop(),g){if(i)c=c.slice();else{for(var m={},y=0,b=Object.keys(c);y<b.length;y++){var E=b[y];m[E]=c[E]}c=m}for(var w=0,S=0;S<s.length;S++){var T=s[S][0],I=s[S][1];i&&(T-=w),i&&null===I?(c.splice(T,1),w++):c[T]=I}}a=r.index,o=r.keys,s=r.edits,i=r.inArray,r=r.prev}else{if(u=l?i?a:o[a]:void 0,null==(c=l?l[u]:p))continue;l&&d.push(u)}var N,A=void 0;
vendor: 5,318 bytes, line 2
2if(!Array.isArray(c)){if(!h(c))throw new Error("Invalid AST Node: ".concat(_(c),"."));var C=ee(t,c.kind,v);if(C){if((A=C.call(t,c,u,l,d,f))===Z)break;if(!1===A){if(!v){d.pop();continue}}else if(void 0!==A&&(s.push([u,A]),!v)){if(!h(A)){d.pop();continue}c=A}}}if(void 0===A&&g&&s.push([u,c]),v)d.pop();else r={inArray:i,index:a,keys:o,edits:s,prev:r},o=(i=Array.isArray(c))?c:null!==(N=n[c.kind])&&void 0!==N?N:[],a=-1,s=[],l&&f.push(l),l=c}while(void 0!==r);return 0!==s.length&&(p=s[s.length-1][1]),p}function X(e){var t=new Array(e.length);return{enter:function(n){for(var r=0;r<e.length;r++)if(null==t[r]){var i=ee(e[r],n.kind,!1);if(i){var o=i.apply(e[r],arguments);if(!1===o)t[r]=n;else if(o===Z)t[r]=Z;else if(void 0!==o)return o}}},leave:function(n){for(var r=0;r<e.length;r++)if(null==t[r]){var i=ee(e[r],n.kind,!0);if(i){var o=i.apply(e[r],arguments);if(o===Z)t[r]=Z;else if(void 0!==o&&!1!==o)return o}}else t[r]===n&&(t[r]=null)}}}function ee(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var i=n?r.leave:r.enter;if("function"==typeof i)return i}else{var o=n?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}var te=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}},ne=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))};function re(e,t,n){var r,i=e instanceof Error?e:new Error("Unexpected error value: "+_(e));return Array.isArray(i.path)?i:new a.e(i.message,null!==(r=i.nodes)&&void 0!==r?r:t,i.source,i.positions,n,i)}var ie=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function oe(e){var t=ae(e);if(t)throw t;return e}function ae(e){return"string"==typeof e||w(0,"Expected name to be a string."),e.length>1&&"_"===e[0]&&"_"===e[1]?new a.e('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.')):ie.test(e)?void 0:new a.e('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}var se=Object.entries||function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))};function ce(e,t){return e.reduce((function(e,n){return e[t(n)]=n,e}),Object.create(null))}function ue(e,t){for(var n=Object.create(null),r=0,i=se(e);r<i.length;r++){var o=i[r],a=o[0],s=o[1];n[a]=t(s,a)}return n}function le(e){if(null===Object.getPrototypeOf(e))return e;for(var t=Object.create(null),n=0,r=se(e);n<r.length;n++){var i=r[n],o=i[0],a=i[1];t[o]=a}return t}function de(e,t,n){return e.reduce((function(e,r){return e[t(r)]=n(r),e}),Object.create(null))}var fe=5;function pe(e,t){var n="string"==typeof e?[e,t]:[void 0,e],r=n[0],i=" Did you mean ";r&&(i+=r+" ");var o=n[1].map((function(e){return'"'.concat(e,'"')}));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}var a=o.slice(0,fe),s=a.pop();return i+a.join(", ")+", or "+s+"?"}var he=n(34856);function ve(e){return e}function ge(e,t){for(var n=0,r=0;n<e.length&&r<t.length;){var i=e.charCodeAt(n),o=t.charCodeAt(r);if(be(i)&&be(o)){var a=0;do{++n,a=10*a+i-me,i=e.charCodeAt(n)}while(be(i)&&a>0);var s=0;do{++r,s=10*s+o-me,o=t.charCodeAt(r)}while(be(o)&&s>0);if(a<s)return-1;if(a>s)return 1}else{if(i<o)return-1;if(i>o)return 1;++n,++r}}return e.length-t.length}var me=48,ye=57;function be(e){return!isNaN(e)&&me<=e&&e<=ye}function _e(e,t){for(var n=Object.create(null),r=new Ee(e),i=Math.floor(.4*e.length)+1,o=0;o<t.length;o++){var a=t[o],s=r.measure(a,i);void 0!==s&&(n[a]=s)}return Object.keys(n).sort((function(e,t){var r=n[e]-n[t];return 0!==r?r:ge(e,t)}))}var Ee=function(){function e(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=we(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}return e.prototype.measure=function(e,t){if(this._input===e)return 0;var n=e.toLowerCase();if(this._inputLowerCase===n)return 1;var r=we(n),i=this._inputArray;if(r.length<i.length){var o=r;r=i,i=o}var a=r.length,s=i.length;if(!(a-s>t)){for(var c=this._rows,u=0;u<=s;u++)c[0][u]=u;for(var l=1;l<=a;l++){for(var d=c[(l-1)%3],f=c[l%3],p=f[0]=l,h=1;h<=s;h++){var v=r[l-1]===i[h-1]?0:1,g=Math.min(d[h]+1,f[h-1]+1,d[h-1]+v);if(l>1&&h>1&&r[l-1]===i[h-2]&&r[l-2]===i[h-1]){var m=c[(l-2)%3][h-2];g=Math.min(g,m+1)}g<p&&(p=g),f[h]=g}if(p>t)return}var y=c[a%3][s];return y<=t?y:void 0}},e}();function we(e){for(var t=e.length,n=new Array(t),r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function Se(e){return $(e,{leave:Te})}var Te={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return Ne(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=Ce("(",Ne(e.variableDefinitions,", "),")"),i=Ne(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?Ne([t,Ne([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+Ce(" = ",r)+Ce(" ",Ne(i," "))},SelectionSet:function(e){return Ae(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet,a=Ce("",t,": ")+n,s=a+Ce("(",Ne(r,", "),")");return s.length>80&&(s=a+Ce("(\n",Oe(Ne(r,"\n")),"\n)")),Ne([s,Ne(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value}
2,FragmentSpread:function(e){return"..."+e.name+Ce(" ",Ne(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return Ne(["...",Ce("on ",t),Ne(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(Ce("(",Ne(r,", "),")")," ")+"on ".concat(n," ").concat(Ce("",Ne(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?D(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+Ne(e.values,", ")+"]"},ObjectValue:function(e){return"{"+Ne(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Ce("(",Ne(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:Ie((function(e){var t=e.directives,n=e.operationTypes;return Ne(["schema",Ne(t," "),Ae(n)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:Ie((function(e){return Ne(["scalar",e.name,Ne(e.directives," ")]," ")})),ObjectTypeDefinition:Ie((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return Ne(["type",t,Ce("implements ",Ne(n," & ")),Ne(r," "),Ae(i)]," ")})),FieldDefinition:Ie((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(De(n)?Ce("(\n",Oe(Ne(n,"\n")),"\n)"):Ce("(",Ne(n,", "),")"))+": "+r+Ce(" ",Ne(i," "))})),InputValueDefinition:Ie((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return Ne([t+": "+n,Ce("= ",r),Ne(i," ")]," ")})),InterfaceTypeDefinition:Ie((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return Ne(["interface",t,Ce("implements ",Ne(n," & ")),Ne(r," "),Ae(i)]," ")})),UnionTypeDefinition:Ie((function(e){var t=e.name,n=e.directives,r=e.types;return Ne(["union",t,Ne(n," "),r&&0!==r.length?"= "+Ne(r," | "):""]," ")})),EnumTypeDefinition:Ie((function(e){var t=e.name,n=e.directives,r=e.values;return Ne(["enum",t,Ne(n," "),Ae(r)]," ")})),EnumValueDefinition:Ie((function(e){return Ne([e.name,Ne(e.directives," ")]," ")})),InputObjectTypeDefinition:Ie((function(e){var t=e.name,n=e.directives,r=e.fields;return Ne(["input",t,Ne(n," "),Ae(r)]," ")})),DirectiveDefinition:Ie((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(De(n)?Ce("(\n",Oe(Ne(n,"\n")),"\n)"):Ce("(",Ne(n,", "),")"))+(r?" repeatable":"")+" on "+Ne(i," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return Ne(["extend schema",Ne(t," "),Ae(n)]," ")},ScalarTypeExtension:function(e){return Ne(["extend scalar",e.name,Ne(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return Ne(["extend type",t,Ce("implements ",Ne(n," & ")),Ne(r," "),Ae(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return Ne(["extend interface",t,Ce("implements ",Ne(n," & ")),Ne(r," "),Ae(i)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return Ne(["extend union",t,Ne(n," "),r&&0!==r.length?"= "+Ne(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return Ne(["extend enum",t,Ne(n," "),Ae(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return Ne(["extend input",t,Ne(n," "),Ae(r)]," ")}};function Ie(e){return function(t){return Ne([t.description,e(t)],"\n")}}function Ne(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function Ae(e){return Ce("{\n",Oe(Ne(e,"\n")),"\n}")}function Ce(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function Oe(e){return Ce(" ",e.replace(/\n/g,"\n "))}function ke(e){return-1!==e.indexOf("\n")}function De(e){return null!=e&&e.some(ke)}function Re(e,t){switch(e.kind){case c.NULL:return null;case c.INT:return parseInt(e.value,10);case c.FLOAT:return parseFloat(e.value);case c.STRING:case c.ENUM:case c.BOOLEAN:return e.value;case c.LIST:return e.values.map((function(e){return Re(e,t)}));case c.OBJECT:return de(e.fields,(function(e){return e.name.value}),(function(e){return Re(e.value,t)}));case c.VARIABLE:return null==t?void 0:t[e.name.value]}u(0,"Unexpected value node: "+_(e))}function Pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xe(e,t,n){return t&&Pe(e.prototype,t),n&&Pe(e,n),e}function Me(e){return Ue(e)||je(e)||Ve(e)||qe(e)||Ke(e)||ze(e)||Je(e)||Ze(e)}function Le(e){if(!Me(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL type."));return e}function Ue(e){return S(e,Et)}function Fe(e){if(!Ue(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Scalar type."));return e}function je(e){return S(e,wt)}function Be(e){if(!je(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Object type."));return e}function Ve(e){return S(e,Ot)}function Ge(e){if(!Ve(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Interface type."));return e}function qe(e){return S(e,kt)}function Ye(e){if(!qe(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Union type."));return e}function Ke(e){return S(e,Rt)}function He(e){if(!Ke(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Enum type."));return e}function ze(e){return S(e,xt)}function We(e){if(!ze(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Input Object type."));return e}function Je(e){return S(e,ut)}function Qe(e){if(!Je(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL List type."));return e}function Ze(e){return S(e,lt)}function $e(e){if(!Ze(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL Non-Null type."));return e}function Xe(e){return Ue(e)||Ke(e)||ze(e)||dt(e)&&Xe(e.ofType)}function et(e){if(!Xe(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL input type."));return e}function tt(e){return Ue(e)||je(e)||Ve(e)||qe(e)||Ke(e)||dt(e)&&tt(e.ofType)}function nt(e){if(!tt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL output type."));return e}function rt(e){return Ue(e)||Ke(e)}function it(e){if(!rt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL leaf type."));return e}function ot(e){return je(e)||Ve(e)||qe(e)}function at(e){if(!ot(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL composite type."));return e}function st(e){return Ve(e)||qe(e)}function ct(e){if(!st(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL abstract type."));return e}function ut(e){if(!(this instanceof ut))return new ut(e);this.ofType=Le(e)}function lt(e){if(!(this instanceof lt))return new lt(e);this.ofType=ht(e)}function dt(e){return Je(e)||Ze(e)}
2function ft(e){if(!dt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL wrapping type."));return e}function pt(e){return Me(e)&&!Ze(e)}function ht(e){if(!pt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL nullable type."));return e}function vt(e){if(e)return Ze(e)?e.ofType:e}function gt(e){return Ue(e)||je(e)||Ve(e)||qe(e)||Ke(e)||ze(e)}function mt(e){if(!gt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL named type."));return e}function yt(e){if(e){for(var t=e;dt(t);)t=t.ofType;return t}}function bt(e){return"function"==typeof e?e():e}function _t(e){return e&&e.length>0?e:void 0}ut.prototype.toString=function(){return"["+String(this.ofType)+"]"},ut.prototype.toJSON=function(){return this.toString()},Object.defineProperty(ut.prototype,g.Kp,{get:function(){return"GraphQLList"}}),d(ut),lt.prototype.toString=function(){return String(this.ofType)+"!"},lt.prototype.toJSON=function(){return this.toString()},Object.defineProperty(lt.prototype,g.Kp,{get:function(){return"GraphQLNonNull"}}),d(lt);var Et=function(){function e(e){var t,n,r,i=null!==(t=e.parseValue)&&void 0!==t?t:ve;this.name=e.name,this.description=e.description,this.specifiedByUrl=e.specifiedByUrl,this.serialize=null!==(n=e.serialize)&&void 0!==n?n:ve,this.parseValue=i,this.parseLiteral=null!==(r=e.parseLiteral)&&void 0!==r?r:function(e,t){return i(Re(e,t))},this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),"string"==typeof e.name||w(0,"Must provide name."),null==e.specifiedByUrl||"string"==typeof e.specifiedByUrl||w(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(_(e.specifiedByUrl),".")),null==e.serialize||"function"==typeof e.serialize||w(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||w(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var e;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLScalarType"}}]),e}();d(Et);var wt=function(){function e(e){this.name=e.name,this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),this._fields=Tt.bind(void 0,e),this._interfaces=St.bind(void 0,e),"string"==typeof e.name||w(0,"Must provide name."),null==e.isTypeOf||"function"==typeof e.isTypeOf||w(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(_(e.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Nt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLObjectType"}}]),e}();function St(e){var t,n=null!==(t=bt(e.interfaces))&&void 0!==t?t:[];return Array.isArray(n)||w(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),n}function Tt(e){var t=bt(e.fields);return It(t)||w(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ue(t,(function(t,n){var r;It(t)||w(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in t)||w(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),null==t.resolve||"function"==typeof t.resolve||w(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat(_(t.resolve),"."));var i=null!==(r=t.args)&&void 0!==r?r:{};It(i)||w(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var o=se(i).map((function(e){var t=e[0],n=e[1];return{name:t,description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions&&le(n.extensions),astNode:n.astNode}}));return{name:n,description:t.description,type:t.type,args:o,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:null!=t.deprecationReason,deprecationReason:t.deprecationReason,extensions:t.extensions&&le(t.extensions),astNode:t.astNode}}))}function It(e){return(0,he.A)(e)&&!Array.isArray(e)}function Nt(e){return ue(e,(function(e){return{description:e.description,type:e.type,args:At(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}}))}function At(e){return de(e,(function(e){return e.name}),(function(e){return{description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}}))}function Ct(e){return Ze(e.type)&&void 0===e.defaultValue}d(wt);var Ot=function(){function e(e){this.name=e.name,this.description=e.description,this.resolveType=e.resolveType,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),this._fields=Tt.b
2ind(void 0,e),this._interfaces=St.bind(void 0,e),"string"==typeof e.name||w(0,"Must provide name."),null==e.resolveType||"function"==typeof e.resolveType||w(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(e.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var e;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Nt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLInterfaceType"}}]),e}();d(Ot);var kt=function(){function e(e){this.name=e.name,this.description=e.description,this.resolveType=e.resolveType,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),this._types=Dt.bind(void 0,e),"string"==typeof e.name||w(0,"Must provide name."),null==e.resolveType||"function"==typeof e.resolveType||w(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(e.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return"function"==typeof this._types&&(this._types=this._types()),this._types},t.toConfig=function(){var e;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLUnionType"}}]),e}();function Dt(e){var t=bt(e.types);return Array.isArray(t)||w(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}d(kt);var Rt=function(){function e(e){var t,n;this.name=e.name,this.description=e.description,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),this._values=(t=this.name,It(n=e.values)||w(0,"".concat(t," values must be an object with value names as keys.")),se(n).map((function(e){var n=e[0],r=e[1];return It(r)||w(0,"".concat(t,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(_(r),".")),!("isDeprecated"in r)||w(0,"".concat(t,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:r.description,value:void 0!==r.value?r.value:n,isDeprecated:null!=r.deprecationReason,deprecationReason:r.deprecationReason,extensions:r.extensions&&le(r.extensions),astNode:r.astNode}}))),this._valueLookup=new Map(this._values.map((function(e){return[e.value,e]}))),this._nameLookup=ce(this._values,(function(e){return e.name})),"string"==typeof e.name||w(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(e){return this._nameLookup[e]},t.serialize=function(e){var t=this._valueLookup.get(e);if(void 0===t)throw new a.e('Enum "'.concat(this.name,'" cannot represent value: ').concat(_(e)));return t.name},t.parseValue=function(e){if("string"!=typeof e){var t=_(e);throw new a.e('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(t,".")+Pt(this,t))}var n=this.getValue(e);if(null==n)throw new a.e('Value "'.concat(e,'" does not exist in "').concat(this.name,'" enum.')+Pt(this,e));return n.value},t.parseLiteral=function(e,t){if(e.kind!==c.ENUM){var n=Se(e);throw new a.e('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(n,".")+Pt(this,n),e)}var r=this.getValue(e.value);if(null==r){var i=Se(e);throw new a.e('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+Pt(this,i),e)}return r.value},t.toConfig=function(){var e,t=de(this.getValues(),(function(e){return e.name}),(function(e){return{description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLEnumType"}}]),e}();function Pt(e,t){return pe("the enum value",_e(t,e.getValues().map((function(e){return e.name}))))}d(Rt);var xt=function(){function e(e){this.name=e.name,this.description=e.description,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=_t(e.extensionASTNodes),this._fields=Mt.bind(void 0,e),"string"==typeof e.name||w(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var e,t=ue(this.getFields(),(function(e){return{description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},xe(e,[{key:g.Kp,get:function(){return"GraphQLInputObjectType"}}]),e}();function Mt(e){var t=bt(e.fields);return It(t)||w(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),ue(t,(function(t,n){return!("resolve"in t)||w(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&le(t.extensions),astNode:t.astNode}}))}function Lt(e){return Ze(e.type)&&void 0===e.defaultValue}function Ut(e,t){return e===t||(Ze(e)&&Ze(t)||!(!Je(e)||!Je(t)))&&Ut(e.ofType,t.ofType)}function Ft(e,t,n){return t===n||(Ze(n)?!!Ze(t)&&Ft(e,t.ofType,n.ofType):Ze(t)?Ft(e,t.ofType,n):Je
2(n)?!!Je(t)&&Ft(e,t.ofType,n.ofType):!Je(t)&&(st(n)&&(Ve(t)||je(t))&&e.isSubType(n,t)))}function jt(e,t,n){return t===n||(st(t)?st(n)?e.getPossibleTypes(t).some((function(t){return e.isSubType(n,t)})):e.isSubType(t,n):!!st(n)&&e.isSubType(n,t))}d(xt);var Bt=Array.from||function(e,t,n){if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var r=e[g.q4];if("function"==typeof r){for(var i,o=r.call(e),a=[],s=0;!(i=o.next()).done;++s)if(a.push(t.call(n,i.value,s)),s>9999999)throw new TypeError("Near-infinite iteration.");return a}var c=e.length;if("number"==typeof c&&c>=0&&c%1==0){for(var u=[],l=0;l<c;++l)Object.prototype.hasOwnProperty.call(e,l)&&u.push(t.call(n,e[l],l));return u}return[]},Vt=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)};function Gt(e){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(e)}function qt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};if(null==e||"object"!==Gt(e))return null;if(Array.isArray(e))return e.map(t);var n=e[g.q4];if("function"==typeof n){for(var r,i=n.call(e),o=[],a=0;!(r=i.next()).done;++a)o.push(t(r.value,a));return o}var s=e.length;if("number"==typeof s&&s>=0&&s%1==0){for(var c=[],u=0;u<s;++u){if(!Object.prototype.hasOwnProperty.call(e,u))return null;c.push(t(e[String(u)],u))}return c}return null}var Yt=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Kt=2147483647,Ht=-2147483648;var zt=new Et({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:function(e){var t=Jt(e);if("boolean"==typeof t)return t?1:0;var n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),!Yt(n))throw new a.e("Int cannot represent non-integer value: ".concat(_(t)));if(n>Kt||n<Ht)throw new a.e("Int cannot represent non 32-bit signed integer value: "+_(t));return n},parseValue:function(e){if(!Yt(e))throw new a.e("Int cannot represent non-integer value: ".concat(_(e)));if(e>Kt||e<Ht)throw new a.e("Int cannot represent non 32-bit signed integer value: ".concat(e));return e},parseLiteral:function(e){if(e.kind!==c.INT)throw new a.e("Int cannot represent non-integer value: ".concat(Se(e)),e);var t=parseInt(e.value,10);if(t>Kt||t<Ht)throw new a.e("Int cannot represent non 32-bit signed integer value: ".concat(e.value),e);return t}});var Wt=new Et({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:function(e){var t=Jt(e);if("boolean"==typeof t)return t?1:0;var n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),!Vt(n))throw new a.e("Float cannot represent non numeric value: ".concat(_(t)));return n},parseValue:function(e){if(!Vt(e))throw new a.e("Float cannot represent non numeric value: ".concat(_(e)));return e},parseLiteral:function(e){if(e.kind!==c.FLOAT&&e.kind!==c.INT)throw new a.e("Float cannot represent non numeric value: ".concat(Se(e)),e);return parseFloat(e.value)}});function Jt(e){if((0,he.A)(e)){if("function"==typeof e.valueOf){var t=e.valueOf();if(!(0,he.A)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}var Qt=new Et({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:function(e){var t=Jt(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if(Vt(t))return t.toString();throw new a.e("String cannot represent value: ".concat(_(e)))},parseValue:function(e){if("string"!=typeof e)throw new a.e("String cannot represent a non string value: ".concat(_(e)));return e},parseLiteral:function(e){if(e.kind!==c.STRING)throw new a.e("String cannot represent a non string value: ".concat(Se(e)),e);return e.value}});var Zt=new Et({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:function(e){var t=Jt(e);if("boolean"==typeof t)return t;if(Vt(t))return 0!==t;throw new a.e("Boolean cannot represent a non boolean value: ".concat(_(t)))},parseValue:function(e){if("boolean"!=typeof e)throw new a.e("Boolean cannot represent a non boolean value: ".concat(_(e)));return e},parseLiteral:function(e){if(e.kind!==c.BOOLEAN)throw new a.e("Boolean cannot represent a non boolean value: ".concat(Se(e)),e);return e.value}});var $t=new Et({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:function(e){var t=Jt(e);if("string"==typeof t)return t;if(Yt(t))return String(t);throw new a.e("ID cannot represent value: ".concat(_(e)))},parseValue:function(e){if("string"==typeof e)return e;if(Yt(e))return e.toString();throw new a.e("ID cannot represent value: ".concat(_(e)))},parseLiteral:function(e){if(e.kind!==c.STRING&&e.kind!==c.INT)throw new a.e("ID cannot represent a non-string and non-integer value: "+Se(e),e);return e.value}}),Xt=Object.freeze([Qt,zt,Wt,Zt,$t]);
2function en(e){return Xt.some((function(t){var n=t.name;return e.name===n}))}function tn(e,t){if(Ze(t)){var n=tn(e,t.ofType);return(null==n?void 0:n.kind)===c.NULL?null:n}if(null===e)return{kind:c.NULL};if(void 0===e)return null;if(Je(t)){var r=t.ofType,i=qt(e);if(null!=i){for(var o=[],a=0;a<i.length;a++){var s=tn(i[a],r);null!=s&&o.push(s)}return{kind:c.LIST,values:o}}return tn(e,r)}if(ze(t)){if(!(0,he.A)(e))return null;for(var l=[],d=0,f=ne(t.getFields());d<f.length;d++){var p=f[d],h=tn(e[p.name],p.type);h&&l.push({kind:c.OBJECT_FIELD,name:{kind:c.NAME,value:p.name},value:h})}return{kind:c.OBJECT,fields:l}}if(rt(t)){var v=t.serialize(e);if(null==v)return null;if("boolean"==typeof v)return{kind:c.BOOLEAN,value:v};if("number"==typeof v&&Vt(v)){var g=String(v);return nn.test(g)?{kind:c.INT,value:g}:{kind:c.FLOAT,value:g}}if("string"==typeof v)return Ke(t)?{kind:c.ENUM,value:v}:t===$t&&nn.test(v)?{kind:c.INT,value:v}:{kind:c.STRING,value:v};throw new TypeError("Cannot convert value to AST: ".concat(_(v),"."))}u(0,"Unexpected input type: "+_(t))}var nn=/^-?(?:0|[1-9][0-9]*)$/,rn=new wt({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:Qt,resolve:function(e){return e.description}},types:{description:"A list of all types supported by this server.",type:new lt(new ut(new lt(sn))),resolve:function(e){return ne(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new lt(sn),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:sn,resolve:function(e){return e.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:sn,resolve:function(e){return e.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new lt(new ut(new lt(on))),resolve:function(e){return e.getDirectives()}}}}}),on=new wt({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:function(){return{name:{type:new lt(Qt),resolve:function(e){return e.name}},description:{type:Qt,resolve:function(e){return e.description}},isRepeatable:{type:new lt(Zt),resolve:function(e){return e.isRepeatable}},locations:{type:new lt(new ut(new lt(an))),resolve:function(e){return e.locations}},args:{type:new lt(new ut(new lt(un))),args:{includeDeprecated:{type:Zt,defaultValue:!1}},resolve:function(e,t){return t.includeDeprecated?e.args:e.args.filter((function(e){return null==e.deprecationReason}))}}}}}),an=new Rt({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:A.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:A.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:A.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:A.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:A.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:A.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:A.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:A.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:A.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:A.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:A.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:A.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:A.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:A.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:A.UNION,description:"Location adjacent to a union definition."},ENUM:{value:A.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:A.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:A.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:A.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),sn=new wt({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new lt(fn),resolve:function(e){return Ue(e)?dn.SCALAR:je(e)?dn.OBJECT:Ve(e)?dn.INTERFACE:qe(e)?dn.UNION:Ke(e)?dn.ENUM:ze(e)?dn.INPUT_OBJECT:Je(e)?dn.LIST:Ze(e)?dn.NON_NULL:void u(0,'Unexpected type: "'.concat(_(e),'".'))}},name:{type:Qt,resolve:function(e){return void 0!==e.name?e.name:void 0}},description:{type:Qt,resolve:function(e){return void 0!==e.description?e.description:void 0}},specifiedByUrl:{type:Qt,resolve:function(e){return void 0!==e.specifiedByUrl?e.specifiedByUrl:void 0}},fields:{type:new ut(new lt(cn)),args:{includeDeprecated:{type:Zt,defaultValue:!1}},resolve:function(e,t){var n=t.includeDeprecated;if(je(e)||Ve(e)){var r=ne(e.getFields());return n?r:r.filter((function(e){return null==e.deprecationReason}))}}},interfaces:{type:new ut(new lt(sn)),resolve:function(e){if(je(e)||Ve(e))return e.getInterfaces()}},possibleTypes:{type:new ut(new lt(sn)),resolve:function(e,t,n,r){var i=r.schema;if(st(e))return i.getPossibleTypes(e)}},enumValues:{type:new ut(new lt(ln)),args:{includeDeprecated:{type:Zt,defaultValue:!1}},resolve:function(e,t){var n=t.includeDeprecated;if(Ke(e)){var r=e.getValues();return n?r:r.filter((function(e){return null==e.deprecationReason}))}}},inputFields:{type:new ut(new lt(un)),args:{includeDeprecated:{type:Zt,defaultValue:!1}},resolve:function(e,t){var n=t.includeDeprecated;if(ze(e)){var r=ne(e.getFields());return n?r:r.filter((function(e){return null==e.deprecationReason}))}}},ofType:{type:sn,resolve:function(e){return void 0!==e.ofType?e.ofType:void 0}}}}}
2),cn=new wt({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new lt(Qt),resolve:function(e){return e.name}},description:{type:Qt,resolve:function(e){return e.description}},args:{type:new lt(new ut(new lt(un))),args:{includeDeprecated:{type:Zt,defaultValue:!1}},resolve:function(e,t){return t.includeDeprecated?e.args:e.args.filter((function(e){return null==e.deprecationReason}))}},type:{type:new lt(sn),resolve:function(e){return e.type}},isDeprecated:{type:new lt(Zt),resolve:function(e){return null!=e.deprecationReason}},deprecationReason:{type:Qt,resolve:function(e){return e.deprecationReason}}}}}),un=new wt({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new lt(Qt),resolve:function(e){return e.name}},description:{type:Qt,resolve:function(e){return e.description}},type:{type:new lt(sn),resolve:function(e){return e.type}},defaultValue:{type:Qt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(e){var t=e.type,n=tn(e.defaultValue,t);return n?Se(n):null}},isDeprecated:{type:new lt(Zt),resolve:function(e){return null!=e.deprecationReason}},deprecationReason:{type:Qt,resolve:function(e){return e.deprecationReason}}}}}),ln=new wt({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new lt(Qt),resolve:function(e){return e.name}},description:{type:Qt,resolve:function(e){return e.description}},isDeprecated:{type:new lt(Zt),resolve:function(e){return null!=e.deprecationReason}},deprecationReason:{type:Qt,resolve:function(e){return e.deprecationReason}}}}}),dn=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),fn=new Rt({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:dn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:dn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:dn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:dn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:dn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:dn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:dn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:dn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),pn={name:"__schema",type:new lt(rn),description:"Access the current type schema of this server.",args:[],resolve:function(e,t,n,r){return r.schema},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},hn={name:"__type",type:sn,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new lt(Qt),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(e,t,n,r){var i=t.name;return r.schema.getType(i)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},vn={name:"__typename",type:new lt(Qt),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,t,n,r){return r.parentType.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},gn=Object.freeze([rn,on,an,sn,cn,un,ln,fn]);function mn(e){return gn.some((function(t){var n=t.name;return e.name===n}))}function yn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bn(e){return S(e,En)}function _n(e){if(!bn(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL directive."));return e}var En=function(){function e(e){var t,n;this.name=e.name,this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,e.name||w(0,"Directive must be named."),Array.isArray(e.locations)||w(0,"@".concat(e.name," locations must be an Array."));var r=null!==(n=e.args)&&void 0!==n?n:{};(0,he.A)(r)&&!Array.isArray(r)||w(0,"@".concat(e.name," args must be an object with argument names as keys.")),this.args=se(r).map((function(e){var t=e[0],n=e[1];return{name:t,description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions&&le(n.extensions),astNode:n.astNode}}))}var t,n,r,i=e.prototype;return i.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:At(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},i.toString=function(){return"@"+this.name},i.toJSON=function(){return this.toString()},t=e,(n=[{key:g.Kp,get:function(){return"GraphQLDirective"}}])&&yn(t.prototype,n),r&&yn(t,r),e}();d(En);var wn=new En({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[A.FIELD,A.FRAGMENT_SPREAD,A.INLINE_FRAGMENT],args:{if:{type:new lt(Zt),description:"Included when true."}}}),Sn=new En({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[A.FIELD,A.FRAGMENT_SPREAD,A.INLINE_FRAGMENT],args:{if:{type:new lt(Zt),description:"Skipped when true."}}}),Tn="No longer supported",In=new En({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[A.FIELD_DEFINITION,A.ARGUMENT_DEFINITION,A.INPUT_FIELD_DEFINITION,A.ENUM_VALUE],args:{reason:{type:Qt,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Tn}}}),Nn=new En({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[A.SCALAR],args:{url:{type:new lt(Qt),description:"The URL that specifies the behaviour of this scalar."}}}),An=Object.freeze([wn,Sn,In,Nn]);function Cn(e){return An.some((function(t){return t.name===e.name}))}function On(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kn(e){return S(e,Rn)}function Dn(e){if(!kn(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL schema."));return e}var Rn=function(){function e(e){var t;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,he.A)(e)||w(0,"Must provide configuration object."),!e.types||Array.isArray(e.types)||w(0,'"types" must be Array if provided but got: '.concat(_(e.types),".")),!e.directives||Array.isArray(e.directives)||w(0,'"directives" must be Array if provided but got: '+"".concat(_(e.directives),".")),this.description=e.description,this.extensions=e.extensions&&le(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes,this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!==(t=e.directives)&&void 0!==t?t:An;var n=new Set(e.types);if(null!=e.types)for(var r=0,i=e.types;r<i.length;r++){var o=i[r];n.delete(o),Pn(o,n)}null!=this._queryType&&Pn(this._queryType,n),null!=this._mutationType&&Pn(this._mutationType,n),null!=this._subscriptionType&&Pn(this._subscriptionType,n);for(var a=0,s=this._directives;a<s.length;a++){var c=s[a];if(bn(c))for(var u=0,l=c.args;u<l.length;u++){Pn(l[u].type,n)}}Pn(rn,n),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var d=0,f=Bt(n);d<f.length;d++){var p=f[d];if(null!=p){var h=p.name;if(h||w(0,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[h])throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(h,'".'));if(this._typeMap[h]=p,Ve(p))for(var v=0,g=p.getInterfaces();v<g.length;v++){var m=g[v];if(Ve(m)){var y=this._implementationsMap[m.name];void 0===y&&(y=this._implementationsMap[m.name]={objects:[],interfaces:[]}),y.interfaces.push(p)}}else if(je(p))for(var b=0,E=p.getInterfaces();b<E.length;b++){var S=E[b];if(Ve(S)){var T=this._implementationsMap[S.name];void 0===T&&(T=this._implementationsMap[S.name]={objects:[],interfaces:[]}),T.objects.push(p)}}}}}var t,n,r,i=e.prototype;return i.getQueryType=function(){return this._queryType},i.getMutationType=function(){return this._mutationType},i.getSubscriptionType=function(){return this._subscriptionType},i.getTypeMap=function(){return this._typeMap},i.getType=function(e){return this.getTypeMap()[e]},i.getPossibleTypes=function(e){return qe(e)?e.getTypes():this.getImplementations(e).objects},i.getImplementations=function(e){var t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}},i.isPossibleType=function(e,t){return this.isSubType(e,t)},i.isSubType=function(e,t){var n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),qe(e))for(var r=0,i=e.getTypes();r<i.length;r++){n[i[r].name]=!0}else{for(var o=this.getImplementations(e),a=0,s=o.objects;a<s.length;a++){n[s[a].name]=!0}for(var c=0,u=o.interfaces;c<u.length;c++){n[u[c].name]=!0}}this._subTypeMap[e.name]=n}return void 0!==n[t.name]},i.getDirectives=function(){return this._directives},i.getDirective=function(e){return te(this.getDirectives(),(function(t){return t.name===e}))},i.toConfig=function(){var e;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:ne(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:null!==(e=this.extensionASTNodes)&&void 0!==e?e:[],assumeValid:void 0!==this.__validationErrors}},t=e,(n=[{key:g.Kp,get:function(){return"GraphQLSchema"}}])&&On(t.prototype,n),r&&On(t,r),e}();function Pn(e,t){var n=yt(e);if(!t.has(n))if(t.add(n),qe(n))for(var r=0,i=n.getTypes();r<i.length;r++){Pn(i[r],t)}else if(je(n)||Ve(n)){for(var o=0,a=n.getInterfaces();o<a.length;o++){Pn(a[o],t)}for(var s=0,c=ne(n.getFields());s<c.length;s++){var u=c[s];Pn(u.type,t);for(var l=0,d=u.args;l<d.length;l++){Pn(d[l].type,t)}}}else if(ze(n))for(var f=0,p=ne(n.getFields());f<p.length;f++){Pn(p[f].type,t)}return t}function xn(e){if(Dn(e),e.__validationErrors)return e.__validationErrors;var t=new Ln(e);!function(e){var t=e.schema,n=t.getQueryType();if(n){if(!je(n)){var r;e.reportError("Query root type must be Object type, it cannot be ".concat(_(n),"."),null!==(r=Un(t,"query"))&&void 0!==r?r:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);var i,o=t.getMutationType();o&&!je(o)&&e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat(_(o),"."),null!==(i=Un(t,"mutation"))&&void 0!==i?i:o.astNode);var a,s=t.getSubscriptionType();s&&!je(s)&&e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat(_(s),"."),null!==(a=Un(t,"subscription"))&&void 0!==a?a:s.astNode)}
2(t),function(e){for(var t=0,n=e.schema.getDirectives();t<n.length;t++){var r=n[t];if(bn(r)){Fn(e,r);for(var i=0,o=r.args;i<o.length;i++){var a,s=o[i];if(Fn(e,s),Xe(s.type)||e.reportError("The type of @".concat(r.name,"(").concat(s.name,":) must be Input Type ")+"but got: ".concat(_(s.type),"."),s.astNode),Ct(s)&&null!=s.deprecationReason)e.reportError("Required argument @".concat(r.name,"(").concat(s.name,":) cannot be deprecated."),[Qn(s.astNode),null===(a=s.astNode)||void 0===a?void 0:a.type])}}else e.reportError("Expected directive but got: ".concat(_(r),"."),null==r?void 0:r.astNode)}}(t),function(e){for(var t=function(e){var t=Object.create(null),n=[],r=Object.create(null);return i;function i(o){if(!t[o.name]){t[o.name]=!0,r[o.name]=n.length;for(var a=ne(o.getFields()),s=0;s<a.length;s++){var c=a[s];if(Ze(c.type)&&ze(c.type.ofType)){var u=c.type.ofType,l=r[u.name];if(n.push(c),void 0===l)i(u);else{var d=n.slice(l),f=d.map((function(e){return e.name})).join(".");e.reportError('Cannot reference Input Object "'.concat(u.name,'" within itself through a series of non-null fields: "').concat(f,'".'),d.map((function(e){return e.astNode})))}n.pop()}}r[o.name]=void 0}}}(e),n=e.schema.getTypeMap(),r=0,i=ne(n);r<i.length;r++){var o=i[r];gt(o)?(mn(o)||Fn(e,o),je(o)||Ve(o)?(jn(e,o),Bn(e,o)):qe(o)?qn(e,o):Ke(o)?Yn(e,o):ze(o)&&(Kn(e,o),t(o))):e.reportError("Expected GraphQL named type but got: ".concat(_(o),"."),o.astNode)}}(t);var n=t.getErrors();return e.__validationErrors=n,n}function Mn(e){var t=xn(e);if(0!==t.length)throw new Error(t.map((function(e){return e.message})).join("\n\n"))}var Ln=function(){function e(e){this._errors=[],this.schema=e}var t=e.prototype;return t.reportError=function(e,t){var n=Array.isArray(t)?t.filter(Boolean):t;this.addError(new a.e(e,n))},t.addError=function(e){this._errors.push(e)},t.getErrors=function(){return this._errors},e}();function Un(e,t){for(var n=zn(e,(function(e){return e.operationTypes})),r=0;r<n.length;r++){var i=n[r];if(i.operation===t)return i.type}}function Fn(e,t){var n=ae(t.name);n&&e.addError(re(n,t.astNode))}function jn(e,t){var n=ne(t.getFields());0===n.length&&e.reportError("Type ".concat(t.name," must define one or more fields."),Hn(t));for(var r=0;r<n.length;r++){var i,o=n[r];if(Fn(e,o),!tt(o.type))e.reportError("The type of ".concat(t.name,".").concat(o.name," must be Output Type ")+"but got: ".concat(_(o.type),"."),null===(i=o.astNode)||void 0===i?void 0:i.type);for(var a=0,s=o.args;a<s.length;a++){var c,u,l=s[a],d=l.name;if(Fn(e,l),!Xe(l.type))e.reportError("The type of ".concat(t.name,".").concat(o.name,"(").concat(d,":) must be Input ")+"Type but got: ".concat(_(l.type),"."),null===(c=l.astNode)||void 0===c?void 0:c.type);if(Ct(l)&&null!=l.deprecationReason)e.reportError("Required argument ".concat(t.name,".").concat(o.name,"(").concat(d,":) cannot be deprecated."),[Qn(l.astNode),null===(u=l.astNode)||void 0===u?void 0:u.type])}}}function Bn(e,t){for(var n=Object.create(null),r=0,i=t.getInterfaces();r<i.length;r++){var o=i[r];Ve(o)?t!==o?n[o.name]?e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),Wn(t,o)):(n[o.name]=!0,Gn(e,t,o),Vn(e,t,o)):e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),Wn(t,o)):e.reportError("Type ".concat(_(t)," must only implement Interface types, ")+"it cannot implement ".concat(_(o),"."),Wn(t,o))}}function Vn(e,t,n){for(var r=t.getFields(),i=0,o=ne(n.getFields());i<o.length;i++){var a=o[i],s=a.name,c=r[s];if(c){var u,l;if(!Ft(e.schema,c.type,a.type))e.reportError("Interface field ".concat(n.name,".").concat(s," expects type ")+"".concat(_(a.type)," but ").concat(t.name,".").concat(s," ")+"is type ".concat(_(c.type),"."),[null===(u=a.astNode)||void 0===u?void 0:u.type,null===(l=c.astNode)||void 0===l?void 0:l.type]);for(var d=function(r,i){var o,a,u=i[r],l=u.name,d=te(c.args,(function(e){return e.name===l}));if(!d)return e.reportError("Interface field argument ".concat(n.name,".").concat(s,"(").concat(l,":) expected but ").concat(t.name,".").concat(s," does not provide it."),[u.astNode,c.astNode]),"continue";Ut(u.type,d.type)||e.reportError("Interface field argument ".concat(n.name,".").concat(s,"(").concat(l,":) ")+"expects type ".concat(_(u.type)," but ")+"".concat(t.name,".").concat(s,"(").concat(l,":) is type ")+"".concat(_(d.type),"."),[null===(o=u.astNode)||void 0===o?void 0:o.type,null===(a=d.astNode)||void 0===a?void 0:a.type])},f=0,p=a.args;f<p.length;f++)d(f,p);for(var h=function(r,i){var o=i[r],c=o.name;!te(a.args,(function(e){return e.name===c}))&&Ct(o)&&e.reportError("Object field ".concat(t.name,".").concat(s," includes required argument ").concat(c," that is missing from the Interface field ").concat(n.name,".").concat(s,"."),[o.astNode,a.astNode])},v=0,g=c.args;v<g.length;v++)h(v,g)}else e.reportError("Interface field ".concat(n.name,".").concat(s," expected but ").concat(t.name," does not provide it."),[a.astNode].concat(Hn(t)))}}function Gn(e,t,n){for(var r=t.getInterfaces(),i=0,o=n.getInterfaces();i<o.length;i++){var a=o[i];-1===r.indexOf(a)&&e.reportError(a===t?"Type ".concat(t.name," cannot implement ").concat(n.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(a.name," because it is implemented by ").concat(n.name,"."),[].concat(Wn(n,a),Wn(t,n)))}}function qn(e,t){var n=t.getTypes();0===n.length&&e.reportError("Union type ".concat(t.name," must define one or more member types."),Hn(t));for(var r=Object.create(null),i=0;i<n.length;i++){var o=n[i];r[o.name]?e.reportError("Union type ".concat(t.name," can only include type ").concat(o.name," once."),Jn(t,o.name)):(r[o.name]=!0,je(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat(_(o),"."),Jn(t,String(o))))}}function Yn(e,t){var n=t.getValues();0===n.length&&e.reportError("Enum type ".concat(t.name," must define one or more values."),Hn(t));for(var r=0;r<n.length;r++){var i=n[r],o=i.name;Fn(e,i),"true"!==o&&"false"!==o&&"null"!==o||e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function Kn(e,t){var n=ne(t.getFields());0===n.length&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),Hn(t));for(var r=0;r<n.length;r++){var i,o,a=n[r];if(Fn(e,a),!Xe(a.type))e.reportError("The type of ".concat(t.name,".").concat(a.name," must be Input Type ")+"but got: ".concat(_(a.type),"."),null===(i=a.astNode)||void 0===i?void 0:i.type);if(Lt(a)&&null!=a.deprecationReason)e.reportError("Required input field ".concat(t.name,".").concat(a.name," cannot be deprecated."),[Qn(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function Hn(e){var t=e.astNode,n=e.extensionASTNodes;return t?n?[t].concat(n):[t]:null!=n?n:[]}function zn(e,t){for(var n=[],r=0,i=Hn(e);r<i.length;r++){var o,a=i[r];n=n.concat(null!==(o=t(a))&&void 0!==o?o:[])}return n}function Wn(e,t){return zn(e,(function(e){return e.interfaces})).filter((function(e){return e.name.value===t.name}))}function Jn(e,t){return zn(e,(function(e){return e.types})).filter((function(e){return e.name.value===t}))}function Qn(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find((function(e){return e.name.value===In.name}))}function Zn(e,t){var n;return t.kind===c.LIST_TYPE?(n=Zn(e,t.type))&&new ut(n):t.kind===c.NON_NULL_TYPE?(n=Zn(e,t.type))&&new lt(n):t.kind===c.NAMED_TYPE?e.getType(t.name.value):void u(0,"Unexpected type node: "+_(t))}var $n=function(){function e(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=t?t:Xn,n&&(Xe(n)&&this._inputTypeStack.push(n),ot(n)&&this._parentTypeStack.push(n),tt(n)&&this._typeStack.push(n))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(e){var t=this._schema;switch(e.kind){case c.SELECTION_SET:var n=yt(this.getType());this._parentTypeStack.push(ot(n)?n:void 0);break;case c.FIELD:var r,i,o=this.getParentType();o&&(r=this._getFieldDef(t,o,e))&&(i=r.type),this._fieldDefStack.push(r),this._typeStack.push(tt(i)?i:void 0);break;case c.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case c.OPERATION_DEFINITION:var a;switch(e.operation){case"query":a=t.getQueryType();break;case"mutation":a=t.getMutationType();break;case"subscription":a=t.getSubscriptionType()}this._typeStack.push(je(a)?a:void 0);break;case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:var s=e.typeCondition,u=s?Zn(t,s):yt(this.getType());this._typeStack.push(tt(u)?u:void 0);break;case c.VARIABLE_DEFINITION:var l=Zn(t,e.type);this._inputTypeStack.push(Xe(l)?l:void 0);break;case c.ARGUMENT:var d,f,p,h=null!==(d=this.getDirective())&&void 0!==d?d:this.getFieldDef();h&&(f=te(h.args,(function(t){return t.name===e.name.value})))&&(p=f.type),this._argument=f,this._defaultValueStack.push(f?f.defaultValue:void 0),this._inputTypeStack.push(Xe(p)?p:void 0);break;case c.LIST:var v=vt(this.getInputType()),g=Je(v)?v.ofType:v;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Xe(g)?g:void 0);break;case c.OBJECT_FIELD:var m,y,b=yt(this.getInputType());ze(b)&&(y=b.getFields()[e.name.value])&&(m=y.type),this._defaultValueStack.push(y?y.defaultValue:void 0),this._inputTypeStack.push(Xe(m)?m:void 0);break;case c.ENUM:var _,E=yt(this.getInputType());Ke(E)&&(_=E.getValue(e.value)),this._enumValue=_}},t.leave=function(e){switch(e.kind){case c.SELECTION_SET:this._parentTypeStack.pop();break;case c.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case c.DIRECTIVE:this._directive=null;break;case c.OPERATION_DEFINITION:case c.INLINE_FRAGMENT:case c.FRAGMENT_DEFINITION:this._typeStack.pop();break;case c.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case c.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.LIST:case c.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case c.ENUM:this._enumValue=null}},e}();function Xn(e,t,n){var r=n.name.value;return r===pn.name&&e.getQueryType()===t?pn:r===hn.name&&e.getQueryType()===t?hn:r===vn.name&&ot(t)?vn:je(t)||Ve(t)?t.getFields()[r]:void 0}function er(e,t){return{enter:function(n){e.enter(n);var r=ee(t,n.kind,!1);if(r){var i=r.apply(t,arguments);return void 0!==i&&(e.leave(n),h(i)&&e.enter(i)),i}},leave:function(n){var r,i=ee(t,n.kind,!0);return i&&(r=i.apply(t,arguments)),e.leave(n),r}}}function tr(e){return nr(e)||ar(e)||cr(e)}function nr(e){return e.kind===c.OPERATION_DEFINITION||e.kind===c.FRAGMENT_DEFINITION}function rr(e){return e.kind===c.FIELD||e.kind===c.FRAGMENT_SPREAD||e.kind===c.INLINE_FRAGMENT}function ir(e){return e.kind===c.VARIABLE||e.kind===c.INT||e.kind===c.FLOAT||e.kind===c.STRING||e.kind===c.BOOLEAN||e.kind===c.NULL||e.kind===c.ENUM||e.kind===c.LIST||e.kind===c.OBJECT}function or(e){return e.kind===c.NAMED_TYPE||e.kind===c.LIST_TYPE||e.kind===c.NON_NULL_TYPE}function ar(e){return e.kind===c.SCHEMA_DEFINITION||sr(e)||e.kind===c.DIRECTIVE_DEFINITION}function sr(e){return e.kind===c.SCALAR_TYPE_DEFINITION||e.kind===c.OBJECT_TYPE_DEFINITION||e.kind===c.INTERFACE_TYPE_DEFINITION||e.kind===c.UNION_TYPE_DEFINITION||e.kind===c.ENUM_TYPE_DEFINITION||e.kind===c.INPUT_OBJECT_TYPE_DEFINITION}function cr(e){return e.kind===c.SCHEMA_EXTENSION||ur(e)}function ur(e){return e.kind===c.SCALAR_TYPE_EXTENSION||e.kind===c.OBJECT_TYPE_EXTENSION||e.kind===c.INTERFACE_TYPE_EXTENSION||e.kind===c.UNION_TYPE_EXTENSION||e.kind===c.ENUM_TYPE_EXTENSION||e.kind===c.INPUT_OBJECT_TYPE_EXTENSION}function lr(e){return{Document:function(t){for(var n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(!nr(i)){var o=i.kind===c.SCHEMA_DEFINITION||i.kind===c.SCHEMA_EXTENSION?"schema":'"'+i.name.value+'"';e.reportError(new a.e("The ".concat(o," definition is not executable."),i))}}return!1}}}function dr(e){var t=Object.create(null);return{OperationDefinition:function(n){var r=n.name;return r&&(t[r.value]?e.reportError(new a.e('There can be only one operation named "'.concat(r.value,'".'),[t[r.value],r])):t[r.value]=r),!1},FragmentDefinition:function(){return!1}}}function fr(e){var t=0;return{Document:function(e){t=e.definitions.filter((function(e){return e.kind===c.OPERATION_DEFINITION})).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new a.e("This anonymous operation must be the only defined operation.",n))}}}function pr(e){return{OperationDefinition:function(t){"subscription"===t.operation&&1!==t.selectionSet.selections.length&&e.reportError(new a.e(t.name?'Subscription "'.concat(t.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",t.selectionSet.selections.slice(1)))}}}function hr(e){for(var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null),i=0,o=e.getDocument().definitions;i<o.length;i++){var s=o[i];sr(s)&&(r[s.name.value]=!0)}var c=Object.keys(n).concat(Object.keys(r));return{NamedType:function(t,i,o,s,u){var l,d=t.name.value;
2if(!n[d]&&!r[d]){var f,p=null!==(f=u[2])&&void 0!==f?f:o,h=null!=p&&(l=p,!Array.isArray(l)&&(ar(l)||cr(l)));if(h&&function(e){return-1!==vr.indexOf(e)}(d))return;var v=_e(d,h?vr.concat(c):c);e.reportError(new a.e('Unknown type "'.concat(d,'".')+pe(v),t))}}}}var vr=[].concat(Xt,gn).map((function(e){return e.name}));function gr(e){return{InlineFragment:function(t){var n=t.typeCondition;if(n){var r=Zn(e.getSchema(),n);if(r&&!ot(r)){var i=Se(n);e.reportError(new a.e('Fragment cannot condition on non composite type "'.concat(i,'".'),n))}}},FragmentDefinition:function(t){var n=Zn(e.getSchema(),t.typeCondition);if(n&&!ot(n)){var r=Se(t.typeCondition);e.reportError(new a.e('Fragment "'.concat(t.name.value,'" cannot condition on non composite type "').concat(r,'".'),t.typeCondition))}}}}function mr(e){return{VariableDefinition:function(t){var n=Zn(e.getSchema(),t.type);if(n&&!Xe(n)){var r=t.variable.name.value,i=Se(t.type);e.reportError(new a.e('Variable "$'.concat(r,'" cannot be non-input type "').concat(i,'".'),t.type))}}}}function yr(e){return{Field:function(t){var n=e.getType(),r=t.selectionSet;if(n)if(rt(yt(n))){if(r){var i=t.name.value,o=_(n);e.reportError(new a.e('Field "'.concat(i,'" must not have a selection since type "').concat(o,'" has no subfields.'),r))}}else if(!r){var s=t.name.value,c=_(n);e.reportError(new a.e('Field "'.concat(s,'" of type "').concat(c,'" must have a selection of subfields. Did you mean "').concat(s,' { ... }"?'),t))}}}}function br(e){return{Field:function(t){var n=e.getParentType();if(n&&!e.getFieldDef()){var r=e.getSchema(),i=t.name.value,o=pe("to use an inline fragment on",function(e,t,n){if(!st(t))return[];for(var r=new Set,i=Object.create(null),o=0,a=e.getPossibleTypes(t);o<a.length;o++){var s=a[o];if(s.getFields()[n]){r.add(s),i[s.name]=1;for(var c=0,u=s.getInterfaces();c<u.length;c++){var l,d=u[c];d.getFields()[n]&&(r.add(d),i[d.name]=(null!==(l=i[d.name])&&void 0!==l?l:0)+1)}}}return Bt(r).sort((function(t,n){var r=i[n.name]-i[t.name];return 0!==r?r:Ve(t)&&e.isSubType(t,n)?-1:Ve(n)&&e.isSubType(n,t)?1:ge(t.name,n.name)})).map((function(e){return e.name}))}(r,n,i));""===o&&(o=pe(function(e,t){if(je(e)||Ve(e)){return _e(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new a.e('Cannot query field "'.concat(i,'" on type "').concat(n.name,'".')+o,t))}}}}function _r(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var r=n.name.value;return t[r]?e.reportError(new a.e('There can be only one fragment named "'.concat(r,'".'),[t[r],n.name])):t[r]=n.name,!1}}}function Er(e){return{FragmentSpread:function(t){var n=t.name.value;e.getFragment(n)||e.reportError(new a.e('Unknown fragment "'.concat(n,'".'),t.name))}}}function wr(e){var t=[],n=[];return{OperationDefinition:function(e){return t.push(e),!1},FragmentDefinition:function(e){return n.push(e),!1},Document:{leave:function(){for(var r=Object.create(null),i=0;i<t.length;i++)for(var o=t[i],s=0,c=e.getRecursivelyReferencedFragments(o);s<c.length;s++){r[c[s].name.value]=!0}for(var u=0;u<n.length;u++){var l=n[u],d=l.name.value;!0!==r[d]&&e.reportError(new a.e('Fragment "'.concat(d,'" is never used.'),l))}}}}}function Sr(e){return{InlineFragment:function(t){var n=e.getType(),r=e.getParentType();if(ot(n)&&ot(r)&&!jt(e.getSchema(),n,r)){var i=_(r),o=_(n);e.reportError(new a.e('Fragment cannot be spread here as objects of type "'.concat(i,'" can never be of type "').concat(o,'".'),t))}},FragmentSpread:function(t){var n=t.name.value,r=function(e,t){var n=e.getFragment(t);if(n){var r=Zn(e.getSchema(),n.typeCondition);if(ot(r))return r}}(e,n),i=e.getParentType();if(r&&i&&!jt(e.getSchema(),r,i)){var o=_(i),s=_(r);e.reportError(new a.e('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(o,'" can never be of type "').concat(s,'".'),t))}}}}function Tr(e){var t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(e){return i(e),!1}};function i(o){if(!t[o.name.value]){var s=o.name.value;t[s]=!0;var c=e.getFragmentSpreads(o.selectionSet);if(0!==c.length){r[s]=n.length;for(var u=0;u<c.length;u++){var l=c[u],d=l.name.value,f=r[d];if(n.push(l),void 0===f){var p=e.getFragment(d);p&&i(p)}else{var h=n.slice(f),v=h.slice(0,-1).map((function(e){return'"'+e.name.value+'"'})).join(", ");
2e.reportError(new a.e('Cannot spread fragment "'.concat(d,'" within itself')+(""!==v?" via ".concat(v,"."):"."),h))}n.pop()}r[s]=void 0}}}}function Ir(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var r=n.variable.name.value;t[r]?e.reportError(new a.e('There can be only one variable named "$'.concat(r,'".'),[t[r],n.variable.name])):t[r]=n.variable.name}}}function Nr(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var r=e.getRecursiveVariableUsages(n),i=0;i<r.length;i++){var o=r[i].node,s=o.name.value;!0!==t[s]&&e.reportError(new a.e(n.name?'Variable "$'.concat(s,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(s,'" is not defined.'),[o,n]))}}},VariableDefinition:function(e){t[e.variable.name.value]=!0}}}function Ar(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var r=Object.create(null),i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){r[i[o].node.name.value]=!0}for(var s=0,c=t;s<c.length;s++){var u=c[s],l=u.variable.name.value;!0!==r[l]&&e.reportError(new a.e(n.name?'Variable "$'.concat(l,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(l,'" is never used.'),u))}}},VariableDefinition:function(e){t.push(e)}}}function Cr(e){for(var t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():An,i=0;i<r.length;i++){var o=r[i];t[o.name]=o.locations}for(var s=e.getDocument().definitions,l=0;l<s.length;l++){var d=s[l];d.kind===c.DIRECTIVE_DEFINITION&&(t[d.name.value]=d.locations.map((function(e){return e.value})))}return{Directive:function(n,r,i,o,s){var l=n.name.value,d=t[l];if(d){var f=function(e){var t=e[e.length-1];switch(!Array.isArray(t)||u(0),t.kind){case c.OPERATION_DEFINITION:return function(e){switch(e){case"query":return A.QUERY;case"mutation":return A.MUTATION;case"subscription":return A.SUBSCRIPTION}u(0,"Unexpected operation: "+_(e))}(t.operation);case c.FIELD:return A.FIELD;case c.FRAGMENT_SPREAD:return A.FRAGMENT_SPREAD;case c.INLINE_FRAGMENT:return A.INLINE_FRAGMENT;case c.FRAGMENT_DEFINITION:return A.FRAGMENT_DEFINITION;case c.VARIABLE_DEFINITION:return A.VARIABLE_DEFINITION;case c.SCHEMA_DEFINITION:case c.SCHEMA_EXTENSION:return A.SCHEMA;case c.SCALAR_TYPE_DEFINITION:case c.SCALAR_TYPE_EXTENSION:return A.SCALAR;case c.OBJECT_TYPE_DEFINITION:case c.OBJECT_TYPE_EXTENSION:return A.OBJECT;case c.FIELD_DEFINITION:return A.FIELD_DEFINITION;case c.INTERFACE_TYPE_DEFINITION:case c.INTERFACE_TYPE_EXTENSION:return A.INTERFACE;case c.UNION_TYPE_DEFINITION:case c.UNION_TYPE_EXTENSION:return A.UNION;case c.ENUM_TYPE_DEFINITION:case c.ENUM_TYPE_EXTENSION:return A.ENUM;case c.ENUM_VALUE_DEFINITION:return A.ENUM_VALUE;case c.INPUT_OBJECT_TYPE_DEFINITION:case c.INPUT_OBJECT_TYPE_EXTENSION:return A.INPUT_OBJECT;case c.INPUT_VALUE_DEFINITION:return e[e.length-3].kind===c.INPUT_OBJECT_TYPE_DEFINITION?A.INPUT_FIELD_DEFINITION:A.ARGUMENT_DEFINITION}}(s);f&&-1===d.indexOf(f)&&e.reportError(new a.e('Directive "@'.concat(l,'" may not be used on ').concat(f,"."),n))}else e.reportError(new a.e('Unknown directive "@'.concat(l,'".'),n))}}}function Or(e){for(var t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():An,i=0;i<r.length;i++){var o=r[i];t[o.name]=!o.isRepeatable}for(var s=e.getDocument().definitions,u=0;u<s.length;u++){var l=s[u];l.kind===c.DIRECTIVE_DEFINITION&&(t[l.name.value]=!l.repeatable)}var d=Object.create(null),f=Object.create(null);return{enter:function(n){if(null!=n.directives){var r;if(n.kind===c.SCHEMA_DEFINITION||n.kind===c.SCHEMA_EXTENSION)r=d;else if(sr(n)||ur(n)){var i=n.name.value;void 0===(r=f[i])&&(f[i]=r=Object.create(null))}else r=Object.create(null);for(var o=0,s=n.directives;o<s.length;o++){var u=s[o],l=u.name.value;t[l]&&(r[l]?e.reportError(new a.e('The directive "@'.concat(l,'" can only be used once at this location.'),[r[l],u])):r[l]=u)}}}}}function kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?kr(Object(n),!0).forEach((function(t){Rr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pr(e){return Dr(Dr({},xr(e)),{},{Argument:function(t){var n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){var o=t.name.value,s=_e(o,r.args.map((function(e){return e.name})));e.reportError(new a.e('Unknown argument "'.concat(o,'" on field "').concat(i.name,".").concat(r.name,'".')+pe(s),t))}}})}function xr(e){for(var t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():An,i=0;i<r.length;i++){var o=r[i];t[o.name]=o.args.map((function(e){return e.name}))}for(var s=e.getDocument().definitions,u=0;u<s.length;u++){var l=s[u];if(l.kind===c.DIRECTIVE_DEFINITION){var d,f=null!==(d=l.arguments)&&void 0!==d?d:[];t[l.name.value]=f.map((function(e){return e.name.value}))}}return{Directive:function(n){var r=n.name.value,i=t[r];if(n.arguments&&i)for(var o=0,s=n.arguments;o<s.length;o++){var c=s[o],u=c.name.value;if(-1===i.indexOf(u)){var l=_e(u,i);e.reportError(new a.e('Unknown argument "'.concat(u,'" on directive "@').concat(r,'".')+pe(l),c))}}return!1}}}function Mr(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var r=n.name.value;return t[r]?e.reportError(new a.e('There can be only one argument named "'.concat(r,'".'),[t[r],n.name])):t[r]=n.name,!1}}}function Lr(e){return{ListValue:function(t){if(!Je(vt(e.getParentInputType())))return Ur(e,t),!1},ObjectValue:function(t){var n=yt(e.getInputType());if(!ze(n))return Ur(e,t),!1;for(var r=ce(t.fields,(function(e){return e.name.value})),i=0,o=ne(n.getFields());i<o.length;i++){var s=o[i];if(!r[s.name]&&Lt(s)){var c=_(s.type);e.reportError(new a.e('Field "'.concat(n.name,".").concat(s.name,'" of required type "').concat(c,'" was not provided.'),t))}}},ObjectField:function(t){var n=yt(e.getParentInputType());if(!e.getInputType()&&ze(n)){var r=_e(t.name.value,Object.keys(n.getFields()));e.reportError(new a.e('Field "'.concat(t.name.value,'" is not defined by type "').concat(n.name,'".')+pe(r),t))}},NullValue:function(t){var n=e.getInputType();Ze(n)&&e.reportError(new a.e('Expected value of type "'.concat(_(n),'", found ').concat(Se(t),"."),t))},EnumValue:function(t){return Ur(e,t)},IntValue:function(t){return Ur(e,t)},FloatValue:function(t){return Ur(e,t)},StringValue:function(t){return Ur(e,t)},BooleanValue:function(t){return Ur(e,t)}}}function Ur(e,t){var n=e.getInputType();if(n){var r=yt(n);if(rt(r))try{if(void 0===r.parseLiteral(t,void 0)){var i=_(n);e.reportError(new a.e('Expected value of type "'.concat(i,'", found ').concat(Se(t),"."),t))}}catch(c){var o=_(n);c instanceof a.e?e.reportError(c):e.reportError(new a.e('Expected value of type "'.concat(o,'", found ').concat(Se(t),"; ")+c.message,t,void 0,void 0,void 0,c))}else{var s=_(n);e.reportError(new a.e('Expected value of type "'.concat(s,'", found ').concat(Se(t),"."),t))}}}function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?Fr(Object(n),!0).forEach((function(t){Br(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vr(e){return jr(jr({},Gr(e)),{},{Field:{leave:function(t){var n,r=e.getFieldDef();if(!r)return!1;for(var i=ce(null!==(n=t.arguments)&&void 0!==n?n:[],(function(e){return e.name.value})),o=0,s=r.args;o<s.length;o++){var c=s[o];if(!i[c.name]&&Ct(c)){var u=_(c.type);e.reportError(new a.e('Field "'.concat(r.name,'" argument "').concat(c.name,'" of type "').concat(u,'" is required, but it was not provided.'),t))}}}}})}function Gr(e){for(var t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():An,i=0;i<r.length;i++){var o=r[i];t[o.name]=ce(o.args.filter(Ct),(function(e){return e.name}))}for(var s=e.getDocument().definitions,u=0;u<s.length;u++){var l=s[u];if(l.kind===c.DIRECTIVE_DEFINITION){var d,f=null!==(d=l.arguments)&&void 0!==d?d:[];t[l.name.value]=ce(f.filter(qr),(function(e){return e.name.value}))}}return{Directive:{leave:function(n){var r=n.name.value,i=t[r];if(i)for(var o,s=ce(null!==(o=n.arguments)&&void 0!==o?o:[],(function(e){return e.name.value})),c=0,u=Object.keys(i);c<u.length;c++){var l=u[c];if(!s[l]){var d=i[l].type,f=Me(d)?_(d):Se(d);e.reportError(new a.e('Directive "@'.concat(r,'" argument "').concat(l,'" of type "').concat(f,'" is required, but it was not provided.'),n))}}}}}}function qr(e){return e.type.kind===c.NON_NULL_TYPE&&null==e.defaultValue}function Yr(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var r=e.getRecursiveVariableUsages(n),i=0;i<r.length;i++){var o=r[i],s=o.node,c=o.type,u=o.defaultValue,l=s.name.value,d=t[l];if(d&&c){var f=e.getSchema(),p=Zn(f,d.type);if(p&&!Kr(f,p,d.defaultValue,c,u)){var h=_(p),v=_(c);e.reportError(new a.e('Variable "$'.concat(l,'" of type "').concat(h,'" used in position expecting type "').concat(v,'".'),[d,s]))}}}}},VariableDefinition:function(e){t[e.variable.name.value]=e}}}function Kr(e,t,n,r,i){return Ze(r)&&!Ze(t)?(null!=n&&n.kind!==c.NULL||void 0!==i)&&Ft(e,t,r.ofType):Ft(e,t,r)}function Hr(e){return Array.isArray(e)?e.map((function(e){var t=e[0],n=e[1];return'subfields "'.concat(t,'" conflict because ')+Hr(n)})).join(" and "):e}function zr(e){var t=new ri,n=new Map;return{SelectionSet:function(r){for(var i=function(e,t,n,r,i){var o=[],a=Xr(e,t,r,i),s=a[0],c=a[1];if(function(e,t,n,r,i){for(var o=0,a=se(i);o<a.length;o++){var s=a[o],c=s[0],u=s[1];if(u.length>1)for(var l=0;l<u.length;l++)for(var d=l+1;d<u.length;d++){var f=Zr(e,n,r,!1,c,u[l],u[d]);f&&t.push(f)}}}(e,o,t,n,s),0!==c.length)for(var u=0;u<c.length;u++){Wr(e,o,t,n,!1,s,c[u]);for(var l=u+1;l<c.length;l++)Jr(e,o,t,n,!1,c[u],c[l])}return o}(e,n,t,e.getParentType(),r),o=0;o<i.length;o++){var s=i[o],c=s[0],u=c[0],l=c[1],d=s[1],f=s[2],p=Hr(l);e.reportError(new a.e('Fields "'.concat(u,'" conflict because ').concat(p,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(f)))}}}}function Wr(e,t,n,r,i,o,a){var s=e.getFragment(a);if(s){var c=ei(e,n,s),u=c[0],l=c[1];if(o!==u){Qr(e,t,n,r,i,o,u);for(var d=0;d<l.length;d++)Wr(e,t,n,r,i,o,l[d])}}}function Jr(e,t,n,r,i,o,a){if(o!==a&&!r.has(o,a,i)){r.add(o,a,i);var s=e.getFragment(o),c=e.getFragment(a);if(s&&c){var u=ei(e,n,s),l=u[0],d=u[1],f=ei(e,n,c),p=f[0],h=f[1];Qr(e,t,n,r,i,l,p);for(var v=0;v<h.length;v++)Jr(e,t,n,r,i,o,h[v]);for(var g=0;g<d.length;g++)Jr(e,t,n,r,i,d[g],a)}}}function Qr(e,t,n,r,i,o,a){for(var s=0,c=Object.keys(o);s<c.length;s++){var u=c[s],l=a[u];if(l)for(var d=o[u],f=0;f<d.length;f++)for(var p=0;p<l.length;p++){var h=Zr(e,n,r,i,u,d[f],l[p]);h&&t.push(h)}}}function Zr(e,t,n,r,i,o,a){var s=o[0],c=o[1],u=o[2],l=a[0],d=a[1],f=a[2],p=r||s!==l&&je(s)&&je(l);if(!p){var h,v,g=c.name.value,m=d.name.value;if(g!==m)return[[i,'"'.concat(g,'" and "').concat(m,'" are different fields')],[c],[d]];if(!function(e,t){if(e.length!==t.length)return!1;return e.every((function(e){var n,r,i=te(t,(function(t){return t.name.value===e.name.value}));return!!i&&(n=e.value,r=i.value,Se(n)===Se(r))}))}(null!==(h=c.arguments)&&void 0!==h?h:[],null!==(v=d.arguments)&&void 0!==v?v:[]))return[[i,"they have differing arguments"],[c],[d]]}var y=null==u?void 0:u.type,b=null==f?void 0:f.type;if(y&&b&&$r(y,b))return[[i,'they return conflicting types "'.concat(_(y),'" and "').concat(_(b),'"')],[c],[d]];var E=c.selectionSet,w=d.selectionSet;if(E&&w){var S=function(e,t,n,r,i,o,a,s){var c=[],u=Xr(e,t,i,o),l=u[0],d=u[1],f=Xr(e,t,a,s),p=f[0],h=f[1];if(Qr(e,c,t,n,r,l,p),0!==h.length)for(var v=0;v<h.length;v++)Wr(e,c,t,n,r,l,h[v]);if(0!==d.length)for(var g=0;g<d.length;g++)Wr(e,c,t,n,r,p,d[g]);for(var m=0;m<d.length;m++)for(var y=0;
2y<h.length;y++)Jr(e,c,t,n,r,d[m],h[y]);return c}(e,t,n,p,yt(y),E,yt(b),w);return function(e,t,n,r){if(e.length>0)return[[t,e.map((function(e){return e[0]}))],e.reduce((function(e,t){var n=t[1];return e.concat(n)}),[n]),e.reduce((function(e,t){var n=t[2];return e.concat(n)}),[r])]}(S,i,c,d)}}function $r(e,t){return Je(e)?!Je(t)||$r(e.ofType,t.ofType):!!Je(t)||(Ze(e)?!Ze(t)||$r(e.ofType,t.ofType):!!Ze(t)||!(!rt(e)&&!rt(t))&&e!==t)}function Xr(e,t,n,r){var i=t.get(r);if(!i){var o=Object.create(null),a=Object.create(null);ti(e,n,r,o,a),i=[o,Object.keys(a)],t.set(r,i)}return i}function ei(e,t,n){var r=t.get(n.selectionSet);if(r)return r;var i=Zn(e.getSchema(),n.typeCondition);return Xr(e,t,i,n.selectionSet)}function ti(e,t,n,r,i){for(var o=0,a=n.selections;o<a.length;o++){var s=a[o];switch(s.kind){case c.FIELD:var u=s.name.value,l=void 0;(je(t)||Ve(t))&&(l=t.getFields()[u]);var d=s.alias?s.alias.value:u;r[d]||(r[d]=[]),r[d].push([t,s,l]);break;case c.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case c.INLINE_FRAGMENT:var f=s.typeCondition,p=f?Zn(e.getSchema(),f):t;ti(e,p,s.selectionSet,r,i)}}}var ni,ri=function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(e,t,n){var r=this._data[e],i=r&&r[t];return void 0!==i&&(!1!==n||!1===i)},t.add=function(e,t,n){this._pairSetAdd(e,t,n),this._pairSetAdd(t,e,n)},t._pairSetAdd=function(e,t,n){var r=this._data[e];r||(r=Object.create(null),this._data[e]=r),r[t]=n},e}();function ii(e){var t=[],n=Object.create(null);return{ObjectValue:{enter:function(){t.push(n),n=Object.create(null)},leave:function(){n=t.pop()}},ObjectField:function(t){var r=t.name.value;n[r]?e.reportError(new a.e('There can be only one input field named "'.concat(r,'".'),[n[r],t.name])):n[r]=t.name}}}function oi(e){var t,n,r,i=e.getSchema(),o=null!==(t=null!==(n=null!==(r=null==i?void 0:i.astNode)&&void 0!==r?r:null==i?void 0:i.getQueryType())&&void 0!==n?n:null==i?void 0:i.getMutationType())&&void 0!==t?t:null==i?void 0:i.getSubscriptionType(),s=0;return{SchemaDefinition:function(t){o?e.reportError(new a.e("Cannot define a new schema within a schema extension.",t)):(s>0&&e.reportError(new a.e("Must provide only one schema definition.",t)),++s)}}}function ai(e){var t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){for(var i,o=null!==(i=t.operationTypes)&&void 0!==i?i:[],s=0;s<o.length;s++){var c=o[s],u=c.operation,l=n[u];r[u]?e.reportError(new a.e("Type for ".concat(u," already defined in the schema. It cannot be redefined."),c)):l?e.reportError(new a.e("There can be only one ".concat(u," type in schema."),[l,c])):n[u]=c}return!1}}function si(e){var t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){var i=r.name.value;if(null==n||!n.getType(i))return t[i]?e.reportError(new a.e('There can be only one type named "'.concat(i,'".'),[t[i],r.name])):t[i]=r.name,!1;e.reportError(new a.e('Type "'.concat(i,'" already exists in the schema. It cannot also be defined in this type definition.'),r.name))}}function ci(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){var i,o=t.name.value;r[o]||(r[o]=Object.create(null));for(var s=null!==(i=t.values)&&void 0!==i?i:[],c=r[o],u=0;u<s.length;u++){var l=s[u],d=l.name.value,f=n[o];Ke(f)&&f.getValue(d)?e.reportError(new a.e('Enum value "'.concat(o,".").concat(d,'" already exists in the schema. It cannot also be defined in this type extension.'),l.name)):c[d]?e.reportError(new a.e('Enum value "'.concat(o,".").concat(d,'" can only be defined once.'),[c[d],l.name])):c[d]=l.name}return!1}}function ui(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){var i,o=t.name.value;r[o]||(r[o]=Object.create(null));for(var s=null!==(i=t.fields)&&void 0!==i?i:[],c=r[o],u=0;u<s.length;u++){var l=s[u],d=l.name.value;li(n[o],d)?e.reportError(new a.e('Field "'.concat(o,".").concat(d,'" already exists in the schema. It cannot also be defined in this type extension.'),l.name)):c[d]?e.reportError(new a.e('Field "'.concat(o,".").concat(d,'" can only be defined once.'),[c[d],l.name])):c[d]=l.name}return!1}}function li(e,t){return!!(je(e)||Ve(e)||ze(e))&&null!=e.getFields()[t]}function di(e){var t=Object.create(null),n=e.getSchema();return{DirectiveDefinition:function(r){var i=r.name.value;if(null==n||!n.getDirective(i))return t[i]?e.reportError(new a.e('There can be only one directive named "@'.concat(i,'".'),[t[i],r.name])):t[i]=r.name,!1;e.reportError(new a.e('Directive "@'.concat(i,'" already exists in the schema. It cannot be redefined.'),r.name))}}}function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pi(e){for(var t=e.getSchema(),n=Object.create(null),r=0,i=e.getDocument().definitions;r<i.length;r++){var o=i[r];sr(o)&&(n[o.name.value]=o)}return{ScalarTypeExtension:s,ObjectTypeExtension:s,InterfaceTypeExtension:s,UnionTypeExtension:s,EnumTypeExtension:s,InputObjectTypeExtension:s};function s(r){var i,o=r.name.value,s=n[o],l=null==t?void 0:t.getType(o);if(s?i=hi[s.kind]:l&&(i=function(e){if(Ue(e))return c.SCALAR_TYPE_EXTENSION;if(je(e))return c.OBJECT_TYPE_EXTENSION;if(Ve(e))return c.INTERFACE_TYPE_EXTENSION;if(qe(e))return c.UNION_TYPE_EXTENSION;if(Ke(e))return c.ENUM_TYPE_EXTENSION;if(ze(e))return c.INPUT_OBJECT_TYPE_EXTENSION;u(0,"Unexpected type: "+_(e))}(l)),i){if(i!==r.kind){var d=function(e){switch(e){case c.SCALAR_TYPE_EXTENSION:return"scalar";case c.OBJECT_TYPE_EXTENSION:return"object";case c.INTERFACE_TYPE_EXTENSION:return"interface";case c.UNION_TYPE_EXTENSION:return"union";case c.ENUM_TYPE_EXTENSION:return"enum";
2case c.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}u(0,"Unexpected kind: "+_(e))}(r.kind);e.reportError(new a.e("Cannot extend non-".concat(d,' type "').concat(o,'".'),s?[s,r]:r))}}else{var f=Object.keys(n);t&&(f=f.concat(Object.keys(t.getTypeMap())));var p=_e(o,f);e.reportError(new a.e('Cannot extend type "'.concat(o,'" because it is not defined.')+pe(p),r.name))}}}var hi=(fi(ni={},c.SCALAR_TYPE_DEFINITION,c.SCALAR_TYPE_EXTENSION),fi(ni,c.OBJECT_TYPE_DEFINITION,c.OBJECT_TYPE_EXTENSION),fi(ni,c.INTERFACE_TYPE_DEFINITION,c.INTERFACE_TYPE_EXTENSION),fi(ni,c.UNION_TYPE_DEFINITION,c.UNION_TYPE_EXTENSION),fi(ni,c.ENUM_TYPE_DEFINITION,c.ENUM_TYPE_EXTENSION),fi(ni,c.INPUT_OBJECT_TYPE_DEFINITION,c.INPUT_OBJECT_TYPE_EXTENSION),ni);var vi=Object.freeze([lr,dr,fr,pr,hr,gr,mr,yr,br,_r,Er,wr,Sr,Tr,Ir,Nr,Ar,Cr,Or,Pr,Mr,Lr,Vr,Yr,zr,ii]),gi=Object.freeze([oi,ai,si,ci,ui,di,hr,Cr,Or,pi,xr,Mr,ii,Gr]);function mi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var yi=function(){function e(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}var t=e.prototype;return t.reportError=function(e){this._onError(e)},t.getDocument=function(){return this._ast},t.getFragment=function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce((function(e,t){return t.kind===c.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e}),Object.create(null))),t[e]},t.getFragmentSpreads=function(e){var t=this._fragmentSpreads.get(e);if(!t){t=[];for(var n=[e];0!==n.length;)for(var r=0,i=n.pop().selections;r<i.length;r++){var o=i[r];o.kind===c.FRAGMENT_SPREAD?t.push(o):o.selectionSet&&n.push(o.selectionSet)}this._fragmentSpreads.set(e,t)}return t},t.getRecursivelyReferencedFragments=function(e){var t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];for(var n=Object.create(null),r=[e.selectionSet];0!==r.length;)for(var i=r.pop(),o=0,a=this.getFragmentSpreads(i);o<a.length;o++){var s=a[o].name.value;if(!0!==n[s]){n[s]=!0;var c=this.getFragment(s);c&&(t.push(c),r.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t},e}(),bi=function(e){function t(t,n,r){var i;return(i=e.call(this,t,r)||this)._schema=n,i}return mi(t,e),t.prototype.getSchema=function(){return this._schema},t}(yi),_i=function(e){function t(t,n,r,i){var o;return(o=e.call(this,n,i)||this)._schema=t,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}mi(t,e);var n=t.prototype;return n.getSchema=function(){return this._schema},n.getVariableUsages=function(e){var t=this._variableUsages.get(e);if(!t){var n=[],r=new $n(this._schema);$(e,er(r,{VariableDefinition:function(){return!1},Variable:function(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t},n.getRecursiveVariableUsages=function(e){var t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(var n=0,r=this.getRecursivelyReferencedFragments(e);n<r.length;n++){var i=r[n];t=t.concat(this.getVariableUsages(i))}this._recursiveVariableUsages.set(e,t)}return t},n.getType=function(){return this._typeInfo.getType()},n.getParentType=function(){return this._typeInfo.getParentType()},n.getInputType=function(){return this._typeInfo.getInputType()},n.getParentInputType=function(){return this._typeInfo.getParentInputType()},n.getFieldDef=function(){return this._typeInfo.getFieldDef()},n.getDirective=function(){return this._typeInfo.getDirective()},n.getArgument=function(){return this._typeInfo.getArgument()},n.getEnumValue=function(){return this._typeInfo.getEnumValue()},t}(yi);function Ei(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vi,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new $n(e),i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{maxErrors:void 0};t||w(0,"Must provide document."),Mn(e);var o=Object.freeze({}),s=[],c=new _i(e,t,r,(function(e){if(null!=i.maxErrors&&s.length>=i.maxErrors)throw s.push(new a.e("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(e)})),u=X(n.map((function(e){return e(c)})));try{$(t,er(r,u))}catch(l){if(l!==o)throw l}return s}function wi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gi,r=[],i=new bi(e,t,(function(e){r.push(e)}));return $(e,X(n.map((function(e){return e(i)})))),r}function Si(e,t,n){return{prev:e,key:t,typename:n}}function Ti(e){for(var t=[],n=e;n;)t.push(n.key),n=n.prev;return t.reverse()}function Ii(e,t){if("query"===t.operation){var n=e.getQueryType();if(!n)throw new a.e("Schema does not define the required query root type.",t);return n}if("mutation"===t.operation){var r=e.getMutationType();if(!r)throw new a.e("Schema is not configured for mutations.",t);return r}if("subscription"===t.operation){var i=e.getSubscriptionType();if(!i)throw new a.e("Schema is not configured for subscriptions.",t);return i}throw new a.e("Can only have query, mutation and subscription operations.",t)}function Ni(e){return e.map((function(e){return"number"==typeof e?"["+e.toString()+"]":"."+e})).join("")}
2function Ai(e,t,n){if(e){if(e.kind===c.VARIABLE){var r=e.name.value;if(null==n||void 0===n[r])return;var i=n[r];if(null===i&&Ze(t))return;return i}if(Ze(t)){if(e.kind===c.NULL)return;return Ai(e,t.ofType,n)}if(e.kind===c.NULL)return null;if(Je(t)){var o=t.ofType;if(e.kind===c.LIST){for(var a=[],s=0,l=e.values;s<l.length;s++){var d=l[s];if(Ci(d,n)){if(Ze(o))return;a.push(null)}else{var f=Ai(d,o,n);if(void 0===f)return;a.push(f)}}return a}var p=Ai(e,o,n);if(void 0===p)return;return[p]}if(ze(t)){if(e.kind!==c.OBJECT)return;for(var h=Object.create(null),v=ce(e.fields,(function(e){return e.name.value})),g=0,m=ne(t.getFields());g<m.length;g++){var y=m[g],b=v[y.name];if(b&&!Ci(b.value,n)){var E=Ai(b.value,y.type,n);if(void 0===E)return;h[y.name]=E}else if(void 0!==y.defaultValue)h[y.name]=y.defaultValue;else if(Ze(y.type))return}return h}if(rt(t)){var w;try{w=t.parseLiteral(e,n)}catch(S){return}if(void 0===w)return;return w}u(0,"Unexpected input type: "+_(t))}}function Ci(e,t){return e.kind===c.VARIABLE&&(null==t||void 0===t[e.name.value])}function Oi(e,t){return Di(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:ki)}function ki(e,t,n){var r="Invalid value "+_(t);throw e.length>0&&(r+=' at "value'.concat(Ni(e),'"')),n.message=r+": "+n.message,n}function Di(e,t,n,r){if(Ze(t))return null!=e?Di(e,t.ofType,n,r):void n(Ti(r),e,new a.e('Expected non-nullable type "'.concat(_(t),'" not to be null.')));if(null==e)return null;if(Je(t)){var i=t.ofType,o=qt(e,(function(e,t){var o=Si(r,t,void 0);return Di(e,i,n,o)}));return null!=o?o:[Di(e,i,n,r)]}if(ze(t)){if(!(0,he.A)(e))return void n(Ti(r),e,new a.e('Expected type "'.concat(t.name,'" to be an object.')));for(var s={},c=t.getFields(),l=0,d=ne(c);l<d.length;l++){var f=d[l],p=e[f.name];if(void 0!==p)s[f.name]=Di(p,f.type,n,Si(r,f.name,t.name));
2else if(void 0!==f.defaultValue)s[f.name]=f.defaultValue;else if(Ze(f.type)){var h=_(f.type);n(Ti(r),e,new a.e('Field "'.concat(f.name,'" of required type "').concat(h,'" was not provided.')))}}for(var v=0,g=Object.keys(e);v<g.length;v++){var m=g[v];if(!c[m]){var y=_e(m,Object.keys(t.getFields()));n(Ti(r),e,new a.e('Field "'.concat(m,'" is not defined by type "').concat(t.name,'".')+pe(y)))}}return s}if(rt(t)){var b;try{b=t.parseValue(e)}catch(E){return void(E instanceof a.e?n(Ti(r),e,E):n(Ti(r),e,new a.e('Expected type "'.concat(t.name,'". ')+E.message,void 0,void 0,void 0,void 0,E)))}return void 0===b&&n(Ti(r),e,new a.e('Expected type "'.concat(t.name,'".'))),b}u(0,"Unexpected input type: "+_(t))}function Ri(e,t,n,r){var i=[],o=null==r?void 0:r.maxErrors;try{var s=function(e,t,n,r){for(var i={},o=function(o){var s=t[o],c=s.variable.name.value,u=Zn(e,s.type);if(!Xe(u)){var l=Se(s.type);return r(new a.e('Variable "$'.concat(c,'" expected value of type "').concat(l,'" which cannot be used as an input type.'),s.type)),"continue"}if(!Mi(n,c)){if(s.defaultValue)i[c]=Ai(s.defaultValue,u);else if(Ze(u)){var d=_(u);r(new a.e('Variable "$'.concat(c,'" of required type "').concat(d,'" was not provided.'),s))}return"continue"}var f=n[c];if(null===f&&Ze(u)){var p=_(u);return r(new a.e('Variable "$'.concat(c,'" of non-null type "').concat(p,'" must not be null.'),s)),"continue"}i[c]=Oi(f,u,(function(e,t,n){var i='Variable "$'.concat(c,'" got invalid value ')+_(t);e.length>0&&(i+=' at "'.concat(c).concat(Ni(e),'"')),r(new a.e(i+"; "+n.message,s,void 0,void 0,void 0,n.originalError))}))},s=0;s<t.length;s++)o(s);return i}(e,t,n,(function(e){if(null!=o&&i.length>=o)throw new a.e("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)}));if(0===i.length)return{coerced:s}}catch(c){i.push(c)}return{errors:i}}function Pi(e,t,n){for(var r,i={},o=ce(null!==(r=t.arguments)&&void 0!==r?r:[],(function(e){return e.name.value})),s=0,u=e.args;s<u.length;s++){var l=u[s],d=l.name,f=l.type,p=o[d];if(p){var h=p.value,v=h.kind===c.NULL;if(h.kind===c.VARIABLE){var g=h.name.value;if(null==n||!Mi(n,g)){if(void 0!==l.defaultValue)i[d]=l.defaultValue;else if(Ze(f))throw new a.e('Argument "'.concat(d,'" of required type "').concat(_(f),'" ')+'was provided the variable "$'.concat(g,'" which was not provided a runtime value.'),h);continue}v=null==n[g]}if(v&&Ze(f))throw new a.e('Argument "'.concat(d,'" of non-null type "').concat(_(f),'" ')+"must not be null.",h);var m=Ai(h,f,n);if(void 0===m)throw new a.e('Argument "'.concat(d,'" has invalid value ').concat(Se(h),"."),h);i[d]=m}else if(void 0!==l.defaultValue)i[d]=l.defaultValue;else if(Ze(f))throw new a.e('Argument "'.concat(d,'" of required type "').concat(_(f),'" ')+"was not provided.",t)}return i}function xi(e,t,n){var r=t.directives&&te(t.directives,(function(t){return t.name.value===e.name}));if(r)return Pi(e,r,n)}function Mi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Li(e,t,n,r,i,o,a,s){return Fi(1===arguments.length?e:{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:o,fieldResolver:a,typeResolver:s})}function Ui(e){var t=Fi(e);if(o(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Fi(e){var t=e.schema,n=e.document,r=e.rootValue,i=e.contextValue,a=e.variableValues,s=e.operationName,c=e.fieldResolver,u=e.typeResolver;Bi(t,n,a);var l=Vi(t,n,r,i,a,s,c,u);if(Array.isArray(l))return{errors:l};var d=function(e,t,n){var r=Ii(e.schema,t),i=qi(e,r,t.selectionSet,Object.create(null),Object.create(null)),a=void 0;try{var s="mutation"===t.operation?function(e,t,n,r,i){return a=Object.keys(i),s=function(a,s){var c=i[s],u=Si(r,s,t.name),l=Hi(e,t,n,c,u);return void 0===l?a:o(l)?l.then((function(e){return a[s]=e,a})):(a[s]=l,a)},c=Object.create(null),a.reduce((function(e,t){return o(e)?e.then((function(e){return s(e,t)})):s(e,t)}),c);var a,s,c}(e,r,n,a,i):Gi(e,r,n,a,i);return o(s)?s.then(void 0,(function(t){return e.errors.push(t),Promise.resolve(null)})):s}catch(c){return e.errors.push(c),null}}(l,l.operation,r);return ji(l,d)}function ji(e,t){return o(t)?t.then((function(t){return ji(e,t)})):0===e.errors.length?{data:t}:{errors:e.errors,data:t}}function Bi(e,t,n){t||w(0,"Must provide document."),Mn(e),null==n||(0,he.A)(n)||w(0,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Vi(e,t,n,r,i,o,s,u){for(var l,d,f,p=Object.create(null),h=0,v=t.definitions;h<v.length;h++){var g=v[h];switch(g.kind){case c.OPERATION_DEFINITION:if(null==o){if(void 0!==f)return[new a.e("Must provide operation name if query contains multiple operations.")];f=g}else(null===(l=g.name)||void 0===l?void 0:l.value)===o&&(f=g);break;case c.FRAGMENT_DEFINITION:p[g.name.value]=g}}if(!f)return null!=o?[new a.e('Unknown operation named "'.concat(o,'".'))]:[new a.e("Must provide an operation.")];var m=Ri(e,null!==(d=f.variableDefinitions)&&void 0!==d?d:[],null!=i?i:{},{maxErrors:50});return m.errors?m.errors:{schema:e,fragments:p,rootValue:n,contextValue:r,operation:f,variableValues:m.coerced,fieldResolver:null!=s?s:io,typeResolver:null!=u?u:ro,errors:[]}}function Gi(e,t,n,r,i){for(var a,s,c,u=Object.create(null),l=!1,d=0,f=Object.keys(i);d<f.length;d++){var p=f[d],h=Hi(e,t,n,i[p],Si(r,p,t.name));void 0!==h&&(u[p]=h,o(h)&&(l=!0))}return l?(a=u,s=Object.keys(a),c=s.map((function(e){return a[e]})),Promise.all(c).then((function(e){return e.reduce((function(e,t,n){return e[s[n]]=t,e}
2),Object.create(null))}))):u}function qi(e,t,n,r,i){for(var o=0,a=n.selections;o<a.length;o++){var s=a[o];switch(s.kind){case c.FIELD:if(!Yi(e,s))continue;var u=(f=s).alias?f.alias.value:f.name.value;r[u]||(r[u]=[]),r[u].push(s);break;case c.INLINE_FRAGMENT:if(!Yi(e,s)||!Ki(e,s,t))continue;qi(e,t,s.selectionSet,r,i);break;case c.FRAGMENT_SPREAD:var l=s.name.value;if(i[l]||!Yi(e,s))continue;i[l]=!0;var d=e.fragments[l];if(!d||!Ki(e,d,t))continue;qi(e,t,d.selectionSet,r,i)}}var f;return r}function Yi(e,t){var n=xi(Sn,t,e.variableValues);if(!0===(null==n?void 0:n.if))return!1;var r=xi(wn,t,e.variableValues);return!1!==(null==r?void 0:r.if)}function Ki(e,t,n){var r=t.typeCondition;if(!r)return!0;var i=Zn(e.schema,r);return i===n||!!st(i)&&e.schema.isSubType(i,n)}function Hi(e,t,n,r,i){var a,s=r[0].name.value,c=oo(e.schema,t,s);if(c){var u=c.type,l=null!==(a=c.resolve)&&void 0!==a?a:e.fieldResolver,d=zi(e,c,r,t,i);try{var f,p=l(n,Pi(c,r[0],e.variableValues),e.contextValue,d);return f=o(p)?p.then((function(t){return Ji(e,u,r,d,i,t)})):Ji(e,u,r,d,i,p),o(f)?f.then(void 0,(function(t){return Wi(re(t,r,Ti(i)),u,e)})):f}catch(h){return Wi(re(h,r,Ti(i)),u,e)}}}function zi(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function Wi(e,t,n){if(Ze(t))throw e;return n.errors.push(e),null}function Ji(e,t,n,r,i,s){if(s instanceof Error)throw s;if(Ze(t)){var c=Ji(e,t.ofType,n,r,i,s);if(null===c)throw new Error("Cannot return null for non-nullable field ".concat(r.parentType.name,".").concat(r.fieldName,"."));return c}return null==s?null:Je(t)?function(e,t,n,r,i,s){var c=t.ofType,u=!1,l=qt(s,(function(t,a){var s=Si(i,a,void 0);try{var l;return l=o(t)?t.then((function(t){return Ji(e,c,n,r,s,t)})):Ji(e,c,n,r,s,t),o(l)?(u=!0,l.then(void 0,(function(t){return Wi(re(t,n,Ti(s)),c,e)}))):l}catch(d){return Wi(re(d,n,Ti(s)),c,e)}}));if(null==l)throw new a.e('Expected Iterable, but did not find one for field "'.concat(r.parentType.name,".").concat(r.fieldName,'".'));return u?Promise.all(l):l}(e,t,n,r,i,s):rt(t)?function(e,t){var n=e.serialize(t);if(void 0===n)throw new Error('Expected a value of type "'.concat(_(e),'" but ')+"received: ".concat(_(t)));return n}(t,s):st(t)?function(e,t,n,r,i,a){var s,c=null!==(s=t.resolveType)&&void 0!==s?s:e.typeResolver,u=e.contextValue,l=c(a,u,r,t);if(o(l))return l.then((function(o){return Zi(e,Qi(o,e,t,n,r,a),n,r,i,a)}));return Zi(e,Qi(l,e,t,n,r,a),n,r,i,a)}(e,t,n,r,i,s):je(t)?Zi(e,t,n,r,i,s):void u(0,"Cannot complete value of unexpected output type: "+_(t))}function Qi(e,t,n,r,i,o){if(null==e)throw new a.e('Abstract type "'.concat(n.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(n.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),r);var s=gt(e)?e.name:e;if("string"!=typeof s)throw new a.e('Abstract type "'.concat(n.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat(_(o),', received "').concat(_(e),'".'));var c=t.schema.getType(s);if(null==c)throw new a.e('Abstract type "'.concat(n.name,'" was resolve to a type "').concat(s,'" that does not exist inside schema.'),r);if(!je(c))throw new a.e('Abstract type "'.concat(n.name,'" was resolve to a non-object type "').concat(s,'".'),r);if(!t.schema.isSubType(n,c))throw new a.e('Runtime Object type "'.concat(c.name,'" is not a possible type for "').concat(n.name,'".'),r);return c}function Zi(e,t,n,r,i,a){if(t.isTypeOf){var s=t.isTypeOf(a,e.contextValue,r);if(o(s))return s.then((function(r){if(!r)throw $i(t,a,n);return Xi(e,t,n,i,a)}));if(!s)throw $i(t,a,n)}return Xi(e,t,n,i,a)}function $i(e,t,n){return new a.e('Expected value of type "'.concat(e.name,'" but got: ').concat(_(t),"."),n)}function Xi(e,t,n,r,i){return Gi(e,t,i,r,no(e,t,n))}var eo,to,no=(eo=function(e,t,n){for(var r=Object.create(null),i=Object.create(null),o=0;o<n.length;o++){var a=n[o];a.selectionSet&&(r=qi(e,t,a.selectionSet,r,i))}return r},function(e,t,n){to||(to=new WeakMap);var r,i=to.get(e);if(i){if(r=i.get(t)){var o=r.get(n);if(void 0!==o)return o}}else i=new WeakMap,to.set(e,i);r||(r=new WeakMap,i.set(t,r));var a=eo(e,t,n);return r.set(n,a),a});var ro=function(e,t,n,r){if((0,he.A)(e)&&"string"==typeof e.__typename)return e.__typename;for(var i=n.schema.getPossibleTypes(r),a=[],s=0;s<i.length;s++){var c=i[s];if(c.isTypeOf){var u=c.isTypeOf(e,t,n);if(o(u))a[s]=u;else if(u)return c.name}}return a.length?Promise.all(a).then((function(e){for(var t=0;t<e.length;t++)if(e[t])return i[t].name})):void 0},io=function(e,t,n,r){if((0,he.A)(e)||"function"==typeof e){var i=e[r.fieldName];return"function"==typeof i?e[r.fieldName](t,n,r):i}};
2function oo(e,t,n){return n===pn.name&&e.getQueryType()===t?pn:n===hn.name&&e.getQueryType()===t?hn:n===vn.name?vn:t.getFields()[n]}function ao(e,t,n,r,i,o,a,s){var c=arguments;return new Promise((function(u){return u(co(1===c.length?e:{schema:e,source:t,rootValue:n,contextValue:r,variableValues:i,operationName:o,fieldResolver:a,typeResolver:s}))}))}function so(e,t,n,r,i,a,s,c){var u=co(1===arguments.length?e:{schema:e,source:t,rootValue:n,contextValue:r,variableValues:i,operationName:a,fieldResolver:s,typeResolver:c});if(o(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function co(e){var t,n=e.schema,r=e.source,i=e.rootValue,o=e.contextValue,a=e.variableValues,c=e.operationName,u=e.fieldResolver,l=e.typeResolver,d=xn(n);if(d.length>0)return{errors:d};try{t=Y(r)}catch(s){return{errors:[s]}}var f=Ei(n,t);return f.length>0?{errors:f}:Li({schema:n,document:t,rootValue:i,contextValue:o,variableValues:a,operationName:c,fieldResolver:u,typeResolver:l})}var uo=n(98160),lo=n(3143);function fo(e){return"function"==typeof(null==e?void 0:e[g.$r])}function po(e,t,n){var r,i,o,a,s,c,u=e[g.$r].call(e);function l(e){return e.done?e:ho(e.value,t).then(vo,i)}if("function"==typeof u.return&&(r=u.return,i=function(e){var t=function(){return Promise.reject(e)};return r.call(u).then(t,t)}),n){var d=n;o=function(e){return ho(e,d).then(vo,i)}}return a={next:function(){return u.next().then(l,o)},return:function(){return r?r.call(u).then(l,o):Promise.resolve({value:void 0,done:!0})},throw:function(e){return"function"==typeof u.throw?u.throw(e).then(l,o):Promise.reject(e).catch(i)}},s=g.$r,c=function(){return this},s in a?Object.defineProperty(a,s,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[s]=c,a}function ho(e,t){return new Promise((function(n){return n(t(e))}))}function vo(e){return{value:e,done:!1}}function go(e,t,n,r,i,o,a,s){return yo(1===arguments.length?e:{schema:e,document:t,rootValue:n,contextValue:r,variableValues:i,operationName:o,fieldResolver:a,subscribeFieldResolver:s})}function mo(e){if(e instanceof a.e)return{errors:[e]};throw e}function yo(e){var t=e.schema,n=e.document,r=e.rootValue,i=e.contextValue,o=e.variableValues,a=e.operationName,s=e.fieldResolver,c=e.subscribeFieldResolver,u=bo(t,n,r,i,o,a,c),l=function(e){return Li({schema:t,document:n,rootValue:e,contextValue:i,variableValues:o,operationName:a,fieldResolver:s})};return u.then((function(e){return fo(e)?po(e,l,mo):e}))}function bo(e,t,n,r,i,o,s){return Bi(e,t,i),new Promise((function(c){var u=Vi(e,t,n,r,i,o,s);c(Array.isArray(u)?{errors:u}:function(e){var t=e.schema,n=e.operation,r=e.variableValues,i=e.rootValue,o=Ii(t,n),s=qi(e,o,n.selectionSet,Object.create(null),Object.create(null)),c=Object.keys(s)[0],u=s[c],l=u[0].name.value,d=oo(t,o,l);if(!d)throw new a.e('The subscription field "'.concat(l,'" is not defined.'),u);var f=Si(void 0,c,o.name),p=zi(e,d,u,o,f);return new Promise((function(t){var n,o=Pi(d,u[0],r),a=e.contextValue;t((null!==(n=d.subscribe)&&void 0!==n?n:e.fieldResolver)(i,o,a,p))})).then((function(e){if(e instanceof Error)throw re(e,u,Ti(f));if(!fo(e))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat(_(e),"."));return e}),(function(e){throw re(e,u,Ti(f))}))}(u))})).catch(mo)}function _o(e){return{Field:function(t){var n=e.getFieldDef(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){var i=e.getParentType();null!=i||u(0),e.reportError(new a.e("The field ".concat(i.name,".").concat(n.name," is deprecated. ").concat(r),t))}},Argument:function(t){var n=e.getArgument(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){var i=e.getDirective();if(null!=i)e.reportError(new a.e('Directive "@'.concat(i.name,'" argument "').concat(n.name,'" is deprecated. ').concat(r),t));else{var o=e.getParentType(),s=e.getFieldDef();null!=o&&null!=s||u(0),e.reportError(new a.e('Field "'.concat(o.name,".").concat(s.name,'" argument "').concat(n.name,'" is deprecated. ').concat(r),t))}}},ObjectField:function(t){var n=yt(e.getParentInputType());if(ze(n)){var r=n.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new a.e("The input field ".concat(n.name,".").concat(r.name," is deprecated. ").concat(i),t))}},EnumValue:function(t){var n=e.getEnumValue(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){var i=yt(e.getInputType());null!=i||u(0),e.reportError(new a.e('The enum value "'.concat(i.name,".").concat(n.name,'" is deprecated. ').concat(r),t))}}}}function Eo(e){return{Field:function(t){var n=yt(e.getType());n&&mn(n)&&e.reportError(new a.e('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(t.name.value,'".'),t))}}}function wo(e){var t;e||w(0,"Received null or undefined error.");var n=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred.",r=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:n,locations:r,path:i,extensions:o}:{message:n,locations:r,path:i}}function So(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function To(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Io(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?So(Object(n),!0).forEach((function(t){To(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(e){return t.inputValueDeprecation?e:""}return"\n query IntrospectionQuery {\n __schema {\n ".concat(o,"\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ").concat(n,"\n ").concat(i,"\n locations\n args").concat(a("(includeDeprecated: true)")," {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(n,"\n ").concat(r,"\n fields(includeDeprecated: true) {\n name\n ").concat(n,"\n args").concat(a("(includeDeprecated: true)")," {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields").concat(a("(includeDeprecated: true)")," {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(n,"\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(n,"\n type { ...TypeRef }\n defaultValue\n ").concat(a("isDeprecated"),"\n ").concat(a("deprecationReason"),"\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n ")}function No(e,t){for(var n=null,r=0,i=e.definitions;r<i.length;r++){var o,a=i[r];if(a.kind===c.OPERATION_DEFINITION)if(null==t){if(n)return null;n=a}else if((null===(o=a.name)||void 0===o?void 0:o.value)===t)return a}return n}function Ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oo(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ao(Object(n),!0).forEach((function(t){Co(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),r=Ui({schema:e,document:Y(Io(n))});return!r.errors&&r.data||u(0),r.data}function ko(e,t){(0,he.A)(e)&&(0,he.A)(e.__schema)||w(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat(_(e),"."));for(var n=e.__schema,r=de(n.types,(function(e){return e.name}),(function(e){return function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case dn.SCALAR:return new Et({name:(r=e).name,description:r.description,specifiedByUrl:r.specifiedByUrl});case dn.OBJECT:return new wt({name:(n=e).name,description:n.description,interfaces:function(){return v(n)},fields:function(){return g(n)}});case dn.INTERFACE:return new Ot({name:(t=e).name,description:t.description,interfaces:function(){return v(t)},fields:function(){return g(t)}});case dn.UNION:return function(e){if(!e.possibleTypes){var t=_(e);throw new Error("Introspection result missing possibleTypes: ".concat(t,"."))}
2return new kt({name:e.name,description:e.description,types:function(){return e.possibleTypes.map(p)}})}(e);case dn.ENUM:return function(e){if(!e.enumValues){var t=_(e);throw new Error("Introspection result missing enumValues: ".concat(t,"."))}return new Rt({name:e.name,description:e.description,values:de(e.enumValues,(function(e){return e.name}),(function(e){return{description:e.description,deprecationReason:e.deprecationReason}}))})}(e);case dn.INPUT_OBJECT:return function(e){if(!e.inputFields){var t=_(e);throw new Error("Introspection result missing inputFields: ".concat(t,"."))}return new xt({name:e.name,description:e.description,fields:function(){return y(e.inputFields)}})}(e)}var t;var n;var r;var i=_(e);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(i,"."))}(e)})),i=0,o=[].concat(Xt,gn);i<o.length;i++){var a=o[i];r[a.name]&&(r[a.name]=a)}var s=n.queryType?p(n.queryType):null,c=n.mutationType?p(n.mutationType):null,u=n.subscriptionType?p(n.subscriptionType):null,l=n.directives?n.directives.map((function(e){if(!e.args){var t=_(e);throw new Error("Introspection result missing directive args: ".concat(t,"."))}if(!e.locations){var n=_(e);throw new Error("Introspection result missing directive locations: ".concat(n,"."))}return new En({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})})):[];return new Rn({description:n.description,query:s,mutation:c,subscription:u,types:ne(r),directives:l,assumeValid:null==t?void 0:t.assumeValid});function d(e){if(e.kind===dn.LIST){var t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new ut(d(t))}if(e.kind===dn.NON_NULL){var n=e.ofType;if(!n)throw new Error("Decorated type deeper than introspection query.");return new lt(ht(d(n)))}return f(e)}function f(e){var t=e.name;if(!t)throw new Error("Unknown type reference: ".concat(_(e),"."));var n=r[t];if(!n)throw new Error("Invalid or incomplete schema, unknown type: ".concat(t,". Ensure that a full introspection query is used in order to build a client schema."));return n}function p(e){return Be(f(e))}function h(e){return Ge(f(e))}function v(e){if(null===e.interfaces&&e.kind===dn.INTERFACE)return[];if(!e.interfaces){var t=_(e);throw new Error("Introspection result missing interfaces: ".concat(t,"."))}return e.interfaces.map(h)}function g(e){if(!e.fields)throw new Error("Introspection result missing fields: ".concat(_(e),"."));return de(e.fields,(function(e){return e.name}),m)}function m(e){var t=d(e.type);if(!tt(t)){var n=_(t);throw new Error("Introspection must provide output type for fields, but received: ".concat(n,"."))}if(!e.args){var r=_(e);throw new Error("Introspection result missing field args: ".concat(r,"."))}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return de(e,(function(e){return e.name}),b)}function b(e){var t=d(e.type);if(!Xe(t)){var n=_(t);throw new Error("Introspection must provide input type for arguments, but received: ".concat(n,"."))}var r=null!=e.defaultValue?Ai(K(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:r,deprecationReason:e.deprecationReason}}}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach((function(t){Po(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Po(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xo(e,t,n){Dn(e),null!=t&&t.kind===c.DOCUMENT||w(0,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&function(e,t){var n=wi(e,t);if(0!==n.length)throw new Error(n.map((function(e){return e.message})).join("\n\n"))}(t,e);var r=e.toConfig(),i=Mo(r,t,n);return r===i?e:new Rn(i)}
2function Mo(e,t,n){for(var r,i,o,a,s,l=[],d=Object.create(null),f=[],p=[],h=0,v=t.definitions;h<v.length;h++){var g=v[h];if(g.kind===c.SCHEMA_DEFINITION)s=g;else if(g.kind===c.SCHEMA_EXTENSION)p.push(g);else if(sr(g))l.push(g);else if(ur(g)){var m=g.name.value,y=d[m];d[m]=y?y.concat([g]):[g]}else g.kind===c.DIRECTIVE_DEFINITION&&f.push(g)}if(0===Object.keys(d).length&&0===l.length&&0===f.length&&0===p.length&&null==s)return e;for(var b=Object.create(null),E=0,w=e.types;E<w.length;E++){var S=w[E];b[S.name]=D(S)}for(var T=0;T<l.length;T++){var I,N=l[T],A=N.name.value;b[A]=null!==(I=Lo[A])&&void 0!==I?I:q(N)}var C=Ro(Ro({query:e.query&&k(e.query),mutation:e.mutation&&k(e.mutation),subscription:e.subscription&&k(e.subscription)},s&&x([s])),x(p));return Ro(Ro({description:null===(r=s)||void 0===r||null===(i=r.description)||void 0===i?void 0:i.value},C),{},{types:ne(b),directives:[].concat(e.directives.map((function(e){var t=e.toConfig();return new En(Ro(Ro({},t),{},{args:ue(t.args,P)}))})),f.map((function(e){var t=e.locations.map((function(e){return e.value}));return new En({name:e.name.value,description:jo(e,n),locations:t,isRepeatable:e.repeatable,args:F(e.arguments),astNode:e})}))),extensions:void 0,astNode:null!==(o=s)&&void 0!==o?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:null!==(a=null==n?void 0:n.assumeValid)&&void 0!==a&&a});function O(e){return Je(e)?new ut(O(e.ofType)):Ze(e)?new lt(O(e.ofType)):k(e)}function k(e){return b[e.name]}function D(e){return mn(e)||en(e)?e:Ue(e)?function(e){for(var t,n=e.toConfig(),r=null!==(t=d[n.name])&&void 0!==t?t:[],i=n.specifiedByUrl,o=0;o<r.length;o++){var a;i=null!==(a=Fo(r[o]))&&void 0!==a?a:i}return new Et(Ro(Ro({},n),{},{specifiedByUrl:i,extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):je(e)?function(e){var t,n=e.toConfig(),r=null!==(t=d[n.name])&&void 0!==t?t:[];return new wt(Ro(Ro({},n),{},{interfaces:function(){return[].concat(e.getInterfaces().map(k),V(r))},fields:function(){return Ro(Ro({},ue(n.fields,R)),U(r))},extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):Ve(e)?function(e){var t,n=e.toConfig(),r=null!==(t=d[n.name])&&void 0!==t?t:[];return new Ot(Ro(Ro({},n),{},{interfaces:function(){return[].concat(e.getInterfaces().map(k),V(r))},fields:function(){return Ro(Ro({},ue(n.fields,R)),U(r))},extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):qe(e)?function(e){var t,n=e.toConfig(),r=null!==(t=d[n.name])&&void 0!==t?t:[];return new kt(Ro(Ro({},n),{},{types:function(){return[].concat(e.getTypes().map(k),G(r))},extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):Ke(e)?function(e){var t,n=e.toConfig(),r=null!==(t=d[e.name])&&void 0!==t?t:[];return new Rt(Ro(Ro({},n),{},{values:Ro(Ro({},n.values),B(r)),extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):ze(e)?function(e){var t,n=e.toConfig(),r=null!==(t=d[n.name])&&void 0!==t?t:[];return new xt(Ro(Ro({},n),{},{fields:function(){return Ro(Ro({},ue(n.fields,(function(e){return Ro(Ro({},e),{},{type:O(e.type)})}))),j(r))},extensionASTNodes:n.extensionASTNodes.concat(r)}))}(e):void u(0,"Unexpected type: "+_(e))}function R(e){return Ro(Ro({},e),{},{type:O(e.type),args:ue(e.args,P)})}function P(e){return Ro(Ro({},e),{},{type:O(e.type)})}function x(e){for(var t={},n=0;n<e.length;n++)for(var r,i=null!==(r=e[n].operationTypes)&&void 0!==r?r:[],o=0;o<i.length;o++){var a=i[o];t[a.operation]=M(a.type)}return t}function M(e){var t,n=e.name.value,r=null!==(t=Lo[n])&&void 0!==t?t:b[n];if(void 0===r)throw new Error('Unknown type: "'.concat(n,'".'));return r}function L(e){return e.kind===c.LIST_TYPE?new ut(L(e.type)):e.kind===c.NON_NULL_TYPE?new lt(L(e.type)):M(e)}function U(e){for(var t=Object.create(null),r=0;r<e.length;r++)for(var i,o=null!==(i=e[r].fields)&&void 0!==i?i:[],a=0;a<o.length;a++){var s=o[a];t[s.name.value]={type:L(s.type),description:jo(s,n),args:F(s.arguments),deprecationReason:Uo(s),astNode:s}}return t}function F(e){for(var t=null!=e?e:[],r=Object.create(null),i=0;i<t.length;i++){var o=t[i],a=L(o.type);r[o.name.value]={type:a,description:jo(o,n),defaultValue:Ai(o.defaultValue,a),deprecationReason:Uo(o),astNode:o}}return r}function j(e){for(var t=Object.create(null),r=0;r<e.length;r++)for(var i,o=null!==(i=e[r].fields)&&void 0!==i?i:[],a=0;a<o.length;a++){var s=o[a],c=L(s.type);t[s.name.value]={type:c,description:jo(s,n),defaultValue:Ai(s.defaultValue,c),deprecationReason:Uo(s),astNode:s}}return t}function B(e){for(var t=Object.create(null),r=0;r<e.length;r++)for(var i,o=null!==(i=e[r].values)&&void 0!==i?i:[],a=0;a<o.length;a++){var s=o[a];t[s.name.value]={description:jo(s,n),deprecationReason:Uo(s),astNode:s}}return t}function V(e){for(var t=[],n=0;n<e.length;n++)for(var r,i=null!==(r=e[n].interfaces)&&void 0!==r?r:[],o=0;o<i.length;o++){var a=i[o];t.push(M(a))}return t}function G(e){for(var t=[],n=0;n<e.length;n++)for(var r,i=null!==(r=e[n].types)&&void 0!==r?r:[],o=0;o<i.length;o++){var a=i[o];t.push(M(a))}return t}function q(e){var t,r=e.name.value,i=jo(e,n),o=null!==(t=d[r])&&void 0!==t?t:[];switch(e.kind){case c.OBJECT_TYPE_DEFINITION:var a=o,s=[e].concat(a);return new wt({name:r,description:i,interfaces:function(){return V(s)},fields:function(){return U(s)},astNode:e,extensionASTNodes:a});case c.INTERFACE_TYPE_DEFINITION:var l=o,f=[e].concat(l);return new Ot({name:r,description:i,interfaces:function(){return V(f)},fields:function(){return U(f)},astNode:e,extensionASTNodes:l});case c.ENUM_TYPE_DEFINITION:var p=o,h=[e].concat(p);return new Rt({name:r,description:i,values:B(h),astNode:e,extensionASTNodes:p});case c.UNION_TYPE_DEFINITION:var v=o,g=[e].concat(v);
2return new kt({name:r,description:i,types:function(){return G(g)},astNode:e,extensionASTNodes:v});case c.SCALAR_TYPE_DEFINITION:var m=o;return new Et({name:r,description:i,specifiedByUrl:Fo(e),astNode:e,extensionASTNodes:m});case c.INPUT_OBJECT_TYPE_DEFINITION:var y=o,b=[e].concat(y);return new xt({name:r,description:i,fields:function(){return j(b)},astNode:e,extensionASTNodes:y})}u(0,"Unexpected type definition node: "+_(e))}}var Lo=ce(Xt.concat(gn),(function(e){return e.name}));function Uo(e){var t=xi(In,e);return null==t?void 0:t.reason}function Fo(e){var t=xi(Nn,e);return null==t?void 0:t.url}function jo(e,t){if(e.description)return e.description.value;if(!0===(null==t?void 0:t.commentDescriptions)){var n=function(e){var t=e.loc;if(!t)return;var n=[],r=t.startToken.prev;for(;null!=r&&r.kind===v.COMMENT&&r.next&&r.prev&&r.line+1===r.next.line&&r.line!==r.prev.line;){var i=String(r.value);n.push(i),r=r.prev}return n.length>0?n.reverse().join("\n"):void 0}(e);if(void 0!==n)return C("\n"+n)}}function Bo(e,t){null!=e&&e.kind===c.DOCUMENT||w(0,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&function(e){var t=wi(e);if(0!==t.length)throw new Error(t.map((function(e){return e.message})).join("\n\n"))}(e);var n=Mo({description:void 0,types:[],directives:[],extensions:void 0,extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(var r=0,i=n.types;r<i.length;r++){var o=i[r];switch(o.name){case"Query":n.query=o;break;case"Mutation":n.mutation=o;break;case"Subscription":n.subscription=o}}for(var a=n.directives,s=function(e){var t=An[e];a.every((function(e){return e.name!==t.name}))&&a.push(t)},u=0;u<An.length;u++)s(u);return new Rn(n)}function Vo(e,t){return Bo(Y(e,{noLocation:null==t?void 0:t.noLocation,allowLegacySDLEmptyFields:null==t?void 0:t.allowLegacySDLEmptyFields,allowLegacySDLImplementsInterfaces:null==t?void 0:t.allowLegacySDLImplementsInterfaces,experimentalFragmentVariables:null==t?void 0:t.experimentalFragmentVariables}),{commentDescriptions:null==t?void 0:t.commentDescriptions,assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})}function Go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Go(Object(n),!0).forEach((function(t){Yo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ko(e){var t=e.toConfig(),n=de(zo(t.types),(function(e){return e.name}),(function(e){if(Ue(e)||mn(e))return e;if(je(e)){var t=e.toConfig();return new wt(qo(qo({},t),{},{interfaces:function(){return c(t.interfaces)},fields:function(){return s(t.fields)}}))}if(Ve(e)){var n=e.toConfig();return new Ot(qo(qo({},n),{},{interfaces:function(){return c(n.interfaces)},fields:function(){return s(n.fields)}}))}if(qe(e)){var i=e.toConfig();return new kt(qo(qo({},i),{},{types:function(){return c(i.types)}}))}if(Ke(e)){var o=e.toConfig();return new Rt(qo(qo({},o),{},{values:Ho(o.values)}))}if(ze(e)){var a=e.toConfig();return new xt(qo(qo({},a),{},{fields:function(){return Ho(a.fields,(function(e){return qo(qo({},e),{},{type:r(e.type)})}))}}))}u(0,"Unexpected type: "+_(e))}));return new Rn(qo(qo({},t),{},{types:ne(n),directives:zo(t.directives).map((function(e){var t=e.toConfig();return new En(qo(qo({},t),{},{locations:Wo(t.locations,(function(e){return e})),args:a(t.args)}))})),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function r(e){return Je(e)?new ut(r(e.ofType)):Ze(e)?new lt(r(e.ofType)):i(e)}function i(e){return n[e.name]}function o(e){return e&&i(e)}function a(e){return Ho(e,(function(e){return qo(qo({},e),{},{type:r(e.type)})}))}function s(e){return Ho(e,(function(e){return qo(qo({},e),{},{type:r(e.type),args:a(e.args)})}))}function c(e){return zo(e).map(i)}}function Ho(e,t){for(var n=Object.create(null),r=Wo(Object.keys(e),(function(e){return e})),i=0;i<r.length;i++){var o=r[i],a=e[o];n[o]=t?t(a):a}return n}function zo(e){return Wo(e,(function(e){return e.name}))}function Wo(e,t){return e.slice().sort((function(e,n){return ge(t(e),t(n))}))}function Jo(e,t){return $o(e,(function(e){return!Cn(e)}),Zo,t)}function Qo(e,t){return $o(e,Cn,mn,t)}function Zo(e){return!en(e)&&!mn(e)}function $o(e,t,n,r){var i=e.getDirectives().filter(t),o=ne(e.getTypeMap()).filter(n);
2return[Xo(e)].concat(i.map((function(e){return function(e,t){return sa(t,e)+"directive @"+e.name+ia(t,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e,r)})),o.map((function(e){return ea(e,r)}))).filter(Boolean).join("\n\n")+"\n"}function Xo(e){if(null!=e.description||!function(e){var t=e.getQueryType();if(t&&"Query"!==t.name)return!1;var n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;var r=e.getSubscriptionType();if(r&&"Subscription"!==r.name)return!1;return!0}(e)){var t=[],n=e.getQueryType();n&&t.push(" query: ".concat(n.name));var r=e.getMutationType();r&&t.push(" mutation: ".concat(r.name));var i=e.getSubscriptionType();return i&&t.push(" subscription: ".concat(i.name)),sa({},e)+"schema {\n".concat(t.join("\n"),"\n}")}}function ea(e,t){return Ue(e)?function(e,t){return sa(t,e)+"scalar ".concat(e.name)+function(e){if(null==e.specifiedByUrl)return"";var t=tn(e.specifiedByUrl,Qt);return t||u(0,"Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+Se(t)+")"}(e)}(e,t):je(e)?function(e,t){return sa(t,e)+"type ".concat(e.name)+ta(e)+na(t,e)}(e,t):Ve(e)?function(e,t){return sa(t,e)+"interface ".concat(e.name)+ta(e)+na(t,e)}(e,t):qe(e)?function(e,t){var n=e.getTypes(),r=n.length?" = "+n.join(" | "):"";return sa(t,e)+"union "+e.name+r}(e,t):Ke(e)?function(e,t){var n=e.getValues().map((function(e,n){return sa(t,e," ",!n)+" "+e.name+aa(e.deprecationReason)}));return sa(t,e)+"enum ".concat(e.name)+ra(n)}(e,t):ze(e)?function(e,t){var n=ne(e.getFields()).map((function(e,n){return sa(t,e," ",!n)+" "+oa(e)}));return sa(t,e)+"input ".concat(e.name)+ra(n)}(e,t):void u(0,"Unexpected type: "+_(e))}function ta(e){var t=e.getInterfaces();return t.length?" implements "+t.map((function(e){return e.name})).join(" & "):""}function na(e,t){return ra(ne(t.getFields()).map((function(t,n){return sa(e,t," ",!n)+" "+t.name+ia(e,t.args," ")+": "+String(t.type)+aa(t.deprecationReason)})))}function ra(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function ia(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return 0===t.length?"":t.every((function(e){return!e.description}))?"("+t.map(oa).join(", ")+")":"(\n"+t.map((function(t,r){return sa(e,t," "+n,!r)+" "+n+oa(t)})).join("\n")+"\n"+n+")"}function oa(e){var t=tn(e.defaultValue,e.type),n=e.name+": "+String(e.type);return t&&(n+=" = ".concat(Se(t))),n+aa(e.deprecationReason)}function aa(e){if(null==e)return"";var t=tn(e,Qt);return t&&e!==Tn?" @deprecated(reason: "+Se(t)+")":" @deprecated"}function sa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=t.description;return null==i?"":!0===(null==e?void 0:e.commentDescriptions)?function(e,t,n){var r=t&&!n?"\n":"",i=e.split("\n").map((function(e){return t+(""!==e?"# "+e:"#")})).join("\n");return r+i+"\n"}(i,n,r):(n&&!r?"\n"+n:n)+D(i,"",i.length>70).replace(/\n/g,"\n"+n)+"\n"}function ca(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t=t.concat(r.definitions)}return{kind:"Document",definitions:t}}function ua(e){for(var t=[],n=Object.create(null),r=0,i=e.definitions;r<i.length;r++){var o=i[r];switch(o.kind){case c.OPERATION_DEFINITION:t.push(o);break;case c.FRAGMENT_DEFINITION:n[o.name.value]=da(o.selectionSet)}}for(var a=Object.create(null),s=function(r){for(var i=t[r],o=new Set,s=0,u=da(i.selectionSet);s<u.length;s++){var l=u[s];la(o,n,l)}var d=i.name?i.name.value:"";a[d]={kind:c.DOCUMENT,definitions:e.definitions.filter((function(e){return e===i||e.kind===c.FRAGMENT_DEFINITION&&o.has(e.name.value)}))}},u=0;u<t.length;u++)s(u);return a}function la(e,t,n){if(!e.has(n)){e.add(n);var r=t[n];if(void 0!==r)for(var i=0;i<r.length;i++){la(e,t,r[i])}}}function da(e){var t=[];return $(e,{FragmentSpread:function(e){t.push(e.name.value)}}),t}function fa(e){for(var t=N(e)?e:new I(e),n=t.body,r=new R(t),i="",o=!1;r.advance().kind!==v.EOF;){var a=r.token,s=a.kind,c=!P(a.kind);o&&(c||a.kind===v.SPREAD)&&(i+=" ");var u=n.slice(a.start,a.end);s===v.BLOCK_STRING?i+=pa(u):i+=u,o=c}return i}function pa(e){var t=C(e.slice(3,-3));k(t)>0&&(t="\n"+t);var n=t[t.length-1];return('"'===n&&'\\"""'!==t.slice(-4)||"\\"===n)&&(t+="\n"),'"""'+t+'"""'}function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function va(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?ha(Object(n),!0).forEach((function(t){ga(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ga(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ma=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"}),ya=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});function ba(e,t){return Ea(e,t).filter((function(e){return e.type in ma}))}function _a(e,t){return Ea(e,t).filter((function(e){return e.type in ya}))}function Ea(e,t){return[].concat(function(e,t){for(var n=[],r=Ra(ne(e.getTypeMap()),ne(t.getTypeMap())),i=0,o=r.removed;i<o.length;i++){var a=o[i];n.push({type:ma.TYPE_REMOVED,description:en(a)?"Standard scalar ".concat(a.name," was removed because it is not referenced anymore."):"".concat(a.name," was removed.")})}for(var s=0,c=r.persisted;s<c.length;s++){var u=c[s],l=u[0],d=u[1];Ke(l)&&Ke(d)?n.push.apply(n,Ta(l,d)):qe(l)&&qe(d)?n.push.apply(n,Sa(l,d)):ze(l)&&ze(d)?n.push.apply(n,wa(l,d)):je(l)&&je(d)||Ve(l)&&Ve(d)?n.push.apply(n,Na(l,d).concat(Ia(l,d))):l.constructor!==d.constructor&&n.push({type:ma.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(ka(l)," to ").concat(ka(d),".")})}return n}(e,t),function(e,t){for(var n=[],r=Ra(e.getDirectives(),t.getDirectives()),i=0,o=r.removed;i<o.length;i++){var a=o[i];n.push({type:ma.DIRECTIVE_REMOVED,description:"".concat(a.name," was removed.")})}for(var s=0,c=r.persisted;s<c.length;s++){for(var u=c[s],l=u[0],d=u[1],f=Ra(l.args,d.args),p=0,h=f.added;p<h.length;p++){var v=h[p];Ct(v)&&n.push({type:ma.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ").concat(l.name," was added.")})}for(var g=0,m=f.removed;g<m.length;g++){var y=m[g];n.push({type:ma.DIRECTIVE_ARG_REMOVED,description:"".concat(y.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&n.push({type:ma.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var b=0,_=l.locations;b<_.length;b++){var E=_[b];-1===d.locations.indexOf(E)&&n.push({type:ma.DIRECTIVE_LOCATION_REMOVED,description:"".concat(E," was removed from ").concat(l.name,".")})}}return n}(e,t))}function wa(e,t){for(var n=[],r=Ra(ne(e.getFields()),ne(t.getFields())),i=0,o=r.added;i<o.length;i++){var a=o[i];Lt(a)?n.push({type:ma.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(a.name," on input type ").concat(e.name," was added.")}):n.push({type:ya.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(a.name," on input type ").concat(e.name," was added.")})}for(var s=0,c=r.removed;s<c.length;s++){var u=c[s];n.push({type:ma.FIELD_REMOVED,description:"".concat(e.name,".").concat(u.name," was removed.")})}for(var l=0,d=r.persisted;l<d.length;l++){var f=d[l],p=f[0],h=f[1];Oa(p.type,h.type)||n.push({type:ma.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(p.name," changed type from ")+"".concat(String(p.type)," to ").concat(String(h.type),".")})}return n}function Sa(e,t){for(var n=[],r=Ra(e.getTypes(),t.getTypes()),i=0,o=r.added;i<o.length;i++){var a=o[i];n.push({type:ya.TYPE_ADDED_TO_UNION,description:"".concat(a.name," was added to union type ").concat(e.name,".")})}for(var s=0,c=r.removed;s<c.length;s++){var u=c[s];n.push({type:ma.TYPE_REMOVED_FROM_UNION,description:"".concat(u.name," was removed from union type ").concat(e.name,".")})}return n}function Ta(e,t){for(var n=[],r=Ra(e.getValues(),t.getValues()),i=0,o=r.added;i<o.length;i++){var a=o[i];n.push({type:ya.VALUE_ADDED_TO_ENUM,description:"".concat(a.name," was added to enum type ").concat(e.name,".")})}for(var s=0,c=r.removed;s<c.length;s++){var u=c[s];n.push({type:ma.VALUE_REMOVED_FROM_ENUM,description:"".concat(u.name," was removed from enum type ").concat(e.name,".")})}return n}function Ia(e,t){for(var n=[],r=Ra(e.getInterfaces(),t.getInterfaces()),i=0,o=r.added;i<o.length;i++){var a=o[i];
2n.push({type:ya.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(a.name," added to interfaces implemented by ").concat(e.name,".")})}for(var s=0,c=r.removed;s<c.length;s++){var u=c[s];n.push({type:ma.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(u.name,".")})}return n}function Na(e,t){for(var n=[],r=Ra(ne(e.getFields()),ne(t.getFields())),i=0,o=r.removed;i<o.length;i++){var a=o[i];n.push({type:ma.FIELD_REMOVED,description:"".concat(e.name,".").concat(a.name," was removed.")})}for(var s=0,c=r.persisted;s<c.length;s++){var u=c[s],l=u[0],d=u[1];n.push.apply(n,Aa(e,l,d)),Ca(l.type,d.type)||n.push({type:ma.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return n}function Aa(e,t,n){for(var r=[],i=Ra(t.args,n.args),o=0,a=i.removed;o<a.length;o++){var s=a[o];r.push({type:ma.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(s.name," was removed.")})}for(var c=0,u=i.persisted;c<u.length;c++){var l=u[c],d=l[0],f=l[1];if(Oa(d.type,f.type)){if(void 0!==d.defaultValue)if(void 0===f.defaultValue)r.push({type:ya.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var p=Da(d.defaultValue,d.type),h=Da(f.defaultValue,f.type);p!==h&&r.push({type:ya.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(p," to ").concat(h,".")})}}else r.push({type:ma.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(f.type),".")})}for(var v=0,g=i.added;v<g.length;v++){var m=g[v];Ct(m)?r.push({type:ma.REQUIRED_ARG_ADDED,description:"A required arg ".concat(m.name," on ").concat(e.name,".").concat(t.name," was added.")}):r.push({type:ya.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(m.name," on ").concat(e.name,".").concat(t.name," was added.")})}return r}function Ca(e,t){return Je(e)?Je(t)&&Ca(e.ofType,t.ofType)||Ze(t)&&Ca(e,t.ofType):Ze(e)?Ze(t)&&Ca(e.ofType,t.ofType):gt(t)&&e.name===t.name||Ze(t)&&Ca(e,t.ofType)}function Oa(e,t){return Je(e)?Je(t)&&Oa(e.ofType,t.ofType):Ze(e)?Ze(t)&&Oa(e.ofType,t.ofType)||!Ze(t)&&Oa(e.ofType,t):gt(t)&&e.name===t.name}function ka(e){return Ue(e)?"a Scalar type":je(e)?"an Object type":Ve(e)?"an Interface type":qe(e)?"a Union type":Ke(e)?"an Enum type":ze(e)?"an Input type":void u(0,"Unexpected type: "+_(e))}function Da(e,t){var n=tn(e,t);return null!=n||u(0),Se($(n,{ObjectValue:function(e){var t=[].concat(e.fields);return t.sort((function(e,t){return ge(e.name.value,t.name.value)})),va(va({},e),{},{fields:t})}}))}function Ra(e,t){for(var n=[],r=[],i=[],o=ce(e,(function(e){return e.name})),a=ce(t,(function(e){return e.name})),s=0;s<e.length;s++){var c=e[s],u=a[c.name];void 0===u?r.push(c):i.push([c,u])}for(var l=0;l<t.length;l++){var d=t[l];void 0===o[d.name]&&n.push(d)}return{added:n,persisted:i,removed:r}}function Pa(e,t){return Ei(e,t,[_o])}},34856:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e){return"object"==r(e)&&null!==e}n.d(t,{A:function(){return i}})},98160:function(e,t,n){"use strict";function r(e,t){for(var n,r=/\r\n|[\n\r]/g,i=1,o=t+1;(n=r.exec(e.body))&&n.index<t;)i+=1,o=t+1-(n.index+n[0].length);return{line:i,column:o}}n.d(t,{g:function(){return r}})},3143:function(e,t,n){"use strict";n.d(t,{C:function(){return o},V:function(){return i}});var r=n(98160);function i(e){return o(e.source,(0,r.g)(e.source,e.start))}function o(e,t){var n=e.locationOffset.column-1,r=s(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,c=t.line+o,u=1===t.line?n:0,l=t.column+u,d="".concat(e.name,":").concat(c,":").concat(l,"\n"),f=r.split(/\r\n|[\n\r]/g),p=f[i];if(p.length>120){for(var h=Math.floor(l/80),v=l%80,g=[],m=0;m<p.length;m+=80)g.push(p.slice(m,m+80));return d+a([["".concat(c),g[0]]].concat(g.slice(1,h+1).map((function(e){return["",e]})),[[" ",s(v-1)+"^"],["",g[h+1]]]))}return d+a([["".concat(c-1),f[i-1]],["".concat(c),p],["",s(l-1)+"^"],["".concat(c+1),f[i+1]]])}function a(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),n=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,r=e[0],i=e[1];return s(n-(t=r).length)+t+(i?" | "+i:" |")})).join("\n")}function s(e){return Array(e+1).join(" ")}},18838:function(e,t,n){"use strict";n.d(t,{$r:function(){return i},Kp:function(){return o},q4:function(){return r}});var r="function"==typeof Symbol&&null!=Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Symbol&&null!=Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator",o="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"}}]);
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.