1import{j as e}from"./vendor-motion-CPSEqs_I.js";import{i as k,R as h}from"./vendor-react-OjgrNuag.js";import{u as v}from"./vendor-query-ogxQoy9h.js";import{cA as _,d as S,r as L,cb as T,cc as o,gq as A,s as j}from"./App-DuQM0bfj.js";import{P as D}from"./PageSEO-kTf7LGYm.js";import"./index-DznYXkVU.js";import"./vendor-supabase-CQZ--lA_.js";import"./vendor-date-DG6vk2ZR.js";import"./vendor-helmet-BzTHcnMH.js";import"./abortAware-DTy6x2Iy.js";import"./seo-constants-CtdhRkhV.js";const P="#00FFFF",F=[{value:"license",label:"License"},{value:"co_production",label:"Co-production"},{value:"distribution",label:"Distribution"},{value:"service_work",label:"Service work"},{value:"investment",label:"Investment"},{value:"other",label:"Something else"}],q=T({partner_name:o().trim().min(1,"Please add your name.").max(120),partner_email:o().trim().email("That email address does not look right.").max(255),partner_company:o().trim().max(160).optional(),partner_role:o().trim().max(120).optional(),deal_kind:A(["license","co_production","distribution","service_work","investment","other"]),territory:o().trim().max(160).optional(),term_months:o().trim().max(5).optional(),amount:o().trim().max(20).optional(),message:o().trim().min(1,"Say what you are proposing.").max(4e3)}),r="w-full rounded-xl border border-white/10 bg-white/[0.04] px-3.5 py-3 text-[16px] text-white placeholder:text-white/50 focus:border-cyan-300/60 focus:outline-none",n="text-[14px] text-white/65";function H(){const{slug:l=""}=k(),[x,N]=h.useState(!1),[d,u]=h.useState(!1),[b,p]=h.useState(null),i=v({queryKey:["deal-intake",l],enabled:!!l,queryFn:async()=>{const{data:t,error:c}=await j.rpc("org_deal_intake",{_slug:l});if(c)throw c;return(Array.isArray(t)?t[0]:t)??null}});async function f(t){var y,g;t.preventDefault(),p(null);const c=new FormData(t.currentTarget),m=q.safeParse(Object.fromEntries(c.entries()));if(!m.success){p(((y=m.error.errors[0])==null?void 0:y.message)??"Please check the form.");return}u(!0);try{const{data:s,error:w}=await j.functions.invoke("submit-deal-request",{body:{slug:l,...m.data}});if(w)throw w;if(!(s!=null&&s.recorded))throw new Error((s==null?void 0:s.error)||"Your proposal was not recorded.");N(!0)}catch(s){p((g=s==null?void 0:s.message)!=null&&g.includes("Failed to send")?"That did not reach them. Check your connection and send it again.":(s==null?void 0:s.message)||"Your proposal was not recorded. Please try again.")}finally{u(!1)}}const a=i.data;return e.jsxs("div",{className:"min-h-screen bg-black pt-3",children:[e.jsx(D,{title:a?`Make ${a.name} an offer · Sinima`:"Send a proposal · Sinima",description:"Send a licensing, co-production, distribution or investment proposal directly to the workspace that owns the work.",canonical:`/propose/${l}`,noindex:!0}),e.jsxs("div",{className:"mx-auto w-full max-w-2xl px-5 py-10 sm:py-16",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx(_,{className:"h-7 w-7 text-cyan-300",strokeWidth:1.5}),e.jsx("h1",{className:"mt-4 text-[28px] font-light leading-tight tracking-tight text-white sm:text-[34px]",children:a?`Make ${a.name} an offer`:"Send a proposal"}),e.jsx("p",{className:"mt-3 text-[16px] leading-relaxed text-white/65",children:"Fill this in and it goes straight to the people who own the work. No account needed. Leave anything blank that you haven't settled yet."})]}),i.isLoading&&e.jsx("p",{className:"text-[16px] text-white/55",children:"Checking who this goes toâ¦"}),i.error&&e.jsx("p",{className:"rounded-2xl border border-[#DA4167]/40 bg-[#DA4167]/10 p-4 text-[15px] text-white/80",children:"We couldn't check who this link belongs to. Refresh and try again."}),!i.isLoading&&!i.error&&!a&&e.jsx("p",{className:"rounded-2xl border border-white/10 bg-white/[0.03] p-5 text-[15px] text-white/75",children:"This link doesn't belong to a workspace. Ask whoever sent it for a fresh one."}),a&&!a.is_open&&e.jsxs("p",{className:"rounded-2xl border border-white/10 bg-white/[0.03] p-5 text-[15px] text-white/75",children:[a.name," isn't taking proposals right now."]}),x&&e.jsxs("div",{className:"rounded-2xl border border-cyan-300/30 bg-cyan-300/[0.06] p-6",children:[e.jsx(S,{className:"h-6 w-6 text-cyan-300",strokeWidth:2}),e.jsx("p",{className:"mt-3 text-[18px] text-white",children:"It's on their desk."}),e.jsxs("p",{className:"mt-1 text-[15px] text-white/70",children:[a==null?void 0:a.name," has your proposal and your email address. They'll reply to you directly."]})]}),(a==null?void 0:a.is_open)&&!x&&e.jsxs("form",{onSubmit:f,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Your name"}),e.jsx("input",{name:"partner_name",required:!0,maxLength:120,className:r})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Your email"}),e.jsx("input",{name:"partner_email",type:"email",required:!0,maxLength:255,className:r})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Company (optional)"}),e.jsx("input",{name:"partner_company",maxLength:160,className:r})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Your role (optional)"}),e.jsx("input",{name:"partner_role",maxLength:120,className:r})]})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"What kind of deal is this?"}),e.jsx("select",{name:"deal_kind",defaultValue:"licence",className:r,children:F.map(t=>e.jsx("option",{value:t.value,className:"bg-black",children:t.label},t.value))})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Territory (optional)"}),e.jsx("input",{name:"territory",maxLength:160,placeholder:"Worldwide",className:r})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Term in months (optional)"}),e.jsx("input",{name:"term_months",inputMode:"numeric",maxLength:5,className:r})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"Amount in USD (optional)"}),e.jsx("input",{name:"amount",inputMode:"decimal",maxLength:20,className:r})]})]}),e.jsxs("label",{className:"block space-y-1.5",children:[e.jsx("span",{className:n,children:"What are you proposing? Name the title if it's about one piece of work."}),e.jsx("textarea",{name:"message",required:!0,rows:6,maxLength:4e3,className:r})]}),b&&e.jsx("p",{className:"rounded-xl border border-[#DA4167]/40 bg-[#DA4167]/10 px-4 py-3 text-[15px] text-white/85",children:b}),e.jsxs("button",{type:"submit",disabled:d,className:"inline-flex min-h-[48px] w-full items-center justify-center gap-2 rounded-full px-6 text-[16px] font-medium text-black disabled:opacity-60 sm:w-auto",style:{background:P},children:[d&&e.jsx(L,{className:"h-4 w-4 animate-spin",strokeWidth:2}),d?"Sending":"Send proposal"]})]})]})]})}export{H 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.