PageSourceSearch

https://www.elevolt.co.ke/_next/static/chunks/1025-9073a5a8be6b47e9.js

js elevolt.co.ke collected 2026-10-04 21:44:28 UTC 26,226 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="e8c7db02-2aaf-4e7e-8f2f-b800c0ebc19f",e._sentryDebugIdIdentifier="sentry-dbid-e8c7db02-2aaf-4e7e-8f2f-b800c0ebc19f")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1025],{11025:function(e,a,n){n.d(a,{Z:function(){return z}});var s=n(52322),t=n(13980),i=n.n(t),r=n(2784),l=n(97203),o=n(14010),c=n(87686),d=n(60418),u=n(62202),m=n(88393),p=n(82036),v=n(84475);let y={addon:"ai_analysis_pack",name:"AI Analysis Pack",credits:100,priceKes:3900,validityDays:30};var h=n(41798);let x={401:"Your session expired. Please sign in again to continue your purchase.",403:"Only administrators can purchase AI credits for this organization.",404:"That credit pack is no longer available. Please refresh and try again.",409:"A purchase is already in progress. Please wait a moment before trying again.",422:"We could not start this purchase. Please confirm your organization has an active subscription and try again.",429:"Too many attempts. Please wait a minute and try again."},b=(e,a)=>{var n,s,t,i;return x[e]?x[e]:"number"==typeof e&&e>=500?"Our payments service is having trouble. Please try again in a few minutes.":(null==a?void 0:null===(s=a.response)||void 0===s?void 0:null===(n=s.data)||void 0===n?void 0:n.message)||(null==a?void 0:null===(i=a.response)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.error)||"Failed to start your purchase. Please try again."},g=e=>{let a=(0,o.NL)(),n=(0,c.D)({mutationFn:async function(){var e;let{addon:a=y.addon}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null===(e=(await d.Z.post("".concat(p.JW,"tenant/subscriptions/addons"),{addon:a},{withCredentials:!0,headers:{...(0,v.g0)(),"x-elv-realm":"hr"}})).data)||void 0===e?void 0:e.data},onSuccess:()=>{a.invalidateQueries({queryKey:h.Ll.all}),a.invalidateQueries({queryKey:["tenantInvoices"]}),a.invalidateQueries({queryKey:["billing","tenant",e]}),a.invalidateQueries({queryKey:["ai-usage-stats"]})},onError:(a,n)=>{var s;let t=null==a?void 0:null===(s=a.response)||void 0===s?void 0:s.status;u.default.error(b(t,a)),(0,m.N2)(a,"useTenantAiCreditsPurchase.purchase",{tenantId:e,addon:(null==n?void 0:n.addon)||y.addon,statusCode:t})},meta:{expected404:!0}}),s=(0,c.D)({mutationFn:async e=>{let{sid:a,reason:n}=e;return(await d.Z.delete("".concat(p.JW,"tenant/subscriptions/").concat(a),{data:n?{reason:n,immediate:!0}:{immediate:!0},withCredentials:!0,headers:{...(0,v.g0)(),"x-elv-realm":"hr"}})).data},onSuccess:(n,s)=>{u.default.success("Order cancelled."),a.invalidateQueries({queryKey:h.Ll.all}),a.invalidateQueries({queryKey:["billing","tenant",e]}),a.removeQueries({queryKey:["tenant-subscription",s.sid]})},onError:(a,n)=>{var s;let t=null==a?void 0:null===(s=a.response)||void 0===s?void 0:s.status;u.default.error(b(t,a)),(0,m.N2)(a,"useTenantAiCreditsPurchase.cancel",{tenantId:e,sid:null==n?void 0:n.sid,statusCode:t})},meta:{expected404:!0}});return{purchasePack:n.mutateAsync,cancelPurchase:s.mutateAsync,purchaseResult:n.data,isSubmitting:n.isPending,isCancelling:s.isPending,purchaseError:n.error,cancelError:s.error,resetPurchase:n.reset}};var f=n(47023),j=n(65232),N=n(76467),w=n(64792);let C=e=>{let{onSelect:a,onCancel:n,isSubmitting:t=!1}=e;return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"text-center mb-4",children:[(0,s.jsx)(N.Z,{variant:"heading3",children:"Buy AI credits"}),(0,s.jsxs)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:["Top up your team's AI analysis credits without changing your base plan. Credits are valid for ",y.validityDays," days from purchase."]})]}),(0,s.jsx)(j.ZP,{className:"border-blue ring-2 ring-blue/20",children:(0,s.jsx)(j.eW,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(N.Z,{variant:"heading4",children:y.name}),(0,s.jsxs)("div",{className:"mt-1 flex items-baseline gap-2",children:[(0,s.jsx)(N.Z,{color:"text-blue-dark",variant:"heading2",children:y.credits}),(0,s.jsx)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:"AI credits"})]})]}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)(N.Z,{variant:"heading4",children:(0,w.x)(y.priceKes,"KES")}),(0,s.jsxs)(N.Z,{color:"text-gray-500",variant:"bodySmall",children:["Valid for ",y.validityDays," days"]})]})]})})}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,s.jsx)(f.Z,{design:"secondary",onClick:n,children:"Cancel"}),(0,s.jsx)(f.Z,{disabled:t,loading:t,onClick:()=>{a(y)},children:"Continue to payment"})]})]})};C.propTypes={onSelect:i().func.isRequired,onCancel:i().func.isRequired,isSubmitting:i().bool};var Z=n(17047),_=n(1973),k=n(3175);let P=e=>{let{invoice:a,pack:n,onContinue:t,onCancel:i,isCancelling:r=!1}=e,l=(null==a?void 0:a.formatted_total)||"KES ".concat(null==n?void 0:n.priceKes
1);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)(N.Z,{variant:"heading3",children:"Complete your payment"}),(0,s.jsxs)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:["Pay ",(0,s.jsx)("strong",{children:l})," for the"," ",(0,s.jsx)("strong",{children:null==n?void 0:n.name})," (",null==n?void 0:n.credits," AI credits). Your credits activate as soon as we confirm your payment."]})]}),!!(null==a?void 0:a.payment_methods)&&(0,s.jsx)(k.Z,{daysOverdue:(null==a?void 0:a.days_overdue)||0,formattedTotal:l,invoiceNumber:null==a?void 0:a.invoice_number,isOverdue:!!(null==a?void 0:a.is_overdue),paymentMethods:a.payment_methods}),!(null==a?void 0:a.payment_methods)&&(0,s.jsx)(_.Z,{description:"Refresh this page in a moment, or check your billing page for the invoice.",design:"wrapped",message:"Payment instructions are being prepared"}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-4 gap-3 flex-wrap",children:[(0,s.jsx)(f.Z,{design:"textOnly",disabled:r,onClick:()=>{(0,Z.Z)({title:"Cancel order?",message:"Your pending order will be removed. You will need to start again if you change your mind.",confirmButtonText:"Cancel order",cancelButtonText:"Keep order",handler:i})},children:"Cancel order"}),(0,s.jsx)(f.Z,{onClick:t,children:"I've paid, waiting for confirmation"})]})]})};P.propTypes={invoice:i().object,pack:i().object,onContinue:i().func.isRequired,onCancel:i().func.isRequired,isCancelling:i().bool};var I=n(39097),S=n.n(I),A=n(59820);let q=function(e){var a,n,s;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!!e&&!1!==t.enabled,l="tenant"===t.scope?"tenant":"user",c=(0,r.useRef)(0),u=(0,r.useRef)(0),y=(0,o.NL)(),h=(0,A.a)({queryKey:["tenant"===l?"tenant-subscription":"user-subscription",e],queryFn:async()=>{c.current+=1;let a="tenant"===l?{withCredentials:!0,headers:(0,v.g0)({realm:"hr"})}:{headers:(0,v.g0)({realm:"jobs"})};try{var n;let s=await d.Z.get("".concat(p.JW).concat(l,"/subscriptions/").concat(e),a);return u.current=0,null===(n=s.data)||void 0===n?void 0:n.data}catch(e){throw u.current+=1,e}},enabled:i,refetchInterval:e=>{var a,n,s,t,r;if(!i)return!1;let o=null===(n=e.state)||void 0===n?void 0:null===(a=n.data)||void 0===a?void 0:a.status;if("active"===o||"cancelled"===o)return!1;if("tenant"===l){let a=null===(r=e.state)||void 0===r?void 0:null===(t=r.error)||void 0===t?void 0:null===(s=t.response)||void 0===s?void 0:s.status;if(403===a||404===a||u.current>=3)return!1}let d=c.current;return!(d>=48)&&(d<12?5e3:15e3)},refetchOnWindowFocus:!1,meta:"tenant"===l?{expected404:!0}:void 0});(0,r.useEffect)(()=>{h.error&&(0,m.N2)(h.error,"useSubscriptionActivationPoll",{sid:e})},[h.error,e]),(0,r.useEffect)(()=>{c.current=0,u.current=0},[e]);let x=h.data||null,b=(null==x?void 0:x.status)||null,g="active"===b,f="cancelled"===b,j=null!==(s=null===(n=h.error)||void 0===n?void 0:null===(a=n.response)||void 0===a?void 0:a.status)&&void 0!==s?s:null,N="tenant"===l&&(403===j||404===j||!!h.error&&u.current>=3),w=!g&&!f&&!N&&c.current>=48;return{subscription:x,status:b,isActive:g,isCancelled:f,isPending:"pending_payment"===b,isTimedOut:w,isErrored:N,httpStatus:j,attemptCount:c.current,error:h.error||null,queryClient:y}},R=e=>{let{sid:a,tenantId:n,onSuccess:t,onClose:i,billingHref:l="/settings/plan-billing"}=e,{isActive:o,isTimedOut:c,isErrored:d,attemptCount:u,error:m,queryClient:p}=q(a,{scope:"tenant"}),v=(0,r.useRef)(!1);return((0,r.useEffect)(()=>{o&&!v.current&&(v.current=!0,p.invalidateQueries({queryKey:["billing","tenant",n]}),p.invalidateQueries({queryKey:["ai-usage-stats"]}),t())},[o,p,n,t]),o)?(0,s.jsxs)("div",{className:"space-y-4 py-6 text-center",children:[(0,s.jsx)(N.Z,{color:"text-green-700",variant:"heading3",children:"Your credits are ready"}),(0,s.jsx)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:"Thank you. Your AI credits are now available to your team."}),(0,s.jsx)(f.Z,{onClick:i,children:"Done"})]}):d?(0,s.jsxs)("div",{className:"space-y-4 py-6 text-center",children:[(0,s.jsx)(N.Z,{color:"text-red-700",variant:"heading3",children:"We couldn't verify this order"}),(0,s.jsx)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:"We couldn't verify this order — please check your billing page. If you've already paid, your credits will still be applied once the payment is confirmed."}),(0,s.jsxs)("div",{className:"flex justify-center gap-3 pt-4 flex-wrap",children:[(0,s.jsx)(f.Z,{design:"secondary",onClick:i,children:"Close"}),(0,s.jsx)(S(),{href:l,legacyBehavior:!0,children:(0,s.jsx)(f.Z,{as:"a",children:"View billing"})})]})]}):c?(0,s.jsxs)("div",{className:"space-y-4 py-6 text-center",children:[(0,s.jsx)(N.Z,{variant:"heading3",children:"Still waiting for payment"}),(0,s.jsx)(N.Z,{color:"text-gray-600",variant:"bodySmall",children:"We haven't received confirmation yet. This usually means the payment is still being processed. You can close this dialog. We'll activate your credits as soon as payment arrives, and you can check progress on your billing page."}),(0,s.jsxs)("div",{className:"flex justify-center gap-3 pt-4 flex-wrap",children:[(0,s.jsx)(f.Z,{design:"secondary",onClick:i,children:"Close"}),(0,s.jsx)(S(),{href:l,legacyBehavior:!0,children:(0,s.jsx)(f.Z,{as:"a",children:"View billing"})})]})]}):(0,s.jsxs)("div",{className:"py-4",children:[(0,s.jsx)(_.Z,{design:"wrapped",isLoading:!0,message:"Waiting for payment confirmation..."}),(0,s.jsxs)(N.Z,{className:"text-center mt-3",color:"text-gray-500",variant:"bodySmall",children:["We're checking with our payment system. This usually takes a couple of minutes. You can safely close this dialog. Your credits will activate automatically once payment is received.",u>0&&" (Check ".concat(u,")")]}),!!m&&(0,s.jsx)(N.Z,{className:"text-center mt-2",color:"text-yellow-700",variant:"bodySmall",children:"We're having trouble reaching our servers, still trying. Your payment is safe; check your billing page if this persists."})]})};R.propTypes={sid:i().string.isRequired,tenantId:i().string,onSuccess:i().func.isRequired,onClose:i().func.isRequired,billingHref:i().string};let T={PACK:"pack",INSTRUCTIONS:"instructions",POLLING:"polling"},F=e=>{let{isOpen:a,onClose:n,tenantId:t,onSuccess:i}=e,[o,c]=(0,r.useState)(T.PACK),[d,u]=(0,r.useState)(null),[m,p]=(0,r.useState)(null),{purchasePack:v,cancelPurchase:y,isSubmitting:h,isCancelling:x,resetPurchase:b}=g(t),f=()=>{c(T.PACK),u(null),p(null),b(),n()},j=async e=>{try{let a=await v({addon:e.addon});if(!(null==a?void 0:a.sid))throw Error("Purchase response missing sid");u(e),p(a),c(T.INSTRUCTIONS)}catch(e){}},N=async()=>
1{if(!(null==m?void 0:m.sid)){f();return}try{await y({sid:m.sid}),f()}catch(e){}};return(0,s.jsx)(l.B,{centerY:!0,fullWidth:!0,maxWidth:"640px",onClose:f,show:a,title:"AI Credits",children:(0,s.jsxs)("div",{className:"py-2",children:[o===T.PACK&&(0,s.jsx)(C,{isSubmitting:h,onCancel:f,onSelect:j}),o===T.INSTRUCTIONS&&(0,s.jsx)(P,{invoice:null==m?void 0:m.latest_invoice,isCancelling:x,onCancel:N,onContinue:()=>c(T.POLLING),pack:d}),!!(o===T.POLLING&&(null==m?void 0:m.sid))&&(0,s.jsx)(R,{onClose:f,onSuccess:()=>{i&&i()},sid:m.sid,tenantId:t})]})})};F.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,tenantId:i().string,onSuccess:i().func};var z=F},41798:function(e,a,n){n.d(a,{Ll:function(){return c},oG:function(){return d}});var s=n(14010),t=n(87686),i=n(60418),r=n(62202),l=n(82036),o=n(84475);let c={all:["tenantSubscriptions"],lists:()=>[...c.all,"list"],list:e=>[...c.lists(),e],details:()=>[...c.all,"detail"],detail:e=>[...c.details(),e]},d=e=>{let a=(0,s.NL)();return(0,t.D)({mutationFn:async e=>{let{plan:a,billing_cycle:n,auto_renew:s=!0}=e;return(await i.Z.post("".concat(l.JW,"tenant/subscriptions"),{plan:a,billing_cycle:n,auto_renew:s},{withCredentials:!0,headers:{...(0,o.g0)(),"x-elv-realm":"hr"}})).data},onSuccess:()=>{r.default.success("Subscription initiated! Please complete payment to activate."),a.invalidateQueries({queryKey:c.all}),a.invalidateQueries({queryKey:["tenantInvoices"]}),a.invalidateQueries({queryKey:["billing","tenant",e]})},onError:e=>{var a,n,s,t,i,l,o,c;let d=(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(a=n.data)||void 0===a?void 0:a.message)||"Failed to create subscription",u=null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(s=t.data)||void 0===s?void 0:s.errors;if((null==e?void 0:null===(i=e.response)||void 0===i?void 0:i.status)===422&&u){if(null==u?void 0:null===(o=u.plan)||void 0===o?void 0:o.includes("already have an active subscription")){r.default.error("Your organization already has an active subscription for this plan.");return}if(null==u?void 0:null===(c=u.plan)||void 0===c?void 0:c.includes("pending payment")){r.default.error("Your organization has a pending payment. Please complete payment first.");return}}if((null==e?void 0:null===(l=e.response)||void 0===l?void 0:l.status)===403){r.default.error("Only administrators can manage subscriptions.");return}r.default.error(d)}})}},3175:function(e,a,n){n.d(a,{Z:function(){return j}});var s=n(52322),t=n(2784),i=n(13980),r=n.n(i),l=n(92942),o=n(2369),c=n(79663),d=n(65405),u=n(51634),m=n(76467),p=n(62202),v=n(27160),y=n(47023);let h=(0,t.memo)(function(e){let{label:a,value:n,onCopy:t,isCopied:i=!1,highlight:r=!1}=e;return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between p-4 gap-2 sm:gap-4 ".concat(r?"bg-gray-50":""),children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[(0,s.jsx)(m.Z,{color:"text-gray-500",size:"text-sm",variant:"label",children:a}),(0,s.jsx)(m.Z,{className:"break-words ".concat(r?"text-lg":""),variant:"labelValue",children:n})]}),!!t&&(0,s.jsxs)(y.Z,{className:"self-end sm:self-auto",design:"ghost",onClick:t,size:"sm",type:"button",children:[!!i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-green-600",icon:o.LEp}),(0,s.jsx)(m.Z,{as:"span",className:"ml-2",color:"text-green-600",variant:"bodySmall",children:"Copied!"})]}),!i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.FontAwesomeIcon,{icon:o.kZ_}),(0,s.jsx)(m.Z,{as:"span",className:"ml-2",variant:"bodySmall",children:"Copy"})]})]})]})});h.propTypes={label:r().string.isRequired,value:r().string.isRequired,onCopy:r().func,isCopied:r().bool,highlight:r().bool};let x=e=>{let{details:a,invoiceNumber:n}=e,[i,r]=(0,t.useState)(null),c=(0,t.useCallback)(async(e,a)=>{await (0,v.v)(e)?(r(a),p.default.success("".concat(a," copied to clipboard")),setTimeout(()=>r(null),2e3)):p.default.error("Failed to copy. Please copy manually.")},[]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mt-2 md:mt-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-blue-600 mt-1",icon:o.sqG}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)(m.Z,{className:"text-blue-900 mb-1",variant:"labelValue",children:"Important: Payment Reference"}),(0,s.jsxs)(m.Z,{className:"text-blue-800",size:"text-sm",variant:"body",children:["Always use"," ",(0,s.jsx)("code",{className:"px-1.5 py-0.5 bg-blue-100 rounded font-mono font-semibold",children:n})," ","as your payment reference to ensure quick processing."]})]})]})}),(0,s.jsxs)("div",{className:"rounded-lg border divide-y divide-gray-200",children:[(0,s.jsx)(h,{isCopied:"Bank Name"===i,label:"Bank Name",onCopy:()=>c(a.bank_name,"Bank Name"),value:a.bank_name}),(0,s.jsx)(h,{isCopied:"Account Name"===i,label:"Account Name",onCopy:()=>c(a.account_name,"Account Name"),value:a.account_name}),(0,s.jsx)(h,{highlight:!0,isCopied:"Account Number"===i,label:"Account Number",onCopy:()=>c(a.account_number,"Account Number"),value:a.account_number}),(0,s.jsx)(h,{label:"Branch",value:a.branch}),!!a.swift_code&&(0,s.jsx)(h,{isCopied:"SWIFT Code"===i,label:"SWIFT Code",onCopy:()=>c(a.swift_code,"SWIFT Code"),value:a.swift_code}),(0,s.jsx)(h,{highlight:!0,isCopied:"Payment Reference"===i,label:"Payment Reference",onCopy:()=>c(a.reference,"Payment Reference"),value:a.reference})]}),(0,s.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-gray-600 mt-1",icon:o.sqG}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(m.Z,{className:"text-gray-700",size:"text-sm",variant:"body",children:"Bank transfers typically take 1-2 business days to process. Your subscription will be activated once payment is confirmed."})})]})})]})};
1x.propTypes={details:r().shape({bank_name:r().string.isRequired,account_name:r().string.isRequired,account_number:r().string.isRequired,branch:r().string.isRequired,swift_code:r().string,reference:r().string.isRequired}).isRequired,invoiceNumber:r().string.isRequired};let b=(0,t.memo)(function(e){let{details:a}=e;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"bg-gradient-to-br from-green-50 to-green-100 border-green-200 rounded-lg p-4 mt-2 md:mt-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-green-700",icon:o.bJI,size:"lg"}),(0,s.jsx)(m.Z,{className:"text-green-900",variant:"heading4",children:"M-Pesa PayBill"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(m.Z,{className:"text-green-700",size:"text-sm",variant:"label",children:"Business Number"}),(0,s.jsx)(m.Z,{className:"text-green-900 font-bold mt-1",size:"text-2xl",variant:"stat",children:a.business_number})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(m.Z,{className:"text-green-700",size:"text-sm",variant:"label",children:"Account Number"}),(0,s.jsx)(m.Z,{className:"text-green-900 font-bold mt-1",size:"text-2xl",variant:"stat",children:a.account_number})]})]}),(0,s.jsxs)("div",{className:"pt-4 border-t border-green-300",children:[(0,s.jsx)(m.Z,{className:"text-green-700",size:"text-sm",variant:"label",children:"Amount to Pay"}),(0,s.jsx)(m.Z,{className:"text-green-900 font-bold mt-1",size:"text-3xl",variant:"stat",children:a.formatted_amount})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(m.Z,{variant:"heading4",children:"How to Pay"}),(0,s.jsx)("ol",{className:"space-y-3",children:a.instructions.map((e,a)=>(0,s.jsxs)("li",{className:"flex gap-3",children:[(0,s.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-blue flex items-center justify-center",children:(0,s.jsx)(m.Z,{as:"span",color:"text-white",variant:"captionMedium",weight:"font-semibold",children:a+1})}),(0,s.jsx)("div",{className:"flex-1 pt-1",children:(0,s.jsx)(m.Z,{className:"leading-relaxed",size:"text-sm",variant:"body",children:e})})]},a))})]}),(0,s.jsx)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-green-600 mt-1",icon:o.f8k}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(m.Z,{className:"text-green-900",size:"text-sm",variant:"body",children:"You'll receive an M-Pesa confirmation SMS immediately after successful payment. Your subscription will be activated within a few minutes."})})]})})]})});b.propTypes={details:r().shape({business_number:r().string.isRequired,account_number:r().string.isRequired,amount:r().number.isRequired,formatted_amount:r().string.isRequired,instructions:r().arrayOf(r().string).isRequired}).isRequired};let g=e=>{let{paymentMethods:a,invoiceNumber:n,formattedTotal:i}=e,{bank_transfer:r,mpesa_paybill:c}=a,d=(0,t.useCallback)(async()=>{if(!r)return;let e="Payment Details for ".concat(n,"\n\nBank: ").concat(r.bank_name,"\nAccount Name: ").concat(r.account_name,"\nAccount Number: ").concat(r.account_number,"\nBranch: ").concat(r.branch,"\n").concat(r.swift_code?"SWIFT: ".concat(r.swift_code,"\n"):"","Reference: ").concat(r.reference,"\nAmount: ").concat(i).trim();try{navigator.share?await navigator.share({title:"Payment for ".concat(n),text:e}):await (0,v.v)(e)?p.default.success("Payment details copied to clipboard"):p.default.error("Unable to share payment details")}catch(e){"AbortError"!==e.name&&console.error("Share failed:",e)}},[r,n,i]),u=(0,t.useCallback)(()=>{if(!c)return;let e="mpesa://paybill?businessNumber=".concat(c.business_number,"&accountNumber=").concat(c.account_number,"&amount=").concat(c.amount);try{window.location.href=e,setTimeout(()=>{(0,p.default)("If M-Pesa app did not open, please follow the manual instructions above",{duration:4e3})},2e3)}catch(e){console.error("M-Pesa deep link failed:",e),p.default.error("Unable to open M-Pesa app. Please use manual instructions.")}},[c]);return r||c?(0,s.jsxs)("div",{className:"mobile-payment-actions space-y-3 md:hidden mt-4",children:[!!c&&(0,s.jsxs)(y.Z,{className:"w-full",design:"primary",onClick:u,size:"lg",type:"button",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"mr-2",icon:o.bJI}),"Pay with M-Pesa App"]}),!!r&&(0,s.jsxs)(y.Z,{className:"w-full",design:"secondary",onClick:d,size:"lg",type:"button",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"mr-2",icon:o.EfQ}),"Share Bank Details"]}
1)]}):null};g.propTypes={paymentMethods:r().shape({bank_transfer:r().object,mpesa_paybill:r().object}).isRequired,invoiceNumber:r().string.isRequired,formattedTotal:r().string.isRequired};let f=e=>{let{paymentMethods:a,invoiceNumber:n,isOverdue:i=!1,daysOverdue:r=0,formattedTotal:p}=e,v=!!(null==a?void 0:a.bank_transfer),y=!!(null==a?void 0:a.mpesa_paybill),[h,f]=(0,t.useState)(y?1:0);return v||y?(0,s.jsxs)("section",{className:"payment-methods-section border-t border-gray-200 pt-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 mb-4",children:[(0,s.jsx)(m.Z,{variant:"heading3",children:"Payment Options"}),!!i&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-red-100 text-red-800 rounded-full",children:[(0,s.jsx)(l.FontAwesomeIcon,{icon:o.eHv,size:"sm"}),(0,s.jsxs)(m.Z,{className:"text-red-800",size:"text-sm",variant:"labelValue",children:[r," ",1===r?"Day":"Days"," Overdue"]})]})]}),!!i&&(0,s.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(l.FontAwesomeIcon,{className:"text-red-600 mt-1",icon:o.eHv}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)(m.Z,{className:"text-red-900 mb-1",variant:"labelValue",children:"Payment Overdue"}),(0,s.jsx)(m.Z,{className:"text-red-800",size:"text-sm",variant:"body",children:"This invoice is overdue. Please complete payment as soon as possible to avoid service interruption."})]})]})}),(0,s.jsx)("div",{className:"bg-gray-50 rounded-lg p-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)(m.Z,{className:"text-gray-600",size:"text-sm",variant:"label",children:"Amount to Pay"}),(0,s.jsx)(m.Z,{className:"text-gray-900",size:"text-3xl",variant:"stat",children:p})]})}),(0,s.jsxs)(c.ZP,{className:"payment-methods-tabs",index:h,justify:"start",lazyMount:!1,onChange:f,children:[!!v&&(0,s.jsx)(d.Z,{icon:(0,s.jsx)(l.FontAwesomeIcon,{className:"mr-2",icon:o.bhf,size:"1x"}),label:"Bank Transfer"}),!!y&&(0,s.jsx)(d.Z,{icon:(0,s.jsx)(l.FontAwesomeIcon,{className:"mr-2",icon:o.bJI,size:"1x"}),label:"M-Pesa"}),!!v&&(0,s.jsx)(u.Z,{children:(0,s.jsx)(x,{details:a.bank_transfer,invoiceNumber:n})}),!!y&&(0,s.jsx)(u.Z,{children:(0,s.jsx)(b,{details:a.mpesa_paybill})})]}),(0,s.jsx)(g,{formattedTotal:p,invoiceNumber:n,paymentMethods:a})]}):null};f.propTypes={paymentMethods:r().shape({bank_transfer:r().shape({bank_name:r().string,account_name:r().string,account_number:r().string,branch:r().string,swift_code:r().string,reference:r().string}),mpesa_paybill:r().shape({business_number:r().string,account_number:r().string,amount:r().number,formatted_amount:r().string,instructions:r().arrayOf(r().string)})}).isRequired,invoiceNumber:r().string.isRequired,isOverdue:r().bool,daysOverdue:r().number,formattedTotal:r().string.isRequired};var j=f},27160:function(e,a,n){n.d(a,{v:function(){return s}});async function s(e){if(!e)return!1;if(navigator.clipboard&&window.isSecureContext)try{return await navigator.clipboard.writeText(e),!0}catch(e){console.error("Clipboard API failed:",e)}try{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",a.setAttribute("readonly",""),document.body.appendChild(a),a.select(),a.setSelectionRange(0,e.length);let n=document.execCommand("copy");return document.body.removeChild(a),n}catch(e){return console.error("Fallback copy failed:",e),!1}}},64792:function(e,a,n){n.d(a,{x:function(){return s}});let s=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"KES";return new Intl.NumberFormat("en-KE",{style:"currency",currency:a,minimumFractionDigits:2}).format(null!=e?e:0)}}}]);

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.