@qratilabs/qrati-connect 2.2.2 → 2.3.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.
- package/CHANGELOG.md +13 -0
- package/element/{AuthLayout-yBnXbTdQ.js → AuthLayout-BQsxj8DA.js} +1 -1
- package/element/{ContentsPage-BpGmiu2Y.js → ContentsPage-BswZWICC.js} +2 -2
- package/element/{CuratePage-Bf96ltsu.js → CuratePage-l_53kq1u.js} +1 -1
- package/element/{Dialog-BqAbQiPJ.js → Dialog-xRPAHU1U.js} +1 -1
- package/element/{DotLottiePlayer-BtxapiSJ.js → DotLottiePlayer-DWbmlHl0.js} +1 -1
- package/element/{EventHeaderAdminButtons-BplHheBN.js → EventHeaderAdminButtons-DpqqYPmp.js} +2 -2
- package/element/FolderBreadcrumb-DgOZR2JO.js +1 -0
- package/element/{ForgotPasswordPage-Z0fY0XwU.js → ForgotPasswordPage-CIz3_X-3.js} +1 -1
- package/element/{InputField-B4v4KXcE.js → InputField-DybXE_Ab.js} +1 -1
- package/element/{LazyLoadImage-DAovisp3.js → LazyLoadImage-8X8b06AJ.js} +1 -1
- package/element/{LeaderboardPage-Ygaebr-t.js → LeaderboardPage-Bphjksy_.js} +1 -1
- package/element/{LoginPage-DIZ7qlYO.js → LoginPage-CHzBIQEq.js} +1 -1
- package/element/{NCMVHL6D-CxiMFMqg.js → NCMVHL6D-CBCgRwdZ.js} +1 -1
- package/element/PublicEvents-RN-_fsl2.js +1 -0
- package/element/{RegisterPage-Bg7pyJeh.js → RegisterPage-7WLryyTX.js} +1 -1
- package/element/{SocialLoginButton-DsAt02H9.js → SocialLoginButton-DpBl7dWg.js} +1 -1
- package/element/{UploadPage-C0ek4Qqe.js → UploadPage-B7BieTEU.js} +1 -1
- package/element/{VideoPlayer-g56XT4-3.js → VideoPlayer-Bk8Hao3q.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-z2RaaSEC.js → heic2any-DLQd-wQs.js} +1 -1
- package/element/{index-BhzTVsTo.js → index-DI8B7D73.js} +1 -1
- package/element/{index-DDOpdb3i.js → index-JyoNGo8S.js} +9 -9
- package/element/index.esm-CAQX5kI5.js +1 -0
- package/element/{photoswipe-B7SExy7W.js → photoswipe-Coj-X7bR.js} +1 -1
- package/element/styles.css +1 -1
- package/element/{tslib.es6-DIRCPYhi.js → tslib.es6-C9bR68b3.js} +1 -1
- package/element/{useOrgAccess-CQNPoSFq.js → useOrgAccess-CnN4aiYB.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +18 -15
- package/react/-74yB4f5.js +1 -0
- package/react/B1neVlFZ.js +1 -0
- package/react/{DppB7lia.js → BO8jvMXn.js} +1 -1
- package/react/{DqmSOLfe.js → BbIY3X7C.js} +1 -1
- package/react/{CBpEkjwz.js → CN2vdtYT.js} +1 -1
- package/react/{Ck9enZ3e.js → CXu6PHUW.js} +1 -1
- package/react/{Dhcvm9yI.js → CZp0lmKh.js} +1 -1
- package/react/{C5XgHCIU.js → CfZ5_7x-.js} +1 -1
- package/react/{Cb66NH94.js → D6nR1wv_.js} +1 -1
- package/react/DBnzOELO.js +30 -0
- package/react/{C1kBrsed.js → D_imcCpv.js} +2 -2
- package/react/DrqnWQLs.js +1 -0
- package/react/{MZeQHhBV.js → DvDETl8u.js} +1 -1
- package/react/{Cr9MgBeI.js → DvOl03h5.js} +2 -2
- package/react/{BBaDMfm_.js → Dwry3hNI.js} +1 -1
- package/react/{C27Sy5Nr.js → DyklTvwE.js} +1 -1
- package/react/{CouLaMtF.js → Gbk2zO2l.js} +1 -1
- package/react/{x0a0HaZy.js → IbMHxVCj.js} +1 -1
- package/react/{Dx52SzWS.js → Pcjql-py.js} +1 -1
- package/react/{BX9GvyM-.js → Ply2G2qz.js} +1 -1
- package/react/{DLUmYnVL.js → Y9TU3Znq.js} +1 -1
- package/react/{qwl23nTI.js → fuEo08KS.js} +1 -1
- package/react/index.es.js +2 -2
- package/react/{FcDLBnwX.js → jRrpvD0D.js} +1 -1
- package/react/{BE9_Ublk.js → rZy1FKOQ.js} +1 -1
- package/react/types/QratiConnect.d.ts +75 -0
- package/react/types/index.d.ts +1 -0
- package/umd/web.umd.js +119 -119
- package/element/FolderBreadcrumb-DhqYRcyB.js +0 -1
- package/element/PublicEvents-D4eUZCHS.js +0 -1
- package/element/index.esm-BbqgTw7t.js +0 -1
- package/react/DZqtPzMv.js +0 -1
- package/react/HhCRmfOk.js +0 -1
- package/react/Ld9VPzmf.js +0 -30
- package/react/U0g8gQE-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a as r,u as n,T as o,O as t,k as a,l as s,Z as l,ab as i,P as c}from"./index-
|
|
1
|
+
import{j as e,a as r,u as n,T as o,O as t,k as a,l as s,Z as l,ab as i,P as c}from"./index-JyoNGo8S.js";import{I as d}from"./InputField-DybXE_Ab.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./index.esm-CAQX5kI5.js";const v=({count:r=1,currentStep:n=0,disabled:o,onStepClick:t})=>{const a=o||!t;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,o)=>e.jsx("li",{children:o<n?e.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:a,onClick:()=>t&&t(o)}):o===n?e.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:a,onClick:()=>t&&t(o),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:a,onClick:()=>t&&t(o)})},`progress-dot-${o}`))})},q={email:""},w=f().shape({email:h().required("Please enter your email").email("Enter a valid email")}),x=({onCodeSent:l})=>{const[i,c]=r.useState(!1),[f,h]=r.useState(null),{props:{organizationId:g}}=n(),{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),c(!0);try{await a.post(s.SEND_PASSWORD_RESET_CODE,{json:{email:e.email?.toLowerCase()},headers:{"x-org-id":g}}),l(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.")}c(!1)}),children:[e.jsx(p,{name:"email",control:v,render:({field:{value:r,onChange:n,onBlur:o}})=>e.jsx(d,{label:"Email",disabled:i,type:"email",value:r,onChange:n,onBlur:o,error:y.email?.message})}),e.jsx(t,{fullWidth:!0,type:"submit",loading:i,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,n=void 0===r?"":r,o=e.numInputs,t=void 0===o?4:o,a=e.onChange,s=e.onPaste,i=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=l.useState(0),x=w[0],b=w[1],j=l.useRef([]),S=function(){return n?n.toString().split(""):[]},C="number"===m||"tel"===m;l.useEffect(function(){j.current=j.current.slice(0,t)},[t]),l.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===t)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,n=e.target.value;if(!N(n)){if(n.length===t)n.split("").some(function(e){return!N(e)})||(O(n.split("")),I(t-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,n,o=Math.max(Math.min(t-1,e),0);j.current[o]&&(null===(r=j.current[o])||void 0===r||r.focus(),null===(n=j.current[o])||void 0===n||n.select(),b(o))},R=function(e){var r=S();r[x]=e[0],O(r)},O=function(e){var r=e.join("");a(r)},B=function(e){var r;e.preventDefault();var n=S(),o=x,a=e.clipboardData.getData("text/plain").slice(0,t-x).split("");if(!C||!a.some(function(e){return isNaN(Number(e))})){for(var s=0;s<t;++s)s>=x&&a.length>0&&(n[s]=null!==(r=a.shift())&&void 0!==r?r:"",o++);I(o),O(n)}};return l.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},y(h)&&h),className:"string"==typeof h?h:void 0,onPaste:s},Array.from({length:t},function(e,r){return r}).map(function(e){var r,n,o;return l.createElement(l.Fragment,{key:e},i({value:null!==(r=S()[e])&&void 0!==r?r:"",placeholder:null!==(o=null===(n=P())||void 0===n?void 0:n[e])&&void 0!==o?o: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<t-1&&("function"==typeof f?f(e):f))}))};const j={code:""},S=f().shape({code:h().required("Please enter the code")}),C=({email:l,onCodeVerified:i})=>{const{props:{organizationId:c}}=n(),[d,f]=r.useState(!1),[h,g]=r.useState(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:l})]}),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(s.VERIFY_PASSWORD_RESET_CODE,{json:{email:l,code:e.code},headers:{"x-org-id":c}}),i&&i()}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:n}})=>e.jsx(b,{value:r,onChange:n,numInputs:6,shouldAutoFocus:!0,inputType:"number",isInputNum:!0,containerStyle:"qc:flex qc:gap-4",inputStyle:"qc:rounded qc:border qc:focus:border-primary qc:text-foreground qc:bg-white qc:disabled:border-border qc:disabled:text-gray-400 otp-input qc:text-xl qc:focus:outline-none qc:focus:ring-0 qc:focus:boder-none",renderInput:r=>e.jsx("input",{...r})})}),e.jsx(t,{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:l,onPasswordReset:i})=>{const{props:{organizationId:c}}=n(),[f,h]=r.useState({showPassword:!1,showConfirmPassword:!1}),[g,v]=r.useState(!1),[q,w]=r.useState(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(s.RESET_PASSWORD,{json:{email:l.toLowerCase(),password:e.password},headers:{"x-org-id":c}});r.error?w(r.error):i()}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:n,onBlur:o}})=>e.jsx(d,{label:"New password",disabled:g,type:f.showPassword?"text":"password",value:r,onChange:n,onBlur:o,error:b.password?.message})}),e.jsx(t,{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:n,onBlur:o}})=>e.jsx(d,{label:"Confirm new password",disabled:g,type:f.showConfirmPassword?"text":"password",value:r,onChange:n,onBlur:o,error:b.confirmPassword?.message})}),e.jsx(t,{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(t,{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 n=i(),[o,t]=r.useState(null),[a,s]=r.useState(0);return e.jsxs("div",{className:"space-y-9",children:[(({index:r})=>{switch(r){case 0:return e.jsx(x,{onCodeSent:e=>{t(e),s(1)}});case 1:return e.jsx(C,{email:o,onCodeVerified:()=>s(2)});case 2:return e.jsx(D,{email:o,onPasswordReset:()=>{n(c.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 c,c as t}from"./index-
|
|
1
|
+
import{u as e,j as c,c as t}from"./index-JyoNGo8S.js";const r=({label:r,type:s="text",step:o=1,disabled:q,error:a,info:d,iconSVG:i,className:l="",...n})=>{const{props:{textClassName:m}}=e();return c.jsxs("div",{className:"qc:relative",children:[r&&c.jsx("div",{className:"qc:mb-1 qc:flex qc:items-center qc:gap-1",children:c.jsx("label",{className:t("qc:select-none qc:text-sm qc:font-medium",m,q?"qc:text-muted":"qc:text-foreground"),children:r})}),c.jsx("input",{type:s,disabled:q,step:"number"===s?o:void 0,"aria-invalid":!!a,className:t("qc:text-foreground qc:border-border qc:shadow-outer qc:focus:border-primary qc:focus:ring-primary qc:peer qc:w-full qc:rounded qc:border qc:p-2 qc:focus:outline-none",q?"qc:text-muted qc:bg-transparent":"qc:text-foreground qc:bg-white",a?"qc:border-destructive":"qc:border-border",i?"qc:pl-9":"",m,l),...n}),c.jsx("div",{className:t("qc:text-destructive qc:absolute qc:left-0 qc:flex qc:items-center qc:gap-1 qc:text-xs qc:transition-all qc:duration-300 qc:md:text-sm",a?"qc:-bottom-5 qc:opacity-100":"qc:-bottom-1 qc:opacity-0",m),children:c.jsx("label",{children:a})})]})};export{r as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,j as e,c as r}from"./index-
|
|
1
|
+
import{a as t,j as e,c as r}from"./index-JyoNGo8S.js";var i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],s=t=>{let e=0;for(let r=0;r<t.length;r++){let s=t[r];e=83*e+i.indexOf(s)}return e},n=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},o=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},h=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),a=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},l=t=>{let e=t>>8&255,r=255&t;return[n(t>>16),n(e),n(r)]},c=(t,e)=>{let r=Math.floor(t/361),i=Math.floor(t/19)%19,s=t%19;return[h((r-9)/9,2)*e,h((i-9)/9,2)*e,h((s-9)/9,2)*e]},u=(t,e,r,i)=>{(t=>{if(!t||t.length<6)throw new a("The blurhash string must be at least 6 characters");let e=s(t[0]),r=Math.floor(e/9)+1,i=e%9+1;if(t.length!==4+2*i*r)throw new a(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*i*r}`)})(t),i|=1;let n=s(t[0]),h=Math.floor(n/9)+1,u=n%9+1,p=(s(t[1])+1)/166,d=new Array(u*h);for(let e=0;e<d.length;e++)if(0===e){let r=s(t.substring(2,6));d[e]=l(r)}else{let r=s(t.substring(4+2*e,6+2*e));d[e]=c(r,p*i)}let b=4*e,f=new Uint8ClampedArray(b*r);for(let t=0;t<r;t++)for(let i=0;i<e;i++){let s=0,n=0,a=0;for(let o=0;o<h;o++)for(let h=0;h<u;h++){let l=Math.cos(Math.PI*i*h/e)*Math.cos(Math.PI*t*o/r),c=d[h+o*u];s+=c[0]*l,n+=c[1]*l,a+=c[2]*l}let l=o(s),c=o(n),p=o(a);f[4*i+0+t*b]=l,f[4*i+1+t*b]=c,f[4*i+2+t*b]=p,f[4*i+3+t*b]=255}return f},p=Object.defineProperty,d=Object.defineProperties,b=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,v=(t,e,r)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))g.call(e,r)&&v(t,r,e[r]);if(f)for(var r of f(e))w.call(e,r)&&v(t,r,e[r]);return t},y=(t,e)=>d(t,b(e)),V=(t,e)=>{var r={};for(var i in t)g.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&f)for(var i of f(t))e.indexOf(i)<0&&w.call(t,i)&&(r[i]=t[i]);return r},M=class extends t.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=t=>{this.canvas=t,this.draw()},this.draw=()=>{let{hash:t,height:e,punch:r,width:i}=this.props;if(this.canvas){let s=u(t,i,e,r),n=this.canvas.getContext("2d"),o=n.createImageData(i,e);o.data.set(s),n.putImageData(o,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:r,height:i,width:s}=e,n=V(e,["hash","height","width"]);return t.createElement("canvas",y(m({},n),{height:i,width:s,ref:this.handleRef}))}};M.defaultProps={height:128,width:128};var I={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends t.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:r,height:i,width:s,punch:n,resolutionX:o,resolutionY:h,style:a}=e,l=V(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return t.createElement("div",y(m({},l),{style:y(m({display:"inline-block",height:i,width:s},a),{position:"relative"})}),t.createElement(M,{hash:r,height:h,width:o,punch:n,style:I}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var q=Object.defineProperty,C=(t,e,r)=>((t,e,r)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),j=new Map,k=new WeakMap,O=0;function x(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>`${e}_${"root"===e?function(t){return t?(k.has(t)||(O+=1,k.set(t,O.toString())),k.get(t)):"0"}(t.root):t[e]}`).toString()}function E(t,e,r={},i=undefined){if(typeof window.IntersectionObserver>"u"&&void 0!==i){const s=t.getBoundingClientRect();return e(i,{isIntersecting:i,target:t,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:s,intersectionRect:s,rootBounds:s}),()=>{}}const{id:s,observer:n,elements:o}=function(t){const e=x(t);let r=j.get(e);if(!r){const i=new Map;let s;const n=new IntersectionObserver(e=>{e.forEach(e=>{var r;const n=e.isIntersecting&&s.some(t=>e.intersectionRatio>=t);t.trackVisibility&&typeof e.isVisible>"u"&&(e.isVisible=n),null==(r=i.get(e.target))||r.forEach(t=>{t(n,e)})})},t);s=n.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),r={id:e,observer:n,elements:i},j.set(e,r)}return r}(r),h=o.get(t)||[];return o.has(t)||o.set(t,h),h.push(e),n.observe(t),function(){h.splice(h.indexOf(e),1),0===h.length&&(o.delete(t),n.unobserve(t)),0===o.size&&(n.disconnect(),j.delete(s))}}var P=class extends t.Component{constructor(t){super(t),C(this,"node",null),C(this,"_unobserveCb",null),C(this,"lastInView"),C(this,"handleNode",t=>{this.node&&(this.unobserve(),!t&&!this.props.triggerOnce&&!this.props.skip&&(this.setState({inView:!!this.props.initialInView,entry:void 0}),this.lastInView=this.props.initialInView)),this.node=t||null,this.observeNode()}),C(this,"handleChange",(t,e)=>{const r=this.lastInView;this.lastInView=t,(void 0!==r||t)&&(t&&this.props.triggerOnce&&this.unobserve(),function(t){return"function"!=typeof t.children}(this.props)||this.setState({inView:t,entry:e}),this.props.onChange&&this.props.onChange(t,e))}),this.state={inView:!!t.initialInView,entry:void 0},this.lastInView=t.initialInView}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(t){(t.rootMargin!==this.props.rootMargin||t.root!==this.props.root||t.threshold!==this.props.threshold||t.skip!==this.props.skip||t.trackVisibility!==this.props.trackVisibility||t.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:r,trackVisibility:i,delay:s,fallbackInView:n}=this.props;void 0===this.lastInView&&(this.lastInView=this.props.initialInView),this._unobserveCb=E(this.node,this.handleChange,{threshold:t,root:e,rootMargin:r,trackVisibility:i,delay:s},n)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if("function"==typeof e){const{inView:t,entry:r}=this.state;return e({inView:t,entry:r,ref:this.handleNode})}const{as:r,triggerOnce:i,threshold:s,root:n,rootMargin:o,onChange:h,skip:a,trackVisibility:l,delay:c,initialInView:u,fallbackInView:p,...d}=this.props;return t.createElement(r||"div",{ref:this.handleNode,...d},e)}};const N=({src:i,alt:s,delayTime:n=0,threshold:o=.5,blurhash:h="LEHV6nWB2yk8pyo0adR*.7kCMdnj",wrapperClassName:a="qc:size-full",sizeMode:l="cover",position:c="center",onClick:u})=>{const p=t.useRef(null),d=t.useRef(null),[b,f]=t.useState(!1),[g,w]=t.useState(!1);return e.jsxs(P,{as:"div",className:r(a,"qc:relative qc:overflow-hidden"),threshold:o,onChange:t=>{t?d.current||(n<=0?f(!0):d.current=setTimeout(()=>f(!0),n)):d.current&&(clearTimeout(d.current),d.current=null)},children:[e.jsx(M,{className:"qc:size-full qc:blur-2xl",hash:h}),e.jsx("img",{alt:s,ref:p,src:b?i:null,onLoad:()=>w(!0),className:r("qc:bg-background qc:absolute qc:left-0 qc:top-0 qc:size-full qc:object-center qc:transition-all qc:duration-300",g?"qc:scale-100 qc:opacity-100":"qc:scale-95 qc:opacity-0","contain"===l?"qc:object-contain":"qc:object-cover","top"===c?"qc:object-top":"bottom"===c?"qc:object-bottom":"qc:object-center"),onClick:u})]})};export{P as I,N as L,u as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as c,d as t,u as s,M as l,f as a,c as i,S as r,B as n,k as q,l as d}from"./index-
|
|
1
|
+
import{j as e,T as c,d as t,u as s,M as l,f as a,c as i,S as r,B as n,k as q,l as d}from"./index-JyoNGo8S.js";const o=({title:t,entries:s=[],showFloatingPoint:l=!1,hidePictures:a=!0})=>{const i=t.replace(/\s+/g,"-").toLowerCase(),r=e=>{if(!e)return"";const c=e.trim().split(" ");return 1===c.length?c[0]:`${c[0]} ${c[1][0]}.`};return e.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[e.jsx(c,{variant:"h4",align:"center",color:"primary",children:t}),0===s.length?e.jsx(c,{variant:"h5",align:"center",color:"error",children:"Not available"}):e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[s.length>1&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[1].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[1].totalPoint?s[1].maxScore?.toFixed(l?2:0):s[1].totalPoint?.toFixed(l?2:0)})]}),s.length>0&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[0].name)}),e.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[0].totalPoint?s[0].maxScore?.toFixed(l?2:0):s[0].totalPoint?.toFixed(l?2:0)})]}),s.length>2&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[2].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[2].totalPoint?s[2].maxScore?.toFixed(l?2:0):s[2].totalPoint?.toFixed(l?2:0)})]})]}),e.jsx("div",{className:"qc:mt-6",children:e.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:e.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:e.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:e.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:e.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:s.slice(3).map((c,t)=>e.jsxs("tr",{children:[e.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:e.jsx("span",{className:"qc:px-2",children:t+4})}),e.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:e.jsxs("div",{className:"qc:flex qc:items-center",children:[!a&&e.jsx("div",{className:"qc:size-8 qc:shrink-0"}),e.jsx("div",{className:"qc-ml-4",children:e.jsx("div",{className:"qc-text-primary qc-font-medium",children:r(c.name)})})]})}),e.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:void 0===c.totalPoint?c.maxScore?.toFixed(l?2:0):c.totalPoint?.toFixed(l?2:0)})]},`${i}-${t}`))})})})})})})]})]})},x=()=>{const{eventSlug:c}=t(),{props:{organizationId:x}}=s(),{event:m}=l({eventSlug:c}),{isLoading:f,data:h}=a({queryKey:[`leaderboard-${x}-${m?._id}`],queryFn:async()=>(await q.get(d.GET_LEADERBOARD,{headers:{"x-org-id":x},searchParams:{eventId:m?._id}}).json()).data,enabled:!!m});return f?e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",m?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsxs("div",{className:"qc:flex-1",children:[e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"}),e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"})]}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:m?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:m?.engagementStyle===n.CONTEST,entries:h?.leaderboardByScore?.topRankers||[],pointName:m?.pointName})})]}):e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",m?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:"Point Leaders",entries:h?.leaderboardByPoint?.topRankers||[],pointName:m?.pointName})}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:m?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:m?.engagementStyle===n.CONTEST,entries:h?.leaderboardByScore?.topRankers||[],pointName:m?.pointName})})]})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,e as a,u as s,j as l,O as o,T as r,h as i,P as t}from"./index-
|
|
1
|
+
import{a as e,e as a,u as s,j as l,O as o,T as r,h as i,P as t}from"./index-JyoNGo8S.js";import{I as n}from"./InputField-DybXE_Ab.js";import{S as c}from"./SocialLoginButton-DpBl7dWg.js";import{u as d,C as m,o as p,c as u,a as g}from"./index.esm-CAQX5kI5.js";const h=u().shape({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")}),j=()=>{const[u,g]=e.useState(!1),[j,x]=e.useState(!1),[f,w]=e.useState({google:!1,apple:!1}),[y,q]=e.useState(null),v=a(),{control:C,handleSubmit:b,formState:{errors:S}}=d({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:p(h)}),{loginUsingEmail:N,loginWithGoogle:B,loginWithApple:P}=s(),F=async(e,a)=>{w(a=>({...a,[e]:!0})),q(null);try{await a()}catch(a){q(a.message||`Failed to login with ${e.charAt(0).toUpperCase()+e.slice(1)}`)}finally{w(a=>({...a,[e]:!1}))}};return l.jsxs("div",{className:"qc:w-full qc:space-y-6",children:[l.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b(async e=>{const{email:a,password:s}=e;x(!0);try{const e=await N(a.toLowerCase(),s);e?.error&&q(e.error)}catch(e){q(e)}finally{x(!1)}}),className:"qc:space-y-6",children:[l.jsxs("div",{className:"qc:space-y-9",children:[l.jsx(m,{name:"email",control:C,render:({field:{value:e,onChange:a,onBlur:s}})=>l.jsx(n,{label:"Email",disabled:j,type:"email",value:e,onChange:a,onBlur:s,autoComplete:"email",error:S.email?.message})}),l.jsx(m,{name:"password",control:C,render:({field:{value:e,onChange:a,onBlur:s}})=>l.jsxs("div",{className:"qc:relative",children:[l.jsx(n,{label:"Password",disabled:j,type:u?"text":"password",value:e,onChange:a,onBlur:s,autoComplete:"current-password",error:S.password?.message}),l.jsx(o,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:u?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>g(!u)})]})})]}),y&&l.jsx(r,{align:"center",weight:"medium",color:"error",children:y}),l.jsx("div",{className:"qc:flex qc:justify-end",children:l.jsx(i,{to:t.FORGOT_PASSWORD,state:v?.state,children:l.jsx(r,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),l.jsx(o,{type:"submit",color:"primary",className:"qc:w-full",loading:j,disabled:j,children:"Login"})]}),l.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[l.jsx(c,{disabled:j||f.google||f.apple,loading:f.google,onClick:()=>F("google",B),provider:"google"}),l.jsx(c,{disabled:j||f.google||f.apple,loading:f.apple,onClick:()=>F("apple",P),provider:"apple"})]})]})};export{j as default};
|