1import{e as T,m as j,q as S,A as U,x as o,k as $,b1 as q,y as I,B,c as i,o as l,a as t,b as s,f as r,F as z,d as u,t as x,b2 as L,w as g,g as M,H,j as R,b3 as Y,J as G}from"#entry";import{_ as J}from"./CXVszHqz.js";import{_ as O}from"./DlP9uqBQ.js";import{_ as W}from"./DjoTwymE.js";import{C as K}from"./DBr935Js.js";import{_ as Q}from"./1681sehF.js";import"./C3DONDKa.js";import"./kC3kxybx.js";import"./D5Td5aVQ.js";import"./CvtDo0MO.js";import"./Dmhids7v.js";import"./BBoVSIOO.js";import"./Ltqd2rAr.js";import"./DippbqLN.js";import"./DcGhxoNh.js";import"./DlAUqK2U.js";const X={class:"min-h-screen bg-[#F6F8FA]"},Z={class:"fixed top-0 left-0 right-0 z-50 bg-white border-b border-[#E2E4E9] px-6 py-4"},ee=["src","alt"],te={key:0,class:"flex items-center justify-center min-h-[60vh]"},se={class:"text-center space-y-4"},ne={key:1,class:"flex items-center justify-center min-h-[60vh]"},ae={class:"text-center space-y-4 max-w-md px-6"},oe={class:"w-16 h-16 rounded-full bg-red-50 border-2 border-red-200 flex items-center justify-center mx-auto"},ie={key:2,class:"flex items-center justify-center min-h-[60vh]"},le={class:"text-center space-y-4 max-w-md px-6"},re={class:"w-16 h-16 rounded-full bg-[#FEFDEA] border-2 border-[#FEF08A] flex items-center justify-center mx-auto"},de={key:3,class:"flex items-center justify-center min-h-[60vh]"},me={class:"text-center space-y-4 max-w-md px-6"},ue={class:"w-16 h-16 rounded-full bg-red-50 border-2 border-red-200 flex items-center justify-center mx-auto"},ce={key:4,class:"flex items-center justify-center min-h-[60vh]"},pe={class:"text-center space-y-4 max-w-md px-6"},xe={class:"w-16 h-16 rounded-full bg-green-50 border-2 border-green-200 flex items-center justify-center mx-auto"},ge={class:"text-base text-[#525866]"},fe={class:"font-bold text-[#0A0D14]"},ve={key:5,class:"max-w-3xl mx-auto px-4 sm:px-6 py-8 sm:py-12"},be={class:"bg-white rounded-2xl border border-[#E2E4E9] p-6 sm:p-10"},ye={class:"mt-2 mb-6 text-base text-[#525866]"}
1,he={class:"border rounded-3xl border-[#E2E4E9] px-6 pb-3"},_e={class:"mt-6 max-h-48 overflow-y-auto rounded-xl border border-[#E2E4E9] bg-[#F1F5F9] p-5 text-sm text-neutral-600"},ke={class:"grid grid-cols-1 sm:grid-cols-2 gap-6 text-left"},we={class:"space-y-1"},Ae={class:"text-base font-bold text-neutral-900 leading-tight"},Ee={class:"text-sm font-normal leading-[143%] text-neutral-500"},Fe={class:"font-bold text-[#0A0D14]"},De={key:0,class:"text-sm text-red-600",role:"alert"},Ne={class:"mt-6 flex flex-col gap-2"},Ge=T({__name:"sign-policy",setup(Ce){const b=j(),F=S(),f=U(()=>F.query.token||""),y=o(!0),_=o(!1),v=o(!1),k=o(!1),h=o(!1),c=o(""),{mutate:D,loading:w}=$(q),p=o(""),A=o(""),a=I({accepted:!1,signatureName:""});async function N(){if(!f.value){y.value=!1;return}try{const{clients:d}=R(),{data:e}=await d.default.query({query:Y,variables:{token:f.value},fetchPolicy:"network-only"}),n=e?.validateSigningToken;if(!n){v.value=!0;return}if(n.expired){_.value=!0;return}if(!n.valid){v.value=!0;return}p.value=n.hospital_name||"Your Organisation",A.value=n.signer_name||"",a.signatureName=A.value}catch(d){console.error("Failed to validate signing token",d),v.value=!0}finally{y.value=!1}}async function C(){if(c.value="",!a.accepted||!a.signatureName.trim()){c.value="Enter your full name and accept the agreement to continue.";return}try{if(!(await D({token:f.value}))?.data?.signPolicy?.success)throw new Error("Signing was not confirmed");k.value=!0,G({title:"Agreement signed",description:"Thank you for signing the Data Processing Agreement.",color:"success"})}catch(d){console.error("Failed to sign policy",d),c.value="Unable to sign the agreement. Please try again or contact the administrator."}}return B(()=>{N()}),(d,e)=>{const n=z,E=J,P=O,V=W;return l(),i("div",X,[t("header",Z,[t("img",{src:r(b).label.logo,alt:`${r(b).label.name}`,class:"h-9 w-auto"},null,8,ee)]),e[24]||(e[24]=t("div",{class:"pt-[65px]"},null,-1)),y.value?(l(),i("div",te,[t("div",se,[s(n,{name:"i-ri-loader-4-line",class:"w-10 h-10 text-primary animate-spin"}),e[4]||(e[4]=t("p",{class:"text-base text-[#525866]"}," Validating your signing link⦠",-1))])])):r(f)?_.value?(l(),i("div",ie,[t("div",le,[t("div",re,[s(n,{name:"i-ri-time-line",class:"w-8 h-8 text-[#A16207]"})]),e[7]||(e[7]=t("h2",{class:"text-2xl font-semibold text-[#0A0D14]"}," Link Expired ",-1)),e[8]||(e[8]=t("p",{class:"text-base text-[#525866]"}," This signing link has expired. Please contact the hospital administrator to request a new one. ",-1))])])):v.value?(l(),i("div",de,[t("div",me,[t("div",ue,[s(n,{name:"i-ri-close-circle-line",class:"w-8 h-8 text-red-500"})]),e[9]||(e[9]=t("h2",{class:"text-2xl font-semibold text-[#0A0D14]"}," Invalid Link ",-1)),e[10]||(e[10]=t("p",{class:"text-base text-[#525866]"}," This signing link is no longer valid. It may have already been used. Please contact the hospital administrator if you need a new link. ",-1))])])):k.value?(l(),i("div",ce,[t("div",pe,[t("div",xe,[s(n,{name:"i-ri-checkbox-circle-line",class:"w-8 h-8 text-green-600"})]),e[13]||(e[13]=t("h2",{class:"text-2xl font-semibold text-[#0A0D14]"}," Agreement Signed ",-1)),t("p",ge,[e[11]||(e[11]=u(" The Data Processing Agreement for ",-1)),t("span",fe,x(p.value),1),e[12]||(e[12]=u(" has been signed successfully. You may close this page. ",-1))])])])):(l(),i("main",ve,[t("div",be,[e[23]||(e[23]=t("h1",{class:"text-[32px] font-semibold text-[#0A0D14]"}," Data Processing Agreement ",-1)),t("p",ye," Review and sign the agreement between your organisation and "+x(r(b).label.pwa.shortName)+". ",1),t("div",he,[t("div",_e,[e[18]||(e[18]=t("h3",{class:"font-bold text-neutral-900 mb-4 text-base"}," Parties to this Agreement ",-1)),t("div",ke,[t("div",we,[e[14]||(e[14]=t("h4",{class:"text-xs font-medium text-neutral-400"}," Data Controller ",-1)),t("p",Ae,x(p.value),1),e[15]||(e[15]=t("p",{class:"text-sm text-neutral-400"}," [Company Address] ",-1)),e[16]||(e[16]=t("p",{class:"text-sm text-neutral-400"}," [Company number] ",-1))]),e[17]||(e[17]=L('<div class="space-y-1"><h4 class="text-xs font-medium text-neutral-400"> Data Processor </h4><p class="text-base font-bold text-neutral-900 leading-tight"> Sevenz HealthCare </p><p class="text-sm text-neutral-400 leading-normal">
1 1st Floor, UAC Building, Central Business District, Garki, Abuja, FCT, Nigeria. </p><p class="text-sm text-neutral-400 leading-normal"> +234 (0) 817 4290 703, +234 (0) 817 4290 702. </p></div>',1))])]),t("button",{type:"button",class:"mt-3 text-sm font-medium text-primary hover:underline flex items-center cursor-pointer gap-1",onClick:e[0]||(e[0]=m=>h.value=!0)},[e[19]||(e[19]=u(" View full agreement ",-1)),s(n,{name:"i-ri-external-link-line",class:"w-4 h-4"})]),s(V,{state:a,class:"mt-5 space-y-5",onSubmit:C},{default:g(()=>[s(E,{name:"signatureName",required:"",class:"text-sm font-normal leading-[143%] tracking-[-0.084px] text-[#0A0D14]"},{default:g(()=>[s(r(K),{modelValue:a.signatureName,"onUpdate:modelValue":e[1]||(e[1]=m=>a.signatureName=m),placeholder:"Enter full name",label:"Type your full name as e-signature",required:"",size:"xl",class:"w-full"},null,8,["modelValue"])]),_:1}),s(E,{name:"accepted",class:"mt-5"},{default:g(()=>[s(P,{modelValue:a.accepted,"onUpdate:modelValue":e[2]||(e[2]=m=>a.accepted=m)},{label:g(()=>[t("span",Ee,[e[20]||(e[20]=u(" I have read and understood the Data Processing Agreement and accept its terms on behalf of ",-1)),t("span",Fe,x(p.value),1),e[21]||(e[21]=u(". ",-1))])]),_:1},8,["modelValue"])]),_:1}),c.value?(l(),i("p",De,x(c.value),1)):M("",!0),t("div",Ne,[s(r(H),{type:"submit",block:"",size:"xl",loading:r(w),disabled:r(w)||!a.accepted||!a.signatureName.trim()},{default:g(()=>[...e[22]||(e[22]=[u(" Accept Agreement ",-1)])]),_:1},8,["loading","disabled"])])]),_:1},8,["state"])])])])):(l(),i("div",ne,[t("div",ae,[t("div",oe,[s(n,{name:"i-ri-error-warning-line",class:"w-8 h-8 text-red-500"})]),e[5]||(e[5]=t("h2",{class:"text-2xl font-semibold text-[#0A0D14]"}," Invalid Link ",-1)),e[6]||(e[6]=t("p",{class:"text-base text-[#525866]"}," This signing link is missing a valid token. Please check the link in your email and try again. ",-1))])])),s(Q,{open:h.value,"onUpdate:open":e[3]||(e[3]=m=>h.value=m),"hospital-name":p.value},null,8,["open","hospital-name"])])}}});export{Ge as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.