(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75379,e=>{"use strict";function t(e,t){let r=t.toUpperCase(),a="KES"===r;return new Intl.NumberFormat("en-US",{style:"currency",currency:r,...a?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}).format(e/100)}let r="Africa/Nairobi";e.s(["formatEventDate",0,function(e){return new Intl.DateTimeFormat("en-GB",{timeZone:r,weekday:"short",day:"numeric",month:"short",year:"numeric"}).format(new Date(e))},"formatEventTime",0,function(e){return new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",minute:"2-digit",hour12:!0}).format(new Date(e))},"formatPrice",0,t,"formatPriceFrom",0,function(e,r){return null===e?"—":0===e?"FREE":`From ${t(e,r)}`}])},17303,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(18566),n=e.i(75379);e.s(["default",0,function({organizerId:e,method:i,verified:o,owedCents:s,currency:c,inFlight:m}){let u=(0,a.useRouter)(),[l,f]=(0,r.useState)(!1),[p,d]=(0,r.useState)(null);if(m)return(0,t.jsx)("span",{className:"text-xs font-medium text-[color:var(--pill-warn-fg)]",children:"Payout in progress…"});if(s<=0)return(0,t.jsx)("span",{className:"text-xs text-be-muted",children:"Settled"});if(!i)return(0,t.jsx)("span",{className:"text-xs text-be-muted",children:"No payout account"});if("mpesa"===i&&!o)return(0,t.jsx)("span",{className:"text-xs text-[color:var(--pill-warn-fg)]",children:"Awaiting verification"});async function x(e,t){d(null),f(!0);let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json().catch(()=>({}));(f(!1),r.ok)?u.refresh():d(a.error||"Payout failed")}async function h(){confirm(`Send ${(0,n.formatPrice)(s,c)} via M-Pesa now?`)&&await x("/api/payouts/run",{organizerId:e})}async function y(){let t=prompt(`Record a bank transfer of ${(0,n.formatPrice)(s,c)}. Enter the bank reference:`);t&&await x("/api/payouts/mark-paid",{organizerId:e,reference:t})}return(0,t.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:"mpesa"===i?h:y,disabled:l,className:"be-act be-act-primary",children:l?"Working…":"mpesa"===i?`Pay ${(0,n.formatPrice)(s,c)}`:`Mark paid ${(0,n.formatPrice)(s,c)}`}),p&&(0,t.jsx)("span",{className:"text-xs text-[color:var(--pill-danger-fg)]",children:p})]})}])}]);