PageSourceSearch

https://hudumacna.com/static/js/7896.55781306.chunk.js

js hudumacna.com collected 2026-10-09 22:40:13 UTC 8,485 bytes, 2 lines download raw bytes

1/*! For license information please see 7896.55781306.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[7896],{14012:(e,t,a)=>{function s(e){if(null===e||void 0===e||!e.width||null===e||void 0===e||!e.height)return"";const t=e.getContext("2d").getImageData(0,0,e.width,e.height);let a=e.width,s=-1,n=e.height,l=-1;for(let x=0;x<e.height;x+=1)for(let r=0;r<e.width;r+=1){const i=4*(x*e.width+r);t.data[i+3]>20&&(t.data[i]<235||t.data[i+1]<235||t.data[i+2]<235)&&(a=Math.min(a,r),s=Math.max(s,r),n=Math.min(n,x),l=Math.max(l,x))}if(s<a||l<n)return"";const r=Math.max(8,Math.round(.015*e.width)),i=Math.max(0,a-r),d=Math.max(0,n-r),c=Math.min(e.width-i,s-a+1+2*r),o=Math.min(e.height-d,l-n+1+2*r),m=document.createElement("canvas");m.width=c,m.height=o;const u=m.getContext("2d");return u.fillStyle="#ffffff",u.fillRect(0,0,m.width,m.height),u.drawImage(e,i,d,c,o,0,0,c,o),m.toDataURL("image/png")}a.d(t,{U:()=>s})},47288:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},71057:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},87896:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var s=a(9950),n=a(73814),l=a(67117),r=a(47288),i=a(71057),d=a(90661),c=a(14012),o=a(44414);const m="https://us-central1-hudumacna-2831c.cloudfunctions.net";function u(){const{token:e}=(0,n.g)(),t=(0,s.useRef)(null),a=(0,s.useRef)(null),[u,x]=(0,s.use
2State)(null),[h,g]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[j,v]=(0,s.useState)(!0),[N,y]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[k,A]=(0,s.useState)("");(0,s.useEffect)(()=>{fetch(`${m}/getAttendanceSignatureRequest?token=${encodeURIComponent(e)}`).then(async e=>{var t;const a=await e.json();if(!e.ok)throw new Error((null===(t=a.error)||void 0===t?void 0:t.message)||"Unable to open request.");x(a.result),w(Boolean(a.result.savedSignature)),"signed"===a.result.status&&S(!0)}).catch(e=>A(e.message)).finally(()=>v(!1))},[e]),(0,s.useEffect)(()=>{if(!u||C||b||!t.current)return;const e=t.current,s=()=>{var t;const s=!1===(null===(t=a.current)||void 0===t?void 0:t.isEmpty())?a.current.toData():null,n=Math.max(window.devicePixelRatio||1,1);e.width=e.offsetWidth*n,e.height=190*n,e.getContext("2d").scale(n,n),s&&a.current.fromData(s)};return a.current=new l.A(e,{backgroundColor:"#ffffff",penColor:"#111827"}),s(),window.addEventListener("resize",s),()=>{var e;window.removeEventListener("resize",s),null===(e=a.current)||void 0===e||e.off(),a.current=null}},[u,C,b]);return j?(0,o.jsx)("main",{className:"grid min-h-screen place-items-center bg-slate-100",children:(0,o.jsx)(r.A,{className:"h-9 w-9 animate-spin text-[#123b69]"})}):C?(0,o.jsx)("main",{className:"grid min-h-screen place-items-center bg-slate-100 p-4",children:(0,o.jsxs)("div",{className:"w-full max-w-md rounded-2xl bg-white p-8 text-center shadow-lg",children:[(0,o.jsx)(i.A,{className:"mx-auto h-14 w-14 text-emerald-600"}),(0,o.jsx)("h1",{className:"mt-4 text-2xl font-bold text-slate-950",children:"Attendance confirmed"}),(0,o.jsx)("p",{className:"mt-2 text-sm text-slate-600",children:"Your signature has been placed in the attendance record for the correct class date."})]})}):u?(0,o.jsx)("main",{className:"min-h-screen bg-slate-100 px-4 py-6 sm:py-12",children:(0,o.jsxs)("div",{className:"mx-auto w-full max-w-xl overflow-hidden rounded-2xl bg-white shadow-xl",children:[(0,o.jsxs)("header",{className:"border-b p-5 sm:p-7",children:[(0,o.jsx)("p",{className:"text-sm font-semibold text-slate-500",children:"Caregiver Training & Huduma Center LLC"}),(0,o.jsx)("h1",{className:"mt-1 text-2xl font-bold text-slate-950",children:"Confirm attendance"}),(0,o.jsx)("p",{className:"mt-1 text-sm text-slate-600",children:"No login is required."})]}),(0,o.jsxs)("div",{className:"p-5 sm:p-7",children:[(0,o.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2",children:[(0,o.jsxs)("div",{className:"rounded-lg bg-slate-50 p-4",children:[(0,o.jsx)("dt",{className:"text-xs font-bold uppercase text-slate-500",children:"Student name"}),(0,o.jsx)("dd",{className:"mt-1 font-semibold text-slate-950",children:u.studentName})]}),(0,o.jsxs)("div",{className:"rounded-lg bg-slate-50 p-4",children:[(0,o.jsx)("dt",{className:"text-xs font-bold uppercase text-slate-500",children:"Class date"}),(0,o.jsx)("dd",{className:"mt-1 font-semibold text-slate-950",children:new Date(`${u.classDate}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})})]})]}),(0,o.jsx)("p",{className:"mt-5 text-sm text-slate-700",children:"Confirm the name and date above, then sign in the box."}),u.savedSignature&&(0,o.jsxs)("div",{className:"mt-4 rounded-xl border border-emerald-200 bg-emerald-50 p-4",children:[(0,o.jsx)("p",{className:"text-sm font-semibold text-emerald-900",children:"Saved signature available"}),(0,o.jsx)("div",{className:"mt-3 flex min-h-14 items-center justify-center rounded-lg border border-emerald-200 bg-white p-2",children:u.savedSignature.image?(0,o.jsx)("img",{src:u.savedSignature.image,alt:"Your saved signature",className:"max-h-12 max-w-full object-contain"}):(0,o.jsx)("span",{className:"font-serif text-xl italic",children:u.savedSignature.initials})}),(0,o.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[(0,o.jsx)("button",{type:"button",onClick:()=>w(!0),className:"rounded-lg px-3 py-2 text-sm font-semibold "+(b?"bg-emerald-700 text-white":"border border-emerald-300 bg-white text-emerald-800"),children:"Reuse saved signature"}),(0,o.jsx)("button",{type:"button",onClick:()=>w(!1),className:"rounded-lg px-3 py-2 text-sm font-semibold "+(b?"border border-slate-300 bg-white text-slate-700":"bg-[#123b69] text-white"),children:"Add a new signature"})]})]}),!b&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-sm font-semibold text-slate-700",children:"Signature"}),(0,o.jsxs)("button",{type:"button",onClick:()=>{var e;null===(e=a.current)||void 0===e||e.clear(),f("")},className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-600",children:[(0,o.jsx)(d.A,{className:"h-3.5 w-3.5"})," Clear"]})]}),(0,o.jsx)("canvas",{ref:t,onPointerDown:()=>f(""),onPointerUp:()=>
2t.current&&f((0,c.U)(t.current)),className:"mt-2 block h-[190px] w-full touch-none rounded-lg border-2 border-slate-400 bg-white"}),(0,o.jsxs)("div",{className:"my-4 flex items-center gap-3 text-[11px] font-bold uppercase text-slate-400",children:[(0,o.jsx)("span",{className:"h-px flex-1 bg-slate-200"})," or initials",(0,o.jsx)("span",{className:"h-px flex-1 bg-slate-200"})]}),(0,o.jsx)("input",{"aria-label":"Student initials",value:h,onChange:e=>g(e.target.value.slice(0,6)),placeholder:"Enter initials",className:"w-full rounded-lg border border-slate-300 px-3 py-2.5 uppercase"})]}),k&&(0,o.jsx)("p",{className:"mt-3 text-sm text-red-700",children:k}),(0,o.jsxs)("button",{onClick:async()=>{const s=p||(a.current&&!a.current.isEmpty()?(0,c.U)(t.current):"");if(b||s||h.trim()){y(!0),A("");try{var n;const t=await fetch(`${m}/submitAttendanceSignature`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,signatureImage:s,initials:s?"":h.trim().toUpperCase(),reuseSaved:b})}),a=await t.json();if(!t.ok)throw new Error((null===(n=a.error)||void 0===n?void 0:n.message)||"Unable to submit signature.");S(!0)}catch(l){A(l.message)}finally{y(!1)}}else A("Draw your signature or enter your initials.")},disabled:N,className:"mt-5 inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[#123b69] px-4 py-3 font-semibold text-white disabled:opacity-50",children:[N&&(0,o.jsx)(r.A,{className:"h-4 w-4 animate-spin"}),"Submit attendance signature"]})]})]})}):(0,o.jsx)("main",{className:"grid min-h-screen place-items-center bg-slate-100 p-4",children:(0,o.jsxs)("div",{className:"max-w-md rounded-xl bg-white p-8 text-center shadow",children:[(0,o.jsx)("h1",{className:"text-xl font-bold",children:"Unable to open attendance request"}),(0,o.jsx)("p",{className:"mt-2 text-sm text-red-700",children:k})]})})}},90661:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])}}]);

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.