@eka-care/abha 0.1.99 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/abha/js/abha.js +1 -1
- package/package.json +1 -1
package/dist/sdk/abha/js/abha.js
CHANGED
|
@@ -62,7 +62,7 @@ b.goToAndStop(ht-b.firstFrame-1,!0)}ut.type==="loop"&&(rt===null||rt!==ut.frames
|
|
|
62
62
|
pds2-transition-colors`,children:[jsxRuntimeExports.jsx("input",{type:"radio",name:"ekaProfile",value:jt.oid,checked:It,onChange:()=>Tt({profile:jt}),className:"pds2-self-start pds2-mt-4 pds2-w-14 pds2-h-14 pds2-accent-primary-brand",onKeyDown:gt=>gt.key==="Enter"&&Ot()}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-row pds2-items-center pds2-gap-x-8 pds2-flex-1",children:[jsxRuntimeExports.jsx("div",{className:"TitlesSubheadline pds2-text-content-primary",children:jt.fln}),jsxRuntimeExports.jsx("span",{className:"pds2-ml-auto pds2-text-primary-brand pds2-text-14 pds2-font-600",children:"Link"})]})]},jt.oid)})}),jsxRuntimeExports.jsx(TextSeparator,{title:"or"}),jsxRuntimeExports.jsx(Pds2CustomButton,{title:"Create new Family Member",bgColor:"pds2-bg-primary-brand/20",prefixIcon:jsxRuntimeExports.jsx(l$7,{}),className:"pds2-justify-center pds2-border pds2-border-surface-muted pds2-text-primary-brand Body1Semibold",onClick:kt})]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-sticky pds2-border pds2-border-surface-muted pds2-bottom-0 pds2-left-0 pds2-right-0 pds2-bg-surface-base pds2-shadow-lg pds2-p-16",children:[pt&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error pds2-text-center pds2-mb-8",children:pt}),jsxRuntimeExports.jsx(Pds2Button,{title:"Continue",state:_e===null||nt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:nt===LOADING_STATE.LOADING,className:"pds2-w-full",onClick:Ot})]})]}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Dt}),jsxRuntimeExports.jsx(ExitPopup,{open:ot,setOpen:it})]})},AuthLoginCard=({icon:a,text:o,otpReq:_,isSelected:b,onClick:$})=>jsxRuntimeExports.jsx("div",{className:"pds2-group pds2-cursor-pointer hover:pds2-text-content-enabled pds2-flex-1",onClick:$,children:jsxRuntimeExports.jsxs("div",{className:"pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:` ${_?"":"pds2-hidden"} pds2-text-content-primary Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-semantic-warning pds2-mx-auto pds2-border pds2-border-surface-neutral pds2-border-b-none pds2-rounded-t-6`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center",children:[jsxRuntimeExports.jsx(n$6,{className:"pds2-w-10"}),"Fastest. No OTP"]})}),jsxRuntimeExports.jsxs("div",{className:`pds2-border pds2-pt-8 pds2-px-8 pds2-rounded-8 pds2-bg-surface-base
|
|
63
63
|
${b?"pds2-border-primary-brand":"pds2-border-surface-muted group-hover:pds2-border-primary-brand"}`,children:[jsxRuntimeExports.jsx("div",{className:"pds2-p-6 pds2-bg-surface-muted pds2-rounded-8 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("div",{className:`pds2-w-25 pds2-h-25 pds2-overflow-hidden pds2-flex pds2-items-center pds2-justify-center group-hover:pds2-text-primary-brand
|
|
64
64
|
${b?"pds2-text-primary-brand":""} `,children:a})}),jsxRuntimeExports.jsx("div",{className:`Body3Medium pds2-py-6 group-hover:pds2-text-primary-brand
|
|
65
|
-
${b?"pds2-text-primary-brand":""}`,children:o})]})]})}),LoginorCreateAbhaScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId),[o,_]=reactExports.useState(!1);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,st;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((st=window==null?void 0:window.EkaAbha)==null||st.changeStatusBarColor("#FFFFFF"))}},[]);const b=()=>{var _e;o?_(!1):((_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount())},$=["eka-web","phr","www-eka"];return jsxRuntimeExports.jsxs("div",{className:`pds2-h-full ${o?"pds2-overflow-y-hidden ":"pds2-overflow-y-auto"}`,children:[jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:!o&&jsxRuntimeExports.jsx("button",{onClick:b,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-surface-subtle",showHeaderStrip:!$.includes(a)}),jsxRuntimeExports.jsx(LoginOrCreateWithDifferentMethods,{tryFaceAuthScreen:o,setTryFaceAuthScreen:_})]})},LoginOrCreateWithDifferentMethods=({tryFaceAuthScreen:a,setTryFaceAuthScreen:o})=>{const _=useAuthAbhaStore(Kt=>Kt.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.MOBILE),b=useAuthAbhaStore(Kt=>Kt.setAbhaAuthFlowMethod),$=useAuthAbhaStore(Kt=>Kt.goBackToLogin);useAuthAbhaStore(Kt=>Kt.isEkaDocWebRequest);const _e=useAuthAbhaStore(Kt=>Kt.isSkipABHAEnable),et=useAuthAbhaStore(Kt=>Kt.setGoBackToLogin),st=useAuthAbhaStore(Kt=>Kt.setIdentifierValue),tt=useAuthAbhaStore(Kt=>Kt.identifierValue),nt=useAuthAbhaStore(Kt=>Kt.isEkaAppLogin),rt=useAuthAbhaStore(Kt=>Kt.setSelectedAbhaAddress),ot=useAuthAbhaStore(Kt=>Kt.setLoginIdentifierValue),it=useAuthAbhaStore(Kt=>Kt.setRegistrationType),pt=useAuthAbhaStore(Kt=>Kt.setAadhaarInitResponse),ut=useAuthAbhaStore(Kt=>Kt.setAadhaarFaceAuthInitResponse),ht=useAuthAbhaStore(Kt=>Kt.setMobileInitResponse),yt=useAuthAbhaStore(Kt=>Kt.initAbhaAppMobileNumber),lt=useAuthAbhaStore(Kt=>Kt.initAbhaAppIdentifierType),ct=useAuthAbhaStore(Kt=>Kt.initAbhaAppIdentifier),at=useAuthAbhaStore(Kt=>Kt.setInitAbhaAppIdentifier),dt=useAuthAbhaStore(Kt=>Kt.setInitAbhaAppIdentifierType),_t=useAuthAbhaStore(Kt=>Kt.isDocAppRequest),xt=useAuthAbhaStore(Kt=>Kt.faceAuthEnable),vt=useAuthAbhaStore(Kt=>Kt.setIsNewLoginOrCreateFlow),bt=useAuthAbhaStore(Kt=>Kt.clientId),kt=useAuthAbhaStore(Kt=>Kt.isInitApiTriggered),Tt=useAuthAbhaStore(Kt=>Kt.setIsInitApiTriggered),Ot=useAuthAbhaStore(Kt=>Kt.setIdentityValue);useAuthAbhaStore(Kt=>Kt.identityValue);const Dt=useAuthAbhaStore(Kt=>Kt.setSelectedAbhaFlow),Mt=useAuthAbhaStore(Kt=>Kt.initAbhaFlow),jt=useAuthAbhaStore(Kt=>Kt.selectedAadhaarAuth),It=useAuthAbhaStore(Kt=>Kt.setSelectedAadhaarAuth),gt=useAuthAbhaStore(Kt=>Kt.orgIconUrl),At=useAuthAbhaStore(Kt=>Kt.initAbhaAppMethod),[mt,ft]=reactExports.useState(LOADING_STATE.IDLE),[Ct,Rt]=reactExports.useState(""),Bt=useAuthAbhaStore(Kt=>Kt.setScreen),[Lt,St]=reactExports.useState({aadhaar:LOADING_STATE.IDLE,mobile:LOADING_STATE.IDLE}),[Ft,Pt]=reactExports.useState($?tt==null?void 0:tt.mobile:""),[Et,Gt]=reactExports.useState(!1),[Yt,Ht]=reactExports.useState(!1),[qt,$t]=reactExports.useState(tt.aadhaar_number||""),[Wt,zt]=reactExports.useState(tt.abha_number||""),[Ut,os]=reactExports.useState(""),[ds,es]=reactExports.useState(tt.phr_address||""),us=reactExports.useRef(!1),ss=GET_EXTRA_HEADERS(),Qt=(ss==null?void 0:ss["X-User-ID"])??void 0;reactExports.useEffect(()=>{Xt({name:"abha_login_or_create_screen",data:{flow:Mt}}),handleReadOTP()},[]);const wt=()=>{onSkipAbha({identifier:(tt==null?void 0:tt.mobile)||(tt==null?void 0:tt.aadhaar_number)||(tt==null?void 0:tt.abha_number)||(tt==null?void 0:tt.phr_address)||"",identifier_type:tt!=null&&tt.mobile?"mobile":"aadhaar_number"}),Xt({name:"skip_abha_clicked",data:{flow:Mt,platform:bt}}),unMount()},Nt=async Kt=>{var _s;try{ft(LOADING_STATE.LOADING);const ls=await postAbdmProfileSearch({mobile:Kt});if(((_s=ls==null?void 0:ls.profiles)==null?void 0:_s.length)>0&&ct)Pt(ct);else{ft(LOADING_STATE.REJECTED),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),Rt(`KYC ABHA not found for ${ct}. Please register with Aadhaar.`);return}}catch(ls){console.error("Error searching ABDM profile:",ls),ft(LOADING_STATE.REJECTED),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}};reactExports.useEffect(()=>{ct&<===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(os(ct),es(ct.split("@")[0]),st({phr_address:ct.split("@")[0]}),xr(!0),Rr(!0),b(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS)):ct&<===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?(st({abha_number:ct}),zt(ct),xr(!0),Tr(!0),b(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):ct&<===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?($t(ct),Ht(!0),st({aadhaar_number:ct}),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)):ct&<===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$&&(b(ABHA_AUTH_FLOW_METHOD.MOBILE),Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION?Pt(ct):Nt(ct),Gt(ct.length===10),st({mobile:ct}),Rt(null))},[lt,ct]),reactExports.useEffect(()=>{kt||us.current||(Ft&&Ft.length===10&&_==ABHA_AUTH_FLOW_METHOD.MOBILE&&!_e?(gs("auto_submit_mobile"),Tt(!0),us.current=!0):Ft&&Ft.length===10&&_==ABHA_AUTH_FLOW_METHOD.MOBILE&&_e&<===ABHA_AUTH_FLOW_METHOD.MOBILE&&ft(LOADING_STATE.REJECTED))},[Ft]),reactExports.useEffect(()=>{kt||us.current||qt&&qt.length===12&&_==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!xt&&(Tt(!0),us.current=!0,gs("auto_submit_aadhaar"))},[qt]),reactExports.useEffect(()=>{st({aadhaar_number:qt})},[qt]),reactExports.useEffect(()=>{kt||us.current||Wt&&Wt.length===17&&_==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(Tt(!0),us.current=!0,gs("auto_submit_abha"))},[Wt]),reactExports.useEffect(()=>{kt||us.current||Ut&&Ut.includes("@abdm")&&_==ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&(Tt(!0),us.current=!0,gs("auto_submit_phr"))},[Ut]);const Xt=useTrackAbhaEvent(),ts=React.useMemo(()=>{switch(_){case ABHA_AUTH_FLOW_METHOD.MOBILE:return"Enter your Mobile Number";case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return"Enter your Aadhaar Number";default:return""}},[_]),rs=Kt=>{dt(""),Rt("");const _s=Kt.target.value;switch(_){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:if(_s.length>20)return;es(_s),st({phr_address:_s}),at(null);break;case ABHA_AUTH_FLOW_METHOD.MOBILE:const ls=_s.replace(/\D/g,"").slice(-10);Pt(ls),Gt(!0),st({mobile:ls}),at(null);break;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:if(!/^[\d-]*$/.test(_s)||_s.length>17)return;const Ts=Kt.target.value.replace(/-/g,"");let js="";return Ts.length>0&&(js+=Ts.slice(0,2)),Ts.length>2&&(js+=`-${Ts.slice(2,6)}`),Ts.length>6&&(js+=`-${Ts.slice(6,10)}`),Ts.length>10&&(js+=`-${Ts.slice(10,14)}`),zt(js),at(null),st({abha_number:js.trim()});case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:if(_s&&!/^[0-9]+$/.test(_s)||_s.length>12)return;$t(_s),Ht(!0),at(null),st({aadhaar_number:_s});break}};ABHA_AUTH_FLOW_METHOD.MOBILE;const xs=React.useMemo(()=>{switch(_){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:return tt.phr_address.length>=4&&tt.phr_address.length<=20;case ABHA_AUTH_FLOW_METHOD.MOBILE:return lt==="mobile"?(ct==null?void 0:ct.length)===10:Ft.length===10;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return tt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return tt.aadhaar_number.length===12&&jt!=AADHAAR_AUTH_STATES.NONE}},[_,tt,jt]),fs=(Kt,_s)=>{St(ls=>({...ls,[Kt]:_s}))},Ds=({inputVal:Kt})=>{Kt.length===12&&(st({aadhaar_number:Kt}),$t(Kt),Ht(!0))};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",_)},[_]);const gs=async(Kt,_s)=>{var Gr,$r,Ur,zr;vt(!0),Xt({name:"abha_login_next_click",data:{flow:Mt,flow_step_type:Kt}}),ft(LOADING_STATE.LOADING),it(REGISTRATION_TYPE.LOGIN);let ls="";if(!nt){const Ss=await postAuthLogoutV2();Xt({name:Ss?"abha_logout_success":"abha_logout_failure",data:{flow:Mt,platform:bt}});const{txn_id:vs,error:ms}=await postAuthInitV2({method:AUTH_METHOD.ABHA});if(!vs||ms){Xt({name:"abha_auth_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:ms||"missing_txnId_or_unknown_error",error_message_exists:!!ms,txn_id_exists:!!vs}}),Rt((ms==null?void 0:ms.message)||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}ls=vs,Xt({name:"abha_auth_init_success.",data:{flow:Mt,flow_step_type:"init",auth_txnId:ls}})}const Ts=_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?`${tt.phr_address}@abdm`:_===ABHA_AUTH_FLOW_METHOD.MOBILE?tt==null?void 0:tt.mobile:_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?tt.abha_number:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?tt.aadhaar_number:"";if(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER||_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS){const{txn_id:Ss,error:vs,action:ms,hint:bs}=await postAbdmLoginInit({method:_,identifier:Ts});if(Tt(!0),Ot(Ts),Xt({name:"abha_login_init_triggered",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,method:_}}),_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&rt(Ts),vs||!Ss){if(et(!0),((Gr=ms==null?void 0:ms.cta)==null?void 0:Gr.pid)==="abha_mobile_enroll"&&_===ABHA_AUTH_FLOW_METHOD.MOBILE){fs("mobile",LOADING_STATE.LOADING),it(REGISTRATION_TYPE.CREATE);const{txn_id:Ls,hint:Wr,error:vr,action:Ar}=await postRegisterMobileInit({mobile_number:tt==null?void 0:tt.mobile});if(Tt(!0),Ot(tt==null?void 0:tt.mobile),Dt("mobile"),Ls&&Wr){ht({authTxnId:ls,txnId:Ls,mobileOtpSentToHint:Wr}),Xt({name:"abha_mobile_registration_init_success",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,error_message:vr,error_action:ms}}),fs("mobile",LOADING_STATE.RESOLVED),ft(LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),Bt(SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION);return}if(fs("mobile",LOADING_STATE.REJECTED),Xt({name:"abha_mobile_registration_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:vr||"unknown_error",error_message_exists:!!vr,error_action_exists:!!Ar}}),Ar){if(($r=Ar==null?void 0:Ar.cta)!=null&&$r.pid)return Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}else Rt(vr||"Something went wrong");Rt(vr||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}Xt({name:"abha_login_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:vs||"unknown_error",error_message_exists:!!vs,error_action_exists:!!ms}}),Rt(vs||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}Xt({name:"abha_login_init_success",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,hint:bs}}),pt({authTxnId:ls,txnId:Ss,aadhaarOtpSentToHint:bs||null}),et(!1),ot(Ts),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA);return}const js=_s??jt;if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.OTP){fs("aadhaar",LOADING_STATE.LOADING),Xt({name:"aadhaar_registration_init_start",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,aadhaarNumber:tt.aadhaar_number}});const{txn_id:Ss,hint:vs,error:ms,action:bs}=await postRegisterAadhaarInit({aadhaar_number:tt.aadhaar_number});if(Ot(tt.aadhaar_number),Dt("aadhaar"),Ss&&vs){pt({authTxnId:ls,txnId:Ss,aadhaarOtpSentToHint:vs}),Xt({name:"aadhaar_registration_init_success",data:{flow:Mt,flow_step_type:"verify",ndhmTxnId:Ss,authTxnId:ls}}),et(!1),fs("aadhaar",LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(Xt({name:"abha_registration_init_failure",data:{flow:Mt,error_message:ms||"unknown_error",error_message_exists:!!ms,auth_txn_id:ls,error_action:bs,error_action_exists:!!bs}}),fs("aadhaar",LOADING_STATE.REJECTED),ft(LOADING_STATE.REJECTED),bs||ms){et(!0),(Ur=bs==null?void 0:bs.cta)!=null&&Ur.pid?Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):Rt(ms||"Something went wrong");return}}if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.FACE_AUTH){fs("aadhaar",LOADING_STATE.LOADING),Xt({name:"aadhaar_registration_faceauth_init_start",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,aadhaarNumber:tt.aadhaar_number}});const{url:Ss,txn_id:vs,hint:ms,error:bs,action:Ls}=await postRegisterAadhaarFaceAuthInit();if(Ot(tt.aadhaar_number),Dt("aadhaar"),vs&&ms&&Ss){ut({authTxnId:ls,txnId:vs,aadhaarFaceAuthOtpSentToHint:ms,faceAuthQrUrl:Ss}),Xt({name:"aadhaar_registration_faceauth_init_success",data:{flow:Mt,flow_step_type:"verify",ndhmTxnId:vs,authTxnId:ls}}),et(!1),fs("aadhaar",LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.ABHA_AUTH_QR_SCREEN);return}if(Xt({name:"abha_registration_faceauth_init_failure",data:{flow:Mt,error_message:bs||"unknown_error",error_message_exists:!!bs,auth_txn_id:ls,error_action:Ls,error_action_exists:!!Ls}}),fs("aadhaar",LOADING_STATE.REJECTED),ft(LOADING_STATE.REJECTED),Ls||bs){et(!0),(zr=Ls==null?void 0:Ls.cta)!=null&&zr.pid?Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):Rt(bs||"Something went wrong");return}}if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.FINGERPRINT){ut({authTxnId:ls,txnId:null,aadhaarFaceAuthOtpSentToHint:null,faceAuthQrUrl:null}),Ot(tt.aadhaar_number),Dt("aadhaar"),it(REGISTRATION_TYPE.CREATE),et(!1),Bt(SCREEN_NAMES.AADHAAR_FINGERPRINT_SCREEN);return}},[Ir,xr]=reactExports.useState(!1),[an,Tr]=reactExports.useState($&&_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),[on,Rr]=reactExports.useState($&&_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),[ln,Cr]=reactExports.useState(!1);return jsxRuntimeExports.jsxs("div",{className:`pds2-w-full pds2-h-full ${a?"pds2-relative":""}`,children:[jsxRuntimeExports.jsxs("div",{className:`pds2-p-16 pds2-bg-surface-subtle pds2-space-y-16 pds2-text-center pds2-rounded-b-24 ${_t?"pds2-pt-0 -pds2-mt-20":"pds2-pt-22"}`,children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION)&&At!="login_abha_with_mobile"?jsxRuntimeExports.jsx(AbhaStepper,{}):jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-surface-subtle"}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsxs("div",{className:`pds2-rounded-16 ${gt?"pds2-flex pds2-gap-10":""}`,children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64 pds2-bg-surface-base pds2-rounded-16"}),gt&&jsxRuntimeExports.jsx("img",{src:gt,alt:"org-icon",className:"pds2-w-64 pds2-h-64 pds2-rounded-16"})]})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-content-primary",children:At==="login_abha_with_mobile"?"Login using ABHA":bt==="phr"?"Login or Create your ABHA":_t?"Add Patient via ABHA":"Create your ABHA"}),At!="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-text-content-secondary",style:{marginTop:"4px"},children:_===ABHA_AUTH_FLOW_METHOD.MOBILE?_t?"Enter Patient's Mobile Number":"Enter your Mobile Number":_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?_t?"Enter Patient's Aadhaar Number":"Enter your Aadhaar Number":_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?_t?"Enter Patient's ABHA Number":"Enter your ABHA Number":_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?_t?"Enter Patient's ABHA Address":"Enter your ABHA Address":ts}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsxs("div",{className:"pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-1/2 pds2-relative",children:jsxRuntimeExports.jsx("div",{className:"Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-surface-success pds2-text-content-success pds2-mx-auto pds2-border pds2-border-surface-neutral pds2-border-b-none pds2-rounded-t-6",children:"Recommended"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-surface-muted pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-surface-base pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),Rt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{b(ABHA_AUTH_FLOW_METHOD.MOBILE),Rt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-w-14 pds2-h-14 pds2-text-semantic-success"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${_===ABHA_AUTH_FLOW_METHOD.MOBILE?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:_===ABHA_AUTH_FLOW_METHOD.MOBILE?{fontWeight:700}:{fontWeight:400},children:"Mobile"})]})]})]}),At==="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-text-content-secondary",children:"Enabling ABHA for lifelong health records"}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative",children:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaInputComponent,{initialValues:lt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(ct==null?void 0:ct.match(/.{1,4}/g))??void 0:(qt==null?void 0:qt.match(/.{1,4}/g))??void 0,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!ct,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:Ds,setIsValid:Ht,setValue:$t,setError:Rt,isOtpInput:!1}),xt&&jsxRuntimeExports.jsxs("div",{className:"pds2-mt-20",children:[jsxRuntimeExports.jsx("hr",{className:"pds2-text-content-muted pds2-border-t-2 pds2-border-surface-strong pds2-w-4/5 pds2-mx-auto"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-py-12 pds2-text-content-secondary ",children:"Authenticate using"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-8 pds2-w-11/12 pds2-mx-auto pds2-items-end",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(t$5,{className:"pds2-w-full pds2-h-full"}),text:"OTP",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.OTP,onClick:()=>It(AADHAAR_AUTH_STATES.OTP)}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-2/3",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-text-content-primary Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-semantic-warning pds2-mx-auto pds2-border pds2-border-surface-neutral pds2-border-b-none pds2-rounded-t-6 pds2-flex",children:[jsxRuntimeExports.jsx(n$6,{className:"pds2-w-10"}),"Fastest. No OTP"]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-8",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(l$3,{className:"pds2-w-full pds2-h-full"}),text:"Face Auth",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.FACE_AUTH,onClick:()=>It(AADHAAR_AUTH_STATES.FACE_AUTH)}),jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(t$3,{className:"pds2-w-full pds2-h-full"}),text:"Biometric",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.FINGERPRINT,onClick:()=>It(AADHAAR_AUTH_STATES.FINGERPRINT)})]})]})]})]})]}):jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$?ct||"":Ft,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.MOBILE||!!ct&&!!Qt,onChange:rs,type:"tel",name:"phone",autoComplete:"tel",inputMode:"numeric",pattern:"[0-9]*",placeholder:"Mobile Number",autoFocus:!0,PrefixComponent:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-x-8 pds2-border-r pds2-border-surface-muted pds2-pr-24",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4mlct2900000tg98p8u967s.webp",alt:"indian-flag-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:"pds2-text-content-primary pds2-text-sm",children:"+91"})]})})}),Ct&&(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:`${Ct.includes("KYC ABHA not found for")?"pds2-text-content-primary":"pds2-text-semantic-error"} Body3Regular`,children:Ct}),jsxRuntimeExports.jsxs("div",{className:"BodyFootnote pds2-text-content-secondary",children:["By proceeding, you agree to"," ",jsxRuntimeExports.jsx("span",{className:"pds2-underline pds2-cursor-pointer",onClick:()=>Cr(!0),children:"T&C"})]}),(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER||_===ABHA_AUTH_FLOW_METHOD.MOBILE&&!_e)&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!xs||mt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:mt===LOADING_STATE.LOADING,onClick:()=>{gs("aadhaar_or_mobile_on_click")},className:"pds2-w-full"}),_===ABHA_AUTH_FLOW_METHOD.MOBILE&&_e&&xt&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!xs||mt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:mt===LOADING_STATE.LOADING,onClick:()=>gs("aadhaar_or_mobile_on_click"),className:"pds2-w-full"}),At==="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"BodyFootnote pds2-text-content-secondary",children:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"You will receive OTP from Aadhaar":"You will receive OTP from NHA "})]}),At!="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-pb-10",children:jsxRuntimeExports.jsxs("div",{className:"pds2-m-16 pds2-mb-32 pds2-bg-surface-base pds2-rounded-16 pds2-border pds2-border-surface-muted pds2-overflow-hidden",children:[jsxRuntimeExports.jsxs("button",{onClick:()=>xr(!Ir),className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-16 pds2-bg-surface-base hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsx("span",{className:"pds2-text-content-secondary",children:_t?"Other add options for ABHA":"Other login options for ABHA"}),jsxRuntimeExports.jsx(c$3,{className:`pds2-w-16 pds2-h-16 pds2-text-content-secondary pds2-transition-transform ${Ir?"pds2-rotate-180":""}`})]}),jsxRuntimeExports.jsxs("div",{className:`pds2-overflow-hidden pds2-transition-all pds2-duration-300 ${Ir?"pds2-max-h-126 pds2-opacity-100":"pds2-max-h-0 pds2-opacity-0"}`,children:[jsxRuntimeExports.jsxs("button",{onClick:()=>{xr(!1),b(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),Tr(!0),Rt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-surface-muted pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-content-primary",children:_t?"Add patient with ABHA Number":"Login with ABHA Number"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-content-secondary"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{xr(!1),b(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),Rr(!0),Rt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-surface-muted pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"ABHA",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-content-primary",children:_t?"Add patient with ABHA Address":"Login with ABHA Address"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-content-secondary"})]})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:an,setIsOpen:Tr,setFlowMethod:b,setError:Rt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE_KIOSK)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Rt(null),Tr(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-surface-subtle pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-content-primary",children:_t?"Add Patient with ABHA Number":"Login with ABHA Number"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-content-secondary pds2-mb-24",children:_t?"Enter Patient's 14 digit ABHA Number":"Enter your 14 digit ABHA Number"}),jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?ct||"":Wt,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!ct,onChange:rs,placeholder:"00-0000-0000-0000",padding:"pds2-p-18",textStyle:"Body2Regular pds2-text-center pds2-text-lg",borderStyle:"focus-within:pds2-border-primary-brand",type:"tel",inputMode:"numeric",autoFocus:!0,onKeyDown:Kt=>{Kt.key==="Enter"&&gs("after_enter_abha_number_on_click_by_user")}}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error Body3Regular pds2-mt-12",children:Ct}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||mt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>gs("after_enter_abha_number_on_click_by_user"),className:`pds2-w-full ${Ct?"pds2-mt-12":"pds2-mt-24"}`,isLoading:mt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:on,setIsOpen:Rr,setFlowMethod:b,setError:Rt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE_KIOSK)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Rt(null),Rr(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-surface-subtle pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-content-primary",children:_t?"Add Patient with ABHA Address":"Login with ABHA Address"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-content-secondary pds2-mb-24",children:_t?"Enter Patient's ABHA Address below":"Enter your ABHA Address below"}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative",children:[jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(ct==null?void 0:ct.split("@")[0])||"":ds,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!!ct,onChange:rs,placeholder:"Enter ABHA Address",inputMode:"text",autoFocus:!0,onKeyDown:Kt=>{Kt.key==="Enter"&&gs("after_enter_abha_address_on_click_by_user")}}),jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-right-16 pds2-top-16 Body1Regular pds2-text-content-secondary",children:"@abdm"})]}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error Body3Regular pds2-mt-12",children:Ct}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||mt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>gs("after_enter_abha_address_on_click_by_user"),className:`pds2-w-full ${Ct?"pds2-mt-12":"pds2-mt-24"}`,isLoading:mt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:ln,setIsOpen:Cr,setFlowMethod:b,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-h-10 pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Cr(!1)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-h-4/5 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-h-30 TitlesSubheadline pds2-pb-10",children:"Terms and Conditions"}),jsxRuntimeExports.jsxs("div",{className:"pds2-h-4/5 pds2-text-justify pds2-px-10 pds2-overflow-auto",children:["I, hereby declare that I am voluntarily sharing my Aadhaar number and demographic information issued by UIDAI, with National Health Authority (NHA) for the sole purpose of creation of ABHA number. ",jsxRuntimeExports.jsx("br",{})," ",jsxRuntimeExports.jsx("br",{}),'I understand that my ABHA number can be used and shared for purposes as may be notified by ABDM from time to time including provision of healthcare services. Further, I am aware that my personal identifiable information (Name, Address, Age, Date of Birth, Gender and Photograph) may be made available to the entities working in the National Digital Health Ecosystem (NDHE) which inter alia includes stakeholders and entities such as healthcare professionals (e.g. doctors), facilities (e.g. hospitals, laboratories) and data fiduciaries (e.g. health programmes), which are registered with or linked to the Ayushman Bharat Digital Mission (ABDM), and various processes there under. I authorize NHA to use my Aadhaar number for performing Aadhaar based authentication with UIDAI as per the provisions of the Aadhaar (Targeted Delivery of Financial and other Subsidies, Benefits and Services) Act, 2016 for the aforesaid purpose. I understand that UIDAI will share my e-KYC details, or response of "Yes" with NHA upon successful authentication. I have been duly informed about the option of using other IDs apart from Aadhaar; however, I consciously choose to use Aadhaar number for the purpose of availing benefits across the NDHE. I am aware that my personal identifiable information excluding Aadhaar number / VID number can be used and shared for purposes as mentioned above. I reserve the right to revoke the given consent at any point of time as per provisions of Aadhaar Act and Regulations.']}),jsxRuntimeExports.jsx(Pds2Button,{title:"I Agree",state:"enabled",onClick:()=>Cr(!1),className:"pds2-w-full pds2-mt-20"})]})]})}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&xt&&_e&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-text-primary-brand",children:jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-15 pds2-right-14 pds2-z-50 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("button",{onClick:wt,className:"pds2-bg-surface-base pds2-w-full pds2-py-4 pds2-px-15 pds2-rounded-12 Body2Regular pds2-text-primary-brand hover:pds2-bg-primary-brand/20 pds2-border pds2-border-surface-muted",children:"Skip ABHA"})})}),a&&jsxRuntimeExports.jsx("div",{className:"pds2-w-full pds2-h-full pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-flex-col pds2-bg-surface-base",children:jsxRuntimeExports.jsxs("div",{className:"pds2-px-16 pds2-pb-16 pds2-pt-150 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-surface-subtle",children:[jsxRuntimeExports.jsx("div",{className:"Title2Bold pds2-text-center pds2-w-full pds2-mx-auto pds2-text-content-primary",children:"Hasslefree patient addition"}),jsxRuntimeExports.jsxs("div",{className:"Title3Regular pds2-text-center pds2-w-full pds2-mx-auto pds2-text-content-primary",children:[jsxRuntimeExports.jsx("div",{children:"With Digital Health Incentive"})," Scheme, earn by linking records"," ",jsxRuntimeExports.jsx("div",{children:"to ABHA."})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-gap-20 pds2-w-full pds2-pt-20",children:[jsxRuntimeExports.jsx(Pds2Button,{title:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center",children:[jsxRuntimeExports.jsx(n$6,{className:"pds2-w-30 pds2-text-semantic-warning"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center",children:[jsxRuntimeExports.jsx("div",{children:"Try Face Auth"}),jsxRuntimeExports.jsx("div",{className:"Body4Regular",children:"Fastest. No OTP"})]})]}),buttonColor:"",className:"pds2-w-full",padding:"pds2-p-9",onClick:()=>{Xt({name:"abha_try_face_auth_clicked",data:{flow:Mt,platform:bt}}),It(AADHAAR_AUTH_STATES.FACE_AUTH),gs("aadhaar_or_mobile_on_click",AADHAAR_AUTH_STATES.FACE_AUTH)}}),jsxRuntimeExports.jsx(Pds2Button,{textColor:"pds2-text-primary-brand",title:"Proceed with Aadhaar OTP",buttonColor:"pds2-bg-surface-base",className:"pds2-w-full pds2-border pds2-border-surface-muted",onClick:()=>{Xt({name:"abha_proceed_with_aadhaar_otp_clicked",data:{flow:Mt,platform:bt}}),It(AADHAAR_AUTH_STATES.OTP),gs("aadhaar_or_mobile_on_click",AADHAAR_AUTH_STATES.OTP)}})]}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error pds2-text-center Body3Regular pds2-mt-12",children:Ct})]})})]})},AbhaBottomSheet$1=({isOpen:a,setIsOpen:o,children:_,setFlowMethod:b,overlayClassName:$="pds2-bg-content-primary pds2-bg-opacity-50",setError:_e})=>{const[et,st]=reactExports.useState(a),tt=useAuthAbhaStore(rt=>rt.initAbhaFlow),nt=GET_CLIENT_ID();return reactExports.useEffect(()=>{if(a)st(!0);else{const rt=setTimeout(()=>st(!1),300);return()=>clearTimeout(rt)}},[a]),et?jsxRuntimeExports.jsxs("div",{className:`pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-items-end pds2-transition-all pds2-duration-300 ${a?"pds2-opacity-100":"pds2-opacity-0 pointer-events-none"}`,children:[jsxRuntimeExports.jsx("div",{className:`pds2-absolute pds2-inset-0 ${$} pds2-transition-opacity pds2-duration-300 ${nt==="ext"?"pds2-bg-surface-subtle":"pds2-bg-surface-neutral"}`,onClick:rt=>{if(tt!=ABHA_INIT_FLOW.ABHA_REGISTRATION){rt.stopPropagation();return}_e==null||_e(null),o(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}}),jsxRuntimeExports.jsx("div",{className:`pds2-relative ${nt==="ext"?"pds2-bg-surface-subtle":"pds2-bg-surface-base"} pds2-rounded-t-24 pds2-w-full pds2-transition-transform pds2-duration-300 ${a?"pds2-translate-y-0":"pds2-translate-y-full"}`,style:{height:"75%",maxHeight:"600px",overflowY:"auto"},children:_})]}):null},formatDateTime=(a,o={date:!0,time:!0})=>{const _=new Date(a);let b="",$="";return o.time&&(b=_.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0})),o.date&&($=_.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"})),o.time&&o.date?`${b}, ${$}`:o.time?b:o.date?$:""};function ConsentCard(){var o,_,b,$,_e,et,st,tt,nt;const a=useAuthAbhaStore(rt=>rt.consentDetails);return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Semibold pds2-text-content-primary pds2-flex-1",children:[(o=a==null?void 0:a.hiu)==null?void 0:o.name,jsxRuntimeExports.jsx("div",{className:"Body2Regular",children:(_=a==null?void 0:a.hiu)==null?void 0:_.id})]}),(a==null?void 0:a.status)==ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-primary-brand pds2-bg-primary-brand/20 pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$c,{}),"Pending"]}),(a==null?void 0:a.status)==ConsentStatus.GRANTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-semantic-success pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Granted"]}),(a==null?void 0:a.status)==ConsentStatus.EXPIRED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-secondary pds2-bg-surface-subtle pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Expired"]}),(a==null?void 0:a.status)==ConsentStatus.DENIED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-surface-danger pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Denied"]}),(a==null?void 0:a.status)==ConsentStatus.REVOKED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-surface-danger pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Revoked"]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Type of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:"consent"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Purpose of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:(b=a==null?void 0:a.purpose)==null?void 0:b.text})]}),(($=a==null?void 0:a.duration)==null?void 0:$.from)&&((_e=a==null?void 0:a.duration)==null?void 0:_e.to)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Duration"}),jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-content-secondary",children:[formatDateTime((et=a==null?void 0:a.duration)==null?void 0:et.from,{date:!0,time:!1})," - ",formatDateTime((st=a==null?void 0:a.duration)==null?void 0:st.to,{date:!0,time:!1})]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Requested by"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-secondary",children:((tt=a==null?void 0:a.requester)==null?void 0:tt.name)||((nt=a==null?void 0:a.hiu)==null?void 0:nt.name)})]}),(a==null?void 0:a.created_at)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Requested at"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-secondary",children:formatDateTime(a==null?void 0:a.created_at,{date:!0,time:!0})})]})]})]})}const ConsentHiTypeListCard=()=>{var _e;const a=useAuthAbhaStore(et=>et.consentDetails),o=useAuthAbhaStore(et=>et.consentApiBody),_=useAuthAbhaStore(et=>et.setConsentApiBody),b=(o==null?void 0:o.hi_types)??[],$=et=>{const st=et.target.id,nt=et.target.checked?[...b,st]:b.filter(rt=>rt!==st);_({hi_types:nt})};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col ",children:(_e=a==null?void 0:a.hi_types)==null?void 0:_e.map((et,st)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-16 pds2-py-16 ${st<a.hi_types.length-1?"pds2-border-b pds2-border-surface-muted":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[(a==null?void 0:a.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsx("input",{id:et.id,type:"checkbox",checked:b.includes(et.id),className:"pds2-accent-primary-brand",onChange:$}),jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:et.display})]})},et==null?void 0:et.id))})})},formatDateToBackendISO=a=>{const o=new Date;return new Date(`${a}T${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`).toISOString()},ConsentDurationCard=()=>{var st,tt,nt,rt;const a=reactExports.useRef(null),o=reactExports.useRef(null),_=useAuthAbhaStore(ot=>ot.consentApiBody),b=useAuthAbhaStore(ot=>ot.setConsentApiBody),$=useAuthAbhaStore(ot=>ot.consentDetails),_e=new Date,et=(ot,it)=>{const pt=formatDateToBackendISO(it);b({duration:{..._==null?void 0:_.duration,[ot]:pt}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-py-6 pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:[jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary",children:jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-surface-muted`,children:[jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["From",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:((st=_==null?void 0:_.duration)==null?void 0:st.from)&&formatDateTime((tt=_==null?void 0:_.duration)==null?void 0:tt.from,{date:!0,time:!1})})]}),($==null?void 0:$.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n,{className:"pds2-text-primary-brand pds2-text-16",onClick:()=>{var ot;return(ot=a.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:a,type:"date",max:_e.toISOString().split("T")[0],onChange:ot=>et("from",ot.target.value)})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary",children:jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-surface-muted`,children:[jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["To",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:((nt=_==null?void 0:_.duration)==null?void 0:nt.to)&&formatDateTime((rt=_==null?void 0:_.duration)==null?void 0:rt.to,{date:!0,time:!1})})]}),($==null?void 0:$.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n,{className:"pds2-text-primary-brand pds2-text-16",onClick:()=>{var ot;return(ot=o.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:o,type:"date",max:_e.toISOString().split("T")[0],onChange:ot=>et("to",ot.target.value)})]})]})}),jsxRuntimeExports.jsxs("div",{className:`pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary ${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["Expires on",(_==null?void 0:_.erase_at)&&jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:formatDateTime(_==null?void 0:_.erase_at,{date:!0,time:!0})})]})]})},ConsentHCPCard=()=>{var yt,lt,ct;const a=useAuthAbhaStore(at=>at.consentDetails),o=(yt=a==null?void 0:a.providers)==null?void 0:yt.reduce((at,dt)=>(at[dt.hip.id]=dt.care_contexts,at),{}),_=useAuthAbhaStore(at=>at.setConsentApiBody),[b,$]=reactExports.useState(o||{}),[_e,et]=reactExports.useState([]),st=()=>{var at;return(at=Object==null?void 0:Object.entries(b??{}))==null?void 0:at.map(([dt,_t])=>({hip_id:dt,care_contexts:_t}))};reactExports.useEffect(()=>{const at=st();_({consent_artefacts:at})},[b]);const tt=at=>{et(dt=>dt.includes(at)?dt.filter(_t=>_t!==at):[...dt,at])},nt=at=>_e.includes(at),rt=(lt=a==null?void 0:a.providers)==null?void 0:lt.every(at=>b[at.hip.id].length===at.care_contexts.length&&at.care_contexts.length>0),ot=at=>{var dt;return((dt=b[at.hip.id])==null?void 0:dt.length)===at.care_contexts.length},it=(at,dt)=>{var _t;return(_t=b[at])==null?void 0:_t.some(xt=>xt.id===dt)},pt=at=>{if(at){const dt=a==null?void 0:a.providers.reduce((_t,xt)=>(_t[xt.hip.id]=xt.care_contexts,_t),{});$(dt||{})}else{const dt=a==null?void 0:a.providers.reduce((_t,xt)=>(_t[xt.hip.id]=[],_t),{});$(dt||{})}},ut=(at,dt)=>{const _t=at.hip.id;$(xt=>({...xt,[_t]:dt?at.care_contexts:[]}))},ht=(at,dt,_t)=>{$(xt=>{const vt=xt[at]??[];let bt;return _t?bt=[...vt,dt]:bt=vt.filter(kt=>kt.id!==dt.id),{...xt,[at]:bt}})};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-uppercase pds2-border-b pds2-border-surface-muted",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:rt,onChange:at=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){at.preventDefault();return}pt(at.target.checked)},onClick:at=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(at.preventDefault(),at.stopPropagation())}}),"All"]}),(ct=a==null?void 0:a.providers)==null?void 0:ct.map(at=>{const dt=at.hip.id;return jsxRuntimeExports.jsxs("div",{className:"Body3Medium",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between pds2-items-center pds2-cursor-pointer",onClick:()=>tt(dt),children:[jsxRuntimeExports.jsxs("div",{className:" pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-text-content-secondary",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:ot(at),onChange:_t=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){_t.preventDefault();return}ut(at,_t.target.checked)},onClick:_t=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(_t.preventDefault(),_t.stopPropagation())}}),at.hip.name]}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-16",children:nt(dt)?jsxRuntimeExports.jsx(e,{}):jsxRuntimeExports.jsx(c$3,{})})]}),nt(dt)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:at.care_contexts.map((_t,xt)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-24 pds2-py-16 ${xt<at.care_contexts.length-1?"pds2-border-b pds2-border-surface-muted":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:it(dt,_t.id),onChange:vt=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){vt.preventDefault();return}ht(dt,_t,vt.target.checked)},onClick:vt=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(vt.preventDefault(),vt.stopPropagation())}}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-5 pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-primary",children:_t.display}),jsxRuntimeExports.jsx("div",{className:"!Body3Regular pds2-text-content-secondary",children:_t.id})]})]})},_t.id))})]},dt)})]})},AbhaLoadingStatus=({loaderText:a})=>jsxRuntimeExports.jsxs("div",{className:"pds2-bg-surface-subtle pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"}),jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"}),jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"})]}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-mt-48",children:a||"Loading"})]}),ConsentDetailsScreen=()=>{const a=useAuthAbhaStore(et=>et.setScreen),o=useAuthAbhaStore(et=>et.initAbhaFlow),_=useAuthAbhaStore(et=>et.clientId),b=useAuthAbhaStore(et=>et.consentDetails),$={REQUESTED:"Consent Request Details",GRANTED:"Granted Consent Details",DENIED:"Consent Denied Details",EXPIRED:"Consent Expired Details",REVOKED:"Consent Revoked Details"},_e=useTrackAbhaEvent();return b||_e({name:"abha_consent_details_screen",data:{page_view:"abha_consent_details_screen",platform:_,error:"consent details not found",flow:o}}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-surface-base",children:b?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Header,{title:`${b!=null&&b.status?$[b.status]??"":""}`,className:"pds2-border-b-1 pds2-border-surface-muted"}),jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-surface-subtle",children:[jsxRuntimeExports.jsx(ConsentCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"DURATION"}),jsxRuntimeExports.jsx(ConsentDurationCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"REQUEST INFORMATION TYPE"}),jsxRuntimeExports.jsx(ConsentHiTypeListCard,{}),jsxRuntimeExports.jsxs("div",{className:"Body3Semibold pds2-text-content-secondary",children:["HEALTH CARE PROVIDERS",jsxRuntimeExports.jsx("br",{}),"Sharing your data for requested information, from following healthcare providers:"]}),jsxRuntimeExports.jsx(ConsentHCPCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"By granting this consent, you agree to let the Doctors view your health information."})]}),["REQUESTED","GRANTED"].includes(b.status)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-surface-base pds2-w-full pds2-border pds2-border-surface-muted",children:[b.status==="REQUESTED"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{title:"Deny",buttonColor:"pds2-bg-surface-danger",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_DENY)}),jsxRuntimeExports.jsx(Pds2Button,{title:"Grant Access",buttonColor:"pds2-bg-semantic-success",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_APPROVE)})]}),b.status==="GRANTED"&&jsxRuntimeExports.jsx(Pds2Button,{title:"Revoke Access",buttonColor:"pds2-bg-surface-danger",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_REVOKE)})]})]}):jsxRuntimeExports.jsx(AbhaLoadingStatus,{})})},v$2="5.9.6",fr$2=30,ip$2=0,op$2=10,w$2=400,h$2=400,nm$2="Композиция 1",ddd$1=0,assets$2=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$2=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$2=[],animationDataLoading={v:v$2,fr:fr$2,ip:ip$2,op:op$2,w:w$2,h:h$2,nm:nm$2,ddd:ddd$1,assets:assets$2,layers:layers$2,markers:markers$2},v$1="5.9.6",fr$1=30,ip$1=0,op$1=50,w$1=400,h$1=400,nm$1="Композиция 1",ddd=0,assets$1=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$1=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$1=[],animationData$1={v:v$1,fr:fr$1,ip:ip$1,op:op$1,w:w$1,h:h$1,nm:nm$1,ddd,assets:assets$1,layers:layers$1,markers:markers$1},AbhaRejectionStatus=({loading:a=!1,loadingText:o,rejectText:_})=>jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center pds2-bg-surface-subtle",children:a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading,loop:!0,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-absolute pds2-mt-220",children:o})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationData$1,loop:!1,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-absolute pds2-mt-220",children:_})]})}),AbhaConsentDenyScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.abhaRequestConsentId),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!$){st({name:"abha_consent_deny_screen",data:{page_view:"abha_consent_request_page",platform:_,data:{flow:b,error_msg:"No consent ID found"}}}),console.error("No consent ID found");return}st({name:"abha_consent_revoke_triggered",data:{flow_step_type:"init",clientId:_,flow:b}});const rt=await postAbdmConsentDeny({consentId:$});if("success"in rt){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent deny success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_deny_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:ot,error:it,source_error:pt}=rt;et({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:_,flow:b,error_code:ot,error_msg:it,source_error:pt}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Denying...",rejectText:"Consent Denied Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})},AbhaConsentRevokeScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.consentApiBody),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),$(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!(et!=null&&et.consent_artefacts_id)){st({name:"abha_consent_revoke_screen",data:{page_view:"abha_consent_request_page",flow:b,platform:_,data:{error_msg:"No consent artefacts ids found"}}}),console.error("No consent artefacts ids found");return}const rt=await postAbdmConsentRevoke({consent_artefacts_ids:et==null?void 0:et.consent_artefacts_id});if("success"in rt){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent revoke success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_revoke_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:ot,error:it,source_error:pt}=rt;$({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_revoke_failed",data:{flow:b,flow_step_type:"init",clientId:_,error_code:ot,error_msg:it,source_error:pt}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Revoke in progress...",rejectText:"Consent Revoked Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})},AbhaConsentApproveScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.consentApiBody),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_approve_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!$){st({name:"abha_consent_approve_screen",data:{page_view:"abha_consent_request_page",platform:_,data:{flow:b,error_msg:"No consent details found"}}}),console.error("No consent details found");return}const{consent_artefacts_id:rt,...ot}=$,it=await postAbdmConsentApprove({consentApprovePayload:ot});if("success"in it){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent grant success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_grant_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:pt,error:ut,source_error:ht}=it;et({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_grant_failed",data:{flow:b,flow_step_type:"init",clientId:_,error_code:pt,error_msg:ut,source_error:ht}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:a,loadingText:"Grant in progress...",successText:"Consent Granted Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})};function SelfAssessmentSDKIframe({src:a,mountConfig:o,iframeId:_="sa-sdk-iframe"}){const b=reactExports.useRef(null),$=reactExports.useRef(null);return reactExports.useEffect(()=>{var rt;const _e=b.current;if(!_e)return;$.current&&($.current.remove(),$.current=null);const et=document.createElement("iframe");$.current=et,et.id=_,et.style.width="100%",et.style.height="100%",et.style.border="0",_e.appendChild(et);const st=(rt=et.contentWindow)==null?void 0:rt.document;if(!st)return;const tt=`
|
|
65
|
+
${b?"pds2-text-primary-brand":""}`,children:o})]})]})}),LoginorCreateAbhaScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId),[o,_]=reactExports.useState(!1);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,st;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((st=window==null?void 0:window.EkaAbha)==null||st.changeStatusBarColor("#FFFFFF"))}},[]);const b=()=>{var _e;o?_(!1):((_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount())},$=["eka-web","phr","www-eka","ext"];return jsxRuntimeExports.jsxs("div",{className:`pds2-h-full ${o?"pds2-overflow-y-hidden ":"pds2-overflow-y-auto"}`,children:[jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:!o&&jsxRuntimeExports.jsx("button",{onClick:b,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-surface-subtle",showHeaderStrip:!$.includes(a)}),jsxRuntimeExports.jsx(LoginOrCreateWithDifferentMethods,{tryFaceAuthScreen:o,setTryFaceAuthScreen:_})]})},LoginOrCreateWithDifferentMethods=({tryFaceAuthScreen:a,setTryFaceAuthScreen:o})=>{const _=useAuthAbhaStore(Kt=>Kt.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.MOBILE),b=useAuthAbhaStore(Kt=>Kt.setAbhaAuthFlowMethod),$=useAuthAbhaStore(Kt=>Kt.goBackToLogin);useAuthAbhaStore(Kt=>Kt.isEkaDocWebRequest);const _e=useAuthAbhaStore(Kt=>Kt.isSkipABHAEnable),et=useAuthAbhaStore(Kt=>Kt.setGoBackToLogin),st=useAuthAbhaStore(Kt=>Kt.setIdentifierValue),tt=useAuthAbhaStore(Kt=>Kt.identifierValue),nt=useAuthAbhaStore(Kt=>Kt.isEkaAppLogin),rt=useAuthAbhaStore(Kt=>Kt.setSelectedAbhaAddress),ot=useAuthAbhaStore(Kt=>Kt.setLoginIdentifierValue),it=useAuthAbhaStore(Kt=>Kt.setRegistrationType),pt=useAuthAbhaStore(Kt=>Kt.setAadhaarInitResponse),ut=useAuthAbhaStore(Kt=>Kt.setAadhaarFaceAuthInitResponse),ht=useAuthAbhaStore(Kt=>Kt.setMobileInitResponse),yt=useAuthAbhaStore(Kt=>Kt.initAbhaAppMobileNumber),lt=useAuthAbhaStore(Kt=>Kt.initAbhaAppIdentifierType),ct=useAuthAbhaStore(Kt=>Kt.initAbhaAppIdentifier),at=useAuthAbhaStore(Kt=>Kt.setInitAbhaAppIdentifier),dt=useAuthAbhaStore(Kt=>Kt.setInitAbhaAppIdentifierType),_t=useAuthAbhaStore(Kt=>Kt.isDocAppRequest),xt=useAuthAbhaStore(Kt=>Kt.faceAuthEnable),vt=useAuthAbhaStore(Kt=>Kt.setIsNewLoginOrCreateFlow),bt=useAuthAbhaStore(Kt=>Kt.clientId),kt=useAuthAbhaStore(Kt=>Kt.isInitApiTriggered),Tt=useAuthAbhaStore(Kt=>Kt.setIsInitApiTriggered),Ot=useAuthAbhaStore(Kt=>Kt.setIdentityValue);useAuthAbhaStore(Kt=>Kt.identityValue);const Dt=useAuthAbhaStore(Kt=>Kt.setSelectedAbhaFlow),Mt=useAuthAbhaStore(Kt=>Kt.initAbhaFlow),jt=useAuthAbhaStore(Kt=>Kt.selectedAadhaarAuth),It=useAuthAbhaStore(Kt=>Kt.setSelectedAadhaarAuth),gt=useAuthAbhaStore(Kt=>Kt.orgIconUrl),At=useAuthAbhaStore(Kt=>Kt.initAbhaAppMethod),[mt,ft]=reactExports.useState(LOADING_STATE.IDLE),[Ct,Rt]=reactExports.useState(""),Bt=useAuthAbhaStore(Kt=>Kt.setScreen),[Lt,St]=reactExports.useState({aadhaar:LOADING_STATE.IDLE,mobile:LOADING_STATE.IDLE}),[Ft,Pt]=reactExports.useState($?tt==null?void 0:tt.mobile:""),[Et,Gt]=reactExports.useState(!1),[Yt,Ht]=reactExports.useState(!1),[qt,$t]=reactExports.useState(tt.aadhaar_number||""),[Wt,zt]=reactExports.useState(tt.abha_number||""),[Ut,os]=reactExports.useState(""),[ds,es]=reactExports.useState(tt.phr_address||""),us=reactExports.useRef(!1),ss=GET_EXTRA_HEADERS(),Qt=(ss==null?void 0:ss["X-User-ID"])??void 0;reactExports.useEffect(()=>{Xt({name:"abha_login_or_create_screen",data:{flow:Mt}}),handleReadOTP()},[]);const wt=()=>{onSkipAbha({identifier:(tt==null?void 0:tt.mobile)||(tt==null?void 0:tt.aadhaar_number)||(tt==null?void 0:tt.abha_number)||(tt==null?void 0:tt.phr_address)||"",identifier_type:tt!=null&&tt.mobile?"mobile":"aadhaar_number"}),Xt({name:"skip_abha_clicked",data:{flow:Mt,platform:bt}}),unMount()},Nt=async Kt=>{var _s;try{ft(LOADING_STATE.LOADING);const ls=await postAbdmProfileSearch({mobile:Kt});if(((_s=ls==null?void 0:ls.profiles)==null?void 0:_s.length)>0&&ct)Pt(ct);else{ft(LOADING_STATE.REJECTED),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),Rt(`KYC ABHA not found for ${ct}. Please register with Aadhaar.`);return}}catch(ls){console.error("Error searching ABDM profile:",ls),ft(LOADING_STATE.REJECTED),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}};reactExports.useEffect(()=>{ct&<===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(os(ct),es(ct.split("@")[0]),st({phr_address:ct.split("@")[0]}),xr(!0),Rr(!0),b(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS)):ct&<===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?(st({abha_number:ct}),zt(ct),xr(!0),Tr(!0),b(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):ct&<===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?($t(ct),Ht(!0),st({aadhaar_number:ct}),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)):ct&<===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$&&(b(ABHA_AUTH_FLOW_METHOD.MOBILE),Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION?Pt(ct):Nt(ct),Gt(ct.length===10),st({mobile:ct}),Rt(null))},[lt,ct]),reactExports.useEffect(()=>{kt||us.current||(Ft&&Ft.length===10&&_==ABHA_AUTH_FLOW_METHOD.MOBILE&&!_e?(gs("auto_submit_mobile"),Tt(!0),us.current=!0):Ft&&Ft.length===10&&_==ABHA_AUTH_FLOW_METHOD.MOBILE&&_e&<===ABHA_AUTH_FLOW_METHOD.MOBILE&&ft(LOADING_STATE.REJECTED))},[Ft]),reactExports.useEffect(()=>{kt||us.current||qt&&qt.length===12&&_==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!xt&&(Tt(!0),us.current=!0,gs("auto_submit_aadhaar"))},[qt]),reactExports.useEffect(()=>{st({aadhaar_number:qt})},[qt]),reactExports.useEffect(()=>{kt||us.current||Wt&&Wt.length===17&&_==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(Tt(!0),us.current=!0,gs("auto_submit_abha"))},[Wt]),reactExports.useEffect(()=>{kt||us.current||Ut&&Ut.includes("@abdm")&&_==ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&(Tt(!0),us.current=!0,gs("auto_submit_phr"))},[Ut]);const Xt=useTrackAbhaEvent(),ts=React.useMemo(()=>{switch(_){case ABHA_AUTH_FLOW_METHOD.MOBILE:return"Enter your Mobile Number";case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return"Enter your Aadhaar Number";default:return""}},[_]),rs=Kt=>{dt(""),Rt("");const _s=Kt.target.value;switch(_){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:if(_s.length>20)return;es(_s),st({phr_address:_s}),at(null);break;case ABHA_AUTH_FLOW_METHOD.MOBILE:const ls=_s.replace(/\D/g,"").slice(-10);Pt(ls),Gt(!0),st({mobile:ls}),at(null);break;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:if(!/^[\d-]*$/.test(_s)||_s.length>17)return;const Ts=Kt.target.value.replace(/-/g,"");let js="";return Ts.length>0&&(js+=Ts.slice(0,2)),Ts.length>2&&(js+=`-${Ts.slice(2,6)}`),Ts.length>6&&(js+=`-${Ts.slice(6,10)}`),Ts.length>10&&(js+=`-${Ts.slice(10,14)}`),zt(js),at(null),st({abha_number:js.trim()});case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:if(_s&&!/^[0-9]+$/.test(_s)||_s.length>12)return;$t(_s),Ht(!0),at(null),st({aadhaar_number:_s});break}};ABHA_AUTH_FLOW_METHOD.MOBILE;const xs=React.useMemo(()=>{switch(_){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:return tt.phr_address.length>=4&&tt.phr_address.length<=20;case ABHA_AUTH_FLOW_METHOD.MOBILE:return lt==="mobile"?(ct==null?void 0:ct.length)===10:Ft.length===10;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return tt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return tt.aadhaar_number.length===12&&jt!=AADHAAR_AUTH_STATES.NONE}},[_,tt,jt]),fs=(Kt,_s)=>{St(ls=>({...ls,[Kt]:_s}))},Ds=({inputVal:Kt})=>{Kt.length===12&&(st({aadhaar_number:Kt}),$t(Kt),Ht(!0))};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",_)},[_]);const gs=async(Kt,_s)=>{var Gr,$r,Ur,zr;vt(!0),Xt({name:"abha_login_next_click",data:{flow:Mt,flow_step_type:Kt}}),ft(LOADING_STATE.LOADING),it(REGISTRATION_TYPE.LOGIN);let ls="";if(!nt){const Ss=await postAuthLogoutV2();Xt({name:Ss?"abha_logout_success":"abha_logout_failure",data:{flow:Mt,platform:bt}});const{txn_id:vs,error:ms}=await postAuthInitV2({method:AUTH_METHOD.ABHA});if(!vs||ms){Xt({name:"abha_auth_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:ms||"missing_txnId_or_unknown_error",error_message_exists:!!ms,txn_id_exists:!!vs}}),Rt((ms==null?void 0:ms.message)||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}ls=vs,Xt({name:"abha_auth_init_success.",data:{flow:Mt,flow_step_type:"init",auth_txnId:ls}})}const Ts=_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?`${tt.phr_address}@abdm`:_===ABHA_AUTH_FLOW_METHOD.MOBILE?tt==null?void 0:tt.mobile:_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?tt.abha_number:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?tt.aadhaar_number:"";if(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER||_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS){const{txn_id:Ss,error:vs,action:ms,hint:bs}=await postAbdmLoginInit({method:_,identifier:Ts});if(Tt(!0),Ot(Ts),Xt({name:"abha_login_init_triggered",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,method:_}}),_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&rt(Ts),vs||!Ss){if(et(!0),((Gr=ms==null?void 0:ms.cta)==null?void 0:Gr.pid)==="abha_mobile_enroll"&&_===ABHA_AUTH_FLOW_METHOD.MOBILE){fs("mobile",LOADING_STATE.LOADING),it(REGISTRATION_TYPE.CREATE);const{txn_id:Ls,hint:Wr,error:vr,action:Ar}=await postRegisterMobileInit({mobile_number:tt==null?void 0:tt.mobile});if(Tt(!0),Ot(tt==null?void 0:tt.mobile),Dt("mobile"),Ls&&Wr){ht({authTxnId:ls,txnId:Ls,mobileOtpSentToHint:Wr}),Xt({name:"abha_mobile_registration_init_success",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,error_message:vr,error_action:ms}}),fs("mobile",LOADING_STATE.RESOLVED),ft(LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),Bt(SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION);return}if(fs("mobile",LOADING_STATE.REJECTED),Xt({name:"abha_mobile_registration_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:vr||"unknown_error",error_message_exists:!!vr,error_action_exists:!!Ar}}),Ar){if(($r=Ar==null?void 0:Ar.cta)!=null&&$r.pid)return Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}else Rt(vr||"Something went wrong");Rt(vr||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}Xt({name:"abha_login_init_failure",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,error_message:vs||"unknown_error",error_message_exists:!!vs,error_action_exists:!!ms}}),Rt(vs||"Something went wrong. Please try again."),ft(LOADING_STATE.REJECTED);return}Xt({name:"abha_login_init_success",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,ndhmTxnId:Ss,hint:bs}}),pt({authTxnId:ls,txnId:Ss,aadhaarOtpSentToHint:bs||null}),et(!1),ot(Ts),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA);return}const js=_s??jt;if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.OTP){fs("aadhaar",LOADING_STATE.LOADING),Xt({name:"aadhaar_registration_init_start",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,aadhaarNumber:tt.aadhaar_number}});const{txn_id:Ss,hint:vs,error:ms,action:bs}=await postRegisterAadhaarInit({aadhaar_number:tt.aadhaar_number});if(Ot(tt.aadhaar_number),Dt("aadhaar"),Ss&&vs){pt({authTxnId:ls,txnId:Ss,aadhaarOtpSentToHint:vs}),Xt({name:"aadhaar_registration_init_success",data:{flow:Mt,flow_step_type:"verify",ndhmTxnId:Ss,authTxnId:ls}}),et(!1),fs("aadhaar",LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(Xt({name:"abha_registration_init_failure",data:{flow:Mt,error_message:ms||"unknown_error",error_message_exists:!!ms,auth_txn_id:ls,error_action:bs,error_action_exists:!!bs}}),fs("aadhaar",LOADING_STATE.REJECTED),ft(LOADING_STATE.REJECTED),bs||ms){et(!0),(Ur=bs==null?void 0:bs.cta)!=null&&Ur.pid?Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):Rt(ms||"Something went wrong");return}}if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.FACE_AUTH){fs("aadhaar",LOADING_STATE.LOADING),Xt({name:"aadhaar_registration_faceauth_init_start",data:{flow:Mt,flow_step_type:"init",authTxnId:ls,aadhaarNumber:tt.aadhaar_number}});const{url:Ss,txn_id:vs,hint:ms,error:bs,action:Ls}=await postRegisterAadhaarFaceAuthInit();if(Ot(tt.aadhaar_number),Dt("aadhaar"),vs&&ms&&Ss){ut({authTxnId:ls,txnId:vs,aadhaarFaceAuthOtpSentToHint:ms,faceAuthQrUrl:Ss}),Xt({name:"aadhaar_registration_faceauth_init_success",data:{flow:Mt,flow_step_type:"verify",ndhmTxnId:vs,authTxnId:ls}}),et(!1),fs("aadhaar",LOADING_STATE.RESOLVED),it(REGISTRATION_TYPE.CREATE),ft(LOADING_STATE.RESOLVED),Bt(SCREEN_NAMES.ABHA_AUTH_QR_SCREEN);return}if(Xt({name:"abha_registration_faceauth_init_failure",data:{flow:Mt,error_message:bs||"unknown_error",error_message_exists:!!bs,auth_txn_id:ls,error_action:Ls,error_action_exists:!!Ls}}),fs("aadhaar",LOADING_STATE.REJECTED),ft(LOADING_STATE.REJECTED),Ls||bs){et(!0),(zr=Ls==null?void 0:Ls.cta)!=null&&zr.pid?Bt(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):Rt(bs||"Something went wrong");return}}if(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&js===AADHAAR_AUTH_STATES.FINGERPRINT){ut({authTxnId:ls,txnId:null,aadhaarFaceAuthOtpSentToHint:null,faceAuthQrUrl:null}),Ot(tt.aadhaar_number),Dt("aadhaar"),it(REGISTRATION_TYPE.CREATE),et(!1),Bt(SCREEN_NAMES.AADHAAR_FINGERPRINT_SCREEN);return}},[Ir,xr]=reactExports.useState(!1),[an,Tr]=reactExports.useState($&&_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),[on,Rr]=reactExports.useState($&&_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),[ln,Cr]=reactExports.useState(!1);return jsxRuntimeExports.jsxs("div",{className:`pds2-w-full pds2-h-full ${a?"pds2-relative":""}`,children:[jsxRuntimeExports.jsxs("div",{className:`pds2-p-16 pds2-bg-surface-subtle pds2-space-y-16 pds2-text-center pds2-rounded-b-24 ${_t?"pds2-pt-0 -pds2-mt-20":"pds2-pt-22"}`,children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION)&&At!="login_abha_with_mobile"?jsxRuntimeExports.jsx(AbhaStepper,{}):jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-surface-subtle"}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsxs("div",{className:`pds2-rounded-16 ${gt?"pds2-flex pds2-gap-10":""}`,children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64 pds2-bg-surface-base pds2-rounded-16"}),gt&&jsxRuntimeExports.jsx("img",{src:gt,alt:"org-icon",className:"pds2-w-64 pds2-h-64 pds2-rounded-16"})]})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-content-primary",children:At==="login_abha_with_mobile"?"Login using ABHA":bt==="phr"?"Login or Create your ABHA":_t?"Add Patient via ABHA":"Create your ABHA"}),At!="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-text-content-secondary",style:{marginTop:"4px"},children:_===ABHA_AUTH_FLOW_METHOD.MOBILE?_t?"Enter Patient's Mobile Number":"Enter your Mobile Number":_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?_t?"Enter Patient's Aadhaar Number":"Enter your Aadhaar Number":_===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?_t?"Enter Patient's ABHA Number":"Enter your ABHA Number":_===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?_t?"Enter Patient's ABHA Address":"Enter your ABHA Address":ts}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsxs("div",{className:"pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-1/2 pds2-relative",children:jsxRuntimeExports.jsx("div",{className:"Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-surface-success pds2-text-content-success pds2-mx-auto pds2-border pds2-border-surface-neutral pds2-border-b-none pds2-rounded-t-6",children:"Recommended"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-surface-muted pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-surface-base pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),Rt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{b(ABHA_AUTH_FLOW_METHOD.MOBILE),Rt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-w-14 pds2-h-14 pds2-text-semantic-success"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${_===ABHA_AUTH_FLOW_METHOD.MOBILE?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:_===ABHA_AUTH_FLOW_METHOD.MOBILE?{fontWeight:700}:{fontWeight:400},children:"Mobile"})]})]})]}),At==="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-text-content-secondary",children:"Enabling ABHA for lifelong health records"}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative",children:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaInputComponent,{initialValues:lt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(ct==null?void 0:ct.match(/.{1,4}/g))??void 0:(qt==null?void 0:qt.match(/.{1,4}/g))??void 0,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!ct,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:Ds,setIsValid:Ht,setValue:$t,setError:Rt,isOtpInput:!1}),xt&&jsxRuntimeExports.jsxs("div",{className:"pds2-mt-20",children:[jsxRuntimeExports.jsx("hr",{className:"pds2-text-content-muted pds2-border-t-2 pds2-border-surface-strong pds2-w-4/5 pds2-mx-auto"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-py-12 pds2-text-content-secondary ",children:"Authenticate using"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-8 pds2-w-11/12 pds2-mx-auto pds2-items-end",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(t$5,{className:"pds2-w-full pds2-h-full"}),text:"OTP",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.OTP,onClick:()=>It(AADHAAR_AUTH_STATES.OTP)}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-2/3",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-text-content-primary Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-semantic-warning pds2-mx-auto pds2-border pds2-border-surface-neutral pds2-border-b-none pds2-rounded-t-6 pds2-flex",children:[jsxRuntimeExports.jsx(n$6,{className:"pds2-w-10"}),"Fastest. No OTP"]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-8",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(l$3,{className:"pds2-w-full pds2-h-full"}),text:"Face Auth",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.FACE_AUTH,onClick:()=>It(AADHAAR_AUTH_STATES.FACE_AUTH)}),jsxRuntimeExports.jsx(AuthLoginCard,{icon:jsxRuntimeExports.jsx(t$3,{className:"pds2-w-full pds2-h-full"}),text:"Biometric",otpReq:!1,isSelected:jt===AADHAAR_AUTH_STATES.FINGERPRINT,onClick:()=>It(AADHAAR_AUTH_STATES.FINGERPRINT)})]})]})]})]})]}):jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$?ct||"":Ft,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.MOBILE||!!ct&&!!Qt,onChange:rs,type:"tel",name:"phone",autoComplete:"tel",inputMode:"numeric",pattern:"[0-9]*",placeholder:"Mobile Number",autoFocus:!0,PrefixComponent:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-x-8 pds2-border-r pds2-border-surface-muted pds2-pr-24",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4mlct2900000tg98p8u967s.webp",alt:"indian-flag-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:"pds2-text-content-primary pds2-text-sm",children:"+91"})]})})}),Ct&&(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:`${Ct.includes("KYC ABHA not found for")?"pds2-text-content-primary":"pds2-text-semantic-error"} Body3Regular`,children:Ct}),jsxRuntimeExports.jsxs("div",{className:"BodyFootnote pds2-text-content-secondary",children:["By proceeding, you agree to"," ",jsxRuntimeExports.jsx("span",{className:"pds2-underline pds2-cursor-pointer",onClick:()=>Cr(!0),children:"T&C"})]}),(_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER||_===ABHA_AUTH_FLOW_METHOD.MOBILE&&!_e)&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!xs||mt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:mt===LOADING_STATE.LOADING,onClick:()=>{gs("aadhaar_or_mobile_on_click")},className:"pds2-w-full"}),_===ABHA_AUTH_FLOW_METHOD.MOBILE&&_e&&xt&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!xs||mt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:mt===LOADING_STATE.LOADING,onClick:()=>gs("aadhaar_or_mobile_on_click"),className:"pds2-w-full"}),At==="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"BodyFootnote pds2-text-content-secondary",children:_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"You will receive OTP from Aadhaar":"You will receive OTP from NHA "})]}),At!="login_abha_with_mobile"&&jsxRuntimeExports.jsx("div",{className:"pds2-pb-10",children:jsxRuntimeExports.jsxs("div",{className:"pds2-m-16 pds2-mb-32 pds2-bg-surface-base pds2-rounded-16 pds2-border pds2-border-surface-muted pds2-overflow-hidden",children:[jsxRuntimeExports.jsxs("button",{onClick:()=>xr(!Ir),className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-16 pds2-bg-surface-base hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsx("span",{className:"pds2-text-content-secondary",children:_t?"Other add options for ABHA":"Other login options for ABHA"}),jsxRuntimeExports.jsx(c$3,{className:`pds2-w-16 pds2-h-16 pds2-text-content-secondary pds2-transition-transform ${Ir?"pds2-rotate-180":""}`})]}),jsxRuntimeExports.jsxs("div",{className:`pds2-overflow-hidden pds2-transition-all pds2-duration-300 ${Ir?"pds2-max-h-126 pds2-opacity-100":"pds2-max-h-0 pds2-opacity-0"}`,children:[jsxRuntimeExports.jsxs("button",{onClick:()=>{xr(!1),b(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),Tr(!0),Rt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-surface-muted pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-content-primary",children:_t?"Add patient with ABHA Number":"Login with ABHA Number"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-content-secondary"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{xr(!1),b(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),Rr(!0),Rt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-surface-muted pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-surface-muted pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"ABHA",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-content-primary",children:_t?"Add patient with ABHA Address":"Login with ABHA Address"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-content-secondary"})]})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:an,setIsOpen:Tr,setFlowMethod:b,setError:Rt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE_KIOSK)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Rt(null),Tr(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-surface-subtle pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-content-primary",children:_t?"Add Patient with ABHA Number":"Login with ABHA Number"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-content-secondary pds2-mb-24",children:_t?"Enter Patient's 14 digit ABHA Number":"Enter your 14 digit ABHA Number"}),jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?ct||"":Wt,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!ct,onChange:rs,placeholder:"00-0000-0000-0000",padding:"pds2-p-18",textStyle:"Body2Regular pds2-text-center pds2-text-lg",borderStyle:"focus-within:pds2-border-primary-brand",type:"tel",inputMode:"numeric",autoFocus:!0,onKeyDown:Kt=>{Kt.key==="Enter"&&gs("after_enter_abha_number_on_click_by_user")}}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error Body3Regular pds2-mt-12",children:Ct}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||mt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>gs("after_enter_abha_number_on_click_by_user"),className:`pds2-w-full ${Ct?"pds2-mt-12":"pds2-mt-24"}`,isLoading:mt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:on,setIsOpen:Rr,setFlowMethod:b,setError:Rt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[(Mt==null||Mt===ABHA_INIT_FLOW.ABHA_REGISTRATION||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE||Mt===ABHA_INIT_FLOW.SCAN_AND_SHARE_KIOSK)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Rt(null),Rr(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-surface-subtle pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-content-primary",children:_t?"Add Patient with ABHA Address":"Login with ABHA Address"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-content-secondary pds2-mb-24",children:_t?"Enter Patient's ABHA Address below":"Enter your ABHA Address below"}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative",children:[jsxRuntimeExports.jsx(Pds2InputField,{value:lt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(ct==null?void 0:ct.split("@")[0])||"":ds,disabled:!$&<===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!!ct,onChange:rs,placeholder:"Enter ABHA Address",inputMode:"text",autoFocus:!0,onKeyDown:Kt=>{Kt.key==="Enter"&&gs("after_enter_abha_address_on_click_by_user")}}),jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-right-16 pds2-top-16 Body1Regular pds2-text-content-secondary",children:"@abdm"})]}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error Body3Regular pds2-mt-12",children:Ct}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||mt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>gs("after_enter_abha_address_on_click_by_user"),className:`pds2-w-full ${Ct?"pds2-mt-12":"pds2-mt-24"}`,isLoading:mt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet$1,{isOpen:ln,setIsOpen:Cr,setFlowMethod:b,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-h-10 pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{Cr(!1)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-content-secondary hover:pds2-text-content-primary",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-h-4/5 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-h-30 TitlesSubheadline pds2-pb-10",children:"Terms and Conditions"}),jsxRuntimeExports.jsxs("div",{className:"pds2-h-4/5 pds2-text-justify pds2-px-10 pds2-overflow-auto",children:["I, hereby declare that I am voluntarily sharing my Aadhaar number and demographic information issued by UIDAI, with National Health Authority (NHA) for the sole purpose of creation of ABHA number. ",jsxRuntimeExports.jsx("br",{})," ",jsxRuntimeExports.jsx("br",{}),'I understand that my ABHA number can be used and shared for purposes as may be notified by ABDM from time to time including provision of healthcare services. Further, I am aware that my personal identifiable information (Name, Address, Age, Date of Birth, Gender and Photograph) may be made available to the entities working in the National Digital Health Ecosystem (NDHE) which inter alia includes stakeholders and entities such as healthcare professionals (e.g. doctors), facilities (e.g. hospitals, laboratories) and data fiduciaries (e.g. health programmes), which are registered with or linked to the Ayushman Bharat Digital Mission (ABDM), and various processes there under. I authorize NHA to use my Aadhaar number for performing Aadhaar based authentication with UIDAI as per the provisions of the Aadhaar (Targeted Delivery of Financial and other Subsidies, Benefits and Services) Act, 2016 for the aforesaid purpose. I understand that UIDAI will share my e-KYC details, or response of "Yes" with NHA upon successful authentication. I have been duly informed about the option of using other IDs apart from Aadhaar; however, I consciously choose to use Aadhaar number for the purpose of availing benefits across the NDHE. I am aware that my personal identifiable information excluding Aadhaar number / VID number can be used and shared for purposes as mentioned above. I reserve the right to revoke the given consent at any point of time as per provisions of Aadhaar Act and Regulations.']}),jsxRuntimeExports.jsx(Pds2Button,{title:"I Agree",state:"enabled",onClick:()=>Cr(!1),className:"pds2-w-full pds2-mt-20"})]})]})}),(_===ABHA_AUTH_FLOW_METHOD.MOBILE||_===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&xt&&_e&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-text-primary-brand",children:jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-15 pds2-right-14 pds2-z-50 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("button",{onClick:wt,className:"pds2-bg-surface-base pds2-w-full pds2-py-4 pds2-px-15 pds2-rounded-12 Body2Regular pds2-text-primary-brand hover:pds2-bg-primary-brand/20 pds2-border pds2-border-surface-muted",children:"Skip ABHA"})})}),a&&jsxRuntimeExports.jsx("div",{className:"pds2-w-full pds2-h-full pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-flex-col pds2-bg-surface-base",children:jsxRuntimeExports.jsxs("div",{className:"pds2-px-16 pds2-pb-16 pds2-pt-150 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-surface-subtle",children:[jsxRuntimeExports.jsx("div",{className:"Title2Bold pds2-text-center pds2-w-full pds2-mx-auto pds2-text-content-primary",children:"Hasslefree patient addition"}),jsxRuntimeExports.jsxs("div",{className:"Title3Regular pds2-text-center pds2-w-full pds2-mx-auto pds2-text-content-primary",children:[jsxRuntimeExports.jsx("div",{children:"With Digital Health Incentive"})," Scheme, earn by linking records"," ",jsxRuntimeExports.jsx("div",{children:"to ABHA."})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-gap-20 pds2-w-full pds2-pt-20",children:[jsxRuntimeExports.jsx(Pds2Button,{title:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center",children:[jsxRuntimeExports.jsx(n$6,{className:"pds2-w-30 pds2-text-semantic-warning"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center",children:[jsxRuntimeExports.jsx("div",{children:"Try Face Auth"}),jsxRuntimeExports.jsx("div",{className:"Body4Regular",children:"Fastest. No OTP"})]})]}),buttonColor:"",className:"pds2-w-full",padding:"pds2-p-9",onClick:()=>{Xt({name:"abha_try_face_auth_clicked",data:{flow:Mt,platform:bt}}),It(AADHAAR_AUTH_STATES.FACE_AUTH),gs("aadhaar_or_mobile_on_click",AADHAAR_AUTH_STATES.FACE_AUTH)}}),jsxRuntimeExports.jsx(Pds2Button,{textColor:"pds2-text-primary-brand",title:"Proceed with Aadhaar OTP",buttonColor:"pds2-bg-surface-base",className:"pds2-w-full pds2-border pds2-border-surface-muted",onClick:()=>{Xt({name:"abha_proceed_with_aadhaar_otp_clicked",data:{flow:Mt,platform:bt}}),It(AADHAAR_AUTH_STATES.OTP),gs("aadhaar_or_mobile_on_click",AADHAAR_AUTH_STATES.OTP)}})]}),Ct&&jsxRuntimeExports.jsx("div",{className:"pds2-text-semantic-error pds2-text-center Body3Regular pds2-mt-12",children:Ct})]})})]})},AbhaBottomSheet$1=({isOpen:a,setIsOpen:o,children:_,setFlowMethod:b,overlayClassName:$="pds2-bg-content-primary pds2-bg-opacity-50",setError:_e})=>{const[et,st]=reactExports.useState(a),tt=useAuthAbhaStore(rt=>rt.initAbhaFlow),nt=GET_CLIENT_ID();return reactExports.useEffect(()=>{if(a)st(!0);else{const rt=setTimeout(()=>st(!1),300);return()=>clearTimeout(rt)}},[a]),et?jsxRuntimeExports.jsxs("div",{className:`pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-items-end pds2-transition-all pds2-duration-300 ${a?"pds2-opacity-100":"pds2-opacity-0 pointer-events-none"}`,children:[jsxRuntimeExports.jsx("div",{className:`pds2-absolute pds2-inset-0 ${$} pds2-transition-opacity pds2-duration-300 ${nt==="ext"?"pds2-bg-surface-subtle":"pds2-bg-surface-neutral"}`,onClick:rt=>{if(tt!=ABHA_INIT_FLOW.ABHA_REGISTRATION){rt.stopPropagation();return}_e==null||_e(null),o(!1),b(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}}),jsxRuntimeExports.jsx("div",{className:`pds2-relative ${nt==="ext"?"pds2-bg-surface-subtle":"pds2-bg-surface-base"} pds2-rounded-t-24 pds2-w-full pds2-transition-transform pds2-duration-300 ${a?"pds2-translate-y-0":"pds2-translate-y-full"}`,style:{height:"75%",maxHeight:"600px",overflowY:"auto"},children:_})]}):null},formatDateTime=(a,o={date:!0,time:!0})=>{const _=new Date(a);let b="",$="";return o.time&&(b=_.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0})),o.date&&($=_.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"})),o.time&&o.date?`${b}, ${$}`:o.time?b:o.date?$:""};function ConsentCard(){var o,_,b,$,_e,et,st,tt,nt;const a=useAuthAbhaStore(rt=>rt.consentDetails);return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Semibold pds2-text-content-primary pds2-flex-1",children:[(o=a==null?void 0:a.hiu)==null?void 0:o.name,jsxRuntimeExports.jsx("div",{className:"Body2Regular",children:(_=a==null?void 0:a.hiu)==null?void 0:_.id})]}),(a==null?void 0:a.status)==ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-primary-brand pds2-bg-primary-brand/20 pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$c,{}),"Pending"]}),(a==null?void 0:a.status)==ConsentStatus.GRANTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-semantic-success pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Granted"]}),(a==null?void 0:a.status)==ConsentStatus.EXPIRED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-secondary pds2-bg-surface-subtle pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Expired"]}),(a==null?void 0:a.status)==ConsentStatus.DENIED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-surface-danger pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Denied"]}),(a==null?void 0:a.status)==ConsentStatus.REVOKED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-content-enabled pds2-bg-surface-danger pds2-px-8 pds2-py-4 pds2-border-surface-neutral pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Revoked"]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Type of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:"consent"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Purpose of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:(b=a==null?void 0:a.purpose)==null?void 0:b.text})]}),(($=a==null?void 0:a.duration)==null?void 0:$.from)&&((_e=a==null?void 0:a.duration)==null?void 0:_e.to)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Duration"}),jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-content-secondary",children:[formatDateTime((et=a==null?void 0:a.duration)==null?void 0:et.from,{date:!0,time:!1})," - ",formatDateTime((st=a==null?void 0:a.duration)==null?void 0:st.to,{date:!0,time:!1})]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Requested by"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-secondary",children:((tt=a==null?void 0:a.requester)==null?void 0:tt.name)||((nt=a==null?void 0:a.hiu)==null?void 0:nt.name)})]}),(a==null?void 0:a.created_at)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:"Requested at"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-secondary",children:formatDateTime(a==null?void 0:a.created_at,{date:!0,time:!0})})]})]})]})}const ConsentHiTypeListCard=()=>{var _e;const a=useAuthAbhaStore(et=>et.consentDetails),o=useAuthAbhaStore(et=>et.consentApiBody),_=useAuthAbhaStore(et=>et.setConsentApiBody),b=(o==null?void 0:o.hi_types)??[],$=et=>{const st=et.target.id,nt=et.target.checked?[...b,st]:b.filter(rt=>rt!==st);_({hi_types:nt})};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col ",children:(_e=a==null?void 0:a.hi_types)==null?void 0:_e.map((et,st)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-16 pds2-py-16 ${st<a.hi_types.length-1?"pds2-border-b pds2-border-surface-muted":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[(a==null?void 0:a.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsx("input",{id:et.id,type:"checkbox",checked:b.includes(et.id),className:"pds2-accent-primary-brand",onChange:$}),jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-content-secondary",children:et.display})]})},et==null?void 0:et.id))})})},formatDateToBackendISO=a=>{const o=new Date;return new Date(`${a}T${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`).toISOString()},ConsentDurationCard=()=>{var st,tt,nt,rt;const a=reactExports.useRef(null),o=reactExports.useRef(null),_=useAuthAbhaStore(ot=>ot.consentApiBody),b=useAuthAbhaStore(ot=>ot.setConsentApiBody),$=useAuthAbhaStore(ot=>ot.consentDetails),_e=new Date,et=(ot,it)=>{const pt=formatDateToBackendISO(it);b({duration:{..._==null?void 0:_.duration,[ot]:pt}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-py-6 pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:[jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary",children:jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-surface-muted`,children:[jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["From",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:((st=_==null?void 0:_.duration)==null?void 0:st.from)&&formatDateTime((tt=_==null?void 0:_.duration)==null?void 0:tt.from,{date:!0,time:!1})})]}),($==null?void 0:$.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n,{className:"pds2-text-primary-brand pds2-text-16",onClick:()=>{var ot;return(ot=a.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:a,type:"date",max:_e.toISOString().split("T")[0],onChange:ot=>et("from",ot.target.value)})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary",children:jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-surface-muted`,children:[jsxRuntimeExports.jsxs("div",{className:`${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["To",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:((nt=_==null?void 0:_.duration)==null?void 0:nt.to)&&formatDateTime((rt=_==null?void 0:_.duration)==null?void 0:rt.to,{date:!0,time:!1})})]}),($==null?void 0:$.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n,{className:"pds2-text-primary-brand pds2-text-16",onClick:()=>{var ot;return(ot=o.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:o,type:"date",max:_e.toISOString().split("T")[0],onChange:ot=>et("to",ot.target.value)})]})]})}),jsxRuntimeExports.jsxs("div",{className:`pds2-px-16 pds2-py-6 Body3Regular pds2-text-content-secondary ${($==null?void 0:$.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["Expires on",(_==null?void 0:_.erase_at)&&jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-content-primary",children:formatDateTime(_==null?void 0:_.erase_at,{date:!0,time:!0})})]})]})},ConsentHCPCard=()=>{var yt,lt,ct;const a=useAuthAbhaStore(at=>at.consentDetails),o=(yt=a==null?void 0:a.providers)==null?void 0:yt.reduce((at,dt)=>(at[dt.hip.id]=dt.care_contexts,at),{}),_=useAuthAbhaStore(at=>at.setConsentApiBody),[b,$]=reactExports.useState(o||{}),[_e,et]=reactExports.useState([]),st=()=>{var at;return(at=Object==null?void 0:Object.entries(b??{}))==null?void 0:at.map(([dt,_t])=>({hip_id:dt,care_contexts:_t}))};reactExports.useEffect(()=>{const at=st();_({consent_artefacts:at})},[b]);const tt=at=>{et(dt=>dt.includes(at)?dt.filter(_t=>_t!==at):[...dt,at])},nt=at=>_e.includes(at),rt=(lt=a==null?void 0:a.providers)==null?void 0:lt.every(at=>b[at.hip.id].length===at.care_contexts.length&&at.care_contexts.length>0),ot=at=>{var dt;return((dt=b[at.hip.id])==null?void 0:dt.length)===at.care_contexts.length},it=(at,dt)=>{var _t;return(_t=b[at])==null?void 0:_t.some(xt=>xt.id===dt)},pt=at=>{if(at){const dt=a==null?void 0:a.providers.reduce((_t,xt)=>(_t[xt.hip.id]=xt.care_contexts,_t),{});$(dt||{})}else{const dt=a==null?void 0:a.providers.reduce((_t,xt)=>(_t[xt.hip.id]=[],_t),{});$(dt||{})}},ut=(at,dt)=>{const _t=at.hip.id;$(xt=>({...xt,[_t]:dt?at.care_contexts:[]}))},ht=(at,dt,_t)=>{$(xt=>{const vt=xt[at]??[];let bt;return _t?bt=[...vt,dt]:bt=vt.filter(kt=>kt.id!==dt.id),{...xt,[at]:bt}})};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-uppercase pds2-border-b pds2-border-surface-muted",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:rt,onChange:at=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){at.preventDefault();return}pt(at.target.checked)},onClick:at=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(at.preventDefault(),at.stopPropagation())}}),"All"]}),(ct=a==null?void 0:a.providers)==null?void 0:ct.map(at=>{const dt=at.hip.id;return jsxRuntimeExports.jsxs("div",{className:"Body3Medium",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between pds2-items-center pds2-cursor-pointer",onClick:()=>tt(dt),children:[jsxRuntimeExports.jsxs("div",{className:" pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-text-content-secondary",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:ot(at),onChange:_t=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){_t.preventDefault();return}ut(at,_t.target.checked)},onClick:_t=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(_t.preventDefault(),_t.stopPropagation())}}),at.hip.name]}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-16",children:nt(dt)?jsxRuntimeExports.jsx(e,{}):jsxRuntimeExports.jsx(c$3,{})})]}),nt(dt)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-surface-base pds2-space-y-8",children:at.care_contexts.map((_t,xt)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-24 pds2-py-16 ${xt<at.care_contexts.length-1?"pds2-border-b pds2-border-surface-muted":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-primary-brand",checked:it(dt,_t.id),onChange:vt=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){vt.preventDefault();return}ht(dt,_t,vt.target.checked)},onClick:vt=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(vt.preventDefault(),vt.stopPropagation())}}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-5 pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-content-primary",children:_t.display}),jsxRuntimeExports.jsx("div",{className:"!Body3Regular pds2-text-content-secondary",children:_t.id})]})]})},_t.id))})]},dt)})]})},AbhaLoadingStatus=({loaderText:a})=>jsxRuntimeExports.jsxs("div",{className:"pds2-bg-surface-subtle pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"}),jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"}),jsxRuntimeExports.jsx("div",{className:"pds2-w-12 pds2-h-12 pds2-bg-primary-brand pds2-rounded-full"})]}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-mt-48",children:a||"Loading"})]}),ConsentDetailsScreen=()=>{const a=useAuthAbhaStore(et=>et.setScreen),o=useAuthAbhaStore(et=>et.initAbhaFlow),_=useAuthAbhaStore(et=>et.clientId),b=useAuthAbhaStore(et=>et.consentDetails),$={REQUESTED:"Consent Request Details",GRANTED:"Granted Consent Details",DENIED:"Consent Denied Details",EXPIRED:"Consent Expired Details",REVOKED:"Consent Revoked Details"},_e=useTrackAbhaEvent();return b||_e({name:"abha_consent_details_screen",data:{page_view:"abha_consent_details_screen",platform:_,error:"consent details not found",flow:o}}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-surface-base",children:b?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Header,{title:`${b!=null&&b.status?$[b.status]??"":""}`,className:"pds2-border-b-1 pds2-border-surface-muted"}),jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-surface-subtle",children:[jsxRuntimeExports.jsx(ConsentCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"DURATION"}),jsxRuntimeExports.jsx(ConsentDurationCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"REQUEST INFORMATION TYPE"}),jsxRuntimeExports.jsx(ConsentHiTypeListCard,{}),jsxRuntimeExports.jsxs("div",{className:"Body3Semibold pds2-text-content-secondary",children:["HEALTH CARE PROVIDERS",jsxRuntimeExports.jsx("br",{}),"Sharing your data for requested information, from following healthcare providers:"]}),jsxRuntimeExports.jsx(ConsentHCPCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-content-secondary",children:"By granting this consent, you agree to let the Doctors view your health information."})]}),["REQUESTED","GRANTED"].includes(b.status)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-surface-base pds2-w-full pds2-border pds2-border-surface-muted",children:[b.status==="REQUESTED"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{title:"Deny",buttonColor:"pds2-bg-surface-danger",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_DENY)}),jsxRuntimeExports.jsx(Pds2Button,{title:"Grant Access",buttonColor:"pds2-bg-semantic-success",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_APPROVE)})]}),b.status==="GRANTED"&&jsxRuntimeExports.jsx(Pds2Button,{title:"Revoke Access",buttonColor:"pds2-bg-surface-danger",className:"pds2-w-full",onClick:()=>a(SCREEN_NAMES.CONSENT_REVOKE)})]})]}):jsxRuntimeExports.jsx(AbhaLoadingStatus,{})})},v$2="5.9.6",fr$2=30,ip$2=0,op$2=10,w$2=400,h$2=400,nm$2="Композиция 1",ddd$1=0,assets$2=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$2=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$2=[],animationDataLoading={v:v$2,fr:fr$2,ip:ip$2,op:op$2,w:w$2,h:h$2,nm:nm$2,ddd:ddd$1,assets:assets$2,layers:layers$2,markers:markers$2},v$1="5.9.6",fr$1=30,ip$1=0,op$1=50,w$1=400,h$1=400,nm$1="Композиция 1",ddd=0,assets$1=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$1=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$1=[],animationData$1={v:v$1,fr:fr$1,ip:ip$1,op:op$1,w:w$1,h:h$1,nm:nm$1,ddd,assets:assets$1,layers:layers$1,markers:markers$1},AbhaRejectionStatus=({loading:a=!1,loadingText:o,rejectText:_})=>jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center pds2-bg-surface-subtle",children:a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading,loop:!0,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-absolute pds2-mt-220",children:o})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationData$1,loop:!1,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-content-primary Heading4Semibold pds2-absolute pds2-mt-220",children:_})]})}),AbhaConsentDenyScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.abhaRequestConsentId),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!$){st({name:"abha_consent_deny_screen",data:{page_view:"abha_consent_request_page",platform:_,data:{flow:b,error_msg:"No consent ID found"}}}),console.error("No consent ID found");return}st({name:"abha_consent_revoke_triggered",data:{flow_step_type:"init",clientId:_,flow:b}});const rt=await postAbdmConsentDeny({consentId:$});if("success"in rt){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent deny success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_deny_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:ot,error:it,source_error:pt}=rt;et({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:_,flow:b,error_code:ot,error_msg:it,source_error:pt}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Denying...",rejectText:"Consent Denied Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})},AbhaConsentRevokeScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.consentApiBody),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),$(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!(et!=null&&et.consent_artefacts_id)){st({name:"abha_consent_revoke_screen",data:{page_view:"abha_consent_request_page",flow:b,platform:_,data:{error_msg:"No consent artefacts ids found"}}}),console.error("No consent artefacts ids found");return}const rt=await postAbdmConsentRevoke({consent_artefacts_ids:et==null?void 0:et.consent_artefacts_id});if("success"in rt){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent revoke success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_revoke_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:ot,error:it,source_error:pt}=rt;$({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_revoke_failed",data:{flow:b,flow_step_type:"init",clientId:_,error_code:ot,error_msg:it,source_error:pt}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Revoke in progress...",rejectText:"Consent Revoked Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})},AbhaConsentApproveScreen=()=>{const[a,o]=reactExports.useState(!0),_=useAuthAbhaStore(rt=>rt.clientId),b=useAuthAbhaStore(rt=>rt.initAbhaFlow),$=useAuthAbhaStore(rt=>rt.consentApiBody),_e=useAuthAbhaStore(rt=>rt.goBackLoginScreen),et=useAuthAbhaStore(rt=>rt.setBottomsheetErrorInfo),st=useTrackAbhaEvent(),tt=()=>{st({name:"abha_consent_approve_error_bottomsheet_dismissed",data:{platform:_,flow:b}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})},nt=async()=>{if(!$){st({name:"abha_consent_approve_screen",data:{page_view:"abha_consent_request_page",platform:_,data:{flow:b,error_msg:"No consent details found"}}}),console.error("No consent details found");return}const{consent_artefacts_id:rt,...ot}=$,it=await postAbdmConsentApprove({consentApprovePayload:ot});if("success"in it){console.log("Success"),o(!1),setTimeout(()=>{onConsentSuccess("Consent grant success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),st({name:"abha_consent_grant_success",data:{flow:b,flow_step_type:"init",clientId:_}});return}const{code:pt,error:ut,source_error:ht}=it;et({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),st({name:"abha_consent_grant_failed",data:{flow:b,flow_step_type:"init",clientId:_,error_code:pt,error_msg:ut,source_error:ht}})};return reactExports.useEffect(()=>{nt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:a,loadingText:"Grant in progress...",successText:"Consent Granted Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:tt})]})};function SelfAssessmentSDKIframe({src:a,mountConfig:o,iframeId:_="sa-sdk-iframe"}){const b=reactExports.useRef(null),$=reactExports.useRef(null);return reactExports.useEffect(()=>{var rt;const _e=b.current;if(!_e)return;$.current&&($.current.remove(),$.current=null);const et=document.createElement("iframe");$.current=et,et.id=_,et.style.width="100%",et.style.height="100%",et.style.border="0",_e.appendChild(et);const st=(rt=et.contentWindow)==null?void 0:rt.document;if(!st)return;const tt=`
|
|
66
66
|
<!doctype html>
|
|
67
67
|
<html>
|
|
68
68
|
<head><meta charset="utf-8"/></head>
|