PageSourceSearch

https://dashboard.relevic.com/static/js/502.1aae78c3.chunk.js

js relevic.com collected 2026-10-01 02:23:43 UTC 37,472 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkrelevicfrontend=self.webpackChunkrelevicfrontend||[]).push([[502],{99502:(e,s,r)=>{r.r(s),r.d(s,{default:()=>Ke});var t=r(47313),n=r(80207),i=r(82762),a=r(63989),l=r(55878),o=r(32313),d=r(6959),c=r(65893),h=r(51544),u=r(68441),x=r(46417),p=(0,h.G)((function(e,s){const r=(0,d.bt)(e),t=(0,a.s)();return(0,x.jsx)(u.m.div,{...r,width:"100%",ref:s,className:(0,c.cx)("chakra-tabs__tab-panels",e.className),__css:t.tabpanels})}));p.displayName="TabPanels";var m=(0,h.G)((function(e,s){const r=(0,d.WE)({...e,ref:s}),t=(0,a.s)();return(0,x.jsx)(u.m.div,{outline:"0",...r,className:(0,c.cx)("chakra-tabs__tab-panel",e.className),__css:t.tabpanel})}));m.displayName="TabPanel";var g=r(52982),j=r(1396),w=r(65059),f=r(13991),y=r(41953),b=r(92293),v=r(42061),k=r(93241),C=r(88910),I=r(62652),S=r(94722),T=r(16442),D=r(67727),z=r(22539),P=r(78437),_=r(51009),E=r(10896),A=r(36316),O=r(36113);function N(e){let{}=e;const s=(0,t.useRef)(null),[r,n]=(0,t.useState)(!1),{user:a,activeWorkspaceId:l}=(0,P.C)(_.Hz),[o,d]=(0,t.useState)({name:"",email:"",profileUrl:a.profileUrl}),[c,{isLoading:h}]=(0,E.yy)(),u=(0,A.a)(),p=(0,P.T)(),m=(0,g.p)(),[N,R]=(0,t.useState)({message:"",type:"success"}),L=(0,t.useCallback)((async e=>{if(e.target.files&&e.target.files[0]){const r=e.target.files[0],t=r.type;if("image/png"!==t&&"image/jpeg"!==t&&"image/jpg"!==t)return;let i=new FormData;if(i.append("image",r),i.append("fileType",t.split("/")[1]),u){n(!0);try{const e=await c({workspaceId:l,settingItem:"update-profile-image",body:i}).unwrap();await p((0,_.Nq)({profileUrl:e.result.profileUrl})),R({message:e.result.message,type:"success"})}catch(s){const e=new O.M(s);R({message:e.message,type:"error"})}finally{n(!1)}}}e.target.value=""}),[u,c,l,p]);return(0,t.useLayoutEffect)((()=>{d({name:a.name,email:a.email,profileUrl:a.profileUrl})}
1),[a]),(0,t.useEffect)((()=>{""!==N.message&&m({title:"Settings Status",position:"top-right",description:N.message,status:N.type||"success",duration:9e3,isClosable:!0})}),[N,m]),(0,x.jsxs)(j.k,{direction:"column",gap:10,height:"40vh",children:[(0,x.jsx)(w.X,{fontSize:"xl",alignSelf:"flex-start",children:"Profile Settings"}),(0,x.jsxs)(j.k,{width:"100%",direction:"row",height:"100%",gap:"5vw",children:[(0,x.jsx)(j.k,{width:"20%",children:r?(0,x.jsx)(f.$,{color:"yellow.400"}):(0,x.jsxs)(i.g,{alignItems:"center",justifyContent:"center",spacing:5,children:[(0,x.jsx)(y.K,{direction:"column",children:(0,x.jsx)(b.q,{name:o.name,src:o.profileUrl?o.profileUrl:"",size:"2xl"})}),(0,x.jsxs)(v.U,{justifyContent:"center",alignItems:"center",children:[(0,x.jsx)(k.I,{type:"file",accept:".png, .jpg, .jpeg",padding:"0",borderWidth:0,hidden:!0,ref:s,onChange:L,max:5242880}),(0,x.jsx)(C.h,{icon:(0,x.jsx)(z.s_P,{}),fontSize:"xl",color:"black",background:"gray.200","aria-label":"upload Image",onClick:()=>{s.current&&s.current.click()}})," ",(0,x.jsx)(C.h,{icon:(0,x.jsx)(z.ZkW,{}),fontSize:"xl",color:"red.500",background:"gray.200","aria-label":"Delete Image"})]})]})}),(0,x.jsx)(I.i,{orientation:"vertical",bgColor:"blackAlpha.700",width:"1px",height:"100%"}),(0,x.jsx)(j.k,{width:"40%",height:"100%",children:(0,x.jsxs)(i.g,{flex:"1",justifyContent:"stretch",width:"100%",spacing:6,children:[(0,x.jsxs)(i.g,{width:"100%",children:[(0,x.jsxs)(i.g,{width:"100%",alignItems:"flex-start",children:[(0,x.jsx)(S.x,{children:"Email"}),(0,x.jsx)(k.I,{isDisabled:!0,bgColor:"gray.400",color:"black",value:o.email})]}),(0,x.jsxs)(i.g,{width:"100%",alignItems:"flex-start",children:[(0,x.jsx)(S.x,{children:"Name"}),(0,x.jsx)(k.I,{name:"name",value:o.name,isDisabled:h,onChange:e=>{const s=e.target.name,r=e.target.value;d((e=>({...e,[s]:r})))}})]})]}),(0,x.jsx)(T.L,{}),(0,x.jsx)(D.z,{alignSelf:"flex-end",variant:"primary",onClick:async()=>{try{const e=await c({workspaceId:l,settingItem:"update-user-information",body:o}).unwrap();R({message:e.result.message,type:"success"}),p((0,_.Nq)({name:e.result.name}))}catch(e){const s=new O.M(e);R({message:s.message,type:"error"})}},isDisabled:h,children:"Save Changes"})]})})]})]})}var R=r(56636),L=r(558),M=r(70841),Y=r(95577),W=r(22317),U=r(30755),F=r(25155),X=r(8248),q=r(18323),Z=r(56360),G=r(27094),K=r(5521),B=r(65549),H=r(41237),J=r(23216),$=r(22190),V=r(58816),Q=r(35784),ee=r(71433),se=r(39346),re=r(79976),te=r(67345),ne=r(2504),ie=r(26998),ae=r(92681),le=r(24128),oe=r(96653),de=r(37394),ce=r(10745),he=r(26587),ue=r(58467),xe=r(31096),pe=r(60230),me=r(41536),ge=r(49851),je=r(73146);function we(e){var s,r,n;let{}=e;const{user:a,activeWorkspaceId:l}=(0,P.C)(_.Hz),[o,d]=(0,t.useState)(!1),[c,h]=(0,t.useState)(!1),[u,p]=(0,t.useState)([]),[m,f]=(0,t.useState)(""),[b,C]=(0,t.useState)({oldPassword:"",password:"",confirmPassword:""}),[z,A]=(0,t.useState)({oldPassword:!1,password:!1,confirmPassword:!1}),[N,ae]=(0,t.useState)({message:"",type:"success"}),[le,oe]=(0,t.useState)(""),[he,we]=(0,t.useState)(!1),ve=(0,ue.s0)(),{isOpen:ke,onOpen:Ce,onClose:Ie}=(0,R.q)(),Se=t.useRef(null),Te=(0,P.T)(),De=()=>{oe(""),Ie()},ze="local"===a.signupType?["oldPassword","password","confirmPassword"]:["password","confirmPassword"],{isFormValid:Pe,errors:_e,clearErrors:Ee}=(0,pe.j)(b,ze),[Ae,{isLoading:Oe}]=(0,E.yy)(),{data:Ne,isLoading:Re,refetch:Le}=(0,E.W7)({workspaceId:l,settingItem:"get-user-workspaces"}),[Me,{isLoading:Ye}]=(0,E.cG)(),We={..._e},Ue=(0,g.p)(),Fe=e=>{p([]),Ee();const{name:s,value:r}=e.target;C((e=>({...e,[s]:r})))},Xe=async e=>{if(e.preventDefault(),"google"===a.signupType&&!Pe())return;const s="local"===a.signupType?{signupType:a.signupType}:{password:b.password,confirmPassword:b.confirmPassword,signupType:a.signupType};try{const e=await Ae({workspaceId:l,settingItem:"update-user-signup-type",body:s}).unwrap();C({oldPassword:"",password:"",confirmPassword:""}),ae({message:e.result.message,type:"success"}),"success"===e.result.status&&(Te((0,_.Nq)({...a,signupType:e.result.signupType})),"changeRequested"===e.result.signupType&&(window.location.href="https://services.relevic.com/api/auth/login/google"))}catch(r){const e=new O.M(r);ae({message:e.message,type:"error"})}},qe=e=>{A({...z,[e]:!z[e]})},Ze=(0,t.useCallback)((async(e,s,r)=>{e.preventDefault(),h(!0);const t={teamMembers:[{userId:r,role:"Owner"}]};try{if(""===r)ae({message:"Please select an option",type:"error"});else{const e=await Ae({workspaceId:s,settingItem:"update-team-members",body:t}).unwrap();Te(E.pJ.util.invalidateTags([{type:"workspace",id:"get-team-members-list"}])),Te(je.pC.util.invalidateTags(["workspaces"])),ae({message:e.result.message,type:"success"}),await Le(),Ie(),oe("")}}catch(n){const e=new O.M(n).message;ae({message:e,type:"error"})}}),[Ae,Ie,Le,Te]);(0,t.useEffect)((()=>{""!==N.message&&Ue({title:"Settings Status",position:"top-right",description:N.message,status:N.type||"success",duration:9e3,isClosable:!0})}),[N,Ue]);return(0,x.jsxs)(j.k,{style:{overflowY:"scroll",height:"90vh"},pb:14,width:"100%",direction:"column",gap:7,children:[(0,x.jsx)(j.k,{direction:"row",height:"40%",children:(0,x.jsx)(i.g,{flex:"1",justifyContent:"stretch",width:"100%",spacing:6,children:"local"===a.signupType?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(w.X,{fontSize:"xl",alignSelf:"flex-start",children:"Update Your Password Settings"}),(0,x.jsxs)(v.U,{width:"100%",spacing:10,alignItems:"flex-start",children:[(0,x.jsx)(fe,{text:"Old Password",name:"oldPassword",type:z.oldPassword?"text":"password",value:b.oldPassword,onChange:Fe,placeholder:"Enter your old password",color:z.oldPassword?"gray.200":"yellow.400",onClick:()=>qe("oldPassword")}),(0,x.jsxs)(i.g,{width:"100%",alignItems:"flex-start",children:[(0,x.jsx)(fe,{text:"New Password",name:"password",type:z.password?"text":"password",value:b.password,onChange:Fe,placeholder:"Enter your new password",color:z.password?"gray.200":"yellow.400",onClick:()=>qe("password")}),(0,x.jsx)(fe,{text:"Confirm Password",name:"confirmPassword",type:z.password?"text":"password",value:b.confirmPassword,onChange:Fe,placeholder:"Reconfirm your password",color:z.password?"gray.200":"yellow.400",onClick:()=>qe("password")})]})]}),(0,x.jsx)(T.L,{}),(0,x.jsxs)(v.U,{width:"100%",children:[(0,x.jsxs)(i.g,{alignItems:"flex-start",children:[We&&Object.keys(We).length>0&&Object.entries(We).map((e=>{let[s,r]=e;return(0,x.jsx)(ge.Z,{children:r},s)})),u.length>0&&(0,x.jsx)(ge.Z,{children:u})]}),(0,x.jsx)(T.L,{}),(0,x.jsxs)(v.U,{alignSelf:"flex-end",children:[(0,x.jsx)(D.z,{variant:"primary",width:"100%",onClick:async e=>{if(e.preventDefault(),Pe())try{const e=await Ae({workspaceId:l,settingItem:"update-user-password",body:b}).unwrap();ae({message:e.result.message,type:"success"}),C({oldPassword:"",password:"",confirmPassword:""})}catch(s){const e=new O.M(s).message;ae({message:e,type:"error"})}},isDisabled:Oe,children:"Reset Password"}),(0,x.jsx)(D.z,{leftIcon:(0,x.jsx)(de.JM8,{}),variant:"primary",backgroundColor:"white",borderColor:"yellow.400",borderWidth:"2px",width:"100%",paddingX:"30px",onClick:Xe,isDisabled:Oe,children:"Connect with google"})]})]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(w.X,{fontSize:"xl",alignSelf:"flex-start",children:"Disconnect Your Google Account"}),(0,x.jsxs)(v.U,{width:"100%",spacing:10,alignItems:"flex-start",children:[(0,x.jsxs)(i.g,{width:"100%",alignItems:"flex-start",alignSelf:"center",spacing:2,children:[(0,x.jsx)(D.z,{leftIcon:(0,x.jsx)(de.JM8,{}),variant:"primary",backgroundColor:"white",borderColor:"yellow.400",borderWidth:"2px",width:"100%",paddingX:"30px",onClick:Xe,isDisabled:Oe,children:"Disconnect with google"}),(0,x.jsxs)(i.g,{alignItems:"flex-start",children:[We&&Object.keys(We).length>0&&Object.entries(We).map((e=>{let[s,r]=e;return(0,x.jsx)(ge.Z,{children:r},s)})),u.length>0&&(0,x.jsx)(ge.Z,{children:u})]})]}),(0,x.jsxs)(i.g,{width:"100%",alignItems:"flex-start",children:[(0,x.jsx)(fe,{text:"New Password",name:"password",type:z.password?"text":"password",value:b.password,onChange:Fe,placeholder:"Enter your password",color:z.password?"gray.200":"yellow.400",onClick:()=>qe("password")}),(0,x.jsx)(fe,{text:"Confirm Password",name:"confirmPassword",type:z.password?"text":"password",value:b.confirmPassword,onChange:Fe,placeholder:"Reconfirm your password",color:z.password?"gray.200":"yellow.400",onClick:()=>qe("password")})]})]})]})})}),(0,x.jsx)(j.k,{direction:"row",height:"1%",justifyContent:"center",children:(0,x.jsx)(I.i,{orientation:"horizontal",width:"50px",height:"40px",borderColor:"gray.400",padding:"-50px",marginY:"-10",flexGrow:"0.9",alignSelf:"center"})}),(0,x.jsx)(j.k,{direction:"row",children:(0,x.jsxs)(i.g,{flex:"1",justifyContent:"stretch",width:"100%",spacing:6,paddingY:5,children:[(0,x.jsxs)(v.U,{width:"100%",spacing:3,alignItems:"baseline",children:[(0,x.jsx)(w.X,{fontSize:"xl",alignSelf:"baseline",children:"Delete Account"}),(0,x.jsxs)(L.J,{children:[(0,x.jsx)(M.x,{children:(0,x.jsx)(ce.h,{alignSelf:"baseline",role:"button"})}),(0,x.jsxs)(Y.y,{children:[(0,x.jsx)(W.Q,{}),(0,x.jsx)(U.u,{}),(0,x.jsx)(F.Y,{color:"red",children:"Important"}),(0,x.jsx)(X.b,{children:"You cannot delete an account if you're the sole owner of a workspace having more than one members."}
1),(0,x.jsx)(X.b,{children:'Before deletion, you must click on the "Share" button to share the ownership with another member'})]})]})]}),(0,x.jsx)(q.x,{width:"100%",bgColor:"white",boxShadow:"md",padding:5,borderRadius:"md",children:(0,x.jsxs)(Z.i,{variant:"simple",children:[(0,x.jsx)(G.h,{children:(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(B.Th,{width:"20%",children:"Workspace Name"}),(0,x.jsx)(B.Th,{width:"20%",children:"Workspace members"}),(0,x.jsx)(B.Th,{width:"20%",children:"Current Role"}),(0,x.jsx)(B.Th,{width:"10%",children:"Action"})]})}),(0,x.jsx)(H.p,{children:null===Ne||void 0===Ne||null===(s=Ne.result)||void 0===s||null===(r=s.data)||void 0===r?void 0:r.map((e=>{var s;let r=0,t=0,n=0,i="",l="";return e.members.forEach((e=>{e.userId===a._id&&(i=e.role,l=e.userId),"Owner"===e.role?r++:"Admin"===e.role?t++:"Designer"===e.role&&n++})),(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(J.Td,{children:e.name}),(0,x.jsxs)(J.Td,{children:["Owners: ",(0,x.jsx)("b",{children:r})," | Admins:"," ",(0,x.jsx)("b",{children:t})," | Designers: ",(0,x.jsx)("b",{children:n})]}),(0,x.jsx)(J.Td,{children:i}),(0,x.jsx)(J.Td,{children:ye(e,a)?(0,x.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(D.z,{variant:"primary",onClick:Ce,children:"Share Ownership"}),(0,x.jsxs)($.u_,{isOpen:ke,onClose:De,isCentered:!0,size:{base:"2xl",xl:"4xl","2xl":"5xl"},children:[(0,x.jsx)(V.Z,{}),(0,x.jsxs)(Q.h,{maxW:{lg:"25%"},style:{zIndex:"9999"},children:[(0,x.jsx)(ee.x,{alignSelf:"left",children:"Select Any"}),(0,x.jsx)(j.k,{direction:"row",height:"5%",justifyContent:"center",paddingY:"-1",children:(0,x.jsx)(I.i,{orientation:"horizontal",borderColor:"gray.400",flexGrow:"0.1",alignSelf:"center",marginX:"4"})}),(0,x.jsx)(se.o,{}),(0,x.jsxs)(re.f,{alignSelf:"left",paddingY:1,marginY:4,children:[(0,x.jsx)(te.E,{value:le,onChange:oe,children:(0,x.jsx)(y.K,{direction:"column",children:null===e||void 0===e||null===(s=e.members)||void 0===s?void 0:s.map((e=>e.userId!==a._id&&(0,x.jsxs)(ne.Y,{value:e.userId,children:[e.name," (",e.role,")"]},e.userId)))})}),(0,x.jsx)(j.k,{justifyContent:"right",padding:"2",marginY:"5",children:(0,x.jsx)(D.z,{isLoading:c,loadingText:"Sharing...",variant:"primary",onClick:s=>Ze(s,e._id,le),children:"Share"})})]})]})]})]}):"No Action Required"})]},e._id)}))})]})})]})}),(0,x.jsx)(j.k,{justifyContent:"flex-end",alignItems:"center",height:"5%",children:(0,x.jsxs)(v.U,{spacing:"24px",paddingX:10,children:[(0,x.jsxs)($.u_,{isOpen:he,onClose:()=>{we(!1)},isCentered:!0,size:{base:"2xl",xl:"4xl","2xl":"5xl"},children:[(0,x.jsx)(V.Z,{}),(0,x.jsxs)(Q.h,{maxW:{lg:"25%"},style:{zIndex:"9999"},children:[(0,x.jsx)(ee.x,{alignSelf:"left",children:"Delete Account"}),(0,x.jsx)(j.k,{direction:"row",height:"5%",justifyContent:"center",paddingY:"-1",children:(0,x.jsx)(I.i,{orientation:"horizontal",borderColor:"gray.400",flexGrow:"0.1",alignSelf:"center",marginX:"4"})}),(0,x.jsx)(se.o,{}),(0,x.jsxs)(re.f,{alignSelf:"left",children:[(0,x.jsx)(S.x,{paddingY:1,marginY:2,children:"Deleting your account will remove all of your information from our database. This cannot be undone."}),(0,x.jsxs)(ie.NI,{children:[(0,x.jsx)(S.x,{paddingY:1,marginY:2,fontSize:"small",color:"gray.400",children:'To confirm this, type "PERMANENTLY DELETE"'}),(0,x.jsx)(k.I,{ref:Se,onChange:e=>f(e.target.value)})]}),(0,x.jsx)(j.k,{justifyContent:"right",padding:"2",marginY:"5",children:(0,x.jsx)(D.z,{isLoading:o,variant:"solid",paddingX:"30px",loadingText:"Deleting",colorScheme:"red",isDisabled:"PERMANENTLY DELETE"!==m,onClick:()=>(async()=>{try{d(!0),"success"===(await Me({workspaceId:l,settingItem:"delete-user",id:a._id}).unwrap()).result.status&&(Te((0,me.ZT)()),Te((0,_.ni)()),setTimeout((()=>xe.D.purge()),200),ve("/"))}catch(e){console.error("Failed to delete setting item:",e)}})(),children:"Delete"})})]})]})]}),(0,x.jsx)(D.z,{loadingText:"Deleting",variant:"solid",colorScheme:"red",paddingX:5,onClick:()=>{we(!0)},isDisabled:be(null===Ne||void 0===Ne||null===(n=Ne.result)||void 0===n?void 0:n.data,a),children:"Delete Account"})]})})]})}const fe=e=>{let{text:s,type:r,name:t,value:n,placeholder:a,onChange:l,color:o,onClick:d}=e;return(0,x.jsx)(i.g,{width:"100%",alignItems:"flex-start",children:(0,x.jsxs)(ie.NI,{isRequired:!0,gap:2,children:[(0,x.jsx)(ae.l,{children:s}),(0,x.jsxs)(le.B,{children:[(0,x.jsx)(k.I,{type:r,name:t,value:n,placeholder:a,onChange:l}),(0,x.jsx)(oe.x,{children:(0,x.jsx)(he.O,{color:o,onClick:d})})]})]})})},ye=(e,s)=>{let r=0,t="";for(let n=0;n<e.members.length;n++)"Owner"===e.members[n].role&&r++,e.members[n].userId===s._id&&(t=e.members[n].role);return"Owner"===t&&(1!==e.members.length&&!(r>1))},be=(e,s)=>{if(e)for(let r=0;r<e.length;r++)if(ye(e[r],s))return!0;return!1};var ve=r(72814);const ke=(e,s,r)=>e.every((e=>{const t=s.find((s=>s[r]===e[r]));return t&&JSON.stringify(t)===JSON.stringify(e)}));var Ce=r(42481);let Ie=function(e){return e.Owner="Owner",e.Admin="Admin",e.Designer="Designer",e}({});function Se(e){let{}=e;const s=(0,P.C)(_.NP),{user:r,activeWorkspaceId:n}=(0,P.C)(_.Hz),[i,a]=(0,t.useState)(!1),[l,o]=(0,t.useState)([{userId:"",profileUrl:"",email:"",name:"",role:"",status:""}]),d=(0,t.useRef)(null),c=(0,t.useRef)([]),[h,u]=(0,t.useState)(0),[p,m]=(0,t.useState)(!1),w=(0,g.p)(),[f,y]=(0,t.useState)({message:"",type:"success"}),{data:I,isLoading:S,error:T,refetch:A}=(0,E.W7)({workspaceId:n,settingItem:"get-team-members-list"}),[N,{isLoading:R}]=(0,E.yy)(),L=(0,P.T)(),M=(0,t.useCallback)((async(e,s)=>{a(!0);try{const r=await N({workspaceId:n,settingItem:s,body:e}).unwrap();y({message:r.result.message,type:"success"}),await A(),L(E.pJ.util.invalidateTags([{type:"workspace",id:"get-user-workspaces"}])),L(je.pC.util.invalidateTags(["workspaces"]))}catch(T){const s=new O.M(T).message;y({message:s,type:"error"})}finally{null!==d.current&&null!==d.current.value&&(d.current.value=""),a(!1)}}),[n,L,N,A]),Y=(0,t.useCallback)((async e=>{if(d.current){const e=d.current.value;(0,Ce.vV)(e)?M({email:e},"add-team-member"):y({message:"Please enter a valid email",type:"error"})}}),[M]),W=(0,t.useCallback)((async e=>{if(e.preventDefault(),!p)return;const s={teamMembers:[...l]};M(s,"update-team-members")}),[p,l,M]),U=(0,t.useCallback)((async(e,s)=>{var r;let t;e.preventDefault();const n=null===(r=l.find((e=>e.email===s)))||void 0===r?void 0:r.userId;t=n?{deleteMemberId:n}:{deleteMemberEmail:s},M(t,"delete-team-member")}),[M,l]);return(0,t.useEffect)((()=>
1{if(I)o(I.result.teamMembers),c.current=null!==I&&void 0!==I&&I.result.teamMembers?[...I.result.teamMembers]:[],m(!1);else if(T){const e=new O.M(T);y({message:e.message,type:"error"})}}),[I,T]),(0,t.useEffect)((()=>{""!==f.message&&w({title:"Settings Status",position:"top-right",description:f.message,status:f.type||"success",duration:9e3,isClosable:!0})}),[f,w]),(0,t.useEffect)((()=>{if(I){var e;const r=null===I||void 0===I||null===(e=I.result)||void 0===e?void 0:e.teamMembers;let t=0;for(let e=0;e<(null===r||void 0===r?void 0:r.length);e++){var s;"Owner"===(null===r||void 0===r||null===(s=r[e])||void 0===s?void 0:s.role)&&t++}u(t)}}),[I,s]),(0,x.jsx)(j.k,{width:"100%",overflowY:"auto",maxHeight:{base:"70vh",sm:"90vh"},children:(0,x.jsxs)(j.k,{direction:"column",gap:10,width:"100%",children:[(0,x.jsx)(j.k,{alignSelf:"flex-end",children:s!==Ie.Designer&&(0,x.jsxs)(v.U,{spacing:0,borderRadius:6,border:"1px solid",borderColor:(null===l||void 0===l?void 0:l.length)>5||i?"gray.400":"yellow.400",children:[(0,x.jsx)(k.I,{borderRightRadius:0,minWidth:{xl:"250px","2xl":"300px"},placeholder:"Enter Email",ref:d,isDisabled:i,onKeyDown:e=>{console.log(e.key),"Enter"===e.key&&Y(e)},sx:{"::placeholder":{fontSize:{base:"xs",sm:"md"}}}}),(0,x.jsx)(D.z,{variant:"primary",width:"100%",borderLeftRadius:0,isDisabled:i,onClick:Y,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontSize:{base:"xs",sm:"md"},children:"Add Team Member"})]})}),(0,x.jsx)(q.x,{width:"100%",bgColor:"white",p:5,borderRadius:"md",boxShadow:"md",children:(0,x.jsxs)(Z.i,{variant:"simple",children:[(0,x.jsx)(G.h,{children:(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(B.Th,{width:"10%",children:"Profile"}),(0,x.jsx)(B.Th,{width:"20%",children:"Name"}),(0,x.jsx)(B.Th,{width:"20%",children:"Email"}),(0,x.jsx)(B.Th,{width:"20%",children:"Role"}),(0,x.jsx)(B.Th,{width:"20%",children:"Status"}),(0,x.jsx)(B.Th,{width:"10%",children:"Action"})]})}),(0,x.jsx)(H.p,{children:null===l||void 0===l?void 0:l.map((e=>(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(J.Td,{children:(0,x.jsx)(b.q,{size:"md",name:e.name,src:e.profileUrl})}),(0,x.jsx)(J.Td,{children:e.name}),(0,x.jsx)(J.Td,{children:e.email}),s===Ie.Designer||s===Ie.Admin||s===Ie.Owner&&1===h&&e.userId===r._id?(0,x.jsx)(J.Td,{children:e.role}):(0,x.jsx)(J.Td,{children:(0,x.jsx)(ve.P,{variant:"primary",value:e.role,width:{xl:"150px","2xl":"200px"},border:"2px solid",borderColor:"gray.200",onChange:s=>((e,s)=>{e.preventDefault();const r=e.target.value,t=l.findIndex((e=>e.email===s));if(-1!==t){const e=[...l];e[t]={...l[t],role:r},o(e),m(!ke(e,c.current,"email"))}})(s,e.email),isDisabled:s===Ie.Designer,children:Object.values(Ie).map((e=>(0,x.jsx)("option",{value:e,children:e},e)))})}),(0,x.jsx)(J.Td,{children:e.status}),(0,x.jsx)(J.Td,{children:e.userId!==r._id&&(0,x.jsx)(C.h,{icon:(0,x.jsx)(z.ZkW,{}),fontSize:"xl",color:"red.500",background:"gray.200","aria-label":"Delete Image",onClick:s=>U(s,e.email),isDisabled:s===Ie.Designer})})]},e.email)))})]})}),(0,x.jsx)(v.U,{width:"100%",justifyContent:"flex-end",children:(0,x.jsx)(D.z,{variant:"primary",isDisabled:!p||S||R,onClick:W,children:"Save Changes"})})]})})}var Te=r(42549),De=r(30969),ze=r(39875),Pe=r(65204),_e=r(22016),Ee=r(75009),Ae=r(20844),Oe=r(3373),Ne=r(34445);function Re(e){let{}=e;const{isOpen:s,onOpen:r,onClose:n}=(0,R.q)(),[i,a]=(0,t.useState)(""),[l,o]=(0,t.useState)(""),[d,c]=(0,t.useState)({edit:"",leave:"",delete:""}),{user:h,workspaces:u}=((0,P.C)(_.Gt),(0,P.C)(_.Hz)),p=(0,ue.s0)(),m=(0,t.useRef)(null),[w,f]=(0,t.useState)(!1),[y,b]=(0,t.useState)(!1),C=(0,g.p)(),[T,E]=(0,t.useState)(!1),[A,{isLoading:N}]=(0,_e._J)(),[L,M]=(0,t.useState)({message:"",type:"success"}),[Y,{isLoading:W}]=(0,je.c1)(),[U,{isLoading:F}]=(0,je.ic)(),[X,{isLoading:te}]=(0,je.bq)(),ne=(0,P.T)(),ae=(0,t.useCallback)((async e=>{e.preventDefault();try{await Y({workspaceId:"undefined",featureItem:"create-workspace",body:{...h,workspaceName:i}}).unwrap();ne(je.pC.util.invalidateTags(["workspaces"]))}catch(s){const e=new O.M(s).message;M({message:e,type:"error"})}finally{a("")}}),[Y,h,ne,i]);(0,t.useEffect)((()=>{""!==L.message&&C({title:"Settings Status",position:"top-right",description:L.message,status:L.type||"success",duration:9e3,isClosable:!0})}),[L,C]);const le=u;return(0,x.jsx)(j.k,{overflowY:"auto",height:"83vh",children:(0,x.jsxs)(j.k,{width:"100%",direction:"column",gap:10,children:[""!==d.delete&&(0,x.jsxs)($.u_,{isOpen:s,onClose:n,isCentered:!0,size:{base:"2xl",xl:"4xl","2xl":"5xl"},children:[(0,x.jsx)(V.Z,{}),(0,x.jsxs)(Q.h,{maxW:{lg:"25%"},style:{zIndex:"9999"},children:[(0,x.jsx)(ee.x,{alignSelf:"left",children:"Delete Worksp
1ace"}),(0,x.jsx)(j.k,{direction:"row",height:"5%",justifyContent:"center",paddingY:"-1",children:(0,x.jsx)(I.i,{orientation:"horizontal",borderColor:"gray.400",flexGrow:"0.1",alignSelf:"center",marginX:"4"})}),(0,x.jsx)(se.o,{}),(0,x.jsxs)(re.f,{alignSelf:"left",children:[(0,x.jsx)(S.x,{paddingY:1,marginY:2,children:"Deleting your workspace will permanently remove all associated data from our system. This action cannot be undone."}),(0,x.jsxs)(ie.NI,{children:[(0,x.jsx)(S.x,{paddingY:1,marginY:2,fontSize:"small",color:"gray.400",children:'To confirm this, type "PERMANENTLY DELETE"'}),(0,x.jsx)(k.I,{value:l,onChange:e=>o(e.target.value)})]}),(0,x.jsx)(j.k,{justifyContent:"right",padding:"2",marginY:"5",children:(0,x.jsx)(D.z,{isLoading:y,variant:"solid",paddingX:"30px",loadingText:"Deleting",colorScheme:"red",isDisabled:"PERMANENTLY DELETE"!==l,onClick:()=>(async()=>{M({message:"Deleting workspace",type:"info"});try{b(!0),await U({workspaceId:d.delete,featureItem:"delete-workspace",param1:h._id}).unwrap(),ne(je.pC.util.invalidateTags(["workspaces"])),b(!1),p((0,Ee.BT)(h&&h.baseRoute?h.baseRoute:Ae.ly.base))}catch(e){const s=new O.M(e).message;M({message:s,type:"error"})}finally{c({edit:"",leave:"",delete:""})}})(),children:"Delete"})})]})]})]}),""!==d.leave&&(0,x.jsx)(Ne.Z,{id:`${d.leave}`,message:"Are you sure you want to leave this workspace?",handleCancel:()=>{c({edit:"",leave:"",delete:""})},handleConfirm:()=>(async()=>{try{await X({workspaceId:d.leave,featureItem:"leave-workspace",param1:"undefined",body:{}}).unwrap(),ne(je.pC.util.invalidateTags(["workspaces"])),p((0,Ee.BT)(h&&h.baseRoute?h.baseRoute:Ae.ly.base))}catch(e){const s=new O.M(e).message;M({message:s,type:"error"})}finally{c({edit:"",leave:"",delete:""})}})(),dataAutomationIds:{confirmButton:"button_settings_workspaces_confirmLeave",cancelButton:"button_settings_workspaces_cancelLeave",alertContent:"div_settings_workspaces_deleteLeave"}}),(0,x.jsxs)(j.k,{alignSelf:"flex-end",borderRadius:6,border:"1px solid",borderColor:W||y||N?"gray.400":"yellow.400",children:[(0,x.jsx)(k.I,{borderRightRadius:0,minWidth:{xl:"250px","2xl":"300px"},placeholder:"Enter Workspace Name",onChange:e=>{a(e.target.value)},value:i,onKeyDown:e=>{"Enter"===e.key&&ae(e)},sx:{"::placeholder":{fontSize:{base:"xs",sm:"md"}}}}),(0,x.jsx)(D.z,{variant:"primary",width:"100%",borderLeftRadius:0,isDisabled:W||y||N,onClick:ae,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontSize:{base:"xs",sm:"md"},children:"Create New Workspace"})]}),(0,x.jsx)(q.x,{width:"100%",bgColor:"white",p:5,borderRadius:"md",boxShadow:"md",children:(0,x.jsxs)(Z.i,{variant:"simple",children:[(0,x.jsx)(G.h,{children:(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(B.Th,{width:"15%",children:"Name"}),(0,x.jsx)(B.Th,{width:"20%",children:"Members"}),(0,x.jsx)(B.Th,{width:"15%",children:"Role"}),(0,x.jsx)(B.Th,{width:"10%",children:"Actions"})]})}),(0,x.jsx)(H.p,{children:le.map((e=>{let s=0,t=0,n=0,i="",a="";return e.members.forEach((e=>{e.userId===h._id&&(i=e.role,a=e.userId),"Owner"===e.role?s++:"Admin"===e.role?t++:"Designer"===e.role&&n++})),(0,x.jsxs)(K.Tr,{children:[(0,x.jsx)(J.Td,{children:T&&e._id===d.edit?(0,x.jsx)(k.I,{type:"text",borderWidth:"2px",borderColor:"gray.200",ref:m,defaultValue:e.name}):e.name}),(0,x.jsxs)(J.Td,{children:["Owners: ",(0,x.jsx)("b",{children:s})," | Admins: ",(0,x.jsx)("b",{children:t})," ","| Designers: ",(0,x.jsx)("b",{children:n})]}),(0,x.jsx)(J.Td,{children:i}),(0,x.jsx)(J.Td,{children:(0,x.jsxs)(Te.v,{placement:"bottom-end",children:[(0,x.jsx)(De.j,{as:D.z,rightIcon:(0,x.jsx)(Oe.v,{}),isDisabled:W||y||N,children:"Actions"}),(0,x.jsxs)(ze.q,{children:[(0,x.jsx)(Pe.s,{onClick:()=>{return s=e._id,c({...d,edit:s}),E(!0),void f(!0);var s},icon:(0,x.jsx)(z.zmo,{}),children:"Edit"}),(0,x.jsx)(Pe.s,{icon:(0,x.jsx)(z.IUz,{}),onClick:()=>{return s=e._id,void c({...d,leave:s});var s},children:"Leave Workspace"}),(0,x.jsx)(Pe.s,{icon:(0,x.jsx)(z.ZkW,{}),onClick:s=>(async(e,s)=>{e.preventDefault(),c({...d,delete:s}),r()})(s,e._id),isDisabled:"Owner"!==i,children:"Delete"})]})]})})]},e._id)}))})]})}),(0,x.jsx)(v.U,{width:"100%",justifyContent:"flex-end",children:(0,x.jsx)(D.z,{variant:"primary",isDisabled:!w||N||F||W,onClick:e=>(async e=>{try{var s,r;if(E(!1),null!==(s=m.current)&&void 0!==s&&s.value.trim())await A({workspaceId:d.edit,featureItem:"update-workspace-billing",body:{name:null===(r=m.current)||void 0===r?void 0:r.value}}).unwrap(),ne(je.pC.util.invalidateTags(["workspaces"]));else M({message:"Please enter a name",type:"error"})}catch(t){const e=new O.M(t).message;M({message:e,type:"error"})}})(),children:"Save Changes"})})]})})}var Le=r(37400),Me=r(97939),Ye=r(74200),We=r(14777),Ue=r(68713),Fe=r(4451);let Xe=function(e){return e.Owner="Owner",e.Admin="Admin",e.Designer="Designer",e}({});function qe(e){if(!e)return"\u2014";const s=new Date(e);
1return Number.isNaN(s.getTime())?"\u2014":s.toLocaleString()}function Ze(e){var s,r;let{}=e;const{activeWorkspaceId:n}=(0,P.C)(_.Hz),i=(0,P.C)(_.NP)!==Xe.Designer,a=(0,g.p)(),[l,o]=(0,t.useState)(!1),[d,c]=(0,t.useState)(""),{isOpen:h,onOpen:u,onClose:p}=(0,R.q)(),{onCopy:m,hasCopied:b,setValue:I}=(0,Le.V)(""),{data:T,isLoading:E,error:A,refetch:N}=(0,je.Jf)({workspaceId:n,featureItem:"api-clients"},{skip:!n||!i}),[L]=(0,je.c1)(),[M]=(0,je.ic)(),Y=null!==(s=null===T||void 0===T||null===(r=T.result)||void 0===r?void 0:r.apiClient)&&void 0!==s?s:null,W="active"===(null===Y||void 0===Y?void 0:Y.status);(0,t.useEffect)((()=>{A&&a({title:"API keys",position:"top-right",description:new O.M(A).message,status:"error",duration:9e3,isClosable:!0})}),[A,a]);const U=e=>{a({title:"API keys",position:"top-right",description:new O.M(e).message,status:"error",duration:9e3,isClosable:!0})},F=e=>{c(e),I(e),u()},X=async()=>{o(!0);try{const e=await L({workspaceId:n,featureItem:"api-client",body:{name:"API Client"}}).unwrap();await N(),F(e.result.apiKey)}catch(e){U(e)}finally{o(!1)}};return i?(0,x.jsxs)(j.k,{width:"100%",overflowY:"auto",maxHeight:{base:"70vh",sm:"90vh"},children:[(0,x.jsxs)(j.k,{direction:"column",gap:6,width:"100%",children:[(0,x.jsxs)(Me.xu,{children:[(0,x.jsx)(w.X,{size:"md",mb:1,children:"API Keys"}),(0,x.jsx)(S.x,{color:"gray.500",fontSize:"sm",children:"A secret key lets your backend call the Relevic public API for this workspace. Treat it like a password \u2014 it's shown only once when generated."})]}),(0,x.jsx)(Ye.Z,{bgColor:"white",boxShadow:"md",borderRadius:"md",children:(0,x.jsx)(We.e,{children:E?(0,x.jsx)(j.k,{justify:"center",py:8,children:(0,x.jsx)(f.$,{})}):Y?(0,x.jsxs)(y.K,{spacing:4,children:[(0,x.jsxs)(v.U,{justify:"space-between",flexWrap:"wrap",children:[(0,x.jsxs)(Me.xu,{children:[(0,x.jsx)(S.x,{fontWeight:"semibold",children:Y.name}),(0,x.jsxs)(S.x,{fontFamily:"mono",color:"gray.600",children:["relv_\u2026",Y.secretLast4||"????"]})]}),(0,x.jsx)(Ue.C,{colorScheme:W?"green":"red",fontSize:"0.8em",px:2,py:1,borderRadius:"md",children:W?"Active":"Revoked"})]}),(0,x.jsxs)(v.U,{spacing:8,flexWrap:"wrap",color:"gray.600",fontSize:"sm",children:[(0,x.jsxs)(S.x,{children:["Created: ",qe(Y.createdAt)]}),(0,x.jsxs)(S.x,{children:["Last used: ",qe(Y.lastUsedAt)]})]}),(0,x.jsx)(v.U,{spacing:3,children:W?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(D.z,{variant:"primary",onClick:async()=>{if(window.confirm("Regenerate this API key? The current key will stop working immediately and any integration using it must be updated.")){o(!0);try{const e=await L({workspaceId:n,featureItem:"rotate-api-client",body:{}}).unwrap();await N(),F(e.result.apiKey)}catch(e){U(e)}finally{o(!1)}}},isDisabled:l,children:"Regenerate"}),(0,x.jsx)(D.z,{colorScheme:"red",variant:"outline",onClick:async()=>{if(window.confirm("Revoke this API key? Any integration using it will stop working immediately.")){o(!0);try{await M({workspaceId:n,featureItem:"api-client",param1:"revoke"}).unwrap(),await N(),a({title:"API keys",position:"top-right",description:"API key revoked.",status:"success",duration:6e3,isClosable:!0})}catch(e){U(e)}finally{o(!1)}}},isDisabled:l,children:"Revoke"})]}):(0,x.jsx)(D.z,{variant:"primary",onClick:X,isDisabled:l,children:"Generate new key"})})]}):(0,x.jsxs)(y.K,{spacing:4,align:"flex-start",children:[(0,x.jsx)(S.x,{color:"gray.600",children:"No API key has been generated for this workspace yet."}),(0,x.jsx)(D.z,{variant:"primary",onClick:X,isDisabled:l,children:"Generate API key"})]})})})]}),(0,x.jsxs)($.u_,{isOpen:h,onClose:p,closeOnOverlayClick:!1,isCentered:!0,children:[(0,x.jsx)(V.Z,{}),(0,x.jsxs)(Q.h,{children:[(0,x.jsx)(ee.x,{children:"Your new API key"}),(0,x.jsx)(se.o,{}),(0,x.jsxs)(re.f,{children:[(0,x.jsx)(S.x,{mb:3,color:"gray.600",fontSize:"sm",children:"Copy this key now and store it securely. For your protection, it won't be shown again."}),(0,x.jsxs)(le.B,{children:[(0,x.jsx)(k.I,{value:d,isReadOnly:!0,fontFamily:"mono",fontSize:"sm",pr:"3rem"}),(0,x.jsx)(oe.x,{children:(0,x.jsx)(C.h,{"aria-label":"Copy API key",icon:(0,x.jsx)(z.Fqs,{}),size:"sm",onClick:m})})]}),b&&(0,x.jsx)(S.x,{mt:2,color:"green.500",fontSize:"sm",children:"Copied to clipboard."})]}),(0,x.jsx)(Fe.m,{children:(0,x.jsx)(D.z,{variant:"primary",onClick:p,children:"Done"})})]})]})]}):(0,x.jsx)(j.k,{width:"100%",py:10,justify:"center",children:(0,x.jsx)(S.x,{color:"gray.500",children:"You don't have permission to manage API keys. Ask a workspace Owner or Admin."})})}var Ge=r(12103);function Ke(e){let{}=e;const[s]=(0,n.a)("(min-width: 992px)"),r=(0,ue.TH)(),[d,c]=(0,t.useState)(0),[h,u]=(0,t.useState)(!1),g="Designer"!==(0,P.C)(_.NP);return(0,t.useEffect)((()=>{u(!0);
1const e=new URLSearchParams(r.search).get("activeTab");e&&c("workspaces"===e?3:0)}),[r.search]),h?s?(0,x.jsx)(i.g,{alignItems:"stretch",fontFamily:"Karla",paddingX:{base:"60px","2xl":20},paddingY:{base:"20px","2xl":"40px"},height:"100vh",width:"100%",children:(0,x.jsxs)(a.m,{variant:"primary",index:d,onChange:e=>c(e),children:[(0,x.jsxs)(l.t,{children:[(0,x.jsx)(o.O,{"data-automation-id":"button_settings_basicInformation",children:"Basic Information"}),(0,x.jsx)(o.O,{"data-automation-id":"button_settings_security",children:"Security"}),(0,x.jsx)(o.O,{"data-automation-id":"button_settings_teamMembers",children:"Team Members"}),(0,x.jsx)(o.O,{"data-automation-id":"button_settings_workspace",children:"Workspace"}),g&&(0,x.jsx)(o.O,{"data-automation-id":"button_settings_secrets",children:"Secrets"})]}),(0,x.jsxs)(p,{children:[(0,x.jsx)(m,{children:(0,x.jsx)(N,{})}),(0,x.jsx)(m,{children:(0,x.jsx)(we,{})}),(0,x.jsx)(m,{children:(0,x.jsx)(Se,{})}),(0,x.jsx)(m,{children:(0,x.jsx)(Re,{})}),g&&(0,x.jsx)(m,{children:(0,x.jsx)(Ze,{})})]})]})}):(0,x.jsx)(i.g,{alignItems:"stretch",fontFamily:"Karla",padding:{base:"60px","2xl":"80px"},height:"100vh",width:"100%",justifyContent:"center",children:(0,x.jsxs)(a.m,{variant:"primary",index:d,onChange:e=>c(e),children:[(0,x.jsxs)(l.t,{children:[(0,x.jsx)(o.O,{children:"Team Members"}),(0,x.jsx)(o.O,{children:"Workspace"}),g&&(0,x.jsx)(o.O,{children:"Secrets"})]}),(0,x.jsxs)(p,{children:[(0,x.jsx)(m,{children:(0,x.jsx)(Se,{})}),(0,x.jsx)(m,{children:(0,x.jsx)(Re,{})}),g&&(0,x.jsx)(m,{children:(0,x.jsx)(Ze,{})})]})]})}):(0,x.jsx)(Ge.Z,{})}},6959:(e,s,r)=>{r.d(s,{WE:()=>C,X:()=>j,YE:()=>g,bt:()=>k,hp:()=>f,mE:()=>u,xD:()=>y});var t=r(83040),n=r(98052),i=r(97623),a=r(9876),l=r(60149),o=r(57274),d=r(66767),c=r(65893),h=r(47313),[u,x,p,m]=(0,n.n)();function g(e){var s;const{defaultIndex:r,onChange:t,index:n,isManual:i,isLazy:l,lazyBehavior:o="unmount",orientation:d="horizontal",direction:c="ltr",...u}=e,[x,m]=(0,h.useState)(null!=r?r:0),[g,j]=(0,a.T)({defaultValue:null!=r?r:0,value:n,onChange:t});(0,h.useEffect)((()=>{null!=n&&m(n)}),[n]);const w=p(),f=(0,h.useId)();return{id:`tabs-${null!=(s=e.id)?s:f}`,selectedIndex:g,focusedIndex:x,setSelectedIndex:j,setFocusedIndex:m,isManual:i,isLazy:l,lazyBehavior:o,orientation:d,descendants:w,direction:c,htmlProps:u}}var[j,w]=(0,i.k)({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function f(e){const{focusedIndex:s,orientation:r,direction:t}=w(),n=x(),i=(0,h.useCallback)((e=>{const i=()=>{var e;const r=n.nextEnabled(s);r&&(null==(e=r.node)||e.focus())},a=()=>{var e;const r=n.prevEnabled(s);r&&(null==(e=r.node)||e.focus())},l="horizontal"===r,o="vertical"===r,d=e.key,c={["ltr"===t?"ArrowLeft":"ArrowRight"]:()=>l&&a(),["ltr"===t?"ArrowRight":"ArrowLeft"]:()=>l&&i(),ArrowDown:()=>o&&i(),ArrowUp:()=>o&&a(),Home:()=>{var e;const s=n.firstEnabled();s&&(null==(e=s.node)||e.focus())},End:()=>{var e;const s=n.lastEnabled();s&&(null==(e=s.node)||e.focus())}}[d];c&&(e.preventDefault(),c(e))}),[n,s,r,t]);return{...e,role:"tablist","aria-orientation":r,onKeyDown:(0,c.v0)(e.onKeyDown,i)}}function y(e){const{isDisabled:s,isFocusable:r,...n}=e,{setSelectedIndex:i,isManual:a,id:l,setFocusedIndex:d,selectedIndex:h}=w(),{index:u,register:x}=m({disabled:s&&!r}),p=u===h;return{...(0,t.h)({...n,ref:(0,o.lq)(x,e.ref),isDisabled:s,isFocusable:r,onClick:(0,c.v0)(e.onClick,(()=>{i(u)}))}),id:I(l,u),role:"tab",tabIndex:p?0:-1,type:"button","aria-selected":p,"aria-controls":S(l,u),onFocus:s?void 0:(0,c.v0)(e.onFocus,(()=>{d(u);!a&&!(s&&r)&&i(u)}))}}var[b,v]=(0,i.k)({});function k(e){const s=w(),{id:r,selectedIndex:t}=s,n=(0,l.W)(e.children).map(((e,s)=>(0,h.createElement)(b,{key:s,value:{isSelected:s===t,id:S(r,s),tabId:I(r,s),selectedIndex:t}},e)));return{...e,children:n}}function C(e){const{children:s,...r}=e,{isLazy:t,lazyBehavior:n}=w(),{isSelected:i,id:a,tabId:l}=v(),o=(0,h.useRef)(!1);i&&(o.current=!0);return{tabIndex:0,...r,children:(0,d.k)({wasSelected:o.current,isSelected:i,enabled:t,mode:n})?s:null,role:"tabpanel","aria-labelledby":l,hidden:!i,id:a}}function I(e,s){return`${e}--tab-${s}`}function S(e,s){return`${e}--tabpanel-${s}`}},32313:(e,s,r)=>{r.d(s,{O:()=>d});var t=r(63989),n=r(6959),i=r(65893),a=r(51544),l=r(68441),o=r(46417),d=(0,a.G)((function(e,s){const r=(0,t.s)(),a=(0,n.xD)({...e,ref:s}),d={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return(0,o.jsx)(l.m.button,{...a,className:(0,i.cx)("chakra-tabs__tab",e.className),__css:d})}));d.displayName="Tab"},55878:(e,s,r)=>{r.d(s,{t:()=>d});var t=r(63989),n=r(6959),i=r(65893),a=r(51544),l=r(68441),o=r(46417),d=(0,a.G)((function(e,s){const r=(0,n.hp)({...e,ref:s}),a={display:"flex",...(0,t.s)().tablist};return(0,o.jsx)(l.m.div,{...r,className:(0,i.cx)("chakra-tabs__tablist",e.className),__css:a})}));d.displayName="TabList"},63989:(e,s,r)=>{r.d(s,{m:()=>p,s:()=>x});var t=r(6959),n=r(97623),i=r(51544),a=r(10465),l=r(51877),o=r(68441),d=r(65893),c=r(47313),h=r(46417),[u,x]=(0,n.k)({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Tabs />\" "}),p=(0,i.G)((function(e,s){const r=(0,a.jC)("Tabs",e),{children:n,className:i,...x}=(0,l.Lr)(e),{htmlProps:p,descendants:m,...g}=(0,t.YE)(x),j=(0,c.useMemo)((()=>g),[g]),{isFitted:w,...f}=p;return(0,h.jsx)(t.mE,{value:m,children:(0,h.jsx)(t.X,{value:j,children:(0,h.jsx)(u,{value:r,children:(0,h.jsx)(o.m.div,{className:(0,d.cx)("chakra-tabs",i),ref:s,...f,__css:r.root,children:n})})})})}));p.displayName="Tabs"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.