import{j as e,c as f}from"./@tanstack-CEbkxrhX.js";import{u as m,S,a as j,b as v}from"./SuccessStep-CykrFndS.js";import{f as b,ao as g,aA as w,i as A,h as x,A as C,a as U,b as P,am as _,S as N}from"./index-BawkpTlr.js";import{A as k,a as z,P as H}from"./AwarenessChannel-B2KR83Tr.js";import{r as l}from"./@radix-C9DBgJhe.js";import"./UpdatePasswordSchemas-CKrd3UZz.js";import"./check-circle-BVvhm5dy.js";import"./url-CgvM-IVM.js";import"./@react-router-DYovave8.js";import"./@reactflow-DYIyhCfd.js";import"./zod-DrZvVLjd.js";import"./index.esm-F7nqy9zY.js";import"./file-text-CbVERUON.js";import"./play-circle-DK5QMJyp.js";const h=l.createContext(null);function E({children:t,initialUser:r}){const[s,a]=l.useState(r||{});return e.jsx(h.Provider,{value:{user:s,setUser:a},children:t})}function d(){const t=l.useContext(h);if(t===null)throw new Error("useSurveyUserContext must be used within an SurveyUserProvider");return t}function F({user:t}){var o,u;const{setSurveyStep:r}=m(),{setUser:s}=d();function a({fullName:n,getUpdates:i,email:c}){s(p=>({...p,...c?{email:c}:{email:null},full_name:n,email_opted_in:i})),r(2)}return e.jsx(k,{email:(o=t.metadata)==null?void 0:o.email,fullName:(u=t.body)==null?void 0:u.full_name,submitHandler:a})}function Z(){const{user:t}=d(),{setSurveyStep:r}=m(),{toast:s}=b(),a=f(),{mutate:o}=g({onSuccess:async()=>{await a.invalidateQueries({queryKey:w()}),r(n=>n+1)},onError:n=>{n instanceof Error&&s({status:"error",emphasis:"subtle",icon:e.jsx(A,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function u({other:n,channels:i,otherVal:c}){const y={awareness_channels:n?[...i,c]:i};o({...t,user_metadata:{...t.user_metadata,...y}})}return e.jsx(z,{submitHandler:u})}function B({user:t}){const{setSurveyStep:r}=m(),{setUser:s}=d();function a({amountProductionModels:o,primaryUse:u}){const n={models_production:o,primary_use:u};s(i=>({...i,user_metadata:{...i.user_metadata,...n}})),r(3)}return e.jsx(H,{user:t,submitHandler:a})}const D="/assets/adam-e-y0WnB_.webp",L="/assets/alex-DcCuDHPg.webp",M="/assets/baris-C0ZrZ10g.webp",K="/assets/hamza-NKKOZz1I.webp",T="/assets/stefan-B08Ftbba.webp";function q(){const{setSurveyStep:t}=m();function r(){window.open("https://zenml.io/slack","_blank"),t(s=>s+1)}return e.jsxs("div",{className:"max-w-[540px] space-y-5",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-display-xs font-semibold",children:"Join The ZenML Slack Community"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Connect to our growing community and meet fellow ZenML enthusiasts, get support, and share your insights. Let's grow together!"})]}),e.jsx(J,{}),e.jsx(x,{onClick:()=>r(),className:"h-auto min-h-8 w-full justify-center py-1",intent:"primary",emphasis:"bold",size:"lg",children:"Join the ZenML Community and Continue"}),e.jsx(x,{intent:"secondary",emphasis:"minimal",onClick:()=>t(s=>s+1),className:"mx-auto justify-center text-neutral-500",size:"sm",children:"Skip this step"})]})}const I=[{name:"Adam",image:D},{name:"Hamza",image:K},{name:"Alex",image:L},{name:"Stefan",image:T},{name:"Baris",image:M}];function J(){return e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center justify-center -space-x-[7px]",children:I.map(t=>e.jsxs(C,{size:"lg",type:"rounded",children:[e.jsx(U,{alt:`Portrait of ${t.name}`,src:t.image}),e.jsx(P,{size:"lg",children:t.name[0]})]},t.name))}),e.jsx("p",{className:"text-center text-text-xs text-theme-text-tertiary",children:"Adam Probst, Hamza Tahir, and +1,800 others have already joined"})]})}function O(){const{data:t,isPending:r,isError:s}=_({throwOnError:!0}),{surveyStep:a}=m();return s?null:r?e.jsx(N,{className:"h-[300px]"}):e.jsx(e.Fragment,{children:e.jsxs(E,{children:[e.jsx(S,{stepAmount:4}),a===1&&e.jsx(F,{user:t}),a===2&&e.jsx(B,{user:t}),a===3&&e.jsx(Z,{}),a===4&&e.jsx(q,{}),a===5&&e.jsx(j,{subHeader:"Your ZenML account is now updated",displayBody:!1,username:t.name})]})})}function ie(){return e.jsx("div",{children:e.jsx(v,{children:e.jsx(O,{})})})}export{ie as default};
