PageSourceSearch

https://hudumacna.com/static/js/2746.0b591f84.chunk.js

js hudumacna.com collected 2026-10-09 22:40:33 UTC 37,456 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[2746],{52620:(e,t,s)=>{s.d(t,{A:()=>n});var a=s(9950),r=s(44414);const n=e=>{let{value:t,onChange:s,preview:n,onPreviewChange:o,className:i=""}=e;const[l,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)(""),u=(0,a.useRef)(null),x=(0,a.useRef)(null),h=e=>{const t=(e=>e.type.startsWith("image/")?e.size>5242880?"File size must be less than 5MB":null:"Please select an image file")(e);if(t)return void m(t);m(""),s({target:{value:e}});const a=new FileReader;a.onload=e=>{o(e.target.result)},a.readAsDataURL(e)},p=e=>{const t=e.target.files[0];t&&h(t)},g=()=>{var e;null===(e=u.current)||void 0===e||e.click()};return(0,r.jsxs)("div",{className:`space-y-4 ${i}`,children:[n&&(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)("div",{className:"bg-gray-50 rounded-xl p-4 border border-gray-200",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("img",{src:n,alt:"Photo preview",className:"mx-auto rounded-lg shadow-sm max-h-64 w-auto"}),(0,r.jsxs)("div",{className:"mt-4 flex justify-center space-x-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{s({target:{value:null}}),o(null),m(""),u.current&&(u.current.value=""),x.current&&(x.current.value="")},className:"inline-flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-500 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Remove Photo"]}),(0,r.jsxs)("button",{type:"button",onClick:g,className:"inline-flex items-center px-4 py-2 border border-blue-300 rounded-md shadow-sm text-sm font-medium text-blue-700 bg-white hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),"Change Photo"]})]})]})})}),!n&&(0,r.jsx)("div",{className:`\n            relative border-2 border-dashed rounded-xl p-8 text-center transition-all duration-200\n            ${l?"border-blue-400 bg-blue-50":"border-gray-300 hover:border-gray-400 bg-gray-50"}\n          `,onDragOver:e=>{e.preventDefault(),d(!0)},onDragLeave:e=>{e.preventDefault(),d(!1)},onDrop:e=>{e.preventDefault(),d(!1);const t=e.dataTransfer.files;t.length>0&&h(t[0])},children:(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"mx-auto w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-600 rounded-full flex items-center justify-center",children:(0,r.jsxs)("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Upload Your Photo"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"We need a clear photo of you for identification purposes"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Drag and drop your photo here, or use the buttons below"})]}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{var e;null===(e=x.current)||void 0===e||e.click()},className:"inline-flex items-center justify-center px-6 py-3 border border-transparent roun
1ded-lg shadow-sm text-sm font-medium text-white bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition-all duration-200",children:[(0,r.jsxs)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Take Photo"]}),(0,r.jsxs)("button",{type:"button",onClick:g,className:"inline-flex items-center justify-center px-6 py-3 border border-gray-300 rounded-lg shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all duration-200",children:[(0,r.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),"Upload File"]})]})]})}),c&&(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-red-400 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsx)("span",{className:"text-sm text-red-700",children:c})]})}),(0,r.jsx)("input",{ref:u,type:"file",accept:"image/*",onChange:p,className:"hidden"}),(0,r.jsx)("input",{ref:x,type:"file",accept:"image/*",capture:"user",onChange:p,className:"hidden"}),(0,r.jsxs)("div",{className:"bg-blue-50 rounded-lg p-4 border border-blue-100",children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:"Photo Requirements:"}),(0,r.jsxs)("ul",{className:"text-xs text-blue-800 space-y-1",children:[(0,r.jsx)("li",{children:"\u2022 Clear, well-lit photo of your face"}),(0,r.jsx)("li",{children:"\u2022 Looking directly at the camera"}),(0,r.jsx)("li",{children:"\u2022 No sunglasses or hats"}),(0,r.jsx)("li",{children:"\u2022 File size must be less than 5MB"}),(0,r.jsx)("li",{children:"\u2022 Supported formats: JPG, PNG, GIF"})]})]})]})}},52746:(e,t,s)=>{s.r(t),s.d(t,{default:()=>J});var a=s(9950),r=s(73814),n=s(56600),o=s(387),i=s(48805),l=s(2765),d=s(63421),c=s(71572),m=s(83375),u=s(44414);const x=e=>{let{type:t="info",message:s,onClose:a}=e;const r={success:{icon:l.A,classes:"bg-green-50 text-green-800 border-green-200",iconColor:"text-green-400"},error:{icon:d.A,classes:"bg-red-50 text-red-800 border-red-200",iconColor:"text-red-400"},warning:{icon:c.A,classes:"bg-yellow-50 text-yellow-800 border-yellow-200",iconColor:"text-yellow-400"},info:{icon:m.A,classes:"bg-blue-50 text-blue-800 border-blue-200",iconColor:"text-blue-400"}},{icon:n,classes:o,iconColor:i}=r[t];return(0,u.jsx)("div",{className:`p-4 rounded-md border ${o} relative`,role:"alert",children:(0,u.jsxs)("div",{className:"flex",children:[(0,u.jsx)("div",{className:"flex-shrink-0",children:(0,u.jsx)(n,{className:`h-5 w-5 ${i}`,"aria-hidden":"true"})}),(0,u.jsx)("div",{className:"ml-3",children:(0,u.jsx)("p",{className:"text-sm font-medium",children:s})}),a&&(0,u.jsx)("div",{className:"ml-auto pl-3",children:(0,u.jsxs)("button",{type:"button",className:`inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2 ${o}`,onClick:a,children:[(0,u.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,u.jsx)(d.A,{className:"h-5 w-5","aria-hidden":"true"})]})})]})})};var h=s(52620),p=s(54235);const{SCHOOL_INFO:g,COLORS:b,FONTS:f,PAGE_SETTINGS:v,addLetterhead:y,addFooter:j,addSectionHeader:N,addInfoBox:w,addProfessionalTable:C,addSummaryCard:F}=p.Ay;var S=s(17638),D=s(73601),A=s(674),k=s(78010),q=s(67952),L=s(57491),E=s(15536),O=s(82777),P=s(33720),R=s(48996),I=s(64112),B=s(35320),T=s(90045),$=s(37619),M=s(4294),W=s(35191),_=s(43302),H=s(73214),U=s(55556);const z={"cna-traditional":{name:"CNA Traditional",classDays:20,hours:108},"hca-cna-bridge":{name:"HCA\u2013CNA Bridge",classDays:5,hours:40}},G=a.memo(e=>{let{label:t,name:s,type:r="text",value:n,onChange:o,required:i=!1,placeholder:l,options:d,icon:c,description:x}=e;const[h,p]=(0,a.useState)(!1),g=n&&""!==n.toString().trim();return"select"===r?(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsxs)("label",{className:"flex items-center space-x-2 text-sm font-semibold text-gray-800",children:[c&&(0,u.jsx)(c,{className:"h-4 w-4 text-blue-600"}),(0,u.jsx)("span",{children:t}),i&&(0,u.jsx)("span",{className:"text-red-500 text-xs",children:"*"})]}),x&&(0,u.jsxs)("p",{className:"text-xs text-gray-500 flex items-center space-x-1",children:[(0,u.jsx)(m.A,{className:"h-3 w-3"}),(0,u.jsx)("span",{children:x})]}),(0,u.jsxs)("div",{className:"relative",children:[(0,u.jsx)("select",{name:s,value:n,onChange:o,className:"w-full px-4 py-3 pl-10 border-2 border-gray-200 rounded-xl focus:ring-4 focus:ring-blue-100 focus:border-blue-500 transition-all duration-200 appearance-none bg-white text-gray-900 font-medium",required:i,onFocus:()=>p(!0),onBlur:()=>p(!1),children:d.map(e=>(0,u.jsx)("option",{value:e.value,children:e.label},e.value))}),c&&(0,u.jsx)(c,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 transition-colors duration-200 "+(h||g?"text-blue-600":"text-gray-400")})]})]}):(0,u.jsxs)("div",{className:"space-y-2",children:[(0,u.jsxs)("label",{className:"flex items-center space-x-2 text-sm font-semibold text-gray-800",children:[c&&(0,u.jsx)(c,{className:"h-4 w-4 text-blue-600"}),(0,u.jsx)("span",{children:t}),i&&(0,u.jsx)("span",{className:"text-red-500 text-xs",children:"*"})]}),x&&(0,u.jsxs)("p",{className:"text-xs text-gray-500 flex items-center space-x-1",children:[(0,u.jsx)(m.A,{className:"h-3 w-3"}),(0,u.jsx)("span",{children:x})]}),(0,u.jsxs)("div",{className:"relative",children:[(0,u.jsx)("input",{type:r,name:s,value:n,onChange:o,className:"w-full px-4 py-3 pl-10 border-2 border-gray-200 rounded-xl focus:ring-4 focus:ring-blue-100 focus:border-blue-500 transition-all duration-200 text-gray-900 font-medium placeholder-gray-400",required:i,placeholder:l,onFocus:()=>p(!0),onBlur:()=>p(!1)}),c&&(0,u.jsx)(c,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 transition-colors duration-200 "+(h||g?"text-blue-600":"text-gray-400")})]})]})}),V=a.memo(e=>{let{formData:t,configuration:s,onChange:a,onCustomFeeChange:r,onAddCustomFee:n,onRemoveCustomFee:o}=e;const i=((null===s||void 0===s?void 0:s.optionalServices)||[]).filter(e=>e.enabled);return(0,u.jsxs)("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 p-6 rounded-2xl border border-blue-100 space-y-6",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,u.jsx)("div",{className:"p-2 bg-blue-600 rounded-lg",children:(0,u.jsx)(k.A,{className:"h-6 w-6 text-white"})}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Optional Services & Fees"}),(0,u.jsx)("p",{className:"text-sm text-gray-600",children:"Select additional services you need"})]})]}),(0,u.jsx)("div",{className:"space-y-4",children:i.map(e=>(0,u.jsx)("div",{className:"bg-white p-4 rounded-xl border border-gray-200 hover:border-blue-300 transition-all duration-200",children:(0,u.jsxs)("div",{className:"flex items-start justify-between",children:[(0,u.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,u.jsx)("input",{type:"checkbox",id:e.id,name:`selectedServices.${e.id}`,checked:t.selectedServices[e.id]||!1,onChange:a,className:"mt-1 h-5 w-5 text-blue-600 focus:ring-blue-500 border-gray-300 rounded-md"}),(0,u.jsxs)("div",{className:"flex-1",children:[(0,u.jsx)("label",{htmlFor:e.id,className:"block text-sm font-semibold text-gray-900 cursor-pointer",children:e.name}),(0,u.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:e.description})]})]}),(0,u.jsxs)("div",{className:"text-right",children:[(0,u.jsx)("span",{className:"text-lg font-bold text-green-600",children:(0,A.s$)(e.price)}),(0,u.jsx)("p",{className:"text-xs text-gray-500",children:"one-time"})]})]})},e.id))}),(0,u.jsxs)("div",{className:"border-t border-blue-200 pt-6",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)(q.A,{className:"h-5 w-5 text-indigo-600"}),(0,u.jsx)("h4",{className:"text-lg font-semibold text-gray-900",children:"Additional Custom Fees"})]}),(0,u.jsxs)("button",{type:"button",onClick:n,className:"group flex items-center space-x-2 px-4 py-2 bg-gradient-to-r from-indigo-500 to-purple-600 hover:from-indigo-600 hover:to-purple-700 text-white font-medium rounded-xl shadow-lg hover:shadow-xl transform hover:scale-105 transition-all duration-200",children:[(0,u.jsx)(L.A,{className:"h-4 w-4 group-hover:rotate-90 transition-transform duration-200"}),(0,u.jsx)("span",{children:"Add Custom Fee"})]})]}),t.customFees&&t.customFees.length>0&&(0,u.jsx)("div",{className:"space-y-3",children:t.customFees.map((e,t)=>(0,u.jsxs)("div",{className:"bg-white p-4 rounded-xl border border-indigo-200",children:[(0,u.jsx)("div",{className:"flex items-center space-x-3",children:(0,u.jsxs)("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,u.jsx)("input",{type:"text",placeholder:"Fee name (e.g., Study Materials)",value:e.name,onChange:e=>r(t,"name",e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm"}),(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)("span",{className:"text-gray-500 font-medium",children:"$"}),(0,u.jsx)("input",{type:"number",placeholder:"Amount",value:e.amount,onChange:e=>r(t,"amount",parseFloat(e.target.value)||0),className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm",min:"0",step:"0.01"}),(0,u.jsx)("button",{type:"button",onClick:()=>o(t),className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors duration-200",children:(0,u.jsx)(E.A,{className:"h-4 w-4"})})]})]})}),(0,u.jsx)("input",{type:"text",placeholder:"Description (optional)",value:e.description,onChange:e=>
1r(t,"description",e.target.value),className:"w-full mt-3 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm"})]},t))}),(!t.customFees||0===t.customFees.length)&&(0,u.jsxs)("div",{className:"text-center py-6 text-gray-500",children:[(0,u.jsx)(O.A,{className:"h-8 w-8 mx-auto mb-2 text-gray-400"}),(0,u.jsx)("p",{className:"text-sm",children:"No custom fees added yet"}),(0,u.jsx)("p",{className:"text-xs",children:'Click "Add Custom Fee" to include additional services'})]})]})]})}),Z=a.memo(e=>{var t,s;let{formData:a,pricing:r,calculateTotal:n}=e;const o=(0,A.PE)(r,a.programId),i=(null===r||void 0===r||null===(t=r.programs)||void 0===t||null===(s=t.find(e=>e.id===a.programId))||void 0===s?void 0:s.name)||"CNA Program",d=a.accommodationDetails.required?r.accommodationFee:0;return(0,u.jsxs)("div",{className:"bg-gradient-to-br from-green-50 to-emerald-50 border-2 border-green-200 p-6 rounded-2xl",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,u.jsx)("div",{className:"p-2 bg-green-600 rounded-lg",children:(0,u.jsx)(l.A,{className:"h-6 w-6 text-white"})}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Payment Summary"}),(0,u.jsx)("p",{className:"text-sm text-gray-600",children:"Review your total investment"})]})]}),(0,u.jsxs)("div",{className:"space-y-3 mb-6",children:[(0,u.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-green-200",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)(P.A,{className:"h-4 w-4 text-green-600"}),(0,u.jsxs)("span",{className:"font-medium text-gray-700",children:[i," tuition"]})]}),(0,u.jsx)("span",{className:"font-bold text-gray-900",children:(0,A.s$)(o)})]}),d>0&&(0,u.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-green-200",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)(R.A,{className:"h-4 w-4 text-green-600"}),(0,u.jsx)("span",{className:"font-medium text-gray-700",children:"Accommodation"})]}),(0,u.jsx)("span",{className:"font-bold text-gray-900",children:(0,A.s$)(d)})]}),((null===r||void 0===r?void 0:r.optionalServices)||[]).filter(e=>e.enabled&&a.selectedServices[e.id]).map(e=>(0,u.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-green-200",children:[(0,u.jsx)("span",{className:"text-sm text-gray-600 ml-6",children:e.name}),(0,u.jsx)("span",{className:"font-medium text-gray-900",children:(0,A.s$)(e.price)})]},e.id)),a.customFees&&a.customFees.map((e,t)=>e.name&&e.amount>0&&(0,u.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-green-200",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)(q.A,{className:"h-4 w-4 text-green-600"}),(0,u.jsx)("span",{className:"text-sm text-gray-600",children:e.name})]}),(0,u.jsx)("span",{className:"font-medium text-gray-900",children:(0,A.s$)(e.amount)})]},t))]}),(0,u.jsxs)("div",{className:"bg-white p-4 rounded-xl border border-green-300",children:[(0,u.jsxs)("div",{className:"flex justify-between items-center",children:[(0,u.jsx)("span",{className:"text-lg font-bold text-gray-900",children:"Total Investment"}),(0,u.jsx)("span",{className:"text-2xl font-bold text-green-600",children:(0,A.s$)(n())})]}),(0,u.jsxs)("p",{className:"text-xs text-gray-500 mt-2 flex items-center space-x-1",children:[(0,u.jsx)(m.A,{className:"h-3 w-3"}),(0,u.jsx)("span",{children:"Flexible payment plans available after registration"})]})]})]})}),J=a.memo(e=>{let{onTabChange:t=()=>{}}=e;const{showLoading:s,hideLoading:d,showError:c,showSuccess:m}=(0,o.nm)(),p=(0,r.Zp)(),[g,b]=(0,a.useState)({programId:"cna-traditional",fullName:"",phoneNumber:"",email:"",emergencyContact:"",countryOfOrigin:"",address:{addressLine1:"",addressLine2:"",city:"",state:"",postalCode:"",country:"United States"},gender:"",dateOfBirth:"",courseStartDate:"",accommodationDetails:{required:!1},optionalFees:{narRegistration:!1,stateExamRegistration:!1,stateExamFee:!1},selectedServices:{},customFees:[]}),[f,v]=(0,a.useState)(!1),[y,j]=(0,a.useState)({text:"",type:""}),[N,w]=(0,a.useState)(!1),[C,F]=(0,a.useState)(1),[k,q]=(0,a.useState)(null),[L,E]=(0,a.useState)(""),[O,J]=(0,a.useState)(null),[Y,K]=(0,a.useState)(null),Q=(null===k||void 0===k?void 0:k.prices)||A.jT,X=(0,a.useMemo)(()=>((null===k||void 0===k?void 0:k.programs)||[]).filter(e=>e.enabled),[k]),ee=X.find(e=>e.id===g.programId)||z[g.programId]||z["cna-traditional"],te=(0,A.PE)({...Q,programs:null===k||void 0===k?void 0:k.programs},g.programId),se=(0,a.useCallback)(async()=>{E("");try{q(await(0,A.Sc)({fresh:!0}))}catch(e){E(e.message||"Registration pricing is temporarily unavailable.")}},[]);(0,a.useEffect)(()=>{se()},[se]),(0,a.useEffect)(()=>{X.length&&!X.some(e=>e.id===g.programId)&&b(e=>({...e,programId:X[0].id}))},[X,g.programId]);const ae=(0,a.useMemo)(()=>[{value:"",label:"Select Gender"},{value:"Male",label:"Male"},{value:"Female",label:"Female"},{value:"Other",label:"Other"}],[]),re=(0,a.useCallback)(()=>{b(e=>({...e,customFees:[...e.customFees||[],{name:"",amount:0,description:""}]}))},[]),ne=(0,a.useCallback)(e=>{b(t=>({...t,customFees:t.customFees.filter((t,s)=>s!==e)}))},[]),oe=(0,a.useCallback)((e,t,s)=>{b(a=>({...a,customFees:a.customFees.map((a,r)=>
1r===e?{...a,[t]:s}:a)}))},[]),ie=(0,a.useCallback)(e=>{const{name:t,value:s,type:a,checked:r}=e.target;if(t.startsWith("selectedServices.")){const e=t.split(".")[1];b(t=>({...t,selectedServices:{...t.selectedServices,[e]:r}}))}else if(t.startsWith("optionalFees.")){const e=t.split(".")[1];b(t=>({...t,optionalFees:{...t.optionalFees,[e]:r}}))}else if(t.startsWith("address.")){const e=t.split(".")[1];b(t=>({...t,address:{...t.address,[e]:s}}))}else b("checkbox"===a&&"accommodationDetails.required"===t?e=>({...e,accommodationDetails:{...e.accommodationDetails,required:r}}):e=>({...e,[t]:s}))},[]),le=(0,a.useCallback)(()=>{let e=te;return g.accommodationDetails.required&&(e+=Q.accommodationFee),g.optionalFees.narRegistration&&(e+=Q.narRegistrationFee),g.optionalFees.stateExamRegistration&&(e+=Q.stateExamRegistrationFee),g.optionalFees.stateExamFee&&(e+=Q.stateExamFee),((null===k||void 0===k?void 0:k.optionalServices)||[]).forEach(t=>{t.enabled&&g.selectedServices[t.id]&&(e+=Number(t.price)||0)}),g.customFees&&g.customFees.forEach(t=>{t.amount&&t.amount>0&&(e+=t.amount)}),e},[g.accommodationDetails.required,g.optionalFees,g.selectedServices,g.customFees,Q,te,k]),de=(0,a.useCallback)(()=>{var e,t,s,a,r,n,o,i,l,d;const c=[];return g.fullName.trim()||c.push("Full Name is required"),X.some(e=>e.id===g.programId)||c.push("Choose a valid CNA program"),g.phoneNumber.trim()||c.push("Phone Number is required"),g.email.trim()||c.push("Email is required"),g.emergencyContact.trim()||c.push("Emergency Contact is required"),g.countryOfOrigin.trim()||c.push("Country of Origin is required"),null!==(e=g.address)&&void 0!==e&&null!==(t=e.addressLine1)&&void 0!==t&&t.trim()||c.push("Street Address is required"),null!==(s=g.address)&&void 0!==s&&null!==(a=s.city)&&void 0!==a&&a.trim()||c.push("City is required"),null!==(r=g.address)&&void 0!==r&&null!==(n=r.state)&&void 0!==n&&n.trim()||c.push("State / Province is required"),null!==(o=g.address)&&void 0!==o&&null!==(i=o.postalCode)&&void 0!==i&&i.trim()||c.push("ZIP / Postal Code is required"),null!==(l=g.address)&&void 0!==l&&null!==(d=l.country)&&void 0!==d&&d.trim()||c.push("Address Country is required"),g.gender||c.push("Gender is required"),g.dateOfBirth||c.push("Date of Birth is required"),g.courseStartDate||c.push("Course Start Date is required"),O||c.push("Student photo is required"),g.customFees&&g.customFees.forEach((e,t)=>{e.name&&!e.amount&&c.push(`Custom fee "${e.name}" requires an amount`),e.amount&&!e.name&&c.push(`Custom fee #${t+1} requires a name`)}),c},[g,O,X]),ce=(0,a.useCallback)(async e=>{if(e.preventDefault(),f)return;if(!k)return void j({text:L||"Please wait while current registration prices load.",type:"error"});v(!0),s();let t=null;try{const e=de();if(e.length>0)return j({text:e.join("\n"),type:"error"}),v(!1),void d();const s=le(),o=g.customFees?g.customFees.filter(e=>e.name&&e.amount>0):[],i=(k.optionalServices||[]).filter(e=>e.enabled&&g.selectedServices[e.id]).map(e=>({id:e.id,name:e.name,description:e.description||"",amount:Number(e.price)||0})),l=(0,n.H9)((0,n.rJ)(n.db,"students")),c=await(0,n.nr)(O,l.id);if(!c.success||!c.url)return j({text:"Photo upload failed. Please check your connection and try again.",type:"error"}),v(!1),void d();t=c.path;const u={programId:g.programId,courseType:ee.name,programHours:ee.hours,fullName:g.fullName.trim(),profilePhoto:c.url,email:g.email.trim(),phoneNumber:g.phoneNumber.trim(),emergencyContact:g.emergencyContact.trim(),address:{addressLine1:g.address.addressLine1.trim(),addressLine2:g.address.addressLine2.trim(),city:g.address.city.trim(),state:g.address.state.trim(),postalCode:g.address.postalCode.trim(),country:g.address.country.trim()},city:g.address.city.trim(),countryOfOrigin:g.countryOfOrigin.trim().toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),gender:g.gender,dateOfBirth:g.dateOfBirth||"",courseStartDate:new Date(g.courseStartDate),expectedCompletionDate:(0,D.j)(g.courseStartDate,ee.classDays).toISOString(),registrationDate:(0,n.O5)(),status:"active",accommodationDetails:{required:g.accommodationDetail
1s.required,status:g.accommodationDetails.required?"pending":"not_required"},optionalFees:g.optionalFees,optionalServices:i,customFees:o,fees:{courseFee:te,programTuition:te,accommodationFee:g.accommodationDetails.required?Q.accommodationFee:0,narRegistrationFee:g.optionalFees.narRegistration?Q.narRegistrationFee:0,stateExamRegistrationFee:g.optionalFees.stateExamRegistration?Q.stateExamRegistrationFee:0,stateExamFee:g.optionalFees.stateExamFee?Q.stateExamFee:0,customFees:o,optionalServices:i},pricingSnapshot:(0,A.aw)(k),paymentDetails:{totalAmount:s,totalPaid:0,balance:s,paymentStatus:"pending",lastUpdated:(0,n.O5)()}};if(console.log("Saving student with dateOfBirth:",u.dateOfBirth),console.log("Full student data:",u),await(0,n.BN)(l,u),t=null,null===l||void 0===l||!l.id)throw new Error("Failed to save student registration");console.log("Student saved successfully with ID:",l.id);try{var a;const e=u.fullName.split(" ");await(0,S.ns)({studentId:l.id,studentName:u.fullName,studentEmail:u.email,courseName:ee.name,startDate:new Date(u.courseStartDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),expectedCompletionDate:(0,D.j)(g.courseStartDate,ee.classDays).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),totalAmount:s,balance:s,courseDetails:`We look forward to supporting you through the ${ee.name} program and your path to nursing assistant certification.`,registrationDetails:{firstName:e[0]||"",lastName:e.slice(1).join(" ")||"",email:u.email,phone:u.phoneNumber||"",dateOfBirth:u.dateOfBirth||"",gender:u.gender||"",nationality:u.countryOfOrigin||"",city:(null===(a=u.address)||void 0===a?void 0:a.city)||"",expectedStartDate:new Date(u.courseStartDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),emergencyContactName:g.emergencyContact||"",emergencyContactPhone:g.emergencyContactPhone||""}}),console.log("\u2705 Registration confirmation email sent to:",u.email)}catch(r){console.error("\u26a0\ufe0f Failed to send registration email (non-blocking):",r)}sessionStorage.setItem("registeredStudentId",l.id),sessionStorage.setItem("registrationAmount",s.toString()),sessionStorage.setItem("registrationData",JSON.stringify({studentId:l.id,fullName:u.fullName,totalAmount:s,fees:{courseFee:te,programTuition:te,accommodationFee:g.accommodationDetails.required?Q.accommodationFee:0,narRegistrationFee:g.optionalFees.narRegistration?Q.narRegistrationFee:0,stateExamRegistrationFee:g.optionalFees.stateExamRegistration?Q.stateExamRegistrationFee:0,stateExamFee:g.optionalFees.stateExamFee?Q.stateExamFee:0,customFees:o,optionalServices:i},pricingSnapshot:u.pricingSnapshot})),await(0,n.$F)("student_registered",{program_id:g.programId,has_accommodation:g.accommodationDetails.required,has_nar:g.optionalFees.narRegistration,has_state_exam:g.optionalFees.stateExamRegistration,custom_fees_count:o.length,total_amount:s}),(0,n.At)("student.registered",{category:"student",targetType:"student",targetId:l.id,targetLabel:u.fullName,details:{totalAmount:s}}),m("Registration completed successfully! Redirecting to dashboard..."),w(!0),b({programId:"cna-traditional",fullName:"",phoneNumber:"",email:"",emergencyContact:"",countryOfOrigin:"",address:{addressLine1:"",addressLine2:"",city:"",state:"",postalCode:"",country:"United States"},gender:"",dateOfBirth:"",courseStartDate:"",accommodationDetails:{required:!1},optionalFees:{narRegistration:!1,stateExamRegistration:!1,stateExamFee:!1},selectedServices:{},customFees:[]}),J(null),K(null),setTimeout(()=>{d(),v(!1),p("/dashboard")},1500)}catch(o){if(console.error("Registration error:",o),t)try{await(0,n.Ww)(t)}catch(i){console.warn("Failed to clean up orphaned student photo:",i)}j({text:"Failed to register student. Please try again.",type:"error"}),d(),v(!1)}},[g,O,le,de,s,d,m,p,k,L,Q,ee,te]);return(0,a.useEffect)(()=>{if(f){const e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)}},[f]),(0,a.useEffect)(()=>{if(N){const e=setTimeout(()=>{"function"===typeof t&&t("payments")},2e3);return()=>clearTimeout(e)}},[N,t]),(0,a.useEffect)(()=>{navigator.cookieEnabled||c("Please enable cookies to use all features of this application.")},[c]),(0,u.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-blue-50 to-indigo-50 py-8",children:(0,u.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,u.jsx)("div",{className:"bg-white rounded-3xl shadow-2xl border border-gray-100 overflow-hidden",children:(0,u.jsxs)("div",{className:"p-8 lg:p-12",children:[y.text&&(0,u.jsx)("div",{className:"mb-8",children:(0,u.jsx)(x,{type:y.type,message:y.text,onClose:()=>j({text:"",type:""})})}),!k&&(0,u.jsx)("div",{className:"mb-8 rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:L?(0,u.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,u.jsxs)("span",{children:[L," Registration is paused to prevent an incorrect charge."]}),(0,u.jsx)("button",{type:"button",onClick:se,className:"font-semibold text-blue-700 hover:text-blue-800",children:"Try again"})]}):"Loading current registration prices\u2026"}),(0,u.jsxs)("form",{onSubmit:ce,className:"space-y-12",children:[(0,u.jsxs)("div",{className:"space-y-8",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-200",children:[(0,u.jsx)("div",{className:"p-2 bg-blue-600 rounded-lg",children:(0,u.jsx)(I.A,{className:"h-6 w-6 text-white"})}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Personal Information"}),(0,u.jsx)("p",{className:"text-gray-600",children:"Tell us about yourself"})]})]}),(0,u.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,u.jsx)(G,{label:"CNA Program",name:"programId",type:"select",value:g.programId,onChange:ie,required:!0,options:X.map(e=>({value:e.id,label:`${e.name} \xb7 ${e.hours} hours \xb7 ${(0,A.s$)(e.tuition)}`})),icon:P.A,description:"Bridge enrollment requires an active Washington HCA credential"}),(0,u.jsx)(G,{label:"Full Name",name:"fullName",value:g.fullName,onChange:ie,required:!0,placeholder:"Enter your full legal name",icon:B.A,description:"As it appears on your official documents"}),(0,u.jsx)(G,{label:"Phone Number",name:"phoneNumber",type:"tel",value:g.phoneNumber,onChange:ie,required:!0,placeholder:"(555) 123-4567",icon:T.A,description:"Primary contact number"}),(0,u.jsx)(G,{label:"Email Address",name:"email",type:"email",value:g.email,onChange:ie,required:!0,placeholder:"[email protected]",icon:$.A,description:"For course updates and communications"}),(0,u.jsx)(G,{label:"Emergency Contact",name:"emergencyContact",value:g.emergencyContact,onChange:ie,required:!0,placeholder:"Name and phone number",icon:M.A,description:"Person to contact in case of emergency"}),(0,u.jsx)(G,{label:"Country of Origin",name:"countryOfOrigin",value:g.countryOfOrigin,onChange:ie,required:!0,placeholder:"Enter your country",icon:W.A,description:"For statistical and cultural accommodation purposes"}),(0,u.jsx)(G,{label:"Gender",name:"gender",type:"select",value:g.gender,onCh
1ange:ie,required:!0,options:ae,icon:B.A,description:"For accommodation and statistical purposes"}),(0,u.jsx)(G,{label:"Date of Birth",name:"dateOfBirth",type:"date",value:g.dateOfBirth,onChange:ie,required:!0,icon:_.A,description:"Your birth date for age verification and records"}),(0,u.jsx)(G,{label:"Course Start Date",name:"courseStartDate",type:"date",value:g.courseStartDate,onChange:ie,required:!0,icon:_.A,description:"When you plan to begin your studies"}),(0,u.jsx)("div",{className:"space-y-3",children:(0,u.jsxs)("label",{className:"flex items-center space-x-3 p-4 bg-blue-50 rounded-xl border-2 border-blue-200 hover:border-blue-300 transition-all duration-200 cursor-pointer",children:[(0,u.jsx)("input",{type:"checkbox",name:"accommodationDetails.required",checked:g.accommodationDetails.required,onChange:ie,className:"h-5 w-5 text-blue-600 focus:ring-blue-500 border-gray-300 rounded-md"}),(0,u.jsxs)("div",{className:"flex-1",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,u.jsx)(R.A,{className:"h-5 w-5 text-blue-600"}),(0,u.jsx)("span",{className:"font-semibold text-gray-900",children:"Student Accommodation"}),(0,u.jsx)("span",{className:"font-bold text-green-600",children:(0,A.s$)(Q.accommodationFee)})]}),(0,u.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:"Secure, comfortable housing near campus facilities"})]})]})})]})]}),(0,u.jsxs)("div",{className:"space-y-8",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-200",children:[(0,u.jsx)("div",{className:"p-2 bg-emerald-600 rounded-lg",children:(0,u.jsx)(H.A,{className:"h-6 w-6 text-white"})}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Address"}),(0,u.jsx)("p",{className:"text-gray-600",children:"Student's current residential or mailing address"})]})]}),(0,u.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,u.jsx)("div",{className:"lg:col-span-2",children:(0,u.jsx)(G,{label:"Street Address",name:"address.addressLine1",value:g.address.addressLine1,onChange:ie,required:!0,placeholder:"House number and street name",icon:H.A})}),(0,u.jsx)("div",{className:"lg:col-span-2",children:(0,u.jsx)(G,{label:"Apartment, Suite, or Unit",name:"address.addressLine2",value:g.address.addressLine2,onChange:ie,placeholder:"Apartment, suite, unit, building, floor, etc. (optional)",icon:R.A})}),(0,u.jsx)(G,{label:"City",name:"address.city",value:g.address.city,onChange:ie,required:!0,placeholder:"City",icon:H.A}),(0,u.jsx)(G,{label:"State / Province",name:"address.state",value:g.address.state,onChange:ie,required:!0,placeholder:"State or province",icon:H.A}),(0,u.jsx)(G,{label:"ZIP / Postal Code",name:"address.postalCode",value:g.address.postalCode,onChange:ie,required:!0,placeholder:"ZIP or postal code",icon:H.A}),(0,u.jsx)(G,{label:"Country",name:"address.country",value:g.address.country,onChange:ie,required:!0,placeholder:"Country",icon:W.A})]})]}),(0,u.jsxs)("div",{className:"bg-gradient-to-br from-purple-50 to-indigo-50 p-6 rounded-2xl border border-purple-100 space-y-6",children:[(0,u.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,u.jsx)("div",{className:"p-2 bg-purple-600 rounded-lg",children:(0,u.jsx)(U.A,{className:"h-6 w-6 text-white"})}),(0,u.jsxs)("div",{children:[(0,u.jsxs)("h3",{className:"text-xl font-bold text-gray-900",children:["Student Photo ",(0,u.jsx)("span",{className:"text-red-500 text-base align-top",children:"*"})]}),(0,u.jsx)("p",{className:"text-sm text-gray-600",children:"A photo is required to complete registration"})]})]}),(0,u.jsx)(h.A,{value:O,onChange:e=>J(e.target.value),preview:Y,onPreviewChange:K})]}),(0,u.jsx)(V,{formData:g,configuration:k,onChange:ie,onCustomFeeChange:oe,onAddCustomFee:re,onRemoveCustomFee:ne}),(0,u.jsx)(Z,{formData:g,pricing:{...Q,programs:null===k||void 0===k?void 0:k.programs,optionalServices:null===k||void 0===k?void 0:k.optionalServices},calculateTotal:le}),(0,u.jsx)("div",{className:"flex justify-center pt-8",children:(0,u.jsx)(i.$,{type:"submit",disabled:f||!k,isLoading:f,variant:"primary",size:"large",className:"px-12 py-4 text-lg font-semibold bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 transform hover:scale-105 transition-all duration-200 shadow-xl",children:f?(0,u.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,u.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent roun
1ded-full animate-spin"}),(0,u.jsx)("span",{children:"Processing Registration..."})]}):(0,u.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,u.jsx)(l.A,{className:"h-6 w-6"}),(0,u.jsx)("span",{children:"Complete Registration"})]})})})]})]})}),(0,u.jsx)("div",{className:"text-center mt-12 text-gray-500",children:(0,u.jsxs)("p",{className:"text-sm",children:["Need help? Contact our admissions team at"," ",(0,u.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:text-blue-800 font-medium",children:"[email protected]"})]})})]})})})},73601:(e,t,s)=>{s.d(t,{j:()=>r});const a=e=>{if(null==e||""===e)return null;if("object"===typeof e&&"function"===typeof e.toDate)return a(e.toDate());if("object"===typeof e&&"number"===typeof e.seconds)return a(new Date(1e3*e.seconds));if("string"===typeof e){const t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),12,0,0);const s=new Date(e);return isNaN(s.getTime())?null:a(s)}if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);const t=new Date(e);return isNaN(t.getTime())?null:a(t)},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;const s=a(e);if(!s)return null;let r=0===s.getDay()?0:1;for(;r<t;)s.setDate(s.getDate()+1),0!==s.getDay()&&(r+=1);return s}}}]);

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.