1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4457],{6398:function(e,t,r){var a=r(52322),n=r(2784),s=r(47843),o=r(25090),i=r(56462),l=r(76510),d=r(91262),c=r(85100),u=r(14804),m=r(89019),f=r(21106);t.Z=e=>{let{open:t,onOpenChange:r}=e,[g,p]=(0,n.useState)(""),[x,h]=(0,n.useState)(""),[b,y]=(0,n.useState)(""),[v,w]=(0,n.useState)(!1),[N,j]=(0,n.useState)(null),[k,S]=(0,n.useState)(null),[z,C]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(N){let e=setTimeout(()=>{r(!1),_()},2e3);return()=>clearTimeout(e)}},[N,r]);let _=()=>{p(""),h(""),y(""),j(null),S(null)},R=async e=>{e.preventDefault(),w(!0),j(null),S(null);try{let e=await fetch("/api/contact-agency",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:g,email:x,message:b,type:"agency_pricing"})}),t=await e.json();e.ok?j("Your message has been sent! We will be in touch soon."):S(t.message||"An error occurred. Please try again.")}catch(e){console.error("Error submitting contact form:",e),S("An error occurred. Please try again.")}finally{w(!1)}};return(0,a.jsx)(f.pn,{children:(0,a.jsxs)(f.u,{open:z,children:[(0,a.jsx)(f.aJ,{asChild:!0,children:(0,a.jsx)(s.Vq,{open:t,onOpenChange:r,children:(0,a.jsxs)(s.cZ,{className:"sm:max-w-[500px]",children:[(0,a.jsxs)(s.fK,{children:[(0,a.jsx)(s.$N,{className:"text-2xl font-bold text-blue-900",children:"Contact Us"}),(0,a.jsx)(s.Be,{children:"Whether you're in casting, an agency, or a studio, fill out this form and we'll be in touch!"})]}),N?(0,a.jsx)("div",{className:"py-10 flex justify-center items-center",children:(0,a.jsx)(c.bZ,{className:"bg-blue-50 text-blue-700 border-blue-200",children:(0,a.jsx)(c.X,{className:"text-center text-lg",children:N})})}):(0,a.jsxs)(a.Fragment,{children:[k&&(0,a.jsx)(c.bZ,{variant:"destructive",children:(0,a.jsx)(c.X,{children:k})}),(0,a.jsxs)("form",{onSubmit:R,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(l._,{htmlFor:"name",children:"Name"}),(0,a.jsx)(i.I,{id:"name",value:g,onChange:e=>p(e.target.value),placeholder:"Your name",required:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(l._,{htmlFor:"email",children:"Email"}),(0,a.jsx)(i.I,{id:"email",type:"email",value:x,onChange:e=>h(e.target.value),placeholder:"Your email address",required:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(l._,{htmlFor:"message",children:"Message"}),(0,a.jsx)(d.g,{id:"message",value:b,onChange:e=>y(e.target.value),placeholder:"Tell us about your requirements",className:"min-h-[100px]",required:!0})]}),(0,a.jsxs)(s.cN,{children:[(0,a.jsx)(s.GG,{asChild:!0,children:(0,a.jsx)(o.z,{type:"button",variant:"outline",className:"mt-2",children:"Cancel"})}),(0,a.jsx)(o.z,{type:"submit",className:"mt-2 bg-blue-900 hover:bg-blue-800",disabled:v,children:v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Y2X,{className:"mr-2 h-4 w-4"}),"Send Message"]})})]})]})]})]})})}),(0,a.jsx)(f._v,{className:"bg-blue-50 text-blue-700 border border-blue-200 p-3",children:"Application submitted successfully. We'll be in touch soon!"})]})})}},85100:function(e,t,r){r.d(t,{X:function(){return d},bZ:function(){return l}});var a=r(52322),n=r(2784),s=r(61335),o=r(43632);let i=(0,s.j)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),l=n.forwardRef((e,t)=>{let{className:r,variant:n,...s}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,o.cn)(i({variant:n}),r),...s})});l.displayName="Alert",n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("h5",{ref:t,className:(0,o.cn)("mb-1 font-medium leading-none tracking-tight",r),...n})}).displayName="AlertTitle";let d=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,o.cn)("text-sm [&_p]:leading-relaxed",r),...n})});d.displayName="AlertDescription"},25090:function(e,t,r){r.d(t,{d:function(){return l},z:function(){return d}});var a=r(52322),n=r(2784),s=r(4222),o=r(61335),i=r(43632);let l=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=n.forwardRef((e,t)=>
1{let{className:r,variant:n,size:o,asChild:d=!1,...c}=e,u=d?s.g7:"button";return(0,a.jsx)(u,{className:(0,i.cn)(l({variant:n,size:o,className:r})),ref:t,...c})});d.displayName="Button"},47843:function(e,t,r){r.d(t,{$N:function(){return x},Be:function(){return h},GG:function(){return u},Vq:function(){return l},cN:function(){return p},cZ:function(){return f},fK:function(){return g},hg:function(){return d}});var a=r(52322),n=r(2784),s=r(39479),o=r(77298),i=r(43632);let l=s.fC,d=s.xz,c=s.h_,u=s.x8,m=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...n})});m.displayName=s.aV.displayName;let f=n.forwardRef((e,t)=>{let{className:r,children:n,...l}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(m,{}),(0,a.jsxs)(s.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...l,children:[n,(0,a.jsxs)(s.x8,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(o.Pxu,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=s.VY.displayName;let g=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};g.displayName="DialogHeader";let p=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};p.displayName="DialogFooter";let x=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",r),...n})});x.displayName=s.Dx.displayName;let h=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",r),...n})});h.displayName=s.dk.displayName},56462:function(e,t,r){r.d(t,{I:function(){return o}});var a=r(52322),n=r(2784),s=r(43632);let o=n.forwardRef((e,t)=>{let{className:r,type:n,...o}=e;return(0,a.jsx)("input",{type:n,className:(0,s.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...o})});o.displayName="Input"},76510:function(e,t,r){r.d(t,{_:function(){return d}});var a=r(52322),n=r(2784),s=r(23707),o=r(61335),i=r(43632);let l=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.f,{ref:t,className:(0,i.cn)(l(),r),...n})});d.displayName=s.f.displayName},91262:function(e,t,r){r.d(t,{g:function(){return o}});var a=r(52322),n=r(2784),s=r(43632);let o=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)("textarea",{className:(0,s.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...n})});o.displayName="Textarea"},21106:function(e,t,r){r.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return l}});var a=r(52322),n=r(2784),s=r(99385),o=r(43632);let i=s.zt,l=s.fC,d=s.xz,c=n.forwardRef((e,t)=>{let{className:r,sideOffset:n=4,...i}=e;return(0,a.jsx)(s.VY,{ref:t,sideOffset:n,className:(0,o.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...i})});c.displayName=s.VY.displayName},72510:function(e,t,r){r.d(t,{X:function(){return i}});var a=r(2784),n=r(35374),s=r(89644),o=r.n(s);function i(){let e=(0,n.W)(),[t,r]=(0,a.useState)(""),[s,i]=(0,a.useState)(""),l=async(t,a)=>{let{data:n,error:s}=await e.auth.signInWithPassword({email:t,password:a});return!s&&null!=n&&!!n.user||(console.error(s),r(s?s.message:"An unexpected error occurred."),!1)},d=async function(t,a,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let d=t.toLowerCase();if(["castingnetworks","breakdown","backstage"].some(e=>d.includes(e)))return i("A verification code has been sent to your email!"),!1;if("casting"===n){let e=d.split("@")[1];if(!e||["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","proton.me","zoho.com","yandex.com","gmx.com","gmx.net","live.com","msn.com","me.com","mac.com","inbox.com","fastmail.com","tutanota.com","hey.com","pm.me"].includes(e))return r("Please use your organization email to sign up for a casting account."),
1!1}console.log("Rewardful referral used: ".concat(s)),console.log("User referral used: ".concat(o));let{data:m,error:f}=await e.auth.signUp({email:t,password:a,options:{data:{user_type:n,is_onboarding:!0,referral:s||null,user_referral:o||null,upgradeModalShown:!1}}});if(f){if(console.log("Error is ".concat(f.message)),f.message&&f.message.toLowerCase().includes("user already registered"))return r(""),i("You already have an account. Attempting to log you in."),await l(t,a);console.error(f),r(f.message)}else if(null==m?void 0:m.user){if(console.log("User creation successful: ".concat(JSON.stringify(m.user))),!await c({userId:m.user.id}))return r("Failed to set initial user preferences."),!1;if(!await u({userId:m.user.id,email:t,userType:n,rewardfulReferral:s,userReferral:o}))return r("Failed to onboard user."),!1;let{error:a}=await e.auth.updateUser({data:{is_onboarding:!1}});if(a)return console.error(a),r(a.message),!1;return!0}return!1}catch(e){return console.error(e),r("An unexpected error occurred."),!1}},c=async e=>{let{userId:t}=e;try{let e=await fetch("/api/user-preferences",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t,autoApply:!0,physicalAttributesPrivate:!1,emailDigestFrequency:"daily",smartSubmissionNote:!0})}),r=await e.json();if(!e.ok)throw Error(r.message);return r.created?console.log("User preferences created successfully"):console.log("User preferences already exist"),!0}catch(e){return console.error("Error updating user preferences:",e),!1}},u=async e=>{let{userId:t,email:r,userType:a,rewardfulReferral:n,userReferral:s}=e;console.log("Onboarding user with ID ".concat(t," (type: ").concat(a,") and email ").concat(r," with Rewardful code ").concat(n," and user referral ").concat(s,"."));try{let e=await o().post("/api/onboard-user",{userId:t,email:r,userType:a,referral:n,userReferral:s});if(200!==e.status)throw Error(e.data.message||"Failed to onboard user.");return console.log("User onboarded successfully"),await new Promise(e=>setTimeout(e,500)),!0}catch(e){return console.error("Error onboarding user:",e),!1}};return{errorMessage:t,verificationMessage:s,setErrorMessage:r,setVerificationMessage:i,logIn:l,signUp:d,markUpgradeModalAsShown:async()=>{try{let{error:t}=await e.auth.updateUser({data:{upgradeModalShown:!0}});if(t)return console.error("Error marking upgrade modal as shown:",t),!1;return!0}catch(e){return console.error("Error marking upgrade modal as shown:",e),!1}}}}}}]);
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.