supertokens-web-js
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailPassword;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[581],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1260),a=n(255),u=n(2173),c=function(){function e(e,t){var n=this;this.recipeId=e,this.appInfo=t,this.get=function(e,t,s,a,u,c){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,t,a),r({method:"GET"},s),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===s.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},s),a,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,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,t),r({method:"DELETE"},s),a,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,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,t),r({method:"PUT"},s),a,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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new s.default(t),a="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?a:a+"?"+new URLSearchParams(r)},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]}}))}))}}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.getTenantIdFromURL=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.getTenantIdFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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;var v=s.getTenantIdFromURL;t.getTenantIdFromURL=v},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,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,clientType:r,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Ensure that the 'EmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";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.__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.getRecipeImplementation=void 0;var s=n(634),a=n(6984),u=n(8122);function c(e){var t=new s.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var a=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=this.getTenantIdFromURL({userContext:c}),o=this.getResetPasswordTokenFromURL({userContext:c}),[4,t.post(n,"/user/password/reset",{body:JSON.stringify({formFields:a,token:o,method:"token"})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:c}))];case 1:return l=i.sent(),f=l.jsonBody,p=l.fetchResponse,"FIELD_ERROR"===f.status?[2,{status:"FIELD_ERROR",formFields:f.formFields,fetchResponse:p}]:"RESET_PASSWORD_INVALID_TOKEN_ERROR"===f.status?[2,{status:f.status,fetchResponse:p}]:[2,r(r({},f),{fetchResponse:p})]}}))}))},sendPasswordResetEmail:function(n){var r=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,p.apply(f,[i.sent(),"/user/password/reset/token",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:l}]:"PASSWORD_RESET_NOT_ALLOWED"===o.status?[2,{status:o.status,reason:o.reason,fetchResponse:l}]:[2,{status:o.status,fetchResponse:l}]}}))}))},signUp:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f,p,d;return i(this,(function(i){switch(i.label){case 0:return d=(p=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,d.apply(p,[i.sent(),"/signup",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:c,userContext:l}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:f}]:"SIGN_UP_NOT_ALLOWED"===o.status?[2,{status:"SIGN_UP_NOT_ALLOWED",reason:o.reason,fetchResponse:f}]:[2,{status:o.status,user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:f}]}}))}))},signIn:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f,p,d;return i(this,(function(i){switch(i.label){case 0:return d=(p=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,d.apply(p,[i.sent(),"/signin",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:c,userContext:l}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:f}]:"WRONG_CREDENTIALS_ERROR"===o.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:f}]:"SIGN_IN_NOT_ALLOWED"===o.status?[2,{status:"SIGN_IN_NOT_ALLOWED",reason:o.reason,fetchResponse:f}]:[2,{status:"OK",user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:f}]}}))}))},doesEmailExist:function(n){var r=n.email,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).get,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,p.apply(f,[i.sent(),"/signup/email/exists",{},{email:r},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:l}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,u.getQueryParams)("token");return void 0===e?"":e},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")}}}t.default=c,t.getRecipeImplementation=c},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})}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),a=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new a.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var s=n.tenantId,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(s,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=s,t.getRecipeImplementation=s},4853: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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(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 s(n,void 0,void 0,(function(){return a(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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260),a=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,a.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),s=i.default.getClaimValidatorsAddedByOtherRecipes(),a=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:s,userContext:n});return void 0!==e?e(a,n):a}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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.recipeId=e,this.appInfo=t,this.get=function(e,t,s,a,u,c){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,t,a),r({method:"GET"},s),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===s.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},s),a,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,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,t),r({method:"DELETE"},s),a,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,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,t),r({method:"PUT"},s),a,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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new s.default(t),a="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?a:a+"?"+new URLSearchParams(r)},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]}}))}))}}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.getTenantIdFromURL=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.getTenantIdFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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;var v=s.getTenantIdFromURL;t.getTenantIdFromURL=v},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,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,clientType:r,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Ensure that the 'EmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";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.__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.getRecipeImplementation=void 0;var s=n(634),a=n(6984),u=n(8122);function c(e){var t=new s.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var a=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return n=this.getTenantIdFromURL({userContext:c}),o=this.getResetPasswordTokenFromURL({userContext:c}),[4,t.post(n,"/user/password/reset",{body:JSON.stringify({formFields:a,token:o,method:"token"})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:c}))];case 1:return l=i.sent(),f=l.jsonBody,p=l.fetchResponse,"FIELD_ERROR"===f.status?[2,{status:"FIELD_ERROR",formFields:f.formFields,fetchResponse:p}]:"RESET_PASSWORD_INVALID_TOKEN_ERROR"===f.status?[2,{status:f.status,fetchResponse:p}]:[2,r(r({},f),{fetchResponse:p})]}}))}))},sendPasswordResetEmail:function(n){var r=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,p.apply(f,[i.sent(),"/user/password/reset/token",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:l}]:"PASSWORD_RESET_NOT_ALLOWED"===o.status?[2,{status:o.status,reason:o.reason,fetchResponse:l}]:[2,{status:o.status,fetchResponse:l}]}}))}))},signUp:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f,p,d;return i(this,(function(i){switch(i.label){case 0:return d=(p=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,d.apply(p,[i.sent(),"/signup",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:c,userContext:l}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:f}]:"SIGN_UP_NOT_ALLOWED"===o.status?[2,{status:"SIGN_UP_NOT_ALLOWED",reason:o.reason,fetchResponse:f}]:[2,{status:o.status,user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:f}]}}))}))},signIn:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f,p,d;return i(this,(function(i){switch(i.label){case 0:return d=(p=t).post,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,d.apply(p,[i.sent(),"/signin",{body:JSON.stringify({formFields:r})},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:c,userContext:l}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:f}]:"WRONG_CREDENTIALS_ERROR"===o.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:f}]:"SIGN_IN_NOT_ALLOWED"===o.status?[2,{status:"SIGN_IN_NOT_ALLOWED",reason:o.reason,fetchResponse:f}]:[2,{status:"OK",user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:f}]}}))}))},doesEmailExist:function(n){var r=n.email,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).get,[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,p.apply(f,[i.sent(),"/signup/email/exists",{},{email:r},s.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:u,userContext:c}),s.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:l}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,u.getQueryParams)("token");return void 0===e?"":e},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")}}}t.default=c,t.getRecipeImplementation=c},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})}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),a=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new a.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var s=n.tenantId,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(s,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=s,t.getRecipeImplementation=s},4853: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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(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 s(n,void 0,void 0,(function(){return a(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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260),a=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,a.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),s=i.default.getClaimValidatorsAddedByOtherRecipes(),a=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:s,userContext:n});return void 0!==e?e(a,n):a}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(6022,e(e.s=6022));supertokensEmailPassword=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537,560],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var n=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,n=e.postInitCallbacks;t<n.length;t++)(0,n[t])()},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=n},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1260),s=n(255),u=n(2173),l=function(){function e(e,t){var n=this;this.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,l){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,t,s),r({method:"GET"},a),u,l)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,u){return o(n,void 0,void 0,(function(){var n,o,l,c,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(),l=o.requestInit,c=o.url,[4,fetch(c,l)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(d=f.clone(),[4,u({requestInit:l,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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=l},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},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=n(9236),l=n(1013),c=n(1199);function f(e){return Math.max(e,u.DateProviderReference.getReferenceOrThrow().dateProvider.getThresholdInSeconds())}var d=function(e){function t(t){var n=e.call(this,{id:c.EMAILVERIFICATION_CLAIM_ID,refresh:function(e){return a(n,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 n.validators=i(i({},n.validators),{isVerified:function(e,t){return{id:n.id,refresh:n.refresh,shouldRefresh:function(r,o){var i=u.DateProviderReference.getReferenceOrThrow().dateProvider;if(t=null!=t?t:f(10),e=null!=e?e:f(300),t<i.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(i.getThresholdInSeconds()));if(e<i.getThresholdInSeconds())throw new Error("refetchTimeOnFalseInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(i.getThresholdInSeconds()));var a=n.getValueFromPayload(r,o);return void 0===a||n.getLastFetchedTime(r,o)<i.now()-1e3*t||!1===a&&n.getLastFetchedTime(r,o)<i.now()-1e3*e},validate:function(e,t){return a(n,void 0,void 0,(function(){var n;return s(this,(function(r){return[2,!0===(n=this.getValueFromPayload(e,t))?{isValid:!0}:{isValid:!1,reason:{message:"wrong value",expectedValue:!0,actualValue:n}}]}))}))}}}}),n}return o(t,e),t}(l.BooleanClaim);t.EmailVerificationClaimClass=d},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.getTenantIdFromURL=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.getTenantIdFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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 l=s.verifyEmail;t.verifyEmail=l;var c=s.sendVerificationEmail;t.sendVerificationEmail=c;var f=s.isEmailVerified;t.isEmailVerified=f;var d=s.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=d;var p=s.getTenantIdFromURL;t.getTenantIdFromURL=p;var h=s.EmailVerificationClaim;t.EmailVerificationClaim=h},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(4881),i=n(787),a=n(5120),s=n(6333),u=n(8122),l=n(3288),c=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,clientType:this.config.clientType,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=n.override(this.config.override.functions).build(),c.PostSuperTokensInitCallbacks.addPostInitCallback((function(){o.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(e.EmailVerificationClaim.validators.isVerified(10))}))}return e.init=function(t){return function(n,o){return e.instance=new e(r(r({},t),{appInfo:n,clientType:o,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Ensure that the 'EmailVerification.init' method is called within the 'SuperTokens.init' recipeList.";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 l.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,l,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:s}),r=this.getTenantIdFromURL({userContext:s}),[4,t.post(r,"/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 u=o.sent(),l=u.jsonBody,c=u.fetchResponse,[2,{status:l.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(void 0,"/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(void 0,"/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},getTenantIdFromURL:function(){return(0,a.getQueryParams)("tenantId")}}}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,clientType:e.clientType,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.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=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.getAccessToken=function(e){return a.default.getInstanceOrThrow().getAccessToken({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 f=s.getAccessToken;t.getAccessToken=f;var d=s.attemptRefreshingSession;t.attemptRefreshingSession=d;var p=s.doesSessionExist;t.doesSessionExist=p;var h=s.addAxiosInterceptors;t.addAxiosInterceptors=h;var v=s.signOut;t.signOut=v;var m=s.validateClaims;t.validateClaims=m;var g=s.getClaimValue;t.getClaimValue=g;var y=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=y;var I=n(1757);Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return I.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return I.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return I.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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var l=n(1996),c=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(l.default);t.Recipe=p,t.default=p},4881:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var r=n(6376);Object.defineProperty(t,"SessionClaimValidatorStore",{enumerable:!0,get:function(){return r.SessionClaimValidatorStore}})},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},9236:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2519))},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},6376:(e,t,n)=>{function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}t.__esModule=!0;let o=n(2582);void 0!==o.default?r(o):r({default:o,...o})},9092:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7860))}},e=>{var t=(5857,e(e.s=5857));supertokensEmailVerification=t}]); | ||
"use strict";var supertokensEmailVerification;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[537,560],{7611:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSR_ERROR=t.DEFAULT_API_BASE_PATH=void 0,t.DEFAULT_API_BASE_PATH="/auth",t.SSR_ERROR="\nIf you are trying to use this method doing server-side-rendering, please make sure you move this method inside a componentDidMount method or useEffect hook."},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},7992:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");var r=new URL(e);return t?r.hostname.startsWith("localhost")||(o=r.hostname,/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(o))?"http://"+r.host:"https://"+r.host:r.protocol+"//"+r.host}catch(e){}var o;if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),n(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=n(e)}},1260:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("Error converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PostSuperTokensInitCallbacks=void 0;var n=function(){function e(){}return e.addPostInitCallback=function(t){e.postInitCallbacks.push(t)},e.runPostInitCallbacks=function(){for(var t=0,n=e.postInitCallbacks;t<n.length;t++)(0,n[t])()},e.postInitCallbacks=[],e}();t.PostSuperTokensInitCallbacks=n},634:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(1260),s=n(255),u=n(2173),l=function(){function e(e,t){var n=this;this.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,l){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,t,s),r({method:"GET"},a),u,l)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,u){return o(n,void 0,void 0,(function(){var n,o,l,c,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(),l=o.requestInit,c=o.url,[4,fetch(c,l)];case 2:if((f=i.sent()).status>=300)throw f;return void 0===u?[3,4]:(d=f.clone(),[4,u({requestInit:l,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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=l},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},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=n(9236),l=n(1013),c=n(1199);function f(e){return Math.max(e,u.DateProviderReference.getReferenceOrThrow().dateProvider.getThresholdInSeconds())}var d=function(e){function t(t){var n=e.call(this,{id:c.EMAILVERIFICATION_CLAIM_ID,refresh:function(e){return a(n,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 n.validators=i(i({},n.validators),{isVerified:function(e,t){return{id:n.id,refresh:n.refresh,shouldRefresh:function(r,o){var i=u.DateProviderReference.getReferenceOrThrow().dateProvider;if(t=null!=t?t:f(300),e=null!=e?e:f(10),t<i.getThresholdInSeconds())throw new Error("maxAgeInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(i.getThresholdInSeconds()));if(e<i.getThresholdInSeconds())throw new Error("refetchTimeOnFalseInSeconds must be greater than or equal to the DateProvider threshold value -> ".concat(i.getThresholdInSeconds()));var a=n.getValueFromPayload(r,o);return void 0===a||n.getLastFetchedTime(r,o)<i.now()-1e3*t||!1===a&&n.getLastFetchedTime(r,o)<i.now()-1e3*e},validate:function(e,t){return a(n,void 0,void 0,(function(){var n;return s(this,(function(r){return[2,!0===(n=this.getValueFromPayload(e,t))?{isValid:!0}:{isValid:!1,reason:{message:"wrong value",expectedValue:!0,actualValue:n}}]}))}))}}}}),n}return o(t,e),t}(l.BooleanClaim);t.EmailVerificationClaimClass=d},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.getTenantIdFromURL=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.getTenantIdFromURL=function(e){return o.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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 l=s.verifyEmail;t.verifyEmail=l;var c=s.sendVerificationEmail;t.sendVerificationEmail=c;var f=s.isEmailVerified;t.isEmailVerified=f;var d=s.getEmailVerificationTokenFromURL;t.getEmailVerificationTokenFromURL=d;var p=s.getTenantIdFromURL;t.getTenantIdFromURL=p;var h=s.EmailVerificationClaim;t.EmailVerificationClaim=h},6923:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var o=n(4881),i=n(787),a=n(5120),s=n(6333),u=n(8122),l=n(3288),c=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,clientType:this.config.clientType,preAPIHook:this.config.preAPIHook,postAPIHook:this.config.postAPIHook}));this.recipeImplementation=n.override(this.config.override.functions).build(),c.PostSuperTokensInitCallbacks.addPostInitCallback((function(){o.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(e.EmailVerificationClaim.validators.isVerified(10))}))}return e.init=function(t){return function(n,o){return e.instance=new e(r(r({},t),{appInfo:n,clientType:o,recipeId:e.RECIPE_ID})),e.instance}},e.getInstanceOrThrow=function(){if(void 0===e.instance){var t="No instance of EmailVerification found. Ensure that the 'EmailVerification.init' method is called within the 'SuperTokens.init' recipeList.";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 l.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,l,c;return o(this,(function(o){switch(o.label){case 0:return n=this.getEmailVerificationTokenFromURL({userContext:s}),r=this.getTenantIdFromURL({userContext:s}),[4,t.post(r,"/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 u=o.sent(),l=u.jsonBody,c=u.fetchResponse,[2,{status:l.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(void 0,"/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(void 0,"/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},getTenantIdFromURL:function(){return(0,a.getQueryParams)("tenantId")}}}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,clientType:e.clientType,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.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=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.getAccessToken=function(e){return a.default.getInstanceOrThrow().getAccessToken({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 f=s.getAccessToken;t.getAccessToken=f;var d=s.attemptRefreshingSession;t.attemptRefreshingSession=d;var p=s.doesSessionExist;t.doesSessionExist=p;var h=s.addAxiosInterceptors;t.addAxiosInterceptors=h;var v=s.signOut;t.signOut=v;var m=s.validateClaims;t.validateClaims=m;var g=s.getClaimValue;t.getClaimValue=g;var y=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=y;var I=n(1757);Object.defineProperty(t,"PrimitiveClaim",{enumerable:!0,get:function(){return I.PrimitiveClaim}}),Object.defineProperty(t,"PrimitiveArrayClaim",{enumerable:!0,get:function(){return I.PrimitiveArrayClaim}}),Object.defineProperty(t,"BooleanClaim",{enumerable:!0,get:function(){return I.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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var l=n(1996),c=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,c.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(l.default);t.Recipe=p,t.default=p},4881:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var r=n(6376);Object.defineProperty(t,"SessionClaimValidatorStore",{enumerable:!0,get:function(){return r.SessionClaimValidatorStore}})},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},9236:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2519))},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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 supertokensMultiFactorAuth;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[910],{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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},8140:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MultiFactorAuthClaimClass=t.MultiFactorAuthClaim=t.resyncSessionAndFetchMFAInfo=t.init=void 0;var r=n(6970);Object.defineProperty(t,"MultiFactorAuthClaimClass",{enumerable:!0,get:function(){return r.MultiFactorAuthClaimClass}});var o=n(7504),i=n(8122),a=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.resyncSessionAndFetchMFAInfo=function(e){var t;return o.default.getInstanceOrThrow().recipeImplementation.resyncSessionAndFetchMFAInfo({options:null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{},userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.MultiFactorAuthClaim=o.default.MultiFactorAuthClaim,e}();t.default=a;var s=a.init;t.init=s;var u=a.resyncSessionAndFetchMFAInfo;t.resyncSessionAndFetchMFAInfo=u;var c=a.MultiFactorAuthClaim;t.MultiFactorAuthClaim=c},6970: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.MultiFactorAuthClaimClass=void 0;var i=n(2305),a=function(){function e(e){var t=this;this.getRecipeImpl=e,this.id="st-mfa",this.validators={hasCompletedMFARequirementsForAuth:function(){return{id:t.id,refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},validate:function(e,n){return r(t,void 0,void 0,(function(){var t;return o(this,(function(r){return void 0===(t=this.getValueFromPayload(e,n))?[2,{isValid:!1,reason:{message:"MFA info not available in payload"}}]:t.v?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"not all required factors have been completed"}}]}))}))}}},hasCompletedFactors:function(e){return{id:t.id,shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},validate:function(n,r){var o=t.getValueFromPayload(n,r);if(void 0===o)return{isValid:!1,reason:{message:"MFA info not available in payload"}};for(var a=o.c,s=0,u=e;s<u.length;s++){var c=u[s];if("object"==typeof c&&"oneOf"in c){if((l=c.oneOf.map((function(e){return(0,i.checkFactorRequirement)(e,a)})).filter((function(e){return!1===e.isValid}))).length===c.oneOf.length)return{isValid:!1,reason:{message:"All factor checkers failed in the list",oneOf:c.oneOf,failures:l}}}else if("object"==typeof c&&"allOfInAnyOrder"in c){if(0!==(l=c.allOfInAnyOrder.map((function(e){return(0,i.checkFactorRequirement)(e,a)})).filter((function(e){return!1===e.isValid}))).length)return{isValid:!1,reason:{message:"Some factor checkers failed in the list",allOfInAnyOrder:c.allOfInAnyOrder,failures:l}}}else{var l;if(!0!==(l=(0,i.checkFactorRequirement)(c,a)).isValid)return{isValid:!1,reason:{message:"Factor validation failed: "+l.message,factorId:l.id}}}}return{isValid:!0}}}}}}return e.prototype.refresh=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.getRecipeImpl().resyncSessionAndFetchMFAInfo(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getValueFromPayload=function(e,t){if(void 0!==e[this.id])return{c:e[this.id].c,v:e[this.id].v}},e.prototype.getLastFetchedTime=function(e,t){var n;return null===(n=e[this.id])||void 0===n?void 0:n.t},e}();t.MultiFactorAuthClaimClass=a},7504: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 a=n(2305),s=n(6333),u=n(1576),c=n(8122),l=n(7725),f=n(5941),d=n(6376),p=n(6970),h=function(e){function t(n){var r=e.call(this,(0,a.normaliseUserInput)(n))||this,o=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=o.override(r.config.override.functions).build(),f.PostSuperTokensInitCallbacks.addPostInitCallback((function(){d.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(t.MultiFactorAuthClaim.validators.hasCompletedMFARequirementsForAuth())})),r}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of MultiFactorAuth found. Make sure to call the MultiFactorAuth.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="multifactorauth",t.MultiFactorAuthClaim=new p.MultiFactorAuthClaimClass((function(){return t.getInstanceOrThrow().recipeImplementation})),t}(l.default);t.Recipe=h,t.default=h},1576: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}),t.getRecipeImplementation=void 0;var a=n(634);function s(e){var t=new a.default(e.recipeId,e.appInfo);return{resyncSessionAndFetchMFAInfo:function(n){var s=n.options,u=n.userContext;return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.put(void 0,"/mfa/info",{},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_MFA_INFO",options:s,userContext:u}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_MFA_INFO",userContext:u}))];case 1:return n=i.sent(),o=n.jsonBody,c=n.fetchResponse,[2,r(r({},o),{fetchResponse:c})]}}))}))}}}t.default=s,t.getRecipeImplementation=s},2305: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.checkFactorRequirement=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})},t.checkFactorRequirement=function(e,t){return{id:e,isValid:void 0!==t[e],message:"Not completed"}}},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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(8140,e(e.s=8140));supertokensMultiFactorAuth=t}]); | ||
"use strict";var supertokensMultiFactorAuth;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[910],{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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},8140:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MultiFactorAuthClaimClass=t.MultiFactorAuthClaim=t.resyncSessionAndFetchMFAInfo=t.init=void 0;var r=n(6970);Object.defineProperty(t,"MultiFactorAuthClaimClass",{enumerable:!0,get:function(){return r.MultiFactorAuthClaimClass}});var o=n(7504),i=n(8122),a=function(){function e(){}return e.init=function(e){return o.default.init(e)},e.resyncSessionAndFetchMFAInfo=function(e){var t;return o.default.getInstanceOrThrow().recipeImplementation.resyncSessionAndFetchMFAInfo({options:null!==(t=null==e?void 0:e.options)&&void 0!==t?t:{},userContext:(0,i.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.MultiFactorAuthClaim=o.default.MultiFactorAuthClaim,e}();t.default=a;var s=a.init;t.init=s;var u=a.resyncSessionAndFetchMFAInfo;t.resyncSessionAndFetchMFAInfo=u;var c=a.MultiFactorAuthClaim;t.MultiFactorAuthClaim=c},6970: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.MultiFactorAuthClaimClass=void 0;var i=n(2305),a=function(){function e(e){var t=this;this.getRecipeImpl=e,this.id="st-mfa",this.validators={hasCompletedMFARequirementsForAuth:function(){return{id:t.id,refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},validate:function(e,n){return r(t,void 0,void 0,(function(){var t;return o(this,(function(r){return void 0===(t=this.getValueFromPayload(e,n))?[2,{isValid:!1,reason:{message:"MFA info not available in payload"}}]:t.v?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"not all required factors have been completed"}}]}))}))}}},hasCompletedFactors:function(e){return{id:t.id,shouldRefresh:function(e,n){return void 0===t.getValueFromPayload(e,n)},refresh:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.refresh.apply(t,e)},validate:function(n,r){var o=t.getValueFromPayload(n,r);if(void 0===o)return{isValid:!1,reason:{message:"MFA info not available in payload"}};for(var a=o.c,s=0,u=e;s<u.length;s++){var c=u[s];if("object"==typeof c&&"oneOf"in c){if((l=c.oneOf.map((function(e){return(0,i.checkFactorRequirement)(e,a)})).filter((function(e){return!1===e.isValid}))).length===c.oneOf.length)return{isValid:!1,reason:{message:"All factor checkers failed in the list",oneOf:c.oneOf,failures:l}}}else if("object"==typeof c&&"allOfInAnyOrder"in c){if(0!==(l=c.allOfInAnyOrder.map((function(e){return(0,i.checkFactorRequirement)(e,a)})).filter((function(e){return!1===e.isValid}))).length)return{isValid:!1,reason:{message:"Some factor checkers failed in the list",allOfInAnyOrder:c.allOfInAnyOrder,failures:l}}}else{var l;if(!0!==(l=(0,i.checkFactorRequirement)(c,a)).isValid)return{isValid:!1,reason:{message:"Factor validation failed: "+l.message,factorId:l.id}}}}return{isValid:!0}}}}}}return e.prototype.refresh=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.getRecipeImpl().resyncSessionAndFetchMFAInfo(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getValueFromPayload=function(e,t){if(void 0!==e[this.id])return{c:e[this.id].c,v:e[this.id].v}},e.prototype.getLastFetchedTime=function(e,t){var n;return null===(n=e[this.id])||void 0===n?void 0:n.t},e}();t.MultiFactorAuthClaimClass=a},7504: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 a=n(2305),s=n(6333),u=n(1576),c=n(8122),l=n(7725),f=n(5941),d=n(6376),p=n(6970),h=function(e){function t(n){var r=e.call(this,(0,a.normaliseUserInput)(n))||this,o=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook}));return r.recipeImplementation=o.override(r.config.override.functions).build(),f.PostSuperTokensInitCallbacks.addPostInitCallback((function(){d.SessionClaimValidatorStore.addClaimValidatorFromOtherRecipe(t.MultiFactorAuthClaim.validators.hasCompletedMFARequirementsForAuth())})),r}return o(t,e),t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of MultiFactorAuth found. Make sure to call the MultiFactorAuth.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="multifactorauth",t.MultiFactorAuthClaim=new p.MultiFactorAuthClaimClass((function(){return t.getInstanceOrThrow().recipeImplementation})),t}(l.default);t.Recipe=h,t.default=h},1576: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}),t.getRecipeImplementation=void 0;var a=n(634);function s(e){var t=new a.default(e.recipeId,e.appInfo);return{resyncSessionAndFetchMFAInfo:function(n){var s=n.options,u=n.userContext;return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.put(void 0,"/mfa/info",{},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_MFA_INFO",options:s,userContext:u}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_MFA_INFO",userContext:u}))];case 1:return n=i.sent(),o=n.jsonBody,c=n.fetchResponse,[2,r(r({},o),{fetchResponse:c})]}}))}))}}}t.default=s,t.getRecipeImplementation=s},2305: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.checkFactorRequirement=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})},t.checkFactorRequirement=function(e,t){return{id:e,isValid:void 0!==t[e],message:"Not completed"}}},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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(8140,e(e.s=8140));supertokensMultiFactorAuth=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensMultitenancy;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[746,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)}},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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},4694: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.AllowedDomainsClaim=t.AllowedDomainsClaimClass=void 0;var u=n(9092),c=function(e){function t(){var t=e.call(this,{id:"st-t-dmns",refresh:function(){return a(t,void 0,void 0,(function(){return s(this,(function(e){return[2]}))}))},defaultMaxAgeInSeconds:Number.MAX_SAFE_INTEGER})||this;return t.validators=i(i({},t.validators),{hasAccessToCurrentDomain:function(){return{id:t.id,refresh:t.refresh,shouldRefresh:function(){return!1},validate:function(e,n){return a(t,void 0,void 0,(function(){var t;return s(this,(function(r){return t=u.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHostName(),[2,this.validators.includes(t,Number.MAX_SAFE_INTEGER,this.id).validate(e,n)]}))}))}}}}),t}return o(t,e),t}(n(1013).PrimitiveArrayClaim);t.AllowedDomainsClaimClass=c,t.AllowedDomainsClaim=new c},2797: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.AllowedDomainsClaim=t.getTenantId=t.getLoginMethods=t.init=void 0;var o=n(8122),i=n(4694);Object.defineProperty(t,"AllowedDomainsClaim",{enumerable:!0,get:function(){return i.AllowedDomainsClaim}});var a=n(6984),s=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.getLoginMethods=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getLoginMethods(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getTenantId=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getTenantId(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.AllowedDomainsClaim=i.AllowedDomainsClaim,e}();t.default=s;var u=s.init;t.init=u;var c=s.getLoginMethods;t.getLoginMethods=c;var l=s.getTenantId;t.getTenantId=l},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=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.getAccessToken=function(e){return a.default.getInstanceOrThrow().getAccessToken({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.getAccessToken;t.getAccessToken=f;var d=s.attemptRefreshingSession;t.attemptRefreshingSession=d;var p=s.doesSessionExist;t.doesSessionExist=p;var h=s.addAxiosInterceptors;t.addAxiosInterceptors=h;var v=s.signOut;t.signOut=v;var y=s.validateClaims;t.validateClaims=y;var g=s.getClaimValue;t.getClaimValue=g;var m=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=m;var w=n(1757);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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(2797,e(e.s=2797));supertokensMultitenancy=t}]); | ||
"use strict";var supertokensMultitenancy;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[746,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)}},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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},4694: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.AllowedDomainsClaim=t.AllowedDomainsClaimClass=void 0;var u=n(9092),c=function(e){function t(){var t=e.call(this,{id:"st-t-dmns",refresh:function(){return a(t,void 0,void 0,(function(){return s(this,(function(e){return[2]}))}))},defaultMaxAgeInSeconds:Number.MAX_SAFE_INTEGER})||this;return t.validators=i(i({},t.validators),{hasAccessToCurrentDomain:function(){return{id:t.id,refresh:t.refresh,shouldRefresh:function(){return!1},validate:function(e,n){return a(t,void 0,void 0,(function(){var t;return s(this,(function(r){return t=u.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getHostName(),[2,this.validators.includes(t,Number.MAX_SAFE_INTEGER,this.id).validate(e,n)]}))}))}}}}),t}return o(t,e),t}(n(1013).PrimitiveArrayClaim);t.AllowedDomainsClaimClass=c,t.AllowedDomainsClaim=new c},2797: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.AllowedDomainsClaim=t.getTenantId=t.getLoginMethods=t.init=void 0;var o=n(8122),i=n(4694);Object.defineProperty(t,"AllowedDomainsClaim",{enumerable:!0,get:function(){return i.AllowedDomainsClaim}});var a=n(6984),s=function(){function e(){}return e.init=function(e){return a.default.init(e)},e.getLoginMethods=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getLoginMethods(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getTenantId=function(e){return a.default.getInstanceOrThrow().recipeImplementation.getTenantId(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.AllowedDomainsClaim=i.AllowedDomainsClaim,e}();t.default=s;var u=s.init;t.init=u;var c=s.getLoginMethods;t.getLoginMethods=c;var l=s.getTenantId;t.getTenantId=l},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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.getAccessToken=t.getAccessTokenPayloadSecurely=t.getUserId=t.init=t.BooleanClaim=t.PrimitiveArrayClaim=t.PrimitiveClaim=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.getAccessToken=function(e){return a.default.getInstanceOrThrow().getAccessToken({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.getAccessToken;t.getAccessToken=f;var d=s.attemptRefreshingSession;t.attemptRefreshingSession=d;var p=s.doesSessionExist;t.doesSessionExist=p;var h=s.addAxiosInterceptors;t.addAxiosInterceptors=h;var v=s.signOut;t.signOut=v;var y=s.validateClaims;t.validateClaims=y;var g=s.getClaimValue;t.getClaimValue=g;var m=s.getInvalidClaimsFromResponse;t.getInvalidClaimsFromResponse=m;var w=n(1757);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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),d=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return d.includes(e.id)})),!0),n.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(2797,e(e.s=2797));supertokensMultitenancy=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{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.recipeId=e,this.appInfo=t,this.get=function(e,t,s,a,u,c){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,t,a),r({method:"GET"},s),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===s.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},s),a,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,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,t),r({method:"DELETE"},s),a,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,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,t),r({method:"PUT"},s),a,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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new s.default(t),a="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?a:a+"?"+new URLSearchParams(r)},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]}}))}))}}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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),a=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new a.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var s=n.tenantId,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(s,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=s,t.getRecipeImplementation=s},4853: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})}},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{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.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getTenantIdFromURL=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),a=n(6984),u=n(2856),c=n(4921),l=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,c.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,c.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,c.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.getTenantIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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 o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),n=u.default.getInstanceOrThrow(),[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,n.recipeImplementation.setLoginAttemptInfo({attemptInfo:r({tenantId:o},e.attemptInfo),userContext:t})]}}))}))},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=l;var f=l.init;t.init=f;var p=l.createCode;t.createCode=p;var d=l.resendCode;t.resendCode=d;var h=l.consumeCode;t.consumeCode=h;var v=l.doesEmailExist;t.doesEmailExist=v;var I=l.doesPhoneNumberExist;t.doesPhoneNumberExist=I;var m=l.signOut;t.signOut=m;var g=l.getLinkCodeFromURL;t.getLinkCodeFromURL=g;var y=l.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=y;var w=l.getTenantIdFromURL;t.getTenantIdFromURL=w;var b=l.getLoginAttemptInfo;t.getLoginAttemptInfo=b;var P=l.setLoginAttemptInfo;t.setLoginAttemptInfo=P;var _=l.clearLoginAttemptInfo;t.clearLoginAttemptInfo=_},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),a=n(8122),u=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,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Ensure that the 'Passwordless.init' method is called within the 'SuperTokens.init' recipeList.";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=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{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.getRecipeImplementation=void 0;var s=n(7528),a=n(634),u=n(8122),c=n(6984),l=n(6427);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,u,l,f,p;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}),p=(f=t).post,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,p.apply(f,[i.sent(),"/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext})])];case 2:return s=i.sent(),u=s.jsonBody,l=s.fetchResponse,[2,r(r({},u),{fetchResponse:l})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post(n.tenantId,"/signinup/code/resend",{body:JSON.stringify(r)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,c,l;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(n.tenantId,"/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),c=s.jsonBody,l=s.fetchResponse,"OK"!==c.status?[2,r(r({},c),{fetchResponse:l})]:[2,r(r({status:"OK"},(0,u.normaliseUserResponse)("passwordless",c)),{fetchResponse:l})]}}))}))},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u,l;return i(this,(function(i){switch(i.label){case 0:return l=(u=t).get,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,l.apply(u,[i.sent(),"/signup/email/exists",{},{email:n.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext})])];case 2: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,u,l;return i(this,(function(i){switch(i.label){case 0:return l=(u=t).get,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,l.apply(u,[i.sent(),"/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext})])];case 2: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(l.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(l.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(l.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=f,t.getRecipeImplementation=f},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{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.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),a=n(5053),u=n(6984);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,u.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:e.userContext})];case 1:return n=i.sent(),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 2:return"OK"!==(o=i.sent()).status?[3,4]:[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{tenantId:n,deviceId:o.deviceId,preAuthSessionId:o.preAuthSessionId,flowType:o.flowType},userContext:t})];case 3:i.sent(),i.label=4;case 4:return[2,o]}}))}))},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),{tenantId:null==n?void 0:n.tenantId,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,a,u,c;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,tenantId:null==o?void 0:o.tenantId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getTenantIdFromURL({userContext:e.userContext}),c=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={tenantId:u,linkCode:a,preAuthSessionId:c},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{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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(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 s(n,void 0,void 0,(function(){return a(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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260),a=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,a.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),s=i.default.getClaimValidatorsAddedByOtherRecipes(),a=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:s,userContext:n});return void 0!==e?e(a,n):a}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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{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.recipeId=e,this.appInfo=t,this.get=function(e,t,s,a,u,c){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,t,a),r({method:"GET"},s),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===s.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},s),a,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,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,t),r({method:"DELETE"},s),a,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,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,t),r({method:"PUT"},s),a,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,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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new s.default(t),a="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?a:a+"?"+new URLSearchParams(r)},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]}}))}))}}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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),a=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,s.normaliseUserInput)(t))||this,r=new a.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function s(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var s=n.tenantId,a=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(s,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:a,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=s,t.getRecipeImplementation=s},4853: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})}},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{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.clearLoginAttemptInfo=t.setLoginAttemptInfo=t.getLoginAttemptInfo=t.getTenantIdFromURL=t.getPreAuthSessionIdFromURL=t.getLinkCodeFromURL=t.signOut=t.doesPhoneNumberExist=t.doesEmailExist=t.consumeCode=t.resendCode=t.createCode=t.init=void 0;var s=n(8122),a=n(6984),u=n(2856),c=n(4921),l=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,c.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,c.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,c.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.getTenantIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(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 o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),n=u.default.getInstanceOrThrow(),[4,a.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,n.recipeImplementation.setLoginAttemptInfo({attemptInfo:r({tenantId:o},e.attemptInfo),userContext:t})]}}))}))},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=l;var f=l.init;t.init=f;var p=l.createCode;t.createCode=p;var d=l.resendCode;t.resendCode=d;var h=l.consumeCode;t.consumeCode=h;var v=l.doesEmailExist;t.doesEmailExist=v;var I=l.doesPhoneNumberExist;t.doesPhoneNumberExist=I;var m=l.signOut;t.signOut=m;var g=l.getLinkCodeFromURL;t.getLinkCodeFromURL=g;var y=l.getPreAuthSessionIdFromURL;t.getPreAuthSessionIdFromURL=y;var w=l.getTenantIdFromURL;t.getTenantIdFromURL=w;var b=l.getLoginAttemptInfo;t.getLoginAttemptInfo=b;var P=l.setLoginAttemptInfo;t.setLoginAttemptInfo=P;var _=l.clearLoginAttemptInfo;t.clearLoginAttemptInfo=_},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),a=n(8122),u=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,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Passwordless found. Ensure that the 'Passwordless.init' method is called within the 'SuperTokens.init' recipeList.";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=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{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.getRecipeImplementation=void 0;var s=n(7528),a=n(634),u=n(8122),c=n(6984),l=n(6427);function f(e){var t=new a.default(e.recipeId,e.appInfo);return{createCode:function(n){return o(this,void 0,void 0,(function(){var o,s,u,l,f,p;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}),p=(f=t).post,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,p.apply(f,[i.sent(),"/signinup/code",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CREATE_CODE",userContext:n.userContext})])];case 2:return s=i.sent(),u=s.jsonBody,l=s.fetchResponse,[2,r(r({},u),{fetchResponse:l})]}}))}))},resendCode:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return r={deviceId:n.deviceId,preAuthSessionId:n.preAuthSessionId},[4,t.post(n.tenantId,"/signinup/code/resend",{body:JSON.stringify(r)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_RESEND_CODE",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:s.status,fetchResponse:u}]}}))}))},consumeCode:function(n){return o(this,void 0,void 0,(function(){var o,s,c,l;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(n.tenantId,"/signinup/code/consume",{body:JSON.stringify(o)},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PASSWORDLESS_CONSUME_CODE",userContext:n.userContext}))];case 1:return s=i.sent(),c=s.jsonBody,l=s.fetchResponse,"OK"!==c.status?[2,r(r({},c),{fetchResponse:l})]:[2,r(r({status:"OK"},(0,u.normaliseUserResponse)("passwordless",c)),{fetchResponse:l})]}}))}))},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")},getLinkCodeFromURL:function(){return(0,u.getHashFromLocation)()},getPreAuthSessionIdFromURL:function(){var e=(0,u.getQueryParams)("preAuthSessionId");return void 0===e?"":e},doesEmailExist:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u,l;return i(this,(function(i){switch(i.label){case 0:return l=(u=t).get,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,l.apply(u,[i.sent(),"/signup/email/exists",{},{email:n.email},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:n.userContext})])];case 2: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,u,l;return i(this,(function(i){switch(i.label){case 0:return l=(u=t).get,[4,c.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:n.userContext})];case 1:return[4,l.apply(u,[i.sent(),"/signup/phoneNumber/exists",{},{phoneNumber:n.phoneNumber},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext,options:n.options}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"PHONE_NUMBER_EXISTS",userContext:n.userContext})])];case 2: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(l.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(l.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(l.PASSWORDLESS_LOGIN_ATTEMPT_INFO_STORAGE_KEY),[2]}))}))}}}t.default=f,t.getRecipeImplementation=f},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{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.consumeCode=t.resendCode=t.createCode=t.normaliseUserInput=void 0;var s=n(8122),a=n(5053),u=n(6984);t.normaliseUserInput=function(e){var t=r({functions:function(e){return e}},e.override);return r(r({},(0,a.normaliseAuthRecipe)(e)),{override:t})},t.createCode=function(e){return o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,s.getNormalisedUserContext)(e.userContext),[4,u.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:e.userContext})];case 1:return n=i.sent(),[4,e.recipeImplementation.createCode(r(r({},e),{userContext:t}))];case 2:return"OK"!==(o=i.sent()).status?[3,4]:[4,e.recipeImplementation.setLoginAttemptInfo({attemptInfo:{tenantId:n,deviceId:o.deviceId,preAuthSessionId:o.preAuthSessionId,flowType:o.flowType},userContext:t})];case 3:i.sent(),i.label=4;case 4:return[2,o]}}))}))},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),{tenantId:null==n?void 0:n.tenantId,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,a,u,c;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,tenantId:null==o?void 0:o.tenantId},[3,3];case 2:a=e.recipeImplementation.getLinkCodeFromURL({userContext:e.userContext}),u=e.recipeImplementation.getTenantIdFromURL({userContext:e.userContext}),c=e.recipeImplementation.getPreAuthSessionIdFromURL({userContext:e.userContext}),n={tenantId:u,linkCode:a,preAuthSessionId:c},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{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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return s(n,void 0,void 0,(function(){return a(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},n.getAccessTokenPayloadSecurely=function(e){return s(n,void 0,void 0,(function(){return a(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 s(n,void 0,void 0,(function(){return a(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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),s=n(1260),a=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,a.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),s=i.default.getClaimValidatorsAddedByOtherRecipes(),a=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:s,userContext:n});return void 0!==e?e(a,n):a}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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 supertokens;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[842],{280:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(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."},4587:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(2118);Object.defineProperty(t,"CookieHandlerReference",{enumerable:!0,get:function(){return r.CookieHandlerReference}})},7335:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(9236);Object.defineProperty(t,"DateProviderReference",{enumerable:!0,get:function(){return r.DateProviderReference}})},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=n(3146),o=function(){function e(){}return e.init=function(e){r.default.init(e)},e}();t.default=o,t.init=o.init},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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,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: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]:(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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},3146:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(8122),o=n(4587),i=n(7528),a=n(5941),s=n(6984),u=n(7335),c=function(){function e(e){var t=this;if(this.recipeList=[],this.appInfo=(0,r.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 n=!1;void 0!==e.enableDebugLogs&&(n=e.enableDebugLogs);var o=!1;this.recipeList=e.recipeList.map((function(r){var i=r(t.appInfo,e.clientType,n);return i.config.recipeId===s.Recipe.RECIPE_ID&&(o=!0),i})),o||this.recipeList.push(s.Recipe.init()(this.appInfo,e.clientType,n))}return e.init=function(t){o.CookieHandlerReference.init(t.cookieHandler),i.WindowHandlerReference.init(t.windowHandler),u.DateProviderReference.init(t.dateProvider),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,r.checkForSSRErrorAndAppendIfNeeded)(t),new Error(t)}return e.instance},e.reset=function(){(0,r.isTest)()?e.instance=void 0:console.warn("Calling reset() is only supported during testing")},e}();t.default=c},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},2118:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(5209))},9236:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2519))},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(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,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(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."},4587:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(2118);Object.defineProperty(t,"CookieHandlerReference",{enumerable:!0,get:function(){return r.CookieHandlerReference}})},7335:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(9236);Object.defineProperty(t,"DateProviderReference",{enumerable:!0,get:function(){return r.DateProviderReference}})},2173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(942);t.default=r.STGeneralError},569:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=n(3146),o=function(){function e(){}return e.init=function(e){r.default.init(e)},e}();t.default=o,t.init=o.init},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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,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: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]:(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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,f;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},3146:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(8122),o=n(4587),i=n(7528),a=n(5941),s=n(6984),u=n(7335),c=function(){function e(e){var t=this;if(this.recipeList=[],this.appInfo=(0,r.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 n=!1;void 0!==e.enableDebugLogs&&(n=e.enableDebugLogs);var o=!1;this.recipeList=e.recipeList.map((function(r){var i=r(t.appInfo,e.clientType,n);return i.config.recipeId===s.Recipe.RECIPE_ID&&(o=!0),i})),o||this.recipeList.push(s.Recipe.init()(this.appInfo,e.clientType,n))}return e.init=function(t){o.CookieHandlerReference.init(t.cookieHandler),i.WindowHandlerReference.init(t.windowHandler),u.DateProviderReference.init(t.dateProvider),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,r.checkForSSRErrorAndAppendIfNeeded)(t),new Error(t)}return e.instance},e.reset=function(){(0,r.isTest)()?e.instance=void 0:console.warn("Calling reset() is only supported during testing")},e}();t.default=c},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},2118:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(5209))},9236:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(2519))},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),n({method:"GET"},a),u,c)];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,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),n({method:"POST"},a),s,u)];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,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,t),n({method:"DELETE"},a),s,u)];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,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,t),n({method:"PUT"},a),s,u)];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,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,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(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,n){var o=r.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===n?s:s+"?"+new URLSearchParams(n)},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]}}))}))}}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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),s=r(6333),u=r(1265),c=r(8122),l=function(e){function t(t){var r=e.call(this,(0,a.normaliseUserInput)(t))||this,n=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,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,n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r,clientType:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(r(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(r){var a=r.tenantId,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,l,f;return o(this,(function(o){switch(o.label){case 0:return r={},void 0!==e.clientType&&(r.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},r,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,l=n.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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})}},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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=r(1996),l=r(1757),f=r(8122),d=[r(1199).EMAILVERIFICATION_CLAIM_ID],p=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return l.default.getUserId({userContext:e.userContext})},r.getAccessToken=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return l.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return l.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,l.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(e){return l.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},l.default.init(i(i({},t),{override:{functions:function(e,r){var n;return r.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var r=e.getGlobalClaimValidators(t);return u(u([],r.filter((function(e){return d.includes(e.id)})),!0),r.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(n=t.override)||void 0===n?void 0:n.functions)&&r.override(t.override.functions),e}},preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r,n;return s(this,(function(o){return(r=new Headers(e.requestInit.headers)).set("rid",t.recipeId),n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:r})}),void 0===t.preAPIHook?[2,n]:[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,o){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},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.signOut=t.signInAndUp=t.getAuthorisationURLWithQueryParamsAndSetState=t.getStateAndOtherInfoFromStorage=t.init=void 0;var a=r(8122),s=r(6984),u=r(9102),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getStateAndOtherInfoFromStorage=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return o(this,void 0,void 0,(function(){var t,r,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,a.getNormalisedUserContext)(e.userContext),r=u.default.getInstanceOrThrow(),[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,r.recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({tenantId:o},e),{userContext:t}))]}}))}))},e.signInAndUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var l=c.init;t.init=l;var f=c.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=f;var d=c.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=d;var p=c.signInAndUp;t.signInAndUp=p;var h=c.signOut;t.signOut=h},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(4566),s=r(6333),u=r(3664),c=r(8122),l=function(e){function t(t){var r=e.call(this,(0,a.normaliseUserInput)(t))||this,n=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,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,n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r,clientType:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Ensure that the 'ThirdParty.init' method is called within the 'SuperTokens.init' recipeList.";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=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(7528);function l(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[4,this.getAuthorisationURLFromBackend({thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,userContext:e.userContext,options:e.options})];case 1:return t=i.sent(),r=void 0!==e.redirectURIOnProviderDashboard&&e.frontendRedirectURI!==e.redirectURIOnProviderDashboard?e.frontendRedirectURI:void 0,n=this.generateStateToSendToOAuthProvider({frontendRedirectURI:r,userContext:e.userContext}),o=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:n,thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,expiresAt:o,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,pkceCodeVerifier:t.pkceCodeVerifier},userContext:e.userContext})];case 2:return i.sent(),[2,(0,s.appendQueryParamsToURL)(t.urlWithQueryParams,{state:n})]}}))}))},getAuthorisationURLFromBackend: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={thirdPartyId:r.thirdPartyId,redirectURIOnProviderDashboard:r.redirectURIOnProviderDashboard},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(r.tenantId,"/authorisationurl",{},n,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 o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:"OK",urlWithQueryParams:s.urlWithQueryParams,pkceCodeVerifier:s.pkceCodeVerifier,fetchResponse:u}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,c,l,f,d,p,h,v,y;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),c=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:c,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(l=i.sent(),void 0!==(f=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(f));return d=(0,s.getAllQueryParams)(),p=Object.fromEntries(d),[4,t.post(l.tenantId,"/signinup",{body:JSON.stringify({thirdPartyId:l.thirdPartyId,clientType:e.clientType,redirectURIInfo:{redirectURIOnProviderDashboard:l.redirectURIOnProviderDashboard,redirectURIQueryParams:p,pkceCodeVerifier:l.pkceCodeVerifier}})},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(h=i.sent(),v=h.jsonBody,y=h.fetchResponse,"FIELD_ERROR"===v.status)throw new u.default(v.error);return"OK"!==v.status?[2,n(n({},v),{fetchResponse:y})]:[2,n(n({status:"OK"},(0,s.normaliseUserResponse)("thirdparty",v)),{fetchResponse:y})]}}))}))},generateStateToSendToOAuthProvider:function(e){var t={state:"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))};return void 0!==e&&void 0!==e.frontendRedirectURI&&(t.frontendRedirectURI=e.frontendRedirectURI),btoa(JSON.stringify(t))},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]}))}))},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=l,t.getRecipeImplementation=l},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})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),a=r(1260),s=r(5811);function u(e,t){if("loginMethods"in t)return t;var r=void 0!==t.email?[t.email]:[],n=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:r,phoneNumbers:n,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,r=e.userContext;return(0,s.getGlobalClaimValidators)(t,r)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},4328:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var n=r(2652),o=r(788),i=r(2582);t.getGlobalClaimValidators=function(e,t){var r=(0,n.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:r});return void 0!==e?e(s,r):s}},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})},5811:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(4328))},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:(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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),n({method:"GET"},a),u,c)];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,u){return o(r,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),n({method:"POST"},a),s,u)];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,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,t),n({method:"DELETE"},a),s,u)];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,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,t),n({method:"PUT"},a),s,u)];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,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,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(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,n){var o=r.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(r.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===n?s:s+"?"+new URLSearchParams(n)},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]}}))}))}}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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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(4853),s=r(6333),u=r(1265),c=r(8122),l=function(e){function t(t){var r=e.call(this,(0,a.normaliseUserInput)(t))||this,n=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,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,n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r,clientType:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(r(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(r){var a=r.tenantId,s=r.options,u=r.userContext;return n(this,void 0,void 0,(function(){var r,n,c,l,f;return o(this,(function(o){switch(o.label){case 0:return r={},void 0!==e.clientType&&(r.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},r,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return n=o.sent(),c=n.jsonBody,l=n.fetchResponse,void 0===c.firstFactors?(f=[],c.emailPassword.enabled&&f.push("emailpassword"),c.thirdParty.enabled&&f.push("thirdparty"),c.passwordless.enabled&&(f.push("otp-email"),f.push("otp-phone"),f.push("link-email"),f.push("link-phone"))):f=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:f,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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})}},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,clientType:e.clientType,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])}}},u=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=r(1996),l=r(1757),f=r(8122),d=[r(1199).EMAILVERIFICATION_CLAIM_ID],p=function(e){function t(t){var r=e.call(this,t)||this;return r.getUserId=function(e){return l.default.getUserId({userContext:e.userContext})},r.getAccessToken=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({userContext:e.userContext})]}))}))},r.getAccessTokenPayloadSecurely=function(e){return a(r,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessTokenPayloadSecurely({userContext:e.userContext})]}))}))},r.doesSessionExist=function(e){return l.default.doesSessionExist({userContext:e.userContext})},r.signOut=function(e){return l.default.signOut({userContext:e.userContext})},r.attemptRefreshingSession=function(){return a(r,void 0,void 0,(function(){return s(this,(function(e){return[2,l.default.attemptRefreshingSession()]}))}))},r.validateClaims=function(e){return l.default.validateClaims(e.overrideGlobalClaimValidators,e.userContext)},l.default.init(i(i({},t),{override:{functions:function(e,r){var n;return r.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var r=e.getGlobalClaimValidators(t);return u(u([],r.filter((function(e){return d.includes(e.id)})),!0),r.filter((function(e){return!d.includes(e.id)})),!0)}})})),(null===(n=t.override)||void 0===n?void 0:n.functions)&&r.override(t.override.functions),e}},preAPIHook:function(e){return a(r,void 0,void 0,(function(){var r,n;return s(this,(function(o){return(r=new Headers(e.requestInit.headers)).set("rid",t.recipeId),n=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:r})}),void 0===t.preAPIHook?[2,n]:[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,o){return t.instance=new t(i(i({},e),{appInfo:r,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},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.signOut=t.signInAndUp=t.getAuthorisationURLWithQueryParamsAndSetState=t.getStateAndOtherInfoFromStorage=t.init=void 0;var a=r(8122),s=r(6984),u=r(9102),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.getStateAndOtherInfoFromStorage=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return o(this,void 0,void 0,(function(){var t,r,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,a.getNormalisedUserContext)(e.userContext),r=u.default.getInstanceOrThrow(),[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,r.recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(n(n({tenantId:o},e),{userContext:t}))]}}))}))},e.signInAndUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.signInAndUp(n(n({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=c;var l=c.init;t.init=l;var f=c.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=f;var d=c.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=d;var p=c.signInAndUp;t.signInAndUp=p;var h=c.signOut;t.signOut=h},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(4566),s=r(6333),u=r(3664),c=r(8122),l=function(e){function t(t){var r=e.call(this,(0,a.normaliseUserInput)(t))||this,n=new s.default((0,u.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,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,n){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:r,clientType:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Ensure that the 'ThirdParty.init' method is called within the 'SuperTokens.init' recipeList.";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=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(7528);function l(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[4,this.getAuthorisationURLFromBackend({thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,userContext:e.userContext,options:e.options})];case 1:return t=i.sent(),r=void 0!==e.redirectURIOnProviderDashboard&&e.frontendRedirectURI!==e.redirectURIOnProviderDashboard?e.frontendRedirectURI:void 0,n=this.generateStateToSendToOAuthProvider({frontendRedirectURI:r,userContext:e.userContext}),o=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:n,thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,expiresAt:o,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,pkceCodeVerifier:t.pkceCodeVerifier},userContext:e.userContext})];case 2:return i.sent(),[2,(0,s.appendQueryParamsToURL)(t.urlWithQueryParams,{state:n})]}}))}))},getAuthorisationURLFromBackend: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={thirdPartyId:r.thirdPartyId,redirectURIOnProviderDashboard:r.redirectURIOnProviderDashboard},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(r.tenantId,"/authorisationurl",{},n,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 o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:"OK",urlWithQueryParams:s.urlWithQueryParams,pkceCodeVerifier:s.pkceCodeVerifier,fetchResponse:u}]}}))}))},signInAndUp:function(r){return o(this,void 0,void 0,(function(){var o,c,l,f,d,p,h,v,y;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:r.userContext}),c=this.getAuthStateFromURL({userContext:r.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:c,stateObjectFromStorage:o,userContext:r.userContext})];case 1:if(l=i.sent(),void 0!==(f=this.getAuthErrorFromURL({userContext:r.userContext})))throw new Error("Auth provider responded with error: ".concat(f));return d=(0,s.getAllQueryParams)(),p=Object.fromEntries(d),[4,t.post(l.tenantId,"/signinup",{body:JSON.stringify({thirdPartyId:l.thirdPartyId,clientType:e.clientType,redirectURIInfo:{redirectURIOnProviderDashboard:l.redirectURIOnProviderDashboard,redirectURIQueryParams:p,pkceCodeVerifier:l.pkceCodeVerifier}})},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(h=i.sent(),v=h.jsonBody,y=h.fetchResponse,"FIELD_ERROR"===v.status)throw new u.default(v.error);return"OK"!==v.status?[2,n(n({},v),{fetchResponse:y})]:[2,n(n({status:"OK"},(0,s.normaliseUserResponse)("thirdparty",v)),{fetchResponse:y})]}}))}))},generateStateToSendToOAuthProvider:function(e){var t={state:"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))};return void 0!==e&&void 0!==e.frontendRedirectURI&&(t.frontendRedirectURI=e.frontendRedirectURI),btoa(JSON.stringify(t))},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]}))}))},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=l,t.getRecipeImplementation=l},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})}},8122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var n=r(7528),o=r(7611),i=r(7992),a=r(1260),s=r(5811);function u(e,t){if("loginMethods"in t)return t;var r=void 0!==t.email?[t.email]:[],n=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:r,phoneNumbers:n,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(n.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,r=e.userContext;return(0,s.getGlobalClaimValidators)(t,r)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var n=r(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return n.WindowHandlerReference}})},4328:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var n=r(2652),o=r(788),i=r(2582);t.getGlobalClaimValidators=function(e,t){var r=(0,n.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:r});return void 0!==e?e(s,r):s}},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})},5811:(e,t,r)=>{t.__esModule=!0,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(4328))},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}]); |
@@ -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,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 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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,u){return o(n,void 0,void 0,(function(){var n,o,c,l,d,f;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((d=i.sent()).status>=300)throw d;return void 0===u?[3,4]:(f=d.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,d]}}))}))},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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},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 a=n(5110),s=n(4071),u=n(6333),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new u.default((0,s.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,clientType:r,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Ensure that the 'EmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";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.__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}),t.getRecipeImplementation=void 0;var a=n(634),s=n(6984),u=n(8122);function c(e){var t=new a.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return n=this.getTenantIdFromURL({userContext:c}),o=this.getResetPasswordTokenFromURL({userContext:c}),[4,t.post(n,"/user/password/reset",{body:JSON.stringify({formFields:s,token:o,method:"token"})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:c}))];case 1:return l=i.sent(),d=l.jsonBody,f=l.fetchResponse,"FIELD_ERROR"===d.status?[2,{status:"FIELD_ERROR",formFields:d.formFields,fetchResponse:f}]:"RESET_PASSWORD_INVALID_TOKEN_ERROR"===d.status?[2,{status:d.status,fetchResponse:f}]:[2,r(r({},d),{fetchResponse:f})]}}))}))},sendPasswordResetEmail:function(n){var r=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return f=(d=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[i.sent(),"/user/password/reset/token",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:l}]:"PASSWORD_RESET_NOT_ALLOWED"===o.status?[2,{status:o.status,reason:o.reason,fetchResponse:l}]:[2,{status:o.status,fetchResponse:l}]}}))}))},signUp:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,d,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,p.apply(f,[i.sent(),"/signup",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,d=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:d}]:"SIGN_UP_NOT_ALLOWED"===o.status?[2,{status:"SIGN_UP_NOT_ALLOWED",reason:o.reason,fetchResponse:d}]:[2,{status:o.status,user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:d}]}}))}))},signIn:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,d,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,p.apply(f,[i.sent(),"/signin",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,d=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:d}]:"WRONG_CREDENTIALS_ERROR"===o.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:d}]:"SIGN_IN_NOT_ALLOWED"===o.status?[2,{status:"SIGN_IN_NOT_ALLOWED",reason:o.reason,fetchResponse:d}]:[2,{status:"OK",user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:d}]}}))}))},doesEmailExist:function(n){var r=n.email,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return f=(d=t).get,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[i.sent(),"/signup/email/exists",{},{email:r},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:l}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,u.getQueryParams)("token");return void 0===e?"":e},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")}}}t.default=c,t.getRecipeImplementation=c},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})}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,d;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(d=[],c.emailPassword.enabled&&d.push("emailpassword"),c.thirdParty.enabled&&d.push("thirdparty"),c.passwordless.enabled&&(d.push("otp-email"),d.push("otp-phone"),d.push("link-email"),d.push("link-phone"))):d=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:d,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),d=n(8122),f=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return f.includes(e.id)})),!0),n.filter((function(e){return!f.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},9102: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 a=n(4566),s=n(6333),u=n(3664),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Ensure that the 'ThirdParty.init' method is called within the 'SuperTokens.init' recipeList.";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}(n(7725).default);t.Recipe=l,t.default=l},3664: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}),t.getRecipeImplementation=void 0;var a=n(634),s=n(8122),u=n(2173),c=n(7528);function l(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(n){switch(n.label){case 0:return t=JSON.stringify(r({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return n.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return[4,this.getAuthorisationURLFromBackend({thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,userContext:e.userContext,options:e.options})];case 1:return t=i.sent(),n=void 0!==e.redirectURIOnProviderDashboard&&e.frontendRedirectURI!==e.redirectURIOnProviderDashboard?e.frontendRedirectURI:void 0,r=this.generateStateToSendToOAuthProvider({frontendRedirectURI:n,userContext:e.userContext}),o=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:r,thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,expiresAt:o,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,pkceCodeVerifier:t.pkceCodeVerifier},userContext:e.userContext})];case 2:return i.sent(),[2,(0,s.appendQueryParamsToURL)(t.urlWithQueryParams,{state:r})]}}))}))},getAuthorisationURLFromBackend:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return r={thirdPartyId:n.thirdPartyId,redirectURIOnProviderDashboard:n.redirectURIOnProviderDashboard},void 0!==e.clientType&&(r.clientType=e.clientType),[4,t.get(n.tenantId,"/authorisationurl",{},r,a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:n.options,userContext:n.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:"OK",urlWithQueryParams:s.urlWithQueryParams,pkceCodeVerifier:s.pkceCodeVerifier,fetchResponse:u}]}}))}))},signInAndUp:function(n){return o(this,void 0,void 0,(function(){var o,c,l,d,f,p,h,v,I;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:n.userContext}),c=this.getAuthStateFromURL({userContext:n.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:c,stateObjectFromStorage:o,userContext:n.userContext})];case 1:if(l=i.sent(),void 0!==(d=this.getAuthErrorFromURL({userContext:n.userContext})))throw new Error("Auth provider responded with error: ".concat(d));return f=(0,s.getAllQueryParams)(),p=Object.fromEntries(f),[4,t.post(l.tenantId,"/signinup",{body:JSON.stringify({thirdPartyId:l.thirdPartyId,clientType:e.clientType,redirectURIInfo:{redirectURIOnProviderDashboard:l.redirectURIOnProviderDashboard,redirectURIQueryParams:p,pkceCodeVerifier:l.pkceCodeVerifier}})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:n.options,userContext:n.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:n.userContext}))];case 2:if(h=i.sent(),v=h.jsonBody,I=h.fetchResponse,"FIELD_ERROR"===v.status)throw new u.default(v.error);return"OK"!==v.status?[2,r(r({},v),{fetchResponse:I})]:[2,r(r({status:"OK"},(0,s.normaliseUserResponse)("thirdparty",v)),{fetchResponse:I})]}}))}))},generateStateToSendToOAuthProvider:function(e){var t={state:"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))};return void 0!==e&&void 0!==e.frontendRedirectURI&&(t.frontendRedirectURI=e.frontendRedirectURI),btoa(JSON.stringify(t))},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]}))}))},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=l,t.getRecipeImplementation=l},4566: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})}},4442: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}),t.getTenantIdFromURL=t.getResetPasswordTokenFromURL=t.signOut=t.getAuthorisationURLWithQueryParamsAndSetState=t.thirdPartySignInAndUp=t.emailPasswordSignIn=t.emailPasswordSignUp=t.doesEmailExist=t.getStateAndOtherInfoFromStorage=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=n(8122),s=n(6984),u=n(5716),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return u.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return u.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getStateAndOtherInfoFromStorage=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignIn=function(e){return u.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getTenantIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.thirdPartySignInAndUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,a.getNormalisedUserContext)(e.userContext),n=u.default.getInstanceOrThrow(),[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,n.recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(r(r({tenantId:o},e),{userContext:t}))]}}))}))},e}();t.default=c;var l=c.init;t.init=l;var d=c.submitNewPassword;t.submitNewPassword=d;var f=c.sendPasswordResetEmail;t.sendPasswordResetEmail=f;var p=c.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=p;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.emailPasswordSignUp;t.emailPasswordSignUp=v;var I=c.emailPasswordSignIn;t.emailPasswordSignIn=I;var g=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=g;var y=c.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=y;var P=c.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=P;var m=c.getTenantIdFromURL;t.getTenantIdFromURL=m;var w=c.signOut;t.signOut=w},5716: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 a=n(7939),s=n(9102),u=n(3834),c=n(6333),l=n(1473),d=n(5367),f=n(5092),p=n(8122),h=function(e){function t(t,n){var r=e.call(this,(0,u.normaliseUserInput)(t))||this,o=new c.default((0,l.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook})).override(r.config.override.functions).build();return r.recipeImplementation=o,r.emailPasswordRecipe=void 0===n.emailPassword?new a.default({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,d.default)(o)}}}):n.emailPassword,r.thirdPartyRecipe=void 0===n.thirdParty?new s.default({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,f.default)(o)}}}):n.thirdParty,r}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyEmailPassword found. Ensure that the 'ThirdPartyEmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";throw e=(0,p.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r}),{emailPassword:void 0,thirdParty:void 0}),t.instance}},t.reset=function(){(0,p.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartyemailpassword",t}(n(7725).default);t.Recipe=h,t.default=h},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),getTenantIdFromURL:e.getTenantIdFromURL.bind(e)}}},1473: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(4071),a=n(3664),s=n(5367),u=n(5092);function c(e){var t=(0,i.default)(e),n=(0,a.default)(e);return{submitNewPassword:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.submitNewPassword.bind((0,s.default)(this))(e)]}))}))},sendPasswordResetEmail:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.sendPasswordResetEmail.bind((0,s.default)(this))(e)]}))}))},doesEmailExist:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.doesEmailExist.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignUp:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.signUp.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignIn:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){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 r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.getAuthorisationURLFromBackend.bind((0,u.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.signInAndUp.bind((0,u.default)(this))(e)]}))}))},getStateAndOtherInfoFromStorage:function(e){return n.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(e)},setStateAndOtherInfoToStorage:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(e)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(e)]}))}))},generateStateToSendToOAuthProvider:function(e){return n.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(e)},verifyAndGetStateOrThrowError:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(e)]}))}))},getAuthErrorFromURL:function(e){return n.getAuthErrorFromURL.bind((0,u.default)(this))(e)},getAuthStateFromURL:function(e){return n.getAuthStateFromURL.bind((0,u.default)(this))(e)},getTenantIdFromURL:function(e){return t.getTenantIdFromURL.bind((0,s.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),getAuthErrorFromURL:e.getAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3834: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})}},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(4442,e(e.s=4442));supertokensThirdPartyEmailPassword=t}]); | ||
"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,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 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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,u){return o(n,void 0,void 0,(function(){var n,o,c,l,d,f;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((d=i.sent()).status>=300)throw d;return void 0===u?[3,4]:(f=d.clone(),[4,u({requestInit:c,url:e,fetchResponse:f})]);case 3:i.sent(),i.label=4;case 4:return[2,d]}}))}))},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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},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 a=n(5110),s=n(4071),u=n(6333),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new u.default((0,s.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,clientType:r,appInfo:n})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of EmailPassword found. Ensure that the 'EmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";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.__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}),t.getRecipeImplementation=void 0;var a=n(634),s=n(6984),u=n(8122);function c(e){var t=new a.default(e.recipeId,e.appInfo);return{submitNewPassword:function(n){var s=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return n=this.getTenantIdFromURL({userContext:c}),o=this.getResetPasswordTokenFromURL({userContext:c}),[4,t.post(n,"/user/password/reset",{body:JSON.stringify({formFields:s,token:o,method:"token"})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SUBMIT_NEW_PASSWORD",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SUBMIT_NEW_PASSWORD",userContext:c}))];case 1:return l=i.sent(),d=l.jsonBody,f=l.fetchResponse,"FIELD_ERROR"===d.status?[2,{status:"FIELD_ERROR",formFields:d.formFields,fetchResponse:f}]:"RESET_PASSWORD_INVALID_TOKEN_ERROR"===d.status?[2,{status:d.status,fetchResponse:f}]:[2,r(r({},d),{fetchResponse:f})]}}))}))},sendPasswordResetEmail:function(n){var r=n.formFields,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return f=(d=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[i.sent(),"/user/password/reset/token",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"SEND_RESET_PASSWORD_EMAIL",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:l}]:"PASSWORD_RESET_NOT_ALLOWED"===o.status?[2,{status:o.status,reason:o.reason,fetchResponse:l}]:[2,{status:o.status,fetchResponse:l}]}}))}))},signUp:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,d,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,p.apply(f,[i.sent(),"/signup",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_UP",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,d=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:d}]:"SIGN_UP_NOT_ALLOWED"===o.status?[2,{status:"SIGN_UP_NOT_ALLOWED",reason:o.reason,fetchResponse:d}]:[2,{status:o.status,user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:d}]}}))}))},signIn:function(n){var r=n.formFields,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,d,f,p;return i(this,(function(i){switch(i.label){case 0:return p=(f=t).post,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:l})];case 1:return[4,p.apply(f,[i.sent(),"/signin",{body:JSON.stringify({formFields:r})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_PASSWORD_SIGN_IN",userContext:l})])];case 2:return n=i.sent(),o=n.jsonBody,d=n.fetchResponse,"FIELD_ERROR"===o.status?[2,{status:"FIELD_ERROR",formFields:o.formFields,fetchResponse:d}]:"WRONG_CREDENTIALS_ERROR"===o.status?[2,{status:"WRONG_CREDENTIALS_ERROR",fetchResponse:d}]:"SIGN_IN_NOT_ALLOWED"===o.status?[2,{status:"SIGN_IN_NOT_ALLOWED",reason:o.reason,fetchResponse:d}]:[2,{status:"OK",user:(0,u.normaliseUser)("emailpassword",o.user),fetchResponse:d}]}}))}))},doesEmailExist:function(n){var r=n.email,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l,d,f;return i(this,(function(i){switch(i.label){case 0:return f=(d=t).get,[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:c})];case 1:return[4,f.apply(d,[i.sent(),"/signup/email/exists",{},{email:r},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"EMAIL_EXISTS",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"EMAIL_EXISTS",userContext:c})])];case 2:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,{status:o.status,doesExist:o.exists,fetchResponse:l}]}}))}))},getResetPasswordTokenFromURL:function(){var e=(0,u.getQueryParams)("token");return void 0===e?"":e},getTenantIdFromURL:function(){return(0,u.getQueryParams)("tenantId")}}}t.default=c,t.getRecipeImplementation=c},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})}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},6984: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 a=n(4853),s=n(6333),u=n(1265),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Ensure that 'SuperTokens.init' method has been called.";throw e=(0,c.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.reset=function(){(0,c.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="multitenancy",t}(n(7725).default);t.Recipe=l,t.default=l},1265: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);function a(e){var t=new i.default(e.recipeId,e.appInfo);return{getTenantId:function(){},getLoginMethods:function(n){var a=n.tenantId,s=n.options,u=n.userContext;return r(this,void 0,void 0,(function(){var n,r,c,l,d;return o(this,(function(o){switch(o.label){case 0:return n={},void 0!==e.clientType&&(n.clientType=e.clientType),[4,t.get(a,"/loginmethods",{},n,i.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_LOGIN_METHODS",options:s,userContext:u}),i.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_LOGIN_METHODS",userContext:u}))];case 1:return r=o.sent(),c=r.jsonBody,l=r.fetchResponse,void 0===c.firstFactors?(d=[],c.emailPassword.enabled&&d.push("emailpassword"),c.thirdParty.enabled&&d.push("thirdparty"),c.passwordless.enabled&&(d.push("otp-email"),d.push("otp-phone"),d.push("link-email"),d.push("link-phone"))):d=c.firstFactors,[2,{status:"OK",thirdParty:{providers:c.thirdParty.providers},firstFactors:d,fetchResponse:l}]}}))}))}}}t.default=a,t.getRecipeImplementation=a},4853: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 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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),d=n(8122),f=[n(1199).EMAILVERIFICATION_CLAIM_ID],p=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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return f.includes(e.id)})),!0),n.filter((function(e){return!f.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=p,t.default=p},9102: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 a=n(4566),s=n(6333),u=n(3664),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdParty found. Ensure that the 'ThirdParty.init' method is called within the 'SuperTokens.init' recipeList.";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}(n(7725).default);t.Recipe=l,t.default=l},3664: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}),t.getRecipeImplementation=void 0;var a=n(634),s=n(8122),u=n(2173),c=n(7528);function l(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(n){switch(n.label){case 0:return t=JSON.stringify(r({},e.state)),[4,c.WindowHandlerReference.getReferenceOrThrow().windowHandler.sessionStorage.setItem("supertokens-oauth-state-2",t)];case 1:return n.sent(),[2]}}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return o(this,void 0,void 0,(function(){var t,n,r,o;return i(this,(function(i){switch(i.label){case 0:return[4,this.getAuthorisationURLFromBackend({thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,userContext:e.userContext,options:e.options})];case 1:return t=i.sent(),n=void 0!==e.redirectURIOnProviderDashboard&&e.frontendRedirectURI!==e.redirectURIOnProviderDashboard?e.frontendRedirectURI:void 0,r=this.generateStateToSendToOAuthProvider({frontendRedirectURI:n,userContext:e.userContext}),o=Date.now()+6e5,[4,this.setStateAndOtherInfoToStorage({state:{stateForAuthProvider:r,thirdPartyId:e.thirdPartyId,tenantId:e.tenantId,expiresAt:o,redirectURIOnProviderDashboard:e.redirectURIOnProviderDashboard||e.frontendRedirectURI,pkceCodeVerifier:t.pkceCodeVerifier},userContext:e.userContext})];case 2:return i.sent(),[2,(0,s.appendQueryParamsToURL)(t.urlWithQueryParams,{state:r})]}}))}))},getAuthorisationURLFromBackend:function(n){return o(this,void 0,void 0,(function(){var r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return r={thirdPartyId:n.thirdPartyId,redirectURIOnProviderDashboard:n.redirectURIOnProviderDashboard},void 0!==e.clientType&&(r.clientType=e.clientType),[4,t.get(n.tenantId,"/authorisationurl",{},r,a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"GET_AUTHORISATION_URL",options:n.options,userContext:n.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"GET_AUTHORISATION_URL",userContext:n.userContext}))];case 1:return o=i.sent(),s=o.jsonBody,u=o.fetchResponse,[2,{status:"OK",urlWithQueryParams:s.urlWithQueryParams,pkceCodeVerifier:s.pkceCodeVerifier,fetchResponse:u}]}}))}))},signInAndUp:function(n){return o(this,void 0,void 0,(function(){var o,c,l,d,f,p,h,v,I;return i(this,(function(i){switch(i.label){case 0:return o=this.getStateAndOtherInfoFromStorage({userContext:n.userContext}),c=this.getAuthStateFromURL({userContext:n.userContext}),[4,this.verifyAndGetStateOrThrowError({stateFromAuthProvider:c,stateObjectFromStorage:o,userContext:n.userContext})];case 1:if(l=i.sent(),void 0!==(d=this.getAuthErrorFromURL({userContext:n.userContext})))throw new Error("Auth provider responded with error: ".concat(d));return f=(0,s.getAllQueryParams)(),p=Object.fromEntries(f),[4,t.post(l.tenantId,"/signinup",{body:JSON.stringify({thirdPartyId:l.thirdPartyId,clientType:e.clientType,redirectURIInfo:{redirectURIOnProviderDashboard:l.redirectURIOnProviderDashboard,redirectURIQueryParams:p,pkceCodeVerifier:l.pkceCodeVerifier}})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",options:n.options,userContext:n.userContext}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"THIRD_PARTY_SIGN_IN_UP",userContext:n.userContext}))];case 2:if(h=i.sent(),v=h.jsonBody,I=h.fetchResponse,"FIELD_ERROR"===v.status)throw new u.default(v.error);return"OK"!==v.status?[2,r(r({},v),{fetchResponse:I})]:[2,r(r({status:"OK"},(0,s.normaliseUserResponse)("thirdparty",v)),{fetchResponse:I})]}}))}))},generateStateToSendToOAuthProvider:function(e){var t={state:"".concat(1e20).replace(/[018]/g,(function(e){return(parseInt(e)^crypto.getRandomValues(new Uint8Array(1))[0]&15>>parseInt(e)/4).toString(16)}))};return void 0!==e&&void 0!==e.frontendRedirectURI&&(t.frontendRedirectURI=e.frontendRedirectURI),btoa(JSON.stringify(t))},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]}))}))},getAuthErrorFromURL:function(){return(0,s.getQueryParams)("error")},getAuthStateFromURL:function(){var e=(0,s.getQueryParams)("state");return void 0===e?"":e}}}t.default=l,t.getRecipeImplementation=l},4566: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})}},4442: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}),t.getTenantIdFromURL=t.getResetPasswordTokenFromURL=t.signOut=t.getAuthorisationURLWithQueryParamsAndSetState=t.thirdPartySignInAndUp=t.emailPasswordSignIn=t.emailPasswordSignUp=t.doesEmailExist=t.getStateAndOtherInfoFromStorage=t.sendPasswordResetEmail=t.submitNewPassword=t.init=void 0;var a=n(8122),s=n(6984),u=n(5716),c=function(){function e(){}return e.init=function(e){return u.default.init(e)},e.signOut=function(e){return u.default.getInstanceOrThrow().signOut({userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)})},e.submitNewPassword=function(e){return u.default.getInstanceOrThrow().recipeImplementation.submitNewPassword(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.sendPasswordResetEmail=function(e){return u.default.getInstanceOrThrow().recipeImplementation.sendPasswordResetEmail(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getStateAndOtherInfoFromStorage=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getStateAndOtherInfoFromStorage(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.doesEmailExist=function(e){return u.default.getInstanceOrThrow().recipeImplementation.doesEmailExist(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.emailPasswordSignIn=function(e){return u.default.getInstanceOrThrow().recipeImplementation.emailPasswordSignIn(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(e.userContext)}))},e.getResetPasswordTokenFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getResetPasswordTokenFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getTenantIdFromURL=function(e){return u.default.getInstanceOrThrow().recipeImplementation.getTenantIdFromURL(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.thirdPartySignInAndUp=function(e){return u.default.getInstanceOrThrow().recipeImplementation.thirdPartySignInAndUp(r(r({},e),{userContext:(0,a.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.getAuthorisationURLWithQueryParamsAndSetState=function(e){return o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=(0,a.getNormalisedUserContext)(e.userContext),n=u.default.getInstanceOrThrow(),[4,s.default.getInstanceOrThrow().recipeImplementation.getTenantId({userContext:t})];case 1:return o=i.sent(),[2,n.recipeImplementation.getAuthorisationURLWithQueryParamsAndSetState(r(r({tenantId:o},e),{userContext:t}))]}}))}))},e}();t.default=c;var l=c.init;t.init=l;var d=c.submitNewPassword;t.submitNewPassword=d;var f=c.sendPasswordResetEmail;t.sendPasswordResetEmail=f;var p=c.getStateAndOtherInfoFromStorage;t.getStateAndOtherInfoFromStorage=p;var h=c.doesEmailExist;t.doesEmailExist=h;var v=c.emailPasswordSignUp;t.emailPasswordSignUp=v;var I=c.emailPasswordSignIn;t.emailPasswordSignIn=I;var g=c.thirdPartySignInAndUp;t.thirdPartySignInAndUp=g;var y=c.getAuthorisationURLWithQueryParamsAndSetState;t.getAuthorisationURLWithQueryParamsAndSetState=y;var P=c.getResetPasswordTokenFromURL;t.getResetPasswordTokenFromURL=P;var m=c.getTenantIdFromURL;t.getTenantIdFromURL=m;var w=c.signOut;t.signOut=w},5716: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 a=n(7939),s=n(9102),u=n(3834),c=n(6333),l=n(1473),d=n(5367),f=n(5092),p=n(8122),h=function(e){function t(t,n){var r=e.call(this,(0,u.normaliseUserInput)(t))||this,o=new c.default((0,l.default)({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:r.config.preAPIHook,postAPIHook:r.config.postAPIHook})).override(r.config.override.functions).build();return r.recipeImplementation=o,r.emailPasswordRecipe=void 0===n.emailPassword?new a.default({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,d.default)(o)}}}):n.emailPassword,r.thirdPartyRecipe=void 0===n.thirdParty?new s.default({recipeId:r.config.recipeId,appInfo:r.config.appInfo,clientType:r.config.clientType,preAPIHook:t.preAPIHook,postAPIHook:t.postAPIHook,override:{functions:function(){return(0,f.default)(o)}}}):n.thirdParty,r}return o(t,e),t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of ThirdPartyEmailPassword found. Ensure that the 'ThirdPartyEmailPassword.init' method is called within the 'SuperTokens.init' recipeList.";throw e=(0,p.checkForSSRErrorAndAppendIfNeeded)(e),Error(e)}return t.instance},t.init=function(e){return function(n,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r}),{emailPassword:void 0,thirdParty:void 0}),t.instance}},t.reset=function(){(0,p.isTest)()&&(t.instance=void 0)},t.RECIPE_ID="thirdpartyemailpassword",t}(n(7725).default);t.Recipe=h,t.default=h},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),getTenantIdFromURL:e.getTenantIdFromURL.bind(e)}}},1473: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(4071),a=n(3664),s=n(5367),u=n(5092);function c(e){var t=(0,i.default)(e),n=(0,a.default)(e);return{submitNewPassword:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.submitNewPassword.bind((0,s.default)(this))(e)]}))}))},sendPasswordResetEmail:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.sendPasswordResetEmail.bind((0,s.default)(this))(e)]}))}))},doesEmailExist:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.doesEmailExist.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignUp:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,t.signUp.bind((0,s.default)(this))(e)]}))}))},emailPasswordSignIn:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){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 r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.getAuthorisationURLFromBackend.bind((0,u.default)(this))(e)]}))}))},thirdPartySignInAndUp:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.signInAndUp.bind((0,u.default)(this))(e)]}))}))},getStateAndOtherInfoFromStorage:function(e){return n.getStateAndOtherInfoFromStorage.bind((0,u.default)(this))(e)},setStateAndOtherInfoToStorage:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.setStateAndOtherInfoToStorage.bind((0,u.default)(this))(e)]}))}))},getAuthorisationURLWithQueryParamsAndSetState:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.getAuthorisationURLWithQueryParamsAndSetState.bind((0,u.default)(this))(e)]}))}))},generateStateToSendToOAuthProvider:function(e){return n.generateStateToSendToOAuthProvider.bind((0,u.default)(this))(e)},verifyAndGetStateOrThrowError:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,n.verifyAndGetStateOrThrowError.bind((0,u.default)(this))(e)]}))}))},getAuthErrorFromURL:function(e){return n.getAuthErrorFromURL.bind((0,u.default)(this))(e)},getAuthStateFromURL:function(e){return n.getAuthStateFromURL.bind((0,u.default)(this))(e)},getTenantIdFromURL:function(e){return t.getTenantIdFromURL.bind((0,s.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),getAuthErrorFromURL:e.getAuthErrorFromURL.bind(e),getAuthStateFromURL:e.getAuthStateFromURL.bind(e),verifyAndGetStateOrThrowError:e.verifyAndGetStateOrThrowError.bind(e),signInAndUp:e.thirdPartySignInAndUp.bind(e)}}},3834: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})}},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(4442,e(e.s=4442));supertokensThirdPartyEmailPassword=t}]); |
@@ -1,1 +0,1 @@ | ||
"use strict";var supertokensTOTP;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[728],{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 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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,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: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]:(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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},5194: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.listDevices=t.removeDevice=t.verifyDevice=t.verifyCode=t.createDevice=t.init=void 0;var o=n(8122),i=n(9317),a=function(){function e(){}return e.init=function(e){return i.default.init(e)},e.createDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.createDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyCode=function(e){return i.default.getInstanceOrThrow().recipeImplementation.verifyCode(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.verifyDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.removeDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.removeDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.listDevices=function(e){return i.default.getInstanceOrThrow().recipeImplementation.listDevices(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=a;var s=a.init;t.init=s;var u=a.createDevice;t.createDevice=u;var c=a.verifyCode;t.verifyCode=c;var l=a.verifyDevice;t.verifyDevice=l;var f=a.removeDevice;t.removeDevice=f;var p=a.listDevices;t.listDevices=p},9317: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 a=n(1408),s=n(6333),u=n(2627),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Make sure to call the Multitenancy.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="totp",t}(n(7725).default);t.Recipe=l,t.default=l},2627: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}),t.getRecipeImplementation=void 0;var a=n(634);function s(e){var t=new a.default(e.recipeId,e.appInfo);return{createDevice:function(n){var s=n.deviceName,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device",{body:JSON.stringify({deviceName:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"CREATE_DEVICE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"CREATE_DEVICE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},verifyCode:function(n){var s=n.totp,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/verify",{body:JSON.stringify({totp:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_CODE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"VERIFY_CODE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},verifyDevice:function(n){var s=n.deviceName,u=n.totp,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device/verify",{body:JSON.stringify({deviceName:s,totp:u})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_DEVICE",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"VERIFY_DEVICE",userContext:l}))];case 1:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,[2,r(r({},o),{fetchResponse:f})]}}))}))},removeDevice:function(n){var s=n.deviceName,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device/remove",{body:JSON.stringify({deviceName:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"REMOVE_DEVICE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"REMOVE_DEVICE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},listDevices:function(n){var s=n.options,u=n.userContext;return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.get(void 0,"/totp/device/list",{},void 0,a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"LIST_DEVICES",options:s,userContext:u}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:u,action:"LIST_DEVICES"}))];case 1:return n=i.sent(),o=n.jsonBody,c=n.fetchResponse,[2,r(r({},o),{fetchResponse:c})]}}))}))}}}t.default=s,t.getRecipeImplementation=s},1408: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})}},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.0",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(5194,e(e.s=5194));supertokensTOTP=t}]); | ||
"use strict";var supertokensTOTP;(self.webpackChunksupertokens_web_js=self.webpackChunksupertokens_web_js||[]).push([[728],{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 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.recipeId=e,this.appInfo=t,this.get=function(e,t,a,s,u,c){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,t,s),r({method:"GET"},a),u,c)];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,u){return o(n,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:if(void 0===a.body)throw new Error("Post request must have a body");return[4,this.fetch(this.getFullUrl(e,t),r({method:"POST"},a),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,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,t),r({method:"DELETE"},a),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,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,t),r({method:"PUT"},a),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,a,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: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]:(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,r){var o=n.appInfo.apiBasePath.getAsStringDangerous();void 0!==e&&"public"!==e&&(o="".concat(o,"/").concat(e));var i=new a.default(t),s="".concat(n.appInfo.apiDomain.getAsStringDangerous()).concat(o).concat(i.getAsStringDangerous());return void 0===r?s:s+"?"+new URLSearchParams(r)},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]}}))}))}}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},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 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())}))},a=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 s=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 a(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}(s.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)}},1199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMAILVERIFICATION_CLAIM_ID=void 0,t.EMAILVERIFICATION_CLAIM_ID="st-ev"},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,clientType:e.clientType,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)},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])}}},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Recipe=void 0;var c=n(1996),l=n(1757),f=n(8122),p=[n(1199).EMAILVERIFICATION_CLAIM_ID],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.getAccessToken=function(e){return a(n,void 0,void 0,(function(){return s(this,(function(t){return[2,l.default.getAccessToken({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),{override:{functions:function(e,n){var r;return n.override((function(e){return i(i({},e),{getGlobalClaimValidators:function(t){var n=e.getGlobalClaimValidators(t);return u(u([],n.filter((function(e){return p.includes(e.id)})),!0),n.filter((function(e){return!p.includes(e.id)})),!0)}})})),(null===(r=t.override)||void 0===r?void 0:r.functions)&&n.override(t.override.functions),e}},preAPIHook:function(e){return a(n,void 0,void 0,(function(){var n,r;return s(this,(function(o){return(n=new Headers(e.requestInit.headers)).set("rid",t.recipeId),r=i(i({},e),{requestInit:i(i({},e.requestInit),{headers:n})}),void 0===t.preAPIHook?[2,r]:[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,o){return t.instance=new t(i(i({},e),{appInfo:n,recipeId:t.RECIPE_ID,enableDebugLogs:o})),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. Ensure that the 'Session.init' method is called within the 'SuperTokens.init' recipeList.";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}(c.default);t.Recipe=d,t.default=d},5194: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.listDevices=t.removeDevice=t.verifyDevice=t.verifyCode=t.createDevice=t.init=void 0;var o=n(8122),i=n(9317),a=function(){function e(){}return e.init=function(e){return i.default.init(e)},e.createDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.createDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyCode=function(e){return i.default.getInstanceOrThrow().recipeImplementation.verifyCode(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.verifyDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.verifyDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.removeDevice=function(e){return i.default.getInstanceOrThrow().recipeImplementation.removeDevice(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e.listDevices=function(e){return i.default.getInstanceOrThrow().recipeImplementation.listDevices(r(r({},e),{userContext:(0,o.getNormalisedUserContext)(null==e?void 0:e.userContext)}))},e}();t.default=a;var s=a.init;t.init=s;var u=a.createDevice;t.createDevice=u;var c=a.verifyCode;t.verifyCode=c;var l=a.verifyDevice;t.verifyDevice=l;var f=a.removeDevice;t.removeDevice=f;var p=a.listDevices;t.listDevices=p},9317: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 a=n(1408),s=n(6333),u=n(2627),c=n(8122),l=function(e){function t(t){var n=e.call(this,(0,a.normaliseUserInput)(t))||this,r=new s.default((0,u.default)({recipeId:n.config.recipeId,appInfo:n.config.appInfo,clientType:n.config.clientType,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,r){return t.instance=new t(i(i({},e),{recipeId:t.RECIPE_ID,appInfo:n,clientType:r})),t.instance}},t.getInstanceOrThrow=function(){if(void 0===t.instance){var e="No instance of Multitenancy found. Make sure to call the Multitenancy.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="totp",t}(n(7725).default);t.Recipe=l,t.default=l},2627: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}),t.getRecipeImplementation=void 0;var a=n(634);function s(e){var t=new a.default(e.recipeId,e.appInfo);return{createDevice:function(n){var s=n.deviceName,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device",{body:JSON.stringify({deviceName:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"CREATE_DEVICE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"CREATE_DEVICE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},verifyCode:function(n){var s=n.totp,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/verify",{body:JSON.stringify({totp:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_CODE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"VERIFY_CODE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},verifyDevice:function(n){var s=n.deviceName,u=n.totp,c=n.options,l=n.userContext;return o(this,void 0,void 0,(function(){var n,o,f;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device/verify",{body:JSON.stringify({deviceName:s,totp:u})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"VERIFY_DEVICE",options:c,userContext:l}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"VERIFY_DEVICE",userContext:l}))];case 1:return n=i.sent(),o=n.jsonBody,f=n.fetchResponse,[2,r(r({},o),{fetchResponse:f})]}}))}))},removeDevice:function(n){var s=n.deviceName,u=n.options,c=n.userContext;return o(this,void 0,void 0,(function(){var n,o,l;return i(this,(function(i){switch(i.label){case 0:return[4,t.post(void 0,"/totp/device/remove",{body:JSON.stringify({deviceName:s})},a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"REMOVE_DEVICE",options:u,userContext:c}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,action:"REMOVE_DEVICE",userContext:c}))];case 1:return n=i.sent(),o=n.jsonBody,l=n.fetchResponse,[2,r(r({},o),{fetchResponse:l})]}}))}))},listDevices:function(n){var s=n.options,u=n.userContext;return o(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.get(void 0,"/totp/device/list",{},void 0,a.default.preparePreAPIHook({recipePreAPIHook:e.preAPIHook,action:"LIST_DEVICES",options:s,userContext:u}),a.default.preparePostAPIHook({recipePostAPIHook:e.postAPIHook,userContext:u,action:"LIST_DEVICES"}))];case 1:return n=i.sent(),o=n.jsonBody,c=n.fetchResponse,[2,r(r({},o),{fetchResponse:c})]}}))}))}}}t.default=s,t.getRecipeImplementation=s},1408: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})}},8122:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normaliseUser=t.normaliseUserResponse=t.getGlobalClaimValidators=t.getHashFromLocation=t.getNormalisedUserContext=t.checkForSSRErrorAndAppendIfNeeded=t.getAllQueryParams=t.getQueryParams=t.isTest=t.normaliseInputAppInfoOrThrowError=t.appendQueryParamsToURL=void 0;var r=n(7528),o=n(7611),i=n(7992),a=n(1260),s=n(5811);function u(e,t){if("loginMethods"in t)return t;var n=void 0!==t.email?[t.email]:[],r=void 0!==t.phoneNumber?[t.phoneNumber]:[],o=void 0!==t.thirdParty?[t.thirdParty]:[];return{id:t.id,emails:n,phoneNumbers:r,thirdParty:o,isPrimaryUser:!1,tenantIds:t.tenantIds,timeJoined:t.timeJoined,loginMethods:[{recipeId:e,recipeUserId:t.id,timeJoined:t.timeJoined,tenantIds:t.tenantIds,email:t.email,phoneNumber:t.email}]}}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.getAllQueryParams=function(){return new URLSearchParams(r.WindowHandlerReference.getReferenceOrThrow().windowHandler.location.getSearch())},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)},t.getGlobalClaimValidators=function(e){var t=e.overrideGlobalClaimValidators,n=e.userContext;return(0,s.getGlobalClaimValidators)(t,n)},t.normaliseUserResponse=function(e,t){return"createdNewRecipeUser"in t?t:{createdNewRecipeUser:t.createdNewUser,user:u(e,t.user)}},t.normaliseUser=u},255:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="0.10.1",t.supported_fdi=["1.17","1.18","1.19"]},7528:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(9092);Object.defineProperty(t,"WindowHandlerReference",{enumerable:!0,get:function(){return r.WindowHandlerReference}})},4328:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobalClaimValidators=void 0;var r=n(2652),o=n(788),i=n(2582);t.getGlobalClaimValidators=function(e,t){var n=(0,r.getNormalisedUserContext)(t),a=i.default.getClaimValidatorsAddedByOtherRecipes(),s=o.default.recipeImpl.getGlobalClaimValidators({claimValidatorsAddedByOtherRecipes:a,userContext:n});return void 0!==e?e(s,n):s}},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})},5811:(e,t,n)=>{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(4328))},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=(5194,e(e.s=5194));supertokensTOTP=t}]); |
@@ -10,2 +10,8 @@ # Changelog | ||
## [0.10.1] - 2024-04-08 | ||
#### Fixes | ||
- Reduced the number of unnecessary email verification checks by fixing the default values for `refetchTimeOnFalseInSeconds` and `maxAgeInSeconds` | ||
## [0.10.0] - 2024-03-03 | ||
@@ -12,0 +18,0 @@ |
@@ -221,7 +221,7 @@ "use strict"; | ||
? maxAgeInSeconds | ||
: getThresholdAwareDefaultValue(10); | ||
: getThresholdAwareDefaultValue(300); | ||
refetchTimeOnFalseInSeconds = | ||
refetchTimeOnFalseInSeconds !== null && refetchTimeOnFalseInSeconds !== void 0 | ||
? refetchTimeOnFalseInSeconds | ||
: getThresholdAwareDefaultValue(300); | ||
: getThresholdAwareDefaultValue(10); | ||
if (maxAgeInSeconds < DateProvider.getThresholdInSeconds()) { | ||
@@ -228,0 +228,0 @@ throw new Error( |
@@ -1,2 +0,2 @@ | ||
export declare const package_version = "0.10.0"; | ||
export declare const package_version = "0.10.1"; | ||
export declare const supported_fdi: string[]; |
@@ -18,3 +18,3 @@ "use strict"; | ||
*/ | ||
exports.package_version = "0.10.0"; | ||
exports.package_version = "0.10.1"; | ||
exports.supported_fdi = ["1.17", "1.18", "1.19"]; |
{ | ||
"name": "supertokens-web-js", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "SuperTokens SDK for vanilla JS for all recipes", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1350862