PageSourceSearch

https://bizvanguard.ai/assets/SignWageReceipt-C1574vVv.js

js bizvanguard.ai collected 2026-10-05 13:46:48 UTC 27,368 bytes, 1 lines download raw bytes

1import{u as Z,j as e,r as f}from"./vendor-react-zwv87yMD.js";import{u as J,a as _,g as q}from"./wage-receipts-CroFQ--9.js";import{u as G}from"./SignatureCapture-BFsHWfr8.js";import{u as K}from"./useOrgTimezone-C1UagyKl.js";import{a as Q}from"./timezoneFormatters-Lg56xFv0.js";import{e as ee,c as te}from"./vendor-router-DimZLiZb.js";import"./vendor-charts-CtrTLS4K.js";import"./vendor-i18n-BdYkS11p.js";import"./vendor-ui-CfDMlrKu.js";import"./vendor-pdf-DQuePnfN.js";import"./vendor-state-ByI9XJey.js";import"./vendor-editor-C_dhmuey.js";import"./api-client-wl3SCNAO.js";import"./vendor-query-DYq8g7OI.js";import"./authStore-Bv6p2Ne2.js";import"./i18n-CwjSIy0a.js";import"./vendor-icons-bLSWzydc.js";import"./tabs-Dd8Qm6LV.js";import"./utils-BXSzAfFa.js";import"./input-C9cRIRX4.js";import"./label-CSUA9GMO.js";import"./signatureImage-rQ9wtwg0.js";import"./employeeAuthStore-lYSKMuhw.js";function se({receiptData:U,organizationName:C,formatCurrency:r,formatDate:w}){var k,b;const{t:n,i18n:L}=Z("employee"),s=U,p=s.templateSettings,P=L.language==="fa"?"en-US":L.language==="zh-CN"?"zh-CN":L.language,x=(t,i=2)=>new Intl.NumberFormat("en-US",{minimumFractionDigits:i,maximumFractionDigits:i}).format(t);function B(t){const[i,c,h]=t.split("-").map(Number);return new Date(Date.UTC(i,c-1,h)).toLocaleDateString(P,{month:"short",day:"numeric",timeZone:"UTC"})}function v(t){const[i,c,h]=t.split("-").map(Number);return new Date(Date.UTC(i,c-1,h)).toLocaleDateString(P,{weekday:"short",timeZone:"UTC"})}const M=t=>({Regular:n("signing.receipt.regular"),"Overtime (1.5x)":n("signing.receipt.overtime"),"Double Time (2x)":n("signing.receipt.doubleTime")})[t]||t,$=t=>({REIMBURSEMENT:n("signing.receipt.reimbursement"),OTHER:n("signing.receipt.otherEarnings")})[t.toUpperCase()]||t,H=[{key:"tips",value:s.earnings.tips},{key:"tipPool",value:s.earnings.tipPool},{key:"bonus",value:s.earnings.bonus},{key:"commission",value:s.earnings.commission},{key:"vacation",value:s.earnings.vacation},{key:"sickPay",value:s.earnings.sick},{key:"holidayPay",value:s.earnings.holiday}].filter(t=>t.value>0),F=(p==null?void 0:p.showDailyHours)!==!1&&s.dailyHours&&s.dailyHours.length>0,N=((k=s.dailyHours)==null?void 0:k.some(t=>t.entries&&t.entries.length>0))??!1,y=((b=s.dailyHours)==null?void 0:b.some(t=>{var i;return(i=t.entries)==null?void 0:i.some(c=>c.breaks&&c.breaks.length>0)}))??!1;function o(t){return t.reduce((i,c)=>{if(!c.end)return i;const[h,u]=c.start.split(":").map(Number),[d,m]=c.end.split(":").map(Number);return i+(d*60+m)-(h*60+u)},0)}function I(t){if(t<=0)return"—";const i=Math.floor(t/60),c=t%60;return i>0&&c>0?`${i}h ${c}m`:i>0?`${i}h`:`${c}m`}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 md:p-6",children:[e.jsxs("div",{className:"text-center mb-4",children:[e.jsx("h2",{className:"text-lg font-bold text-slate-800",children:C}),s.receiptNumber&&e.jsxs("p",{className:"text-sm text-slate-500",children:[n("signing.receipt.receiptNo")," ",s.receiptNumber]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-slate-500",children:n("signing.receipt.payPeriod")}),e.jsxs("p",{className:"font-medium text-slate-800",children:[w(s.periodStart)," – ",w(s.periodEnd)]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-slate-500",children:n("signing.receipt.payDate")}),e.jsx("p",{className:"font-medium text-slate-800",children:w(s.payDate)})]})]})]}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 md:p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:n("signing.receipt.employer")}),e.jsx("p",{className:"font-medium text-slate-800",children:s.employer.legalName||s.employer.name}),e.jsx("p",{className:"text-sm text-slate-600",children:s.employer.address}),(s.employer.city||s.employer.state||s.employer.zipCode)&&e.jsxs("p",{className:"text-sm text-slate-600",children:[[s.employer.city,s.employer.state].filter(
1Boolean).join(", "),s.employer.zipCode?` ${s.employer.zipCode}`:""]}),s.employer.phone&&e.jsx("p",{className:"text-sm text-slate-600",children:s.employer.phone}),s.employer.ein&&e.jsxs("p",{className:"text-sm text-slate-600",children:["EIN: ***-**-",s.employer.ein]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:n("signing.receipt.employee")}),e.jsx("p",{className:"font-medium text-slate-800",children:s.employee.name}),s.employee.employeeId&&e.jsxs("p",{className:"text-sm text-slate-600",children:[n("signing.receipt.employeeId"),": ",s.employee.employeeId]}),s.employee.position&&e.jsxs("p",{className:"text-sm text-slate-600",children:[n("signing.receipt.position"),": ",s.employee.position]}),s.employee.department&&e.jsxs("p",{className:"text-sm text-slate-600",children:[n("signing.receipt.department"),": ",s.employee.department]})]})]})}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 md:p-6",children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800 mb-3",children:n("signing.receipt.earnings")}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.type")}),e.jsx("th",{className:"text-right py-2 text-slate-500 font-medium",children:n("signing.receipt.rate")}),e.jsx("th",{className:"text-right py-2 text-slate-500 font-medium",children:n("signing.receipt.hours")}),e.jsx("th",{className:"text-right py-2 text-slate-500 font-medium",children:n("signing.receipt.amount")})]})}),e.jsxs("tbody",{children:[s.rates.map((t,i)=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 text-slate-700",children:M(t.type)}),e.jsxs("td",{className:"py-2 text-right text-slate-700",children:[r(t.rate),"/hr"]}),e.jsx("td",{className:"py-2 text-right text-slate-700",children:x(t.hours)}),e.jsx("td",{className:"py-2 text-right text-slate-700",children:r(t.amount)})]},i)),H.map(t=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 text-slate-700",colSpan:3,children:n(`signing.receipt.${t.key}`)}),e.jsx("td",{className:"py-2 text-right text-slate-700",children:r(t.value)})]},t.key)),s.earnings.other.map((t,i)=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 text-slate-700",colSpan:3,children:$(t.name)}),e.jsx("td",{className:"py-2 text-right text-slate-700",children:r(t.amount)})]},`other-${i}`)),s.deductions&&s.deductions.map((t,i)=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"py-2 text-slate-700",colSpan:3,children:t.name}),e.jsxs("td",{className:"py-2 text-right text-red-600",children:["-",r(t.amount)]})]},`ded-${i}`)),(s.employeeNotes||s.payrollNotes)&&e.jsx("tr",{className:"border-b border-slate-100",children:e.jsxs("td",{className:"py-2 text-slate-600",colSpan:4,children:[e.jsxs("span",{className:"font-medium text-slate-700",children:[n("signing.receipt.notes"),":"]})," ",[s.employeeNotes,s.payrollNotes].filter(Boolean).join(" | ")]})})]}),e.jsx("tfoot",{children:e.jsxs("tr",{className:"border-t-2 border-slate-300",children:[e.jsx("td",{className:"py-2 font-semibold text-slate-800",colSpan:2,children:n("signing.receipt.grossPay")}),e.jsxs("td",{className:"py-2 text-right text-slate-600",children:[x(s.hours.total)," ",n("signing.receipt.hours").toLowerCase()]}),e.jsx("td",{className:"py-2 text-right font-semibold text-slate-800",children:r(s.totals.grossPay)})]})})]})}),e.jsxs("div",{className:"md:hidden space-y-3",children:[s.rates.map((t,i)=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-slate-700",children:M(t.type)}),e.jsxs("p",{className:"text-xs text-slate-500",children:[r(t.rate),"/hr × ",x(t.hours)," ",n("signing.receipt.hours").toLowerCase()]})]}),e.jsx("span",{className:"text-sm font-medium text-slate-800",children:r(t.amount)})]},i)),H.map(t=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100",children:[e.jsx("span",{className:"text-sm text-slate-700",children:n(`signing.receipt.${t.key}`)}),e.jsx("span",{className:"text-sm font-medium text-slate-800",children:r(t.value)})]},t.key)),s.earnings.other.map((t,i)=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100",children:[e.jsx("span",{className:"text-sm text-slate-700",children:$(t.name)}),e.jsx("span",{className:"text-sm font-medium text-slate-800",children:r(t.amount)})]},`other-${i}`)),s.deductions&&s.deductions.map((t,i)=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100",children:[e.jsx("span",{className:"text-sm text-slate-700",children:t.name}),e.jsxs("span",{className:"text-sm font-medium text-red-600",children:["-",r(t.amount)]})]},`ded-${i}`)),(s.employeeNotes||s.payrollNotes)&&e.jsx("div",{className:"py-2 border-b border-slate-100",children:e.jsxs("p",{className:"text-xs text-slate-600",children:[e.jsxs("span",{className:"font-medium text-slate-700",children:[n("signing.receipt.notes"),":"]}
1)," ",[s.employeeNotes,s.payrollNotes].filter(Boolean).join(" | ")]})}),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t-2 border-slate-300",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-slate-800",children:n("signing.receipt.grossPay")}),e.jsxs("p",{className:"text-xs text-slate-500",children:[x(s.hours.total)," ",n("signing.receipt.hours").toLowerCase()]})]}),e.jsx("span",{className:"text-base font-bold text-slate-800",children:r(s.totals.grossPay)})]})]})]}),F&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 md:p-6",children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800 mb-3",children:n("signing.receipt.dailyHours")}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-200",children:[e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.date")}),N&&e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.clockIn")}),N&&e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.clockOut")}),y&&e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.break")}),y&&e.jsx("th",{className:"text-left py-2 text-slate-500 font-medium",children:n("signing.receipt.breakTime")}),e.jsx("th",{className:"text-right py-2 text-slate-500 font-medium",children:n("signing.receipt.hours")})]})}),e.jsx("tbody",{children:s.dailyHours.map((t,i)=>{const c=t.entries||[],h=Math.max(1,c.length),u=c.reduce((d,m)=>d+(m.breaks?o(m.breaks):0),0);return c.length>0?c.map((d,m)=>e.jsxs("tr",{className:"border-b border-slate-100",children:[m===0&&e.jsxs("td",{className:"py-2 text-slate-700",rowSpan:h,children:[t.date," (",v(t.date),")"]}),N&&e.jsx("td",{className:"py-2 text-slate-600",children:d.clockIn}),N&&e.jsx("td",{className:"py-2 text-slate-600",children:d.clockOut||"—"}),y&&e.jsx("td",{className:"py-2 text-slate-600",children:d.breaks&&d.breaks.length>0?d.breaks.map(j=>`${j.start}${j.end?` – ${j.end}`:""}`).join(", "):"—"}),y&&m===0&&e.jsx("td",{className:"py-2 text-slate-600",rowSpan:h,children:I(u)}),m===0&&e.jsx("td",{className:"py-2 text-right text-slate-700",rowSpan:h,children:x(t.hours)})]},`${i}-${m}`)):[e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsxs("td",{className:"py-2 text-slate-700",children:[t.date," (",v(t.date),")"]}),N&&e.jsx("td",{className:"py-2 text-slate-600",children:"—"}),N&&e.jsx("td",{className:"py-2 text-slate-600",children:"—"}),y&&e.jsx("td",{className:"py-2 text-slate-600",children:"—"}),y&&e.jsx("td",{className:"py-2 text-slate-600",children:"—"}),e.jsx("td",{className:"py-2 text-right text-slate-700",children:x(t.hours)})]},i)]})})]})}),e.jsx("div",{className:"md:hidden space-y-1",children:s.dailyHours.map((t,i)=>{const c=t.entries||[],h=t.hours>0||c.length>0,u=c.reduce((d,m)=>d+(m.breaks?o(m.breaks):0),0);return h?e.jsxs("div",{className:"border border-slate-100 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium text-slate-800 text-sm",children:[B(t.date)," (",v(t.date),")"]}),e.jsxs("span",{className:"font-semibold text-slate-700 text-sm",children:[x(t.hours)," ",n("signing.receipt.hours").toLowerCase()]})]}),c.length>0&&e.jsxs("div",{className:"space-y-1 mt-2",children:[c.map((d,m)=>e.jsxs("div",{className:"text-xs text-slate-500",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("span",{children:[n("signing.receipt.clockIn"),": ",d.clockIn]}),e.jsxs("span",{children:[n("signing.receipt.clockOut"),": ",d.clockOut||"—"]})]}),d.breaks&&d.breaks.length>0&&d.breaks.map((j,z)=>e.jsxs("div",{className:"text-slate-400 ml-1",children:[n("signing.receipt.break"),": ",j.start,j.end?` – ${j.end}`:""]},z))]},m)),u>0&&e.jsxs("div",{className:"text-xs text-slate-500 pt-1 border-t border-slate-50",children:[n("signing.receipt.breakTime"),": ",I(u)]})]})]},i):e.jsxs("div",{className:"flex items-center justify-between py-1.5 px-2 text-xs text-slate-400",children:[e.jsxs("span",{children:[B(t.date)," (",v(t.date),")"]}),e.jsx("span",{children:"—"})]},i)})})]}),s.cashTips&&s.cashTips.reportedAmount>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-4 md:p-6",children:[e.jsx("h3",{className:"text-sm font-semibold text-slate-800 mb-2",children:n("signing.receipt.cashTips")}),e.jsx("p",{className:"text-slate-700",children:r(s.cashTips.reportedAmount)}),s.cashTips.irsForm4070Reference&&e.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[n("signing.receipt.irsReference"),": ",s.cashTips.irsForm4070Reference]})]})]})}function Te(){var Y,O,A,V,X;G();const U=K(),{token:C}=ee(),{t:r,i18n:w}=Z("employee"),n=f.useRef(null),[L,s]=f.useState(!1),[p,P]=f.useState("drawn"),[x,B]=f.useState(""),[v,M]=f.useState(!1),[$,H]=f.useState(!1),[F,N]=f.useState(!1),y=te(),{data:o,isLoading:I,error:k}=J(C||""),b=_(),t=!!localStorage.getItem("employeeSessionToken");f.useEffect(()=>{o!=null&&o.employeeLanguage&&o.employeeLanguage!==w.language&&w.changeLanguage(o.employeeLanguage)},[o==null?void 0:o.employeeLanguage,w]),f.useEffect(()=>{const a=n.current;if(a){const l=a.getContext("2d");l&&(l.fillStyle="white",l.fillRect(0,0,a.width,a.height),l.strokeStyle="#1e40af",l.lineWidth=2,l.lineCap="round",l.lineJoin="round")}}
1,[p]);const i=a=>{s(!0);const l=n.current;if(!l)return;const S=l.getContext("2d");if(!S)return;const g=l.getBoundingClientRect(),E=l.width/g.width,R=l.height/g.height;let T,D;"touches"in a?(T=(a.touches[0].clientX-g.left)*E,D=(a.touches[0].clientY-g.top)*R):(T=(a.clientX-g.left)*E,D=(a.clientY-g.top)*R),S.beginPath(),S.moveTo(T,D)},c=a=>{if(!L)return;const l=n.current;if(!l)return;const S=l.getContext("2d");if(!S)return;const g=l.getBoundingClientRect(),E=l.width/g.width,R=l.height/g.height;let T,D;"touches"in a?(a.preventDefault(),T=(a.touches[0].clientX-g.left)*E,D=(a.touches[0].clientY-g.top)*R):(T=(a.clientX-g.left)*E,D=(a.clientY-g.top)*R),S.lineTo(T,D),S.stroke(),M(!0)},h=()=>{s(!1)},u=()=>{const a=n.current;if(a){const l=a.getContext("2d");l&&(l.fillStyle="white",l.fillRect(0,0,a.width,a.height))}M(!1),B("")},d=()=>{if(p==="drawn"){if(!v)return null;const a=n.current;return a?a.toDataURL("image/png"):null}else{if(!x.trim())return null;const a=document.createElement("canvas");a.width=400,a.height=100;const l=a.getContext("2d");return l?(l.fillStyle="white",l.fillRect(0,0,a.width,a.height),l.fillStyle="#1e40af",l.font='italic 36px "Dancing Script", "Brush Script MT", cursive',l.textAlign="center",l.textBaseline="middle",l.fillText(x,200,50),a.toDataURL("image/png")):null}},m=async()=>{const a=d();if(!(!a||!C))try{await b.mutateAsync({token:C,dto:{signature:a,signatureType:p,typedName:p==="typed"?x:void 0}}),H(!0)}catch{}},j=a=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(a/100),z=a=>Q(a,U,{month:"long"});if(I)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-blue-200 border-t-blue-600 mx-auto"}),e.jsx("p",{className:"mt-4 text-slate-600 font-medium",children:r("signing.loading")})]})});if(k||!o){const a=(O=(Y=k==null?void 0:k.response)==null?void 0:Y.data)==null?void 0:O.message,l=a==null?void 0:a.includes("expired");return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-orange-100 to-red-100 flex items-center justify-center",children:l?e.jsx("svg",{className:"w-10 h-10 text-orange-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}):e.jsx("svg",{className:"w-10 h-10 text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-800 mb-3",children:r(l?"signing.expired.title":"signing.notFound.title")}),e.jsx("p",{className:"text-slate-600 mb-6",children:r(l?"signing.expired.message":"signing.notFound.message")})]})})}if(o.isAlreadySigned)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-green-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-green-100 to-emerald-100 flex items-center justify-center",children:e.jsx("svg",{className:"w-10 h-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-800 mb-3",children:r("signing.alreadySigned.title")}),e.jsx("p",{className:"text-slate-600",children:r("signing.alreadySigned.message")})]})});if(o.isExpired)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-orange-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-orange-100 to-amber-100 flex items-center justify-center",children:e.jsx("svg",{className:"w-10 h-10 text-orange-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-800 mb-3",children:r("signing.linkExpired.title")}),e.jsx("p",{className:"text-slate-600 mb-6",children:r("signing.linkExpired.message")})]})});if($)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-green-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-green-100 to-emerald-100 flex items-center justify-center",children:e.jsx("svg",{className:"w-10 h-10 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsx("h1",{className:"text-2xl font-bold text-slate-800 mb-3",children:r("signing.success.title")}),e.jsx("p",{className:"text-slate-600 mb-6",children:r("signing.success.message")}),e.jsx("div",{className:"bg-white rounded-xl p-6 shadow-sm border border-green-200 mb-6",children:e.jsxs("p",{className:"text-sm text-slate-600",children:[e.jsx("strong",{children:o.organization.name})," ",r("signing.success.record",{orgName:o.organization.name,start:z(o.receiptData.periodStart),end:z(o.receiptData.periodEnd)})]})}),t?e.jsx("button",{onClick:()=>y("/employee"),className:"w-full py-3 px-6 bg-blue-600 text-white rounded-xl font-medium hover:bg-blue-700 transition-colors",children:r("signing.success.backToDashboard","Back to Dashboard")}
1):F?e.jsx("p",{className:"text-base text-slate-500",children:r("signing.success.safeToClose","Your signature has been saved. You can close this tab.")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{try{if(window.parent!==window){window.parent.postMessage("wage-receipt-signed",window.location.origin);return}window.opener&&window.opener.postMessage("wage-receipt-signed",window.location.origin),window.close()}catch{}N(!0)},className:"w-full py-3 px-6 bg-green-600 text-white rounded-xl font-medium hover:bg-green-700 transition-colors",children:r("signing.success.done","Done")}),e.jsx("p",{className:"text-sm text-slate-400 mt-3",children:r("signing.success.safeToClose","Your signature has been saved. You can close this tab.")})]})]})});const W=p==="drawn"&&v||p==="typed"&&x.trim().length>=2;return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 py-8 px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("button",{onClick:()=>{window.history.length>1?window.history.back():window.close()},className:"mb-4 inline-flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"Back"]}),e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-slate-800 mb-2",children:r("signing.title")}),e.jsx("p",{className:"text-slate-600",children:o.organization.name})]}),e.jsx(se,{receiptData:o.receiptData,organizationName:o.organization.name,formatCurrency:j,formatDate:z}),e.jsx("div",{className:"flex justify-center my-4",children:e.jsxs("a",{href:q(C),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 text-sm text-blue-600 hover:text-blue-800 hover:bg-blue-50 rounded-lg transition-colors",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),r("signing.receipt.downloadPdf")]})}),e.jsxs("div",{className:"bg-amber-50 rounded-xl border border-amber-200 p-6 mb-6",children:[o.signaturePromptPrimary&&e.jsx("p",{className:"text-sm text-amber-700 whitespace-pre-wrap mb-3",children:o.signaturePromptPrimary}),o.signaturePromptSecondary&&e.jsx("p",{className:"text-sm text-amber-700 whitespace-pre-wrap mb-3",children:o.signaturePromptSecondary}),!o.signaturePromptPrimary&&!o.signaturePromptSecondary&&o.signaturePrompt&&e.jsx("p",{className:"text-sm text-amber-700 whitespace-pre-wrap mb-3",children:o.signaturePrompt}),e.jsx("p",{className:"text-sm font-medium text-amber-800",children:r("signing.acknowledgment")})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-800 mb-4",children:r("signing.signatureSection")}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsx("button",{onClick:()=>{P("drawn"),u()},className:`flex-1 py-2 px-4 rounded-lg font-medium transition-colors ${p==="drawn"?"bg-blue-600 text-white":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:r("signing.drawSignature")}),e.jsx("button",{onClick:()=>{P("typed"),u()},className:`flex-1 py-2 px-4 rounded-lg font-medium transition-colors ${p==="typed"?"bg-blue-600 text-white":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:r("signing.typeSignature")})]}),p==="drawn"?e.jsxs("div",{className:"relative",children:[e.jsx("canvas",{ref:n,width:400,height:150,className:"w-full border-2 border-dashed border-slate-300 rounded-lg bg-white cursor-crosshair touch-none",onMouseDown:i,onMouseMove:c,onMouseUp:h,onMouseLeave:h,onTouchStart:i,onTouchMove:c,onTouchEnd:h}),e.jsx("p",{className:"text-xs text-slate-500 mt-2 text-center",children:r("signing.drawHint")})]}):e.jsxs("div",{children:[e.jsx("input",{type:"text",value:x,onChange:a=>B(a.target.value),placeholder:r("signing.typePlaceholder"),className:"w-full px-4 py-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-center",style:{fontFamily:'"Dancing Script", "Brush Script MT", cursive',fontSize:"24px"}}),x&&e.jsx("div",{className:"mt-4 p-4 border border-slate-200 rounded-lg bg-slate-50",children:e.jsx("p",{className:"text-center",style:{fontFamily:'"Dancing Script", "Brush Script MT", cursive',fontSize:"32px",color:"#1e40af"},children:x})})]}),e.jsx("button",{onClick:u,className:"mt-4 w-full py-2 px-4 border border-slate-300 rounded-lg text-slate-700 hover:bg-slate-50 transition-colors",children:r("signing.clearSignature")})]}),e.jsx("button",{onClick:m,disabled:!W||b.isPending,className:`w-full py-4 px-6 rounded-xl font-semibold text-lg transition-all ${W&&!b.isPending?"bg-blue-600 text-white hover:bg-blue-700 shadow-lg shadow-blue-200":"bg-slate-200 text-slate-400 cursor-not-allowed"}`,children:b.isPending?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("signing.submitting")]}):r("signing.submit")}),b.isError&&e.jsx("div",{className:"mt-4 p-4 bg-red-50 border border-red-200 rounded-xl text-red-700 text-center",children:((X=(V=(A=b.error)==null?void 0:A.response)==null?void 0:V.data)==null?void 0:X.message)||r("signing.error")}),e.jsx("p",{className:"text-center text-xs text-slate-500 mt-8",children:r("signing.footer",{orgName:o.organization.name})})]})})}export{Te 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.