PageSourceSearch

https://knuckl.com/assets/Welcome-Bx_bvqNh.js

js knuckl.com collected 2026-09-24 14:47:10 UTC 3,185 bytes, 1 lines download raw bytes

1import{u as _,c as k,a as v,j as t}from"./vendor-query-BxlSJxfF.js";import{u as C,a as N,B,s as V,C as q}from"./index-DO0aGFYL.js";import{u as E}from"./use-user-hint-BN7WH046.js";import{H as L}from"./Head-CFjoxvyt.js";import{K}from"./KnucklLogo-DmAzyuOm.js";import{u as S}from"./vendor-react-DdNhUK9-.js";import{m as g}from"./vendor-motion-CdL2ySym.js";import{A}from"./arrow-right-Cxpw4wQL.js";import"./vendor-supabase-Csx7YFID.js";function U(){const{user:i,authStatus:d}=C(),a=S(),w=_(),{isLoading:u,markShown:y}=E("welcome_shown"),{t:r}=N(),{data:e,isLoading:f,isError:b}=k({queryKey:["welcome-routing",i==null?void 0:i.id],enabled:!!i&&d==="ready",queryFn:async()=>{const[{data:l},m]=await Promise.all([V.from("profiles").select("unified_onboarding_completed, laborer_visible, hiring_visible").eq("user_id",i.id).maybeSingle(),q(i.id)]),o=l;return{role:m??"worker",unifiedComplete:!!(o!=null&&o.unified_onboarding_completed),hiringVisible:!!(o!=null&&o.hiring_visible),laborerVisible:!!(o!=null&&o.laborer_visible)}}}),s=e==null?void 0:e.role,n=(e==null?void 0:e.unifiedComplete)??!1,p=(e==null?void 0:e.hiringVisible)??!1,h=(e==null?void 0:e.laborerVisible)??!1;if(v.useEffect(()=>{if(!(u||f||!e)&&!b&&d==="ready"){if(!n){a("/onboarding",{replace:!0});return}s!=="admin"&&(p||h?a("/home",{replace:!0}):a("/onboarding",{replace:!0}))}},[u,f,e,b,d,n,p,h,s,a]),u||f||!s||s==="admin")return null;const x=s==="contractor",c=x?{title:r.welcome.title,bullets:[r.welcome.contractorBullet1,r.welcome.contractorBullet2,r.welcome.contractorBullet3],cta:r.welcome.contractorCta,href:"/contractor"}:{title:r.welcome.title,bullets:[r.welcome.workerBullet1,r.welcome.workerBullet2,r.welcome.workerBullet3],cta:r.welcome.workerCta,href:"/jobs"},j=async()=>{await y(),i!=null&&i.id&&await w.refetchQueries({queryKey:["onboarding-tour-seen",i.id]});const l=n?c.href:"/onboarding";if(x&&n)try{sessionStorage.setItem("knuckl.welcome_open_post_sheet","1")}catch{}a(l,{replace:!0})};return t.jsxs("div",{className:"min-h-[100dvh] bg-background flex items-center justify-center px-5 industrial-grain",children:[t.jsx(L,{title:r.welcome.title,description:r.welcome.headDescription,noindex:!0}),t.jsxs(g.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.35,ease:"easeOut"},className:"w-full max-w-md rounded-3xl bg-card/80 backdrop-blur-md border border-border/60 p-7 shadow-2xl",children:[t.jsx("div",{className:"mb-4 flex justify-center","aria-hidden":!0,children:t.jsx(K,{variant:"icon",size:"lg"})}),t.jsx("h1",{className:"font-display text-3xl text-foreground text-center leading-tight mb-5",children:c.title}),t.jsx("ul",{className:"space-y-3 mb-7",children:c.bullets.map((l,m)=>t.jsxs(g.li,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{duration:.25,delay:.15+m*.08},className:"flex gap-3 text-sm text-foreground",children:[t.jsx("span",{className:"text-primary mt-0.5",children:"•"}),t.jsx("span",{children:l})]},m))}),t.jsxs(B,{onClick:j,size:"lg",className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground font-semibold h-12 rounded-xl gap-2",children:[c.cta,t.jsx(A,{className:"w-4 h-4"})]})]})]})}export{U as default};

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.