module.exports=[90075,a=>{"use strict";function b(a,b){let c=b.toUpperCase(),d="KES"===c;return new Intl.NumberFormat("en-US",{style:"currency",currency:c,...d?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}).format(a/100)}let c="Africa/Nairobi";a.s(["formatEventDate",0,function(a){return new Intl.DateTimeFormat("en-GB",{timeZone:c,weekday:"short",day:"numeric",month:"short",year:"numeric"}).format(new Date(a))},"formatEventTime",0,function(a){return new Intl.DateTimeFormat("en-GB",{timeZone:c,hour:"numeric",minute:"2-digit",hour12:!0}).format(new Date(a))},"formatPrice",0,b,"formatPriceFrom",0,function(a,c){return null===a?"—":0===a?"FREE":`From ${b(a,c)}`}])},34839,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(90075);a.s(["default",0,function({requestId:a,status:f,amountCents:g,currency:h}){let i=(0,d.useRouter)(),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(null);async function n(a,b){m(null),k(!0);let c=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json().catch(()=>({}));(k(!1),c.ok)?i.refresh():m(d.error||"Action failed")}async function o(){confirm(`Approve this ${(0,e.formatPrice)(g,h)} advance request?`)&&await n("/api/financing/resolve",{requestId:a,action:"approve"})}async function p(){let b=prompt("Reason for rejecting (optional):")??void 0;await n("/api/financing/resolve",{requestId:a,action:"reject",note:b})}async function q(){let b=prompt(`Record disbursement of ${(0,e.formatPrice)(g,h)}. Enter a reference (M-Pesa code, bank ref, etc.):`);b&&await n("/api/financing/disburse",{requestId:a,reference:b})}return"pending"===f?(0,b.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("button",{type:"button",onClick:o,disabled:j,className:"be-act be-act-primary",children:"Approve"}),(0,b.jsx)("button",{type:"button",onClick:p,disabled:j,className:"be-act be-act-ghost",children:"Reject"})]}),l&&(0,b.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:l})]}):"approved"===f?(0,b.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,b.jsx)("button",{type:"button",onClick:q,disabled:j,className:"be-act be-act-primary",children:j?"Working…":"Disburse"}),l&&(0,b.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:l})]}):null}])}];

//# sourceMappingURL=src_1_shaah._.js.map