@saasquatch/mint-components 1.10.3-1 → 1.10.4-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{r as e,h as i}from"./p-64c3217a.js";import{k as o,f as a,n as t}from"./p-fd2c5407.js";import{Q as r,j as s,$ as n,b as l,i as d}from"./p-a8f7cb95.js";import{c}from"./p-c1086930.js";import"./p-02be1a88.js";import"./p-cef45012.js";import{s as v,g as u}from"./p-9ec99ced.js";import"./p-5d0c9424.js";import{P as f}from"./p-c8610d0c.js";let m=null;const p=class{constructor(i){e(this,i),this.ignored=!0,this.nextPage="/",this.failedPage="/",this.verifyEmailText="Verify your email",this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.",this.verifyInvalidText="The email verification code is invalid or has expired, please try again.",this.continueText="Continue",this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.",t(this)}disconnectedCallback(){}render(){const{states:e,data:t,callbacks:p,content:h}=d()?(y=u(this),c({states:{error:"",loading:!1,verified:!0},data:{oobCode:"code"},callbacks:{failed:()=>{console.log("failed")},gotoNextPage:()=>{}},content:{verifySuccessText:y.verifySuccessText,verifyEmailText:y.verifyEmailText,verifyInvalidText:y.verifyInvalidText,continueText:y.continueText}},y.demoData||{},{arrayMerge:(e,i)=>i})):function({nextPage:e,failedPage:i,verifySuccessText:t,verifyEmailText:d,verifyInvalidText:c,networkErrorMessage:u,continueText:f}){var p,h,y,g,x,b,T,j,P,k;const[C,E]=o(!1),[w,I]=o(!1),S=r(),[_,{loading:M,data:N,errors:q}]=s(),A=new URLSearchParams(n.location.search),L=A.get("oobCode"),R=A.get("email"),U=A.get("nextPage"),V=void 0===N&&void 0===q&&!!L,Y=!!((null===(p=null==S?void 0:S.managedIdentity)||void 0===p?void 0:p.emailVerified)||(null===(h=null==N?void 0:N.verifyManagedIdentityEmail)||void 0===h?void 0:h.success)||w),$=(null===(y=null==S?void 0:S.managedIdentity)||void 0===y?void 0:y.email)===R,z=()=>{A.delete("nextPage");const i=v(U||e);n.push(i.href)};return a((()=>{(async()=>{m||(m=_({oobCode:L}));const e=await m;e instanceof Error||!e.verifyManagedIdentityEmail.success||I(!0),E(!0)})()}),[]),a((()=>{C&&(Y&&$?setTimeout(z,3e3):setTimeout((()=>{l(void 0),z()}),3e3))}),[C,Y]),{states:{loading:M||!C,disableContinue:V,error:(null===(T=null===(b=null===(x=null===(g=null==q?void 0:q.response)||void 0===g?void 0:g.errors)||void 0===x?void 0:x[0])||void 0===b?void 0:b.extensions)||void 0===T?void 0:T.message)||(null===(k=null===(P=null===(j=null==q?void 0:q.response)||void 0===j?void 0:j.errors)||void 0===P?void 0:P[0])||void 0===k?void 0:k.message)||((null==q?void 0:q.message)||!$)&&u,success:C&&(Y||$),verified:Y},data:{oobCode:L},callbacks:{failed:()=>n.push({pathname:i,search:A.toString()&&"?"+A.toString()}),gotoNextPage:z},content:{verifySuccessText:t,verifyEmailText:d,verifyInvalidText:c,continueText:f}}}(u(this));var y;return i(f,{states:e,data:t,callbacks:p,content:h})}};export{p as sqm_portal_verify_email}