PageSourceSearch

https://app.thefestivalbabes.com/assets/BrandOnboarding-b46Vr91R.js

js thefestivalbabes.com collected 2026-10-04 20:47:09 UTC 8,484 bytes, 1 lines download raw bytes

1import{e as F,r as g,f as I,l as T,j as e,a1 as S,q as O,C as U,d as W,p as A,s as L,a as $,I as p,a9 as f,B as y,x as z,F as K,av as k,D as P,E as Q,aB as B,ab as Y,al as D}from"./index-CAQ9C6-z.js";import{P as H}from"./progress-sbZlcJgL.js";import{e as M,i as R,I as V,t as _,a as G}from"./intakeQuestions-iYeXwBPH.js";import{A as J}from"./arrow-left-BrnCBqZV.js";const q={companyName:"",industry:"",companySize:"",headquarters:"",websiteUrl:"",brandMission:"",aboutBrand:"",uniqueValue:"",contactEmail:"",contactPhone:"",linkedinUrl:"",pressContact:""},j=["Company","Brand & goals","Your ideal campaign","Contacts"];function re({editMode:i=!1}){const[,m]=F(),[s,a]=g.useState(0),[r,c]=g.useState(q),[n,t]=g.useState(M()),{data:d,isLoading:h}=I({queryKey:["/api/brand-profile"]});g.useEffect(()=>{d!=null&&d.profile&&(c(l=>({...l,...Object.fromEntries(Object.entries(d.profile).filter(([b])=>b in q))})),t(R(d.profile)))},[d]);const o=l=>b=>c(v=>({...v,[l]:b.target.value})),x=T({mutationFn:async()=>{const b={...Object.fromEntries(Object.entries(r).filter(([,v])=>v!=="")),..._(n)};await Q("PUT","/api/brand-profile",b)},onSuccess:()=>{P.invalidateQueries({queryKey:["/api/brand-profile"]}),P.invalidateQueries({queryKey:["/api/auth/session"]}),k({title:i?"Profile updated":"Welcome aboard! ✨",description:i?"Your brand profile has been saved.":"Your brand profile is set up."}),m(i?"/brand/settings":"/brand")},onError:l=>k({title:"Couldn't save",description:(l==null?void 0:l.message)||"Please try again.",variant:"destructive"})}),E=s>0||r.companyName.trim().length>0,w=g.useMemo(()=>Math.round((s+1)/j.length*100),[s]);return h?e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(S,{className:"w-6 h-6 animate-spin text-purple-500"})}):e.jsxs("div",{className:"max-w-2xl mx-auto py-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx(O,{className:"w-6 h-6 text-purple-500"}),e.jsx("h1",{className:"text-2xl font-heading text-gradient-festival",children:i?"Brand profile":"Welcome to The Festival Babes"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-5",children:i?"Update your brand details below.":"Tell us about your brand so our team can tailor your campaigns."}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[e.jsxs("span",{children:["Step ",s+1," of ",j.length,": ",j[s]]}),e.jsxs("span",{children:[w,"%"]})]}),e.jsx(H,{value:w})]}),e.jsxs(U,{className:"border-purple-500/20",children:[e.jsxs(W,{children:[e.jsx(A,{className:"text-lg",children:j[s]}),e.jsxs(L,{children:[s===0&&"The basics about your company.",s===1&&"What your brand stands for and wants from creator campaigns.",s===2&&"Help us build your AI-ready campaign profile — the richer this is, the smarter the creator matches we can make.",s===3&&"Who we should reach out to."]})]}),e.jsxs($,{className:"space-y-4",children:[s===0&&e.jsxs(e.Fragment,{children:[e.jsx(u,{label:"Company name",required:!0,children:e.jsx(p,{value:r.companyName,onChange:o("companyName"),placeholder:"e.g. Secret Dreams","data-testid":"input-company-name"})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(u,{label:"Industry",children:e.jsx(p,{value:r.industry,onChange:o("industry"),placeholder:"e.g. Beverage"})}),e.jsx(u,{label:"Company size",children:e.jsx(p,{value:r.companySize,onChange:o("companySize"),placeholder:"e.g. 11–50"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(u,{label:"Headquarters",children:e.jsx(p,{value:r.headquarters,onChange:o("headquarters"),placeholder:"City, Country"})}),e.jsx(u,{label:"Website",children:e.jsx(p,{value:r.websiteUrl,onChange:o("websiteUrl"),placeholder:"https://"})})]})]}),s===1&&e.jsxs(e.Fragment,{children:[e.jsx(u,{label:"Brand mission",children:e.jsx(f,{value:r.brandMission,onChange:o("brandMission"),rows:2,placeholder:"What your brand is about in a sentence."})}),e.jsx(u,{label:"About your brand",children:e.jsx(f,{value:r.aboutBrand,onChange:o("aboutBrand"),rows:3,placeholder:"A short description."})}),e.jsx(u,{label:"What makes you unique",children:e.jsx(f,{value:r.uniqueValue,onChange:o("uniqueValue"),rows:2,placeholder:"What sets your brand apart."})})]}),s===2&&e.jsx("div",{className:"space-y-6",children:V.map(l=>e.jsx(X,{question:l,answers:n,setAnswers:t},l.id))}),s===3&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(u,{label:"Contact email",children:e.jsx(p,{type:"email",value:r.contactEmail,onChange:o("contactEmail"),placeholder:"[email protected]"})}),e.jsx(u,{label:"Contact phone",children:e.jsx(p,{value:r.contactPhone,onChange:o("contactPhone"),placeholder:"Optional"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(u,{label:"LinkedIn",children:e.jsx(p,{value:r.linkedinUrl,onChange:o("linkedinUrl"),placeholder:"Optional"})}),e.jsx(u,{label:"Press contact",children:e.jsx(p,{value:r.pressContact,onChange:o("pressContact"),placeholder:"Optional"})})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-5",children:[e.jsxs(y,{variant:"outline",disabled:s===0,onClick:()=>a(l=>Math.max(0,l-1)),children:[e.jsx(J,{className:"w-4 h-4 mr-1.5"})," Back"]}),s<j.length-1?e.jsxs(y,{disabled:!E,onClick:()=>a(l=>l+1),className:"bg-gradient-to-r from-purple-500 to-rose-500 text-white",children:["Continue ",e.jsx(z,{className:"w-4 h-4 ml-1.5"})]}):e.jsx(y,{disabled:!r.companyName.trim()||x.isPending,onClick:()=>x.mutate(),className:"bg-gradient-to-r from-purple-500 to-rose-500 text-white","data-testid":"button-save-brand-profile",children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-4 h-4 mr-1.5 animate-spin"})," Saving…"]}):e.jsxs(e.Fragment,{children:[e.jsx(K,{className:"w-4 h-4 mr-1.5"})," ",i?"Save changes":"Finish setup"]})})]})]})}function u({label:i,required:m,children:s}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(B,{className:"text-sm",children:[i,m&&e.jsx("span",{className:"text-rose-500 ml-0.5",children:"*"})]}),s]})}function X({question:i,answers:m,setAnswers:s}){const a=i;if(a.type==="chips-multi"){const c=m[a.id]??[],n=t=>s(d=>{const h=d[a.id]??[],o=h.includes(t)?h.filter(x=>x!==t):[...h,t];return{...d,[a.id]:o}});
1return e.jsx(N,{label:a.label,helper:a.helper,children:e.jsx("div",{className:"flex flex-wrap gap-2",children:a.options.map(t=>{const d=c.includes(t.value);return e.jsx(C,{active:d,onClick:()=>n(t.value),"data-testid":`chip-${String(a.id)}-${t.value}`,children:t.label},t.value)})})})}if(a.type==="chips-single"){const c=m[a.id]??"";return e.jsx(N,{label:a.label,helper:a.helper,children:e.jsx("div",{className:"flex flex-wrap gap-2",children:a.options.map(n=>{const t=c===n.value;return e.jsx(C,{active:t,onClick:()=>s(d=>({...d,[a.id]:t?"":n.value})),"data-testid":`chip-${String(a.id)}-${n.value}`,children:e.jsxs("span",{className:"flex flex-col items-start leading-tight",children:[e.jsx("span",{children:n.label}),n.hint&&e.jsx("span",{className:"text-[10px] opacity-80",children:n.hint})]})},n.value)})})})}const r=m[a.id]??"";return e.jsxs(N,{label:a.label,helper:a.helper,children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:a.options.map(c=>e.jsxs(C,{add:!0,onClick:()=>s(n=>({...n,[a.id]:G(n[a.id]??"",c.value)})),"data-testid":`pill-${String(a.id)}-${c.value}`,children:[e.jsx(Y,{className:"w-3 h-3 mr-1 -ml-0.5"}),c.label]},c.value))}),e.jsx(f,{value:r,onChange:c=>s(n=>({...n,[a.id]:c.target.value})),rows:a.rows??3,placeholder:a.placeholder,"data-testid":`input-${String(a.id)}`})]})}function N({label:i,helper:m,children:s}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{className:"text-sm font-medium",children:i}),m&&e.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e.jsx("div",{className:"pt-1",children:s})]})}function C({active:i,add:m,className:s,children:a,...r}){return e.jsx("button",{type:"button",className:D("inline-flex items-center rounded-full border px-3 py-1.5 text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 focus-visible:ring-offset-background",i?"border-transparent bg-primary text-primary-foreground shadow-sm":"border-primary/40 text-primary hover:bg-primary/10 hover:border-primary/60",s),...r,children:a})}export{re 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.