PageSourceSearch

https://www.theculinistas.com/_next/static/chunks/pages/customer/payments-a400460120039312.js

js theculinistas.com collected 2026-10-04 16:35:30 UTC 23,830 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1007],{57584:function(e,t,a){"use strict";var l,n,r,s,i=a(52983);function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}t.Z=function(e){return i.createElement("svg",c({width:27,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=i.createElement("rect",{x:.25,y:.25,width:26.5,height:17.5,rx:1.75,fill:"#FCF6F2"})),n||(n=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 4.826a5.242 5.242 0 0 0-1.993 4.12c0 1.672.779 3.16 1.993 4.122a5.242 5.242 0 0 0 1.993-4.121c0-1.672-.779-3.16-1.993-4.121Z",fill:"currentColor"})),r||(r=i.createElement("path",{d:"M13.08 13.37a5.741 5.741 0 0 1-2.073-4.423c0-1.78.807-3.37 2.073-4.424A5.25 5.25 0 0 0 5 8.947a5.25 5.25 0 0 0 8.08 4.423ZM16.747 14.2A5.25 5.25 0 0 0 22 8.947a5.26 5.26 0 0 0-5.253-5.254 5.212 5.212 0 0 0-2.827.83 5.741 5.741 0 0 1 2.073 4.424c0 1.78-.807 3.369-2.073 4.423.814.523 1.784.83 2.827.83Z",fill:"currentColor"})),s||(s=i.createElement("rect",{x:.25,y:.25,width:26.5,height:17.5,rx:1.75,stroke:"currentColor",strokeWidth:.5})))}},21277:function(e,t,a){"use strict";var l,n=a(52983);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}t.Z=function(e){return n.createElement("svg",r({width:15,height:15,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=n.createElement("path",{d:"m8.756 4.75.744.744-7.188 7.173h-.729v-.729L8.756 4.75ZM11.606 0a.792.792 0 0 0-.554.23l-1.45 1.448 2.97 2.97 1.448-1.45c.31-.308.31-.823 0-1.116L12.168.23a.777.777 0 0 0-.562-.23Zm-2.85 2.525L0 11.281v2.969h2.969l8.756-8.756-2.97-2.969Z",fill:"#000"})))}},4488:function(e,t,a){"use strict";var l,n=a(52983);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}t.Z=function(e){return n.createElement("svg",r({width:17,height:17,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=n.createElement("path",{d:"M13.458 9.208h-4.25v4.25H7.792v-4.25h-4.25V7.792h4.25v-4.25h1.416v4.25h4.25v1.416Z",fill:"#000"})))}},29177:function(e,t,a){"use strict";var l,n=a(52983);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}t.Z=function(e){return n.createElement("svg",r({width:14,height:15,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=n.createElement("path",{d:"M4.314 0v.833H.252V2.5h.812v10.833c0 .442.172.866.476 1.179.305.312.718.488 1.15.488h8.125c.43 0 .844-.176 1.149-.488.304-.313.476-.737.476-1.179V2.5h.812V.833H9.189V0H4.314ZM2.69 2.5h8.126v10.833H2.689V2.5Zm1.625 1.667v7.5H5.94v-7.5H4.314Zm3.25 0v7.5H9.19v-7.5H7.564Z",fill:"#22292F"})))}},89497:function(e,t,a){"use strict";var l,n,r,s=a(52983);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}t.Z=function(e){return s.createElement("svg",i({width:27,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=s.createElement("rect",{x:.25,y:.25,width:26.5,height:17.5,rx:1.75,fill:"#FCF6F2"})),n||(n=s.createElement("path",{d:"M16.678 5.486c-1.491 0-2.824.773-2.824 2.2 0 1.638 2.364 1.751 2.364 2.574 0 .346-.397.656-1.075.656a3.57 3.57 0 0 1-1.682-.433l-.307 1.441s.828.366 1.928.366c1.63 0 2.913-.81 2.913-2.263 0-1.73-2.373-1.84-2.373-2.604 0-.271.326-.568 1.002-.568.763 0 1.385.315 1.385.315l.301-1.392s-.677-.292-1.632-.292Zm-13.642.105L3 5.801s.627.115 1.192.344c.728.262.78.415.902.89l1.335 5.147h1.79l2.757-6.591H9.19L7.42 10.072l-.723-3.798c-.066-.435-.402-.683-.813-.683H3.036Zm8.658 0-1.4 6.59h1.702l1.396-6.59h-1.698Zm9.496 0c-.41 0-.628.22-.787.604l-2.495 5.987h1.786l.345-.998h2.175l.21.998H24L22.625 5.59H21.19Zm.233 1.78.529 2.474h-1.418l.889-2.473Z",fill:"currentColor"})),r||(r=s.createElement("rect",{x:.25,y:.25,width:26.5,height:17.5,rx:1.75,stroke:"currentColor",strokeWidth:.5})))}},17947:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/customer/payments",function(){return a(23297)}])},17481:function(e,t,a){"use strict";a.d(t,{Z:function(){return f}});var l=a(97458),n=a(52983),r=a(49588),s=a(98680),i=a(47411),c=a(55462),o=a(25527),d=a(49122),u=a(15783),h=a(61954),m=a(35031),p=a(14517),v=a(85494),x=a(59328);function f(e){var t;let{primaryColor:a,secondaryColor:f}=e,b=(0,o.useStripe)(),j=(0,o.useElements)(),{register:y,handleSubmit:g,watch:N,formState:C,reset:w}=(0,s.cI)(),{errors:k}=C,{closeModal:M}=(0,r.ws)(),{defaultPaymentMethod:E}=(0,r.S9)(),[P,{loading:Z}]=(0,d.oCe)({refetchQueries:["GetCustomerPaymentsMethods"]}
1),[I,O]=(0,n.useState)(),[T,B]=(0,n.useState)(!1),D=N("isDefault"),_=async e=>{if(B(!0),O(null),!b||!j)return;let t=await b.createToken(j.getElement(o.CardNumberElement),{name:e.cardHolder});if(t.error){O(t.error.message),B(!1),w();return}P({variables:{input:{sourceId:t.token.id,nickname:(null==e?void 0:e.cardName)||void 0,setDefault:D||!1}}}),M(),B(!1),w()};return(0,l.jsx)(x.k,{modalId:r.Ti.AddCard,title:"Add a Card",saveButtonBackgroundColor:a||u.bG.Navy,saveButtonTextColor:a?(0,v._)(a):u.bG.White,cancelButtonTextColor:a,onSaveClickRaw:g(_),afterClose:()=>{w()},saveButtonLoading:T||Z,className:a&&(0,m.M)("text",a),children:(0,l.jsxs)("form",{className:"grid grid-cols-2 gap-x-14 gap-y-6 pb-6 md:gap-y-10 md:pb-8",children:[(0,l.jsx)(h.j,{containerClassName:"col-span-2",label:"Payment Method Nickname (Optional)",variant:"underlined",...y("cardName"),primaryColor:a}),(0,l.jsx)(h.j,{containerClassName:"col-span-2",label:"Name on Card",variant:"underlined",error:null===(t=k.cardHolder)||void 0===t?void 0:t.message.toString(),...y("cardHolder",{required:"Name on Card is required"}),primaryColor:a}),(0,l.jsxs)("div",{className:"col-span-2",children:[(0,l.jsx)("span",{className:"helvetica-10-400 block",children:"Credit Card Number"}),(0,l.jsx)(o.CardNumberElement,{className:(0,p.Z)("border-b border-opacity-40 pb-2.5 pt-1",(0,m.M)("border",a||u.bG.CulinistaBlack))})]}),(0,l.jsxs)("div",{className:"col-span-2 md:col-span-1",children:[(0,l.jsx)("span",{className:"helvetica-10-400 block",children:"Exp. Date"}),(0,l.jsx)(o.CardExpiryElement,{className:(0,p.Z)("border-b border-opacity-40 pb-2.5 pt-1",(0,m.M)("border",a||u.bG.CulinistaBlack))})]}),(0,l.jsxs)("div",{className:"col-span-2 md:col-span-1",children:[(0,l.jsx)("span",{className:"helvetica-10-400 block",children:"CVC"}),(0,l.jsx)(o.CardCvcElement,{className:(0,p.Z)("border-b border-opacity-40 pb-2.5 pt-1",(0,m.M)("border",a||u.bG.CulinistaBlack))})]}),(0,l.jsxs)("div",{className:"col-span-2 flex flex-col gap-y-2 pt-2 md:gap-y-4 md:pt-0",children:[(0,l.jsx)(i.W,{variant:"customer-panel",label:"Make this my default payment method.",labelClassName:(0,c.cn)('before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:p-[3px] before:bg-clip-content',(0,m.M)("before:border",a||u.bG.CulinistaBlack),{"opacity-70 before:border-opacity-40":!D,[(0,m.M)("before:bg",a||u.bG.CulinistaBlack)]:D}),className:"hidden cursor-pointer",...y("isDefault")}),E&&(0,l.jsxs)("p",{className:(0,c.cn)("helvetica-14-400 p-2 text-ar-culinista-black transition-opacity",(0,m.M)("bg",f?(0,v._)(f):u.bG.NavyLight),{"opacity-100":D,"opacity-0":!D}),children:[(0,l.jsx)("span",{className:"helvetica-14-500",children:"Please note:"})," ","Your current default card is ".concat(null==E?void 0:E.brand," ending in ").concat(null==E?void 0:E.last4,".\n            Checking this option will change your default card.")]})]}),I?(0,l.jsx)("p",{className:"col-span-2 text-center text-ar-red",children:I}):null]})})}},57337:function(e,t,a){"use strict";a.d(t,{_:function(){return i}});var l=a(97458);a(52983);var n=a(14517),r=a(15783),s=a(35031);function i(e){let{children:t,className:a,descriptionClassName:i="mt-5",childrenClassName:c,title:o,customActionElement:d,titleRightElement:u,description:h}=e,m=(0,s.M)("border",r.bG.CulinistaBlack),p=(0,s.M)("text",r.bG.CulinistaBlack),v=o||h;return(0,l.jsxs)("section",{className:(0,n.Z)("mb-[60px] md:mb-[88px]",a),children:[v&&(0,l.jsx)("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between",children:(0,l.jsxs)("div",{className:"w-full",children:[o&&(0,l.jsxs)("div",{className:"flex flex-col md:flex-row md:justify-between",children:[(0,l.jsx)("h3",{className:(0,n.Z)(p,"editorial-24 md:editorial-38"),children:o}),u&&(0,l.jsx)("div",{className:"mt-6 md:mt-0",children:u})]}),h&&(0,l.jsx)("p",{className:(0,n.Z)("garamond-16  mt-4 max-w-[680px] md:mt-6",i),children:h})]})}),t&&(0,l.jsxs)("div",{className:(0,n.Z)(m,"border border-opacity-40 p-6 md:p-8",v&&"mt-6 md:mt-8",c),children:[t,d&&(0,l.jsx)("div",{className:"ml-auto w-fit pt-8",children:d})]})]})}},94036:function(e,t,a){"use strict";function l(e){if((null==e?void 0:e.name)==="ServerError"){let{result:a}=e;if("object"==typeof a){var t;let e=null==a?void 0:a.errors[0];if(null==e?void 0:null===(t=e.extensions)||void 0===t?void 0:t.violations)return JSON.parse(e.extensions.violations);if(null==e?void 0:e.message)return[{Message:e.message,Property:e.message}]}}return[]}a.d(t,{s:function(){return l}})},93101:function(e,t,a){"use strict";a.d(t,{f:function(){return n}});var l=a(52983);function n(e){let{items:t,itemsPerPage:a}=e,[n,r]=(0,l.useState)(1);return{pageItems:(0,l.useMemo)(()=>t.slice((n-1)*a,n*a),[n,t,a]),currentPage:n,totalItemsCount:t.length,itemsPerPage:a,onPageChange:e=>{r(e)}}}},23297:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return J},default:function(){return K}});
1var l,n=a(97458),r=a(52983),s=a(15783),i=a(80250),c=a(57337),o=a(11738),d=a(2241),u=a(45537),h=a(60728),m=a(21277),p=a(29177),v=a(89497),x=a(57584),f=a(4488),b=a(49122),j=a(49588),y=a(1571),g=a(89044),N=a(14517);function C(e){let{brandName:t,nickname:a,cardEnding:l,expiryMonth:r,expiryYear:s,isDefault:i,id:c}=e,{openModal:o,setPaymentMethod:d,setPaymentMethodToRemove:u}=(0,j.ws)();return(0,n.jsxs)("div",{className:"helvetica-14-400 grid grid-cols-4 gap-y-4 pb-6 xl:grid-cols-3 xl:gap-y-10 xl:pb-10",children:[(0,n.jsxs)("div",{className:"col-span-2 flex gap-x-4 xl:col-span-1",children:[(0,n.jsx)(h.k,{width:27,height:18,icon:"visa"===t?(0,n.jsx)(v.Z,{}):(0,n.jsx)(x.Z,{})}),(0,n.jsx)("p",{className:"helvetica-14-500",children:a})]}),(0,n.jsx)("div",{className:"col-span-4 col-start-1 row-start-2 xl:col-span-1 xl:col-start-2 xl:row-start-1",children:(0,n.jsxs)("p",{className:"flex flex-col gap-x-9 xl:flex-row",children:["mastercard"===t?"MasterCard":"".concat(t.charAt(0).toUpperCase()+t.slice(1)," Card")," ending in ",l,(0,n.jsxs)("span",{className:"opacity-70",children:["Exp. ",r,"/",s]})]})}),(0,n.jsxs)("div",{className:"col-span-2 col-start-3 row-start-1 flex items-center gap-x-4 justify-self-end xl:gap-x-[84px]",children:[i&&(0,n.jsx)("div",{className:"helvetica-10-400 h-fit w-fit bg-ar-navy-light px-2 py-[3px]",children:"DEFAULT"}),(0,n.jsxs)("div",{className:"flex shrink-0 gap-4",children:[(0,n.jsx)(y.k,{variant:"text",theme:"transparent",type:"button",onClick:()=>{o(j.Ti.EditCard),d({id:c,brand:t,nickname:a,last4:l,expiryMonth:r,expiryYear:s,isDefault:i})},children:(0,n.jsx)(h.k,{width:14,height:14,icon:(0,n.jsx)(m.Z,{})})}),(0,n.jsx)(y.k,{variant:"text",theme:"transparent",type:"button",onClick:()=>{o(j.Ti.DeletePaymentMethod),u({id:c,brand:t,nickname:a,last4:l,expiryMonth:r,expiryYear:s,isDefault:i})},children:(0,n.jsx)(h.k,{width:14,height:14,icon:(0,n.jsx)(p.Z,{})})})]})]}),(0,n.jsx)("div",{className:"col-span-4 border-t border-t-ar-culinista-black opacity-40"})]})}function w(){let{openModal:e,setDefaultPaymentMethod:t}=(0,j.ws)(),{data:a,loading:l}=(0,b.LCX)({notifyOnNetworkStatusChange:!0,onCompleted:e=>{t(e.paymentMethods.items.find(e=>e.isDefault))}}),r=(null==a?void 0:a.paymentMethods.items)||[];return(0,n.jsx)(n.Fragment,{children:l?(0,n.jsx)("div",{className:"flex flex-1 justify-center",children:(0,n.jsx)(g.U,{})}):(0,n.jsxs)(n.Fragment,{children:[r.map(e=>(0,n.jsx)(C,{id:e.id,brandName:"Visa"===e.brand?"visa":"mastercard",nickname:e.nickname,cardEnding:e.last4,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,isDefault:e.isDefault},e.id)),0===r.length&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"helvetica-14-400",children:"No payments methods"}),(0,n.jsx)("div",{className:"mt-6 w-full border-t border-t-ar-culinista-black opacity-40"})]}),(0,n.jsx)("div",{className:(0,N.Z)("helvetica-14-500 flex xl:place-content-end",{"-mt-2":r.length>0,"mt-8":0===r.length}),children:(0,n.jsxs)("button",{type:"button",className:"flex gap-2",onClick:()=>{e(j.Ti.AddCard)},children:[(0,n.jsx)("p",{children:"Add a card"}),(0,n.jsx)(h.k,{size:14,icon:(0,n.jsx)(f.Z,{})})]})})]})})}var k=a(43359);function M(){return(M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(this,arguments)}var E=function(e){return r.createElement("svg",M({width:16,height:16,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=r.createElement("path",{d:"M2 16c-.55 0-1.021-.196-1.413-.588A1.922 1.922 0 0 1 0 14v-3h2v3h12v-3h2v3c0 .55-.196 1.021-.588 1.413A1.922 1.922 0 0 1 14 16H2Zm6-4L3 7l1.4-1.45L7 8.15V0h2v8.15l2.6-2.6L13 7l-5 5Z",fill:"#22292F"})))},P=a(21535),Z=a(78778),I=a(1137),O=a(93101),T=a(13916),B=a(52682),D=a(9703),_=a(42424),S=a.n(_),G=a(71977),L=a(97373);function H(e){let{selectedServiceTypeOptionValue:t}=e,a=(0,k.a)(768),{data:l,loading:s}=(0,b.jNe)({variables:{input:{serviceType:"all"===t?void 0:t}}}),{pageItems:i,...c}=(0,O.f)({items:(null==l?void 0:l.billingHistory.items)||[],itemsPerPage:5}),[o,d]=(0,r.useState)([]),u=e=>()=>{o.includes(e)?d(o.filter(t=>t!==e)):d([...o,e])};return s?(0,n.jsx)("div",{className:"flex flex-1 justify-center",children:(0,n.jsx)(g.U,{})}):(null==l?void 0:l.billingHistory.items.length)===0?(0,n.jsx)("p",{children:"No billing history"}):a?(0,n.jsxs)("div",{className:"helvetica-14-400 mt-2",children:[(0,n.jsx)("p",{className:"helvetica-9-400",children:"SERVICE TYPE"}),(0,n.jsx)("div",{className:"my-4 w-full border-t border-t-ar-culinista-black opacity-40"}),i.map(e=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-start",onClick:u(e.stripeInvoiceRefId),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"helvetica-14-500",children:D.vL[e.serviceType]}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:(0,B.Z)((0,G.EM)(e.serviceDate),"MM/dd/yyyy")})]}),(0,n.jsx)(Z.E.div,{animate:{rotate:o.includes(e.stripeInvoiceRefId)?180:0},transition:{duration:.3},children:(0,n.jsx)(h.k,{size:12,icon:(0,n.jsx)(P.Z,{})})})]}),(0,n.jsx)(I.M,{initial:!1,children:o.includes(e.stripeInvoiceRefId)&&(0,n.jsxs)(Z.E.div,{initial:"collapsed",animate:"open",exit:"collapsed",transition:{duration:.25},variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},className:"overflow-hidden",children:[(0,n.jsxs)("div",{className:"my-[25px] flex items-center justify-between",children:[(0,n.jsx)("p",{className:"helvetica-10-400",children:"BILLED ON"}),(0,n.jsx)("p",{children:e.stripeInvoiceCreatedAt?(0,B.Z)(new Date(e.stripeInvoiceCreatedAt),"MM/dd/yyyy"):""})]}),(0,n.jsxs)("div",{className:"my-[15px] flex items-center justify-between",children:[(0,n.jsx)("p",{className:"helvetica-10-400",children:"PAYMENT METHOD"}),(0,n.jsx)("p",{children:e.intendedPaymentMethod?e.intendedPaymentMethod.label:"Invoice"})]}),(0,n.jsxs)("div",{className:"my-[15px] flex items-center justify-between",children:[(0,n.jsx)("p",{className:"helvetica-10-400",children:"CHARGE"}),(0,n.jsx)("p",{children:(0,T.T)(100*e.stripeInvoiceTotal)})]}),(0,n.jsx)("div",{className:"mt-6 flex justify-end",children:e.stripeInvoicePdfUrl&&(0,n.jsxs)(S(),{href:e.stripeInvoicePdfUrl,className:"flex items-center gap-x-2",rel:"noopener noreferrer",target:"_blank",children:[(0,n.jsx)("p",{children:"Invoice"}),(0,n.jsx)(h.k,{icon:(0,n.jsx)(E,{}),size:16})]})})]},"content")}),(0,n.jsx)("div",{className:"my-4 w-full border-t border-t-ar-culinista-black opacity-40"})]},e.stripeInvoiceRefId)),(0,n.jsx)("div",{className:"pt-4",children:(0,n.jsx)(L.J,{...c})})]}):(0,n.jsxs)("div",{className:"helvetica-14-400 my-2 grid grid-cols-[1fr_1fr_1fr_1fr_50px] items-center",children:[(0,n.jsxs)("div",{className:"helvetica-10-400 col-span-5 grid grid-cols-[1fr_1fr_1fr_1fr_50px]",children:[(0,n.jsx)("div",{className:"pr-3",children:"SERVICE TYPE"}),(0,n.jsx)("div",{className:"pr-3",children:"BILLED ON"}),(0,n.jsx)("div",{className:"pr-3",children:"PAYMENT METHOD"}),(0,n.jsx)("div",{className:"pr-3",children:"CHARGE"}),(0,n.jsx)("div",{className:"justify-self-end",children:"INVOICE"})]}),(0,n.jsx)("div",{className:"col-span-5 mb-[21px] mt-4 border-t border-t-ar-culinista-black opacity-40"}),i.map(e=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsxs)("div",{className:"pr-3",children:[(0,n.jsx)("p",{className:"helvetica-14-500",children:D.vL[e.serviceType]}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:(0,B.Z)((0,G.EM)(e.serviceDate),"MM/dd/yyyy")})]}),(0,n.jsx)("div",{className:"pr-3",children:e.stripeInvoiceCreatedAt?(0,B.Z)(new Date(e.stripeInvoiceCreatedAt),"MM/dd/yyyy"):""}),(0,n.jsx)("div",{className:"pr-3",children:e.intendedPaymentMethod?e.intendedPaymentMethod.label:"Invoice"}),(0,n.jsx)("div",{className:"pr-3",children:(0,T.T)(100*e.stripeInvoiceTotal)}),(0,n.jsx)("div",{className:"justify-self-end",children:e.stripeInvoicePdfUrl&&(0,n.jsx)(S(),{href:e.stripeInvoicePdfUrl,rel:"noopener noreferrer",target:"_blank",children:(0,n.jsx)(h.k,{icon:(0,n.jsx)(E,{}),size:16})})}),(0,n.jsx)("div",{className:"col-span-5 my-[21px] border-t border-t-ar-culinista-black opacity-40"})]},e.stripeInvoiceRefId)),(0,n.jsx)("div",{className:"col-span-5 mt-3 justify-self-end",children:(0,n.jsx)(L.J,{...c})})]})}var A=a(17481),R=a(98680),F=a(47411),V=a(55462),U=a(94036),W=a(61954),Y=a(59328);
1function Q(){let{register:e,handleSubmit:t,watch:a,reset:l}=(0,R.cI)(),{closeModal:i,clearPaymentMethod:c}=(0,j.ws)(),{chosenPaymentMethod:o,defaultPaymentMethod:d}=(0,j.S9)(),[u,{loading:h}]=(0,b.fXT)({refetchQueries:["GetCustomerPaymentsMethods"]}),[m,{loading:p}]=(0,b.GJR)({refetchQueries:["GetCustomerPaymentsMethods"]}),[v,{loading:x}]=(0,b.uoy)({refetchQueries:["GetCustomerPaymentsMethods"]}),f=a("isDefault"),[y,g]=(0,r.useState)(),N=async e=>{if(e.isDefault&&await m({variables:{input:{cardId:null==o?void 0:o.id}}}),!e.cardName){c(),i(),l();return}u({variables:{input:{cardId:null==o?void 0:o.id,nickname:e.cardName}},onCompleted:()=>{c(),i(),l()},onError:e=>{g((0,U.s)(e.networkError)[0].Message)}})},C=async()=>{await v({variables:{input:{cardId:null==o?void 0:o.id}},onCompleted:()=>{c(),i()},onError:e=>{g((0,U.s)(e.networkError)[0].Message)}})};return(0,n.jsx)(Y.k,{modalId:j.Ti.EditCard,title:"Edit a Payment Method",onSaveClickRaw:t(N),saveButtonLoading:p||h,saveButtonBackgroundColor:s.bG.Navy,saveButtonTextColor:s.bG.White,cancelButtonLoading:x,cancelButtonClassName:"border-ar-red border text-ar-red",cancelButtonText:"Remove card",afterClose:()=>{c(),l()},onCancelClickRaw:C,children:(0,n.jsxs)("form",{className:"flex flex-col gap-y-6 pb-6 md:gap-y-10 md:pb-8",children:[(0,n.jsx)(W.j,{label:"Payment Method Nickname (Optional)",variant:"underlined",defaultValue:null==o?void 0:o.nickname,...e("cardName")}),(0,n.jsx)(W.j,{label:"Credit Card Number",variant:"underlined",disabled:!0,value:"**** **** **** ".concat(null==o?void 0:o.last4)}),(0,n.jsx)(W.j,{label:"Exp. Date",variant:"underlined",value:"".concat(10>Number(null==o?void 0:o.expiryMonth)?"0":"").concat(null==o?void 0:o.expiryMonth,"/").concat(null==o?void 0:o.expiryYear.toString().slice(2,4)),disabled:!0}),(0,n.jsxs)("div",{className:"col-span-2 flex flex-col gap-y-2 pt-2 md:gap-y-4 md:pt-0",children:[(0,n.jsx)(F.W,{variant:"customer-panel",label:"Set as default payment method",labelClassName:(0,V.cn)('before:content-[""] before:inline-block before:w-[18px] before:h-[18px] before:mr-2 before:border before:border-ar-culinista-black before:p-[3px] before:bg-clip-content',{"opacity-70 before:border-opacity-40":!f,"before:bg-ar-culinista-black":f}),className:"hidden cursor-pointer",defaultChecked:null==o?void 0:o.isDefault,disabled:null==o?void 0:o.isDefault,...e("isDefault")}),(0,n.jsxs)("p",{className:(0,V.cn)("helvetica-14-400 bg-ar-navy-light p-2 transition-opacity",{"opacity-100":f&&!(null==o?void 0:o.isDefault),"opacity-0":!f||(null==o?void 0:o.isDefault)}),children:[(0,n.jsx)("span",{className:"helvetica-14-500",children:"Please note: "}),"Your current default card is ".concat(null==d?void 0:d.brand," ending in ").concat(null==d?void 0:d.last4,".\n            Checking this option will change your default card.")]})]}),y?(0,n.jsx)("p",{className:"col-span-2 text-center text-ar-red",children:y}):null]})})}var X=a(76241);function q(e){let{paymentMethod:t}=e,{clearPaymentMethodToRemove:a}=(0,j.ws)(),[l,r]=(0,b.kO9)({refetchQueries:[b.KDL],variables:{input:{cardId:null==t?void 0:t.id}}}),i=async()=>{await l()};return(0,n.jsx)(Y.k,{modalId:j.Ti.DeletePaymentMethod,title:"Delete Payment Method",onSaveClickRaw:i,afterClose:()=>{a(),r.reset()},saveButtonText:"Delete",queryState:r,saveButtonBackgroundColor:s.bG.Transparent,saveButtonTextColor:s.bG.Red,saveButtonClassName:"border border-ar-red helvetica-12-500",cancelButtonClassName:"helvetica-12-500",cancelButtonBackgroundColor:s.bG.Navy,cancelButtonTextColor:s.bG.White,margins:"sm",children:(0,n.jsx)(X.h,{queryState:r,successPrompt:"Payment Method Deleted Successfully",children:(0,n.jsxs)("div",{className:"helvetica-14-400 text-lg",children:[(0,n.jsx)("h1",{className:"pb-12",children:"This payment method will be removed from your account."}),(null==t?void 0:t.nickname)&&(0,n.jsx)("p",{className:"helvetica-14-500",children:null==t?void 0:t.nickname}),(0,n.jsxs)("div",{className:"helvetica-14-400 flex gap-x-8 pb-16",children:[(0,n.jsxs)("p",{className:"",children:[(null==t?void 0:t.brand)?(null==t?void 0:t.brand)==="mastercard"?"MasterCard":"".concat(t.brand.charAt(0).toUpperCase()+t.brand.slice(1)," Card"):""," ending in ",null==t?void 0:t.last4]}),(0,n.jsxs)("p",{className:"opacity-70",children:["Exp ",null==t?void 0:t.expiryMonth,"/",null==t?void 0:t.expiryYear]})]})]})})})}function z(e){let{title:t}=e,{paymentMethodToRemove:a}=(0,j.S9)(),[l,d]=(0,r.useState)("all");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.f,{title:t}),(0,n.jsxs)(i.e,{children:[(0,n.jsx)(c._,{title:"Payments Methods",children:(0,n.jsx)(w,{})}),(0,n.jsx)(c._,{title:"Past Invoices",titleRightElement:(0,n.jsx)("div",{className:"w-full md:w-[264px]",children:(0,n.jsx)(o.W,{label:"Services",options:[{label:"All",value:"all"},{label:"Gatherings",value:b.UW4.Gathering},{label:"Cooking Classes",value:b.UW4.CookingClass},{label:"Weekly Meal Prep",value:b.UW4.MealPrep},{label:"Seasonal & Long Term",value:b.UW4.Placement}],initialOption:{label:"All services",value:"all"},hoverColor:s.bG.NavyLight,onOptionChange:e=>{d(e)}})}),children:(0,n.jsx)(H,{selectedServiceTypeOptionValue:l})})]}),(0,n.jsx)(A.Z,{}),(0,n.jsx)(Q,{}),(0,n.jsx)(q,{paymentMethod:a})]})}z.Layout=d.X;var J=!0,K=z}},function(e){e.O(0,[7249,7250,2888,9774,179],function(){return e(e.s=17947)}),_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.