1"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[6335],{66335:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var n=s(9950),a=s(73814),r=s(23849),l=s(56600),i=s(67117),o=s(99845),d=s(44414);const c={name:"Caregiver Training and Huduma Center LLC",short:"CNA Training Center",address:"30821 Pacific Hwy S, STE A, Federal Way, WA 98003",phone:"(206) 460-9022"},m="https://us-central1-hcastudentsreg.cloudfunctions.net";function h(e){let{delay:t}=e;return(0,n.useEffect)(()=>{const e=setTimeout(()=>{window.location.href="/"},t);return()=>clearTimeout(e)},[t]),null}function x(){const{token:e}=(0,a.g)(),{showAlert:t}=(0,o.M)(),[s,x]=(0,n.useState)(null),[u,g]=(0,n.useState)(!0),[b,y]=(0,n.useState)(null),[f,p]=(0,n.useState)(""),[j,N]=(0,n.useState)(!1),[w,v]=(0,n.useState)(!1),S=(0,n.useRef)(null),A=(0,n.useRef)(null);(0,n.useEffect)(()=>{T()},[e]),(0,n.useEffect)(()=>{if(s&&"pending"===s.status&&S.current&&!A.current){const e=S.current,t=Math.max(window.devicePixelRatio||1,1);e.width=e.offsetWidth*t,e.height=e.offsetHeight*t,e.getContext("2d").scale(t,t),A.current=new i.A(e,{backgroundColor:"rgb(255, 255, 255)",penColor:"rgb(0, 0, 0)"})}},[s]);const T=async()=>{try{g(!0);const t=(0,r.H9)(l.db,"paymentAgreements",e),s=await(0,r.x7)(t);if(!s.exists())return void y("Agreement not found. The link may be invalid or expired.");const n=s.data();if("signed"===n.status)return x(n),void v(!0);if(n.expiresAt&&n.expiresAt.toDate()<new Date)return void y("This agreement link has expired. Please contact the school for a new one.");x(n)}catch(t){console.error("Error loading agreement:",t),y("Failed to load agreement. Please try again.")}finally{g(!1)}},k=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e||0);if(u)return(0,d.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsxs)("svg",{className:"animate-spin h-10 w-10 text-blue-600 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,d.jsx)("p",{className:"text-gray-600",children:"Loading agreement..."})]})});if(b)return(0,d.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,d.jsxs)("div",{className:"bg-white rounded-xl shadow-lg max-w-md w-full p-8 text-center",children:[(0,d.jsx)("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,d.jsx)("svg",{className:"w-8 h-8 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,d.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Unable to Load Agreement"}),(0,d.jsx)("p",{className:"text-gray-600",children:b}),(0,d.jsxs)("p",{className:"text-sm text-gray-400 mt-4",children:["Contact: ",c.phone]})]})});if(w)return(0,d.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,d.jsxs)("div",{className:"bg-white rounded-xl shadow-lg max-w-md w-full p-8 text-center",children:[(0,d.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,d.jsx)("svg",{className:"w-8 h-8 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,d.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Agreement Signed Successfully"}),(0,d.jsxs)("p",{className:"text-gray-600 mb-4",children:["Thank you, ",null===s||void 0===s?void 0:s.studentName,". Your payment agreement has been signed and recorded. A copy has been sent to your email."]}),(0,d.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 text-sm text-gray-600 mb-4",children:[(0,d.jsx)("p",{className:"font-semibold text-gray-800 mb
1-1",children:c.name}),(0,d.jsx)("p",{children:c.address}),(0,d.jsx)("p",{children:c.phone})]}),(0,d.jsx)("p",{className:"text-xs text-gray-400",children:"You will be redirected shortly..."}),(0,d.jsx)(h,{delay:5e3})]})});const D=s.createdAt?new Date(new Date(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt)).getTime()+2592e6):new Date(Date.now()+2592e6);return(0,d.jsx)("div",{className:"min-h-screen bg-gray-100 py-6 px-4",children:(0,d.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,d.jsxs)("div",{className:"bg-white rounded-t-xl shadow-sm border-b-4 border-blue-700 p-6 text-center",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-14 h-14 bg-blue-700 text-white rounded-lg text-xl font-bold mb-3",children:"HC"}),(0,d.jsx)("h1",{className:"text-xl font-bold text-gray-900",children:c.name}),(0,d.jsxs)("p",{className:"text-sm text-gray-500",children:[c.address," | ",c.phone]})]}),(0,d.jsxs)("div",{className:"bg-white shadow-sm px-6 py-8 sm:px-10",children:[(0,d.jsx)("h2",{className:"text-2xl font-bold text-center text-gray-900 mb-1",children:"PAYMENT AGREEMENT"}),(0,d.jsx)("p",{className:"text-center text-sm text-gray-500 mb-8",children:"Tuition Balance Payment Terms"}),(0,d.jsxs)("div",{className:"prose prose-sm max-w-none text-gray-700 space-y-4",children:[(0,d.jsxs)("p",{children:['This Payment Agreement ("Agreement") is entered into as of'," ",(0,d.jsx)("strong",{children:(e=>{if(!e)return"N/A";return(e.toDate?e.toDate():new Date(e)).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})(s.createdAt)}),", by and between:"]}),(0,d.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-200",children:[(0,d.jsx)("p",{className:"font-semibold text-gray-900 mb-1",children:"Institution:"}),(0,d.jsx)("p",{children:c.name}),(0,d.jsx)("p",{className:"text-sm",children:c.address})]}),(0,d.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-200",children:[(0,d.jsx)("p",{className:"font-semibold text-gray-900 mb-1",children:"Student:"}),(0,d.jsx)("p",{children:s.studentName}),s.studentEmail&&(0,d.jsx)("p",{className:"text-sm",children:s.studentEmail})]}),(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900 mt-6",children:"1. OUTSTANDING BALANCE"}),(0,d.jsxs)("p",{children:["The Student acknowledges an outstanding tuition balance of"," ",(0,d.jsx)("strong",{className:"text-red-700",children:k(s.outstandingBalance)})," ",'("Balance") owed to the Institution for educational services rendered.']}),(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"2. PAYMENT TERMS"}),(0,d.jsxs)("p",{children:["The Student agrees to pay the full outstanding Balance within"," ",(0,d.jsx)("strong",{children:"thirty (30) days"})," from the date of this Agreement, which is by"," ",(0,d.jsx)("strong",{children:D.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})," ",'("Due Date").']}),(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"3. INTEREST ON LATE PAYMENT"}),(0,d.jsxs)("p",{children:["If the Balance is not paid in full by the Due Date, the unpaid amount shall accrue interest at a rate of"," ",(0,d.jsx)("strong",{children:"fifteen percent (15%) per month"}),", compounded monthly, beginning from the Due Date until the Balance is paid in full."]}),(0,d.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"font-semibold text-amber-800 mb-2",children:"Interest Calculation Example:"}),(0,d.jsxs)("p",{className:"text-sm text-amber-700",children:["If the outstanding balance of ",k(s.outstandingBalance)," remains unpaid after 30 days:"]}),(0,d.jsxs)("ul",{className:"text-sm text-amber-700 mt-2 space-y-1",children:[(0,d.jsxs)("li",{children:["After 1 month: ",k(1.15*s.outstandingBalance)]}),(0,d.jsxs)("li",{children:["After 2 months: ",k(1.15*s.outstandingBalance*1.15)]}),(0,d.jsxs)("li",{children:["After 3 months: ",k(1.15*s.outstandingBalance*1.15*1.15)]})]})]}),(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"4. PAYMENT METHODS"}),(0,d.jsx)("p",{children:"Payments may be made via cash, check, money order, credit/debit card, or online at the school's payment portal. All payments shall be directed to the Institution at the address listed above or through the approved online payment system."}),(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"5. ACKNOWLEDGMENT"}
1),(0,d.jsx)("p",{children:"By signing below, the Student acknowledges that they have read, understood, and agree to the terms of this Payment Agreement. The Student further acknowledges that failure to pay the outstanding Balance by the Due Date will result in interest charges as described in Section 3 above."}),(0,d.jsx)("p",{children:"The Student also acknowledges that this Agreement does not waive any other rights or remedies available to the Institution for the collection of the outstanding Balance, including but not limited to withholding of certificates and transcripts."})]}),(0,d.jsxs)("div",{className:"mt-10 border-t-2 border-gray-200 pt-8",children:[(0,d.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-6 text-center",children:"STUDENT SIGNATURE"}),(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Type Your Full Legal Name ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("input",{type:"text",value:f,onChange:e=>p(e.target.value),placeholder:"Enter your full legal name",className:"w-full border-2 border-gray-300 rounded-lg px-4 py-3 text-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"})]}),(0,d.jsxs)("div",{className:"mb-4",children:[(0,d.jsxs)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Sign Below (use your finger or mouse) ",(0,d.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,d.jsx)("div",{className:"border-2 border-gray-300 rounded-lg overflow-hidden bg-white",children:(0,d.jsx)("canvas",{ref:S,className:"w-full touch-none",style:{height:"200px"}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,d.jsx)("p",{className:"text-xs text-gray-400",children:"Draw your signature in the box above"}),(0,d.jsx)("button",{onClick:()=>{A.current&&A.current.clear()},className:"text-xs text-red-600 hover:text-red-800 font-semibold",children:"Clear Signature"})]})]}),(0,d.jsxs)("div",{className:"mb-8",children:[(0,d.jsx)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Date"}),(0,d.jsx)("div",{className:"bg-gray-100 rounded-lg px-4 py-3 text-gray-800 font-medium",children:(new Date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),(0,d.jsx)("button",{onClick:async()=>{if(f.trim())if(A.current&&!A.current.isEmpty()){N(!0);try{const t=A.current.toDataURL("image/png"),n=(new Date).toISOString(),a=await fetch(`${m}/submitSignedAgreement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,fullName:f.trim(),signatureImage:t,signedDate:n})}),r=await a.json();var s;if(!a.ok)throw new Error((null===(s=r.error)||void 0===s?void 0:s.message)||"Failed to submit agreement");v(!0),x(e=>({...e,status:"signed"}))}catch(n){console.error("Error submitting agreement:",n),t(n.message||"Failed to submit. Please try again.",{type:"error",title:"Submission Failed"})}finally{N(!1)}}else t("Please provide your signature.",{type:"warning",title:"Signature Required"});else t("Please type your full legal name.",{type:"warning",title:"Name Required"})},disabled:j||!f.trim(),className:"w-full py-4 text-lg font-bold text-white bg-blue-700 rounded-xl hover:bg-blue-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",children:j?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Submitting Agreement..."]}):"Sign & Submit Agreement"}),(0,d.jsx)("p",{className:"text-xs text-center text-gray-400 mt-4",children:'By clicking "Sign & Submit Agreement", you agree to be bound by the terms of this Payment Agreement. A signed copy will be sent to your email.'})]})]}),(0,d.jsx)("div",{className:"bg-gray-800 rounded-b-xl p-4 text-center",children:(0,d.jsxs)("p",{className:"text-xs text-gray-400",children:[c.name," | ",c.address," | ",c.phone]})})]})})}}}]);
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.