@qratilabs/qrati-connect 2.0.0 → 2.2.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +474 -617
  2. package/README.md +19 -23
  3. package/element/{AuthLayout-4cQy1mdD.js → AuthLayout-CyO9f3yS.js} +1 -1
  4. package/element/ContentsPage-DTXin7QX.js +16 -0
  5. package/element/CuratePage-Da329OuY.js +1 -0
  6. package/element/{Dialog-tlCUbTDz.js → Dialog-DUE33ABe.js} +1 -1
  7. package/element/{DotLottiePlayer-Bn1qmQOv.js → DotLottiePlayer-8MlLiMyZ.js} +1 -1
  8. package/element/{EventHeaderAdminButtons-BkQKOgQe.js → EventHeaderAdminButtons-ZWRtXY11.js} +1 -1
  9. package/element/{FolderBreadcrumb-k6xX9GO0.js → FolderBreadcrumb-CEs6rjY8.js} +1 -1
  10. package/element/{ForgotPasswordPage-5MSixvyz.js → ForgotPasswordPage-DcrSZb4Y.js} +1 -1
  11. package/element/{InputField-BoykWQKB.js → InputField-C89vrW2H.js} +1 -1
  12. package/element/{LazyLoadImage-D708Su5P.js → LazyLoadImage-CCgs8tnO.js} +1 -1
  13. package/element/LeaderboardPage-CTDNDeXw.js +1 -0
  14. package/element/{LoginPage-2L0Nuvin.js → LoginPage-smlCb8hl.js} +1 -1
  15. package/element/{NCMVHL6D-yoCKe8ct.js → NCMVHL6D-mctK8Nwg.js} +1 -1
  16. package/element/{PublicEvents-BdeCqgPZ.js → PublicEvents-D2zm99Nv.js} +1 -1
  17. package/element/{RegisterPage-DMsMeUof.js → RegisterPage-B6iFPEOf.js} +1 -1
  18. package/element/{SocialLoginButton-qk-MY7em.js → SocialLoginButton-Bmw5w2Wo.js} +1 -1
  19. package/element/{UploadPage-CZUVc8kB.js → UploadPage-CeUd2Ngw.js} +1 -1
  20. package/element/{VideoPlayer-BT17hBMS.js → VideoPlayer-D3O9yQy5.js} +1 -1
  21. package/element/element.es.js +1 -1
  22. package/element/{heic2any-BQWUOfBR.js → heic2any-ChkiLE0t.js} +1 -1
  23. package/element/{index-BZcFrhzQ.js → index-Dc66pO4G.js} +1 -1
  24. package/element/{index-DNJlz80z.js → index-eZDSy_OJ.js} +3 -3
  25. package/element/{index.esm-BggMyH0D.js → index.esm-fgGipFtS.js} +1 -1
  26. package/element/{photoswipe-DmjIC4PN.js → photoswipe-CqOSmPl3.js} +1 -1
  27. package/element/styles.css +1 -1
  28. package/element/{tslib.es6-BLNHjh5A.js → tslib.es6-CrRFG_pJ.js} +1 -1
  29. package/element/{useOrgAccess-B44Mf6ac.js → useOrgAccess-DwChBdHT.js} +1 -1
  30. package/element/web.es.js +1 -1
  31. package/package.json +1 -1
  32. package/react/{BAYb6fnT.js → 01YpbkrK.js} +1 -1
  33. package/react/{BAE8xft-.js → 3-7xITP8.js} +1 -1
  34. package/react/{BmCY907J.js → B-6zXxDr.js} +1 -1
  35. package/react/{Baa_9kjk.js → BC4qG4vp.js} +1 -1
  36. package/react/BG98DA1v.js +16 -0
  37. package/react/{Bif_3AVc.js → Bhx5l06G.js} +1 -1
  38. package/react/{CoJ8gDSW.js → C9K7NHY-.js} +1 -1
  39. package/react/{DfHcM_ha.js → CQ_GAdf6.js} +1 -1
  40. package/react/{C4kVnfZ8.js → CwHDgEUw.js} +1 -1
  41. package/react/{CKrTAQni.js → Cwug7XlJ.js} +1 -1
  42. package/react/{B2_6-tNW.js → Cy0hl_vl.js} +1 -1
  43. package/react/{c1q53V4Z.js → D9rAIIEm.js} +1 -1
  44. package/react/{FbLadgve.js → DBT304mv.js} +1 -1
  45. package/react/{CzlrzFMj.js → DDDUG6Th.js} +1 -1
  46. package/react/{ht6gpEra.js → DGbDKxZM.js} +1 -1
  47. package/react/{D6oeiPFE.js → DGrws0Ed.js} +1 -1
  48. package/react/{C-9ti-8O.js → DOyHX7jh.js} +1 -1
  49. package/react/{B9gK2pCi.js → DR9E1aMG.js} +3 -3
  50. package/react/DgG5NhsB.js +1 -0
  51. package/react/{D-xnMYoW.js → DlRtYLod.js} +1 -1
  52. package/react/DtITAxUS.js +1 -0
  53. package/react/{DNUABsUN.js → HRRHpVRs.js} +1 -1
  54. package/react/{B8-MmXCH.js → YK1PgWHO.js} +1 -1
  55. package/react/index.es.js +2 -2
  56. package/umd/web.umd.js +43 -43
  57. package/element/ContentsPage-DbUFI6uS.js +0 -16
  58. package/element/CuratePage-BAEOsYip.js +0 -1
  59. package/element/LeaderboardPage-Y1heQYpw.js +0 -1
  60. package/react/Bo3ykSiZ.js +0 -1
  61. package/react/Bs0qJUPj.js +0 -1
  62. package/react/BwBdsDzv.js +0 -16
@@ -1 +1 @@
1
- import{j as e,u as r,T as o,J as n,k as a,i as t,a4 as s,P as l}from"./B9gK2pCi.js";import i,{useState as c}from"react";import{I as d}from"./B8-MmXCH.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./HhCRmfOk.js";const v=({count:r=1,currentStep:o=0,disabled:n,onStepClick:a})=>{const t=n||!a;return e.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:r}).map((r,n)=>e.jsx("li",{children:n<o?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:t,onClick:()=>a&&a(n)}):n===o?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:t,onClick:()=>a&&a(n),children:[e.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:e.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),e.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):e.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:t,onClick:()=>a&&a(n)})},`progress-dot-${n}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:s})=>{const[l,i]=c(!1),[f,h]=c(null),{props:{organizationId:g}}=r(),{control:v,handleSubmit:x,formState:{errors:y}}=u({mode:"onSubmit",defaultValues:q,resolver:m(w)});return e.jsxs("div",{className:"w-full space-y-6",children:[e.jsx(o,{variant:"h5",align:"center",children:"Reset password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-4 qc:lg:space-y-8",onSubmit:x(async e=>{h(null),i(!0);try{await a.post(t.SEND_PASSWORD_RESET_CODE,{json:{email:e.email?.toLowerCase()},headers:{"x-org-id":g}}),s(e.email.toLowerCase())}catch(e){console.error("Error sending verification code:",e),h(e.message||e||"An error occurred while sending the code. Please try again.")}i(!1)}),children:[e.jsx(p,{name:"email",control:v,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Email",disabled:l,type:"email",value:r,onChange:o,onBlur:n,error:y.email?.message})}),e.jsx(n,{fullWidth:!0,type:"submit",loading:l,children:"Send verification code"})]}),f&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:f})]})};var y=function(e){return"object"==typeof e&&null!==e},b=function(e){var r=e.value,o=void 0===r?"":r,n=e.numInputs,a=void 0===n?4:n,t=e.onChange,s=e.onPaste,l=e.renderInput,c=e.shouldAutoFocus,d=void 0!==c&&c,u=e.inputType,m=void 0===u?"text":u,f=e.renderSeparator,p=e.placeholder,h=e.containerStyle,g=e.inputStyle,v=e.skipDefaultStyles,q=void 0!==v&&v,w=i.useState(0),x=w[0],b=w[1],j=i.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;i.useEffect(function(){j.current=j.current.slice(0,a)},[a]),i.useEffect(function(){var e;d&&(null===(e=j.current[0])||void 0===e||e.focus())},[d]);var P=function(){if("string"==typeof p){if(p.length===a)return p;p.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},N=function(e){return(C?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},D=function(e){var r=e.target.value;N(r)&&(R(r),I(x+1))},E=function(e){var r=e.nativeEvent,o=e.target.value;if(!N(o)){if(o.length===a)o.split("").some(function(e){return!N(e)})||(O(o.split("")),I(a-1));null===r.data&&"deleteContentBackward"===r.inputType&&(e.preventDefault(),R(""),I(x-1)),e.target.value=""}},k=function(){b(x-1)},A=function(e){var r=S();[e.code,e.key].includes("Backspace")?(e.preventDefault(),R(""),I(x-1)):"Delete"===e.code?(e.preventDefault(),R("")):"ArrowLeft"===e.code?(e.preventDefault(),I(x-1)):"ArrowRight"===e.code||e.key===r[x]?(e.preventDefault(),I(x+1)):("Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()},I=function(e){var r,o,n=Math.max(Math.min(a-1,e),0);j.current[n]&&(null===(r=j.current[n])||void 0===r||r.focus(),null===(o=j.current[n])||void 0===o||o.select(),b(n))},R=function(e){var r=S();r[x]=e[0],O(r)},O=function(e){var r=e.join("");t(r)},B=function(e){var r;e.preventDefault();var o=S(),n=x,t=e.clipboardData.getData("text/plain").slice(0,a-x).split("");if(!C||!t.some(function(e){return isNaN(Number(e))})){for(var s=0;s<a;++s)s>=x&&t.length>0&&(o[s]=null!==(r=t.shift())&&void 0!==r?r:"",n++);I(n),O(o)}};return i.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},y(h)&&h),className:"string"==typeof h?h:void 0,onPaste:s},Array.from({length:a},function(e,r){return r}).map(function(e){var r,o,n;return i.createElement(i.Fragment,{key:e},l({value:null!==(r=S()[e])&&void 0!==r?r:"",placeholder:null!==(n=null===(o=P())||void 0===o?void 0:o[e])&&void 0!==n?n:void 0,ref:function(r){return j.current[e]=r},onChange:D,onFocus:function(r){return function(e){return function(r){b(r),e.target.select()}}(r)(e)},onBlur:k,onKeyDown:A,onPaste:B,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(q?{}:{width:"1em",textAlign:"center"},y(g)?g:{}),className:"string"==typeof g?g:void 0,type:m,inputMode:C?"numeric":"text",onInput:E},e),e<a-1&&("function"==typeof f?f(e):f))}))};const j={code:""},S=f().shape({code:h().required("Please enter the code")}),C=({email:s,onCodeVerified:l})=>{const{props:{organizationId:i}}=r(),[d,f]=c(!1),[h,g]=c(null),{control:v,handleSubmit:q,watch:w}=u({mode:"onSubmit",defaultValues:j,resolver:m(S)});return e.jsxs("div",{className:"qc:space-y-4 qc:lg:space-y-8",children:[e.jsxs(o,{variant:"h5",align:"center",children:["Enter the code sent to ",e.jsx("span",{className:"qc:text-primary qc:font-medium",children:s})]}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:flex qc:w-full qc:flex-col qc:items-center qc:gap-4 qc:lg:gap-8",onSubmit:q(async e=>{g(null),f(!0);try{await a.post(t.VERIFY_PASSWORD_RESET_CODE,{json:{email:s,code:e.code},headers:{"x-org-id":i}}),l&&l()}catch(e){console.error(e.message),g("An error occurred while verifying the code. Please try again.")}f(!1)}),children:[e.jsx(p,{name:"code",control:v,render:({field:{value:r,onChange:o}})=>e.jsx(b,{value:r,onChange:o,numInputs:6,shouldAutoFocus:!0,inputType:"number",isInputNum:!0,containerStyle:"qc:flex qc:gap-4",inputStyle:"qc:rounded qc:border focus:qc:border-primary qc:text-foreground qc:bg-white disabled:qc:border-border disabled:qc:text-gray-400 otp-input qc:text-xl focus:qc:outline-none focus:qc:ring-0 focus:qc:boder-none",renderInput:r=>e.jsx("input",{...r})})}),e.jsx(n,{fullWidth:!0,type:"submit",disabled:w("code").length<6,loading:d,children:"Submit"})]}),h&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:h})]})},P={password:"",confirmPassword:""},N=f().shape({password:h().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:h().required("Please confirm your password").min(8,"Min password length is 8").oneOf([g("password"),null],"Passwords do not match")}),D=({email:s,onPasswordReset:l})=>{const{props:{organizationId:i}}=r(),[f,h]=c({showPassword:!1,showConfirmPassword:!1}),[g,v]=c(!1),[q,w]=c(null),{control:x,handleSubmit:y,formState:{errors:b}}=u({defaultValues:P,mode:"onSubmit",resolver:m(N)});return e.jsxs("div",{className:"qc:w-full qc:space-y-4",children:[e.jsx(o,{variant:"h5",align:"center",children:"Set new password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-8",onSubmit:y(async e=>{w(null),v(!0);try{const r=await a.post(t.RESET_PASSWORD,{json:{email:s.toLowerCase(),password:e.password},headers:{"x-org-id":i}});r.error?w(r.error):l()}catch{w("An error occurred while resetting the password. Please try again.")}v(!1)}),children:[e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"password",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"New password",disabled:g,type:f.showPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.password?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-4 qc:top-7",icon:f.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showPassword:!f.showPassword})})]}),e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"confirmPassword",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Confirm new password",disabled:g,type:f.showConfirmPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.confirmPassword?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-4 qc:top-7",icon:f.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showConfirmPassword:!f.showConfirmPassword})})]}),e.jsx(n,{fullWidth:!0,type:"submit",color:"brand",loading:g,children:"Reset password"})]}),q&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:q})]})},E=()=>{const r=s(),[o,n]=c(null),[a,t]=c(0);return e.jsxs("div",{className:"space-y-9",children:[(({index:a})=>{switch(a){case 0:return e.jsx(x,{onCodeSent:e=>{n(e),t(1)}});case 1:return e.jsx(C,{email:o,onCodeVerified:()=>t(2)});case 2:return e.jsx(D,{email:o,onPasswordReset:()=>{r(l.LOGIN)}})}})({index:a}),e.jsx("div",{className:"qc:mt-8 qc:flex qc:justify-center",children:e.jsx(v,{count:3,currentStep:a})})]})};export{E as default};
1
+ import{j as e,u as r,T as o,J as n,k as a,i as t,a4 as s,P as l}from"./DR9E1aMG.js";import i,{useState as c}from"react";import{I as d}from"./YK1PgWHO.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./HhCRmfOk.js";const v=({count:r=1,currentStep:o=0,disabled:n,onStepClick:a})=>{const t=n||!a;return e.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:r}).map((r,n)=>e.jsx("li",{children:n<o?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:t,onClick:()=>a&&a(n)}):n===o?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:t,onClick:()=>a&&a(n),children:[e.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:e.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),e.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):e.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:t,onClick:()=>a&&a(n)})},`progress-dot-${n}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:s})=>{const[l,i]=c(!1),[f,h]=c(null),{props:{organizationId:g}}=r(),{control:v,handleSubmit:x,formState:{errors:y}}=u({mode:"onSubmit",defaultValues:q,resolver:m(w)});return e.jsxs("div",{className:"w-full space-y-6",children:[e.jsx(o,{variant:"h5",align:"center",children:"Reset password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-4 qc:lg:space-y-8",onSubmit:x(async e=>{h(null),i(!0);try{await a.post(t.SEND_PASSWORD_RESET_CODE,{json:{email:e.email?.toLowerCase()},headers:{"x-org-id":g}}),s(e.email.toLowerCase())}catch(e){console.error("Error sending verification code:",e),h(e.message||e||"An error occurred while sending the code. Please try again.")}i(!1)}),children:[e.jsx(p,{name:"email",control:v,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Email",disabled:l,type:"email",value:r,onChange:o,onBlur:n,error:y.email?.message})}),e.jsx(n,{fullWidth:!0,type:"submit",loading:l,children:"Send verification code"})]}),f&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:f})]})};var y=function(e){return"object"==typeof e&&null!==e},b=function(e){var r=e.value,o=void 0===r?"":r,n=e.numInputs,a=void 0===n?4:n,t=e.onChange,s=e.onPaste,l=e.renderInput,c=e.shouldAutoFocus,d=void 0!==c&&c,u=e.inputType,m=void 0===u?"text":u,f=e.renderSeparator,p=e.placeholder,h=e.containerStyle,g=e.inputStyle,v=e.skipDefaultStyles,q=void 0!==v&&v,w=i.useState(0),x=w[0],b=w[1],j=i.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;i.useEffect(function(){j.current=j.current.slice(0,a)},[a]),i.useEffect(function(){var e;d&&(null===(e=j.current[0])||void 0===e||e.focus())},[d]);var P=function(){if("string"==typeof p){if(p.length===a)return p;p.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},N=function(e){return(C?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},D=function(e){var r=e.target.value;N(r)&&(R(r),I(x+1))},E=function(e){var r=e.nativeEvent,o=e.target.value;if(!N(o)){if(o.length===a)o.split("").some(function(e){return!N(e)})||(O(o.split("")),I(a-1));null===r.data&&"deleteContentBackward"===r.inputType&&(e.preventDefault(),R(""),I(x-1)),e.target.value=""}},k=function(){b(x-1)},A=function(e){var r=S();[e.code,e.key].includes("Backspace")?(e.preventDefault(),R(""),I(x-1)):"Delete"===e.code?(e.preventDefault(),R("")):"ArrowLeft"===e.code?(e.preventDefault(),I(x-1)):"ArrowRight"===e.code||e.key===r[x]?(e.preventDefault(),I(x+1)):("Spacebar"===e.code||"Space"===e.code||"ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()},I=function(e){var r,o,n=Math.max(Math.min(a-1,e),0);j.current[n]&&(null===(r=j.current[n])||void 0===r||r.focus(),null===(o=j.current[n])||void 0===o||o.select(),b(n))},R=function(e){var r=S();r[x]=e[0],O(r)},O=function(e){var r=e.join("");t(r)},B=function(e){var r;e.preventDefault();var o=S(),n=x,t=e.clipboardData.getData("text/plain").slice(0,a-x).split("");if(!C||!t.some(function(e){return isNaN(Number(e))})){for(var s=0;s<a;++s)s>=x&&t.length>0&&(o[s]=null!==(r=t.shift())&&void 0!==r?r:"",n++);I(n),O(o)}};return i.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},y(h)&&h),className:"string"==typeof h?h:void 0,onPaste:s},Array.from({length:a},function(e,r){return r}).map(function(e){var r,o,n;return i.createElement(i.Fragment,{key:e},l({value:null!==(r=S()[e])&&void 0!==r?r:"",placeholder:null!==(n=null===(o=P())||void 0===o?void 0:o[e])&&void 0!==n?n:void 0,ref:function(r){return j.current[e]=r},onChange:D,onFocus:function(r){return function(e){return function(r){b(r),e.target.select()}}(r)(e)},onBlur:k,onKeyDown:A,onPaste:B,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(q?{}:{width:"1em",textAlign:"center"},y(g)?g:{}),className:"string"==typeof g?g:void 0,type:m,inputMode:C?"numeric":"text",onInput:E},e),e<a-1&&("function"==typeof f?f(e):f))}))};const j={code:""},S=f().shape({code:h().required("Please enter the code")}),C=({email:s,onCodeVerified:l})=>{const{props:{organizationId:i}}=r(),[d,f]=c(!1),[h,g]=c(null),{control:v,handleSubmit:q,watch:w}=u({mode:"onSubmit",defaultValues:j,resolver:m(S)});return e.jsxs("div",{className:"qc:space-y-4 qc:lg:space-y-8",children:[e.jsxs(o,{variant:"h5",align:"center",children:["Enter the code sent to ",e.jsx("span",{className:"qc:text-primary qc:font-medium",children:s})]}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:flex qc:w-full qc:flex-col qc:items-center qc:gap-4 qc:lg:gap-8",onSubmit:q(async e=>{g(null),f(!0);try{await a.post(t.VERIFY_PASSWORD_RESET_CODE,{json:{email:s,code:e.code},headers:{"x-org-id":i}}),l&&l()}catch(e){console.error(e.message),g("An error occurred while verifying the code. Please try again.")}f(!1)}),children:[e.jsx(p,{name:"code",control:v,render:({field:{value:r,onChange:o}})=>e.jsx(b,{value:r,onChange:o,numInputs:6,shouldAutoFocus:!0,inputType:"number",isInputNum:!0,containerStyle:"qc:flex qc:gap-4",inputStyle:"qc:rounded qc:border focus:qc:border-primary qc:text-foreground qc:bg-white disabled:qc:border-border disabled:qc:text-gray-400 otp-input qc:text-xl focus:qc:outline-none focus:qc:ring-0 focus:qc:boder-none",renderInput:r=>e.jsx("input",{...r})})}),e.jsx(n,{fullWidth:!0,type:"submit",disabled:w("code").length<6,loading:d,children:"Submit"})]}),h&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:h})]})},P={password:"",confirmPassword:""},N=f().shape({password:h().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:h().required("Please confirm your password").min(8,"Min password length is 8").oneOf([g("password"),null],"Passwords do not match")}),D=({email:s,onPasswordReset:l})=>{const{props:{organizationId:i}}=r(),[f,h]=c({showPassword:!1,showConfirmPassword:!1}),[g,v]=c(!1),[q,w]=c(null),{control:x,handleSubmit:y,formState:{errors:b}}=u({defaultValues:P,mode:"onSubmit",resolver:m(N)});return e.jsxs("div",{className:"qc:w-full qc:space-y-4",children:[e.jsx(o,{variant:"h5",align:"center",children:"Set new password"}),e.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-8",onSubmit:y(async e=>{w(null),v(!0);try{const r=await a.post(t.RESET_PASSWORD,{json:{email:s.toLowerCase(),password:e.password},headers:{"x-org-id":i}});r.error?w(r.error):l()}catch{w("An error occurred while resetting the password. Please try again.")}v(!1)}),children:[e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"password",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"New password",disabled:g,type:f.showPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.password?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-4 qc:top-7",icon:f.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showPassword:!f.showPassword})})]}),e.jsxs("div",{className:"qc:relative",children:[e.jsx(p,{name:"confirmPassword",control:x,render:({field:{value:r,onChange:o,onBlur:n}})=>e.jsx(d,{label:"Confirm new password",disabled:g,type:f.showConfirmPassword?"text":"password",value:r,onChange:o,onBlur:n,error:b.confirmPassword?.message})}),e.jsx(n,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-4 qc:top-7",icon:f.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>h({...f,showConfirmPassword:!f.showConfirmPassword})})]}),e.jsx(n,{fullWidth:!0,type:"submit",color:"primary",loading:g,children:"Reset password"})]}),q&&e.jsx(o,{variant:"h3",align:"center",color:"color",children:q})]})},E=()=>{const r=s(),[o,n]=c(null),[a,t]=c(0);return e.jsxs("div",{className:"space-y-9",children:[(({index:a})=>{switch(a){case 0:return e.jsx(x,{onCodeSent:e=>{n(e),t(1)}});case 1:return e.jsx(C,{email:o,onCodeVerified:()=>t(2)});case 2:return e.jsx(D,{email:o,onPasswordReset:()=>{r(l.LOGIN)}})}})({index:a}),e.jsx("div",{className:"qc:mt-8 qc:flex qc:justify-center",children:e.jsx(v,{count:3,currentStep:a})})]})};export{E as default};
@@ -1 +1 @@
1
- import{u as e,j as s,J as a,T as r,g as o,P as l}from"./B9gK2pCi.js";import{useState as i}from"react";import{I as n}from"./B8-MmXCH.js";import{S as d}from"./BAYb6fnT.js";import{u as t,C as c,o as m,c as u,a as g,b as p}from"./HhCRmfOk.js";const h={fname:"",lname:"",email:"",password:"",confirmPassword:""},w=u().shape({fname:g().required("First name is required"),lname:g().required("Last name is required"),email:g().required("Please enter your Email").email("Enter a valid Email"),password:g().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:g().required("Please confirm your password").oneOf([p("password"),null],"Passwords do not match")}),f=()=>{const[u,g]=i(null),[p,f]=i(!1),[j,x]=i({google:!1,apple:!1}),[q,v]=i({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:y,loginWithGoogle:C,loginWithApple:b}=e(),P=async(e,s)=>{x(s=>({...s,[e]:!0})),g(null);try{await s()}catch(s){g(s.message||`Failed to sign up with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{x(s=>({...s,[e]:!1}))}},{control:N,handleSubmit:B,formState:{errors:S}}=t({defaultValues:h,mode:"onSubmit",resolver:m(w)});return s.jsxs("div",{className:"qc:w-full qc:space-y-8",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:B(async e=>{const{email:s,password:a,fname:r,lname:o}=e;f(!0);try{const e=await y(s.toLowerCase(),a,r,o);e?.error&&g(e.error)}catch(e){g(e)}finally{f(!1)}}),className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(c,{name:"fname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"First name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.fname?.message})}),s.jsx(c,{name:"lname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Last name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.lname?.message})})]}),s.jsx(c,{name:"email",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Email",disabled:p,type:"email",value:e,onChange:a,onBlur:r,error:S.email?.message})}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"password",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Password",disabled:p,type:q.showPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.password?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-5 qc:top-7",icon:q.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showPassword:!q.showPassword})})]}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(c,{name:"confirmPassword",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Confirm password",disabled:p,type:q.showConfirmPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.confirmPassword?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-5 qc:top-7",icon:q.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showConfirmPassword:!q.showConfirmPassword})})]}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(o,{to:l.FORGOT_PASSWORD,state:location?.state,children:s.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(a,{type:"submit",color:"brand",className:"qc:w-full",disabled:p,loading:p,children:"Register"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[s.jsx(d,{disabled:p||j.google||j.apple,loading:j.google,onClick:()=>P("google",C),provider:"google"}),s.jsx(d,{disabled:p||j.google||j.apple,loading:j.apple,onClick:()=>P("apple",b),provider:"apple"})]})]})};export{f as default};
1
+ import{u as e,j as s,J as a,T as r,g as o,P as l}from"./DR9E1aMG.js";import{useState as i}from"react";import{I as n}from"./YK1PgWHO.js";import{S as d}from"./01YpbkrK.js";import{u as t,C as m,o as c,c as u,a as g,b as p}from"./HhCRmfOk.js";const h={fname:"",lname:"",email:"",password:"",confirmPassword:""},w=u().shape({fname:g().required("First name is required"),lname:g().required("Last name is required"),email:g().required("Please enter your Email").email("Enter a valid Email"),password:g().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:g().required("Please confirm your password").oneOf([p("password"),null],"Passwords do not match")}),f=()=>{const[u,g]=i(null),[p,f]=i(!1),[j,x]=i({google:!1,apple:!1}),[q,v]=i({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:y,loginWithGoogle:C,loginWithApple:P}=e(),b=async(e,s)=>{x(s=>({...s,[e]:!0})),g(null);try{await s()}catch(s){g(s.message||`Failed to sign up with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{x(s=>({...s,[e]:!1}))}},{control:N,handleSubmit:B,formState:{errors:S}}=t({defaultValues:h,mode:"onSubmit",resolver:c(w)});return s.jsxs("div",{className:"qc:w-full qc:space-y-8",children:[s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:B(async e=>{const{email:s,password:a,fname:r,lname:o}=e;f(!0);try{const e=await y(s.toLowerCase(),a,r,o);e?.error&&g(e.error)}catch(e){g(e)}finally{f(!1)}}),className:"qc:space-y-4",children:[s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[s.jsx(m,{name:"fname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"First name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.fname?.message})}),s.jsx(m,{name:"lname",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Last name",disabled:p,type:"text",value:e,onChange:a,onBlur:r,error:S.lname?.message})})]}),s.jsx(m,{name:"email",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Email",disabled:p,type:"email",value:e,onChange:a,onBlur:r,error:S.email?.message})}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(m,{name:"password",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Password",disabled:p,type:q.showPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.password?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-5 qc:top-7",icon:q.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showPassword:!q.showPassword})})]}),s.jsxs("div",{className:"qc:relative",children:[s.jsx(m,{name:"confirmPassword",control:N,render:({field:{value:e,onChange:a,onBlur:r}})=>s.jsx(n,{label:"Confirm password",disabled:p,type:q.showConfirmPassword?"text":"password",value:e,onChange:a,onBlur:r,error:S.confirmPassword?.message})}),s.jsx(a,{variant:"ghost",color:"primary",className:"qc:absolute -qc:right-5 qc:top-7",icon:q.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>v({...q,showConfirmPassword:!q.showConfirmPassword})})]}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),u&&s.jsx(r,{weight:"medium",color:"error",align:"center",children:u}),s.jsx("div",{className:"qc:flex qc:justify-end",children:s.jsx(o,{to:l.FORGOT_PASSWORD,state:location?.state,children:s.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),s.jsx(a,{type:"submit",color:"primary",className:"qc:w-full",disabled:p,loading:p,children:"Register"})]}),s.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[s.jsx(d,{disabled:p||j.google||j.apple,loading:j.google,onClick:()=>b("google",C),provider:"google"}),s.jsx(d,{disabled:p||j.google||j.apple,loading:j.apple,onClick:()=>b("apple",P),provider:"apple"})]})]})};export{f as default};
@@ -1 +1 @@
1
- import{c as e,T as r,P as t,a,b as s,C as o,Q as l}from"./FbLadgve.js";import{a5 as n,a6 as c,a7 as i}from"./B9gK2pCi.js";var u=u=>{const[d,h]=e({prefix:"TanstackQueryDevtools"}),m=n(),v=c(()=>{const e=d.theme_preference||r;return"system"!==e?e:m()});return i(l.Provider,{value:u,get children(){return i(t,{disabled:!0,localStore:d,setLocalStore:h,get children(){return i(a.Provider,{value:v,get children(){return i(s,{get children(){return i(o,{localStore:d,setLocalStore:h,get onClose(){return u.onClose},showPanelViewOnly:!0})}})}})}})}})};export{u as default};
1
+ import{c as e,T as r,P as t,a,b as s,C as o,Q as l}from"./DBT304mv.js";import{a5 as n,a6 as c,a7 as i}from"./DR9E1aMG.js";var u=u=>{const[d,h]=e({prefix:"TanstackQueryDevtools"}),m=n(),v=c(()=>{const e=d.theme_preference||r;return"system"!==e?e:m()});return i(l.Provider,{value:u,get children(){return i(t,{disabled:!0,localStore:d,setLocalStore:h,get children(){return i(a.Provider,{value:v,get children(){return i(s,{get children(){return i(o,{localStore:d,setLocalStore:h,get onClose(){return u.onClose},showPanelViewOnly:!0})}})}})}})}})};export{u as default};