supertokens-web-js
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[581],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),a=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,a,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),a,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1996),u=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(a.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6022:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.signOut=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var o=n(7939),i=n(8122),s=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.signOut=function(e){return o.default.getInstanceOrThrow().signOut({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return o.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return o.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return o.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return o.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=s;var a=s.init;t.init=a;var u=s.submitNewPassword;t.submitNewPassword=u;var c=s.sendPasswordResetEmail;t.sendPasswordResetEmail=c;var l=s.signUp;t.signUp=l;var f=s.signIn;t.signIn=f;var p=s.doesEmailExist;t.doesEmailExist=p;var d=s.signOut;t.signOut=d;var h=s.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=h},7939:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(5110),a=n(4071),u=n(6333),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new u.default((0,a.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(n(7725).default);t.Recipe=l,t.default=l},4071:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l;return o(this,(function(o){switch(o.label){case 0:return n=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:n,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:l}]:[2,{status:c.status,fetchResponse:l}]}}))}))},sendPasswordResetEmail:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,fetchResponse:c}]}}))}))},signUp:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,user:r.user,fetchResponse:c}]}}))}))},signIn:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===r.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:r.user,fetchResponse:c}]}}))}))},doesEmailExist:function(n){var s=n.email,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,[2,{status:r.status,doesExist:r.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},5110:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.0",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6022,e(e.s=6022));supertokensEmailPassword=t}]); | ||
"use strict";var supertokensEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[581],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),a=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,a,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),a,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(p=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1996),u=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(a.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6022:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.signOut=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var o=n(7939),i=n(8122),s=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.signOut=function(e){return o.default.getInstanceOrThrow().signOut({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return o.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return o.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return o.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return o.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=s;var a=s.init;t.init=a;var u=s.submitNewPassword;t.submitNewPassword=u;var c=s.sendPasswordResetEmail;t.sendPasswordResetEmail=c;var l=s.signUp;t.signUp=l;var f=s.signIn;t.signIn=f;var p=s.doesEmailExist;t.doesEmailExist=p;var d=s.signOut;t.signOut=d;var h=s.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=h},7939:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(5110),a=n(4071),u=n(6333),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new u.default((0,a.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(n(7725).default);t.Recipe=l,t.default=l},4071:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),s=n(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l;return o(this,(function(o){switch(o.label){case 0:return n=this.getResetPasswordTokenFromURL({userContext:u}),[4,t.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:n,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:l}]:[2,{status:c.status,fetchResponse:l}]}}))}))},sendPasswordResetEmail:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,fetchResponse:c}]}}))}))},signUp:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:[2,{status:r.status,user:r.user,fetchResponse:c}]}}))}))},signIn:function(n){var s=n.formFields,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,"FIELD_ERROR"===r.status?[2,{status:"FIELD_ERROR",formFields:r.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===r.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:r.user,fetchResponse:c}]}}))}))},doesEmailExist:function(n){var s=n.email,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return n=o.sent(),r=n.jsonBody,c=n.fetchResponse,[2,{status:r.status,doesExist:r.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},5110:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.1",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6022,e(e.s=6022));supertokensEmailPassword=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537,560],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var n=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,n=e.postInitCallbacks;t<n.length;t++)(0,n[t])()},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=n},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1260),s=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,a,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),r({method:"GET"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,a,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,d;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(d=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:d})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new a.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},3288:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailVerificationClaimClass=void 0;var u=function(e){function t(t,n){var r=e.call(this,{id:"st-ev",refresh:function(e){return a(r,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,t().isEmailVerified({userContext:e})];case 1:return n.sent(),[2]}}))}))}})||this;return r.validators=i(i({},r.validators),{isVerified:function(e,t){return void 0===e&&(e=10),void 0===t&&(t=300),{id:r.id,refresh:r.refresh,shouldRefresh:function(n,o){var i=r.getValueFromPayload(n,o);return void 0===i||r.getLastFetchedTime(n,o)<Date.now()-1e3*t||!1===i&&r.getLastFetchedTime(n,o)<Date.now()-1e3*e},validate:function(e,t){return a(r,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return!0===(r=this.getValueFromPayload(e,t))||void 0===n?[3,2]:[4,n(t)];case 1:o.sent(),o.label=2;case 2:return[2,!0===r?{isValid:!0}:{isValid:!1,reason:{message:"wrong value",expectedValue:!0,actualValue:r}}]}}))}))}}}}),r}return o(t,e),t}(n(1013).BooleanClaim);t.EmailVerificationClaimClass=u},5857:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailVerificationClaimClass=t.EmailVerificationClaim=t.getEmailVerificationTokenFromURL=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.init=void 0;var o=n(6923),i=n(8122),a=n(3288);Object.defineProperty(t,"EmailVerificationClaimClass",{enumerable:!0,get:function(){return a.EmailVerificationClaimClass}});var s=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.verifyEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.verifyEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.sendVerificationEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendVerificationEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.isEmailVerified=function(e){return o.default.getInstanceOrThrow().recipeImplementation.isEmailVerified(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getEmailVerificationTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getEmailVerificationTokenFromURL(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.EmailVerificationClaim=o.default.EmailVerificationClaim,e}();t.default=s;var u=s.init;t.init=u;var c=s.verifyEmail;t.verifyEmail=c;var l=s.sendVerificationEmail;t.sendVerificationEmail=l;var f=s.isEmailVerified;t.isEmailVerified=f;var d=s.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=d;var p=s.EmailVerificationClaim;t.EmailVerificationClaim=p},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(4881),i=n(787),a=n(5120),s=n(6333),u=n(8122),c=n(3288),l=n(5941),f=function(){function e(t){this.config=(0,i.normaliseUserInput)(t);var n=new s.default((0,a.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=n.override(this.config.override.functions).build(),l.PostSuperTokensInitCallbacks.addPostInitCallback((function(){o.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(e.EmailVerificationClaim.validators.isVerified(10))}))}return e.init=function(t){return function(n){return e.instance=new e(r(r({},t),{appInfo:n,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,u.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,u.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e.EmailVerificationClaim=new c.EmailVerificationClaimClass((function(){return e.getInstanceOrThrow().recipeImplementation})),e}();t.Recipe=f,t.default=f},5120:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),a=n(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:n})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return r=o.sent(),u=r.jsonBody,c=r.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",isVerified:r.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:r.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(6069);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},1013:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getInvalidClaimsFromResponse=t.getClaimValue=t.validateClaims=t.signOut=t.addAxiosInterceptors=t.doesSessionExist=t.attemptRefreshingSession=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=t.SessionClaimValidator=void 0;var i=n(8122),a=n(6322),s=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.getUserId=function(e){return a.default.getInstanceOrThrow().getUserId({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAccessTokenPayloadSecurely=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,a.default.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})]}))}))},e.attemptRefreshingSession=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,a.default.getInstanceOrThrow().attemptRefreshingSession()]}))}))},e.doesSessionExist=function(e){return a.default.getInstanceOrThrow().doesSessionExist({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.addAxiosInterceptors=function(e,t){return a.default.addAxiosInterceptors(e,(0,i.getNormalisedUserContext)(t))},e.signOut=function(e){return a.default.getInstanceOrThrow().signOut({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getClaimValue=function(e){return a.default.getInstanceOrThrow().getClaimValue({claim:e.claim,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.validateClaims=function(e){return a.default.getInstanceOrThrow().validateClaims({overrideGlobalClaimValidators:null==e?void 0:e.overrideGlobalClaimValidators,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getInvalidClaimsFromResponse=function(e){return a.default.getInstanceOrThrow().getInvalidClaimsFromResponse({response:e.response,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=s;var u=s.init;t.init=u;var c=s.getUserId;t.getUserId=c;var l=s.getAccessTokenPayloadSecurely;t.getAccessTokenPayloadSecurely=l;var f=s.attemptRefreshingSession;t.attemptRefreshingSession=f;var d=s.doesSessionExist;t.doesSessionExist=d;var p=s.addAxiosInterceptors;t.addAxiosInterceptors=p;var h=s.signOut;t.signOut=h;var v=s.validateClaims;t.validateClaims=v;var m=s.getClaimValue;t.getClaimValue=m;var y=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=y;var g=n(1757);Object.defineProperty(t,"SessionClaimValidator",{enumerable:!0,get:function(){return g.SessionClaimValidator}}),Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return g.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return g.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return g.BooleanClaim}})},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return a(n,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n;return s(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},4881:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var r=n(6376);Object.defineProperty(t,"SessionClaimValidatorStore",{enumerable:!0,get:function(){return r.SessionClaimValidatorStore}})},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new a.default("");return void 0!==e.apiGatewayPath&&(r=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new a.default(n):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.0",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},6376:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(2582);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(5857,e(e.s=5857));supertokensEmailVerification=t}]); | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537,560],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var n=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,n=e.postInitCallbacks;t<n.length;t++)(0,n[t])()},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=n},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1260),s=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,a,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,a),r({method:"GET"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,a,s){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),a,s)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,a,u){return o(n,void 0,void 0,(function(){var n,o,c,l,f,d;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":s.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(d=f.clone(),[4,u({requestInit:c,url:e,fetchResponse:d})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new a.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new u.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,a=e.action,s=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:a,userContext:u}))];case 1:return o=t.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,a=e.action,s=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},3288:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailVerificationClaimClass=void 0;var u=function(e){function t(t,n){var r=e.call(this,{id:"st-ev",refresh:function(e){return a(r,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,t().isEmailVerified({userContext:e})];case 1:return n.sent(),[2]}}))}))}})||this;return r.validators=i(i({},r.validators),{isVerified:function(e,t){return void 0===e&&(e=10),void 0===t&&(t=300),{id:r.id,refresh:r.refresh,shouldRefresh:function(n,o){var i=r.getValueFromPayload(n,o);return void 0===i||r.getLastFetchedTime(n,o)<Date.now()-1e3*t||!1===i&&r.getLastFetchedTime(n,o)<Date.now()-1e3*e},validate:function(e,t){return a(r,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return!0===(r=this.getValueFromPayload(e,t))||void 0===n?[3,2]:[4,n(t)];case 1:o.sent(),o.label=2;case 2:return[2,!0===r?{isValid:!0}:{isValid:!1,reason:{message:"wrong value",expectedValue:!0,actualValue:r}}]}}))}))}}}}),r}return o(t,e),t}(n(1013).BooleanClaim);t.EmailVerificationClaimClass=u},5857:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailVerificationClaimClass=t.EmailVerificationClaim=t.getEmailVerificationTokenFromURL=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.init=void 0;var o=n(6923),i=n(8122),a=n(3288);Object.defineProperty(t,"EmailVerificationClaimClass",{enumerable:!0,get:function(){return a.EmailVerificationClaimClass}});var s=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.verifyEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.verifyEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.sendVerificationEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendVerificationEmail(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.isEmailVerified=function(e){return o.default.getInstanceOrThrow().recipeImplementation.isEmailVerified(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getEmailVerificationTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getEmailVerificationTokenFromURL(r(r({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.EmailVerificationClaim=o.default.EmailVerificationClaim,e}();t.default=s;var u=s.init;t.init=u;var c=s.verifyEmail;t.verifyEmail=c;var l=s.sendVerificationEmail;t.sendVerificationEmail=l;var f=s.isEmailVerified;t.isEmailVerified=f;var d=s.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=d;var p=s.EmailVerificationClaim;t.EmailVerificationClaim=p},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(4881),i=n(787),a=n(5120),s=n(6333),u=n(8122),c=n(3288),l=n(5941),f=function(){function e(t){this.config=(0,i.normaliseUserInput)(t);var n=new s.default((0,a.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=n.override(this.config.override.functions).build(),l.PostSuperTokensInitCallbacks.addPostInitCallback((function(){o.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(e.EmailVerificationClaim.validators.isVerified(10))}))}return e.init=function(t){return function(n){return e.instance=new e(r(r({},t),{appInfo:n,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Make sure to call the EmailVerification.init method.";throw t=(0,u.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,u.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e.EmailVerificationClaim=new c.EmailVerificationClaimClass((function(){return e.getInstanceOrThrow().recipeImplementation})),e}();t.Recipe=f,t.default=f},5120:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=n(634),a=n(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:n})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"VERIFY_EMAIL"}))];case 1:return r=o.sent(),u=r.jsonBody,c=r.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.get("/user/email/verify",{},void 0,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"IS_EMAIL_VERIFIED",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"IS_EMAIL_VERIFIED"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",isVerified:r.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(n){var a=n.options,s=n.userContext;return r(this,void 0,void 0,(function(){var n,r,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.post("/user/email/verify/token",{body:JSON.stringify({})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_VERIFY_EMAIL",options:a,userContext:s}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:s,action:"SEND_VERIFY_EMAIL"}))];case 1:return n=o.sent(),r=n.jsonBody,u=n.fetchResponse,[2,{status:r.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},787:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=n(6069);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},1013:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getInvalidClaimsFromResponse=t.getClaimValue=t.validateClaims=t.signOut=t.addAxiosInterceptors=t.doesSessionExist=t.attemptRefreshingSession=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=t.SessionClaimValidator=void 0;var i=n(8122),a=n(6322),s=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.getUserId=function(e){return a.default.getInstanceOrThrow().getUserId({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAccessTokenPayloadSecurely=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,a.default.getInstanceOrThrow().getAccessTokenPayloadSecurely({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})]}))}))},e.attemptRefreshingSession=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,a.default.getInstanceOrThrow().attemptRefreshingSession()]}))}))},e.doesSessionExist=function(e){return a.default.getInstanceOrThrow().doesSessionExist({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.addAxiosInterceptors=function(e,t){return a.default.addAxiosInterceptors(e,(0,i.getNormalisedUserContext)(t))},e.signOut=function(e){return a.default.getInstanceOrThrow().signOut({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getClaimValue=function(e){return a.default.getInstanceOrThrow().getClaimValue({claim:e.claim,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.validateClaims=function(e){return a.default.getInstanceOrThrow().validateClaims({overrideGlobalClaimValidators:null==e?void 0:e.overrideGlobalClaimValidators,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getInvalidClaimsFromResponse=function(e){return a.default.getInstanceOrThrow().getInvalidClaimsFromResponse({response:e.response,userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=s;var u=s.init;t.init=u;var c=s.getUserId;t.getUserId=c;var l=s.getAccessTokenPayloadSecurely;t.getAccessTokenPayloadSecurely=l;var f=s.attemptRefreshingSession;t.attemptRefreshingSession=f;var d=s.doesSessionExist;t.doesSessionExist=d;var p=s.addAxiosInterceptors;t.addAxiosInterceptors=p;var h=s.signOut;t.signOut=h;var v=s.validateClaims;t.validateClaims=v;var m=s.getClaimValue;t.getClaimValue=m;var y=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=y;var g=n(1757);Object.defineProperty(t,"SessionClaimValidator",{enumerable:!0,get:function(){return g.SessionClaimValidator}}),Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return g.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return g.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return g.BooleanClaim}})},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return a(n,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n;return s(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=f,t.default=f},4881:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var r=n(6376);Object.defineProperty(t,"SessionClaimValidatorStore",{enumerable:!0,get:function(){return r.SessionClaimValidatorStore}})},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new a.default("");return void 0!==e.apiGatewayPath&&(r=new a.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new a.default(n):new a.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.1",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},6376:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(2582);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(5857,e(e.s=5857));supertokensEmailVerification=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[87],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),u=n(255),a=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,u,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),u,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===a?[3,4]:(p=f.clone(),[4,a({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new a.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,u=e.options,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:a}))];case 1:return o=t.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:a})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:u,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(1996),a=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,a.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(u.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},6525:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),u=n(2856),a=n(4921),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.createCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.createCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.resendCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.resendCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.consumeCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.getLinkCodeFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLinkCodeFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPreAuthSessionIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getPreAuthSessionIdFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.doesPhoneNumberExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesPhoneNumberExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.getLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.setLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.clearLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.clearLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=c;var l=c.init;t.init=l;var f=c.createCode;t.createCode=f;var p=c.resendCode;t.resendCode=p;var d=c.consumeCode;t.consumeCode=d;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.doesPhoneNumberExist;t.doesPhoneNumberExist=v;var I=c.signOut;t.signOut=I;var m=c.getLinkCodeFromURL;t.getLinkCodeFromURL=m;var g=c.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=g;var w=c.getLoginAttemptInfo;t.getLoginAttemptInfo=w;var y=c.setLoginAttemptInfo;t.setLoginAttemptInfo=y;var b=c.clearLoginAttemptInfo;t.clearLoginAttemptInfo=b},2856:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6333),u=n(8122),a=n(7725),c=n(4921),l=n(8891),f=function(e){function t(t){var n=e.call(this,(0,c.normaliseUserInput)(t))||this,r=new s.default((0,l.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,u.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,u.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(a.default);t.Recipe=f,t.default=f},8891:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(7528),u=n(634),a=n(8122),c=n(6427);function l(e){var t=new u.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return"email"in n&&(o={email:n.email}),"phoneNumber"in n&&(o={phoneNumber:n.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(r)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,a=o.fetchResponse,[2,{status:s.status,fetchResponse:a}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in n?{userInputCode:n.userInputCode,deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId}:{linkCode:n.linkCode,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,a.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,a.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:n.email},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(r({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=l,t.getRecipeImplementation=l},4921:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),u=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,u.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 1:return n=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId,flowType:n.flowType},userContext:t})];case 2:return o.sent(),[2,n]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return n=o.sent(),[2,e.recipeImplementation.resendCode(r(r({},e),{userContext:t,deviceId:void 0===n?"":n.deviceId,preAuthSessionId:void 0===n?"":n.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o,u,a;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),n={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:u=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),a=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={linkCode:u,preAuthSessionId:a},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(r({userContext:t,options:e.options},n))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return u(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(a.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.0",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6525,e(e.s=6525));supertokensPasswordless=t}]); | ||
"use strict";var supertokensPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[87],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),u=n(255),a=n(2173),c=function(){function e(e,t){var n=this;this.get=function(e,t,s,u,a){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),r({method:"GET"},t),u,a)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.post=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),r({method:"POST"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.delete=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"DELETE"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.put=function(e,t,s,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),r({method:"PUT"},t),s,u)];case 1:return n=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(n)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:n}]}}))}))},this.fetch=function(e,t,s,a){return o(n,void 0,void 0,(function(){var n,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:r(r({},t),{headers:r(r({},n),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===a?[3,4]:(p=f.clone(),[4,a({requestInit:c,url:e,fetchResponse:p})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(e){return o(n,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var r=new s.default(e),o="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(n.appInfo.apiBasePath.getAsStringDangerous()).concat(r.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=r.sent()).status)throw n=void 0===t.message?"No Error Message Provided":t.message,new a.default(n);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var n=e.recipePreAPIHook,s=e.action,u=e.options,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{action:s,userContext:a}))];case 1:return o=t.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:a})]}}))}))}},e.preparePostAPIHook=function(e){var n=e.recipePostAPIHook,s=e.action,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,n(r(r({},e),{userContext:u,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(1996),a=n(6322),c=function(e){function t(t){var n=e.call(this,t)||this;return n.signOut=function(e){return i(n,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,a.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},n}return o(t,e),t}(u.default);t.default=c},5053:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var r=n(6069);t.normaliseAuthRecipe=function(e){return(0,r.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},6525:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),u=n(2856),a=n(4921),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.createCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.createCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.resendCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.resendCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=u.default.getInstanceOrThrow(),[2,a.consumeCode(r(r({},e),{recipeImplementation:t.recipeImplementation}))]}))}))},e.getLinkCodeFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLinkCodeFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPreAuthSessionIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getPreAuthSessionIdFromURL(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.doesPhoneNumberExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesPhoneNumberExist(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.getLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.setLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(e.userContext)}))},e.clearLoginAttemptInfo=function(e){return u.default.getInstanceOrThrow().recipeImplementation.clearLoginAttemptInfo(r(r({},e),{userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,s.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=c;var l=c.init;t.init=l;var f=c.createCode;t.createCode=f;var p=c.resendCode;t.resendCode=p;var d=c.consumeCode;t.consumeCode=d;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.doesPhoneNumberExist;t.doesPhoneNumberExist=v;var I=c.signOut;t.signOut=I;var m=c.getLinkCodeFromURL;t.getLinkCodeFromURL=m;var g=c.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=g;var w=c.getLoginAttemptInfo;t.getLoginAttemptInfo=w;var y=c.setLoginAttemptInfo;t.setLoginAttemptInfo=y;var b=c.clearLoginAttemptInfo;t.clearLoginAttemptInfo=b},2856:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=n(6333),u=n(8122),a=n(7725),c=n(4921),l=n(8891),f=function(e){function t(t){var n=e.call(this,(0,c.normaliseUserInput)(t))||this,r=new s.default((0,l.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=r.override(n.config.override.functions).build(),n}return o(t,e),t.init=function(e){return function(n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,u.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,u.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(a.default);t.Recipe=f,t.default=f},8891:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=n(7528),u=n(634),a=n(8122),c=n(6427);function l(e){var t=new u.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return"email"in n&&(o={email:n.email}),"phoneNumber"in n&&(o={phoneNumber:n.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,a;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(r)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,a=o.fetchResponse,[2,{status:s.status,fetchResponse:a}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,a,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in n?{userInputCode:n.userInputCode,deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId}:{linkCode:n.linkCode,preAuthSessionId:n.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),a=s.jsonBody,c=s.fetchResponse,[2,r(r({},a),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,a.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,a.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:n.email},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},u.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),u.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext}))];case 1:return r=i.sent(),o=r.jsonBody,s=r.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(r({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=l,t.getRecipeImplementation=l},4921:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),u=n(5053);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,u.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 1:return n=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId,flowType:n.flowType},userContext:t})];case 2:return o.sent(),[2,n]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return n=o.sent(),[2,e.recipeImplementation.resendCode(r(r({},e),{userContext:t,deviceId:void 0===n?"":n.deviceId,preAuthSessionId:void 0===n?"":n.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o,u,a;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),n={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:u=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),a=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={linkCode:u,preAuthSessionId:a},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(r({userContext:t,options:e.options},n))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return n(t,void 0,void 0,(function(){return r(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return n(t,void 0,void 0,(function(){return r(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,n){var r,o=this&&this.__extends||(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)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,u)}a((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var a=n(1996),c=n(1757),l=n(8122),f=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return c.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return s(n,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n;return u(this,(function(r){return n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,n]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),n}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:r})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(a.default);t.Recipe=f,t.default=f},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var n=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];n.searchParams.set(t,r)})),n.href}catch(n){var r=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(r).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];o.searchParams.set(t,n)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,n,r=new s.default("");return void 0!==e.apiGatewayPath&&(r=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:r.appendPath((t=o.DEFAULT_API_BASE_PATH,n=e.apiBasePath,void 0!==n?new s.default(n):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.1",t.supported_fdi=["1.15"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},942:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(6398);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6525,e(e.s=6525));supertokensPasswordless=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdParty;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[298],{7611:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SSR_ERROR=e.DEFAULT_API_BASE_PATH=void 0,e.DEFAULT_API_BASE_PATH="/auth",e.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(942);e.default=n.STGeneralError},7992:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t,e){void 0===e&&(e=!1),t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(t);return e?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(t){}var o;if(t.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===t.indexOf(".")&&(t=t.substr(1)),(-1!==t.indexOf(".")||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://")){t="https://"+t;try{return new URL(t),r(t,!0)}catch(t){}}throw new Error("Please provide a valid domain name")}e.default=function(t){var e=this;this.getAsStringDangerous=function(){return e.value},this.value=r(t)}},1260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t){t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(t=new URL(t).pathname).charAt(t.length-1)?t.substr(0,t.length-1):t}catch(t){}if((function(t){if(-1===t.indexOf(".")||t.startsWith("/"))return!1;try{return-1!==new URL(t).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+t).hostname.indexOf(".")}catch(t){}return!1}(t)||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://"))return r(t="http://"+t);"/"!==t.charAt(0)&&(t="/"+t);try{return new URL("http://example.com"+t),r("http://example.com"+t)}catch(t){throw new Error("Please provide a valid URL path")}}e.default=function t(e){var n=this;this.startsWith=function(t){return n.value.startsWith(t.value)},this.appendPath=function(e){return new t(n.value+e.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(e)}},634:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1260),u=r(255),s=r(2173),c=function(){function t(t,e){var r=this;this.get=function(t,e,a,u,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t,a),n({method:"GET"},e),u,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===e.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(t),n({method:"POST"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"DELETE"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"PUT"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(t,e,a,s){return o(r,void 0,void 0,(function(){var r,o,c,l,f,h;return i(this,(function(i){switch(i.label){case 0:return r=void 0===e?{}:e.headers,[4,this.callPreAPIHook({preAPIHook:a,url:t,requestInit:n(n({},e),{headers:n(n({},r),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===s?[3,4]:(h=f.clone(),[4,s({requestInit:c,url:t,fetchResponse:h})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(t){return o(r,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return void 0===t.preAPIHook?[2,{url:t.url,requestInit:t.requestInit}]:[4,t.preAPIHook({url:t.url,requestInit:t.requestInit})];case 1:return[2,e.sent()]}}))}))},this.getFullUrl=function(t,e){var n=new a.default(t),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===e?o:o+"?"+new URLSearchParams(e)},this.getResponseJsonOrThrowGeneralError=function(t){return o(r,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return[4,t.clone().json()];case 1:if("GENERAL_ERROR"===(e=n.sent()).status)throw r=void 0===e.message?"No Error Message Provided":e.message,new s.default(r);return[2,e]}}))}))},this.recipeId=t,this.appInfo=e}var e;return e=t,t.preparePreAPIHook=function(t){var r=t.recipePreAPIHook,a=t.action,u=t.options,s=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){var o;return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{action:a,userContext:s}))];case 1:return o=e.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:s})]}}))}))}},t.preparePostAPIHook=function(t){var r=t.recipePostAPIHook,a=t.action,u=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{userContext:u,action:a}))];case 1:return e.sent(),[2]}}))}))}},t}();e.default=c},7725:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var u=r(1996),s=r(6322),c=function(t){function e(e){var r=t.call(this,e)||this;return r.signOut=function(t){return i(r,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,s.default.getInstanceOrThrow().signOut({userContext:t.userContext})];case 1:return[2,e.sent()]}}))}))},r}return o(e,t),e}(u.default);e.default=c},5053:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseAuthRecipe=void 0;var n=r(6069);e.normaliseAuthRecipe=function(t){return(0,n.normaliseRecipeModuleConfig)(t)}},1996:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.config=t}},6069:function(t,e){var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseRecipeModuleConfig=void 0,e.normaliseRecipeModuleConfig=function(t){var e=this,o=t.preAPIHook;void 0===o&&(o=function(t){return r(e,void 0,void 0,(function(){return n(this,(function(e){return[2,t]}))}))});var i=t.postAPIHook;return void 0===i&&(i=function(){return r(e,void 0,void 0,(function(){return n(this,(function(t){return[2]}))}))}),{recipeId:t.recipeId,appInfo:t.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(1996),c=r(1757),l=r(8122),f=function(t){function e(e){var r=t.call(this,e)||this;return r.getUserId=function(t){return c.default.getUserId({userContext:t.userContext})},r.getAccessTokenPayloadSecurely=function(t){return a(r,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.getAccessTokenPayloadSecurely({userContext:t.userContext})]}))}))},r.doesSessionExist=function(t){return c.default.doesSessionExist({userContext:t.userContext})},r.signOut=function(t){return c.default.signOut({userContext:t.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(t){return c.default.validateClaims(t.overrideGlobalClaimValidators,t.userContext)},c.default.init(i(i({},e),{preAPIHook:function(t){return a(r,void 0,void 0,(function(){var r;return u(this,(function(n){return r=i(i({},t),{requestInit:i(i({},t.requestInit),{headers:i(i({},t.requestInit.headers),{rid:e.recipeId})})}),void 0===e.preAPIHook?[2,r]:[2,e.preAPIHook(t)]}))}))},apiDomain:e.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:e.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(e,t),e.init=function(t){return function(r,n){return e.instance=new e(i(i({},t),{appInfo:r,recipeId:e.RECIPE_ID,enableDebugLogs:n})),e.instance}},e.prototype.getClaimValue=function(t){return c.default.getClaimValue(t)},e.prototype.getInvalidClaimsFromResponse=function(t){return c.default.getInvalidClaimsFromResponse(t)},e.addAxiosInterceptors=function(t,e){return c.default.addAxiosInterceptors(t,e)},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of Session found. Make sure to call the Session.init method.";throw t=(0,l.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,l.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="session",e}(s.default);e.Recipe=f,e.default=f},1257:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthStateFromURL=e.getAuthErrorFromURL=e.getAuthCodeFromURL=e.verifyAndGetStateOrThrowError=e.generateStateToSendToOAuthProvider=e.getAuthorisationURLFromBackend=e.setStateAndOtherInfoToStorage=e.getStateAndOtherInfoFromStorage=e.signOut=e.signInAndUp=e.getAuthorisationURLWithQueryParamsAndSetState=e.init=void 0;var o=r(8122),i=r(9102),a=function(){function t(){}return t.init=function(t){return i.default.init(t)},t.signOut=function(t){return i.default.getInstanceOrThrow().signOut({userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)})},t.getStateAndOtherInfoFromStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.setStateAndOtherInfoToStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLWithQueryParamsAndSetState=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLFromBackend=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.signInAndUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.generateStateToSendToOAuthProvider=function(t){return i.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.verifyAndGetStateOrThrowError=function(t){return i.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthCodeFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthErrorFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthStateFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t}();e.default=a;var u=a.init;e.init=u;var s=a.getAuthorisationURLWithQueryParamsAndSetState;e.getAuthorisationURLWithQueryParamsAndSetState=s;var c=a.signInAndUp;e.signInAndUp=c;var l=a.getStateAndOtherInfoFromStorage;e.getStateAndOtherInfoFromStorage=l;var f=a.setStateAndOtherInfoToStorage;e.setStateAndOtherInfoToStorage=f;var h=a.getAuthorisationURLFromBackend;e.getAuthorisationURLFromBackend=h;var d=a.generateStateToSendToOAuthProvider;e.generateStateToSendToOAuthProvider=d;var p=a.verifyAndGetStateOrThrowError;e.verifyAndGetStateOrThrowError=p;var v=a.getAuthCodeFromURL;e.getAuthCodeFromURL=v;var g=a.getAuthErrorFromURL;e.getAuthErrorFromURL=g;var w=a.getAuthStateFromURL;e.getAuthStateFromURL=w;var y=a.signOut;e.signOut=y},9102:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var a=r(4566),u=r(6333),s=r(3664),c=r(8122),l=function(t){function e(e){var r=t.call(this,(0,a.normaliseUserInput)(e))||this,n=new u.default((0,s.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdparty",e}(r(7725).default);e.Recipe=l,e.default=l},3664:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var a=r(634),u=r(8122),s=r(2173),c=r(7528);function l(t){var e=new a.default(t.recipeId,t.appInfo);return{getStateAndOtherInfoFromStorage:function(){var t=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==t)try{return JSON.parse(t)}catch(t){return}},setStateAndOtherInfoToStorage:function(t){return o(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return e=JSON.stringify(n({},t.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",e)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return o(this,void 0,void 0,(function(){var e,r,n,o;return i(this,(function(i){switch(i.label){case 0:return e=this.generateStateToSendToOAuthProvider({userContext:t.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:e,providerId:t.providerId,expiresAt:r,authorisationURL:t.authorisationURL,providerClientId:t.providerClientId},userContext:t.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:t.providerId,userContext:t.userContext,options:t.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,u.appendQueryParamsToURL)(n.url,{state:e}):(0,u.appendQueryParamsToURL)(n.url,{state:e,redirect_uri:t.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,u;return i(this,(function(i){switch(i.label){case 0:return[4,e.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:u}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,u,c,l,f,h,d,p;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),u=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:u,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),l=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(f=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(f));return[4,e.post("/signinup",{body:JSON.stringify({code:l,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(h=i.sent(),d=h.jsonBody,p=h.fetchResponse,"FIELD_ERROR"===d.status)throw new s.default(d.error);return[2,n(n({},d),{fetchResponse:p})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(t){return(parseInt(t)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(t)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(t){return o(this,void 0,void 0,(function(){return i(this,(function(e){if(void 0===t.stateObjectFromStorage||void 0===t.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===t.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(t.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(t.stateFromAuthProvider!==t.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,t.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var t=(0,u.getQueryParams)("code");return void 0===t?"":t},getAuthErrorFromURL:function(){return(0,u.getQueryParams)("error")},getAuthStateFromURL:function(){var t=(0,u.getQueryParams)("state");return void 0===t?"":t}}}e.default=l,e.getRecipeImplementation=l},4566:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},8122:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getHashFromLocation=e.getNormalisedUserContext=e.checkForSSRErrorAndAppendIfNeeded=e.getQueryParams=e.isTest=e.normaliseInputAppInfoOrThrowError=e.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),a=r(1260);e.appendQueryParamsToURL=function(t,e){if(void 0===e)return t;try{var r=new URL(t);return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];r.searchParams.set(e,n)})),r.href}catch(r){var n=t.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(t));return Object.entries(e).forEach((function(t){var e=t[0],r=t[1];o.searchParams.set(e,r)})),"".concat(o.pathname).concat(o.search)}},e.normaliseInputAppInfoOrThrowError=function(t){if(void 0===t)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===t.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===t.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var e,r,n=new a.default("");return void 0!==t.apiGatewayPath&&(n=new a.default(t.apiGatewayPath)),{appName:t.appName,apiDomain:new i.default(t.apiDomain),apiBasePath:n.appendPath((e=o.DEFAULT_API_BASE_PATH,r=t.apiBasePath,void 0!==r?new a.default(r):new a.default(e)))}},e.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(t){return!1}},e.getQueryParams=function(t){var e=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(t);if(null!==e)return e},e.checkForSSRErrorAndAppendIfNeeded=function(t){return"undefined"==typeof window&&(t+=o.SSR_ERROR),t},e.getNormalisedUserContext=function(t){return void 0===t?{}:t},e.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.supported_fdi=e.package_version=void 0,e.package_version="0.4.0",e.supported_fdi=["1.15"]},7528:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(e,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(t,e,r)=>{function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}e.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(t,e,r)=>{e.__esModule=!0,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(7860))}},t=>{var e=(1257,t(t.s=1257));supertokensThirdParty=e}]); | ||
"use strict";var supertokensThirdParty;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[298],{7611:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SSR_ERROR=e.DEFAULT_API_BASE_PATH=void 0,e.DEFAULT_API_BASE_PATH="/auth",e.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(942);e.default=n.STGeneralError},7992:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t,e){void 0===e&&(e=!1),t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(t);return e?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(t){}var o;if(t.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===t.indexOf(".")&&(t=t.substr(1)),(-1!==t.indexOf(".")||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://")){t="https://"+t;try{return new URL(t),r(t,!0)}catch(t){}}throw new Error("Please provide a valid domain name")}e.default=function(t){var e=this;this.getAsStringDangerous=function(){return e.value},this.value=r(t)}},1260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t){t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(t=new URL(t).pathname).charAt(t.length-1)?t.substr(0,t.length-1):t}catch(t){}if((function(t){if(-1===t.indexOf(".")||t.startsWith("/"))return!1;try{return-1!==new URL(t).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+t).hostname.indexOf(".")}catch(t){}return!1}(t)||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://"))return r(t="http://"+t);"/"!==t.charAt(0)&&(t="/"+t);try{return new URL("http://example.com"+t),r("http://example.com"+t)}catch(t){throw new Error("Please provide a valid URL path")}}e.default=function t(e){var n=this;this.startsWith=function(t){return n.value.startsWith(t.value)},this.appendPath=function(e){return new t(n.value+e.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(e)}},634:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1260),u=r(255),s=r(2173),c=function(){function t(t,e){var r=this;this.get=function(t,e,a,u,s){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t,a),n({method:"GET"},e),u,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===e.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(t),n({method:"POST"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"DELETE"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(t,e,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"PUT"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(t,e,a,s){return o(r,void 0,void 0,(function(){var r,o,c,l,f,h;return i(this,(function(i){switch(i.label){case 0:return r=void 0===e?{}:e.headers,[4,this.callPreAPIHook({preAPIHook:a,url:t,requestInit:n(n({},e),{headers:n(n({},r),{"fdi-version":u.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,l=o.url,[4,fetch(l,c)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===s?[3,4]:(h=f.clone(),[4,s({requestInit:c,url:t,fetchResponse:h})]);case 3:i.sent(),i.label=4;case 4:return[2,f]}}))}))},this.callPreAPIHook=function(t){return o(r,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return void 0===t.preAPIHook?[2,{url:t.url,requestInit:t.requestInit}]:[4,t.preAPIHook({url:t.url,requestInit:t.requestInit})];case 1:return[2,e.sent()]}}))}))},this.getFullUrl=function(t,e){var n=new a.default(t),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===e?o:o+"?"+new URLSearchParams(e)},this.getResponseJsonOrThrowGeneralError=function(t){return o(r,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return[4,t.clone().json()];case 1:if("GENERAL_ERROR"===(e=n.sent()).status)throw r=void 0===e.message?"No Error Message Provided":e.message,new s.default(r);return[2,e]}}))}))},this.recipeId=t,this.appInfo=e}var e;return e=t,t.preparePreAPIHook=function(t){var r=t.recipePreAPIHook,a=t.action,u=t.options,s=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){var o;return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{action:a,userContext:s}))];case 1:return o=e.sent(),void 0===u||void 0===u.preAPIHook?[2,o]:[2,u.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:s})]}}))}))}},t.preparePostAPIHook=function(t){var r=t.recipePostAPIHook,a=t.action,u=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{userContext:u,action:a}))];case 1:return e.sent(),[2]}}))}))}},t}();e.default=c},7725:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var u=r(1996),s=r(6322),c=function(t){function e(e){var r=t.call(this,e)||this;return r.signOut=function(t){return i(r,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,s.default.getInstanceOrThrow().signOut({userContext:t.userContext})];case 1:return[2,e.sent()]}}))}))},r}return o(e,t),e}(u.default);e.default=c},5053:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseAuthRecipe=void 0;var n=r(6069);e.normaliseAuthRecipe=function(t){return(0,n.normaliseRecipeModuleConfig)(t)}},1996:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.config=t}},6069:function(t,e){var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseRecipeModuleConfig=void 0,e.normaliseRecipeModuleConfig=function(t){var e=this,o=t.preAPIHook;void 0===o&&(o=function(t){return r(e,void 0,void 0,(function(){return n(this,(function(e){return[2,t]}))}))});var i=t.postAPIHook;return void 0===i&&(i=function(){return r(e,void 0,void 0,(function(){return n(this,(function(t){return[2]}))}))}),{recipeId:t.recipeId,appInfo:t.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(1996),c=r(1757),l=r(8122),f=function(t){function e(e){var r=t.call(this,e)||this;return r.getUserId=function(t){return c.default.getUserId({userContext:t.userContext})},r.getAccessTokenPayloadSecurely=function(t){return a(r,void 0,void 0,(function(){return u(this,(function(e){return[2,c.default.getAccessTokenPayloadSecurely({userContext:t.userContext})]}))}))},r.doesSessionExist=function(t){return c.default.doesSessionExist({userContext:t.userContext})},r.signOut=function(t){return c.default.signOut({userContext:t.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return u(this,(function(t){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(t){return c.default.validateClaims(t.overrideGlobalClaimValidators,t.userContext)},c.default.init(i(i({},e),{preAPIHook:function(t){return a(r,void 0,void 0,(function(){var r;return u(this,(function(n){return r=i(i({},t),{requestInit:i(i({},t.requestInit),{headers:i(i({},t.requestInit.headers),{rid:e.recipeId})})}),void 0===e.preAPIHook?[2,r]:[2,e.preAPIHook(t)]}))}))},apiDomain:e.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:e.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(e,t),e.init=function(t){return function(r,n){return e.instance=new e(i(i({},t),{appInfo:r,recipeId:e.RECIPE_ID,enableDebugLogs:n})),e.instance}},e.prototype.getClaimValue=function(t){return c.default.getClaimValue(t)},e.prototype.getInvalidClaimsFromResponse=function(t){return c.default.getInvalidClaimsFromResponse(t)},e.addAxiosInterceptors=function(t,e){return c.default.addAxiosInterceptors(t,e)},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of Session found. Make sure to call the Session.init method.";throw t=(0,l.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,l.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="session",e}(s.default);e.Recipe=f,e.default=f},1257:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthStateFromURL=e.getAuthErrorFromURL=e.getAuthCodeFromURL=e.verifyAndGetStateOrThrowError=e.generateStateToSendToOAuthProvider=e.getAuthorisationURLFromBackend=e.setStateAndOtherInfoToStorage=e.getStateAndOtherInfoFromStorage=e.signOut=e.signInAndUp=e.getAuthorisationURLWithQueryParamsAndSetState=e.init=void 0;var o=r(8122),i=r(9102),a=function(){function t(){}return t.init=function(t){return i.default.init(t)},t.signOut=function(t){return i.default.getInstanceOrThrow().signOut({userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)})},t.getStateAndOtherInfoFromStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.setStateAndOtherInfoToStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLWithQueryParamsAndSetState=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLFromBackend=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.signInAndUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.generateStateToSendToOAuthProvider=function(t){return i.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.verifyAndGetStateOrThrowError=function(t){return i.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthCodeFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthErrorFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthStateFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t}();e.default=a;var u=a.init;e.init=u;var s=a.getAuthorisationURLWithQueryParamsAndSetState;e.getAuthorisationURLWithQueryParamsAndSetState=s;var c=a.signInAndUp;e.signInAndUp=c;var l=a.getStateAndOtherInfoFromStorage;e.getStateAndOtherInfoFromStorage=l;var f=a.setStateAndOtherInfoToStorage;e.setStateAndOtherInfoToStorage=f;var h=a.getAuthorisationURLFromBackend;e.getAuthorisationURLFromBackend=h;var d=a.generateStateToSendToOAuthProvider;e.generateStateToSendToOAuthProvider=d;var p=a.verifyAndGetStateOrThrowError;e.verifyAndGetStateOrThrowError=p;var v=a.getAuthCodeFromURL;e.getAuthCodeFromURL=v;var g=a.getAuthErrorFromURL;e.getAuthErrorFromURL=g;var w=a.getAuthStateFromURL;e.getAuthStateFromURL=w;var y=a.signOut;e.signOut=y},9102:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var a=r(4566),u=r(6333),s=r(3664),c=r(8122),l=function(t){function e(e){var r=t.call(this,(0,a.normaliseUserInput)(e))||this,n=new u.default((0,s.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdparty",e}(r(7725).default);e.Recipe=l,e.default=l},3664:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var a=r(634),u=r(8122),s=r(2173),c=r(7528);function l(t){var e=new a.default(t.recipeId,t.appInfo);return{getStateAndOtherInfoFromStorage:function(){var t=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==t)try{return JSON.parse(t)}catch(t){return}},setStateAndOtherInfoToStorage:function(t){return o(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return e=JSON.stringify(n({},t.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",e)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return o(this,void 0,void 0,(function(){var e,r,n,o;return i(this,(function(i){switch(i.label){case 0:return e=this.generateStateToSendToOAuthProvider({userContext:t.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:e,providerId:t.providerId,expiresAt:r,authorisationURL:t.authorisationURL,providerClientId:t.providerClientId},userContext:t.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:t.providerId,userContext:t.userContext,options:t.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,u.appendQueryParamsToURL)(n.url,{state:e}):(0,u.appendQueryParamsToURL)(n.url,{state:e,redirect_uri:t.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,u;return i(this,(function(i){switch(i.label){case 0:return[4,e.get("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,u=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:u}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,u,c,l,f,h,d,p;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),u=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:u,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),l=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(f=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(f));return[4,e.post("/signinup",{body:JSON.stringify({code:l,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(h=i.sent(),d=h.jsonBody,p=h.fetchResponse,"FIELD_ERROR"===d.status)throw new s.default(d.error);return[2,n(n({},d),{fetchResponse:p})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(t){return(parseInt(t)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(t)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(t){return o(this,void 0,void 0,(function(){return i(this,(function(e){if(void 0===t.stateObjectFromStorage||void 0===t.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===t.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(t.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(t.stateFromAuthProvider!==t.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,t.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var t=(0,u.getQueryParams)("code");return void 0===t?"":t},getAuthErrorFromURL:function(){return(0,u.getQueryParams)("error")},getAuthStateFromURL:function(){var t=(0,u.getQueryParams)("state");return void 0===t?"":t}}}e.default=l,e.getRecipeImplementation=l},4566:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},8122:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getHashFromLocation=e.getNormalisedUserContext=e.checkForSSRErrorAndAppendIfNeeded=e.getQueryParams=e.isTest=e.normaliseInputAppInfoOrThrowError=e.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),a=r(1260);e.appendQueryParamsToURL=function(t,e){if(void 0===e)return t;try{var r=new URL(t);return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];r.searchParams.set(e,n)})),r.href}catch(r){var n=t.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(t));return Object.entries(e).forEach((function(t){var e=t[0],r=t[1];o.searchParams.set(e,r)})),"".concat(o.pathname).concat(o.search)}},e.normaliseInputAppInfoOrThrowError=function(t){if(void 0===t)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===t.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===t.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var e,r,n=new a.default("");return void 0!==t.apiGatewayPath&&(n=new a.default(t.apiGatewayPath)),{appName:t.appName,apiDomain:new i.default(t.apiDomain),apiBasePath:n.appendPath((e=o.DEFAULT_API_BASE_PATH,r=t.apiBasePath,void 0!==r?new a.default(r):new a.default(e)))}},e.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(t){return!1}},e.getQueryParams=function(t){var e=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(t);if(null!==e)return e},e.checkForSSRErrorAndAppendIfNeeded=function(t){return"undefined"==typeof window&&(t+=o.SSR_ERROR),t},e.getNormalisedUserContext=function(t){return void 0===t?{}:t},e.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.supported_fdi=e.package_version=void 0,e.package_version="0.4.1",e.supported_fdi=["1.15"]},7528:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(e,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(t,e,r)=>{function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}e.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(t,e,r)=>{e.__esModule=!0,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(7860))}},t=>{var e=(1257,t(t.s=1257));supertokensThirdParty=e}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdPartyEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[828],{7611:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SSR_ERROR=e.DEFAULT_API_BASE_PATH=void 0,e.DEFAULT_API_BASE_PATH="/auth",e.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(942);e.default=n.STGeneralError},7992:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t,e){void 0===e&&(e=!1),t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(t);return e?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(t){}var o;if(t.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===t.indexOf(".")&&(t=t.substr(1)),(-1!==t.indexOf(".")||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://")){t="https://"+t;try{return new URL(t),r(t,!0)}catch(t){}}throw new Error("Please provide a valid domain name")}e.default=function(t){var e=this;this.getAsStringDangerous=function(){return e.value},this.value=r(t)}},1260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t){t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(t=new URL(t).pathname).charAt(t.length-1)?t.substr(0,t.length-1):t}catch(t){}if((function(t){if(-1===t.indexOf(".")||t.startsWith("/"))return!1;try{return-1!==new URL(t).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+t).hostname.indexOf(".")}catch(t){}return!1}(t)||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://"))return r(t="http://"+t);"/"!==t.charAt(0)&&(t="/"+t);try{return new URL("http://example.com"+t),r("http://example.com"+t)}catch(t){throw new Error("Please provide a valid URL path")}}e.default=function t(e){var n=this;this.startsWith=function(t){return n.value.startsWith(t.value)},this.appendPath=function(e){return new t(n.value+e.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(e)}},634:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function t(t,e){var r=this;this.get=function(t,e,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t,s),n({method:"GET"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===e.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(t),n({method:"POST"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"DELETE"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"PUT"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(t,e,s,u){return o(r,void 0,void 0,(function(){var r,o,c,f,d,l;return i(this,(function(i){switch(i.label){case 0:return r=void 0===e?{}:e.headers,[4,this.callPreAPIHook({preAPIHook:s,url:t,requestInit:n(n({},e),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((d=i.sent()).status>=300)throw d;return void 0===u?[3,4]:(l=d.clone(),[4,u({requestInit:c,url:t,fetchResponse:l})]);case 3:i.sent(),i.label=4;case 4:return[2,d]}}))}))},this.callPreAPIHook=function(t){return o(r,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return void 0===t.preAPIHook?[2,{url:t.url,requestInit:t.requestInit}]:[4,t.preAPIHook({url:t.url,requestInit:t.requestInit})];case 1:return[2,e.sent()]}}))}))},this.getFullUrl=function(t,e){var n=new s.default(t),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===e?o:o+"?"+new URLSearchParams(e)},this.getResponseJsonOrThrowGeneralError=function(t){return o(r,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return[4,t.clone().json()];case 1:if("GENERAL_ERROR"===(e=n.sent()).status)throw r=void 0===e.message?"No Error Message Provided":e.message,new u.default(r);return[2,e]}}))}))},this.recipeId=t,this.appInfo=e}var e;return e=t,t.preparePreAPIHook=function(t){var r=t.recipePreAPIHook,s=t.action,a=t.options,u=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){var o;return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{action:s,userContext:u}))];case 1:return o=e.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},t.preparePostAPIHook=function(t){var r=t.recipePostAPIHook,s=t.action,a=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{userContext:a,action:s}))];case 1:return e.sent(),[2]}}))}))}},t}();e.default=c},7725:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(t){function e(e){var r=t.call(this,e)||this;return r.signOut=function(t){return i(r,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:t.userContext})];case 1:return[2,e.sent()]}}))}))},r}return o(e,t),e}(a.default);e.default=c},5053:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseAuthRecipe=void 0;var n=r(6069);e.normaliseAuthRecipe=function(t){return(0,n.normaliseRecipeModuleConfig)(t)}},7939:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(5110),a=r(4071),u=r(6333),c=r(8122),f=function(t){function e(e){var r=t.call(this,(0,s.normaliseUserInput)(e))||this,n=new u.default((0,a.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailpassword",e}(r(7725).default);e.Recipe=f,e.default=f},4071:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var i=r(634),s=r(8122);function a(t){var e=new i.default(t.recipeId,t.appInfo);return{submitNewPassword:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,f;return o(this,(function(o){switch(o.label){case 0:return r=this.getResetPasswordTokenFromURL({userContext:u}),[4,e.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:r,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:f}]:[2,{status:c.status,fetchResponse:f}]}}))}))},sendPasswordResetEmail:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,fetchResponse:c}]}}))}))},signUp:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,user:n.user,fetchResponse:c}]}}))}))},signIn:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===n.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:n.user,fetchResponse:c}]}}))}))},doesEmailExist:function(r){var s=r.email,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,[2,{status:n.status,doesExist:n.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var t=(0,s.getQueryParams)("token");return void 0===t?"":t}}}e.default=a,e.getRecipeImplementation=a},5110:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},1996:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.config=t}},6069:function(t,e){var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseRecipeModuleConfig=void 0,e.normaliseRecipeModuleConfig=function(t){var e=this,o=t.preAPIHook;void 0===o&&(o=function(t){return r(e,void 0,void 0,(function(){return n(this,(function(e){return[2,t]}))}))});var i=t.postAPIHook;return void 0===i&&(i=function(){return r(e,void 0,void 0,(function(){return n(this,(function(t){return[2]}))}))}),{recipeId:t.recipeId,appInfo:t.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),d=function(t){function e(e){var r=t.call(this,e)||this;return r.getUserId=function(t){return c.default.getUserId({userContext:t.userContext})},r.getAccessTokenPayloadSecurely=function(t){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.getAccessTokenPayloadSecurely({userContext:t.userContext})]}))}))},r.doesSessionExist=function(t){return c.default.doesSessionExist({userContext:t.userContext})},r.signOut=function(t){return c.default.signOut({userContext:t.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(t){return c.default.validateClaims(t.overrideGlobalClaimValidators,t.userContext)},c.default.init(i(i({},e),{preAPIHook:function(t){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},t),{requestInit:i(i({},t.requestInit),{headers:i(i({},t.requestInit.headers),{rid:e.recipeId})})}),void 0===e.preAPIHook?[2,r]:[2,e.preAPIHook(t)]}))}))},apiDomain:e.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:e.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(e,t),e.init=function(t){return function(r,n){return e.instance=new e(i(i({},t),{appInfo:r,recipeId:e.RECIPE_ID,enableDebugLogs:n})),e.instance}},e.prototype.getClaimValue=function(t){return c.default.getClaimValue(t)},e.prototype.getInvalidClaimsFromResponse=function(t){return c.default.getInvalidClaimsFromResponse(t)},e.addAxiosInterceptors=function(t,e){return c.default.addAxiosInterceptors(t,e)},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of Session found. Make sure to call the Session.init method.";throw t=(0,f.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,f.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="session",e}(u.default);e.Recipe=d,e.default=d},9102:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(4566),a=r(6333),u=r(3664),c=r(8122),f=function(t){function e(e){var r=t.call(this,(0,s.normaliseUserInput)(e))||this,n=new a.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdparty",e}(r(7725).default);e.Recipe=f,e.default=f},3664:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(7528);function f(t){var e=new s.default(t.recipeId,t.appInfo);return{getStateAndOtherInfoFromStorage:function(){var t=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==t)try{return JSON.parse(t)}catch(t){return}},setStateAndOtherInfoToStorage:function(t){return o(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return e=JSON.stringify(n({},t.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",e)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return o(this,void 0,void 0,(function(){var e,r,n,o;return i(this,(function(i){switch(i.label){case 0:return e=this.generateStateToSendToOAuthProvider({userContext:t.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:e,providerId:t.providerId,expiresAt:r,authorisationURL:t.authorisationURL,providerClientId:t.providerClientId},userContext:t.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:t.providerId,userContext:t.userContext,options:t.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:e}):(0,a.appendQueryParamsToURL)(n.url,{state:e,redirect_uri:t.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,e.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,f,d,l,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(d=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(d));return[4,e.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(l=i.sent(),p=l.jsonBody,h=l.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(t){return(parseInt(t)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(t)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(t){return o(this,void 0,void 0,(function(){return i(this,(function(e){if(void 0===t.stateObjectFromStorage||void 0===t.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===t.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(t.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(t.stateFromAuthProvider!==t.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,t.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var t=(0,a.getQueryParams)("code");return void 0===t?"":t},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var t=(0,a.getQueryParams)("state");return void 0===t?"":t}}}e.default=f,e.getRecipeImplementation=f},4566:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},4442:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthStateFromURL=e.getAuthErrorFromURL=e.getAuthCodeFromURL=e.verifyAndGetStateOrThrowError=e.generateStateToSendToOAuthProvider=e.setStateAndOtherInfoToStorage=e.getStateAndOtherInfoFromStorage=e.getAuthorisationURLFromBackend=e.getResetPasswordTokenFromURL=e.signOut=e.getAuthorisationURLWithQueryParamsAndSetState=e.thirdPartySignInAndUp=e.emailPasswordSignIn=e.emailPasswordSignUp=e.doesEmailExist=e.sendPasswordResetEmail=e.submitNewPassword=e.init=void 0;var o=r(8122),i=r(5716),s=function(){function t(){}return t.init=function(t){return i.default.init(t)},t.signOut=function(t){return i.default.getInstanceOrThrow().signOut({userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)})},t.submitNewPassword=function(t){return i.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.sendPasswordResetEmail=function(t){return i.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.doesEmailExist=function(t){return i.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.emailPasswordSignUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.emailPasswordSignIn=function(t){return i.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getResetPasswordTokenFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthorisationURLFromBackend=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.thirdPartySignInAndUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getStateAndOtherInfoFromStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.setStateAndOtherInfoToStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLWithQueryParamsAndSetState=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.generateStateToSendToOAuthProvider=function(t){return i.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.verifyAndGetStateOrThrowError=function(t){return i.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthCodeFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthErrorFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthStateFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t}();e.default=s;var a=s.init;e.init=a;var u=s.submitNewPassword;e.submitNewPassword=u;var c=s.sendPasswordResetEmail;e.sendPasswordResetEmail=c;var f=s.doesEmailExist;e.doesEmailExist=f;var d=s.emailPasswordSignUp;e.emailPasswordSignUp=d;var l=s.emailPasswordSignIn;e.emailPasswordSignIn=l;var p=s.thirdPartySignInAndUp;e.thirdPartySignInAndUp=p;var h=s.getAuthorisationURLWithQueryParamsAndSetState;e.getAuthorisationURLWithQueryParamsAndSetState=h;var v=s.getResetPasswordTokenFromURL;e.getResetPasswordTokenFromURL=v;var g=s.getAuthorisationURLFromBackend;e.getAuthorisationURLFromBackend=g;var m=s.getStateAndOtherInfoFromStorage;e.getStateAndOtherInfoFromStorage=m;var w=s.setStateAndOtherInfoToStorage;e.setStateAndOtherInfoToStorage=w;var P=s.generateStateToSendToOAuthProvider;e.generateStateToSendToOAuthProvider=P;var I=s.verifyAndGetStateOrThrowError;e.verifyAndGetStateOrThrowError=I;var y=s.getAuthCodeFromURL;e.getAuthCodeFromURL=y;var A=s.getAuthErrorFromURL;e.getAuthErrorFromURL=A;var R=s.getAuthStateFromURL;e.getAuthStateFromURL=R;var b=s.signOut;e.signOut=b},5716:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(7939),a=r(9102),u=r(3834),c=r(6333),f=r(1473),d=r(5367),l=r(5092),p=r(8122),h=function(t){function e(e,r){var n=t.call(this,(0,u.normaliseUserInput)(e))||this,o=new c.default((0,f.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook})).override(n.config.override.functions).build();return n.recipeImplementation=o,n.emailPasswordRecipe=void 0===r.emailPassword?new s.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:e.preAPIHook,postAPIHook:e.postAPIHook,override:{functions:function(){return(0,d.default)(o)}}}):r.emailPassword,n.thirdPartyRecipe=void 0===r.thirdParty?new a.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:e.preAPIHook,postAPIHook:e.postAPIHook,override:{functions:function(){return(0,l.default)(o)}}}):r.thirdParty,n}return o(e,t),e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method.";throw t=(0,p.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r}),{emailPassword:void 0,thirdParty:void 0}),e.instance}},e.reset=function(){(0,p.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdpartyemailpassword",e}(r(7725).default);e.Recipe=h,e.default=h},5367:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return{doesEmailExist:t.doesEmailExist.bind(t),sendPasswordResetEmail:t.sendPasswordResetEmail.bind(t),submitNewPassword:t.submitNewPassword.bind(t),getResetPasswordTokenFromURL:t.getResetPasswordTokenFromURL.bind(t),signIn:t.emailPasswordSignIn.bind(t),signUp:t.emailPasswordSignUp.bind(t)}}},1473:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var i=r(4071),s=r(3664),a=r(5367),u=r(5092);function c(t){var e=(0,i.default)(t),r=(0,s.default)(t);return{submitNewPassword:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.submitNewPassword.bind((0,a.default)(this))(t)]}))}))},sendPasswordResetEmail:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.sendPasswordResetEmail.bind((0,a.default)(this))(t)]}))}))},doesEmailExist:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.doesEmailExist.bind((0,a.default)(this))(t)]}))}))},emailPasswordSignUp:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.signUp.bind((0,a.default)(this))(t)]}))}))},emailPasswordSignIn:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.signIn.bind((0,a.default)(this))(t)]}))}))},getResetPasswordTokenFromURL:function(t){return e.getResetPasswordTokenFromURL.bind((0,a.default)(this))(t)},getAuthorisationURLFromBackend:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.getAuthorisationURLFromBackend.bind((0,u.default)(this))(t)]}))}))},thirdPartySignInAndUp:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.signInAndUp.bind((0,u.default)(this))(t)]}))}))},getStateAndOtherInfoFromStorage:function(t){return r.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(t)},setStateAndOtherInfoToStorage:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(t)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(t)]}))}))},generateStateToSendToOAuthProvider:function(t){return r.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(t)},verifyAndGetStateOrThrowError:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(t)]}))}))},getAuthCodeFromURL:function(t){return r.getAuthCodeFromURL.bind((0,u.default)(this))(t)},getAuthErrorFromURL:function(t){return r.getAuthErrorFromURL.bind((0,u.default)(this))(t)},getAuthStateFromURL:function(t){return r.getAuthStateFromURL.bind((0,u.default)(this))(t)}}}e.default=c,e.getRecipeImplementation=c},5092:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return{getAuthorisationURLFromBackend:t.getAuthorisationURLFromBackend.bind(t),getStateAndOtherInfoFromStorage:t.getStateAndOtherInfoFromStorage.bind(t),getAuthorisationURLWithQueryParamsAndSetState:t.getAuthorisationURLWithQueryParamsAndSetState.bind(t),setStateAndOtherInfoToStorage:t.setStateAndOtherInfoToStorage.bind(t),generateStateToSendToOAuthProvider:t.generateStateToSendToOAuthProvider.bind(t),getAuthCodeFromURL:t.getAuthCodeFromURL.bind(t),getAuthErrorFromURL:t.getAuthErrorFromURL.bind(t),getAuthStateFromURL:t.getAuthStateFromURL.bind(t),verifyAndGetStateOrThrowError:t.verifyAndGetStateOrThrowError.bind(t),signInAndUp:t.thirdPartySignInAndUp.bind(t)}}},3834:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},8122:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getHashFromLocation=e.getNormalisedUserContext=e.checkForSSRErrorAndAppendIfNeeded=e.getQueryParams=e.isTest=e.normaliseInputAppInfoOrThrowError=e.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),s=r(1260);e.appendQueryParamsToURL=function(t,e){if(void 0===e)return t;try{var r=new URL(t);return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];r.searchParams.set(e,n)})),r.href}catch(r){var n=t.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(t));return Object.entries(e).forEach((function(t){var e=t[0],r=t[1];o.searchParams.set(e,r)})),"".concat(o.pathname).concat(o.search)}},e.normaliseInputAppInfoOrThrowError=function(t){if(void 0===t)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===t.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===t.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var e,r,n=new s.default("");return void 0!==t.apiGatewayPath&&(n=new s.default(t.apiGatewayPath)),{appName:t.appName,apiDomain:new i.default(t.apiDomain),apiBasePath:n.appendPath((e=o.DEFAULT_API_BASE_PATH,r=t.apiBasePath,void 0!==r?new s.default(r):new s.default(e)))}},e.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(t){return!1}},e.getQueryParams=function(t){var e=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(t);if(null!==e)return e},e.checkForSSRErrorAndAppendIfNeeded=function(t){return"undefined"==typeof window&&(t+=o.SSR_ERROR),t},e.getNormalisedUserContext=function(t){return void 0===t?{}:t},e.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.supported_fdi=e.package_version=void 0,e.package_version="0.4.0",e.supported_fdi=["1.15"]},7528:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(e,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(t,e,r)=>{function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}e.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(t,e,r)=>{e.__esModule=!0,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(7860))}},t=>{var e=(4442,t(t.s=4442));supertokensThirdPartyEmailPassword=e}]); | ||
"use strict";var supertokensThirdPartyEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[828],{7611:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SSR_ERROR=e.DEFAULT_API_BASE_PATH=void 0,e.DEFAULT_API_BASE_PATH="/auth",e.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=r(942);e.default=n.STGeneralError},7992:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t,e){void 0===e&&(e=!1),t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(t);return e?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(t){}var o;if(t.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===t.indexOf(".")&&(t=t.substr(1)),(-1!==t.indexOf(".")||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://")){t="https://"+t;try{return new URL(t),r(t,!0)}catch(t){}}throw new Error("Please provide a valid domain name")}e.default=function(t){var e=this;this.getAsStringDangerous=function(){return e.value},this.value=r(t)}},1260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});function r(t){t=t.trim();try{if(!t.startsWith("http://")&&!t.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(t=new URL(t).pathname).charAt(t.length-1)?t.substr(0,t.length-1):t}catch(t){}if((function(t){if(-1===t.indexOf(".")||t.startsWith("/"))return!1;try{return-1!==new URL(t).hostname.indexOf(".")}catch(t){}try{return-1!==new URL("http://"+t).hostname.indexOf(".")}catch(t){}return!1}(t)||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://"))return r(t="http://"+t);"/"!==t.charAt(0)&&(t="/"+t);try{return new URL("http://example.com"+t),r("http://example.com"+t)}catch(t){throw new Error("Please provide a valid URL path")}}e.default=function t(e){var n=this;this.startsWith=function(t){return n.value.startsWith(t.value)},this.appendPath=function(e){return new t(n.value+e.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(e)}},634:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function t(t,e){var r=this;this.get=function(t,e,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t,s),n({method:"GET"},e),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===e.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(t),n({method:"POST"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"DELETE"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(t,e,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(t),n({method:"PUT"},e),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(t,e,s,u){return o(r,void 0,void 0,(function(){var r,o,c,f,d,l;return i(this,(function(i){switch(i.label){case 0:return r=void 0===e?{}:e.headers,[4,this.callPreAPIHook({preAPIHook:s,url:t,requestInit:n(n({},e),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,f=o.url,[4,fetch(f,c)];case 2:if((d=i.sent()).status>=300)throw d;return void 0===u?[3,4]:(l=d.clone(),[4,u({requestInit:c,url:t,fetchResponse:l})]);case 3:i.sent(),i.label=4;case 4:return[2,d]}}))}))},this.callPreAPIHook=function(t){return o(r,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return void 0===t.preAPIHook?[2,{url:t.url,requestInit:t.requestInit}]:[4,t.preAPIHook({url:t.url,requestInit:t.requestInit})];case 1:return[2,e.sent()]}}))}))},this.getFullUrl=function(t,e){var n=new s.default(t),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===e?o:o+"?"+new URLSearchParams(e)},this.getResponseJsonOrThrowGeneralError=function(t){return o(r,void 0,void 0,(function(){var e,r;return i(this,(function(n){switch(n.label){case 0:return[4,t.clone().json()];case 1:if("GENERAL_ERROR"===(e=n.sent()).status)throw r=void 0===e.message?"No Error Message Provided":e.message,new u.default(r);return[2,e]}}))}))},this.recipeId=t,this.appInfo=e}var e;return e=t,t.preparePreAPIHook=function(t){var r=t.recipePreAPIHook,s=t.action,a=t.options,u=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){var o;return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{action:s,userContext:u}))];case 1:return o=e.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},t.preparePostAPIHook=function(t){var r=t.recipePostAPIHook,s=t.action,a=t.userContext;return function(t){return o(void 0,void 0,void 0,(function(){return i(e,(function(e){switch(e.label){case 0:return[4,r(n(n({},t),{userContext:a,action:s}))];case 1:return e.sent(),[2]}}))}))}},t}();e.default=c},7725:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(t){function e(e){var r=t.call(this,e)||this;return r.signOut=function(t){return i(r,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:t.userContext})];case 1:return[2,e.sent()]}}))}))},r}return o(e,t),e}(a.default);e.default=c},5053:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseAuthRecipe=void 0;var n=r(6069);e.normaliseAuthRecipe=function(t){return(0,n.normaliseRecipeModuleConfig)(t)}},7939:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(5110),a=r(4071),u=r(6333),c=r(8122),f=function(t){function e(e){var r=t.call(this,(0,s.normaliseUserInput)(e))||this,n=new u.default((0,a.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailPassword found. Make sure to call the EmailPassword.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailpassword",e}(r(7725).default);e.Recipe=f,e.default=f},4071:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var i=r(634),s=r(8122);function a(t){var e=new i.default(t.recipeId,t.appInfo);return{submitNewPassword:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,f;return o(this,(function(o){switch(o.label){case 0:return r=this.getResetPasswordTokenFromURL({userContext:u}),[4,e.post("/user/password/reset",{body:JSON.stringify({formFields:s,token:r,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===c.status?[2,{status:"FIELD_ERROR",formFields:c.formFields,fetchResponse:f}]:[2,{status:c.status,fetchResponse:f}]}}))}))},sendPasswordResetEmail:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/user/password/reset/token",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,fetchResponse:c}]}}))}))},signUp:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/signup",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:[2,{status:n.status,user:n.user,fetchResponse:c}]}}))}))},signIn:function(r){var s=r.formFields,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.post("/signin",{body:JSON.stringify({formFields:s})},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,"FIELD_ERROR"===n.status?[2,{status:"FIELD_ERROR",formFields:n.formFields,fetchResponse:c}]:"WRONG_CREDENTIALS_ERROR"===n.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:c}]:[2,{status:"OK",user:n.user,fetchResponse:c}]}}))}))},doesEmailExist:function(r){var s=r.email,a=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.get("/signup/email/exists",{},{email:s},i.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"EMAIL_EXISTS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"EMAIL_EXISTS",userContext:u}))];case 1:return r=o.sent(),n=r.jsonBody,c=r.fetchResponse,[2,{status:n.status,doesExist:n.exists,fetchResponse:c}]}}))}))},getResetPasswordTokenFromURL:function(){var t=(0,s.getQueryParams)("token");return void 0===t?"":t}}}e.default=a,e.getRecipeImplementation=a},5110:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},1996:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.config=t}},6069:function(t,e){var r=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseRecipeModuleConfig=void 0,e.normaliseRecipeModuleConfig=function(t){var e=this,o=t.preAPIHook;void 0===o&&(o=function(t){return r(e,void 0,void 0,(function(){return n(this,(function(e){return[2,t]}))}))});var i=t.postAPIHook;return void 0===i&&(i=function(){return r(e,void 0,void 0,(function(){return n(this,(function(t){return[2]}))}))}),{recipeId:t.recipeId,appInfo:t.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var u=r(1996),c=r(1757),f=r(8122),d=function(t){function e(e){var r=t.call(this,e)||this;return r.getUserId=function(t){return c.default.getUserId({userContext:t.userContext})},r.getAccessTokenPayloadSecurely=function(t){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.getAccessTokenPayloadSecurely({userContext:t.userContext})]}))}))},r.doesSessionExist=function(t){return c.default.doesSessionExist({userContext:t.userContext})},r.signOut=function(t){return c.default.signOut({userContext:t.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(t){return c.default.validateClaims(t.overrideGlobalClaimValidators,t.userContext)},c.default.init(i(i({},e),{preAPIHook:function(t){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},t),{requestInit:i(i({},t.requestInit),{headers:i(i({},t.requestInit.headers),{rid:e.recipeId})})}),void 0===e.preAPIHook?[2,r]:[2,e.preAPIHook(t)]}))}))},apiDomain:e.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:e.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(e,t),e.init=function(t){return function(r,n){return e.instance=new e(i(i({},t),{appInfo:r,recipeId:e.RECIPE_ID,enableDebugLogs:n})),e.instance}},e.prototype.getClaimValue=function(t){return c.default.getClaimValue(t)},e.prototype.getInvalidClaimsFromResponse=function(t){return c.default.getInvalidClaimsFromResponse(t)},e.addAxiosInterceptors=function(t,e){return c.default.addAxiosInterceptors(t,e)},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of Session found. Make sure to call the Session.init method.";throw t=(0,f.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,f.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="session",e}(u.default);e.Recipe=d,e.default=d},9102:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(4566),a=r(6333),u=r(3664),c=r(8122),f=function(t){function e(e){var r=t.call(this,(0,s.normaliseUserInput)(e))||this,n=new a.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(e,t),e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw t=(0,c.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,c.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdparty",e}(r(7725).default);e.Recipe=f,e.default=f},3664:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(7528);function f(t){var e=new s.default(t.recipeId,t.appInfo);return{getStateAndOtherInfoFromStorage:function(){var t=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==t)try{return JSON.parse(t)}catch(t){return}},setStateAndOtherInfoToStorage:function(t){return o(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return e=JSON.stringify(n({},t.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",e)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return o(this,void 0,void 0,(function(){var e,r,n,o;return i(this,(function(i){switch(i.label){case 0:return e=this.generateStateToSendToOAuthProvider({userContext:t.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:e,providerId:t.providerId,expiresAt:r,authorisationURL:t.authorisationURL,providerClientId:t.providerClientId},userContext:t.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:t.providerId,userContext:t.userContext,options:t.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:e}):(0,a.appendQueryParamsToURL)(n.url,{state:e,redirect_uri:t.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,e.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,f,d,l,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(d=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(d));return[4,e.post("/signinup",{body:JSON.stringify({code:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:t.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:t.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(l=i.sent(),p=l.jsonBody,h=l.fetchResponse,"FIELD_ERROR"===p.status)throw new u.default(p.error);return[2,n(n({},p),{fetchResponse:h})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(t){return(parseInt(t)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(t)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(t){return o(this,void 0,void 0,(function(){return i(this,(function(e){if(void 0===t.stateObjectFromStorage||void 0===t.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===t.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(t.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(t.stateFromAuthProvider!==t.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,t.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var t=(0,a.getQueryParams)("code");return void 0===t?"":t},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var t=(0,a.getQueryParams)("state");return void 0===t?"":t}}}e.default=f,e.getRecipeImplementation=f},4566:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},4442:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthStateFromURL=e.getAuthErrorFromURL=e.getAuthCodeFromURL=e.verifyAndGetStateOrThrowError=e.generateStateToSendToOAuthProvider=e.setStateAndOtherInfoToStorage=e.getStateAndOtherInfoFromStorage=e.getAuthorisationURLFromBackend=e.getResetPasswordTokenFromURL=e.signOut=e.getAuthorisationURLWithQueryParamsAndSetState=e.thirdPartySignInAndUp=e.emailPasswordSignIn=e.emailPasswordSignUp=e.doesEmailExist=e.sendPasswordResetEmail=e.submitNewPassword=e.init=void 0;var o=r(8122),i=r(5716),s=function(){function t(){}return t.init=function(t){return i.default.init(t)},t.signOut=function(t){return i.default.getInstanceOrThrow().signOut({userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)})},t.submitNewPassword=function(t){return i.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.sendPasswordResetEmail=function(t){return i.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.doesEmailExist=function(t){return i.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.emailPasswordSignUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.emailPasswordSignIn=function(t){return i.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getResetPasswordTokenFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthorisationURLFromBackend=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.thirdPartySignInAndUp=function(t){return i.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getStateAndOtherInfoFromStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.setStateAndOtherInfoToStorage=function(t){return i.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthorisationURLWithQueryParamsAndSetState=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.generateStateToSendToOAuthProvider=function(t){return i.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.verifyAndGetStateOrThrowError=function(t){return i.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(t.userContext)}))},t.getAuthCodeFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthErrorFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t.getAuthStateFromURL=function(t){return i.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},t),{userContext:(0,o.getNormalisedUserContext)(null==t?void 0:t.userContext)}))},t}();e.default=s;var a=s.init;e.init=a;var u=s.submitNewPassword;e.submitNewPassword=u;var c=s.sendPasswordResetEmail;e.sendPasswordResetEmail=c;var f=s.doesEmailExist;e.doesEmailExist=f;var d=s.emailPasswordSignUp;e.emailPasswordSignUp=d;var l=s.emailPasswordSignIn;e.emailPasswordSignIn=l;var p=s.thirdPartySignInAndUp;e.thirdPartySignInAndUp=p;var h=s.getAuthorisationURLWithQueryParamsAndSetState;e.getAuthorisationURLWithQueryParamsAndSetState=h;var v=s.getResetPasswordTokenFromURL;e.getResetPasswordTokenFromURL=v;var g=s.getAuthorisationURLFromBackend;e.getAuthorisationURLFromBackend=g;var m=s.getStateAndOtherInfoFromStorage;e.getStateAndOtherInfoFromStorage=m;var w=s.setStateAndOtherInfoToStorage;e.setStateAndOtherInfoToStorage=w;var P=s.generateStateToSendToOAuthProvider;e.generateStateToSendToOAuthProvider=P;var I=s.verifyAndGetStateOrThrowError;e.verifyAndGetStateOrThrowError=I;var y=s.getAuthCodeFromURL;e.getAuthCodeFromURL=y;var A=s.getAuthErrorFromURL;e.getAuthErrorFromURL=A;var R=s.getAuthStateFromURL;e.getAuthStateFromURL=R;var b=s.signOut;e.signOut=b},5716:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var s=r(7939),a=r(9102),u=r(3834),c=r(6333),f=r(1473),d=r(5367),l=r(5092),p=r(8122),h=function(t){function e(e,r){var n=t.call(this,(0,u.normaliseUserInput)(e))||this,o=new c.default((0,f.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook})).override(n.config.override.functions).build();return n.recipeImplementation=o,n.emailPasswordRecipe=void 0===r.emailPassword?new s.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:e.preAPIHook,postAPIHook:e.postAPIHook,override:{functions:function(){return(0,d.default)(o)}}}):r.emailPassword,n.thirdPartyRecipe=void 0===r.thirdParty?new a.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:e.preAPIHook,postAPIHook:e.postAPIHook,override:{functions:function(){return(0,l.default)(o)}}}):r.thirdParty,n}return o(e,t),e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method.";throw t=(0,p.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.init=function(t){return function(r){return e.instance=new e(i(i({},t),{recipeId:e.RECIPE_ID,appInfo:r}),{emailPassword:void 0,thirdParty:void 0}),e.instance}},e.reset=function(){(0,p.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="thirdpartyemailpassword",e}(r(7725).default);e.Recipe=h,e.default=h},5367:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return{doesEmailExist:t.doesEmailExist.bind(t),sendPasswordResetEmail:t.sendPasswordResetEmail.bind(t),submitNewPassword:t.submitNewPassword.bind(t),getResetPasswordTokenFromURL:t.getResetPasswordTokenFromURL.bind(t),signIn:t.emailPasswordSignIn.bind(t),signUp:t.emailPasswordSignUp.bind(t)}}},1473:function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var i=r(4071),s=r(3664),a=r(5367),u=r(5092);function c(t){var e=(0,i.default)(t),r=(0,s.default)(t);return{submitNewPassword:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.submitNewPassword.bind((0,a.default)(this))(t)]}))}))},sendPasswordResetEmail:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.sendPasswordResetEmail.bind((0,a.default)(this))(t)]}))}))},doesEmailExist:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.doesEmailExist.bind((0,a.default)(this))(t)]}))}))},emailPasswordSignUp:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.signUp.bind((0,a.default)(this))(t)]}))}))},emailPasswordSignIn:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,e.signIn.bind((0,a.default)(this))(t)]}))}))},getResetPasswordTokenFromURL:function(t){return e.getResetPasswordTokenFromURL.bind((0,a.default)(this))(t)},getAuthorisationURLFromBackend:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.getAuthorisationURLFromBackend.bind((0,u.default)(this))(t)]}))}))},thirdPartySignInAndUp:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.signInAndUp.bind((0,u.default)(this))(t)]}))}))},getStateAndOtherInfoFromStorage:function(t){return r.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(t)},setStateAndOtherInfoToStorage:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(t)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(t)]}))}))},generateStateToSendToOAuthProvider:function(t){return r.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(t)},verifyAndGetStateOrThrowError:function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,r.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(t)]}))}))},getAuthCodeFromURL:function(t){return r.getAuthCodeFromURL.bind((0,u.default)(this))(t)},getAuthErrorFromURL:function(t){return r.getAuthErrorFromURL.bind((0,u.default)(this))(t)},getAuthStateFromURL:function(t){return r.getAuthStateFromURL.bind((0,u.default)(this))(t)}}}e.default=c,e.getRecipeImplementation=c},5092:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return{getAuthorisationURLFromBackend:t.getAuthorisationURLFromBackend.bind(t),getStateAndOtherInfoFromStorage:t.getStateAndOtherInfoFromStorage.bind(t),getAuthorisationURLWithQueryParamsAndSetState:t.getAuthorisationURLWithQueryParamsAndSetState.bind(t),setStateAndOtherInfoToStorage:t.setStateAndOtherInfoToStorage.bind(t),generateStateToSendToOAuthProvider:t.generateStateToSendToOAuthProvider.bind(t),getAuthCodeFromURL:t.getAuthCodeFromURL.bind(t),getAuthErrorFromURL:t.getAuthErrorFromURL.bind(t),getAuthStateFromURL:t.getAuthStateFromURL.bind(t),verifyAndGetStateOrThrowError:t.verifyAndGetStateOrThrowError.bind(t),signInAndUp:t.thirdPartySignInAndUp.bind(t)}}},3834:function(t,e,r){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.normaliseUserInput=void 0;var o=r(5053);e.normaliseUserInput=function(t){var e=n({functions:function(t){return t}},t.override);return n(n({},(0,o.normaliseAuthRecipe)(t)),{override:e})}},8122:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getHashFromLocation=e.getNormalisedUserContext=e.checkForSSRErrorAndAppendIfNeeded=e.getQueryParams=e.isTest=e.normaliseInputAppInfoOrThrowError=e.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),s=r(1260);e.appendQueryParamsToURL=function(t,e){if(void 0===e)return t;try{var r=new URL(t);return Object.entries(e).forEach((function(t){var e=t[0],n=t[1];r.searchParams.set(e,n)})),r.href}catch(r){var n=t.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(t));return Object.entries(e).forEach((function(t){var e=t[0],r=t[1];o.searchParams.set(e,r)})),"".concat(o.pathname).concat(o.search)}},e.normaliseInputAppInfoOrThrowError=function(t){if(void 0===t)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===t.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===t.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var e,r,n=new s.default("");return void 0!==t.apiGatewayPath&&(n=new s.default(t.apiGatewayPath)),{appName:t.appName,apiDomain:new i.default(t.apiDomain),apiBasePath:n.appendPath((e=o.DEFAULT_API_BASE_PATH,r=t.apiBasePath,void 0!==r?new s.default(r):new s.default(e)))}},e.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(t){return!1}},e.getQueryParams=function(t){var e=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(t);if(null!==e)return e},e.checkForSSRErrorAndAppendIfNeeded=function(t){return"undefined"==typeof window&&(t+=o.SSR_ERROR),t},e.getNormalisedUserContext=function(t){return void 0===t?{}:t},e.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.supported_fdi=e.package_version=void 0,e.package_version="0.4.1",e.supported_fdi=["1.15"]},7528:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(e,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(t,e,r)=>{function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}e.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(t,e,r)=>{e.__esModule=!0,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(7860))}},t=>{var e=(4442,t(t.s=4442));supertokensThirdPartyEmailPassword=e}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensThirdPartyPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[425],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),n({method:"GET"},t),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,s,u){return o(r,void 0,void 0,(function(){var r,o,c,d,l,f;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,d=o.url,[4,fetch(d,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(f=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new s.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(a.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},2856:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6333),a=r(8122),u=r(7725),c=r(4921),d=r(8891),l=function(e){function t(t){var r=e.call(this,(0,c.normaliseUserInput)(t))||this,n=new s.default((0,d.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,a.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,a.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(u.default);t.Recipe=l,t.default=l},8891:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(7528),a=r(634),u=r(8122),c=r(6427);function d(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return"email"in r&&(o={email:r.email}),"phoneNumber"in r&&(o={phoneNumber:r.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},resendCode:function(r){return o(this,void 0,void 0,(function(){var n,o,s,u;return i(this,(function(i){switch(i.label){case 0:return n={deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(n)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in r?{userInputCode:r.userInputCode,deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId}:{linkCode:r.linkCode,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:r.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:r.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(n({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=d,t.getRecipeImplementation=d},4921:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=r(8122),a=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(n(n({},e),{userContext:t}))];case 1:return r=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId,flowType:r.flowType},userContext:t})];case 2:return o.sent(),[2,r]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return r=o.sent(),[2,e.recipeImplementation.resendCode(n(n({},e),{userContext:t,deviceId:void 0===r?"":r.deviceId,preAuthSessionId:void 0===r?"":r.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,u;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),r={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),r={linkCode:a,preAuthSessionId:u},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(n({userContext:t,options:e.options},r))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),d=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(4566),a=r(6333),u=r(3664),c=r(8122),d=function(e){function t(t){var r=e.call(this,(0,s.normaliseUserInput)(t))||this,n=new a.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(r(7725).default);t.Recipe=d,t.default=d},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(7528);function d(e){var t=new s.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:t}):(0,a.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,d,l,f,h,p;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),d=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:d,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(f=i.sent(),h=f.jsonBody,p=f.fetchResponse,"FIELD_ERROR"===h.status)throw new u.default(h.error);return[2,n(n({},h),{fetchResponse:p})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,a.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,a.getQueryParams)("state");return void 0===e?"":e}}}t.default=d,t.getRecipeImplementation=d},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},4706:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearPasswordlessLoginAttemptInfo=t.setPasswordlessLoginAttemptInfo=t.getPasswordlessLoginAttemptInfo=t.getPasswordlessPreAuthSessionIdFromURL=t.getPasswordlessLinkCodeFromURL=t.getThirdPartyAuthStateFromURL=t.getThirdPartyAuthErrorFromURL=t.getThirdPartyAuthCodeFromURL=t.verifyAndGetThirdPartyStateOrThrowError=t.generateThirdPartyStateToSendToOAuthProvider=t.setThirdPartyStateAndOtherInfoToStorage=t.getThirdPartyStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.signOut=t.doesPasswordlessUserPhoneNumberExist=t.doesPasswordlessUserEmailExist=t.consumePasswordlessCode=t.resendPasswordlessCode=t.createPasswordlessCode=t.thirdPartySignInAndUp=t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var s=r(8495),a=r(8122),u=r(4921),c=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setThirdPartyStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setThirdPartyStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateThirdPartyStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateThirdPartyStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetThirdPartyStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetThirdPartyStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.createPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.createCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.resendPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.resendCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.consumePasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.consumeCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.getPasswordlessLinkCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLinkCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPasswordlessPreAuthSessionIdFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessPreAuthSessionIdFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesPasswordlessUserEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesPasswordlessUserPhoneNumberExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserPhoneNumberExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.clearPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.clearPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var d=c.init;t.init=d;var l=c.getThirdPartyAuthorisationURLWithQueryParamsAndSetState;t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=l;var f=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=f;var h=c.createPasswordlessCode;t.createPasswordlessCode=h;var p=c.resendPasswordlessCode;t.resendPasswordlessCode=p;var v=c.consumePasswordlessCode;t.consumePasswordlessCode=v;var g=c.doesPasswordlessUserEmailExist;t.doesPasswordlessUserEmailExist=g;var P=c.doesPasswordlessUserPhoneNumberExist;t.doesPasswordlessUserPhoneNumberExist=P;var m=c.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=m;var I=c.getThirdPartyStateAndOtherInfoFromStorage;t.getThirdPartyStateAndOtherInfoFromStorage=I;var w=c.setThirdPartyStateAndOtherInfoToStorage;t.setThirdPartyStateAndOtherInfoToStorage=w;var y=c.generateThirdPartyStateToSendToOAuthProvider;t.generateThirdPartyStateToSendToOAuthProvider=y;var A=c.verifyAndGetThirdPartyStateOrThrowError;t.verifyAndGetThirdPartyStateOrThrowError=A;var b=c.getThirdPartyAuthCodeFromURL;t.getThirdPartyAuthCodeFromURL=b;var S=c.getThirdPartyAuthErrorFromURL;t.getThirdPartyAuthErrorFromURL=S;var _=c.getThirdPartyAuthStateFromURL;t.getThirdPartyAuthStateFromURL=_;var O=c.getPasswordlessLinkCodeFromURL;t.getPasswordlessLinkCodeFromURL=O;var C=c.getPasswordlessPreAuthSessionIdFromURL;t.getPasswordlessPreAuthSessionIdFromURL=C;var R=c.getPasswordlessLoginAttemptInfo;t.getPasswordlessLoginAttemptInfo=R;var x=c.setPasswordlessLoginAttemptInfo;t.setPasswordlessLoginAttemptInfo=x;var T=c.clearPasswordlessLoginAttemptInfo;t.clearPasswordlessLoginAttemptInfo=T;var E=c.signOut;t.signOut=E},8495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(9102),a=r(2856),u=r(3063),c=r(6333),d=r(1187),l=r(8122),f=r(5491),h=r(9817),p=function(e){function t(t,r){var n=e.call(this,(0,u.normaliseUserInput)(t))||this,o=new c.default((0,d.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook})).override(n.config.override.functions).build();return n.recipeImplementation=o,n.thirdPartyRecipe=void 0===r.thirdParty?new s.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,f.default)(o)}}}):r.thirdParty,n.passwordlessRecipe=void 0===r.passwordless?new a.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,h.default)(o)}}}):r.passwordless,n}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyPasswordless found. Make sure to call the ThirdPartyPasswordless.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{thirdParty:void 0,passwordless:void 0}),t.instance}},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartypasswordless",t}(r(7725).default);t.Recipe=p,t.default=p},1187:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(3664),s=r(8891),a=r(5491),u=r(9817);function c(e){var t=(0,i.default)(e),r=(0,s.default)(e);return{getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLFromBackend.bind((0,a.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signInAndUp.bind((0,a.default)(this))(e)]}))}))},getThirdPartyStateAndOtherInfoFromStorage:function(e){return t.getStateAndOtherInfoFromStorage.bind((0,a.default)(this))(e)},setThirdPartyStateAndOtherInfoToStorage:function(e){return t.setStateAndOtherInfoToStorage.bind((0,a.default)(this))(e)},getThirdPartyAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLWithQueryParamsAndSetState.bind((0,a.default)(this))(e)]}))}))},generateThirdPartyStateToSendToOAuthProvider:function(e){return t.generateStateToSendToOAuthProvider.bind((0,a.default)(this))(e)},verifyAndGetThirdPartyStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.verifyAndGetStateOrThrowError.bind((0,a.default)(this))(e)]}))}))},getThirdPartyAuthCodeFromURL:function(e){return t.getAuthCodeFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthErrorFromURL:function(e){return t.getAuthErrorFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthStateFromURL:function(e){return t.getAuthStateFromURL.bind((0,a.default)(this))(e)},createPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.createCode.bind((0,u.default)(this))(e)]}))}))},resendPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.resendCode.bind((0,u.default)(this))(e)]}))}))},consumePasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.consumeCode.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLinkCodeFromURL:function(e){return r.getLinkCodeFromURL.bind((0,u.default)(this))(e)},getPasswordlessPreAuthSessionIdFromURL:function(e){return r.getPreAuthSessionIdFromURL.bind((0,u.default)(this))(e)},doesPasswordlessUserEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesEmailExist.bind((0,u.default)(this))(e)]}))}))},doesPasswordlessUserPhoneNumberExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesPhoneNumberExist.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLoginAttemptInfo:function(e){return r.getLoginAttemptInfo.bind((0,u.default)(this))(e)},setPasswordlessLoginAttemptInfo:function(e){return r.setLoginAttemptInfo.bind((0,u.default)(this))(e)},clearPasswordlessLoginAttemptInfo:function(e){return r.clearLoginAttemptInfo.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},9817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{clearLoginAttemptInfo:e.clearPasswordlessLoginAttemptInfo.bind(e),consumeCode:e.consumePasswordlessCode.bind(e),createCode:e.createPasswordlessCode.bind(e),doesEmailExist:e.doesPasswordlessUserEmailExist.bind(e),doesPhoneNumberExist:e.doesPasswordlessUserPhoneNumberExist.bind(e),getLoginAttemptInfo:e.getPasswordlessLoginAttemptInfo.bind(e),resendCode:e.resendPasswordlessCode.bind(e),setLoginAttemptInfo:e.setPasswordlessLoginAttemptInfo.bind(e),getLinkCodeFromURL:e.getPasswordlessLinkCodeFromURL.bind(e),getPreAuthSessionIdFromURL:e.getPasswordlessPreAuthSessionIdFromURL.bind(e)}}},5491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getThirdPartyStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setThirdPartyStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateThirdPartyStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getThirdPartyAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getThirdPartyAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getThirdPartyAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetThirdPartyStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3063:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),s=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new s.default("");return void 0!==e.apiGatewayPath&&(n=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new s.default(r):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.0",t.supported_fdi=["1.15"]},7528:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4706,e(e.s=4706));supertokensThirdPartyPasswordless=t}]); | ||
"use strict";var supertokensThirdPartyPasswordless;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[425],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(942);t.default=n.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var n=new URL(e);return t?n.hostname.startsWith("localhost")||(o=n.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+n.host:"https://"+n.host:n.protocol+"//"+n.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function r(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return r(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),r("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var n=this;this.startsWith=function(e){return n.value.startsWith(e.value)},this.appendPath=function(t){return new e(n.value+t.value)},this.getAsStringDangerous=function(){return n.value},this.value=r(t)}},634:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1260),a=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,s,a,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e,s),n({method:"GET"},t),a,u)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.post=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===t.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e),n({method:"POST"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"DELETE"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,s,a){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:return[4,this.fetch(this.getFullUrl(e),n({method:"PUT"},t),s,a)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,s,u){return o(r,void 0,void 0,(function(){var r,o,c,d,l,f;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:s,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":a.supported_fdi.join(","),"Content-Type":"application/json",rid:this.recipeId})})})];case 1:return o=i.sent(),c=o.requestInit,d=o.url,[4,fetch(d,c)];case 2:if((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(f=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,l]}}))}))},this.callPreAPIHook=function(e){return o(r,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return void 0===e.preAPIHook?[2,{url:e.url,requestInit:e.requestInit}]:[4,e.preAPIHook({url:e.url,requestInit:e.requestInit})];case 1:return[2,t.sent()]}}))}))},this.getFullUrl=function(e,t){var n=new s.default(e),o="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(r.appInfo.apiBasePath.getAsStringDangerous()).concat(n.getAsStringDangerous());return void 0===t?o:o+"?"+new URLSearchParams(t)},this.getResponseJsonOrThrowGeneralError=function(e){return o(r,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return[4,e.clone().json()];case 1:if("GENERAL_ERROR"===(t=n.sent()).status)throw r=void 0===t.message?"No Error Message Provided":t.message,new u.default(r);return[2,t]}}))}))},this.recipeId=e,this.appInfo=t}var t;return t=e,e.preparePreAPIHook=function(e){var r=e.recipePreAPIHook,s=e.action,a=e.options,u=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){var o;return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{action:s,userContext:u}))];case 1:return o=t.sent(),void 0===a||void 0===a.preAPIHook?[2,o]:[2,a.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},e.preparePostAPIHook=function(e){var r=e.recipePostAPIHook,s=e.action,a=e.userContext;return function(e){return o(void 0,void 0,void 0,(function(){return i(t,(function(t){switch(t.label){case 0:return[4,r(n(n({},e),{userContext:a,action:s}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},7725:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1996),u=r(6322),c=function(e){function t(t){var r=e.call(this,t)||this;return r.signOut=function(e){return i(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,u.default.getInstanceOrThrow().signOut({userContext:e.userContext})];case 1:return[2,t.sent()]}}))}))},r}return o(t,e),t}(a.default);t.default=c},5053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipe=void 0;var n=r(6069);t.normaliseAuthRecipe=function(e){return(0,n.normaliseRecipeModuleConfig)(e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY=void 0,t.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY="supertokens-passwordless-loginAttemptInfo"},2856:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(6333),a=r(8122),u=r(7725),c=r(4921),d=r(8891),l=function(e){function t(t){var r=e.call(this,(0,c.normaliseUserInput)(t))||this,n=new s.default((0,d.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Make sure to call the Passwordless.init method.";throw e=(0,a.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,a.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="passwordless",t}(u.default);t.Recipe=l,t.default=l},8891:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(7528),a=r(634),u=r(8122),c=r(6427);function d(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return"email"in r&&(o={email:r.email}),"phoneNumber"in r&&(o={phoneNumber:r.phoneNumber}),[4,t.post("/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},resendCode:function(r){return o(this,void 0,void 0,(function(){var n,o,s,u;return i(this,(function(i){switch(i.label){case 0:return n={deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/resend",{body:JSON.stringify(n)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:r.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(r){return o(this,void 0,void 0,(function(){var o,s,u,c;return i(this,(function(i){switch(i.label){case 0:return o="userInputCode"in r?{userInputCode:r.userInputCode,deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId}:{linkCode:r.linkCode,preAuthSessionId:r.preAuthSessionId},[4,t.post("/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:r.userContext}))];case 1:return s=i.sent(),u=s.jsonBody,c=s.fetchResponse,[2,n(n({},u),{fetchResponse:c})]}}))}))},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/email/exists",{},{email:r.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},doesPhoneNumberExist:function(r){return o(this,void 0,void 0,(function(){var n,o,s;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/signup/phoneNumber/exists",{},{phoneNumber:r.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext,options:r.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:s}]}}))}))},getLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.getItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY)];case 1:if(null===(e=t.sent()))return[2,void 0];try{return[2,JSON.parse(e)]}catch(e){return[2,void 0]}return[2]}}))}))},setLoginAttemptInfo:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.setItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY,JSON.stringify(n({version:1},e.attemptInfo)))];case 1:return t.sent(),[2]}}))}))},clearLoginAttemptInfo:function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return s.WindowHandlerReference.getReferenceOrThrow().windowHandler.localStorage.removeItem(c.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=d,t.getRecipeImplementation=d},4921:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=r(8122),a=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.createCode(n(n({},e),{userContext:t}))];case 1:return r=o.sent(),[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{deviceId:r.deviceId,preAuthSessionId:r.preAuthSessionId,flowType:r.flowType},userContext:t})];case 2:return o.sent(),[2,r]}}))}))},t.resendCode=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})];case 1:return r=o.sent(),[2,e.recipeImplementation.resendCode(n(n({},e),{userContext:t,deviceId:void 0===r?"":r.deviceId,preAuthSessionId:void 0===r?"":r.preAuthSessionId}))]}}))}))},t.consumeCode=function(e){return o(this,void 0,void 0,(function(){var t,r,o,a,u;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),"userInputCode"in e?[4,e.recipeImplementation.getLoginAttemptInfo({userContext:t})]:[3,2];case 1:return o=i.sent(),r={userInputCode:e.userInputCode,deviceId:void 0===o?"":o.deviceId,preAuthSessionId:void 0===o?"":o.preAuthSessionId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),r={linkCode:a,preAuthSessionId:u},i.label=3;case 3:return[2,e.recipeImplementation.consumeCode(n({userContext:t,options:e.options},r))]}}))}))}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseRecipeModuleConfig=void 0,t.normaliseRecipeModuleConfig=function(e){var t=this,o=e.preAPIHook;void 0===o&&(o=function(e){return r(t,void 0,void 0,(function(){return n(this,(function(t){return[2,e]}))}))});var i=e.postAPIHook;return void 0===i&&(i=function(){return r(t,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))}),{recipeId:e.recipeId,appInfo:e.appInfo,preAPIHook:o,postAPIHook:i}}},6322:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),d=r(8122),l=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return c.default.getUserId({userContext:e.userContext})},r.getAccessTokenPayloadSecurely=function(e){return s(r,void 0,void 0,(function(){return a(this,(function(t){return[2,c.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return c.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return c.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return s(r,void 0,void 0,(function(){return a(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(e){return c.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},c.default.init(i(i({},t),{preAPIHook:function(e){return s(r,void 0,void 0,(function(){var r;return a(this,(function(n){return r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:i(i({},e.requestInit.headers),{rid:t.recipeId})})}),void 0===t.preAPIHook?[2,r]:[2,t.preAPIHook(e)]}))}))},apiDomain:t.appInfo.apiDomain.getAsStringDangerous(),apiBasePath:t.appInfo.apiBasePath.getAsStringDangerous()})),r}return o(t,e),t.init=function(e){return function(r,n){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:n})),t.instance}},t.prototype.getClaimValue=function(e){return c.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return c.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return c.default.addAxiosInterceptors(e,t)},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Session found. Make sure to call the Session.init method.";throw e=(0,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},9102:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(4566),a=r(6333),u=r(3664),c=r(8122),d=function(e){function t(t){var r=e.call(this,(0,s.normaliseUserInput)(t))||this,n=new a.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=n.override(r.config.override.functions).build(),r}return o(t,e),t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Make sure to call the ThirdParty.init method.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(r(7725).default);t.Recipe=d,t.default=d},3664:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var s=r(634),a=r(8122),u=r(2173),c=r(7528);function d(e){var t=new s.default(e.recipeId,e.appInfo);return{getStateAndOtherInfoFromStorage:function(){var e=c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.getItemSync("supertokens-oauth-state-2");if(null!==e)try{return JSON.parse(e)}catch(e){return}},setStateAndOtherInfoToStorage:function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return t=JSON.stringify(n({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return r.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:return t=this.generateStateToSendToOAuthProvider({userContext:e.userContext}),r=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:t,providerId:e.providerId,expiresAt:r,authorisationURL:e.authorisationURL,providerClientId:e.providerClientId},userContext:e.userContext})];case 1:return i.sent(),[4,this.getAuthorisationURLFromBackend({providerId:e.providerId,userContext:e.userContext,options:e.options})];case 2:return n=i.sent(),o=new URL(n.url),[2,null!==o.searchParams.get("redirect_uri")?(0,a.appendQueryParamsToURL)(n.url,{state:t}):(0,a.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend:function(r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,t.get("/authorisationurl",{},{thirdPartyId:r.providerId},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,a=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:a}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,a,c,d,l,f,h,p;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),a=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:a,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),d=this.getAuthCodeFromURL({userContext:r.userContext}),void 0!==(l=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(l));return[4,t.post("/signinup",{body:JSON.stringify({code:d,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(f=i.sent(),h=f.jsonBody,p=f.fetchResponse,"FIELD_ERROR"===h.status)throw new u.default(h.error);return[2,n(n({},h),{fetchResponse:p})]}}))}))},generateStateToSendToOAuthProvider:function(){return"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))},verifyAndGetStateOrThrowError:function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){if(void 0===e.stateObjectFromStorage||void 0===e.stateObjectFromStorage.stateForAuthProvider)throw new Error("No valid auth state present in session storage");if(void 0===e.stateFromAuthProvider)throw new Error("No state recieved from auth provider");if(e.stateObjectFromStorage.expiresAt<Date.now())throw new Error("Auth state verification failed. The auth provider took too long to respond");if(e.stateFromAuthProvider!==e.stateObjectFromStorage.stateForAuthProvider)throw new Error("Auth state verification failed. The auth provider responded with an invalid state");return[2,e.stateObjectFromStorage]}))}))},getAuthCodeFromURL:function(){var e=(0,a.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,a.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,a.getQueryParams)("state");return void 0===e?"":e}}}t.default=d,t.getRecipeImplementation=d},4566:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},4706:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.clearPasswordlessLoginAttemptInfo=t.setPasswordlessLoginAttemptInfo=t.getPasswordlessLoginAttemptInfo=t.getPasswordlessPreAuthSessionIdFromURL=t.getPasswordlessLinkCodeFromURL=t.getThirdPartyAuthStateFromURL=t.getThirdPartyAuthErrorFromURL=t.getThirdPartyAuthCodeFromURL=t.verifyAndGetThirdPartyStateOrThrowError=t.generateThirdPartyStateToSendToOAuthProvider=t.setThirdPartyStateAndOtherInfoToStorage=t.getThirdPartyStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.signOut=t.doesPasswordlessUserPhoneNumberExist=t.doesPasswordlessUserEmailExist=t.consumePasswordlessCode=t.resendPasswordlessCode=t.createPasswordlessCode=t.thirdPartySignInAndUp=t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var s=r(8495),a=r(8122),u=r(4921),c=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.thirdPartySignInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setThirdPartyStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setThirdPartyStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateThirdPartyStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateThirdPartyStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetThirdPartyStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetThirdPartyStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getThirdPartyAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getThirdPartyAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getThirdPartyAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.createPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.createCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.resendPasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.resendCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.consumePasswordlessCode=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=s.default.getInstanceOrThrow(),[2,u.consumeCode(n(n({},e),{recipeImplementation:t.passwordlessRecipe.recipeImplementation}))]}))}))},e.getPasswordlessLinkCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLinkCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getPasswordlessPreAuthSessionIdFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessPreAuthSessionIdFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesPasswordlessUserEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesPasswordlessUserPhoneNumberExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesPasswordlessUserPhoneNumberExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.clearPasswordlessLoginAttemptInfo=function(e){return s.default.getInstanceOrThrow().recipeImplementation.clearPasswordlessLoginAttemptInfo(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var d=c.init;t.init=d;var l=c.getThirdPartyAuthorisationURLWithQueryParamsAndSetState;t.getThirdPartyAuthorisationURLWithQueryParamsAndSetState=l;var f=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=f;var h=c.createPasswordlessCode;t.createPasswordlessCode=h;var p=c.resendPasswordlessCode;t.resendPasswordlessCode=p;var v=c.consumePasswordlessCode;t.consumePasswordlessCode=v;var g=c.doesPasswordlessUserEmailExist;t.doesPasswordlessUserEmailExist=g;var P=c.doesPasswordlessUserPhoneNumberExist;t.doesPasswordlessUserPhoneNumberExist=P;var m=c.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=m;var I=c.getThirdPartyStateAndOtherInfoFromStorage;t.getThirdPartyStateAndOtherInfoFromStorage=I;var w=c.setThirdPartyStateAndOtherInfoToStorage;t.setThirdPartyStateAndOtherInfoToStorage=w;var y=c.generateThirdPartyStateToSendToOAuthProvider;t.generateThirdPartyStateToSendToOAuthProvider=y;var A=c.verifyAndGetThirdPartyStateOrThrowError;t.verifyAndGetThirdPartyStateOrThrowError=A;var b=c.getThirdPartyAuthCodeFromURL;t.getThirdPartyAuthCodeFromURL=b;var S=c.getThirdPartyAuthErrorFromURL;t.getThirdPartyAuthErrorFromURL=S;var _=c.getThirdPartyAuthStateFromURL;t.getThirdPartyAuthStateFromURL=_;var O=c.getPasswordlessLinkCodeFromURL;t.getPasswordlessLinkCodeFromURL=O;var C=c.getPasswordlessPreAuthSessionIdFromURL;t.getPasswordlessPreAuthSessionIdFromURL=C;var R=c.getPasswordlessLoginAttemptInfo;t.getPasswordlessLoginAttemptInfo=R;var x=c.setPasswordlessLoginAttemptInfo;t.setPasswordlessLoginAttemptInfo=x;var T=c.clearPasswordlessLoginAttemptInfo;t.clearPasswordlessLoginAttemptInfo=T;var E=c.signOut;t.signOut=E},8495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(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 r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var s=r(9102),a=r(2856),u=r(3063),c=r(6333),d=r(1187),l=r(8122),f=r(5491),h=r(9817),p=function(e){function t(t,r){var n=e.call(this,(0,u.normaliseUserInput)(t))||this,o=new c.default((0,d.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook})).override(n.config.override.functions).build();return n.recipeImplementation=o,n.thirdPartyRecipe=void 0===r.thirdParty?new s.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,f.default)(o)}}}):r.thirdParty,n.passwordlessRecipe=void 0===r.passwordless?new a.default({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,h.default)(o)}}}):r.passwordless,n}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyPasswordless found. Make sure to call the ThirdPartyPasswordless.init method.";throw e=(0,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r}),{thirdParty:void 0,passwordless:void 0}),t.instance}},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartypasswordless",t}(r(7725).default);t.Recipe=p,t.default=p},1187:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(3664),s=r(8891),a=r(5491),u=r(9817);function c(e){var t=(0,i.default)(e),r=(0,s.default)(e);return{getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLFromBackend.bind((0,a.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signInAndUp.bind((0,a.default)(this))(e)]}))}))},getThirdPartyStateAndOtherInfoFromStorage:function(e){return t.getStateAndOtherInfoFromStorage.bind((0,a.default)(this))(e)},setThirdPartyStateAndOtherInfoToStorage:function(e){return t.setStateAndOtherInfoToStorage.bind((0,a.default)(this))(e)},getThirdPartyAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.getAuthorisationURLWithQueryParamsAndSetState.bind((0,a.default)(this))(e)]}))}))},generateThirdPartyStateToSendToOAuthProvider:function(e){return t.generateStateToSendToOAuthProvider.bind((0,a.default)(this))(e)},verifyAndGetThirdPartyStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.verifyAndGetStateOrThrowError.bind((0,a.default)(this))(e)]}))}))},getThirdPartyAuthCodeFromURL:function(e){return t.getAuthCodeFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthErrorFromURL:function(e){return t.getAuthErrorFromURL.bind((0,a.default)(this))(e)},getThirdPartyAuthStateFromURL:function(e){return t.getAuthStateFromURL.bind((0,a.default)(this))(e)},createPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.createCode.bind((0,u.default)(this))(e)]}))}))},resendPasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.resendCode.bind((0,u.default)(this))(e)]}))}))},consumePasswordlessCode:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.consumeCode.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLinkCodeFromURL:function(e){return r.getLinkCodeFromURL.bind((0,u.default)(this))(e)},getPasswordlessPreAuthSessionIdFromURL:function(e){return r.getPreAuthSessionIdFromURL.bind((0,u.default)(this))(e)},doesPasswordlessUserEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesEmailExist.bind((0,u.default)(this))(e)]}))}))},doesPasswordlessUserPhoneNumberExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.doesPhoneNumberExist.bind((0,u.default)(this))(e)]}))}))},getPasswordlessLoginAttemptInfo:function(e){return r.getLoginAttemptInfo.bind((0,u.default)(this))(e)},setPasswordlessLoginAttemptInfo:function(e){return r.setLoginAttemptInfo.bind((0,u.default)(this))(e)},clearPasswordlessLoginAttemptInfo:function(e){return r.clearLoginAttemptInfo.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},9817:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{clearLoginAttemptInfo:e.clearPasswordlessLoginAttemptInfo.bind(e),consumeCode:e.consumePasswordlessCode.bind(e),createCode:e.createPasswordlessCode.bind(e),doesEmailExist:e.doesPasswordlessUserEmailExist.bind(e),doesPhoneNumberExist:e.doesPasswordlessUserPhoneNumberExist.bind(e),getLoginAttemptInfo:e.getPasswordlessLoginAttemptInfo.bind(e),resendCode:e.resendPasswordlessCode.bind(e),setLoginAttemptInfo:e.setPasswordlessLoginAttemptInfo.bind(e),getLinkCodeFromURL:e.getPasswordlessLinkCodeFromURL.bind(e),getPreAuthSessionIdFromURL:e.getPasswordlessPreAuthSessionIdFromURL.bind(e)}}},5491:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getThirdPartyStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getThirdPartyAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setThirdPartyStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateThirdPartyStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getThirdPartyAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getThirdPartyAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getThirdPartyAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetThirdPartyStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3063:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUserInput=void 0;var o=r(5053);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipe)(e)),{override:t})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),s=r(1260);t.appendQueryParamsToURL=function(e,t){if(void 0===t)return e;try{var r=new URL(e);return Object.entries(t).forEach((function(e){var t=e[0],n=e[1];r.searchParams.set(t,n)})),r.href}catch(r){var n=e.startsWith("/")?"http:localhost":"http://localhost/",o=new URL("".concat(n).concat(e));return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];o.searchParams.set(t,r)})),"".concat(o.pathname).concat(o.search)}},t.normaliseInputAppInfoOrThrowError=function(e){if(void 0===e)throw new Error("Please provide the appInfo object when calling supertokens.init");if(void 0===e.apiDomain)throw new Error("Please provide your apiDomain inside the appInfo object when calling supertokens.init");if(void 0===e.appName)throw new Error("Please provide your appName inside the appInfo object when calling supertokens.init");var t,r,n=new s.default("");return void 0!==e.apiGatewayPath&&(n=new s.default(e.apiGatewayPath)),{appName:e.appName,apiDomain:new i.default(e.apiDomain),apiBasePath:n.appendPath((t=o.DEFAULT_API_BASE_PATH,r=e.apiBasePath,void 0!==r?new s.default(r):new s.default(t)))}},t.isTest=function(){try{return"testing"===process.env.TEST_MODE}catch(e){return!1}},t.getQueryParams=function(e){var t=new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch()).get(e);if(null!==t)return t},t.checkForSSRErrorAndAppendIfNeeded=function(e){return"undefined"==typeof window&&(e+=o.SSR_ERROR),e},t.getNormalisedUserContext=function(e){return void 0===e?{}:e},t.getHashFromLocation=function(){return n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHash().substring(1)}},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.4.1",t.supported_fdi=["1.15"]},7528:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},942:(e,t,r)=>{function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}t.__esModule=!0;let o=r(6398);void 0!==o.default?n(o):n({default:o,...o})},9092:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7860))}},e=>{var t=(4706,e(e.s=4706));supertokensThirdPartyPasswordless=t}]); |
@@ -10,2 +10,8 @@ # Changelog | ||
## [0.4.1] - 2023-01-26 | ||
### Fixed | ||
- Fixed the typings of the `isVerified` validator of the `EmailVerificationClaim` | ||
## [0.4.0] - 2023-01-19 | ||
@@ -15,3 +21,3 @@ | ||
- Re-exporting `cookiHandler`, `windowHandler` and `sessionClaimValidatorStore` from supertokens-website. | ||
- Re-exporting `cookieHandler`, `windowHandler` and `sessionClaimValidatorStore` from supertokens-website. | ||
@@ -18,0 +24,0 @@ ### Breaking Changes |
@@ -12,4 +12,4 @@ import { SessionClaimValidator, BooleanClaim } from "../session"; | ||
validators: BooleanClaim["validators"] & { | ||
isVerified: (refetchTimeOnFalseInSeconds?: number) => SessionClaimValidator; | ||
isVerified: (refetchTimeOnFalseInSeconds?: number, maxAgeInSeconds?: number) => SessionClaimValidator; | ||
}; | ||
} |
@@ -1,2 +0,2 @@ | ||
export declare const package_version = "0.4.0"; | ||
export declare const package_version = "0.4.1"; | ||
export declare const supported_fdi: string[]; |
@@ -18,3 +18,3 @@ "use strict"; | ||
*/ | ||
exports.package_version = "0.4.0"; | ||
exports.package_version = "0.4.1"; | ||
exports.supported_fdi = ["1.15"]; |
{ | ||
"name": "supertokens-web-js", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "SuperTokens SDK for vanilla JS for all recipes", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1005724