(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17658,e=>{"use strict";var t=e.i(43476);function r(...e){return e.filter(Boolean).join(" ")}e.i(22016);let i={primary:"bg-brand-green text-white hover:bg-brand-green-deep focus-visible:ring-brand-green",secondary:"border border-be-border bg-be-surface text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",ghost:"text-be-muted hover:text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",danger:"bg-[color:var(--pill-danger-fg)] text-white hover:opacity-90 focus-visible:ring-[color:var(--pill-danger-fg)]"};e.s(["Card",0,function({className:e,children:i}){return(0,t.jsx)("div",{className:r("be-card p-5",e),children:i})},"buttonClass",0,function(e="primary",t){return r("inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-be-bg disabled:opacity-50 disabled:pointer-events-none",i[e],t)}])},6631,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(18566),n=e.i(17658);e.s(["default",0,function(){let e=(0,i.useRouter)(),[s,a]=(0,r.useState)(""),[o,l]=(0,r.useState)(""),[u,c]=(0,r.useState)(null),[d,b]=(0,r.useState)(!1);async function f(t){t.preventDefault();let r=Math.round(100*Number(s));if(!Number.isFinite(r)||r<=0)return void c("Enter a valid amount");c(null),b(!0);let i=await fetch("/api/financing/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amountCents:r,note:o.trim()||void 0})}),n=await i.json().catch(()=>({}));(b(!1),i.ok)?e.refresh():c(n.error||"Request failed")}return(0,t.jsxs)("form",{onSubmit:f,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:"Amount (KES)"}),(0,t.jsx)("input",{required:!0,type:"number",min:"1",step:"1",placeholder:"500000",value:s,onChange:e=>a(e.target.value),className:"input"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:"What's it for? (optional)"}),(0,t.jsx)("textarea",{rows:3,placeholder:"Working capital for next event's venue deposit",value:o,onChange:e=>l(e.target.value),className:"input"})]}),u&&(0,t.jsx)("p",{className:"text-sm text-[color:var(--pill-danger-fg)]",children:u}),(0,t.jsx)("button",{type:"submit",disabled:d,className:(0,n.buttonClass)("primary"),children:d?"Requesting…":"Request funds"}),(0,t.jsx)("p",{className:"text-xs text-be-muted",children:"Repayment is a flat 12% of each future payout until the advance is repaid. Approval typically takes under 48h."})]})}])}]);