Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

supertokens-web-js

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supertokens-web-js - npm Package Compare versions

Comparing version 0.1.6 to 0.2.0

bundle/userroles.js

2

bundle/emailpassword.js

@@ -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)}},6277: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)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(6923),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.emailVerificationRecipe=void 0===n.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):n.emailVerification,r}return o(t,e),t}(n(7725).default);t.default=s},7870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var r=n(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,r.normaliseAuthRecipe)(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)},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}),t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getResetPasswordTokenFromURL=t.doesEmailExist=t.signIn=t.signUp=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var s=n(7939),a=n(8122),u=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.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signIn(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var l=u.submitNewPassword;t.submitNewPassword=l;var f=u.sendPasswordResetEmail;t.sendPasswordResetEmail=f;var p=u.signUp;t.signUp=p;var d=u.signIn;t.signIn=d;var h=u.doesEmailExist;t.doesEmailExist=h;var v=u.verifyEmail;t.verifyEmail=v;var w=u.sendVerificationEmail;t.sendVerificationEmail=w;var I=u.isEmailVerified;t.isEmailVerified=I;var y=u.signOut;t.signOut=y;var P=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=P},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(6277),a=n(5110),u=n(4071),c=n(6333),l=n(8122),f=function(e){function t(t,n){var r=e.call(this,(0,a.normaliseUserInput)(t),n)||this,o=new c.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=o.override(r.config.override.functions).build(),r}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}),{emailVerification:void 0}),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,l.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,l.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(s.default);t.Recipe=f,t.default=f},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(7870);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},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(787),i=n(5120),s=n(6333),a=n(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}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,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120: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{verifyEmail:function(n){var s=n.options,a=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:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:n})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,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 s=n.options,a=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:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,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 s=n.options,a=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:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,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,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},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 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()]}))}))},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.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(9092),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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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(9092),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.2.0",t.supported_fdi=["1.15"]},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],{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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,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,a),n({method:"GET"},t),s,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,a,s){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),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,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(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,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(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,l,f,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"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]:(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(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 a.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,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,r(n(n({},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 r=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,r(n(n({},e),{userContext:s,action:a}))];case 1:return t.sent(),[2]}}))}))}},e}();t.default=c},5857: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.getEmailVerificationTokenFromURL=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.init=void 0;var o=r(6923),i=r(8122),a=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.verifyEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.sendVerificationEmail=function(e){return o.default.getInstanceOrThrow().recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.isEmailVerified=function(e){return o.default.getInstanceOrThrow().recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getEmailVerificationTokenFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getEmailVerificationTokenFromURL(n(n({},e),{userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=a;var s=a.init;t.init=s;var u=a.verifyEmail;t.verifyEmail=u;var c=a.sendVerificationEmail;t.sendVerificationEmail=c;var l=a.isEmailVerified;t.isEmailVerified=l;var f=a.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=f},6923: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.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,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,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},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 n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.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,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(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},6069:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,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 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}}},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(9092),o=r(7611),i=r(7992),a=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 a.default("");return void 0!==e.apiGatewayPath&&(n=new a.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 a.default(r):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(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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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=(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(6376),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 g=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=g;var y=n(1757);Object.defineProperty(t,"SessionClaimValidator",{enumerable:!0,get:function(){return y.SessionClaimValidator}}),Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return y.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return y.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return y.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},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(9092),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.2.0",t.supported_fdi=["1.15"]},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 g=c.getLinkCodeFromURL;t.getLinkCodeFromURL=g;var m=c.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=m;var w=c.getLoginAttemptInfo;t.getLoginAttemptInfo=w;var y=c.setLoginAttemptInfo;t.setLoginAttemptInfo=y;var P=c.clearLoginAttemptInfo;t.clearLoginAttemptInfo=P},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(9092),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,"OK"===a.status?[2,{status:"OK",createdUser:a.createdNewUser,user:a.user,fetchResponse:c}]:[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()]}))}))},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.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(9092),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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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(9092),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(9092),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.2.0",t.supported_fdi=["1.15"]},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 supertokensSession;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[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."},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)}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},1013: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.signOut=t.addAxiosInterceptors=t.doesSessionExist=t.attemptRefreshingSession=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=void 0;var i=n(8122),s=n(6322),a=function(){function e(){}return e.init=function(e){return s.default.init(e)},e.getUserId=function(e){return s.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,s.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,s.default.getInstanceOrThrow().attemptRefreshingSession()]}))}))},e.doesSessionExist=function(e){return s.default.getInstanceOrThrow().doesSessionExist({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.addAxiosInterceptors=function(e,t){return s.default.addAxiosInterceptors(e,(0,i.getNormalisedUserContext)(t))},e.signOut=function(e){return s.default.getInstanceOrThrow().signOut({userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e}();t.default=a;var u=a.init;t.init=u;var c=a.getUserId;t.getUserId=c;var l=a.getAccessTokenPayloadSecurely;t.getAccessTokenPayloadSecurely=l;var f=a.attemptRefreshingSession;t.attemptRefreshingSession=f;var h=a.doesSessionExist;t.doesSessionExist=h;var d=a.addAxiosInterceptors;t.addAxiosInterceptors=d;var p=a.signOut;t.signOut=p},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()]}))}))},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.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(9092),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)}},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=(1013,e(e.s=1013));supertokensSession=t}]);
"use strict";var supertokensSession;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[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."},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)}},1996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){this.config=e}},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 l=s.getUserId;t.getUserId=l;var c=s.getAccessTokenPayloadSecurely;t.getAccessTokenPayloadSecurely=c;var d=s.attemptRefreshingSession;t.attemptRefreshingSession=d;var f=s.doesSessionExist;t.doesSessionExist=f;var h=s.addAxiosInterceptors;t.addAxiosInterceptors=h;var p=s.signOut;t.signOut=p;var v=s.validateClaims;t.validateClaims=v;var m=s.getClaimValue;t.getClaimValue=m;var g=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=g;var w=n(1757);Object.defineProperty(t,"SessionClaimValidator",{enumerable:!0,get:function(){return w.SessionClaimValidator}}),Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return w.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return w.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return w.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),l=n(1757),c=n(8122),d=function(e){function t(t){var n=e.call(this,t)||this;return n.getUserId=function(e){return l.default.getUserId({userContext:e.userContext})},n.getAccessTokenPayloadSecurely=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},n.doesSessionExist=function(e){return l.default.doesSessionExist({userContext:e.userContext})},n.signOut=function(e){return l.default.signOut({userContext:e.userContext})},n.attemptRefreshingSession=function(){return a(n,void 0,void 0,(function(){return s(this,(function(e){return[2,l.default.attemptRefreshingSession()]}))}))},n.validateClaims=function(e){return l.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},l.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 l.default.getClaimValue(e)},t.prototype.getInvalidClaimsFromResponse=function(e){return l.default.getInvalidClaimsFromResponse(e)},t.addAxiosInterceptors=function(e,t){return l.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,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=d,t.default=d},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(9092),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)}},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=(1013,e(e.s=1013));supertokensSession=t}]);

@@ -1,1 +0,1 @@

"use strict";var supertokens;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[842],{280:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(569),t)},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."},569:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var n=r(3146),o=function(){function e(){}return e.init=function(e){n.default.init(e)},e}();t.default=o,t.init=o.init},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)}},3146:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(8122),o=r(2118),i=r(9092),a=function(){function e(e){var t=this;if(this.recipeList=[],this.appInfo=(0,n.normaliseInputAppInfoOrThrowError)(e.appInfo),void 0===e.recipeList||0===e.recipeList.length)throw new Error("Please provide at least one recipe to the supertokens.init function call. See https://supertokens.io/docs/emailpassword/quick-setup/frontend");var r=!1;void 0!==e.enableDebugLogs&&(r=e.enableDebugLogs),this.recipeList=e.recipeList.map((function(e){return e(t.appInfo,r)}))}return e.init=function(t){o.CookieHandlerReference.init(t.cookieHandler),i.WindowHandlerReference.init(t.windowHandler),void 0===e.instance?e.instance=new e(t):console.warn("SuperTokens was already initialized")},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="SuperTokens must be initialized before calling this method.";throw t=(0,n.checkForSSRErrorAndAppendIfNeeded)(t),new Error(t)}return e.instance},e.reset=function(){(0,n.isTest)()?e.instance=void 0:console.warn("Calling reset() is only supported during testing")},e}();t.default=a},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(9092),o=r(7611),i=r(7992),a=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 a.default("");return void 0!==e.apiGatewayPath&&(n=new a.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 a.default(r):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(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)}},2118:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(5209))},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=(280,e(e.s=280));supertokens=t}]);
"use strict";var supertokens;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[842],{280:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(569),t)},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."},569:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var n=r(3146),o=function(){function e(){}return e.init=function(e){n.default.init(e)},e}();t.default=o,t.init=o.init},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)}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var r=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,r=e.postInitCallbacks;t<r.length;t++)(0,r[t])()},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=r},3146:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r(8122),o=r(2118),i=r(9092),a=r(5941),s=function(){function e(e){var t=this;if(this.recipeList=[],this.appInfo=(0,n.normaliseInputAppInfoOrThrowError)(e.appInfo),void 0===e.recipeList||0===e.recipeList.length)throw new Error("Please provide at least one recipe to the supertokens.init function call. See https://supertokens.io/docs/emailpassword/quick-setup/frontend");var r=!1;void 0!==e.enableDebugLogs&&(r=e.enableDebugLogs),this.recipeList=e.recipeList.map((function(e){return e(t.appInfo,r)}))}return e.init=function(t){o.CookieHandlerReference.init(t.cookieHandler),i.WindowHandlerReference.init(t.windowHandler),void 0===e.instance?(e.instance=new e(t),a.PostSuperTokensInitCallbacks.runPostInitCallbacks()):console.warn("SuperTokens was already initialized")},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="SuperTokens must be initialized before calling this method.";throw t=(0,n.checkForSSRErrorAndAppendIfNeeded)(t),new Error(t)}return e.instance},e.reset=function(){(0,n.isTest)()?e.instance=void 0:console.warn("Calling reset() is only supported during testing")},e}();t.default=s},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(9092),o=r(7611),i=r(7992),a=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 a.default("");return void 0!==e.apiGatewayPath&&(n=new a.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 a.default(r):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(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)}},2118:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(5209))},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=(280,e(e.s=280));supertokens=t}]);

@@ -1,1 +0,1 @@

"use strict";var supertokensThirdParty;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[298],{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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,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,a),n({method:"GET"},t),s,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,a,s){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),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,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(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,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(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,p;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.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((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(p=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:p})]);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 a.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,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,r(n(n({},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 r=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,r(n(n({},e),{userContext:s,action:a}))];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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=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 a(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}(s.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)}},6277: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)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923: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.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,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,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},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 n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.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,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(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(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 r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,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 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)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=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 a(r,void 0,void 0,(function(){return s(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 a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(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.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,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="session",t}(u.default);t.Recipe=l,t.default=l},1257: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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.getAuthorisationURLFromBackend=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.signInAndUp=t.getAuthorisationURLWithQueryParamsAndSetState=t.init=void 0;var a=r(8122),s=r(9102),u=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.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLFromBackend=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLFromBackend(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.signInAndUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=f;var l=u.signInAndUp;t.signInAndUp=l;var p=u.verifyEmail;t.verifyEmail=p;var h=u.sendVerificationEmail;t.sendVerificationEmail=h;var d=u.isEmailVerified;t.isEmailVerified=d;var v=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=v;var g=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=g;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var m=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=m;var w=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=w;var I=u.getAuthCodeFromURL;t.getAuthCodeFromURL=I;var P=u.getAuthErrorFromURL;t.getAuthErrorFromURL=P;var A=u.getAuthStateFromURL;t.getAuthStateFromURL=A;var b=u.signOut;t.signOut=b},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 a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}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}),{emailVerification:void 0}),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,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.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,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend: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("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,p,h,d;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=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:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(p=i.sent(),h=p.jsonBody,d=p.fetchResponse,"FIELD_ERROR"===h.status)throw new u.default(h.error);return[2,n(n({},h),{fetchResponse:d})]}}))}))},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,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(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(9092),o=r(7611),i=r(7992),a=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 a.default("");return void 0!==e.apiGatewayPath&&(n=new a.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 a.default(r):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(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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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=(1257,e(e.s=1257));supertokensThirdParty=t}]);
"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{u(n.next(t))}catch(t){i(t)}}function s(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(a,s)}u((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: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(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,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function t(t,e){var r=this;this.get=function(t,e,a,s,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,a),n({method:"GET"},e),s,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,a,s){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,s)];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,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),n({method:"DELETE"},e),a,s)];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,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),n({method:"PUT"},e),a,s)];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,u){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":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]:(h=f.clone(),[4,u({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 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,a=t.action,s=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:a,userContext:u}))];case 1:return o=e.sent(),void 0===s||void 0===s.preAPIHook?[2,o]:[2,s.preAPIHook({url:o.url,requestInit:o.requestInit,userContext:u})]}}))}))}},t.preparePostAPIHook=function(t){var r=t.recipePostAPIHook,a=t.action,s=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:s,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{u(n.next(t))}catch(t){i(t)}}function s(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(a,s)}u((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: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(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,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=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 a(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}(s.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{u(n.next(t))}catch(t){i(t)}}function s(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(a,s)}u((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: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(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,s])}}};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{u(n.next(t))}catch(t){i(t)}}function s(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(a,s)}u((n=n.apply(t,e||[])).next())}))},s=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: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(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,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Recipe=void 0;var u=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 s(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 s(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 s(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}(u.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 s=a.init;e.init=s;var u=a.getAuthorisationURLWithQueryParamsAndSetState;e.getAuthorisationURLWithQueryParamsAndSetState=u;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),s=r(6333),u=r(3664),c=r(8122),l=function(t){function e(e){var r=t.call(this,(0,a.normaliseUserInput)(e))||this,n=new s.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=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{u(n.next(t))}catch(t){i(t)}}function s(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(a,s)}u((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: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(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,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);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,s.appendQueryParamsToURL)(n.url,{state:e}):(0,s.appendQueryParamsToURL)(n.url,{state:e,redirect_uri:t.authorisationURL})]}}))}))},getAuthorisationURLFromBackend: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,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,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,l,f,h,d,p;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,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 u.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,s.getQueryParams)("code");return void 0===t?"":t},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var t=(0,s.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(9092),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.2.0",e.supported_fdi=["1.15"]},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:(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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1260),s=r(255),u=r(2173),c=function(){function e(e,t){var r=this;this.get=function(e,t,a,s,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,a),n({method:"GET"},t),s,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,a,s){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),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.delete=function(e,t,a,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(e),n({method:"DELETE"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.put=function(e,t,a,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(e),n({method:"PUT"},t),a,s)];case 1:return r=o.sent(),[4,this.getResponseJsonOrThrowGeneralError(r)];case 2:return[2,{jsonBody:o.sent(),fetchResponse:r}]}}))}))},this.fetch=function(e,t,a,u){return o(r,void 0,void 0,(function(){var r,o,c,f,l,d;return i(this,(function(i){switch(i.label){case 0:return r=void 0===t?{}:t.headers,[4,this.callPreAPIHook({preAPIHook:a,url:e,requestInit:n(n({},t),{headers:n(n({},r),{"fdi-version":s.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((l=i.sent()).status>=300)throw l;return void 0===u?[3,4]:(d=l.clone(),[4,u({requestInit:c,url:e,fetchResponse:d})]);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 a.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,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,r(n(n({},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 r=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,r(n(n({},e),{userContext:s,action:a}))];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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=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 a(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}(s.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)}},6277: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)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),a=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=a},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},7939: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 a=r(6277),s=r(5110),u=r(4071),c=r(6333),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new c.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}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}),{emailVerification:void 0}),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,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="emailpassword",t}(a.default);t.Recipe=l,t.default=l},4071:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{submitNewPassword:function(r){var a=r.formFields,s=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,t.post("/user/password/reset",{body:JSON.stringify({formFields:a,token:r,method:"token"})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.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 a=r.formFields,s=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,t.post("/user/password/reset/token",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.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 a=r.formFields,s=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,t.post("/signup",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.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 a=r.formFields,s=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,t.post("/signin",{body:JSON.stringify({formFields:a})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.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 a=r.email,s=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,t.get("/signup/email/exists",{},{email:a},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.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 e=(0,a.getQueryParams)("token");return void 0===e?"":e}}}t.default=s,t.getRecipeImplementation=s},5110: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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},6923: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.Recipe=void 0;var o=r(787),i=r(5120),a=r(6333),s=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new a.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,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,s.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,s.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(634),a=r(8122);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:s}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},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 n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var a=r.options,s=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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 r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.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,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(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(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 r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,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 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)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var u=r(1996),c=r(1757),f=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 a(r,void 0,void 0,(function(){return s(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 a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,c.default.attemptRefreshingSession()]}))}))},c.default.init(i(i({},t),{preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r;return s(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.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,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.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 a=r(6277),s=r(4566),u=r(6333),c=r(3664),f=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,s.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}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}),{emailVerification:void 0}),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,f.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(a.default);t.Recipe=l,t.default=l},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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var a=r(634),s=r(8122),u=r(2173),c=r(9092);function f(e){var t=new a.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,s.appendQueryParamsToURL)(n.url,{state:t}):(0,s.appendQueryParamsToURL)(n.url,{state:t,redirect_uri:e.authorisationURL})]}}))}))},getAuthorisationURLFromBackend: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("/authorisationurl",{},{thirdPartyId:r.providerId},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:r.userContext}))];case 1:return n=i.sent(),o=n.jsonBody,s=n.fetchResponse,[2,{status:"OK",url:o.url,fetchResponse:s}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,s,c,f,l,d,p,h;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),s=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:s,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(c=i.sent(),f=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:f,thirdPartyId:c.providerId,redirectURI:c.authorisationURL,clientId:c.providerClientId})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:r.options,userContext:r.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:r.userContext}))];case 2:if(d=i.sent(),p=d.jsonBody,h=d.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(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,s.getQueryParams)("code");return void 0===e?"":e},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=f,t.getRecipeImplementation=f},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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(e)),{override:t})}},4442: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 a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthStateFromURL=t.getAuthErrorFromURL=t.getAuthCodeFromURL=t.verifyAndGetStateOrThrowError=t.generateStateToSendToOAuthProvider=t.setStateAndOtherInfoToStorage=t.getStateAndOtherInfoFromStorage=t.getAuthorisationURLFromBackend=t.getResetPasswordTokenFromURL=t.signOut=t.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=t.getAuthorisationURLWithQueryParamsAndSetState=t.thirdPartySignInAndUp=t.emailPasswordSignIn=t.emailPasswordSignUp=t.doesEmailExist=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=r(8122),s=r(5716),u=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.submitNewPassword=function(e){return s.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return s.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.doesEmailExist=function(e){return s.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignUp=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignIn=function(e){return s.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(n(n({},e),{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.getStateAndOtherInfoFromStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.setStateAndOtherInfoToStorage=function(e){return s.default.getInstanceOrThrow().recipeImplementation.setStateAndOtherInfoToStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.generateStateToSendToOAuthProvider=function(e){return s.default.getInstanceOrThrow().recipeImplementation.generateStateToSendToOAuthProvider(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyAndGetStateOrThrowError=function(e){return s.default.getInstanceOrThrow().recipeImplementation.verifyAndGetStateOrThrowError(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getAuthCodeFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthCodeFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthErrorFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthErrorFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthStateFromURL=function(e){return s.default.getInstanceOrThrow().recipeImplementation.getAuthStateFromURL(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e}();t.default=u;var c=u.init;t.init=c;var f=u.submitNewPassword;t.submitNewPassword=f;var l=u.sendPasswordResetEmail;t.sendPasswordResetEmail=l;var d=u.doesEmailExist;t.doesEmailExist=d;var p=u.emailPasswordSignUp;t.emailPasswordSignUp=p;var h=u.emailPasswordSignIn;t.emailPasswordSignIn=h;var v=u.thirdPartySignInAndUp;t.thirdPartySignInAndUp=v;var g=u.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=g;var m=u.verifyEmail;t.verifyEmail=m;var I=u.sendVerificationEmail;t.sendVerificationEmail=I;var P=u.isEmailVerified;t.isEmailVerified=P;var w=u.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=w;var y=u.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=y;var A=u.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=A;var b=u.setStateAndOtherInfoToStorage;t.setStateAndOtherInfoToStorage=b;var R=u.generateStateToSendToOAuthProvider;t.generateStateToSendToOAuthProvider=R;var _=u.verifyAndGetStateOrThrowError;t.verifyAndGetStateOrThrowError=_;var S=u.getAuthCodeFromURL;t.getAuthCodeFromURL=S;var O=u.getAuthErrorFromURL;t.getAuthErrorFromURL=O;var E=u.getAuthStateFromURL;t.getAuthStateFromURL=E;var x=u.signOut;t.signOut=x},5716: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 a=r(6277),s=r(7939),u=r(9102),c=r(3834),f=r(6333),l=r(1473),d=r(5367),p=r(5092),h=r(8122),v=function(e){function t(t,r){var n,o,i=e.call(this,(0,c.normaliseUserInput)(t),r)||this,a=new f.default((0,l.default)({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:i.config.preAPIHook,postAPIHook:i.config.postAPIHook})).override(i.config.override.functions).build();return i.recipeImplementation=a,i.emailPasswordRecipe=void 0===r.emailPassword?new s.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,d.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.emailPassword,i.thirdPartyRecipe=void 0===r.thirdParty?new u.default({recipeId:i.config.recipeId,appInfo:i.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(o=t.override)||void 0===o?void 0:o.emailVerification,functions:function(){return(0,p.default)(a)}}},{emailVerification:i.emailVerificationRecipe}):r.thirdParty,i}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyEmailPassword found. Make sure to call the ThirdPartyEmailPassword.init method.";throw e=(0,h.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}),{emailVerification:void 0,emailPassword:void 0,thirdParty:void 0}),t.instance}},t.reset=function(){(0,h.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartyemailpassword",t}(a.default);t.Recipe=v,t.default=v},5367:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{doesEmailExist:e.doesEmailExist.bind(e),sendPasswordResetEmail:e.sendPasswordResetEmail.bind(e),submitNewPassword:e.submitNewPassword.bind(e),getResetPasswordTokenFromURL:e.getResetPasswordTokenFromURL.bind(e),signIn:e.emailPasswordSignIn.bind(e),signUp:e.emailPasswordSignUp.bind(e)}}},1473:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(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(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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: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(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=t.call(e,a)}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,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRecipeImplementation=void 0;var i=r(4071),a=r(3664),s=r(5367),u=r(5092);function c(e){var t=(0,i.default)(e),r=(0,a.default)(e);return{submitNewPassword:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.submitNewPassword.bind((0,s.default)(this))(e)]}))}))},sendPasswordResetEmail:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.sendPasswordResetEmail.bind((0,s.default)(this))(e)]}))}))},doesEmailExist:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.doesEmailExist.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signUp.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignIn:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(r){return[2,t.signIn.bind((0,s.default)(this))(e)]}))}))},getResetPasswordTokenFromURL:function(e){return t.getResetPasswordTokenFromURL.bind((0,s.default)(this))(e)},getAuthorisationURLFromBackend:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLFromBackend.bind((0,u.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.signInAndUp.bind((0,u.default)(this))(e)]}))}))},getStateAndOtherInfoFromStorage:function(e){return r.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(e)},setStateAndOtherInfoToStorage:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(e)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(e)]}))}))},generateStateToSendToOAuthProvider:function(e){return r.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(e)},verifyAndGetStateOrThrowError:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,r.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(e)]}))}))},getAuthCodeFromURL:function(e){return r.getAuthCodeFromURL.bind((0,u.default)(this))(e)},getAuthErrorFromURL:function(e){return r.getAuthErrorFromURL.bind((0,u.default)(this))(e)},getAuthStateFromURL:function(e){return r.getAuthStateFromURL.bind((0,u.default)(this))(e)}}}t.default=c,t.getRecipeImplementation=c},5092:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{getAuthorisationURLFromBackend:e.getAuthorisationURLFromBackend.bind(e),getStateAndOtherInfoFromStorage:e.getStateAndOtherInfoFromStorage.bind(e),getAuthorisationURLWithQueryParamsAndSetState:e.getAuthorisationURLWithQueryParamsAndSetState.bind(e),setStateAndOtherInfoToStorage:e.setStateAndOtherInfoToStorage.bind(e),generateStateToSendToOAuthProvider:e.generateStateToSendToOAuthProvider.bind(e),getAuthCodeFromURL:e.getAuthCodeFromURL.bind(e),getAuthErrorFromURL:e.getAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3834: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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(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(9092),o=r(7611),i=r(7992),a=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 a.default("");return void 0!==e.apiGatewayPath&&(n=new a.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 a.default(r):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(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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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=(4442,e(e.s=4442));supertokensThirdPartyEmailPassword=t}]);
"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(9092);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(9092),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.2.0",e.supported_fdi=["1.15"]},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)}},6277: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)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(6923),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.emailVerificationRecipe=void 0===r.emailVerification?new i.default({appInfo:t.appInfo,recipeId:t.recipeId,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:void 0===t.override?void 0:t.override.emailVerification}):r.emailVerification,n}return o(t,e),t}(r(7725).default);t.default=s},7870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseAuthRecipeWithEmailVerificationConfig=void 0;var n=r(5053);t.normaliseAuthRecipeWithEmailVerificationConfig=function(e){return(0,n.normaliseAuthRecipe)(e)}},6923: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.Recipe=void 0;var o=r(787),i=r(5120),s=r(6333),a=r(8122),u=function(){function e(e){this.config=(0,o.normaliseUserInput)(e);var t=new s.default((0,i.default)({recipeId:this.config.recipeId,appInfo:this.config.appInfo,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=t.override(this.config.override.functions).build()}return e.init=function(t){return function(r){return e.instance=new e(n(n({},t),{appInfo:r,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,a.checkForSSRErrorAndAppendIfNeeded)(t),Error(t)}return e.instance},e.reset=function(){(0,a.isTest)()&&(e.instance=void 0)},e.RECIPE_ID="emailverification",e}();t.Recipe=u,t.default=u},5120: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(634),s=r(8122);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{verifyEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,u,c;return o(this,(function(o){switch(o.label){case 0:return r=this.getEmailVerificationTokenFromURL({userContext:a}),[4,t.post("/user/email/verify",{body:JSON.stringify({method:"token",token:r})},i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_EMAIL",options:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"VERIFY_EMAIL"}))];case 1:return n=o.sent(),u=n.jsonBody,c=n.fetchResponse,[2,{status:u.status,fetchResponse:c}]}}))}))},isEmailVerified:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"IS_EMAIL_VERIFIED"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:"OK",isVerified:n.isVerified,fetchResponse:u}]}}))}))},sendVerificationEmail:function(r){var s=r.options,a=r.userContext;return n(this,void 0,void 0,(function(){var r,n,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:s,userContext:a}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:a,action:"SEND_VERIFY_EMAIL"}))];case 1:return r=o.sent(),n=r.jsonBody,u=r.fetchResponse,[2,{status:n.status,fetchResponse:u}]}}))}))},getEmailVerificationTokenFromURL:function(){var e=(0,s.getQueryParams)("token");return void 0===e?"":e}}}t.default=a,t.getRecipeImplementation=a},787: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(6069);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseRecipeModuleConfig)(e)),{override:t})}},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(9092),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,"OK"===u.status?[2,{status:"OK",createdUser:u.createdNewUser,user:u.user,fetchResponse:c}]:[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()]}))}))},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.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(6277),a=r(4566),u=r(6333),c=r(3664),d=r(8122),l=function(e){function t(t,r){var n=e.call(this,(0,a.normaliseUserInput)(t),r)||this,o=new u.default((0,c.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,preAPIHook:n.config.preAPIHook,postAPIHook:n.config.postAPIHook}));return n.recipeImplementation=o.override(n.config.override.functions).build(),n}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}),{emailVerification:void 0}),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,d.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,d.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdparty",t}(s.default);t.Recipe=l,t.default=l},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(9092);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,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(),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(),p=f.jsonBody,h=f.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(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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(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.isEmailVerified=t.sendVerificationEmail=t.verifyEmail=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.verifyEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.sendVerificationEmail=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.sendVerificationEmail(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))]}))}))},e.isEmailVerified=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,s.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(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 p=c.verifyEmail;t.verifyEmail=p;var h=c.sendVerificationEmail;t.sendVerificationEmail=h;var v=c.isEmailVerified;t.isEmailVerified=v;var P=c.createPasswordlessCode;t.createPasswordlessCode=P;var g=c.resendPasswordlessCode;t.resendPasswordlessCode=g;var I=c.consumePasswordlessCode;t.consumePasswordlessCode=I;var m=c.doesPasswordlessUserEmailExist;t.doesPasswordlessUserEmailExist=m;var y=c.doesPasswordlessUserPhoneNumberExist;t.doesPasswordlessUserPhoneNumberExist=y;var w=c.getAuthorisationURLFromBackend;t.getAuthorisationURLFromBackend=w;var A=c.getThirdPartyStateAndOtherInfoFromStorage;t.getThirdPartyStateAndOtherInfoFromStorage=A;var b=c.setThirdPartyStateAndOtherInfoToStorage;t.setThirdPartyStateAndOtherInfoToStorage=b;var S=c.generateThirdPartyStateToSendToOAuthProvider;t.generateThirdPartyStateToSendToOAuthProvider=S;var _=c.verifyAndGetThirdPartyStateOrThrowError;t.verifyAndGetThirdPartyStateOrThrowError=_;var O=c.getThirdPartyAuthCodeFromURL;t.getThirdPartyAuthCodeFromURL=O;var R=c.getThirdPartyAuthErrorFromURL;t.getThirdPartyAuthErrorFromURL=R;var C=c.getThirdPartyAuthStateFromURL;t.getThirdPartyAuthStateFromURL=C;var x=c.getPasswordlessLinkCodeFromURL;t.getPasswordlessLinkCodeFromURL=x;var E=c.getPasswordlessPreAuthSessionIdFromURL;t.getPasswordlessPreAuthSessionIdFromURL=E;var T=c.getPasswordlessLoginAttemptInfo;t.getPasswordlessLoginAttemptInfo=T;var k=c.setPasswordlessLoginAttemptInfo;t.setPasswordlessLoginAttemptInfo=k;var U=c.clearPasswordlessLoginAttemptInfo;t.clearPasswordlessLoginAttemptInfo=U;var L=c.signOut;t.signOut=L},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(6277),a=r(9102),u=r(2856),c=r(3063),d=r(6333),l=r(1187),f=r(8122),p=r(5491),h=r(9817),v=function(e){function t(t,r){var n,o=e.call(this,(0,c.normaliseUserInput)(t),r)||this,i=new d.default((0,l.default)({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:o.config.preAPIHook,postAPIHook:o.config.postAPIHook})).override(o.config.override.functions).build();return o.recipeImplementation=i,o.thirdPartyRecipe=void 0===r.thirdParty?new a.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{emailVerification:null===(n=t.override)||void 0===n?void 0:n.emailVerification,functions:function(){return(0,p.default)(i)}}},{emailVerification:o.emailVerificationRecipe}):r.thirdParty,o.passwordlessRecipe=void 0===r.passwordless?new u.default({recipeId:o.config.recipeId,appInfo:o.config.appInfo,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,h.default)(i)}}}):r.passwordless,o}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,f.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}),{emailVerification:void 0,thirdParty:void 0,passwordless:void 0}),t.instance}},t.reset=function(){(0,f.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartypasswordless",t}(s.default);t.Recipe=v,t.default=v},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(7870);t.normaliseUserInput=function(e){var t=n({functions:function(e){return e}},e.override);return n(n({},(0,o.normaliseAuthRecipeWithEmailVerificationConfig)(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(9092),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.1.6",t.supported_fdi=["1.8","1.9","1.10","1.11","1.12","1.13","1.14"]},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(9092),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(9092);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(9092),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.2.0",t.supported_fdi=["1.15"]},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,72 @@ # Changelog

## [0.2.0] - 2022-09-14
### Added
- Session claims related types/classes and the `validateClaims` & `getClaimValue` functions
- Added `getInvalidClaimsFromResponse` to the SessionClass to help parsing responses with invalid claim errors
- Added `API_INVALID_CLAIM` event to the Session recipe
- Added `UserRoleClaim` and `PermissionClaim`
### Breaking changes
- Only supporting FDI 1.15
- Backend SDKs have to be updated first to a version that supports session claims before enabling EmailVerification!
- supertokens-node: >= 12.0
- supertokens-golang: >= 0.9
- supertokens-python >= 0.11
- EmailVerification recipe is now not initialized as part of auth recipes. You can add it to the recipe list as `EmailVerification.init` like other recipes.
- Removed `verifyEmail`, `sendVerificationEmail` and `isEmailVerified` from auth recipes. These should now be called on the `EmailVerification` recipe
- Moved email verification related events, overrides, pre-api hooks and redirection contexts into the `EmailVerification` recipe. You should configure them while initializing the `EmailVerification` recipe.
- Fix typing of `consumeCode` in the passwordless recipe
### Migration
#### EmailVerification recipe init
```ts
SuperTokens.init({
// Normal init conf...
recipeList: [
EmailPassword.init({
preAPIHook: (context) => {
// Move email verification related pre-API hooks into the preAPIHook of the EmailVerification config
},
postAPIHook: (context) => {
// Move email verification related post-API hooks into the postAPIHook of the EmailVerification config
}
override: {
emailVerificationFeature: {
// These overrides should be moved into the config of the EmailVerification recipe
}
}
}),
]
})
```
Should become:
```ts
SuperTokens.init({
// Normal init conf...
recipeList: [
EmailVerification.init({
// Props from emailVerificationFeature of the EmailPassword.init config should be moved here.
override: {
// The overrides from emailVerificationFeature in the overrides of the EmailPassword config should be moved here
},
preAPIHook: (context) => {
// Move email verification related pre-API hooks here
},
postAPIHook: (context) => {
// Move email verification related post-API hooks here
},
}),
EmailPassword.init({}),
],
});
```
## [0.1.6] - 2022-08-23

@@ -12,0 +82,0 @@

@@ -7,8 +7,12 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, {
enumerable: true,
get: function () {
return m[k];
},
});
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true,
get: function () {
return m[k];
},
};
}
Object.defineProperty(o, k2, desc);
}

@@ -15,0 +19,0 @@ : function (o, m, k, k2) {

@@ -26,5 +26,5 @@ import { NormalisedAppInfo } from "./types";

config: RequestInit,
queryParams?: Record<string, string> | undefined,
preAPIHook?: PreAPIHookFunction | undefined,
postAPIHook?: PostAPIHookFunction | undefined
queryParams?: Record<string, string>,
preAPIHook?: PreAPIHookFunction,
postAPIHook?: PostAPIHookFunction
) => Promise<{

@@ -37,4 +37,4 @@ jsonBody: JsonBodyType;

config: RequestInit,
preAPIHook?: PreAPIHookFunction | undefined,
postAPIHook?: PostAPIHookFunction | undefined
preAPIHook?: PreAPIHookFunction,
postAPIHook?: PostAPIHookFunction
) => Promise<{

@@ -47,4 +47,4 @@ jsonBody: JsonBodyType;

config: RequestInit,
preAPIHook?: PreAPIHookFunction | undefined,
postAPIHook?: PostAPIHookFunction | undefined
preAPIHook?: PreAPIHookFunction,
postAPIHook?: PostAPIHookFunction
) => Promise<{

@@ -57,4 +57,4 @@ jsonBody: JsonBodyType;

config: RequestInit,
preAPIHook?: PreAPIHookFunction | undefined,
postAPIHook?: PostAPIHookFunction | undefined
preAPIHook?: PreAPIHookFunction,
postAPIHook?: PostAPIHookFunction
) => Promise<{

@@ -67,4 +67,4 @@ jsonBody: JsonBodyType;

config: RequestInit,
preAPIHook?: PreAPIHookFunction | undefined,
postAPIHook?: PostAPIHookFunction | undefined
preAPIHook?: PreAPIHookFunction,
postAPIHook?: PostAPIHookFunction
) => Promise<Response>;

@@ -75,3 +75,3 @@ callPreAPIHook: (context: { preAPIHook?: PreAPIHookFunction; requestInit: RequestInit; url: string }) => Promise<{

}>;
getFullUrl: (pathStr: string, queryParams?: Record<string, string> | undefined) => string;
getFullUrl: (pathStr: string, queryParams?: Record<string, string>) => string;
getResponseJsonOrThrowGeneralError: (response: Response) => Promise<any>;

@@ -78,0 +78,0 @@ static preparePreAPIHook: <Action>({

import { RecipeInterface, PreAPIHookContext, PostAPIHookContext, UserInput } from "./types";
import { RecipeFunctionOptions } from "../recipeModule/types";
import { UserType } from "../authRecipeWithEmailVerification/types";
import { UserType } from "./types";
export default class RecipeWrapper {

@@ -189,50 +189,2 @@ static init(

static getResetPasswordTokenFromURL(input?: { userContext?: any }): string;
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
fetchResponse: Response;
}>;
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK";
fetchResponse: Response;
}>;
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK";
isVerified: boolean;
fetchResponse: Response;
}>;
}

@@ -245,5 +197,2 @@ declare const init: typeof RecipeWrapper.init;

declare const doesEmailExist: typeof RecipeWrapper.doesEmailExist;
declare const verifyEmail: typeof RecipeWrapper.verifyEmail;
declare const sendVerificationEmail: typeof RecipeWrapper.sendVerificationEmail;
declare const isEmailVerified: typeof RecipeWrapper.isEmailVerified;
declare const signOut: typeof RecipeWrapper.signOut;

@@ -259,5 +208,2 @@ declare const getResetPasswordTokenFromURL: typeof RecipeWrapper.getResetPasswordTokenFromURL;

getResetPasswordTokenFromURL,
verifyEmail,
sendVerificationEmail,
isEmailVerified,
signOut,

@@ -264,0 +210,0 @@ UserType,

@@ -16,138 +16,4 @@ "use strict";

};
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: [],
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === "function" &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_)
try {
if (
((f = 1),
y &&
(t =
op[0] & 2
? y["return"]
: op[0]
? y["throw"] || ((t = y["return"]) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
(op[0] === 6 || op[0] === 2)
) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.signOut =
exports.isEmailVerified =
exports.sendVerificationEmail =
exports.verifyEmail =
exports.getResetPasswordTokenFromURL =

@@ -303,87 +169,2 @@ exports.doesEmailExist =

};
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.verifyEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.sendVerificationEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default
.getInstanceOrThrow()
.emailVerificationRecipe.recipeImplementation.sendVerificationEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/emailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.isEmailVerified = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
return RecipeWrapper;

@@ -404,8 +185,2 @@ })();

exports.doesEmailExist = doesEmailExist;
var verifyEmail = RecipeWrapper.verifyEmail;
exports.verifyEmail = verifyEmail;
var sendVerificationEmail = RecipeWrapper.sendVerificationEmail;
exports.sendVerificationEmail = sendVerificationEmail;
var isEmailVerified = RecipeWrapper.isEmailVerified;
exports.isEmailVerified = isEmailVerified;
var signOut = RecipeWrapper.signOut;

@@ -412,0 +187,0 @@ exports.signOut = signOut;

@@ -1,15 +0,9 @@

import AuthRecipeWithEmailVerification from "../authRecipeWithEmailVerification";
import { InputType, NormalisedInputType, PreAndPostAPIHookAction, RecipeInterface, UserInput } from "./types";
import EmailVerificationRecipe from "../emailverification/recipe";
import { CreateRecipeFunction } from "../../types";
export default class Recipe extends AuthRecipeWithEmailVerification<PreAndPostAPIHookAction, NormalisedInputType> {
import AuthRecipe from "../authRecipe";
export default class Recipe extends AuthRecipe<PreAndPostAPIHookAction, NormalisedInputType> {
static instance?: Recipe;
static RECIPE_ID: string;
recipeImplementation: RecipeInterface;
constructor(
config: InputType,
recipes: {
emailVerification: EmailVerificationRecipe | undefined;
}
);
constructor(config: InputType);
static init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>;

@@ -16,0 +10,0 @@ static getInstanceOrThrow(): Recipe;

@@ -57,3 +57,2 @@ "use strict";

exports.Recipe = void 0;
var authRecipeWithEmailVerification_1 = require("../authRecipeWithEmailVerification");
var utils_1 = require("./utils");

@@ -63,6 +62,7 @@ var recipeImplementation_1 = require("./recipeImplementation");

var utils_2 = require("../../utils");
var authRecipe_1 = require("../authRecipe");
var Recipe = /** @class */ (function (_super) {
__extends(Recipe, _super);
function Recipe(config, recipes) {
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config), recipes) || this;
function Recipe(config) {
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config)) || this;
var builder = new supertokens_js_override_1.default(

@@ -82,6 +82,3 @@ (0, recipeImplementation_1.default)({

Recipe.instance = new Recipe(
__assign(__assign({}, config), { recipeId: Recipe.RECIPE_ID, appInfo: appInfo }),
{
emailVerification: undefined,
}
__assign(__assign({}, config), { recipeId: Recipe.RECIPE_ID, appInfo: appInfo })
);

@@ -108,4 +105,4 @@ return Recipe.instance;

return Recipe;
})(authRecipeWithEmailVerification_1.default);
})(authRecipe_1.default);
exports.Recipe = Recipe;
exports.default = Recipe;

@@ -11,8 +11,9 @@ import {

InputType as AuthRecipeInputType,
UserType,
PreAndPostAPIHookAction as AuthRecipePreAndPostAPIHookAction,
} from "../authRecipeWithEmailVerification/types";
import { InputTypeOverride as EmailVerificationOverride } from "../emailverification/types";
} from "../authRecipe/types";
export declare type UserType = {
id: string;
email: string;
timeJoined: number;
};
export declare type PreAndPostAPIHookAction =
| AuthRecipePreAndPostAPIHookAction
| "EMAIL_PASSWORD_SIGN_UP"

@@ -30,3 +31,2 @@ | "EMAIL_PASSWORD_SIGN_IN"

override?: {
emailVerification?: EmailVerificationOverride;
functions?: (

@@ -33,0 +33,0 @@ originalImplementation: RecipeInterface,

@@ -32,3 +32,3 @@ "use strict";

exports.normaliseUserInput = void 0;
var utils_1 = require("../authRecipeWithEmailVerification/utils");
var utils_1 = require("../authRecipe/utils");
function normaliseUserInput(config) {

@@ -43,6 +43,4 @@ var override = __assign(

);
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipeWithEmailVerificationConfig)(config)), {
override: override,
});
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipe)(config)), { override: override });
}
exports.normaliseUserInput = normaliseUserInput;
import { RecipeInterface, PreAPIHookContext, PostAPIHookContext, UserInput } from "./types";
import { RecipeFunctionOptions } from "../recipeModule/types";
import { EmailVerificationClaimClass } from "./emailVerificationClaim";
export default class RecipeWrapper {
static EmailVerificationClaim: EmailVerificationClaimClass;
static init(

@@ -62,2 +64,3 @@ config?: UserInput

declare const getEmailVerificationTokenFromURL: typeof RecipeWrapper.getEmailVerificationTokenFromURL;
declare const EmailVerificationClaim: EmailVerificationClaimClass;
export {

@@ -69,2 +72,3 @@ init,

getEmailVerificationTokenFromURL,
EmailVerificationClaim,
UserInput,

@@ -75,2 +79,3 @@ RecipeInterface,

PostAPIHookContext,
EmailVerificationClaimClass,
};

@@ -17,3 +17,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getEmailVerificationTokenFromURL =
exports.EmailVerificationClaimClass =
exports.EmailVerificationClaim =
exports.getEmailVerificationTokenFromURL =
exports.isEmailVerified =

@@ -26,2 +28,9 @@ exports.sendVerificationEmail =

var utils_1 = require("../../utils");
var emailVerificationClaim_1 = require("./emailVerificationClaim");
Object.defineProperty(exports, "EmailVerificationClaimClass", {
enumerable: true,
get: function () {
return emailVerificationClaim_1.EmailVerificationClaimClass;
},
});
var RecipeWrapper = /** @class */ (function () {

@@ -103,2 +112,3 @@ function RecipeWrapper() {}

};
RecipeWrapper.EmailVerificationClaim = recipe_1.default.EmailVerificationClaim;
return RecipeWrapper;

@@ -117,1 +127,3 @@ })();

exports.getEmailVerificationTokenFromURL = getEmailVerificationTokenFromURL;
var EmailVerificationClaim = RecipeWrapper.EmailVerificationClaim;
exports.EmailVerificationClaim = EmailVerificationClaim;

@@ -5,5 +5,7 @@ import { CreateRecipeFunction } from "../../types";

import { UserInput } from "./types";
import { EmailVerificationClaimClass } from "./emailVerificationClaim";
export default class Recipe implements RecipeModule<PreAndPostAPIHookAction, NormalisedInputType> {
static instance?: Recipe;
static RECIPE_ID: string;
static EmailVerificationClaim: EmailVerificationClaimClass;
config: NormalisedInputType;

@@ -10,0 +12,0 @@ recipeImplementation: RecipeInterface;

@@ -32,2 +32,3 @@ "use strict";

exports.Recipe = void 0;
var sessionClaimValidatorStore_1 = require("supertokens-website/utils/sessionClaimValidatorStore");
var utils_1 = require("./utils");

@@ -37,2 +38,4 @@ var recipeImplementation_1 = require("./recipeImplementation");

var utils_2 = require("../../utils");
var emailVerificationClaim_1 = require("./emailVerificationClaim");
var postSuperTokensInitCallbacks_1 = require("../../postSuperTokensInitCallbacks");
var Recipe = /** @class */ (function () {

@@ -50,2 +53,7 @@ function Recipe(config) {

this.recipeImplementation = builder.override(this.config.override.functions).build();
postSuperTokensInitCallbacks_1.PostSuperTokensInitCallbacks.addPostInitCallback(function () {
sessionClaimValidatorStore_1.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(
Recipe.EmailVerificationClaim.validators.isVerified(10)
);
});
}

@@ -76,2 +84,5 @@ Recipe.init = function (config) {

Recipe.RECIPE_ID = "emailverification";
Recipe.EmailVerificationClaim = new emailVerificationClaim_1.EmailVerificationClaimClass(function () {
return Recipe.getInstanceOrThrow().recipeImplementation;
});
return Recipe;

@@ -78,0 +89,0 @@ })();

@@ -83,3 +83,3 @@ import { RecipeFunctionOptions } from "../recipeModule/types";

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -108,3 +108,3 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

status: "OK";
createdUser: boolean;
createdNewUser: boolean;
user: PasswordlessUser;

@@ -111,0 +111,0 @@ fetchResponse: Response;

@@ -258,3 +258,3 @@ "use strict";

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -261,0 +261,0 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

@@ -290,17 +290,2 @@ "use strict";

(_a = _b.sent()), (jsonBody = _a.jsonBody), (fetchResponse = _a.fetchResponse);
/**
* Originally this function was incorrectly consuming the FDI spec,
* this change is done this way to avoid needing a breaking change to fix this
*/
if (jsonBody.status === "OK") {
return [
2 /*return*/,
{
status: "OK",
createdUser: jsonBody.createdNewUser,
user: jsonBody.user,
fetchResponse: fetchResponse,
},
];
}
return [2 /*return*/, __assign(__assign({}, jsonBody), { fetchResponse: fetchResponse })];

@@ -307,0 +292,0 @@ }

@@ -121,3 +121,3 @@ import {

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -150,3 +150,3 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

status: "OK";
createdUser: boolean;
createdNewUser: boolean;
user: PasswordlessUser;

@@ -153,0 +153,0 @@ fetchResponse: Response;

@@ -53,3 +53,3 @@ import { RecipeFunctionOptions } from "../recipeModule/types";

status: "OK";
createdUser: boolean;
createdNewUser: boolean;
user: PasswordlessUser;

@@ -56,0 +56,0 @@ fetchResponse: Response;

import { UserInput } from "./types";
import { RecipeInterface } from "supertokens-website";
import { RecipeInterface, ClaimValidationError, SessionClaimValidator, SessionClaim } from "supertokens-website";
export default class RecipeWrapper {

@@ -11,2 +11,18 @@ static init(config?: UserInput): import("../../types").CreateRecipeFunction<unknown>;

static signOut(input?: { userContext?: any }): Promise<void>;
static getClaimValue<T>(input: { claim: SessionClaim<T>; userContext?: any }): Promise<T | undefined>;
static validateClaims(input?: {
overrideGlobalClaimValidators?: (
globalClaimValidators: SessionClaimValidator[],
userContext: any
) => SessionClaimValidator[];
userContext?: any;
}): Promise<ClaimValidationError[]> | ClaimValidationError[];
static getInvalidClaimsFromResponse(input: {
response:
| {
data: any;
}
| Response;
userContext?: any;
}): Promise<ClaimValidationError[]>;
}

@@ -20,3 +36,15 @@ declare const init: typeof RecipeWrapper.init;

declare const signOut: typeof RecipeWrapper.signOut;
declare const validateClaims: typeof RecipeWrapper.validateClaims;
declare const getClaimValue: typeof RecipeWrapper.getClaimValue;
declare const getInvalidClaimsFromResponse: typeof RecipeWrapper.getInvalidClaimsFromResponse;
export {
ClaimValidationError,
ClaimValidationResult,
SessionClaimValidator,
SessionClaim,
PrimitiveClaim,
PrimitiveArrayClaim,
BooleanClaim,
} from "supertokens-website";
export {
init,

@@ -29,4 +57,7 @@ getUserId,

signOut,
validateClaims,
getClaimValue,
getInvalidClaimsFromResponse,
RecipeInterface,
UserInput,
};

@@ -134,3 +134,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.signOut =
exports.getInvalidClaimsFromResponse =
exports.getClaimValue =
exports.validateClaims =
exports.signOut =
exports.addAxiosInterceptors =

@@ -142,2 +145,6 @@ exports.doesSessionExist =

exports.init =
exports.BooleanClaim =
exports.PrimitiveArrayClaim =
exports.PrimitiveClaim =
exports.SessionClaimValidator =
void 0;

@@ -211,2 +218,28 @@ /* Copyright (c) 2022, VRAI Labs and/or its affiliates. All rights reserved.

};
RecipeWrapper.getClaimValue = function (input) {
return recipe_1.default.getInstanceOrThrow().getClaimValue({
claim: input.claim,
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
});
};
RecipeWrapper.validateClaims = function (input) {
return recipe_1.default.getInstanceOrThrow().validateClaims({
overrideGlobalClaimValidators:
input === null || input === void 0 ? void 0 : input.overrideGlobalClaimValidators,
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
});
};
// The strange typing is to avoid adding a dependency to axios
RecipeWrapper.getInvalidClaimsFromResponse = function (input) {
return recipe_1.default.getInstanceOrThrow().getInvalidClaimsFromResponse({
response: input.response,
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
});
};
return RecipeWrapper;

@@ -229,1 +262,32 @@ })();

exports.signOut = signOut;
var validateClaims = RecipeWrapper.validateClaims;
exports.validateClaims = validateClaims;
var getClaimValue = RecipeWrapper.getClaimValue;
exports.getClaimValue = getClaimValue;
var getInvalidClaimsFromResponse = RecipeWrapper.getInvalidClaimsFromResponse;
exports.getInvalidClaimsFromResponse = getInvalidClaimsFromResponse;
var supertokens_website_1 = require("supertokens-website");
Object.defineProperty(exports, "SessionClaimValidator", {
enumerable: true,
get: function () {
return supertokens_website_1.SessionClaimValidator;
},
});
Object.defineProperty(exports, "PrimitiveClaim", {
enumerable: true,
get: function () {
return supertokens_website_1.PrimitiveClaim;
},
});
Object.defineProperty(exports, "PrimitiveArrayClaim", {
enumerable: true,
get: function () {
return supertokens_website_1.PrimitiveArrayClaim;
},
});
Object.defineProperty(exports, "BooleanClaim", {
enumerable: true,
get: function () {
return supertokens_website_1.BooleanClaim;
},
});
import RecipeModule from "../recipeModule";
import { ClaimValidationError, SessionClaimValidator, SessionClaim } from "supertokens-website";
import { InputType, UserInput } from "./types";

@@ -14,2 +15,17 @@ import { CreateRecipeFunction } from "../../types";

attemptRefreshingSession: () => Promise<boolean>;
getClaimValue<T>(input: { claim: SessionClaim<T>; userContext: any }): Promise<T | undefined>;
validateClaims: (input: {
overrideGlobalClaimValidators?:
| ((globalClaimValidators: SessionClaimValidator[], userContext: any) => SessionClaimValidator[])
| undefined;
userContext: any;
}) => Promise<ClaimValidationError[]> | ClaimValidationError[];
getInvalidClaimsFromResponse(input: {
response:
| {
data: any;
}
| Response;
userContext: any;
}): Promise<ClaimValidationError[]>;
static addAxiosInterceptors(axiosInstance: any, userContext: any): void;

@@ -16,0 +32,0 @@ static getInstanceOrThrow(): Recipe;

@@ -229,2 +229,5 @@ "use strict";

};
_this.validateClaims = function (input) {
return supertokens_website_1.default.validateClaims(input.overrideGlobalClaimValidators, input.userContext);
};
supertokens_website_1.default.init(

@@ -270,2 +273,9 @@ __assign(__assign({}, config), {

};
Recipe.prototype.getClaimValue = function (input) {
return supertokens_website_1.default.getClaimValue(input);
};
// The strange typing is to avoid adding a dependency to axios
Recipe.prototype.getInvalidClaimsFromResponse = function (input) {
return supertokens_website_1.default.getInvalidClaimsFromResponse(input);
};
Recipe.addAxiosInterceptors = function (axiosInstance, userContext) {

@@ -272,0 +282,0 @@ return supertokens_website_1.default.addAxiosInterceptors(axiosInstance, userContext);

@@ -1,2 +0,6 @@

import { RecipeInterface as STWebsiteRecipeInterface, InputType as WebsiteInputType } from "supertokens-website";
import {
RecipeInterface as STWebsiteRecipeInterface,
InputType as WebsiteInputType,
ClaimValidationError,
} from "supertokens-website";
import { NormalisedAppInfo } from "../../types";

@@ -9,2 +13,7 @@ export declare type RecipeEvent =

| {
action: "API_INVALID_CLAIM";
claimValidationErrors: ClaimValidationError[];
userContext: any;
}
| {
action: "UNAUTHORISED";

@@ -11,0 +20,0 @@ sessionExpiredOrRevoked: boolean;

@@ -152,50 +152,2 @@ import { RecipeFunctionOptions } from "../emailpassword";

static getAuthStateFromURL(input?: { userContext?: any }): string;
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
fetchResponse: Response;
}>;
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK";
fetchResponse: Response;
}>;
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK";
isVerified: boolean;
fetchResponse: Response;
}>;
}

@@ -205,5 +157,2 @@ declare const init: typeof RecipeWrapper.init;

declare const signInAndUp: typeof RecipeWrapper.signInAndUp;
declare const verifyEmail: typeof RecipeWrapper.verifyEmail;
declare const sendVerificationEmail: typeof RecipeWrapper.sendVerificationEmail;
declare const isEmailVerified: typeof RecipeWrapper.isEmailVerified;
declare const getStateAndOtherInfoFromStorage: typeof RecipeWrapper.getStateAndOtherInfoFromStorage;

@@ -222,5 +171,2 @@ declare const setStateAndOtherInfoToStorage: typeof RecipeWrapper.setStateAndOtherInfoToStorage;

signInAndUp,
verifyEmail,
sendVerificationEmail,
isEmailVerified,
signOut,

@@ -227,0 +173,0 @@ getStateAndOtherInfoFromStorage,

@@ -30,133 +30,2 @@ "use strict";

};
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: [],
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === "function" &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_)
try {
if (
((f = 1),
y &&
(t =
op[0] & 2
? y["return"]
: op[0]
? y["throw"] || ((t = y["return"]) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
(op[0] === 6 || op[0] === 2)
) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -172,5 +41,2 @@ exports.getAuthStateFromURL =

exports.signOut =
exports.isEmailVerified =
exports.sendVerificationEmail =
exports.verifyEmail =
exports.signInAndUp =

@@ -370,87 +236,2 @@ exports.getAuthorisationURLWithQueryParamsAndSetState =

};
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.verifyEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.sendVerificationEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default
.getInstanceOrThrow()
.emailVerificationRecipe.recipeImplementation.sendVerificationEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdparty/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.isEmailVerified = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
return RecipeWrapper;

@@ -465,8 +246,2 @@ })();

exports.signInAndUp = signInAndUp;
var verifyEmail = RecipeWrapper.verifyEmail;
exports.verifyEmail = verifyEmail;
var sendVerificationEmail = RecipeWrapper.sendVerificationEmail;
exports.sendVerificationEmail = sendVerificationEmail;
var isEmailVerified = RecipeWrapper.isEmailVerified;
exports.isEmailVerified = isEmailVerified;
var getStateAndOtherInfoFromStorage = RecipeWrapper.getStateAndOtherInfoFromStorage;

@@ -473,0 +248,0 @@ exports.getStateAndOtherInfoFromStorage = getStateAndOtherInfoFromStorage;

@@ -1,15 +0,9 @@

import AuthRecipeWithEmailVerification from "../authRecipeWithEmailVerification";
import { InputType, NormalisedInputType, PreAndPostAPIHookAction, RecipeInterface, UserInput } from "./types";
import EmailVerificationRecipe from "../emailverification/recipe";
import { CreateRecipeFunction } from "../../types";
export default class Recipe extends AuthRecipeWithEmailVerification<PreAndPostAPIHookAction, NormalisedInputType> {
import AuthRecipe from "../authRecipe";
export default class Recipe extends AuthRecipe<PreAndPostAPIHookAction, NormalisedInputType> {
static instance?: Recipe;
static RECIPE_ID: string;
recipeImplementation: RecipeInterface;
constructor(
config: InputType,
recipes: {
emailVerification: EmailVerificationRecipe | undefined;
}
);
constructor(config: InputType);
static init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>;

@@ -16,0 +10,0 @@ static getInstanceOrThrow(): Recipe;

@@ -57,3 +57,2 @@ "use strict";

exports.Recipe = void 0;
var authRecipeWithEmailVerification_1 = require("../authRecipeWithEmailVerification");
var utils_1 = require("./utils");

@@ -63,6 +62,7 @@ var supertokens_js_override_1 = require("supertokens-js-override");

var utils_2 = require("../../utils");
var authRecipe_1 = require("../authRecipe");
var Recipe = /** @class */ (function (_super) {
__extends(Recipe, _super);
function Recipe(config, recipes) {
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config), recipes) || this;
function Recipe(config) {
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config)) || this;
var builder = new supertokens_js_override_1.default(

@@ -82,6 +82,3 @@ (0, recipeImplementation_1.default)({

Recipe.instance = new Recipe(
__assign(__assign({}, config), { recipeId: Recipe.RECIPE_ID, appInfo: appInfo }),
{
emailVerification: undefined,
}
__assign(__assign({}, config), { recipeId: Recipe.RECIPE_ID, appInfo: appInfo })
);

@@ -108,4 +105,4 @@ return Recipe.instance;

return Recipe;
})(authRecipeWithEmailVerification_1.default);
})(authRecipe_1.default);
exports.Recipe = Recipe;
exports.default = Recipe;
import {
NormalisedInputType as AuthRecipeNormalisedInputType,
InputType as AuthRecipeInputType,
UserType,
PreAndPostAPIHookAction as AuthRecipePreAndPostAPIHookAction,
} from "../authRecipeWithEmailVerification/types";
} from "../authRecipe/types";
import {

@@ -13,8 +11,4 @@ RecipePostAPIHookContext,

} from "../recipeModule/types";
import { InputTypeOverride as EmailVerificationOverride } from "../emailverification/types";
import OverrideableBuilder from "supertokens-js-override";
export declare type PreAndPostAPIHookAction =
| AuthRecipePreAndPostAPIHookAction
| "GET_AUTHORISATION_URL"
| "THIRD_PARTY_SIGN_IN_UP";
export declare type PreAndPostAPIHookAction = "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP";
export declare type PreAPIHookContext = RecipePreAPIHookContext<PreAndPostAPIHookAction>;

@@ -27,3 +21,2 @@ export declare type PostAPIHookContext = RecipePostAPIHookContext<PreAndPostAPIHookAction>;

override?: {
emailVerification?: EmailVerificationOverride;
functions?: (

@@ -51,3 +44,6 @@ originalImplementation: RecipeInterface,

};
export declare type ThirdPartyUserType = UserType & {
export declare type ThirdPartyUserType = {
id: string;
email: string;
timeJoined: number;
thirdParty: {

@@ -54,0 +50,0 @@ id: string;

@@ -32,3 +32,3 @@ "use strict";

*/
var utils_1 = require("../authRecipeWithEmailVerification/utils");
var utils_1 = require("../authRecipe/utils");
function normaliseUserInput(config) {

@@ -43,6 +43,4 @@ var override = __assign(

);
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipeWithEmailVerificationConfig)(config)), {
override: override,
});
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipe)(config)), { override: override });
}
exports.normaliseUserInput = normaliseUserInput;

@@ -321,50 +321,2 @@ import { RecipeFunctionOptions, UserType as EmailPasswordUserType } from "../emailpassword";

static getAuthStateFromURL(input?: { userContext?: any }): string;
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
fetchResponse: Response;
}>;
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK";
fetchResponse: Response;
}>;
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK";
isVerified: boolean;
fetchResponse: Response;
}>;
}

@@ -379,5 +331,2 @@ declare const init: typeof RecipeWrapper.init;

declare const getAuthorisationURLWithQueryParamsAndSetState: typeof RecipeWrapper.getAuthorisationURLWithQueryParamsAndSetState;
declare const verifyEmail: typeof RecipeWrapper.verifyEmail;
declare const sendVerificationEmail: typeof RecipeWrapper.sendVerificationEmail;
declare const isEmailVerified: typeof RecipeWrapper.isEmailVerified;
declare const getResetPasswordTokenFromURL: typeof RecipeWrapper.getResetPasswordTokenFromURL;

@@ -402,5 +351,2 @@ declare const getAuthorisationURLFromBackend: typeof RecipeWrapper.getAuthorisationURLFromBackend;

getAuthorisationURLWithQueryParamsAndSetState,
verifyEmail,
sendVerificationEmail,
isEmailVerified,
signOut,

@@ -407,0 +353,0 @@ getResetPasswordTokenFromURL,

@@ -30,133 +30,2 @@ "use strict";

};
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: [],
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === "function" &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_)
try {
if (
((f = 1),
y &&
(t =
op[0] & 2
? y["return"]
: op[0]
? y["throw"] || ((t = y["return"]) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
(op[0] === 6 || op[0] === 2)
) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -173,5 +42,2 @@ exports.getAuthStateFromURL =

exports.signOut =
exports.isEmailVerified =
exports.sendVerificationEmail =
exports.verifyEmail =
exports.getAuthorisationURLWithQueryParamsAndSetState =

@@ -498,87 +364,2 @@ exports.thirdPartySignInAndUp =

};
/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.verifyEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.sendVerificationEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default
.getInstanceOrThrow()
.emailVerificationRecipe.recipeImplementation.sendVerificationEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.isEmailVerified = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
return RecipeWrapper;

@@ -603,8 +384,2 @@ })();

exports.getAuthorisationURLWithQueryParamsAndSetState = getAuthorisationURLWithQueryParamsAndSetState;
var verifyEmail = RecipeWrapper.verifyEmail;
exports.verifyEmail = verifyEmail;
var sendVerificationEmail = RecipeWrapper.sendVerificationEmail;
exports.sendVerificationEmail = sendVerificationEmail;
var isEmailVerified = RecipeWrapper.isEmailVerified;
exports.isEmailVerified = isEmailVerified;
var getResetPasswordTokenFromURL = RecipeWrapper.getResetPasswordTokenFromURL;

@@ -611,0 +386,0 @@ exports.getResetPasswordTokenFromURL = getResetPasswordTokenFromURL;

@@ -1,8 +0,7 @@

import AuthRecipeWithEmailVerification from "../authRecipeWithEmailVerification";
import { InputType, NormalisedInputType, PreAndPostAPIHookAction, RecipeInterface, UserInput } from "./types";
import EmailVerificationRecipe from "../emailverification/recipe";
import EmailPasswordRecipe from "../emailpassword/recipe";
import ThirdPartyRecipe from "../thirdparty/recipe";
import { CreateRecipeFunction } from "../../types";
export default class Recipe extends AuthRecipeWithEmailVerification<PreAndPostAPIHookAction, NormalisedInputType> {
import AuthRecipe from "../authRecipe";
export default class Recipe extends AuthRecipe<PreAndPostAPIHookAction, NormalisedInputType> {
static instance?: Recipe;

@@ -16,3 +15,2 @@ static RECIPE_ID: string;

recipes: {
emailVerification: EmailVerificationRecipe | undefined;
thirdParty: ThirdPartyRecipe | undefined;

@@ -19,0 +17,0 @@ emailPassword: EmailPasswordRecipe | undefined;

@@ -43,17 +43,2 @@ "use strict";

exports.Recipe = void 0;
/* Copyright (c) 2022, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
var authRecipeWithEmailVerification_1 = require("../authRecipeWithEmailVerification");
var recipe_1 = require("../emailpassword/recipe");

@@ -67,7 +52,7 @@ var recipe_2 = require("../thirdparty/recipe");

var utils_2 = require("../../utils");
var authRecipe_1 = require("../authRecipe");
var Recipe = /** @class */ (function (_super) {
__extends(Recipe, _super);
function Recipe(config, recipes) {
var _a, _b;
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config), recipes) || this;
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config)) || this;
var builder = new supertokens_js_override_1.default(

@@ -89,20 +74,13 @@ (0, recipeImplementation_1.default)({

recipes.emailPassword === undefined
? new recipe_1.default(
{
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
emailVerification:
(_a = config.override) === null || _a === void 0 ? void 0 : _a.emailVerification,
functions: function () {
return (0, emailpassword_1.default)(_recipeImplementation);
},
? new recipe_1.default({
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
functions: function () {
return (0, emailpassword_1.default)(_recipeImplementation);
},
},
{
emailVerification: _this.emailVerificationRecipe,
}
)
})
: recipes.emailPassword;

@@ -115,20 +93,13 @@ /**

recipes.thirdParty === undefined
? new recipe_2.default(
{
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
emailVerification:
(_b = config.override) === null || _b === void 0 ? void 0 : _b.emailVerification,
functions: function () {
return (0, thirdparty_1.default)(_recipeImplementation);
},
? new recipe_2.default({
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
functions: function () {
return (0, thirdparty_1.default)(_recipeImplementation);
},
},
{
emailVerification: _this.emailVerificationRecipe,
}
)
})
: recipes.thirdParty;

@@ -151,3 +122,2 @@ return _this;

{
emailVerification: undefined,
emailPassword: undefined,

@@ -169,4 +139,4 @@ thirdParty: undefined,

return Recipe;
})(authRecipeWithEmailVerification_1.default);
})(authRecipe_1.default);
exports.Recipe = Recipe;
exports.default = Recipe;

@@ -1,3 +0,6 @@

import { PreAndPostAPIHookAction as EmailPasswordPreAndPostAPIHookAction } from "../emailpassword/types";
import {
UserType as EmailPasswordUserType,
PreAndPostAPIHookAction as EmailPasswordPreAndPostAPIHookAction,
} from "../emailpassword/types";
import {
RecipePostAPIHookContext,

@@ -10,8 +13,6 @@ RecipePreAPIHookContext,

import {
UserType as EmailPasswordUserType,
InputType as AuthRecipeInputType,
NormalisedInputType as AuthRecipeNormalisedInputType,
} from "../authRecipeWithEmailVerification/types";
} from "../authRecipe/types";
import OverrideableBuilder from "supertokens-js-override";
import { InputTypeOverride as EmailVerificationOverride } from "../emailverification/types";
import { ThirdPartyUserType } from "../thirdparty/types";

@@ -26,3 +27,2 @@ export declare type PreAndPostAPIHookAction = EmailPasswordPreAndPostAPIHookAction | ThirdPartyPreAndPostAPIHookAction;

override?: {
emailVerification?: EmailVerificationOverride;
functions?: (

@@ -29,0 +29,0 @@ originalImplementation: RecipeInterface,

@@ -32,3 +32,3 @@ "use strict";

exports.normaliseUserInput = void 0;
var utils_1 = require("../authRecipeWithEmailVerification/utils");
var utils_1 = require("../authRecipe/utils");
function normaliseUserInput(config) {

@@ -43,6 +43,4 @@ var override = __assign(

);
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipeWithEmailVerificationConfig)(config)), {
override: override,
});
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipe)(config)), { override: override });
}
exports.normaliseUserInput = normaliseUserInput;

@@ -207,3 +207,3 @@ import { UserInput, RecipeInterface, PreAPIHookContext, PostAPIHookContext, PreAndPostAPIHookAction } from "./types";

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -232,3 +232,3 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

status: "OK";
createdUser: boolean;
createdNewUser: boolean;
user: PasswordlessUser;

@@ -265,50 +265,2 @@ fetchResponse: Response;

/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
fetchResponse: Response;
}>;
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK";
fetchResponse: Response;
}>;
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
static isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{
status: "OK";
isVerified: boolean;
fetchResponse: Response;
}>;
/**
* Check if a user with the given email exists

@@ -395,5 +347,2 @@ *

declare const thirdPartySignInAndUp: typeof RecipeWrapper.thirdPartySignInAndUp;
declare const verifyEmail: typeof RecipeWrapper.verifyEmail;
declare const sendVerificationEmail: typeof RecipeWrapper.sendVerificationEmail;
declare const isEmailVerified: typeof RecipeWrapper.isEmailVerified;
declare const createPasswordlessCode: typeof RecipeWrapper.createPasswordlessCode;

@@ -422,5 +371,2 @@ declare const resendPasswordlessCode: typeof RecipeWrapper.resendPasswordlessCode;

thirdPartySignInAndUp,
verifyEmail,
sendVerificationEmail,
isEmailVerified,
createPasswordlessCode,

@@ -427,0 +373,0 @@ resendPasswordlessCode,

@@ -181,5 +181,2 @@ "use strict";

exports.createPasswordlessCode =
exports.isEmailVerified =
exports.sendVerificationEmail =
exports.verifyEmail =
exports.thirdPartySignInAndUp =

@@ -449,3 +446,3 @@ exports.getThirdPartyAuthorisationURLWithQueryParamsAndSetState =

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -509,87 +506,2 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

/**
* Verify an email
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR"}` if token is invalid
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.verifyEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.verifyEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Send an email to the user for verification.
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK"}` if successfull
* @returns `{status: "EMAIL_ALREADY_VERIFIED_ERROR"}` if the email has already been verified
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.sendVerificationEmail = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default
.getInstanceOrThrow()
.emailVerificationRecipe.recipeImplementation.sendVerificationEmail(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Check if an email has been verified
*
* @param userContext (OPTIONAL) Refer to {@link https://supertokens.com/docs/thirdpartypasswordless/advanced-customizations/user-context the documentation}
*
* @param options (OPTIONAL) Use this to configure additional properties (for example pre api hooks)
*
* @returns `{status: "OK", isVerified: boolean}`
*
* @throws STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`
*/
RecipeWrapper.isEmailVerified = function (input) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [
2 /*return*/,
recipe_1.default.getInstanceOrThrow().emailVerificationRecipe.recipeImplementation.isEmailVerified(
__assign(__assign({}, input), {
userContext: (0, utils_1.getNormalisedUserContext)(
input === null || input === void 0 ? void 0 : input.userContext
),
})
),
];
});
});
};
/**
* Check if a user with the given email exists

@@ -689,8 +601,2 @@ *

exports.thirdPartySignInAndUp = thirdPartySignInAndUp;
var verifyEmail = RecipeWrapper.verifyEmail;
exports.verifyEmail = verifyEmail;
var sendVerificationEmail = RecipeWrapper.sendVerificationEmail;
exports.sendVerificationEmail = sendVerificationEmail;
var isEmailVerified = RecipeWrapper.isEmailVerified;
exports.isEmailVerified = isEmailVerified;
var createPasswordlessCode = RecipeWrapper.createPasswordlessCode;

@@ -697,0 +603,0 @@ exports.createPasswordlessCode = createPasswordlessCode;

@@ -1,8 +0,7 @@

import AuthRecipeWithEmailVerification from "../authRecipeWithEmailVerification";
import { InputType, NormalisedInputType, PreAndPostAPIHookAction, RecipeInterface, UserInput } from "./types";
import EmailVerificationRecipe from "../emailverification/recipe";
import ThirdPartyRecipe from "../thirdparty/recipe";
import PasswordlessRecipe from "../passwordless/recipe";
import { CreateRecipeFunction } from "../../types";
export default class Recipe extends AuthRecipeWithEmailVerification<PreAndPostAPIHookAction, NormalisedInputType> {
import AuthRecipe from "../authRecipe";
export default class Recipe extends AuthRecipe<PreAndPostAPIHookAction, NormalisedInputType> {
static instance?: Recipe;

@@ -16,3 +15,2 @@ static RECIPE_ID: string;

recipes: {
emailVerification: EmailVerificationRecipe | undefined;
thirdParty: ThirdPartyRecipe | undefined;

@@ -19,0 +17,0 @@ passwordless: PasswordlessRecipe | undefined;

@@ -57,3 +57,2 @@ "use strict";

exports.Recipe = void 0;
var authRecipeWithEmailVerification_1 = require("../authRecipeWithEmailVerification");
var recipe_1 = require("../thirdparty/recipe");

@@ -67,7 +66,7 @@ var recipe_2 = require("../passwordless/recipe");

var passwordless_1 = require("./recipeImplementation/passwordless");
var authRecipe_1 = require("../authRecipe");
var Recipe = /** @class */ (function (_super) {
__extends(Recipe, _super);
function Recipe(config, recipes) {
var _a;
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config), recipes) || this;
var _this = _super.call(this, (0, utils_1.normaliseUserInput)(config)) || this;
var builder = new supertokens_js_override_1.default(

@@ -85,20 +84,13 @@ (0, recipeImplementation_1.default)({

recipes.thirdParty === undefined
? new recipe_1.default(
{
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
emailVerification:
(_a = config.override) === null || _a === void 0 ? void 0 : _a.emailVerification,
functions: function () {
return (0, thirdparty_1.default)(_recipeImplementation);
},
? new recipe_1.default({
recipeId: _this.config.recipeId,
appInfo: _this.config.appInfo,
preAPIHook: config.preAPIHook,
postAPIHook: config.postAPIHook,
override: {
functions: function () {
return (0, thirdparty_1.default)(_recipeImplementation);
},
},
{
emailVerification: _this.emailVerificationRecipe,
}
)
})
: recipes.thirdParty;

@@ -135,3 +127,2 @@ _this.passwordlessRecipe =

{
emailVerification: undefined,
thirdParty: undefined,

@@ -153,4 +144,4 @@ passwordless: undefined,

return Recipe;
})(authRecipeWithEmailVerification_1.default);
})(authRecipe_1.default);
exports.Recipe = Recipe;
exports.default = Recipe;
import {
InputType as AuthRecipeInputType,
NormalisedInputType as AuthRecipeNormalisedInputType,
} from "../authRecipeWithEmailVerification/types";
} from "../authRecipe/types";
import {

@@ -17,3 +17,2 @@ PasswordlessFlowType,

import { StateObject, PreAndPostAPIHookAction as ThirdPartyPreAndPostAPIHookAction } from "../thirdparty/types";
import { InputTypeOverride as EmailVerificationOverride } from "../emailverification/types";
import OverrideableBuilder from "supertokens-js-override";

@@ -29,3 +28,2 @@ import { ThirdPartyUserType } from "../thirdparty/types";

override?: {
emailVerification?: EmailVerificationOverride;
functions?: (

@@ -260,3 +258,3 @@ originalImplementation: RecipeInterface,

*
* @returns `{status: "OK", user, createdUser: bool}` if succesful
* @returns `{status: "OK", user, createdNewUser: bool}` if succesful
*

@@ -289,3 +287,3 @@ * @returns `{status: "INCORRECT_USER_INPUT_CODE_ERROR", failedCodeInputAttemptCount, maximumCodeInputAttempts}` if the code is incorrect

status: "OK";
createdUser: boolean;
createdNewUser: boolean;
user: PasswordlessUser;

@@ -292,0 +290,0 @@ fetchResponse: Response;

@@ -32,3 +32,3 @@ "use strict";

exports.normaliseUserInput = void 0;
var utils_1 = require("../authRecipeWithEmailVerification/utils");
var utils_1 = require("../authRecipe/utils");
function normaliseUserInput(config) {

@@ -43,6 +43,4 @@ var override = __assign(

);
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipeWithEmailVerificationConfig)(config)), {
override: override,
});
return __assign(__assign({}, (0, utils_1.normaliseAuthRecipe)(config)), { override: override });
}
exports.normaliseUserInput = normaliseUserInput;

@@ -20,2 +20,3 @@ "use strict";

var windowHandler_1 = require("supertokens-website/utils/windowHandler");
var postSuperTokensInitCallbacks_1 = require("./postSuperTokensInitCallbacks");
var SuperTokens = /** @class */ (function () {

@@ -53,2 +54,3 @@ function SuperTokens(config) {

SuperTokens.instance = new SuperTokens(config);
postSuperTokensInitCallbacks_1.PostSuperTokensInitCallbacks.runPostInitCallbacks();
};

@@ -55,0 +57,0 @@ /**

@@ -1,2 +0,2 @@

export declare const package_version = "0.1.6";
export declare const package_version = "0.2.0";
export declare const supported_fdi: string[];

@@ -18,3 +18,3 @@ "use strict";

*/
exports.package_version = "0.1.6";
exports.supported_fdi = ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14"];
exports.package_version = "0.2.0";
exports.supported_fdi = ["1.15"];
{
"name": "supertokens-web-js",
"version": "0.1.6",
"version": "0.2.0",
"description": "SuperTokens SDK for vanilla JS for all recipes",

@@ -43,3 +43,3 @@ "main": "./index.js",

"supertokens-js-override": "0.0.4",
"supertokens-website": "^13.0.2"
"supertokens-website": "^13.1.0"
},

@@ -72,29 +72,33 @@ "devDependencies": {

"path": "recipe/emailverification/index.js",
"limit": "6kb"
"limit": "20kb"
},
{
"path": "recipe/emailpassword/index.js",
"limit": "18kb"
"limit": "20kb"
},
{
"path": "recipe/thirdparty/index.js",
"limit": "19kb"
"limit": "20kb"
},
{
"path": "recipe/thirdpartyemailpassword/index.js",
"limit": "20kb"
"limit": "22kb"
},
{
"path": "recipe/session/index.js",
"limit": "16kb"
"limit": "18kb"
},
{
"path": "recipe/passwordless/index.js",
"limit": "18kb"
"limit": "20kb"
},
{
"path": "recipe/thirdpartypasswordless/index.js",
"limit": "21kb"
"limit": "25kb"
},
{
"path": "recipe/userroles/index.js",
"limit": "18kb"
}
]
}

@@ -57,2 +57,7 @@ var webpack = require("webpack");

},
supertokensUserRoles: {
import: APP_DIR + "/lib/build/recipe/userroles/index.js",
filename: "userroles.js",
dependOn: "supertokensWebsite",
},
/**

@@ -59,0 +64,0 @@ * Without this webpack will bundle supertokens-website as independent references

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc