1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,316470,e=>{"use strict";var t=e.i(843476),a=e.i(562175),i=e.i(191476),s=e.i(271645),r=e.i(217255),n=e.i(383642),l=e.i(307904),o=e.i(459521),c=e.i(160224);let d={loading:!1,data:null},u=(0,s.createContext)({loading:!1,application:null,setApplication:()=>{},getApplication:()=>{},fetchApplication:async()=>null,getCustomer:()=>{},fetchUserData:async()=>null});e.s(["default",0,e=>{let{children:p,payload:m}=e,x=(0,a.default)(),[h,f]=(0,s.useState)({...d,data:m}),{updateUser:g,user:b}=(0,n.useAuth)(),{data:y,status:j}=(0,r.useSession)(),N=y?.accessToken,v="authenticated"===j&&!!N,w=e=>f(t=>({...t,...e})),k=(0,s.useRef)(!1),A=(0,s.useRef)(null),R=(0,s.useRef)(null),C=(0,l.isTestMode)();(0,s.useEffect)(()=>{C&&w({data:o.TEST_APPLICATION,loading:!1})},[C]),(0,s.useEffect)(()=>{!C&&m&&w({data:m})},[m]),(0,s.useEffect)(()=>{!C&&v&&b?.id&&!h.data&&!h.loading&&B()},[v,b?.id]),(0,s.useEffect)(()=>{!C&&v&&b?.id&&P()},[v,b?.id]);let S=()=>
1{if(C)return w({data:o.TEST_APPLICATION,loading:!1}),Promise.resolve(o.TEST_APPLICATION);let e=A.current;return e&&(0,c.isSnapshotCurrent)(e.snap)?e.promise:e?(R.current||(R.current=e.promise.catch(()=>null).then(()=>(R.current=null,I()))),R.current):I()},I=()=>{let e=(0,c.requestSnapshot)(),t=T().finally(()=>{A.current?.promise===t&&(A.current=null)});return A.current={promise:t,snap:e},t},T=async()=>{try{w({loading:!0});let e=await x.get("/api/v2/applicationByCustomerToken",{params:{_ts:Date.now()},headers:{"Cache-Control":"no-cache"}});if(200===e.status||201===e.status){let t=e.data,a=t?.data?.[0]||t?.data;if(Array.isArray(a)&&0===a.length)return w({data:null}),null;return w({data:a}),a??null}}catch(e){i.AxiosError}finally{w({loading:!1})}return null},B=()=>{S()},P=async()=>{if(!C&&v&&!k.current){k.current=!0;try{let e=await x.get("/api/customer/get");if(200===e.status||201===e.status){let t=e.data?.data,a=(0,n.userInitializer)({apiData:t});g(a)}}catch(e){i.AxiosError}finally{k.current=!1}}},E=async()=>{if(C)return b;if(!v)return null;try{let e=await x.get("/api/customer/get");if(200===e.status||201===e.status){let t=e.data?.data;return(0,n.userInitializer)({apiData:t})}}catch(e){i.AxiosError}return null};return(0,t.jsx)(u.Provider,{value:{application:h.data,loading:h.loading,setApplication:e=>w({data:e}),getApplication:B,fetchApplication:S,getCustomer:P,fetchUserData:E},children:p})},"useApplication",0,function(){let e=(0,s.useContext)(u);if(void 0===e)throw Error("useApplication must be used within an ApplicationProvider");return e}])},652342,e=>{"use strict";e.s(["KycStatusProvider",()=>Y,"default",()=>K,"useKycStatus",()=>$],652342);var t=e.i(843476),a=e.i(271645),i=e.i(174080),s=e.i(88653),r=e.i(846932),n=e.i(717521),l=e.i(180127),o=e.i(403014),c=e.i(10252),d=e.i(589511),u=e.i(361277),p=e.i(624895),m=e.i(123287),x=e.i(779271),h=e.i(563921);let f=(0,e.i(475254).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var g=e.i(582458),b=e.i(949411),y=e.i(923892),j=e.i(841947),N=e.i(813560),v=e.i(562175),w=e.i(6799),k=e.i(383642),A=e.i(316470),R=e.i(772328),C=e.i(41423);let S=e=>{let{status:i,title:S,description:I,data:T,onContinue:B,onBack:P,onDecision:E}=e,L=(0,N.useRouter)(),[O,F]=(0,a.useState)(!1),[_,U]=(0,a.useState)(null),z=(0,v.default)(),{user:D,updateUser:Y}=(0,k.useAuth)(),{application:$,fetchApplication:K}=(0,A.useApplication)(),W=(0,R.useReducedMotion)(),M="approved"===i,q="proceed-to-bank"===i,G="rejected"===i,H="pending"===i,J=e=>{let t=(e?.status??e?.bsaBreStatus??e?.breStatus??"").toString().trim().toUpperCase();return t.includes("APPROVE")||t.includes("REJECT")||t.includes("DECLINE")},V=(e,t)=>{(0,C.clearAaReinitializeCount)(e),(0,w.toast)({variant:"info",title:"Your bank data is still arriving",description:"Keep going â we'll pick it up as soon as it lands."}),B()},Q=async(e,t)=>{let a=T?.applicationNumber||$?.applicationNumber||"";try{let e=await z.post("/api/v2/application/loan/create",{status:"HOLD",isSubmit:!0});200===e.status||e.status}catch(e){}try{localStorage.setItem("applicationStatusData",JSON.stringify({status:"hold",loanNumber:a,amount:"",reason:"We couldn't complete your bank statement check, so your application stays with our team for review."}))}catch{}Y({isSubmit:!0}),K(),P(),L.push("/application-status")},X=function(e,t,a){arguments.length>3&&void 0!==arguments[3]&&arguments[3];let i="string"==typeof a?.message?a.message.trim():"";U({title:e,detail:i?`${i.replace(/[.\s]+$/,"")}. ${t}`:t})},Z=(e,t)=>(0,C.reinitializeAaConsent)((e,t)=>z.post(e,t),{customerId:e,applicationId:t}),ee=(0,a.useRef)(!1),et=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(1===e&&(0,C.isConsentReturnInFlight)())return void U({title:C.CONSENT_RETURN_STILL_STORING.title,detail:C.CONSENT_RETURN_STILL_STORING.description});if(1===e){if(ee.current)return;ee.current=!0}let t=D?.id,a=T?.applicationId||$?._id;if(!t||!a){U({title:"Refresh the page to continue",detail:"We lost track of your application in this session."}),1===e&&(ee.current=!1);return}U(null),F(!0);try{if(1===e){let e,t=await K(),i={status:(e=t?.breHistory||{}).bsaBreStatus||e.breStatus||t?.status,bsaBreStatus:e.bsaBreStatus,breStatus:e.breStatus,applicationNumber:t?.applicationNumber,applicationId:t?._id||t?.applicationId||a,reason:e.reason,loanAmount:t?.approvedLoanAmount??t?.requestedLoanAmount,approvedLoanAmount:t?.approvedLoanAmount,tenure:t?.tenure,tenureUnit:t?.tenureUnit,totalInterest:t?.totalInterest,totalRepayment:t?.totalRepayment,netDisbursalAmount:t?.netDisbursalAmount,interestRate:t?.interestRate};if("COMPLETED"===(t?.bsaStatus||t?.breHistory?.bsaStatus||"").toString().trim().toUpperCase()&&E&&J(i)){(0,C.clearAaReinitializeCount)(a),E(i);return}}let i=await z.post("/api/aa/storeData",{customerId:t,applicationId:a}),s=i.data,r=200===i.status||201===i.status;if((0,C.isReinitiated)(s)){let e=s?.data?.url||s?.data?.redirectUrl||s?.url;if(e){window.location.href=e;return}X("Your bank consent was restarted","Tap Try again to pick it up.",s,"consent reinitiated without a URL");return}if((0,C.isFetchInProgress)(s))return void V(a,s);let n=(0,C.classifyStoreDataResponse)(s,r);if("success"===n){if((0,C.clearAaReinitializeCount)(a),E&&J(s?.data))return void E(s.data);let e=Number(s?.data?.transactionsCount)||0;(0,w.toast)({variant:"success",title:"Bank statements received",description:e?`We read ${e.toLocaleStr
1ing("en-IN")} transactions. Let's finish with bank verification.`:"Let's finish with bank verification."}),B();return}if((0,C.isNonRetryable)(s))return void await Q(s,"non-retryable");if((0,C.isReinitializeRequested)(s)){if(await Z(t,a))return;await Q(s,"consent could not be reopened");return}if("stop"!==n&&e<10)return await new Promise(t=>setTimeout(t,Math.min(4e3+1e3*e,12e3))),et(e+1);await Q(s,"report never landed after retries")}catch(i){let e=i?.response?.data;if((0,C.isFetchInProgress)(e))return void V(a,e);if((0,C.isReinitiated)(e)){let t=e?.data?.url||e?.data?.redirectUrl||e?.url;if(t){window.location.href=t;return}X("Your bank consent was restarted","Tap Try again to pick it up.",e,"consent reinitiated without a URL");return}if((0,C.isNonRetryable)(e))return void await Q(e,"non-retryable");if((0,C.isReinitializeRequested)(e)){if(await Z(t,a))return;await Q(e,"consent could not be reopened");return}if(e)return void await Q(e,`storeData refused (${i?.response?.status})`);U({title:"We couldn't reach the server",detail:"Check your connection, then try again."})}finally{F(!1),1===e&&(ee.current=!1)}},ea=(0,a.useRef)(!1),ei=!!D?.id&&!!(T?.applicationId||$?._id);(0,a.useEffect)(()=>{if(!q){ea.current=!1;return}!ea.current&&ei&&(ea.current=!0,et())},[q,ei]);let es=async()=>{if((0,C.isConsentReturnInFlight)())return void U({title:C.CONSENT_RETURN_STILL_STORING.title,detail:C.CONSENT_RETURN_STILL_STORING.description});let e=D?.id,t=T?.applicationId||$?._id;if(!e||!t)return void U({title:"Refresh the page to continue",detail:"We lost track of your application in this session."});U(null),F(!0);try{let a=await z.post("/api/aa/initialize",{customerId:e,applicationId:t}),i=a.data,s=i.data?.redirectUrl||i.data?.url;200===a.status||201===a.status?s?window.location.href=s:X("We couldn't open your bank consent","Try again in a moment, or contact support if it keeps happening.",i,"aa/initialize returned no consent URL"):U({title:"We couldn't start bank verification",detail:i.message||"Try again in a moment."})}catch(e){U({title:"We couldn't start bank verification",detail:e?.response?.data?.message||e?.message||"Check your connection, then try again."})}finally{F(!1)}},er="",en="",el=null,eo="",ec="";M?(er="text-emerald-600 bg-emerald-100 ring-emerald-50",en="bg-gradient-to-b from-emerald-50 to-white",el=(0,t.jsx)(m.default,{className:"w-10 h-10"}),eo="Offer Unlocked!",ec="Congratulations! You are eligible for the following loan offer."):q?(er="text-blue-600 bg-blue-100 ring-blue-50",en="bg-gradient-to-b from-blue-50 to-white",el=(0,t.jsx)(x.default,{className:"w-10 h-10"}),eo="Proceed to Bank Verification",ec="Your application requires additional bank verification to proceed."):H?(er="text-amber-600 bg-amber-100 ring-amber-50",en="bg-gradient-to-b from-amber-50 to-white",el=(0,t.jsx)(b.default,{className:"w-10 h-10"}),eo="Your account is under review",ec="Your application is currently under review. Please contact our support team for assistance."):(er="text-red-500 bg-red-100 ring-red-50",en="bg-gradient-to-b from-red-50 to-white",el=(0,t.jsx)(f,{className:"w-10 h-10"}),eo="Application Rejected",ec="Based on our credit policy, we cannot proceed with your application at this time.");let ed=S||eo,eu=I||ec,ep=(0,t.jsx)(s.AnimatePresence,{initial:!1,children:_&&(0,t.jsxs)(r.motion.div,{role:"alert","aria-live":"assertive",initial:W?{opacity:0}:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0},transition:{duration:.18},className:"mb-3 flex items-stretch gap-3 rounded-xl border border-rose-100 bg-rose-50 p-3 text-left",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"w-[3px] shrink-0 rounded-full bg-rose-500"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-rose-900 leading-snug",children:_.title}),_.detail&&(0,t.jsx)("p",{className:"text-xs text-rose-700/90 mt-0.5 leading-relaxed",children:_.detail})]})]})}),em=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:0}).format(e);return(0,t.jsxs)("div",{className:"flex flex-col w-full",children:[(0,t.jsxs)("div",{className:`relative ${M&&T?.loanAmount?"h-24":"h-32"} flex items-center justify-center overflow-hidden transition-colors ${en}`,children:[(0,t.jsx)("div",{className:"absolute inset-0 opacity-30",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(0,0,0,0.05) 1px, transparent 0)",backgroundSize:"24px 24px"}}),M&&(0,t.jsx)("button",{type:"button",onClick:P,"aria-label":"Close and come back to this offer later",className:"absolute right-3 top-3 z-20 grid h-9 w-9 place-items-center rounded-full text-gray-500 transition-colors hover:bg-black/5 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#25B181]",children:(0,t.jsx)(j.default,{className:"h-4 w-4"})}),(0,t.jsx)(r.motion.div,{initial:{scale:0,rotate:-45},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:200,damping:15,delay:.1},className:`relative z-10 p-4 rounded-full shadow-lg ring-8 ${er}`,children:el})]}),(0,t.jsxs)("div",{className:"px-6 pb-6 pt-2",children:[(0,t.jsxs)("div",{className:"text-center mb-6",children:[(0,t.jsx)("h3",{className:"text-xl font-bold tracking-tight text-gray-900",children:ed}),!G&&(!M||!T?.loanAmount)&&(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:eu})]}),G&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:10}
1,animate:{opacity:1,y:0},className:"space-y-4 mb-6",children:[(0,t.jsx)("div",{className:"bg-red-50 rounded-xl p-4 border border-red-100 text-left",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(g.default,{className:"w-5 h-5 text-red-600 shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-bold text-red-800 uppercase tracking-wide mb-1",children:"Reason for Rejection"}),(0,t.jsx)("p",{className:"text-sm text-red-700 leading-relaxed font-medium",children:T?.reason||"Internal credit policy criteria not met."})]})]})}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-100 text-center",children:[(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Application No"}),(0,t.jsx)("p",{className:"text-sm font-bold text-gray-900 font-mono mb-3",children:T?.applicationNumber||T?.applicationId||"N/A"}),(0,t.jsx)("div",{className:"h-px w-full bg-gray-200 my-3"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["You can re-apply after ",(0,t.jsx)("span",{className:"font-bold text-gray-900",children:"60 days"}),"."]})]})]}),q&&(T?.applicationNumber||T?.applicationId)&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"rounded-xl p-3 mb-6 border text-center bg-blue-50 border-blue-100",children:[(0,t.jsx)("p",{className:"text-xs uppercase font-semibold mb-1 text-blue-500",children:"Application ID"}),(0,t.jsx)("p",{className:"font-bold text-gray-800 text-base tracking-wide",children:T.applicationNumber||T.applicationId}),T?.reason&&(0,t.jsx)("p",{className:"text-xs text-blue-600 mt-2 px-2",children:T.reason})]}),H&&(T?.applicationNumber||T?.applicationId)&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"rounded-xl p-3 mb-6 border text-center bg-amber-50 border-amber-100",children:[(0,t.jsx)("p",{className:"text-xs uppercase font-semibold mb-1 text-amber-500",children:"Application No"}),(0,t.jsx)("p",{className:"font-bold text-gray-800 text-base tracking-wide",children:T?.applicationNumber||T?.applicationId})]}),M&&T&&T.loanAmount&&(0,t.jsxs)(r.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-gray-50 rounded-2xl border border-gray-200 p-4 mb-6",children:[(0,t.jsxs)("div",{className:"text-center border-b border-gray-200 pb-3 mb-3",children:[(0,t.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wide font-semibold",children:"Approved Amount"}),(0,t.jsx)("p",{className:"text-3xl font-bold text-[#25B181] mt-1",children:em(T.loanAmount)})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-y-4 gap-x-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-500 text-xs",children:[(0,t.jsx)(u.default,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Tenure"})]}),(0,t.jsxs)("p",{className:"font-semibold text-gray-900 text-sm",children:[T.tenure," ",T.tenureUnit]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-500 text-xs",children:[(0,t.jsx)(p.default,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Interest"})]}),(0,t.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:em(T.totalInterest||0)})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-500 text-xs",children:[(0,t.jsx)(d.default,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Disbursal"})]}),(0,t.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:em(T.netDisbursalAmount||0)})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-500 text-xs",children:[(0,t.jsx)(m.default,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Repayment"})]}),(0,t.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:em(T.totalRepayment||0)})]})]}),(0,t.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-200 text-center",children:(0,t.jsxs)("p",{className:"text-[10px] text-gray-400",children:["Application No: ",T.applicationNumber||T.applicationId]})})]}),q&&(0,t.jsxs)(t.Fragment,{children:[ep,(0,t.jsx)("button",{onClick:()=>et(),disabled:O,className:"w-full group relative py-3.5 px-4 bg-blue-600 hover:bg-blue-700 disabled:opacity-70 disabled:cursor-not-allowed text-white rounded-xl font-bold text-sm transition-all shadow-lg shadow-blue-600/20 hover:shadow-blue-600/40 hover:-translate-y-0.5",children:(0,t.jsx)("span",{className:"flex items-center justify-center gap-2",children:O?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{className:"w-5 h-5 animate-spin"})," Processing..."]}):_?(0,t.jsxs)(t.Fragment,{children:["Try again ",(0,t.jsx)(h.default,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]}):(0,t.jsxs)(t.Fragment,{children:["Proceed to Bank ",(0,t.jsx)(h.default,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]})})}),_&&!O&&(0,t.jsxs)("button",{onClick:()=>{P(),L.push("/support")},className:"mt-3 w-full flex items-center justify-center gap-1.5 text-xs font-medium text-gray-500 hover:text-gray-800 transition-colors",children:[(0,t.jsx)(y.default,{className:"w-3.5 h-3.5"}),"Still stuck? Contact support"]})]}),H&&(0,t.jsxs)(t.Fragment,{children:[ep,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("button",{onClick:es,disabled:O,className:"w-full group relative py-3.5 px-4 bg-blue-600 hover:bg-blue-700 disabled:opacity-70 disabled:cursor-not-allowed text-white rounded-xl font-bold text-sm transition-all shadow-lg shadow-blue-600/20 hover:shadow-blue-600/40 hover:-translate-y-0.5",children:(0,t.jsx)("span",{className:"flex items-center justify-center gap-2",children:O?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.default,{className:"w-5 h-5 animate-spin"})," Processing..."]}):_?(0,t.jsxs)(t.Fragment,{children:["Try again ",(0,t.jsx)(h.default,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]}):(0,t.jsxs)(t.Fragment,{children:["Proceed to Bank ",(0,t.jsx)(h.default,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]})})}),(0,t.jsx)("button",{onClick:P,className:"w-full py-3 px-2 bg-white border border-gray-200 hover:bg-gray-50 text-gray-700 rounded-xl font-semibold text-sm transition-all",children:"Close"}),(0,t.jsxs)("button",{onClick:()=>{P(),L.push("/support")},className:"w-full flex items-center justify-center gap-1.5 text-xs font-medium text-amber-700 hover:text-amber-800 transition-colors",children:[(0,t.jsx)(y.default,{className:"w-3.5 h-3.5"}),"Need help? Contact Support"]})]})]}),M&&(0,t.jsx)("button",{onClick:B,className:"w-full group relative py-3.5 px-4 bg-[#25B181] hover:bg-[#1F8F68] text-white rounded-xl font-bold text-sm transition-all shadow-lg shadow-[#25B181]/20 hover:shadow-[#25B181]/40 hover:-translate-y-0.5",children:(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2",children:["Accept & Proceed",(0,t.jsx)(l.default,{className:"w-4 h-4 rotate-180 group-hover:translate-x-1 transition-transform"})]})}),G&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("button",{onClick:()=>{P(),L.push("/")},className:"w-full py-3 px-2 bg-white border border-gray-200 hover:bg-gray-50 text-gray-700 rounded-xl font-semibold text-sm transition-all flex items-center justify-center gap-2",children:[(0,t.jsx)(o.default,{className:"w-4 h-4"}),"Home"]}),(0,t.jsxs)("button",{onClick:()=>{P(),L.push("/user")},className:"w-full py-3 px-2 bg-gray-900 hover:bg-black text-white rounded-xl font-semibold text-sm transition-all flex items-center justify-center gap-2 shadow-md",children:[(0,t.jsx)(c.default,{className:"w-4 h-4"}),"Dashboard"]})]})]})]})};var I=e.i(678745),T=e.i(187942),B=e.i(517302),P=e.i(136166),E=e.i(365452);
1let L=[{title:"Securing your connection",detail:"Setting up an encrypted session"},{title:"Connecting to the Account Aggregator",detail:"An RBI-regulated network used by banks"},{title:"Opening your bank's consent screen",detail:"You'll approve access there in a few taps"}],O=[{icon:T.default,label:"Read-only access"},{icon:B.default,label:"We never see your password"},{icon:P.default,label:"RBI-regulated"}],F=e=>{let{icon:a,label:i}=e;return(0,t.jsxs)("div",{className:"flex w-16 flex-col items-center gap-1.5",children:[(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-[#25B181]/15 to-[#51C9AF]/10 ring-1 ring-[#25B181]/20",children:(0,t.jsx)(a,{className:"h-6 w-6 text-[#1F8F68]","aria-hidden":"true"})}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-gray-500",children:i})]})},_=()=>{let e=(0,R.useReducedMotion)(),[i,n]=(0,a.useState)(0);return(0,a.useEffect)(()=>{if(i>=L.length-1)return;let e=setTimeout(()=>n(e=>Math.min(e+1,L.length-1)),1600);return()=>clearTimeout(e)},[i]),(0,t.jsxs)("div",{className:"flex flex-col items-center px-6 pt-8 pb-6 text-center",role:"status","aria-live":"polite",children:[(0,t.jsxs)("div",{className:"relative mb-6 flex w-full max-w-[260px] items-center justify-between",children:[(0,t.jsx)(F,{icon:E.default,label:"You"}),(0,t.jsxs)("div",{className:"relative mx-2 h-12 flex-1",children:[(0,t.jsx)("div",{className:"absolute inset-x-0 top-1/2 h-[2px] -translate-y-1/2 rounded-full bg-[#25B181]/15"}),!e&&[0,1,2].map(e=>(0,t.jsx)(r.motion.span,{className:"absolute top-1/2 h-1.5 w-1.5 -translate-y-1/2 rounded-full bg-[#25B181]",initial:{left:"0%",opacity:0}
1,animate:{left:["0%","100%"],opacity:[0,1,1,0]},transition:{duration:1.8,repeat:1/0,delay:.6*e,ease:"easeInOut"}},e)),(0,t.jsx)(r.motion.div,{className:"absolute left-1/2 top-1/2 flex h-10 w-10 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow-md ring-4 ring-[#25B181]/10",animate:e?void 0:{scale:[1,1.08,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:(0,t.jsx)(P.default,{className:"h-5 w-5 text-[#25B181]","aria-hidden":"true"})})]}),(0,t.jsx)(F,{icon:x.default,label:"Your bank"})]}),(0,t.jsx)("h3",{className:"text-lg font-bold tracking-tight text-gray-900",children:"Preparing your bank consent"}),(0,t.jsx)("div",{className:"mt-1 min-h-[40px]",children:(0,t.jsx)(s.AnimatePresence,{mode:"wait",children:(0,t.jsx)(r.motion.p,{initial:e?{opacity:0}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:e?{opacity:0}:{opacity:0,y:-6},transition:{duration:.2},className:"text-sm text-gray-500",children:L[i].detail},i)})}),(0,t.jsx)("ol",{className:"mt-4 w-full space-y-2.5 text-left",children:L.map((a,s)=>{let n=s<i,l=s===i;return(0,t.jsxs)("li",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold transition-colors ${n?"bg-[#25B181] text-white":l?"bg-[#25B181]/10 text-[#25B181] ring-2 ring-[#25B181]/30":"bg-gray-100 text-gray-400"}`,children:n?(0,t.jsx)(I.default,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l&&!e?(0,t.jsx)(r.motion.span,{className:"h-2 w-2 rounded-full bg-[#25B181]",animate:{opacity:[.3,1,.3]},transition:{duration:1.2,repeat:1/0}}):s+1}),(0,t.jsx)("span",{className:`text-sm transition-colors ${n?"text-gray-500":l?"font-semibold text-gray-900":"text-gray-400"}`,children:a.title})]},a.title)})}),(0,t.jsx)("div",{className:"mt-5 grid w-full grid-cols-3 gap-2 rounded-2xl bg-emerald-50/70 px-2 py-3 ring-1 ring-emerald-100",children:O.map(e=>{let{icon:a,label:i}=e;return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,t.jsx)(a,{className:"h-4 w-4 text-[#25B181]","aria-hidden":"true"}),(0,t.jsx)("span",{className:"text-[10.5px] leading-tight text-emerald-900/80",children:i})]},i)})}),(0,t.jsx)("p",{className:"mt-4 text-xs text-gray-400",children:"Please don't close or refresh this page."})]})},U=()=>{let{visibility:e,loading:l,loadingKind:o,status:c,title:d,description:u,data:p,updateVisibility:m,onSuccess:x,onFailure:h,onDecision:f}=$(),[g,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>(b(!0),()=>b(!1)),[]),(0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]);let y=()=>m(!1);return g?(0,i.createPortal)((0,t.jsx)(s.AnimatePresence,{children:e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 sm:p-6",style:{pointerEvents:"auto"},children:[(0,t.jsx)(r.motion.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-gray-900/60 backdrop-blur-sm transition-all",onClick:l?void 0:y}),(0,t.jsx)(r.motion.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"relative z-10 w-full max-w-sm bg-white rounded-3xl shadow-2xl overflow-y-auto max-h-[90vh] ring-1 ring-black/5",children:l?"consent"===o?(0,t.jsx)(_,{}):(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center p-10 text-center",children:[(0,t.jsxs)("div",{className:"relative mb-6",children:[(0,t.jsx)(r.motion.div,{animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"absolute inset-0 bg-[#25B181]/20 rounded-full"}),(0,t.jsx)(r.motion.div,{animate:{scale:[1,1.2,1],opacity:[.8,.2,.8]},transition:{duration:2,repeat:1/0,ease:"easeInOut",delay:.5},className:"absolute inset-0 bg-[#25B181]/30 rounded-full"}),(0,t.jsx)("div",{className:"relative z-10 w-20 h-20 bg-white rounded-full flex items-center justify-center shadow-lg ring-4 ring-[#25B181]/10",children:(0,t.jsx)(n.default,{className:"w-8 h-8 text-[#25B181] animate-spin"})})]}),(0,t.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Checking Eligibility"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-2 max-w-[240px]",children:"Please wait while we analyze your profile and generate an offer."})]}),{}):(0,t.jsx)(S,{status:c,title:d,description:u,data:p,onContinue:()=>{y(),x&&x()},onBack:()=>{y(),h&&h()},onDecision:f})})]})}),document.body):null},z=(0,a.createContext)(void 0),D={status:"pending",loading:!1,visibility:!1,title:"",description:"",data:null,onSuccess:void 0,onFailure:void 0,onDecision:void 0},Y=e=>{let{children:i}=e,[s,r]=(0,a.useState)(D),n=(0,a.useCallback)(e=>{r(t=>{let a={...t,...e};return"loading"in e&&!("loadingKind"in e)&&(a.loadingKind=void 0),a})},[]),l=(0,a.useCallback)(e=>n({visibility:e}),[n]),o=(0,a.useCallback)(e=>n({status:e}),[n]),c=(0,a.useCallback)(e=>n({loading:e}),[n]),d=(0,a.useMemo)(()=>({...s,updateVisibility:l,updateStatus:o,setLoading:c,updateKycStatusState:n}),[s,l,o,c,n]);return(0,t.jsxs)(z.Provider,{value:d,children:[(0,t.jsx)(U,{}),i]})};function $(){let e=(0,a.useContext)(z);if(void 0===e)throw Error("useKycStatus must be used within a KycStatusProvider");return e}let K=Y}]);
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.