@qratilabs/qrati-connect 2.5.0 → 2.5.2
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 +19 -0
- package/element/{AuthLayout-EC2U3nsK.js → AuthLayout-IGFGeMq5.js} +1 -1
- package/element/{ContentsPage-BGtOyWxg.js → ContentsPage-Bu42OF-F.js} +1 -1
- package/element/{CuratePage-BLa771HN.js → CuratePage-CBMluidb.js} +1 -1
- package/element/{Dialog-D3m_eBiJ.js → Dialog-DVSvxBn8.js} +1 -1
- package/element/{DotLottiePlayer-FgGW1IR7.js → DotLottiePlayer-DHVhIw5H.js} +1 -1
- package/element/{EventHeaderAdminButtons-CW2SupWX.js → EventHeaderAdminButtons-zE3NbEUA.js} +1 -1
- package/element/{FolderBreadcrumb-CUpIfUTx.js → FolderBreadcrumb-1w72I1FP.js} +1 -1
- package/element/{ForgotPasswordPage-Cd0Oj-RE.js → ForgotPasswordPage-CIw8RrkZ.js} +1 -1
- package/element/{InputField-B_y35j-5.js → InputField-XP30segE.js} +1 -1
- package/element/{LazyLoadImage-CQL8-B3z.js → LazyLoadImage-n94OUygV.js} +1 -1
- package/element/{LeaderboardPage-BRBrFWpp.js → LeaderboardPage-CGuP207i.js} +1 -1
- package/element/{LoginPage-Ba9HTjV1.js → LoginPage-B15CMpYe.js} +1 -1
- package/element/{NCMVHL6D-CCAMoHuQ.js → NCMVHL6D-D_O5jdHL.js} +1 -1
- package/element/{PublicEvents-CddoYNW6.js → PublicEvents-DOp9N4xU.js} +1 -1
- package/element/{RegisterPage-DZGdPdu_.js → RegisterPage-D-6uVKjj.js} +1 -1
- package/element/{SocialLoginButton-BSK0uHQy.js → SocialLoginButton-BuZ03WV-.js} +1 -1
- package/element/{UploadPage-6k9f8u8c.js → UploadPage-Dhjmh06j.js} +1 -1
- package/element/{VideoPlayer-B6NcsNiP.js → VideoPlayer-cWSLl4fO.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-JTWseCtt.js → heic2any-Dui1sz1X.js} +1 -1
- package/element/{index-Dq8XMn-B.js → index-DsN-W6V_.js} +1 -1
- package/element/{index-jVkC2DYJ.js → index-jzNVBihK.js} +1 -1
- package/element/{index.esm-mRBXJrk0.js → index.esm-CsbPHPGO.js} +1 -1
- package/element/{photoswipe-BdJR2C9a.js → photoswipe-5mcef1lI.js} +1 -1
- package/element/styles.css +1 -1
- package/element/{tslib.es6-CT89L4O4.js → tslib.es6-Dp_1P0Dk.js} +1 -1
- package/element/{useOrgAccess-DHToEbG_.js → useOrgAccess-B1cbGHT_.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +1 -1
- package/react/{DPgWGmoG.js → 6xRxF6pz.js} +1 -1
- package/react/{BEzP8sbl.js → BZvhXg2G.js} +1 -1
- package/react/{BDeLdfbp.js → BaA7RHRf.js} +1 -1
- package/react/{CImTSnHg.js → Bebe5T7J.js} +1 -1
- package/react/{B5w5BP6w.js → C565I04Q.js} +1 -1
- package/react/{DPeVo4aL.js → CE-MbwCB.js} +1 -1
- package/react/{DH_wlDkr.js → CIlaT7eJ.js} +1 -1
- package/react/{JfRXqbqu.js → CS7icy9d.js} +1 -1
- package/react/{BUZq1uY0.js → Cp86U6va.js} +1 -1
- package/react/{LF1Cet66.js → Cv7EiFQU.js} +1 -1
- package/react/{eUvYQTPt.js → D1emifDo.js} +1 -1
- package/react/{BwHqpHe9.js → DPtqYlwJ.js} +1 -1
- package/react/{DcQdnYr8.js → DS2UD7gV.js} +1 -1
- package/react/{CYoLgOTC.js → DZitaH5o.js} +1 -1
- package/react/{CQHQocew.js → DjmC7CGh.js} +1 -1
- package/react/{BYYb8zAx.js → DwNWOPAY.js} +1 -1
- package/react/{6z8qI7He.js → Dyk2_V8r.js} +1 -1
- package/react/{CldWPPzn.js → LMErjmPc.js} +1 -1
- package/react/{BeDQQM0T.js → VOx0knsi.js} +1 -1
- package/react/{C-Ri1Eh9.js → W8TabW9M.js} +1 -1
- package/react/{CtX-oYOP.js → cWB0y40v.js} +1 -1
- package/react/index.es.js +1 -1
- package/react/{U9LCogz5.js → jM4FWKDA.js} +1 -1
- package/react/styles.css +1 -1
- package/react/{D464cx8y.js → vmkon26e.js} +1 -1
- package/umd/web.umd.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./
|
|
1
|
+
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./BaA7RHRf.js";import"react";const n=()=>{const n=a(),{initializing:m,organization:x,user:h}=s();return m?c.jsxs("div",{className:"qc:mx-auto qc:max-w-lg qc:space-y-8 qc:py-8",children:[c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"})]}):!x||x?.customAuth?null:h?c.jsx(r,{replace:!0,to:n?.state?.referrer||"/"}):c.jsxs("div",{className:"qc:bg-background qc:mx-auto qc:mt-24 qc:min-h-[80vh] qc:max-w-md",children:[c.jsxs("div",{className:"qc:my-8 qc:flex qc:w-full qc:justify-around",children:[c.jsx(t,{to:i.LOGIN,state:n?.state,className:q(n.pathname===i.LOGIN?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Login"})}),c.jsx(t,{to:i.REGISTER,state:n?.state,className:q(n.pathname===i.REGISTER?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Register"})})]}),c.jsx(d,{}),c.jsx("div",{className:"qc:mt-12",children:c.jsx(o,{})})]})};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c,a3 as e}from"./
|
|
1
|
+
import{j as c,a3 as e}from"./BaA7RHRf.js";const a=({disabled:a,provider:r,onClick:s,loading:i})=>c.jsx("button",{disabled:a||i,onClick:async()=>{if(!a&&!i)try{await s()}catch(c){console.error(`${e(r)} login error:`,c)}},className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:i?c.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:c.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):c.jsx("img",{className:"qc:h-auto qc:w-full",src:(c=>{switch(c){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}})(r,a),alt:`sign in with ${e(r)}`})});export{a as S};
|
|
@@ -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"./
|
|
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"./BaA7RHRf.js";import c,{useState as i}from"react";import{I as d}from"./Bebe5T7J.js";import{u,o as m,c as f,C as p,a as h,b as g}from"./-74yB4f5.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,c]=i(!1),[f,h]=i(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),c(!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.")}c(!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,i=e.shouldAutoFocus,d=void 0!==i&&i,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=c.useState(0),x=w[0],b=w[1],j=c.useRef([]),S=function(){return o?o.toString().split(""):[]},C="number"===m||"tel"===m;c.useEffect(function(){j.current=j.current.slice(0,a)},[a]),c.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 c.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 c.createElement(c.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:c}}=r(),[d,f]=i(!1),[h,g]=i(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":c}}),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 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(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:c}}=r(),[f,h]=i({showPassword:!1,showConfirmPassword:!1}),[g,v]=i(!1),[q,w]=i(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":c}});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]=i(null),[a,t]=i(0);return e.jsxs("div",{className:"qc:space-y-9 qc:bg-background",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{j as t,c as e}from"./
|
|
1
|
+
import{j as t,c as e}from"./BaA7RHRf.js";import*as r from"react";import{useRef as i,useState as s}from"react";var o=["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","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],n=t=>{let e=0;for(let r=0;r<t.length;r++){let i=t[r];e=83*e+o.indexOf(i)}return e},a=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},h=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)},l=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),c=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},u=t=>{let e=t>>8&255,r=255&t;return[a(t>>16),a(e),a(r)]},p=(t,e)=>{let r=Math.floor(t/361),i=Math.floor(t/19)%19,s=t%19;return[l((r-9)/9,2)*e,l((i-9)/9,2)*e,l((s-9)/9,2)*e]},d=(t,e,r,i)=>{(t=>{if(!t||t.length<6)throw new c("The blurhash string must be at least 6 characters");let e=n(t[0]),r=Math.floor(e/9)+1,i=e%9+1;if(t.length!==4+2*i*r)throw new c(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*i*r}`)})(t),i|=1;let s=n(t[0]),o=Math.floor(s/9)+1,a=s%9+1,l=(n(t[1])+1)/166,d=new Array(a*o);for(let e=0;e<d.length;e++)if(0===e){let r=n(t.substring(2,6));d[e]=u(r)}else{let r=n(t.substring(4+2*e,6+2*e));d[e]=p(r,l*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,l=0;for(let h=0;h<o;h++)for(let o=0;o<a;o++){let c=Math.cos(Math.PI*i*o/e)*Math.cos(Math.PI*t*h/r),u=d[o+h*a];s+=u[0]*c,n+=u[1]*c,l+=u[2]*c}let c=h(s),u=h(n),p=h(l);f[4*i+0+t*b]=c,f[4*i+1+t*b]=u,f[4*i+2+t*b]=p,f[4*i+3+t*b]=255}return f},b=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,w=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,y=(t,e,r)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V=(t,e)=>{for(var r in e||(e={}))m.call(e,r)&&y(t,r,e[r]);if(w)for(var r of w(e))v.call(e,r)&&y(t,r,e[r]);return t},M=(t,e)=>f(t,g(e)),I=(t,e)=>{var r={};for(var i in t)m.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&w)for(var i of w(t))e.indexOf(i)<0&&v.call(t,i)&&(r[i]=t[i]);return r},q=class extends r.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=d(t,i,e,r),o=this.canvas.getContext("2d"),n=o.createImageData(i,e);n.data.set(s),o.putImageData(n,0,0)}}}componentDidUpdate(){this.draw()}render(){let t=this.props,{hash:e,height:i,width:s}=t,o=I(t,["hash","height","width"]);return r.createElement("canvas",M(V({},o),{height:i,width:s,ref:this.handleRef}))}};q.defaultProps={height:128,width:128};var C={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"};(class extends r.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 t=this.props,{hash:e,height:i,width:s,punch:o,resolutionX:n,resolutionY:a,style:h}=t,l=I(t,["hash","height","width","punch","resolutionX","resolutionY","style"]);return r.createElement("div",M(V({},l),{style:M(V({display:"inline-block",height:i,width:s},h),{position:"relative"})}),r.createElement(q,{hash:e,height:a,width:n,punch:o,style:C}))}}).defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var j=Object.defineProperty,k=(t,e,r)=>((t,e,r)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),O=new Map,x=new WeakMap,E=0;function P(t){return Object.keys(t).sort().filter(e=>void 0!==t[e]).map(e=>`${e}_${"root"===e?function(t){return t?(x.has(t)||(E+=1,x.set(t,E.toString())),x.get(t)):"0"}(t.root):t[e]}`).toString()}function N(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:o,elements:n}=function(t){const e=P(t);let r=O.get(e);if(!r){const i=new Map;let s;const o=new IntersectionObserver(e=>{e.forEach(e=>{var r;const o=e.isIntersecting&&s.some(t=>e.intersectionRatio>=t);t.trackVisibility&&typeof e.isVisible>"u"&&(e.isVisible=o),null==(r=i.get(e.target))||r.forEach(t=>{t(o,e)})})},t);s=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),r={id:e,observer:o,elements:i},O.set(e,r)}return r}(r),a=n.get(t)||[];return n.has(t)||n.set(t,a),a.push(e),o.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(n.delete(t),o.unobserve(t)),0===n.size&&(o.disconnect(),O.delete(s))}}var R=class extends r.Component{constructor(t){super(t),k(this,"node",null),k(this,"_unobserveCb",null),k(this,"lastInView"),k(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()}),k(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:o}=this.props;void 0===this.lastInView&&(this.lastInView=this.props.initialInView),this._unobserveCb=N(this.node,this.handleChange,{threshold:t,root:e,rootMargin:r,trackVisibility:i,delay:s},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if("function"==typeof t){const{inView:e,entry:r}=this.state;return t({inView:e,entry:r,ref:this.handleNode})}const{as:e,triggerOnce:i,threshold:s,root:o,rootMargin:n,onChange:a,skip:h,trackVisibility:l,delay:c,initialInView:u,fallbackInView:p,...d}=this.props;return r.createElement(e||"div",{ref:this.handleNode,...d},t)}};const z=({src:r,alt:o,delayTime:n=0,threshold:a=.5,blurhash:h="LEHV6nWB2yk8pyo0adR*.7kCMdnj",wrapperClassName:l="qc:size-full",sizeMode:c="cover",position:u="center",onClick:p})=>{const d=i(null),b=i(null),[f,g]=s(!1),[w,m]=s(!1);return t.jsxs(R,{as:"div",className:e(l,"qc:relative qc:overflow-hidden"),threshold:a,onChange:t=>{t?b.current||(n<=0?g(!0):b.current=setTimeout(()=>g(!0),n)):b.current&&(clearTimeout(b.current),b.current=null)},children:[t.jsx(q,{className:"qc:size-full qc:blur-2xl",hash:h}),t.jsx("img",{alt:o,ref:d,src:f?r:null,onLoad:()=>m(!0),className:e("qc:bg-background qc:absolute qc:left-0 qc:top-0 qc:size-full qc:object-center qc:transition-all qc:duration-300",w?"qc:scale-100 qc:opacity-100":"qc:scale-95 qc:opacity-0","contain"===c?"qc:object-contain":"qc:object-cover","top"===u?"qc:object-top":"bottom"===u?"qc:object-bottom":"qc:object-center"),onClick:p})]})};export{R as I,z as L,d as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./
|
|
1
|
+
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./BaA7RHRf.js";import"react";const o=({title:t,entries:s=[],showFloatingPoint:a=!1,hidePictures:l=!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(a?2:0):s[1].totalPoint?.toFixed(a?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(a?2:0):s[0].totalPoint?.toFixed(a?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(a?2:0):s[2].totalPoint?.toFixed(a?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:[!l&&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(a?2:0):c.totalPoint?.toFixed(a?2:0)})]},`${i}-${t}`))})})})})})})]})]})},m=()=>{const{eventSlug:c}=t(),{props:{organizationId:m}}=s(),{event:x}=a({eventSlug:c}),{isLoading:f,data:g}=l({queryKey:[`leaderboard-${m}-${x?._id}`],queryFn:async()=>(await q.get(d.GET_LEADERBOARD,{headers:{"x-org-id":m},searchParams:{eventId:x?._id}}).json()).data,enabled:!!x});return f?e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:bg-background 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",x?.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:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.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",x?.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:g?.leaderboardByPoint?.topRankers||[],pointName:x?.pointName})}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,c as t}from"./
|
|
1
|
+
import{j as e,c as t}from"./BaA7RHRf.js";import{useRef as s,useState as r,useCallback as c,useEffect as l}from"react";const n=({src:n,thumbnailUrl:o,playing:a=!1,controls:u=!1,playsInline:i=!0,fit:q="cover",muted:h=!0,showFullscreen:m=!0,onClick:d,onPlay:v,onPause:T,onEnd:p})=>{const w=s(null),x=s(null),[f,g]=r(!0),j=s(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),b=c(()=>{a?T?.():v?.()},[a,T,v]),y=c(()=>{if(!w.current)return;const e=w.current;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},[]);return l(()=>{const e=w.current;if(!e)return;const t=()=>{try{a&&e.play().catch(()=>{})}catch(e){console.error("Error handling video play:",e)}};return e.addEventListener("canplay",t),()=>e.removeEventListener("canplay",t)},[a]),l(()=>{const e=w.current;if(e){try{a?(e.play().catch(()=>{}),j.current||(x.current=setTimeout(()=>g(!1),1e3))):(e.pause(),g(!0))}catch(e){console.error("Error controlling video playback:",e)}return()=>{x.current&&(clearTimeout(x.current),x.current=null)}}},[a]),e.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("video",{ref:w,className:t("qc:size-full",`qc:object-${q}`),src:n,muted:h,poster:o,controls:u,playsInline:i,onEnded:p,onClick:d,children:"Your browser does not support the video tag."}),!u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:f&&e.jsx("button",{onClick:b,className:"qc:text-white","aria-label":a?"Pause":"Play",children:a?e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),f&&m&&e.jsx("button",{onClick:y,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",e.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})};export{n as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as t,j as r,c as e,O as a,A as c}from"./
|
|
1
|
+
import{u as t,j as r,c as e,O as a,A as c}from"./BaA7RHRf.js";import{useState as n,useRef as o}from"react";function s({content:c,children:s,position:l="bottom",className:q,contentClassName:i}){const[p,b]=n(!1),d=o(null),{organization:u}=t();return r.jsxs("div",{className:e("qc:relative qc:inline-block",q),ref:d,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),onClick:()=>b(!1),onBlur:()=>b(!1),children:[s,p&&r.jsxs("div",{className:e("qc:absolute qc:z-50 qc:whitespace-nowrap qc:rounded qc:bg-neutral-200 qc:px-2 qc:py-1 qc:text-sm qc:text-black",{top:"qc:bottom-full qc:left-1/2 qc:-translate-x-1/2 qc:mb-2",right:"qc:left-full qc:top-1/2 qc:-translate-y-1/2 qc:ml-2",bottom:"qc:top-full qc:left-1/2 qc:-translate-x-1/2 qc:mt-2",left:"qc:right-full qc:top-1/2 qc:-translate-y-1/2 qc:mr-2"}[l],i),style:a(u),role:"tooltip",children:[c,r.jsx("div",{className:e("qc:absolute qc:h-0 qc:w-0 qc:border-4",{top:"qc:top-full qc:left-1/2 qc:-translate-x-1/2 qc:border-l-transparent qc:border-r-transparent qc:border-b-transparent",right:"qc:right-full qc:top-1/2 qc:-translate-y-1/2 qc:border-t-transparent qc:border-b-transparent qc:border-l-transparent",bottom:"qc:bottom-full qc:left-1/2 qc:-translate-x-1/2 qc:border-l-transparent qc:border-r-transparent qc:border-t-transparent",left:"qc:left-full qc:top-1/2 qc:-translate-y-1/2 qc:border-t-transparent qc:border-b-transparent qc:border-r-transparent"}[l])})]})]})}const l=()=>{const{initializing:r,organization:e,user:a,loadingUser:n}=t(),o=e?.admins?.find(t=>t.email===a?.email)?.role;return{role:o,isSuper:a?.isSuper,loading:n||r,isOwner:o===c.OWNER,isAdmin:o===c.ADMIN,isModerator:o===c.MODERATOR}};export{s as T,l as u};
|