@qratilabs/qrati-connect 2.24.2 → 2.25.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/README.md +86 -130
- package/element/{BP2rYgya2.js → BFCgbC5I2.js} +9 -9
- package/element/{BnZIocDu2.js → BV9JHI5n2.js} +41 -41
- package/element/{DkG0zv7_2.js → BccTn5v-2.js} +1 -1
- package/element/BxbojrJs.js +8 -0
- package/element/{Bh8kXbe92.js → C6dzWeQk2.js} +4 -4
- package/element/{C52SUIvC2.js → C7iuJ0h32.js} +8 -8
- package/element/{BM9ujORR2.js → C9T-_wQ82.js} +1 -1
- package/element/{BKDqpSN62.js → C9kBlCZx2.js} +3 -3
- package/element/{LYboLIEU.js → CJXPO3HP.js} +1 -1
- package/element/CMnzxWwG.js +9 -0
- package/element/{DN26AtHL2.js → CZbEGemi2.js} +3 -3
- package/element/{lcKuIs2T2.js → Ctl9NdWl2.js} +5 -9
- package/element/DCj_fMN5.js +5 -0
- package/element/DPg_DKOi.js +5 -0
- package/element/{CHTzn6mh2.js → DRP9vxts2.js} +3 -3
- package/element/{kiL9JENf2.js → DWjheKBP2.js} +1 -1
- package/element/{BOqkzZ92.js → EjMoIoSK.js} +1 -1
- package/element/ZYvo9BjF2.js +8 -0
- package/element/{Bow6F3212.js → iknPnbyg2.js} +14 -14
- package/element/{DdOwRfWG.js → iuooW4mt.js} +8 -9
- package/element/{mIANlVHi2.js → qQ9Xx6H32.js} +1 -1
- package/element/{CLdpUOLk2.js → rg8L51I62.js} +4 -4
- package/element/web.es.js +23 -24
- package/package.json +1 -1
- package/element/BDrHm_qM.js +0 -9
- package/element/BxErY-nv.js +0 -7
- package/element/CWhnvMey2.js +0 -8
- package/element/DWBbTgnB.js +0 -8
- /package/element/{CZ9iaxjO.js → CZ9iaxjO2.js} +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import{E as e,S as t,T as r,_ as a,f as n,h as o,p as s,t as l,v as i,w as d,y as c}from"./DrrpB4Om.js";import{a as p,i as m,n as u,s as f}from"./CaX2xgrP.js";import{t as
|
|
1
|
+
import{E as e,S as t,T as r,_ as a,f as n,h as o,p as s,t as l,v as i,w as d,y as c}from"./DrrpB4Om.js";import{a as p,i as m,n as u,s as f}from"./CaX2xgrP.js";import{t as b}from"./ChJXhA9c.js";import{r as h}from"./CATr-3VW.js";import{t as v}from"./BsYbcfkG.js";var g=h("inline-flex h-fit flex-auto cursor-pointer items-center justify-center border transition-all duration-200 focus:outline-none active:scale-95",{variants:{size:{sm:"gap-1.5 p-1.5 text-xs",md:"gap-3 px-3 py-2 text-sm",lg:"gap-3 px-4 py-3 text-base"}},defaultVariants:{size:"md"}}),x=({size:e,buttons:t=[],onChange:r,selected:a,className:n})=>/* @__PURE__ */l("div",{className:m("button-group-overlap shadow-outer z-0 flex h-fit rounded",n),children:t.map((n,o)=>{const s=0===o,i=o===t.length-1,d=n.value===a;/* @__PURE__ */
|
|
2
2
|
return l("button",{type:"button",onClick:()=>r?.(n.value),className:m(g({size:e}),d?n.activeClassName?n.activeClassName:"bg-primary border-primary text-primary-foreground hover:bg-primary/90 border":"hover:bg-muted/50 active:bg-muted border-border border",s&&"rounded-l",i&&"rounded-r"),children:[!n.icon&&/* @__PURE__ */l("span",{className:"font-medium sm:py-0.5",children:n.text}),n.icon&&/* @__PURE__ */l("div",{className:"size-6",children:n.icon})]},n.value)})}),N=()=>{const{initializing:e,orgRole:t,user:r,loadingUser:a}=u(),n=r?t??void 0:void 0;return{role:n,isSuper:Boolean(r?.isSuper),loading:Boolean(a||e),isOwner:n===f.OWNER,isAdmin:n===f.ADMIN,isModerator:n===f.MODERATOR}};function q({content:e,children:t,position:r="top",className:a,contentClassName:n}){const[s,i]=o(!1),{organization:d}=u();/* @__PURE__ */
|
|
3
|
-
return l("div",{className:m("relative inline-block",a),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>i(!1),onBlur:()=>i(!1),children:[t,s&&/* @__PURE__ */l("div",{className:m("bg-popover text-popover-foreground border-border animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 pointer-events-auto absolute z-50 rounded border px-3 py-2 text-sm whitespace-nowrap shadow-md",{top:"bottom-full left-1/2 -translate-x-1/2 mb-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"}[r],n),"data-side":r,style:p(d),role:"tooltip",children:[e,/* @__PURE__ */l("div",{className:m("border-popover absolute h-0 w-0 border-4",{top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent"}[r])})]})]})}function
|
|
4
|
-
return l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M10.825 22q-.675 0-1.162-.45t-.588-1.1L8.85 18.8q-.325-.125-.612-.3t-.563-.375l-1.55.65q-.625.275-1.25.05t-.975-.8l-1.175-2.05q-.35-.575-.2-1.225t.675-1.075l1.325-1Q4.5 12.5 4.5 12.337v-.675q0-.162.025-.337l-1.325-1Q2.675 9.9 2.525 9.25t.2-1.225L3.9 5.975q.35-.575.975-.8t1.25.05l1.55.65q.275-.2.575-.375t.6-.3l.225-1.65q.1-.65.588-1.1T10.825 2h2.35q.675 0 1.163.45t.587 1.1l.225 1.65q.325.125.613.3t.562.375l1.55-.65q.625-.275 1.25-.05t.975.8l1.175 2.05q.35.575.2 1.225t-.675 1.075l-1.325 1q.025.175.025.338v.674q0 .163-.05.338l1.325 1q.525.425.675 1.075t-.2 1.225l-1.2 2.05q-.35.575-.975.8t-1.25-.05l-1.5-.65q-.275.2-.575.375t-.6.3l-.225 1.65q-.1.65-.587 1.1t-1.163.45zM11 20h1.975l.35-2.65q.775-.2 1.438-.587t1.212-.938l2.475 1.025l.975-1.7l-2.15-1.625q.125-.35.175-.737T17.5 12t-.05-.787t-.175-.738l2.15-1.625l-.975-1.7l-2.475 1.05q-.55-.575-1.212-.962t-1.438-.588L13 4h-1.975l-.35 2.65q-.775.2-1.437.588t-1.213.937L5.55 7.15l-.975 1.7l2.15 1.6q-.125.375-.175.75t-.05.8q0 .4.05.775t.175.75l-2.15 1.625l.975 1.7l2.475-1.05q.55.575 1.213.963t1.437.587zm1.05-4.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.487 1.025T8.55 12t1.013 2.475T12.05 15.5M12 12"})})}var
|
|
5
|
-
return l(
|
|
6
|
-
return l("span",{onClick:d,className:m("cursor-pointer",a),children:e})}function k({children:e,className:t,align:r="end",side:o="bottom",sideOffset:s=4}){const{open:i,setOpen:d}=c(
|
|
7
|
-
return l("div",{ref:f,style:{...p(
|
|
8
|
-
/* @__PURE__ */l("span",{className:"flex-1 truncate font-medium",children:f}),g&&/* @__PURE__ */l(v,{className:"text-primary size-5"}),x&&/* @__PURE__ */l("span",{className:"bg-primary text-primary-foreground rounded px-1.5 py-0.5 text-[10px]",children:"BETA"}),N&&/* @__PURE__ */l("span",{children:N})]}),k=i(e=>{p||(s?.(e),o?.(),
|
|
9
|
-
return l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"})})}
|
|
10
|
-
return l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:[/* @__PURE__ */l("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"}),/* @__PURE__ */l("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:/* @__PURE__ */l("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]})}export{z as a,q as c,k as i,N as l,O as n,T as o,C as r,w as s,M as t,x as u};
|
|
3
|
+
return l("div",{className:m("relative inline-block",a),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>i(!1),onBlur:()=>i(!1),children:[t,s&&/* @__PURE__ */l("div",{className:m("bg-popover text-popover-foreground border-border animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 pointer-events-auto absolute z-50 rounded border px-3 py-2 text-sm whitespace-nowrap shadow-md",{top:"bottom-full left-1/2 -translate-x-1/2 mb-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"}[r],n),"data-side":r,style:p(d),role:"tooltip",children:[e,/* @__PURE__ */l("div",{className:m("border-popover absolute h-0 w-0 border-4",{top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent"}[r])})]})]})}function y({className:e}){/* @__PURE__ */
|
|
4
|
+
return l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M10.825 22q-.675 0-1.162-.45t-.588-1.1L8.85 18.8q-.325-.125-.612-.3t-.563-.375l-1.55.65q-.625.275-1.25.05t-.975-.8l-1.175-2.05q-.35-.575-.2-1.225t.675-1.075l1.325-1Q4.5 12.5 4.5 12.337v-.675q0-.162.025-.337l-1.325-1Q2.675 9.9 2.525 9.25t.2-1.225L3.9 5.975q.35-.575.975-.8t1.25.05l1.55.65q.275-.2.575-.375t.6-.3l.225-1.65q.1-.65.588-1.1T10.825 2h2.35q.675 0 1.163.45t.587 1.1l.225 1.65q.325.125.613.3t.562.375l1.55-.65q.625-.275 1.25-.05t.975.8l1.175 2.05q.35.575.2 1.225t-.675 1.075l-1.325 1q.025.175.025.338v.674q0 .163-.05.338l1.325 1q.525.425.675 1.075t-.2 1.225l-1.2 2.05q-.35.575-.975.8t-1.25-.05l-1.5-.65q-.275.2-.575.375t-.6.3l-.225 1.65q-.1.65-.587 1.1t-1.163.45zM11 20h1.975l.35-2.65q.775-.2 1.438-.587t1.212-.938l2.475 1.025l.975-1.7l-2.15-1.625q.125-.35.175-.737T17.5 12t-.05-.787t-.175-.738l2.15-1.625l-.975-1.7l-2.475 1.05q-.55-.575-1.212-.962t-1.438-.588L13 4h-1.975l-.35 2.65q-.775.2-1.437.588t-1.213.937L5.55 7.15l-.975 1.7l2.15 1.6q-.125.375-.175.75t-.05.8q0 .4.05.775t.175.75l-2.15 1.625l.975 1.7l2.475-1.05q.55.575 1.213.963t1.437.587zm1.05-4.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.487 1.025T8.55 12t1.013 2.475T12.05 15.5M12 12"})})}var w=e({open:!1,setOpen:()=>{}});function C({children:e,className:t,open:r,defaultOpen:a=!1,onOpenChange:n}){const[d,c]=o(a),p=void 0!==r?r:d,u=i(e=>{c(e),n?.(e)},[n]),f=s(()=>({open:p,setOpen:u}),[p,u]);/* @__PURE__ */
|
|
5
|
+
return l(w.Provider,{value:f,children:/* @__PURE__ */l("div",{className:m("relative",t),children:e})})}function T({children:e,className:a,asChild:n=!1}){const{open:o,setOpen:s}=c(w),d=i(e=>{e.stopPropagation(),s(!o)},[o,s]);if(n){const n=t(e)[0];return n?r(n,{onClick:e=>{d(e),n.props?.onClick?.(e)},className:m(n.props?.className,a,"cursor-pointer")}):null}/* @__PURE__ */
|
|
6
|
+
return l("span",{onClick:d,className:m("cursor-pointer",a),children:e})}function k({children:e,className:t,align:r="end",side:o="bottom",sideOffset:s=4}){const{open:i,setOpen:d}=c(w),f=n(null),{organization:b}=u();if(a(()=>{if(!i)return;const e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)},t=e=>{"Escape"===e.key&&d(!1)};return document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[i,d]),!i)return null;const h="start"===r?"left-0":"end"===r?"right-0":"left-1/2 -translate-x-1/2",v="bottom"===o?{top:`calc(100% + ${s}px)`}:{bottom:`calc(100% + ${s}px)`};/* @__PURE__ */
|
|
7
|
+
return l("div",{ref:f,style:{...p(b),...v},className:m("bg-popover text-popover-foreground border-border absolute z-50 min-w-32 rounded border p-1 shadow-md","animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",h,t),"data-side":o,children:e})}function z({children:e,className:a,href:n,onClick:o,onSelect:s,disabled:p,icon:u,title:f,variant:h="default",isChecked:g,isBeta:x,suffix:N,asChild:q}){const{setOpen:y}=c(w),C=m("hover:bg-primary/20 relative flex w-full cursor-pointer items-center gap-3 rounded px-3 py-2 text-left text-sm transition-colors outline-none select-none",p&&"pointer-events-none opacity-50","destructive"===h&&"text-destructive hover:bg-destructive/10 focus:bg-destructive/10",a),T=e??/* @__PURE__ */l(d,{children:[u,
|
|
8
|
+
/* @__PURE__ */l("span",{className:"flex-1 truncate font-medium",children:f}),g&&/* @__PURE__ */l(v,{className:"text-primary size-5"}),x&&/* @__PURE__ */l("span",{className:"bg-primary text-primary-foreground rounded px-1.5 py-0.5 text-[10px]",children:"BETA"}),N&&/* @__PURE__ */l("span",{children:N})]}),k=i(e=>{p||(s?.(e),o?.(),y(!1))},[p,s,o,y]);if(q&&e){const a=t(e)[0];return a?r(a,{onClick:e=>{k(e),a.props?.onClick?.(e)},className:m(a.props?.className,C)}):null}return n?/* @__PURE__ */l(b,{to:n,onClick:k,className:C,children:T}):/* @__PURE__ */l("button",{onClick:k,className:C,disabled:p,type:"button",children:T})}function O({className:e}){/* @__PURE__ */
|
|
9
|
+
return l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */l("path",{fill:"currentColor",d:"M9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"})})}export{T as a,N as c,z as i,x as l,C as n,y as o,k as r,q as s,O as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e,v as r}from"./DrrpB4Om.js";import{N as a,P as t,i as l,n as i,u as n,v as o}from"./CaX2xgrP.js";import{u as s}from"./ChJXhA9c.js";import{t as d}from"./CATr-3VW.js";import{t as c}from"./DGbyGc8b.js";import{n as m}from"./DGGc10Cy.js";import{t as g}from"./CM46vluW.js";import{t as h}from"./
|
|
1
|
+
import{t as e,v as r}from"./DrrpB4Om.js";import{N as a,P as t,i as l,n as i,u as n,v as o}from"./CaX2xgrP.js";import{u as s}from"./ChJXhA9c.js";import{t as d}from"./CATr-3VW.js";import{t as c}from"./DGbyGc8b.js";import{n as m}from"./DGGc10Cy.js";import{t as g}from"./CM46vluW.js";import{t as h}from"./CZ9iaxjO2.js";import{t as f}from"./N4HKgEC52.js";function p({className:r}){/* @__PURE__ */
|
|
2
2
|
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m12 152a8 8 0 0 1-16 0V95l-11.56 7.71a8 8 0 1 1-8.88-13.32l24-16A8 8 0 0 1 140 80Z"})})}function b({className:r}){/* @__PURE__ */
|
|
3
3
|
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m-4 164a35.7 35.7 0 0 1-25.71-10.81A8 8 0 1 1 109.71 166A20 20 0 1 0 124 132a8 8 0 0 1-6.55-12.59L136.63 92H104a8 8 0 0 1 0-16h48a8 8 0 0 1 6.55 12.59l-21 30A36 36 0 0 1 124 188"})})}function x({className:r}){/* @__PURE__ */
|
|
4
4
|
return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256",className:r,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m24 144a8 8 0 0 1 0 16h-48a8 8 0 0 1-6.4-12.8l43.17-57.56a16 16 0 1 0-27.86-15a8 8 0 0 1-15.09-5.34a32 32 0 1 1 55.74 29.93L120 168Z"})})}var u=e=>{if(!e)return"";const r=e.trim().split(/\s+/);return 1===r.length?r[0]:`${r[0]} ${r[1]?.[0]?`${r[1][0]}.`:""}`},v={first:{size:"size-28",imageSize:"size-24",borderColor:"border-amber-400",gradient:"from-amber-400/20 via-yellow-300/10 to-transparent"},second:{size:"size-20",imageSize:"size-16",borderColor:"border-slate-400",gradient:"from-slate-400/20 via-slate-300/10 to-transparent"},third:{size:"size-20",imageSize:"size-16",borderColor:"border-amber-600",gradient:"from-amber-600/20 via-amber-500/10 to-transparent"}},N=(e,r)=>{const a=void 0===e.totalPoint?e.maxScore:e.totalPoint;return void 0===a?"—":a.toFixed(r?2:0)},w=({entry:a,position:t,showFloatingPoint:i,hidePictures:n})=>{const o=1===t?v.first:2===t?v.second:v.third,s={1:p,2:x,3:b}[t],c={1:{bg:"bg-amber-400",border:"border-amber-600",text:"text-amber-900"},2:{bg:"bg-slate-300",border:"border-slate-500",text:"text-slate-700"},3:{bg:"bg-amber-600",border:"border-amber-800",text:"text-amber-100"}},m=r(e=>{e.currentTarget.style.display="none"},[]);/* @__PURE__ */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{h as a,t as e}from"./DrrpB4Om.js";import{D as o,n as s}from"./CaX2xgrP.js";import{c as l,t as r}from"./ChJXhA9c.js";import{t as i}from"./CATr-3VW.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./C3dOFk9A.js";import{i as d,s as p,t as m}from"./DlqJDAie2.js";import{n as c,r as g,t as u}from"./DlRUi0u42.js";var f=()=>{const{t:f}=t(),h=l(),[w,v]=a(""),[b,y]=a(""),[C
|
|
2
|
-
return e("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */e("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const e=d(w),o=p(b);if(e||o)return void
|
|
3
|
-
/* @__PURE__ */e("div",{className:"space-y-9",children:[/* @__PURE__ */e(m,{label:f("auth.email","Email address"),name:"email",disabled:
|
|
1
|
+
import{h as a,t as e}from"./DrrpB4Om.js";import{D as o,n as s}from"./CaX2xgrP.js";import{c as l,t as r}from"./ChJXhA9c.js";import{t as i}from"./CATr-3VW.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./C3dOFk9A.js";import{i as d,s as p,t as m}from"./DlqJDAie2.js";import{n as c,r as g,t as u}from"./DlRUi0u42.js";var f=()=>{const{t:f}=t(),h=l(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,k]=a(null),[x,A]=a(!1),[D,L]=a({}),{loginUsingEmail:P,loginWithGoogle:S,loginWithApple:E}=s(),[F,O]=a({google:!1,apple:!1}),W=a=>{L(e=>e[a]?{...e,[a]:void 0}:e)},G=async(a,e)=>{O(e=>({...e,[a]:!0})),k(null);try{await(e?.())}catch(o){o instanceof Error?k(o.message):k(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{O(e=>({...e,[a]:!1}))}};/* @__PURE__ */
|
|
2
|
+
return e("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */e("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const e=d(w),o=p(b);if(e||o)return void L({email:e,password:o});L({}),C(!0),k(null);const s=await(P?.(w.toLowerCase(),b));s?.error&&k(s.error),C(!1)},className:"space-y-6",children:[
|
|
3
|
+
/* @__PURE__ */e("div",{className:"space-y-9",children:[/* @__PURE__ */e(m,{label:f("auth.email","Email address"),name:"email",disabled:j,type:"email",value:w,onChange:a=>{v(a.target.value),W("email")},autoComplete:"email",error:D.email}),/* @__PURE__ */e(m,{label:f("auth.password","Password"),name:"password",disabled:j,type:x?"text":"password",value:b,onChange:a=>{y(a.target.value),W("password")},autoComplete:"current-password",error:D.password,actionLabel:x?"Hide password":"Show password",actionIcon:/* @__PURE__ */e(x?u:c,{className:"size-5"}),onActionClick:()=>A(!x)})]}),N&&/* @__PURE__ */e(i,{align:"center",color:"error",className:"font-medium",children:N}),
|
|
4
4
|
/* @__PURE__ */e("div",{className:"flex justify-end",children:/* @__PURE__ */e(r,{to:o.FORGOT_PASSWORD,state:{from:h.pathname},children:/* @__PURE__ */e(i,{variant:"h6",className:"w-fit",children:f("button.forgotPassword","Forgot Password?")})})}),
|
|
5
|
-
/* @__PURE__ */e(n,{type:"submit",color:"primary",className:"w-full",loading:
|
|
5
|
+
/* @__PURE__ */e(n,{type:"submit",color:"primary",className:"w-full",loading:j,disabled:j,children:f("button.login","Login")})]}),/* @__PURE__ */e("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */e(g,{disabled:j||F.google||F.apple,loading:F.google,onClick:()=>G("google",S),provider:"google"}),/* @__PURE__ */e(g,{disabled:j||F.google||F.apple,loading:F.apple,onClick:()=>G("apple",E),provider:"apple"})]})]})};export{f as default};
|