1import{S as I,r as l,j as e,U as Q}from"./vendor-CexQRgJT.js";import{Q as R,c as b,B as p,R as U}from"./main-BEPkzHDP.js";import{L as D,i as z,r as M}from"./icons-DOhpu8ly.js";import{m as g}from"./motion-C_xGicOG.js";import"./braintree-Dy4tYErP.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./pdf-ClIykhnB.js";import"./radix-tjr_ed6w.js";function P({question:c,value:d,onChange:i}){const{input_type:x,options:m}=c;if(x==="CHECKBOX"){const s=Array.isArray(m)&&m.length?m:["Yes","No"],n=s.length>2;return e.jsx("div",{className:n?"grid grid-cols-2 gap-3":"flex gap-3",children:s.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:`${n?"":"flex-1"} py-3 px-3 rounded-xl border-2 text-sm font-semibold transition-all ${d===o?"border-black bg-black text-white":"border-gray-200 text-gray-700 hover:border-gray-400"}`,children:o},o))})}return x==="NUMBER"?e.jsx("input",{type:"text",inputMode:"numeric",value:d??"",onChange:s=>{const n=s.target.value.replace(/\D/g,"");n.length<=10&&i(n)},onKeyDown:s=>{!["Backspace","Delete","Tab","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(s.key)&&!/^\d$/.test(s.key)&&s.preventDefault()},placeholder:"Enter a number",maxLength:10,className:"w-full border-2 border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-black transition-colors"}):e.jsx("input",{type:"text",value:d??"",onChange:s=>i(s.target.value),placeholder:"Enter your answer",className:"w-full border-2 border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-black transition-colors"})}function W(){const c=I(),d=new URLSearchParams(window.location.search),i=d.get("claim_id"),x=d.get("claim")||"this claim",[m,s]=l.useState(null),[n,o]=l.useState(!0),[y,f]=l.useState(null),[u,w]=l.useState({}),[A,S]=l.useState(!1),[j,N]=l.useState(!1);l.useEffect(()=>{if(!i){f("No claim ID provided."),o(!1);return}R(i).then(t=>{if(t.status==="QUALIFIED"){c(b("Dashboard"));return}s(t);const a={};t.questions?.forEach(r=>{r.value!==""&&r.value!==null&&r.value!==void 0&&(a[r.id]=r.value)}),w(a)}).catch(t=>f(t.message)).finally(()=>o(!1))},[i]);const v=(m?.questions??[]).slice().sort((t,a)=>t.order_index-a.order_index),_=t=>t.depends_on?u[t.depends_on]===t.show_when_answer:!0,k=v.filter(_),E=k.filter(t=>t.required!==!1).every(t=>u[t.id]!==void 0&&u[t.id]!==""),L=(t,a)=>{w(r=>{const C={...r,[t]:a};return v.forEach(h=>{h.depends_on===t&&a!==h.show_when_answer&&delete C[h.id]}),C})},B=async t=>{t.preventDefault(),N(!0);try{await U(i,u),S(!0)}catch(a){f(a.message)}finally{N(!1)}};return n?e.jsx("div",{className:"min-h-screen bg-[#f5f5f0] flex items-center justify-center",children:e.jsx(D,{className:"w-8 h-8 animate-spin text-gray-400"})}):y?e.jsx("div",{className:"min-h-screen bg-[#f5f5f0] flex items-center justify-center px-6",children:e.jsxs("div",{className:"bg-white rounded-3xl p-10 max-w-md w-full text-center shadow-sm border border-gray-200",children:[e.jsx("p",{className:"text-red-500 font-semibold mb-4",children:y}),e.jsx(p,{onClick:()=>c(b("Dashboard")),className:"w-full bg-black hover:bg-gray-800 text-white rounded-full py-5",children:"Back to Dashboard"})]})}):A?e.jsx("div",{className:"min-h-screen bg-[#f5f5f0] flex items-center justify-center px-6",children:e.jsxs(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white rounded-3xl p-10 max-w-md w-full text-center shadow-sm border border-gray-200",children:[e.jsx(z,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-black mb-2",children:"Information Submitted"}),e.jsx("p",{className:"text-gray-500 text-sm mb-6",children:"Thank you! We'll process your additional information and update your claim status."}),e.jsx(p,{onClick:()=>c(b("Dashboard")),className:"w-full bg-black hover:bg-gray-800 text-white rounded-full py-5",children:"Back to Dashboard"})]})}):e.jsxs("div",{className:"min-h-screen bg-[#f5f5f0]",children:[e.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-white border-b border-gray-200 px-6 h-16 flex items-center gap-4",children:[e.jsx("button",{onClick:()=>c(-1),className:"p-2 rounded-full hover:bg-gray-100 transition-colors",children:e.jsx(M,{className:"w-5 h-5 text-gray-600"})}
1),e.jsx(Q,{to:b("Dashboard"),children:e.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/698a0b917523116de4edac1b/2a6311660_ClaimCowHorizontal2.png",alt:"Claim Cow",className:"h-9 w-auto cursor-pointer"})})]}),e.jsx("div",{className:"pt-24 pb-16 px-6 max-w-2xl mx-auto",children:e.jsxs(g.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("div",{className:"mb-2",children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-orange-600 bg-orange-50 border border-orange-200 rounded-full px-3 py-1",children:"More Information Required"})}),e.jsx("h1",{className:"text-3xl font-bold text-black mt-4 mb-2",children:"Additional Questions"}),e.jsxs("p",{className:"text-gray-500 text-sm mb-8",children:["Please answer the following questions to continue processing your claim for"," ",e.jsx("span",{className:"font-medium text-black",children:m?.lawsuit_name||x}),"."]}),e.jsxs("form",{onSubmit:B,className:"space-y-6",children:[k.map((t,a)=>e.jsxs(g.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:a*.05},className:"bg-white rounded-2xl border border-gray-200 p-6 shadow-sm",children:[e.jsxs("p",{className:"text-sm font-semibold text-black leading-relaxed mb-4",children:[t.question_text,t.required!==!1&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsx(P,{question:t,value:u[t.id],onChange:r=>L(t.id,r)})]},t.id)),e.jsx(p,{type:"submit",disabled:!E||j,className:"w-full bg-black hover:bg-gray-800 text-white text-base py-6 rounded-full disabled:opacity-40 disabled:cursor-not-allowed",children:j?e.jsx(D,{className:"w-5 h-5 animate-spin mx-auto"}):"Submit Information"})]})]})})]})}export{W 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.