PageSourceSearch

https://aid4ummah.org/_next/static/chunks/pages/customer-portal-9cebb0ed85524398.js

js aid4ummah.org collected 2026-10-04 02:12:00 UTC 40,042 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{65445:function(e,t,r){"use strict";r.d(t,{By:function(){return u},CK:function(){return p},eZ:function(){return m},wq:function(){return d}});var n=r(59499),a=r(58480),i=r(34597);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s="bb003e8b0bfe4c3292770911e39252cb",o="https://iclerk-backend-api.xiots.co.uk/",d=function(e){return(0,a.pC)("".concat(o,"invoice/api/public/website/invoice/"),"post",e,{tenant:s})},u=function(e){return(0,a.pC)("".concat(o,"payment/api/stripe/public/payment-intent/"),"post",e,{tenant:s})},m=function(){return(0,a.pC)("".concat(o,"payment/api/stripe/setup-intent/"),"post",null,l({tenant:s},(0,i.g0)()))},p=function(e){return(0,a.pC)("".concat(o,"invoice/api/recursive-subs/"),"post",e,l({tenant:s},(0,i.g0)()))}},34597:function(e,t,r){"use strict";r.d(t,{BY:function(){return b},Gy:function(){return p},RT:function(){return g},VH:function(){return m},WB:function(){return h},g0:function(){return o},gn:function(){return f},lx:function(){return u},r5:function(){return v},w:function(){return d}});var n=r(59499),a=r(58480);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="bb003e8b0bfe4c3292770911e39252cb",s="https://iclerk-backend-api.xiots.co.uk/",o=function(){try{var e=JSON.parse(localStorage.getItem("user")),t=(null==e?void 0:e.knox)||(null==e?void 0:e.token);if(t)return{Authorization:"token ".concat(t)}}catch(e){}return{}},d=function(e){return(0,a.pC)("".concat(s,"api/reg-customers/"),"post",{tenant_uid:l,email:e.email,password:e.password,first_name:e.firstName,last_name:e.lastName,phone:e.phone},{tenant:l})},u=function(e){return(0,a.pC)("".concat(s,"api/customer/auth/login/"),"post",{email:e.email,password:e.password,tenant_uid:l},{tenant:l})},m=function(){return(0,a.pC)("".concat(s,"customer/api/saved-cards/"),"get",null,c({tenant:l},o()))},p=function(e){return(0,a.pC)("".concat(s,"api/add-customer-default-pm/"),"post",{payment_method:e},c({tenant:l},o()))},f=function(){return(0,a.pC)("".concat(s,"api/customer/me/"),"get",null,c({tenant:l},o()))},h=function(e){return(0,a.pC)("".concat(s,"api/customer/me/"),"patch",e,c({tenant:l},o()))},g=function(e){return(0,a.pC)("".concat(s,"api/auth/pw-reset-otp/"),"post",c(c({},e),{},{tenant:l}),{tenant:l})},b=function(e){return(0,a.pC)("".concat(s,"api/public/confirm-otp/"),"post",e,{tenant:l})},v=function(e){return(0,a.pC)("".concat(s,"api/auth/password/reset/confirm/"),"post",e,{tenant:l})}},85109:function(e,t,r){"use strict";var n=r(83307),a=r(35944);t.Z=function(e){var t=e.className;return(0,a.tZ)("div",{className:(0,n.cn)("text-primary h-5 w-5 flex justify-center items-center mx-auto animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",t),role:"status",children:(0,a.tZ)("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})}},34451:function(e,t,r){"use strict";r.d(t,{y:function(){return f}});var n=r(16835),a=r(50029),i=r(64687),c=r.n(i),l=r(9008),s=r.n(l),o=r(67294),d=r(57460),u=r.n(d),m=[{name:r(16054).S.name,type:"AggregateRating",ratingValue:"3.4",reviewRating:"5",bestRating:"5",worstRating:"1",ratingCount:"438"}],p=r(35944),f=function(){var e=(0,o.useState)([]),t=e[0],r=e[1];(0,o.useEffect)(function(){var e;(e=(0,a.Z)(c().mark(function e(){var t,a;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/reviews.csv");case 3:return t=e.sent,e.next=6,t.text();case 6:return a=e.sent,e.next=9,n(a);case 9:r(e.sent),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),console.error("Error fetching reviews:",e.t0);case 16:case"end":return e.stop()}},e,null,[[0,13]])})),function(){return e.apply(this,arguments)})()},[]);var n=function(e){return new Promise(function(t,r){u().parse(e,{header:!0,complete:function(e){t(e.data)},error:function(e){console.error("Error parsing CSV:",e),r(e)}})})}
1,i=m[0],l=i.name,d=i.type,f=i.reviewRating,g=i.ratingValue,b=i.bestRating,v=i.worstRating,x=i.ratingCount,y=t.map(function(e){return{"@type":"Review",reviewBody:e["Review Body"],author:{"@type":e.type,name:e.name},datePublished:h(e.datePublished)}});return(0,p.tZ)(s(),{children:(0,p.tZ)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"Product",name:l,aggregateRating:{"@type":d,ratingValue:g,reviewRating:f,bestRating:b,worstRating:v,ratingCount:x},reviews:y})}})})},h=function(e){var t=e.split("/"),r=(0,n.Z)(t,3),a=r[0],i=r[1],c=r[2];return"".concat(c,"-").concat(i.padStart(2,"0"),"-").concat(a.padStart(2,"0"))}},89411:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(16835),a=r(50029),i=r(64687),c=r.n(i),l=r(67294),s=r(86664),o=r(2859),d=r(58480),u=r(65445),m=r(6620),p=r(85109),f=r(35944),h=(0,o.J)("pk_live_aMNJX4pVTmRpKPDJxTwZJhcY");function g(e){var t,r=e.onSuccess,n=e.onCancel,i=(0,s.useStripe)(),o=(0,s.useElements)(),u=(0,d.dF)(),h=(0,l.useState)(!1),g=h[0],b=h[1],v=(0,l.useState)(!1),x=v[0],y=v[1],Z=(0,l.useState)(""),N=Z[0],w=Z[1],O=(0,l.useRef)(!1),S=(t=(0,a.Z)(c().mark(function e(t){var n,a;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!(!i||!o)){e.next=3;break}return e.abrupt("return");case 3:if(!O.current){e.next=5;break}return e.abrupt("return");case 5:if(x){e.next=8;break}return w("Please complete all card fields."),e.abrupt("return");case 8:return w(""),b(!0),O.current=!0,e.next=13,i.confirmSetup({elements:o,redirect:"if_required",confirmParams:{return_url:window.location.origin+"/customer-portal"}});case 13:if(n=e.sent.error,b(!1),!n){e.next=22;break}return O.current=!1,w(a=(null==n?void 0:n.message)||((null==n?void 0:n.type)==="validation_error"?"Please check your card details.":"Could not save card.")),u(a,"error"),e.abrupt("return");case 22:u("Card saved successfully","success"),null==r||r();case 24:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)});return(0,f.BX)("form",{onSubmit:S,className:"space-y-4",children:[(0,f.tZ)(s.PaymentElement,{id:"payment-element",options:{layout:"tabs",defaultCollapsed:!1,radios:!0,spacedAccentItems:!0},onChange:function(e){w(""),y(e.complete)}}),N&&(0,f.tZ)("p",{className:"text-sm text-red-600",role:"alert",children:N}),(0,f.BX)("div",{className:"flex gap-3 justify-end pt-4",children:[(0,f.tZ)(m.Z,{type:"button",variant:"outlined",onClick:n,disabled:g,children:"Cancel"}),(0,f.tZ)(m.Z,{type:"submit",variant:"contained",color:"primary",disabled:!i||!o||g||!x,children:g?(0,f.tZ)(p.Z,{className:"!text-white"}):"Save card"})]})]})}function b(e){var t=e.onSuccess,r=e.onCancel,a=e.setAddCardOpen,i=(0,d.dF)(),c=(0,l.useState)(null),o=c[0],m=c[1],b=(0,d.h_)({errMsg:!0}),v=(0,n.Z)(b,2),x=v[0],y=v[1].loading,Z=(0,l.useRef)(!1);return((0,l.useEffect)(function(){Z.current||(Z.current=!0,x((0,u.eZ)(),function(e){if(null!=e&&e.error){Z.current=!1;return}var t,r,n=null!==(t=null==e?void 0:e.client_secret)&&void 0!==t?t:null==e||null===(r=e.data)||void 0===r?void 0:r.client_secret;n?m(n):(Z.current=!1,i("Could not load form. Please try again.","error"))},function(){Z.current=!1,i("Could not load form. Please try again.","error"),a(!1)}))},[]),y||!o)?(0,f.tZ)("div",{className:"py-8 flex items-center justify-center",children:(0,f.tZ)(p.Z,{})}):(0,f.tZ)(s.Elements,{stripe:h,options:{clientSecret:o,appearance:{theme:"stripe",variables:{borderRadius:"6px"}}},children:(0,f.tZ)(g,{onSuccess:t,onCancel:r})})}},66112:function(e,t,r){"use strict";r.d(t,{d:function(){return l}});var n=r(16054),a=n.S.name,i=n.S.seotitle,c=n.S.seodescription,l={title:i,description:c,openGraph:{type:"website",locale:"en-GB",url:n.S.website,siteName:a,title:i,description:c,images:[{url:n.S.logo_url,width:1200,height:630,alt:a,type:"image/png"}]},twitter:{handle:"@handle",site:"@site",cardType:"summary_large_image"}}},7762:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ea}});var n=r(59499),a=r(16054),i=r(34451),c=r(50029),l=r(16835),s=r(64687),o=r.n(s),d=r(67294),u=r(87851),m=r(1136),p=r(12865),f=r(35384),h=r(35944);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?g(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var v=function(e){var t=e.state,r=e.setState,a=(e.errorState,e.onErrorStateChange,e.onSaveApi),i=e.updateLoading,c=(0,d.useState)(!1),l=c[0],s=c[1],o=(0,d.useState)({firstName:t.firstName,lastName:t.lastName,email:t.email,newsLetter:t.newsLetter,address:t.address,phone:t.phone}),u=o[0],m=o[1];(0,d.useEffect)(function(){m(function(e){return b(b({},e),{},{firstName:t.firstName,lastName:t.lastName,email:t.email,address:t.address,phone:t.phone})})},[t.firstName,t.lastName,t.email,t.address,t.phone]);var p=function(e){var t="checkbox"===e.target.type?e.target.checked:e.target.value;m(b(b({},u),{},(0,n.Z)({},e.target.name,t)))},g=function(){a?a(b(b({},t),u),function(){return s(!1)}):(s(!1),r(b(b({},t),u)))};return(0,h.tZ)("div",{className:"py-10",children:(0,h.BX)("div",{className:"space-y-5",children:[(0,h.tZ)("div",{children:(0,h.tZ)("button",{type:"button",onClick:function(){s(!0)},className:"px-9 rounded-lg py-2 bg-primary text-white",children:"Edit"})}),(0,h.BX)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[(0,h.BX)("div",{className:"flex flex-col gap-2",children:[(0,h.tZ)("div",{className:"text-sm font-bold",children:"First Name"}),(0,h.tZ)(f.Z,{disabled:!l,name:"firstName",value:u.firstName,onChange:p,className:"rounded-md",type:"text",fullWidth:!0})]}),(0,h.BX)("div",{className:"flex flex-col gap-2",children:[(0,h.tZ)("div",{className:"text-sm font-bold",children:"Last Name"}),(0,h.tZ)(f.Z,{disabled:!l,name:"lastName",value:u.lastName,onChange:p,className:"rounded-md",type:"text",fullWidth:!0})]}),(0,h.BX)("div",{className:"flex flex-col gap-2",children:[(0,h.tZ)("div",{className:"text-sm font-bold",children:"Email"}),(0,h.tZ)(f.Z,{disabled:!l,name:"email",value:u.email,onChange:p,className:"rounded-md",type:"text",fullWidth:!0})]}),(0,h.BX)("div",{className:"flex flex-col gap-2",children:[(0,h.tZ)("div",{className:"text-sm font-bold",children:"Phone"}),(0,h.tZ)(f.Z,{disabled:!l,name:"phone",value:u.phone||"",onChange:p,className:"rounded-md",type:"text",fullWidth:!0})]}),(0,h.BX)("div",{className:"flex flex-col gap-2 md:col-span-2",children:[(0,h.tZ)("div",{className:"text-sm font-bold",children:"Address"}),(0,h.tZ)(f.Z,{disabled:!l,name:"address",value:u.address,onChange:p,className:"rounded-md",type:"text",fullWidth:!0})]})]}),l&&(0,h.tZ)("div",{children:(0,h.BX)("button",{type:"button",onClick:function(){g()},disabled:i,className:"px-9 rounded-lg py-2 bg-primary text-white disabled:opacity-70",children:["Save",i?"...":""]})})]})})},x=r(58480),y=r(34597);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,x.pC)("".concat("https://iclerk-backend-api.xiots.co.uk/","invoice/api/recursive-subs/customer-invoices/?page=").concat(e),"get",null,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({tenant:"bb003e8b0bfe4c3292770911e39252cb"},(0,y.g0)()))},w=r(56564),O=r(55245),S=r(80626),j=r(34908),P=r(28534),k=r(62302),C=r(57210),B=r(107),_=r(7987),X=r(86796),D=r(83307),E=r(85677),R=function(){var e,t,r,n=(0,E.Z)("(max-width:768px)"),a=(0,d.useState)(1),i=a[0],c=a[1],s=(0,x.h_)({errMsg:!0}),o=(0,l.Z)(s,2),u=o[0],m=o[1],f=m.data,g=m.loading;(0,d.useEffect)(function(){u(N(i),function(){})},[i]);var b=null!==(e=null!==(t=null!==(r=null==f?void 0:f.data)&&void 0!==r?r:null==f?void 0:f.results)&&void 0!==t?t:f)&&void 0!==e?e:[];return(0,h.BX)("div",{className:"py-10",children:[(0,h.tZ)("div",{className:"md:px-8 px-2",children:g?(0,h.tZ)(p.Z,{className:"flex justify-center py-10",children:(0,h.tZ)(w.Z,{})}):0===b.length?(0,h.tZ)(p.Z,{className:"text-center py-12",children:(0,h.tZ)(O.Z,{variant:"h6",gutterBottom:!0,children:"No Invoice found"})}):n?(0,h.tZ)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-5 py-6",children:null==b?void 0:b.map(function(e){return(0,h.BX)(p.Z,{className:"relative overflow-hidden rounded-2xl border border-gray-200 bg-white p-5 md:p-6 shadow-sm transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5",children:[(0,h.tZ)("div",{className:"absolute -top-16 -right-14 w-32 h-32 rounded-full bg-emerald-100/70 blur-2xl pointer-events-none"}),(0,h.tZ)("div",{className:"absolute -bottom-16 -left-14 w-32 h-32 rounded-full bg-teal-100/70 blur-2xl pointer-events-none"}),(0,h.BX)("div",{className:"relative z-10",children:[(0,h.BX)("div",{className:"flex items-start justify-between gap-4",children:[(0,h.tZ)("div",{children:(0,h.tZ)("p",{className:"text-xs uppercase tracking-[0.2em] text-gray-500 font-semibold",children:"Invoice"})}),(0,h.tZ)("span",{className:"px-5 py-1 rounded-md text-base font-semibold  text-primary uppercase",children:e.number||""})]}),(0,h.BX)("div",{className:"mt-5 grid grid-cols-2 gap-3",children:[(0,h.BX)("div",{className:"rounded-xl bg-emerald-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-emerald-700",children:"Status"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-emerald-900 mt-1 capitalize",children:e.status||"-"})]}),(0,h.BX)("div",{className:"rounded-xl bg-sky-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-sky-700",children:"Paid at"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-sky-900 mt-1",children:e.paid_at?(0,D.o0)(e.paid_at):"-"})]}),(0,h.BX)("div",{className:"rounded-xl bg-sky-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-sky-700",children:"Payment Method"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold  mt-1",children:(0,D.Hb)(e.payment_method_details)})]}),(0,h.BX)("div",{className:"rounded-xl bg-sky-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-sky-700",children:"Amount Paid"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-sky-900 mt-1",children:e.charged_amount?"\xa3".concat(e.charged_amount):"-"})]})]})]})]},e.uid)})}):(0,h.tZ)(j.Z,{component:P.Z,elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:"grey.200"},children:(0,h.BX)(k.Z,{children:[(0,h.tZ)(C.Z,{children:(0,h.BX)(B.Z,{sx:{bgcolor:"grey.50"},children:[(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Invoice"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Status"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Paid at"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Payment Method"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Amount"})]})}),(0,h.tZ)(X.Z,{children:null==b?void 0:b.map(function(e){var t;return(0,h.BX)(B.Z,{hover:!0,sx:{"&:last-child td":{border:0}},children:[(0,h.tZ)(_.Z,{children:e.number||"—"}),(0,h.tZ)(_.Z,{sx:{textTransform:"capitalize"},children:e.status||"—"}),(0,h.tZ)(_.Z,{children:e.paid_at?(0,D.o0)(e.paid_at):"—"}),(0,h.tZ)(_.Z,{children:null!==(t=(0,D.Hb)(e.payment_method_details))&&void 0!==t?t:""}),(0,h.tZ)(_.Z,{children:e.charged_amount?"\xa3".concat(e.charged_amount):"—"})]},e.uid)})})]})})}),(0,h.tZ)("div",{className:"flex justify-end mt-5",children:(0,h.tZ)(S.Z,{count:Math.ceil(((null==f?void 0:f.count)||0)/10)||1,page:i,onChange:function(e,t){return c(t)},color:"primary",shape:"rounded"})})]})}
1,A=r(66884),W=r(93417),T=r(6620),I=r(24383),M=r(8091),z=r(87508),J=r(43304),H=r(89411);function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var V=function(){var e=(0,x.dF)(),t=(0,d.useState)([]),r=t[0],a=t[1],i=(0,A.Z)(),c=(0,W.Z)(i.breakpoints.down("md")),s=(0,d.useState)(!1),o=s[0],u=s[1],m=(0,d.useState)(null),f=m[0],g=m[1],b=(0,x.h_)({errMsg:!0}),v=(0,l.Z)(b,2),Z=v[0],N=v[1].loading,O=(0,x.h_)({errMsg:!0,successMsg:!1}),S=(0,l.Z)(O,2),E=S[0],R=S[1].loading,V=function(e){Z((0,y.VH)(),function(t){if(null!=t&&t.error)null==e||e();else{var r=(null==t?void 0:t.data)||(null==t?void 0:t.fullRes)||[];a(Array.isArray(r)?r:[]),null==e||e(r)}})};(0,d.useEffect)(function(){V()},[]);var F=function(t){g(t),E((0,y.Gy)(t),function(t){if(null!=t&&t.error){g(null);return}e("Default card updated.","success"),V(function(){return g(null)})})};return N&&0===r.length?(0,h.tZ)("div",{className:"py-10 flex items-center justify-center",children:(0,h.tZ)(w.Z,{})}):(0,h.BX)("div",{className:"py-8 px-2  mx-auto",children:[(0,h.tZ)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-end gap-4 mb-8",children:(0,h.tZ)(T.Z,{variant:"contained",color:"primary",className:"text-white",onClick:function(){return u(!0)},sx:{textTransform:"none",fontWeight:600},children:"Add card"})}),0===r.length?(0,h.BX)(P.Z,{elevation:0,sx:{p:4,textAlign:"center",borderRadius:2,border:"1px dashed",borderColor:"grey.300",bgcolor:"grey.50"},children:[(0,h.tZ)("p",{className:"text-gray-600 mb-1",children:"No saved cards yet."}),(0,h.tZ)("p",{className:"text-sm text-gray-500",children:"Add a card for subscriptions and faster checkout."})]}):c?(0,h.tZ)("div",{className:"grid grid-cols-1 gap-5 py-6",children:r.map(function(e){var t=e.default||e.is_default;return(0,h.BX)(p.Z,{className:"relative overflow-hidden rounded-2xl border border-gray-200 bg-white p-5 md:p-6 shadow-sm transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5 ".concat(t?"ring-1 ring-primary/30":""),children:[(0,h.tZ)("div",{className:"absolute -top-16 -right-14 w-32 h-32 rounded-full bg-emerald-100/70 blur-2xl pointer-events-none"}),(0,h.tZ)("div",{className:"absolute -bottom-16 -left-14 w-32 h-32 rounded-full bg-teal-100/70 blur-2xl pointer-events-none"}),(0,h.BX)("div",{className:"relative z-10",children:[(0,h.BX)("div",{className:"flex items-start justify-between gap-4",children:[(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-xs uppercase tracking-[0.2em] text-gray-500 font-semibold",children:"Saved card"}),(0,h.tZ)("h3",{className:"text-xl font-bold text-gray-900 mt-1",children:e.last4?"".concat(e.last4):"Card"})]}),(0,h.tZ)("span",{className:"px-3 py-1 rounded-full text-xs font-semibold ".concat(t?"bg-green-100 text-green-700":"bg-gray-100 text-gray-700"),children:t?"Default":"Saved"})]}),(0,h.BX)("div",{className:"mt-5 grid grid-cols-2 gap-3",children:[(0,h.BX)("div",{className:"rounded-xl bg-emerald-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-emerald-700",children:"Card"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-emerald-900 mt-1",children:e.last4?"".concat(e.last4):"—"})]}),(0,h.BX)("div",{className:"rounded-xl bg-sky-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-sky-700",children:"Expires"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-sky-900 mt-1",children:null!=e.exp_month&&null!=e.exp_year?"".concat(String(e.exp_month).padStart(2,"0"),"/").concat(e.exp_year):"—"})]})]}),(0,h.BX)("div",{className:"mt-5 grid grid-cols-2 gap-x-4 gap-y-3 text-sm text-gray-700",children:[(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"Brand"}),(0,h.tZ)("p",{className:"font-medium",children:(0,D.Hb)(e)||"—"})]}),(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"Country"}),(0,h.tZ)("p",{className:"font-medium",children:e.country||"—"})]})]}),(0,h.tZ)("div",{className:"mt-6 flex flex-wrap gap-3",children:t?(0,h.tZ)(T.Z,{variant:"contained",color:"primary",size:"medium",disabled:!0,sx:{minWidth:140,py:1,fontWeight:600,color:"white",textTransform:"none","&.Mui-disabled":{color:"white",backgroundColor:"primary.main",opacity:1}},children:"Default"}):(0,h.tZ)(T.Z,{size:"small",variant:"outlined",onClick:function(){return F(e.id)},disabled:f===e.id||R,sx:{minWidth:120},children:f===e.id?"Setting…":"Set as default"})})]})]},e.id||e.last4+(e.exp_month||"")+(e.exp_year||""))})}):(0,h.tZ)(j.Z,{component:P.Z,elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:"grey.200"},children:(0,h.BX)(k.Z,{children:[(0,h.tZ)(C.Z,{children:(0,h.BX)(B.Z,{sx:{bgcolor:"grey.50"},children:[(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Card"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Expires"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Brand"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Country"}),(0,h.tZ)(_.Z,{sx:{fontWeight:600},children:"Default"})]})}),(0,h.tZ)(X.Z,{children:r.map(function(e){return(0,h.BX)(B.Z,{hover:!0,sx:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?L(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({"&:last-child td":{border:0}},(e.default||e.is_default)&&{bgcolor:"action.hover"}),children:[(0,h.tZ)(_.Z,{children:e.last4?"".concat(e.last4):"—"}),(0,h.tZ)(_.Z,{children:null!=e.exp_month&&null!=e.exp_year?"".concat(String(e.exp_month).padStart(2,"0"),"/").concat(e.exp_year):"—"}),(0,h.tZ)(_.Z,{sx:{textTransform:"capitalize"},children:(0,D.Hb)(e)||"—"}),(0,h.tZ)(_.Z,{children:e.country||"—"}),(0,h.tZ)(_.Z,{children:e.default||e.is_default?(0,h.tZ)(T.Z,{variant:"contained",color:"primary",size:"medium",startIcon:(0,h.tZ)(J.Z,{}),disabled:!0,sx:{minWidth:140,py:1,fontWeight:600,color:"white",textTransform:"none","&.Mui-disabled":{color:"white",backgroundColor:"primary.main",opacity:1}},children:"Default"}):(0,h.tZ)(T.Z,{size:"small",variant:"outlined",onClick:function(){return F(e.id)},disabled:f===e.id||R,sx:{minWidth:120},children:f===e.id?"Setting…":"Set as default"})})]},e.id||e.last4+(e.exp_month||"")+(e.exp_year||""))})})]})}),(0,h.BX)(I.Z,{open:o,onClose:function(){return u(!1)},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[(0,h.tZ)(M.Z,{sx:{fontWeight:600},children:"Add a new card"}),(0,h.tZ)(z.Z,{children:(0,h.tZ)(H.Z,{setAddCardOpen:u,onSuccess:function(){u(!1);var t=0===r.length;V(function(r){t&&r.length>=1&&E((0,y.Gy)(r[0].id),function(t){null!=t&&t.error||(e("Card added and set as default.","success"),V())})})},onCancel:function(){return u(!1)}})})]})]})},F=r(37392);function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var U="https://iclerk-backend-api.xiots.co.uk/",K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,x.pC)("".concat(U,"invoice/api/recursive-subs/?page=").concat(e),"get",null,q({tenant:"bb003e8b0bfe4c3292770911e39252cb"},(0,y.g0)()))};function Y(e){var t=e.open,r=e.title,n=e.message,a=e.confirmText,i=e.cancelText,c=e.onConfirm,l=e.onCancel;return t?(0,h.tZ)(p.Z,{className:"fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-30",children:(0,h.BX)(p.Z,{className:"bg-white rounded-lg shadow-lg p-6 min-w-[300px] max-w-[90vw]",children:[(0,h.tZ)("div",{className:"font-bold text-lg mb-2",children:r}),(0,h.tZ)("div",{className:"mb-4 text-gray-700",children:n}),(0,h.BX)("div",{className:"flex justify-end gap-2",children:[(0,h.tZ)(T.Z,{variant:"outlined",onClick:l,children:i||"Cancel"}),(0,h.tZ)(T.Z,{variant:"contained",color:"primary",onClick:c,children:a||"Confirm"})]})]})}):null}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ee=function(){var e,t,r,a=d.useState(0),i=(0,l.Z)(a,2),s=i[0],f=i[1],g=(0,x.h_)({errMsg:!0}
1),b=(0,l.Z)(g,1)[0],Z=(0,x.dF)(),N=d.useState(1),O=(0,l.Z)(N,2),j=O[0],P=O[1],k=(0,x.h_)({errMsg:!0,successMsg:"Profile updated successfully."}),C=(0,l.Z)(k,2),B=C[0],_=C[1].loading,X=(0,x.h_)({errMsg:!0}),E=(0,l.Z)(X,2),A=E[0],W=E[1].loading,I=(0,x.h_)({errMsg:!0}),M=(0,l.Z)(I,1)[0],z=(0,x.h_)({errMsg:!0}),J=(0,l.Z)(z,1)[0],H=d.useState({firstName:"",lastName:"",email:"",phone:"",address:"",city:"",country:"",postcode:""}),L=(0,l.Z)(H,2),G=L[0],Q=L[1];(0,d.useEffect)(function(){var e=(0,F.is)();e&&Q(function(t){return $($({},t),{},{firstName:e.firstName||"",lastName:e.lastName||"",email:e.email||"",phone:e.phone||"",address:e.address||"",city:e.city||"",country:e.country||"",postcode:e.postcode||""})}),b((0,y.gn)(),function(e){if(null==e||!e.error){var t,r,n,a,i,c,l,s,o,d,u,m,p,f=(n=null!==(t=null!==(r=null==e?void 0:e.data)&&void 0!==r?r:null==e?void 0:e.fullRes)&&void 0!==t?t:e)?{firstName:null!==(a=null!==(i=n.first_name)&&void 0!==i?i:n.firstName)&&void 0!==a?a:"",lastName:null!==(c=null!==(l=n.last_name)&&void 0!==l?l:n.lastName)&&void 0!==c?c:"",email:null!==(s=n.email)&&void 0!==s?s:"",phone:null!==(o=n.phone)&&void 0!==o?o:"",address:null!==(d=n.address)&&void 0!==d?d:"",city:null!==(u=n.city)&&void 0!==u?u:"",country:null!==(m=n.country)&&void 0!==m?m:"",postcode:null!==(p=n.postcode)&&void 0!==p?p:""}:{};Object.keys(f).length&&Q(function(e){return $($({},e),f)})}})},[]);var ee=d.useState({firstName:!1,lastName:!1,email:!1,password:!1,address:!1}),et=(0,l.Z)(ee,2),er=et[0],en=et[1],ea=d.useState([]),ei=(0,l.Z)(ea,2),ec=ei[0],el=ei[1];function es(){A(K(j),function(e){if(null==e||!e.error){var t,r;el(null!==(t=null!==(r=null==e?void 0:e.data)&&void 0!==r?r:null==e?void 0:e.fullRes)&&void 0!==t?t:e)}})}(0,d.useEffect)(function(){3===s&&es()},[s,j]);var eo=function(e){M((0,x.pC)("".concat(U,"invoice/api/recursive-subs/").concat(e,"/"),"delete",null,q({tenant:e},(0,y.g0)())),function(e){es(),Z("Subscription deleted successfully.","success")})},ed=d.useState(!1),eu=(0,l.Z)(ed,2),em=eu[0],ep=eu[1],ef=d.useState({}),eh=(0,l.Z)(ef,2),eg=eh[0],eb=eh[1],ev=d.useState(null),ex=(0,l.Z)(ev,2),ey=ex[0],eZ=ex[1],eN=d.useState(""),ew=(0,l.Z)(eN,2),eO=ew[0],eS=ew[1],ej=function(e,t){eS(e),eZ(t.uid),"delete"===e?eb({title:"Delete Subscription",message:"Are you sure you want to delete this subscription?",confirmText:"Delete",cancelText:"Cancel"}):"status"===e&&eb({title:"Change Status",message:"Active"===t.status?"Do you want to change status to Cancelled?":"Do you want to change status to Active?",confirmText:"Active"===t.status?"Cancel Subscription":"Activate Subscription",cancelText:"Keep Current"}),ep(!0)};return(0,h.BX)("div",{children:[(0,h.tZ)("div",{className:"bg-EventsBanner bg-cover bg-center",children:(0,h.tZ)("div",{className:"text-white py-10 px-5 md:px-40 bg-gradient-to-r from-emerald-600 via-trans
1parent",children:(0,h.tZ)("div",{className:"text-5xl text-center font-bold py-10",children:"Our Respected Customer Portal"})})}),(0,h.tZ)(p.Z,{className:"px-4 md:px-20 mt-4",sx:{borderBottom:1,borderColor:"divider"},children:(0,h.tZ)(u.Z,{value:s,onChange:function(e,t){f(t)},variant:"scrollable",scrollButtons:"auto",children:[{label:"Saved Cards",value:0},{label:"Subscriptions",value:3},{label:"Invoices & Donations",value:2},{label:"Personal Information",value:1}].map(function(e){return(0,h.tZ)(m.Z,{label:e.label,value:e.value},e.value)})})}),(0,h.BX)("div",{className:"md:px-20 px-5",children:[0===s&&(0,h.BX)("div",{className:"py-2 md:py-4",children:[(0,h.BX)("div",{className:"rounded-2xl bg-gradient-to-r from-emerald-600 via-emerald-500 to-teal-500 text-white px-5 md:px-8 py-6 shadow-md",children:[(0,h.tZ)("h2",{className:"text-2xl md:text-3xl font-bold tracking-tight",children:"Saved Cards"}),(0,h.tZ)("p",{className:"text-sm md:text-base mt-1 text-emerald-50",children:"Manage your saved payment methods for subscriptions and faster checkout."})]}),(0,h.tZ)("div",{className:"mt-6",children:(0,h.tZ)(V,{})})]}),1===s&&(0,h.BX)("div",{className:"py-2 md:py-4",children:[(0,h.BX)("div",{className:"rounded-2xl bg-gradient-to-r from-emerald-600 via-emerald-500 to-teal-500 text-white px-5 md:px-8 py-6 shadow-md",children:[(0,h.tZ)("h2",{className:"text-2xl md:text-3xl font-bold tracking-tight",children:"Personal Information"}),(0,h.tZ)("p",{className:"text-sm md:text-base mt-1 text-emerald-50",children:"Update your contact details and preferences."})]}),(0,h.tZ)("div",{className:"mt-6",children:(0,h.tZ)(v,{state:G,setState:Q,errorState:er,onErrorStateChange:function(e,t){en($($({},er),{},(0,n.Z)({},e,t)))},onSaveApi:(e=(0,c.Z)(o().mark(function e(t,r){var n,a,i;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i={first_name:t.firstName,last_name:t.lastName,email:t.email,phone:null!==(n=t.phone)&&void 0!==n?n:G.phone,address:t.address,city:G.city,country:G.country,postcode:G.postcode},null!==(a=t.password)&&void 0!==a&&a.trim()&&(i.password=t.password),B((0,y.WB)(i),function(e){if(null==e||!e.error){var n,a=$($({},G),{},{firstName:t.firstName,lastName:t.lastName,email:t.email,phone:null!==(n=t.phone)&&void 0!==n?n:G.phone,address:t.address});Q(a),(0,F.av)((0,F.PR)(),a),null==r||r()}});case 3:case"end":return e.stop()}},e)})),function(t,r){return e.apply(this,arguments)}),updateLoading:_})})]}),2===s&&(0,h.BX)("div",{className:"py-2 md:py-4",children:[(0,h.BX)("div",{className:"rounded-2xl bg-gradient-to-r from-emerald-600 via-emerald-500 to-teal-500 text-white px-5 md:px-8 py-6 shadow-md",children:[(0,h.tZ)("h2",{className:"text-2xl md:text-3xl font-bold tracking-tight",children:"Invoices & Donations"}),(0,h.tZ)("p",{className:"text-sm md:text-base mt-1 text-emerald-50",children:"View your past invoices and donation history."})]}),(0,h.tZ)("div",{className:"mt-6",children:(0,h.tZ)(R,{value:s})})]}),3===s&&(0,h.BX)("div",{className:"py-2 md:py-4",children:[(0,h.BX)("div",{className:"rounded-2xl bg-gradient-to-r from-emerald-600 via-emerald-500 to-teal-500 text-white px-5 md:px-8 py-6 shadow-md",children:[(0,h.tZ)("h2",{className:"text-2xl md:text-3xl font-bold tracking-tight",children:"Subscription Hub"}),(0,h.tZ)("p",{className:"text-sm md:text-base mt-1 text-emerald-50",children:"Manage your recurring donations with a clean, card-first experience."})]}),W?(0,h.tZ)("div",{className:"py-10 text-center ",children:(0,h.tZ)(w.Z,{className:"mx-auto"})}):(null==ec||null===(t=ec.results)||void 0===t?void 0:t.length)===0?(0,h.BX)("div",{className:"mt-6 rounded-2xl border border-dashed border-gray-300 bg-gray-50 px-6 py-10 text-center",children:[(0,h.tZ)("p",{className:"text-lg font-semibold text-gray-700",children:"No subscriptions found"}),(0,h.tZ)("p",{className:"text-sm text-gray-500 mt-1",children:"Start a recurring plan to see it here."})]}):(0,h.tZ)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-5 py-6",children:null==ec||null===(r=ec.results)||void 0===r?void 0:r.map(function(e){var t,r,n="Active"===e.status,a=null!=e&&null!==(t=e.items)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&t.price?"GBP ".concat(e.items[0].price):"Amou
1nt not set",i=e.time||"".concat(e.daily_hour||"--",":").concat(e.daily_minute||"00");return(0,h.BX)(p.Z,{className:"relative overflow-hidden rounded-2xl border border-gray-200 bg-white p-5 md:p-6 shadow-sm transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5",children:[(0,h.tZ)("div",{className:"absolute -top-16 -right-14 w-32 h-32 rounded-full bg-emerald-100/70 blur-2xl pointer-events-none"}),(0,h.tZ)("div",{className:"absolute -bottom-16 -left-14 w-32 h-32 rounded-full bg-teal-100/70 blur-2xl pointer-events-none"}),(0,h.BX)("div",{className:"relative z-10",children:[(0,h.BX)("div",{className:"flex items-start justify-between gap-4",children:[(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-xs uppercase tracking-[0.2em] text-gray-500 font-semibold",children:"Recurring plan"}),(0,h.tZ)("h3",{className:"text-xl font-bold text-gray-900 mt-1",children:e.item_description||"Your Subscription"})]}),(0,h.tZ)("span",{className:"px-3 py-1 rounded-full text-xs font-semibold ".concat(n?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:e.status||"Unknown"})]}),(0,h.BX)("div",{className:"mt-5 grid grid-cols-2 gap-3",children:[(0,h.BX)("div",{className:"rounded-xl bg-emerald-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-emerald-700",children:"Frequency"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-emerald-900 mt-1",children:e.frequency||"N/A"})]}),(0,h.BX)("div",{className:"rounded-xl bg-sky-50 px-4 py-3",children:[(0,h.tZ)("p",{className:"text-xs font-medium uppercase tracking-wide text-sky-700",children:"Amount"}),(0,h.tZ)("p",{className:"text-sm md:text-base font-semibold text-sky-900 mt-1",children:a})]})]}),(0,h.BX)("div",{className:"mt-5 grid grid-cols-2 gap-x-4 gap-y-3 text-sm text-gray-700",children:[(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"Time"}),(0,h.tZ)("p",{className:"font-medium",children:i})]}),(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"No. of Payments"}),(0,h.tZ)("p",{className:"font-medium",children:e.number_of_payments||"Until I cancel"})]}),(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"Start"}),(0,h.tZ)("p",{className:"font-medium",children:(0,D.o0)(e.start_at)||"--"})]}),(0,h.BX)("div",{children:[(0,h.tZ)("p",{className:"text-gray-500",children:"End"}),(0,h.tZ)("p",{className:"font-medium",children:(0,D.o0)(e.end_at)||"Until I cancel"})]})]}),(0,h.BX)("div",{className:"mt-5",children:[(0,h.tZ)("p",{className:"text-xs uppercase tracking-wide text-gray-500 font-semibold mb-2",children:"Included Items"}),(0,h.tZ)("div",{className:"flex flex-wrap gap-2",children:null!=e&&null!==(r=e.items)&&void 0!==r&&r.length?e.items.map(function(e,t){return(0,h.BX)("span",{className:"inline-flex items-center gap-1 rounded-full bg-gray-100 px-3 py-1 text-xs text-gray-700",children:[e.product_title||"Item",e.price?" - GBP ".concat(e.price):""]},t)}):(0,h.tZ)("span",{className:"text-sm text-gray-500",children:"No item details."})})]}),(0,h.BX)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,h.tZ)(T.Z,{color:"error",variant:"outlined",onClick:function(){return ej("delete",e)},sx:{textTransform:"none",borderRadius:"10px"},children:"Delete"}),n&&(0,h.tZ)(T.Z,{color:"warning",variant:"contained",onClick:function(){return ej("status",e)},sx:{textTransform:"none",borderRadius:"10px"},children:"Cancel Subscription"})]})]})]},e.uid)})}),(0,h.tZ)("div",{className:"flex justify-end items-center mt-4",children:(0,h.tZ)(S.Z,{count:Math.ceil(((null==ec?void 0:ec.count)||0)/10)||1,page:j,onChange:function(e,t){return P(t)},color:"primary",shape:"rounded"})})]})]}),(0,h.tZ)(Y,{open:em,title:eg.title,message:eg.message,confirmText:eg.confirmText,cancelText:eg.cancelText,onConfirm:function(){if(ep(!1),"delete"===eO)eo(ey);else if("status"===eO){var e,t=null==ec||null===(e=ec.results)||void 0===e?void 0:e.find(function(e){return e.uid===ey});if(!t)return;var r="Active"===t.status?"Cancelled":"Active";
1J((0,x.pC)("".concat(U,"invoice/api/recursive-subs/").concat(ey,"/"),"patch",{status:r},q({tenant:ey},(0,y.g0)())),function(e){Z("Status changed successfully.","success"),es()})}eZ(null),eS("")},onCancel:function(){ep(!1),eZ(null),eS("")}})]})},et=r(2962),er=r(66112);function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ea(){return(0,h.BX)("div",{children:[(0,h.tZ)(et.PB,{canonical:"".concat(a.S.url)}),(0,h.tZ)(et.lX,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?en(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},er.d)),(0,h.tZ)(i.y,{}),(0,h.tZ)(et.ns,{}),(0,h.tZ)(ee,{})]})}},37392:function(e,t,r){"use strict";r.d(t,{LF:function(){return n},PR:function(){return a},av:function(){return c},is:function(){return i},kS:function(){return l}});var n=(0,r(95495).O4)("user",null),a=function(){var e=localStorage.getItem("user");if(!e||"null"===e)return null;try{return JSON.parse(e)}catch(e){return null}},i=function(){var e=localStorage.getItem("userData");if(!e||"null"===e)return null;try{return JSON.parse(e)}catch(e){return null}},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){localStorage.setItem("user",JSON.stringify(e));var r=t||e,n={firstName:r.firstName||r.first_name||"",lastName:r.lastName||r.last_name||"",email:r.email||"",phone:r.phone||"",address:r.address||"",city:r.city||"",country:r.country||"",postcode:r.postcode||""};localStorage.setItem("userData",JSON.stringify(n))}else localStorage.removeItem("user"),localStorage.removeItem("userData")},l=function(){localStorage.removeItem("user"),localStorage.removeItem("userData")}},37565:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer-portal",function(){return r(7762)}])}},function(e){e.O(0,[1947,1864,5495,555,1745,6339,6188,896,2888,9774,179],function(){return e(e.s=37565)}),_N_E=e.O()}]);

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.