1import{X as Se,Y as _e,d as i,b as Ce,c9 as le,j as e,e as v,v as Ae,c3 as G,T as n,a4 as Te,B as C,A,h as S,R as M,Q as ne,t as oe,ca as ce,at as U,a1 as E,cb as R,cc as Fe,cd as Ie}from"./index.BdFycjDt.js";import{I as de,s as Ee,i as Re,m as We,a as Ne,f as Pe,b as Be,c as ze,S as ae,p as Me}from"./actorSiteIntakeForm.AHItV16f.js";import{a as B}from"./actorSiteApi.DyPdu9hC.js";import{s as ie}from"./showcaseApi.CXh4owQ4.js";import{C as W}from"./Card.y4fRYbDG.js";import{C as N}from"./CardContent.BGaAZbjQ.js";import{L as Le}from"./LinearProgress.B-V9CFME.js";import{D as Ye}from"./Divider.kxa6B8uw.js";import{A as De}from"./ArrowBack.3O-yzPOH.js";import{A as Oe}from"./ArrowForward.CzqR4P8W.js";import{L as $e}from"./Lock.CvpEvvKL.js";import{C as ue}from"./Checkbox.COvbWWwQ.js";import"./functionError.DKuHce60.js";import"./castingVocabulary.B7xQ_ckh.js";const P=t=>`$${(t/100).toLocaleString("en-US",{minimumFractionDigits:t%100===0?0:2,maximumFractionDigits:2})}`;function it(){const{token:t}=Se(),[u]=_e(),k=u.get("paid")==="1",[j,f]=i.useState("loading"),[h,b]=i.useState(""),[l,m]=i.useState({}),[r,a]=i.useState(0),[o,c]=i.useState("professional"),x=Ce(s=>s.user),[d,he]=i.useState(null),[q,xe]=i.useState(!1),[w,H]=i.useState(null),[me,pe]=i.useState(null),[ye,J]=i.useState(!1),[Q,z]=i.useState(null),[L,be]=i.useState(de.map(()=>!1)),[Y,ge]=i.useState(""),[D,je]=i.useState(""),[V,X]=i.useState(!1),T=i.useMemo(()=>Ee(o),[o]),fe=T.length+1,Z=r===T.length,F=T[r],I=i.useRef(!1),ee=i.useRef({});ee.current=l,i.useEffect(()=>{if(!t){f("unavailable");return}(async()=>{try{const s=await B.getIntakeByToken(t);if(!s){f("unavailable");return}b(s.client_name),m(s.answers||{}),H(s.payment||null),(s.audience==="student"||s.audience==="professional")&&c(s.audience),f(s.submitted?"submitted":"editing")}catch{f("unavailable")}})()},[t]);const O=i.useCallback(async()=>{if(!(!t||!I.current)){J(!0);try{const s=await B.saveIntake(t,ee.current);I.current=!1,pe(s),z(null)}catch(s){z(s?.message||"Could not save your answers.")}finally{J(!1)}}},[t]);i.useEffect(()=>{x&&(async()=>{try{const s=await ie.getMyProfile(x.id);if(!s)return;const p=await ie.getMedia(s.id).catch(()=>[]);he({...s,media:p})}catch{}})()},[x]);const ve=()=>{if(!d)return;const p=(d.media||[]).filter(_=>["headshot","photo"].includes(_.kind)&&_.url),y={...l},g=(_,re)=>{re&&!String(y[_]||"").trim()&&(y[_]=re)};g("primary_headshot",d.headshot_url),g("hero_image",d.headshot_url),g("resume_url",d.resume_url),g("acting_reel",d.reel_url),g("full_bio",d.bio),g("vocal_range",d.vocal_range),g("instagram_url",d.instagram_url),g("tiktok_url",d.tiktok_url),g("youtube_url",d.youtube_url),g("imdb_url",d.imdb_url),g("city",d.location_city),g("state",d.location_state),p.length>1&&!String(y.additional_headshots||"").trim()&&(y.additional_headshots=p.slice(1).map(_=>_.url).join(` 2`)),I.current=!0,m(y),xe(!0)},te=l.font_choice==="Show me other fonts";i.useEffect(()=>{if(!te)return;const s=le.map(p=>{const y=document.createElement("link");return y.rel="stylesheet",y.href=p.fontHref,document.head.appendChild(y),y});return()=>{s.forEach(p=>p.remove())}},[te]),i.useEffect(()=>{if(j!=="editing"||!I.current)return;const s=setTimeout(O,2e3);return()=>clearTimeout(s)},[l,j,O]);const ke=(s,p)=>{I.current=!0,m(y=>({...y,[s]:p}))},$=i.useMemo(()=>Re(l,o),[l,o]),se=i.useMemo(()=>We(l,o),[l,o]),K=async s=>{await O(),a(s),window.scrollTo({top:0,behavior:"smooth"})},we=async()=>{if(t){X(!0),z(null);try{await B.submitIntake(t,l,{name:Y,signature:D,version:Be,accepted:L.every(Boolean)}),f("submitted");try{const s=await B.getIntakeByToken(t);s?.payment&&H(s.payment)}catch{}window.scrollTo({top:0,behavior:"smooth"})}catch(s){z(s?.message||"Could not submit your brief.")}finally{X(!1)}}};return j==="loading"?e.jsx(v,{sx:{display:"flex",justifyContent:"center",py:12},children:e.jsx(Ae,{})}):j==="unavailable"?e.jsx(G,{maxWidth:"sm",sx:{py:8},children:e.jsx(W,{children:e.jsxs(N,{sx:{p:4,textAlign:"center"},children:[e.jsx(n,{variant:"h5",sx:{mb:1},children:"This link is no longer available"}),e.jsx(n,{color:"text.secondary",children:"Email us at [email protected] and we will send you a new one."})]})})}):j==="submitted"?e.jsx(G,{maxWidth:"sm",sx:{py:8},children:e.jsx(W,{children:e.jsxs(N,{sx:{p:4,textAlign:"center"},children:[e.jsx(Te,{sx:{fontSize:48,color:"success.main",mb:1}}),e.jsx(n,{variant:"h5",sx:{mb:1}
2,children:"Thank you"}),e.jsx(n,{color:"text.secondary",sx:{mb:2},children:"We have your brief, and we have emailed you what happens next. Once payment lands we start building and come back to you with a first look."}),w?.build_price_id&&e.jsx(C,{variant:"contained",href:`/website-payment/${t}`,sx:{mb:2},children:"Pay For Your Website"}),e.jsx(n,{variant:"body2",color:"text.secondary",sx:{display:"block"},children:"To change an answer, email us at [email protected]."})]})})}):e.jsxs(G,{maxWidth:"md",sx:{py:{xs:3,md:6}},children:[e.jsx(n,{variant:"overline",color:"text.secondary",children:"Websites for performers"}),e.jsx(n,{variant:"h4",sx:{mb:.5},children:h?`${h.split(" ")[0]}, tell us about your website`:"Tell us about your website"}),e.jsx(n,{color:"text.secondary",sx:{mb:3},children:"Answer what you can. Your answers save on their own, so you can close this page and come back to it."}),k&&e.jsx(A,{severity:"success",sx:{mb:3},children:"Your payment went through. This link is in your email as well, so you can stop here and come back whenever you like."}),d&&!q&&e.jsx(A,{severity:"info",sx:{mb:3},action:e.jsx(C,{color:"inherit",size:"small",onClick:ve,children:"Use Them"}),children:"You already keep headshots, a reel, and a resume in your account. We can fill this in from those and you can change anything after."}),q&&e.jsx(A,{severity:"success",sx:{mb:3},children:"Filled in from your account. Check each section and change whatever you want."}),w&&e.jsx(W,{variant:"outlined",sx:{mb:3,borderColor:"primary.light"},children:e.jsxs(N,{sx:{py:2},children:[e.jsx(n,{variant:"subtitle2",sx:{mb:.75},children:"What this costs"}),w.schedule&&w.schedule.length>0?e.jsxs(e.Fragment,{children:[e.jsxs(n,{variant:"body2",color:"text.secondary",sx:{mb:1},children:[P(w.build_cents)," to build your site, and"," ",P(w.hosting_cents)," a year to host it. You pay it in stages."]}),e.jsx(S,{spacing:.25,sx:{mb:1},children:w.schedule.map(s=>e.jsxs(n,{variant:"body2",color:"text.secondary",children:[s.label,": ",e.jsx("strong",{children:P(s.amount_cents)}),s.status==="paid"?" (paid)":""]},s.seq))}),e.jsx(C,{size:"small",href:`/website-payment/${t}`,children:"See Your Payment Page"})]}):e.jsxs(n,{variant:"body2",color:"text.secondary",children:[P(w.build_cents)," to build your site, and ",P(w.hosting_cents)," a year to host it. Nothing is charged until you submit this brief and we send you a payment link."]})]})}),e.jsx(W,{variant:"outlined",sx:{mb:3},children:e.jsxs(N,{sx:{py:2},children:[e.jsxs(S,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:1},children:[e.jsxs(n,{variant:"body2",color:"text.secondary",children:[$.done," of ",$.total," answered"]}),e.jsx(n,{variant:"caption",color:"text.secondary",children:ye?"Saving":me?"Saved":""})]}),e.jsx(Le,{variant:"determinate",value:$.percent,sx:{height:6,borderRadius:3}})]})}),e.jsxs(M,{select:!0,fullWidth:!0,size:"small",label:"Jump To A Section",value:r,onChange:s=>K(Number(s.target.value)),sx:{mb:3},children:[T.map((s,p)=>{const y=Ne(s,l);return e.jsxs(ne,{value:p,children:[p+1,". ",s.title,y>0?` (${y} left)`:""]},s.key)}),e.jsxs(ne,{value:T.length,children:[T.length+1,". Agreement and signature"]})]}),Q&&e.jsx(A,{severity:"error",sx:{mb:2},children:Q}),e.jsx(W,{children:e.jsxs(N,{sx:{p:{xs:2.5,md:4}},children:[Z?e.jsx(Ue,{answers:l,missing:se,agreed:L,setAgreed:be,signName:Y,setSignName:ge,signature:D,setSignature:je}):e.jsxs(e.Fragment,{children:[e.jsxs(n,{variant:"overline",color:"primary",children:["Section ",r+1," of ",fe]}),e.jsx(n,{variant:"h5",sx:{mb:F.intro?.5:2.5},children:F.title}),F.intro&&e.jsx(n,{color:"text.secondary",sx:{mb:2.5},children:F.intro}),e.jsx(S,{spacing:3,children:F.fields.filter(s=>Pe(s,l)).map(s=>e.jsx(Ke,{field:s,value:l[s.key],token:t,mood:typeof l.color_mood=="string"?l.color_mood:void 0,performerName:typeof l.performer_name=="string"?l.performer_name:void 0,onChange:p=>ke(s.key,p)},s.key))})]}),e.jsx(Ye,{sx:{my:3}}),e.jsxs(S,{direction:"row",justifyContent:"space-between",spacing:2,children:[e.jsx(C,{startIcon:e.jsx(De,{}),disabled:r===0,onClick:()=>K(r-1),children:"Back"}),Z?e.jsx(C,{variant:"contained",size:"large",disabled:V||se.length>0||!L.every(Boolean)||!Y.trim()||!D.trim(),onClick:we,children:V?"Submitting":"Submit My Brief"}):e.jsx(C,{variant:"contained",endIcon:e.jsx(Oe,{}),onClick:()=>K(r+1),children:"Next"})]})]})})]})}function Ke({field:t,value:u,token:k,mood:j,performerName:f,onChange:h}){const b=t.optional?`${t.label} (optional)`:t.label;if(t.type==="color_mood"){const r=typeof u=="string"?u:"";return e.jsxs(E,{children:[e.jsx(R,{sx:{fontWeight:600,color:"text.primary",mb:.5},children:b}),t.help&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:t.help}),e.jsx(v,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"}},children:ae.map(a=>{const o=r===a.label;return e.jsxs(v,{onClick:()=>h(a.label),role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&h(a.label)}
2,sx:{border:o?"2px solid":"1px solid",borderColor:o?"primary.main":"divider",borderRadius:2,p:1.5,cursor:"pointer",outline:"none","&:hover":{borderColor:"primary.light"}},children:[e.jsx(S,{direction:"row",sx:{mb:1,borderRadius:1,overflow:"hidden",height:26},children:a.palettes.slice(0,6).map(c=>e.jsx(v,{sx:{flex:1,bgcolor:c.colors[0]}},c.key))}),e.jsx(n,{variant:"body2",sx:{fontWeight:600},children:a.label}),e.jsx(n,{variant:"caption",color:"text.secondary",children:a.blurb})]},a.key)})})]})}if(t.type==="font_pair"){const r=typeof u=="string"?u:"";return e.jsxs(E,{children:[e.jsx(R,{sx:{fontWeight:600,color:"text.primary",mb:.5},children:b}),t.help&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:t.help}),e.jsx(v,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)"}},children:le.map(a=>{const o=r===a.key;return e.jsxs(v,{onClick:()=>h(a.key),role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&h(a.key)},sx:{border:o?"2px solid":"1px solid",borderColor:o?"primary.main":"divider",borderRadius:2,p:2,cursor:"pointer",outline:"none","&:hover":{borderColor:"primary.light"}},children:[e.jsx(n,{sx:{fontFamily:a.displayFont,fontSize:26,lineHeight:1.2,mb:.5},children:f||"Your Name"}),e.jsx(n,{sx:{fontFamily:a.bodyFont,fontSize:14,color:"text.secondary",mb:1},children:"Actor. Singer. Dancer."}),e.jsx(n,{variant:"body2",sx:{fontWeight:600},children:a.label}),e.jsx(n,{variant:"caption",color:"text.secondary",children:a.blurb})]},a.key)})})]})}if(t.type==="palette"){const r=typeof u=="string"?u:"",a=Me(ae.find(o=>o.label===j)?.key);return e.jsxs(E,{children:[e.jsx(R,{sx:{fontWeight:600,color:"text.primary",mb:.5},children:b}),t.help&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:t.help}),e.jsx(v,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"}},children:a.map(o=>{const c=r===o.key;return e.jsxs(v,{onClick:()=>h(o.key),role:"button",tabIndex:0,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&h(o.key)},sx:{border:c?"2px solid":"1px solid",borderColor:c?"primary.main":"divider",borderRadius:2,p:1.25,cursor:"pointer",outline:"none","&:hover":{borderColor:"primary.light"}},children:[e.jsx(S,{direction:"row",sx:{mb:1,borderRadius:1,overflow:"hidden",height:40},children:o.colors.map(x=>e.jsx(v,{sx:{flex:1,bgcolor:x}},x))}),e.jsx(n,{variant:"body2",sx:{fontWeight:600},children:o.label})]},o.key)})})]})}if(t.type==="radio")return e.jsxs(E,{children:[e.jsx(R,{sx:{fontWeight:600,color:"text.primary",mb:.5},children:b}),t.help&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mb:1},children:t.help}),e.jsx(Fe,{value:typeof u=="string"?u:"",onChange:r=>h(r.target.value),children:(t.options||[]).map(r=>e.jsx(U,{value:r,control:e.jsx(Ie,{size:"small"}),label:r},r))})]});if(t.type==="checkboxes"){const r=Array.isArray(u)?u:[],a=t.maxSelected!=null&&r.length>=t.maxSelected;return e.jsxs(E,{children:[e.jsx(R,{sx:{fontWeight:600,color:"text.primary",mb:.5},children:b}),t.help&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mb:1},children:t.help}),t.maxSelected!=null&&e.jsxs(n,{variant:"caption",color:"text.secondary",sx:{mb:.5},children:[r.length," of ",t.maxSelected," chosen"]}),e.jsx(ce,{children:(t.options||[]).map(o=>{const c=r.includes(o);return e.jsx(U,{control:e.jsx(ue,{size:"small",checked:c,disabled:!c&&a,onChange:x=>h(x.target.checked?[...r,o]:r.filter(d=>d!==o))}),label:o},o)})})]})}const l=t.type==="email"?"email":t.type==="tel"?"tel":t.type==="date"?"date":t.type==="url"?"url":"text",m=e.jsx(M,{fullWidth:!0,label:b,type:l,value:typeof u=="string"?u:"",onChange:r=>h(r.target.value),helperText:t.help,placeholder:t.placeholder,multiline:t.type==="textarea",minRows:t.type==="textarea"?t.rows||3:void 0,InputLabelProps:t.type==="date"?{shrink:!0}:void 0});return!t.uploadable||!k?m:e.jsx(Ge,{field:t,value:u,token:k,onChange:h,box:m})}function Ge({field:t,value:u,token:k,onChange:j,box:f}){const[h,b]=i.useState(!1),[l,m]=i.useState(null),r=i.useRef(null),a=typeof u=="string"?u:"",o=/\.(jpe?g|png|webp|heic)$/i.test(a),c=async x=>{if(x){if(x.size>25*1024*1024){m("That file is over 25MB. Send us a smaller copy.");return}b(!0),m(null);try{const d=await B.uploadFile(k,x);j(d)}catch(d){m(d?.message||"The upload did not finish.")}finally{b(!1)}}};return e.jsxs(v,{children:[f,e.jsxs(S,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:1},children:[e.jsx(C,{size:"small",variant:"outlined",disabled:h,onClick:()=>r.current?.click(),children:h?"Uploading":a?"Replace The File":"Upload A File"}),o&&e.jsx(v,{component:"img",src:a,alt:"",sx:{width:44,height:44,objectFit:"cover",borderRadius:1,border:"1px solid",borderColor:"divider"}}),a&&!o&&e.jsx(n,{variant:"caption",color:"text.secondary",children:"File attached"})]}),l&&e.jsx(A,{severity:"error",sx:{mt:1},children:l}),e.jsx("input",{ref:r,type:"file",accept:".jpg,.jpeg,.png,.webp,.heic,.pdf",hidden:!0,onChange:x=>{c(x.target.files?.[0]),x.target.value=""}})]})}function Ue({answers:t,missing:u,agreed:k,setAgreed:j,signName:f,setSignName:h,signature:b,setSignature:l}){const m=u.map(r=>
2ze(r)?.label).filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx(n,{variant:"overline",color:"primary",children:"Last step"}),e.jsx(n,{variant:"h5",sx:{mb:2.5},children:"Agreement and signature"}),m.length>0&&e.jsxs(A,{severity:"warning",sx:{mb:3},children:[e.jsxs(n,{variant:"subtitle2",sx:{mb:.5},children:[m.length," answer",m.length>1?"s":""," still to fill in"]}),e.jsxs(S,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,sx:{mt:1},children:[m.slice(0,12).map(r=>e.jsx(oe,{size:"small",label:r},r)),m.length>12&&e.jsx(oe,{size:"small",label:`and ${m.length-12} more`})]})]}),t.under_18==="Yes"&&e.jsx(A,{severity:"info",icon:e.jsx($e,{fontSize:"small"}),sx:{mb:3},children:"Because the performer is under 18, we keep their email address and phone number off the public website. A parent or guardian approves the finished site."}),e.jsx(ce,{sx:{mb:3},children:de.map((r,a)=>e.jsx(U,{sx:{alignItems:"flex-start",mb:1},control:e.jsx(ue,{size:"small",checked:k[a],onChange:o=>{const c=[...k];c[a]=o.target.checked,j(c)}}),label:e.jsx(n,{variant:"body2",children:r})},r))}),e.jsxs(S,{spacing:2,children:[e.jsx(M,{fullWidth:!0,label:"Your Name",value:f,onChange:r=>h(r.target.value)}),e.jsx(M,{fullWidth:!0,label:"Signature",value:b,onChange:r=>l(r.target.value),helperText:"Type your full name to sign."}),e.jsx(n,{variant:"caption",color:"text.secondary",children:"We record the date and time you sign, along with the version of this agreement."})]})]})}export{it 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.