import{r as e}from"./rolldown-runtime-hePW80VL.js";import{o as t}from"./vendor-forms-yQg41KHz.js";import{t as n}from"./vendor-react-CAGJwf-T.js";import{n as r,t as i}from"./EligibilityResultCard-DxMASHZ-.js";import{D as a,O as o}from"./index-Z_bdWDpJ.js";import{n as s}from"./eligibilityRtkApi-DkYI0_6i.js";var c=e(t(),1),l=n();function u({customerId:e,isOpen:t,onClose:n}){return(0,l.jsx)(o,{isOpen:t,onClose:n,title:`Check Eligibility`,description:`Run a credit and KYC eligibility check using this customer's profile.`,size:`xl`,footer:(0,l.jsx)(a,{variant:`outline`,onClick:n,children:`Close`}),children:t&&(0,l.jsx)(d,{customerId:e})})}function d({customerId:e}){let{data:t}=s(),n=t?.eligibility.require_consent??!0,a=t?.eligibility.internal_default_outcome??`lead`,[o,u]=(0,c.useState)(null);return o?(0,l.jsxs)(`div`,{className:`space-y-4`,children:[(0,l.jsx)(i,{check:o,defaultOutcome:a}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>u(null),className:`text-[12px] text-[var(--color-primary)] hover:underline`,children:`Run another check`})]}):(0,l.jsx)(r,{customerId:e,requireConsent:n,aadhaarEnabled:t?.surepass?.aadhaar_otp_enabled??!1,panAutofillEnabled:t?.surepass?.pan_autofill_enabled??!1,onResult:u})}export{u as t};