import{d as L,C as Q,u as H,am as W,e as i,f as C,g as l,t as p,h as s,j as g,w as _,k as P,aL as pe,v as ct,b$ as X,aC as J,Q as T,m as N,X as M,i as b,ag as ue,F as $,c as q,al as Le,q as ut,s as Ne,r as ee,B as Re,ap as ae,p as k,W as Ie,I as he,H as mt,J as _t,n as pt,ax as ht,aB as Z,a5 as oe,a6 as yt,G as Y,o as me,c1 as re,ak as vt,S as se,l as de,A as $e,bA as Te,a4 as ce,K as ft,bI as le,ca as Ct,b2 as gt,a7 as He,ci as zt,cj as bt,M as wt}from"./index-0LqjRhnu.js";import{B as ie}from"./BasePlaceholder-Cd11HBzv.js";import{F as Be}from"./FormRadio-Bq669eUg.js";import{P as U}from"./Payment.api-BTaM3-ji.js";import{_ as Mt}from"./payment-method-1-Bfj5e8hF.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="2b22c12f-5d49-4c2e-8d72-f0a4a0af5bcf",a._sentryDebugIdIdentifier="sentry-dbid-2b22c12f-5d49-4c2e-8d72-f0a4a0af5bcf")}catch{}})();var V=(a=>(a.CARD="card",a.PAYPAL="paypal",a.GOCARDLESS="gocardless",a.BANK_TRANSFER="supported_bank_transfer",a))(V||{});const Et={class:"ask"},St={class:"ask__title"},kt={class:"ask__actions"},Fe=L({__name:"ExistingPaymentMethodAskDelete",props:{paymentMethod:{}},emits:["close"],setup(a){const n=a,e=Q(),{t}=H(),{mutate:o,isPending:r}=W({mutationFn:()=>U.deletePaymentMethod(n.paymentMethod.id),onSuccess:()=>{e.refetchQueries({queryKey:[T.PAYMENT_METHODS]})}});return(c,d)=>(i(),C("div",Et,[l("div",St,p(s(t)("title")),1),l("div",kt,[g(J,{type:s(pe).BUTTON,theme:s(ct).DISCRET,size:s(X).SMALL,class:"ask__actions--button",onClick:d[0]||(d[0]=m=>c.$emit("close"))},{default:_(()=>[P(p(s(t)("cancel")),1)]),_:1},8,["type","theme","size"]),g(J,{type:s(pe).BUTTON,class:"ask__actions--button",size:s(X).SMALL,pending:s(r),onClick:s(o)},{default:_(()=>[P(p(s(t)("delete")),1)]),_:1},8,["type","size","pending","onClick"])])]))}});function ye(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{title:e=>{const{normalize:t}=e;return t(["Supprimer ce mode de paiement ?"])},delete:e=>{const{normalize:t}=e;return t(["Supprimer"])},cancel:e=>{const{normalize:t}=e;return t(["Non"])}},en:{title:e=>{const{normalize:t}=e;return t(["Delete this payment method ?"])},delete:e=>{const{normalize:t}=e;return t(["Delete"])},cancel:e=>{const{normalize:t}=e;return t(["No"])}}}})}typeof ye=="function"&&ye(Fe);const Pt=N(Fe,[["__scopeId","data-v-bfe47b4b"]]);var xe=(a=>(a.STRIPE="stripe",a))(xe||{}),K=(a=>(a.VALID="valid",a.EXPIRING="expiring",a.EXPIRED="expired",a.INVALID="invalid",a.VERIFICATION="pending_verification",a))(K||{});const At={class:"method__name"},Dt={key:0,class:"method__name--brand"},Vt={key:0,class:"method__details text-sm"},Ue=L({__name:"ExistingPaymentMethodCard",props:{paymentMethod:{},askDelete:{type:Boolean}},setup(a){const{t:n}=H();return(e,t)=>(i(),C($,null,[l("div",At,[e.paymentMethod.card?(i(),C("div",Dt,p(e.paymentMethod.card.brand),1)):M("",!0),e.paymentMethod.primary&&!e.askDelete?(i(),b(ue,{key:1,class:"method__favorite",rounded:""},{default:_(()=>[P(p(s(n)("primary")),1)]),_:1})):M("",!0)]),e.paymentMethod.card?(i(),C("div",Vt,p(s(n)("maskedNumber",{number:e.paymentMethod.card.maskedNumber.slice(-4)})),1)):M("",!0)],64))}});function ve(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{maskedNumber:e=>{const{normalize:t,interpolate:o,named:r}=e;return t(["Fini par ",o(r("number"))])},primary:e=>{const{normalize:t}=e;return t(["Favoris"])}},en:{maskedNumber:e=>{const{normalize:t,interpolate:o,named:r}=e;return t(["End with ",o(r("number"))])},primary:e=>{const{normalize:t}=e;return t(["Favorite"])}}}})}typeof ve=="function"&&ve(Ue);const fe=N(Ue,[["__scopeId","data-v-4b5e89fa"]]),Lt={class:"method__name"},Nt={class:"method__name--brand"},Rt={class:"method__details"},Ge=L({__name:"ExistingPaymentMethodGoCardlessACH",props:{paymentMethod:{},askDelete:{type:Boolean}},setup(a){const n=a,{t:e}=H(),t=q(()=>{switch(n.paymentMethod.status){case K.VALID:return e("status.valid");case K.VERIFICATION:return e("status.pending");case K.EXPIRED:return e("status.expired");case K.INVALID:return e("status.invalid");default:return""}});return(o,r)=>(i(),C($,null,[l("div",Lt,[l("div",Nt,p(s(e)("brand")),1),o.paymentMethod.primary&&!o.askDelete?(i(),b(ue,{key:0,class:"method__favorite",rounded:""},{default:_(()=>[P(p(s(e)("primary")),1)]),_:1})):M("",!0)]),l("div",Rt,[l("div",null,p(t.value),1)])],64))}});function Ce(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{brand:e=>{const{normalize:t}=e;return t(["Compte Bancaire via GoCardless"])},status:{valid:e=>{const{normalize:t}=e;return t(["Valide"])},pending:e=>{const{normalize:t}=e;return t(["Validation en cours"])},expired:e=>{const{normalize:t}=e;return t(["Expirer"])},invalid:e=>{const{normalize:t}=e;return t(["Invalide"])}}},en:{brand:e=>{const{normalize:t}=e;return t(["Bank account via GoCardless"])},status:{valid:e=>{const{normalize:t}=e;return t(["Validate"])},pending:e=>{const{normalize:t}=e;return t(["Validation in progress"])},expired:e=>{const{normalize:t}=e;return t(["Expire"])},invalid:e=>{const{normalize:t}=e;return t(["Disabled"])}}}}})}typeof Ce=="function"&&Ce(Ge);const It=N(Ge,[["__scopeId","data-v-9a8c139a"]]);var D=(a=>(a.BRAINTREE="braintree",a.STRIPE="stripe",a.GOCARDLESS="gocardless",a.BANK_TRANSFER="bank_transfer",a))(D||{});const $t={class:"method__name"},Tt={class:"method__name--brand"},Ht={key:0,class:"method__details"},Oe=L({__name:"ExistingPaymentMethodPaypal",props:{paymentMethod:{},askDelete:{type:Boolean}},setup(a){const{t:n}=H();return(e,t)=>{var o,r;return i(),C($,null,[l("div",$t,[l("div",Tt,p(s(n)("paypal")),1),e.paymentMethod.primary&&!e.askDelete?(i(),b(ue,{key:0,class:"method__favorite",rounded:""},{default:_(()=>[P(p(s(n)("primary")),1)]),_:1})):M("",!0)]),(o=e.paymentMethod.paypal)!=null&&o.email?(i(),C("div",Ht,p((r=e.paymentMethod.paypal)==null?void 0:r.email),1)):M("",!0)],64)}}});function ge(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{paypal:e=>{const{normalize:t}=e;return t(["Paypal"])},primary:e=>{const{normalize:t}=e;return t(["Favoris"])}},en:{paypal:e=>{const{normalize:t}=e;return t(["Paypal"])},primary:e=>{const{normalize:t}=e;return t(["Favorite"])}}}})}typeof ge=="function"&&ge(Oe);const Bt=N(Oe,[["__scopeId","data-v-ebb9695c"]]),Ft={class:"method__name"},xt={class:"method__name--brand"},Ut={key:0},Gt={class:"method__information text-sm"},Ot={class:"method__details"},qt={class:"method__details-item-label text-sm"},qe=L({__name:"ExistingPaymentMethodBankTransfer",props:{currentValue:{}},setup(a){const{t:n}=H(),{toast:e}=Le(),t=[{label:n("bank_info.name"),text:"Bank of the west"},{label:n("bank_info.account_number"),text:"060466679"},{label:n("bank_info.routing_number"),text:"121100782"},{label:n("bank_info.swift"),text:"BWSTUS66"},{label:n("bank_info.beneficiary"),text:"Frenchfounders Inc. - 27 West 20th Street, Suite #800, New York, NY 10011"}],o=r=>{navigator.clipboard.writeText(r),e({type:ae.SUCCESS,text:n("copy_link")})};return(r,c)=>{const d=ut("safe-html");return i(),C($,null,[l("div",Ft,[l("div",xt,p(s(n)("brand")),1)]),r.currentValue===s(D).BANK_TRANSFER?(i(),C("div",Ut,[Ne(l("div",Gt,null,512),[[d,s(n)("information")]]),l("div",Ot,[(i(),C($,null,ee(t,m=>l("div",{key:m.label},[l("div",qt,[l("div",null,p(m.label.toUpperCase()),1),g(Re,{name:"content_copy",onClick:u=>o(m.text)},null,8,["onClick"])]),l("div",null,p(m.text),1)])),64))])])):M("",!0)],64)}}});function ze(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{copy_link:e=>{const{normalize:t}=e;return t(["Lien copié dans le presse-papier"])},brand:e=>{const{normalize:t}=e;return t(["Virement bancaire"])},information:e=>{const{normalize:t}=e;return t(["Afin de procéder au paiement, vous trouverez ci-dessous nos coordonnées bancaires.<br/>Attention: le montant de l’abonnement est en USD. Dans le cas où votre compte bancaire n’est pas en dollars, merci d’anticiper les frais de conversion afin que Frenchfounders reçoive le montant à payer dans son intégralité."])},bank_info:{name:e=>{const{normalize:t}=e;return t(["Banque"])},account_number:e=>{const{normalize:t}=e;return t(["Numéro de compte"])},routing_number:e=>{const{normalize:t}=e;return t(["Numéro de routage"])},swift:e=>{const{normalize:t}=e;return t(["SWIFT"])},beneficiary:e=>{const{normalize:t}=e;return t(["Bénéficiaire"])}}},en:{copy_link:e=>{const{normalize:t}=e;return t(["Link copied to clipboard"])},brand:e=>{const{normalize:t}=e;return t(["Bank transfer"])},information:e=>{const{normalize:t}=e;return t(["In order to make the payment, you will find below our bank details.<br/>Attention: the amount of the subscription is in USD.In the event that your bank account is not in dollars, please anticipate the conversion costs so that Frenchfounders receives the amount to pay in its entirety."])},bank_info:{name:e=>{const{normalize:t}=e;return t(["Bank name"])},account_number:e=>{const{normalize:t}=e;return t(["Account number"])},routing_number:e=>{const{normalize:t}=e;return t(["Routing number"])},swift:e=>{const{normalize:t}=e;return t(["SWIFT"])},beneficiary:e=>{const{normalize:t}=e;return t(["Beneficiary"])}}}}})}typeof ze=="function"&&ze(qe);const Zt=N(qe,[["__scopeId","data-v-1a7af73f"]]),Kt={class:"method"},Yt={class:"method__infos"},Qt={class:"method__options--activator"},Ze=L({__name:"ExistingPaymentMethod",props:{paymentMethod:{},modelValue:{},disableRemove:{type:Boolean}},emits:["update:model-value"],setup(a){const n=a,e=k(!1),{t}=H(),o=Q(),{mutate:r}=W({mutationFn:()=>U.setPrimaryPaymentMethod(n.paymentMethod.id),onSuccess:()=>{o.refetchQueries({queryKey:[T.PAYMENT_METHODS]})}}),c=()=>{switch(n.paymentMethod.gateway){case D.GOCARDLESS:return It;case D.BRAINTREE:return n.paymentMethod.paypal?Bt:fe;case D.BANK_TRANSFER:return Zt;default:return fe}};return(d,m)=>(i(),C("div",Kt,[l("div",{class:pt(["method__content",{"method--expired":d.paymentMethod.status===s(K).EXPIRED}])},[g(Be,{value:d.paymentMethod.id,"model-value":d.modelValue,"onUpdate:modelValue":m[0]||(m[0]=u=>d.$emit("update:model-value",u))},null,8,["value","model-value"]),l("div",Yt,[(i(),b(Ie(c()),{"payment-method":d.paymentMethod,"ask-delete":e.value,"current-value":d.modelValue},null,8,["payment-method","ask-delete","current-value"]))]),!d.paymentMethod.primary||!d.disableRemove?(i(),b(_t,{key:0,class:"method__options"},{activator:_(()=>[l("div",Qt,[(i(),C($,null,ee(3,u=>l("div",{key:u,class:"method__options--dot"})),64))])]),dropdown:_(()=>[g(mt,{class:"method__options--content",align:"left"},{default:_(()=>[d.paymentMethod.primary?M("",!0):(i(),b(he,{key:0,onClick:s(r)},{default:_(()=>[P(p(s(t)("setPrimary")),1)]),_:1},8,["onClick"])),d.disableRemove?M("",!0):(i(),b(he,{key:1,onClick:m[1]||(m[1]=u=>e.value=!0)},{default:_(()=>[P(p(s(t)("delete")),1)]),_:1}))]),_:1})]),_:1})):M("",!0)],2),g(ht,{name:"fade"},{default:_(()=>[e.value?(i(),b(Pt,{key:0,"payment-method":d.paymentMethod,onClose:m[2]||(m[2]=u=>e.value=!1)},null,8,["payment-method"])):M("",!0)]),_:1})]))}});function be(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{maskedNumber:e=>{const{normalize:t,interpolate:o,named:r}=e;return t(["Fini par ",o(r("number"))])},setPrimary:e=>{const{normalize:t}=e;return t(["Définir comme favoris"])},primary:e=>{const{normalize:t}=e;return t(["Favoris"])},delete:e=>{const{normalize:t}=e;return t(["Supprimer"])}},en:{maskedNumber:e=>{const{normalize:t,interpolate:o,named:r}=e;return t(["End with ",o(r("number"))])},setPrimary:e=>{const{normalize:t}=e;return t(["Define as favorite"])},primary:e=>{const{normalize:t}=e;return t(["Favorite"])},delete:e=>{const{normalize:t}=e;return t(["Delete"])}}}})}typeof be=="function"&&be(Ze);const jt=N(Ze,[["__scopeId","data-v-bcdc53d9"]]),Wt={class:"module__title"},Xt={class:"module__subtitle"},Jt={class:"module__placeholders"},en={class:"module__subtitle"},we=3,Ke=L({__name:"MyPaymentMethods",props:{myPaymentMethods:{},loading:{type:Boolean},modelValue:{}},emits:["update:model-value"],setup(a){const{t:n}=H();return(e,t)=>{var o,r;return i(),C($,null,[l("h2",Wt,p(s(n)("title")),1),g(yt,{"is-loading":!!e.loading,"is-empty":!((o=e.myPaymentMethods)!=null&&o.length),"is-success":!!((r=e.myPaymentMethods)!=null&&r.length),"is-error":!1},{success:_(()=>[l("div",null,[l("p",Xt,p(s(n)("subtitle")),1),g(Z,{class:"module__separator module__separator--small"}),(i(!0),C($,null,ee(e.myPaymentMethods,(c,d)=>(i(),C($,{key:c.id},[g(jt,{"payment-method":c,"model-value":e.modelValue,"disable-remove":e.myPaymentMethods.length===1||c.gateway===s(D).BANK_TRANSFER,"onUpdate:modelValue":t[0]||(t[0]=m=>e.$emit("update:model-value",m))},null,8,["payment-method","model-value","disable-remove"]),d<e.myPaymentMethods.length-1?(i(),b(Z,{key:0,class:"module__separator module__separator--small"})):M("",!0)],64))),128))])]),fallback:_(()=>[l("div",Jt,[g(ie,{dark:""}),g(Z,{class:"module__separator module__separator--small"}),(i(),C($,null,ee(we,c=>l("div",{key:c},[g(ie,{class:"module__placeholder",dark:""}),g(ie,{class:"module__placeholder--short",dark:""}),c<=we-1?(i(),b(Z,{key:0,class:"module__separator module__separator--small"})):M("",!0)])),64))])]),empty:_(()=>[l("p",en,[oe(e.$slots,"noPaymentMethods",{},()=>[P(p(s(n)("no-methods")),1)],!0)])]),_:3},8,["is-loading","is-empty","is-success"])],64)}}});function Me(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{title:e=>{const{normalize:t}=e;return t(["Mes moyens de paiement"])},subtitle:e=>{const{normalize:t}=e;return t(["Supprimez ou sélectionnez votre moyen de paiement favori."])},"no-methods":e=>{const{normalize:t}=e;return t(["Vous n'avez aucun moyen de paiement, commencez par ajouter un mode de paiement."])}},en:{title:e=>{const{normalize:t}=e;return t(["My payment methods"])},"no-methods":e=>{const{normalize:t}=e;return t(["You don't have any payment method, start by adding a payment method."])},subtitle:e=>{const{normalize:t}=e;return t(["Delete or select your favorite payment method."])}}}})}typeof Me=="function"&&Me(Ke);const tn=N(Ke,[["__scopeId","data-v-0955844d"]]),nn="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='white'%20stroke='%23D9D9D9'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.5377%2016.2582H8.44771L6.88044%2010.1924C6.80605%209.91334%206.6481%209.66666%206.41576%209.5504C5.83593%209.25823%205.197%209.0257%204.49998%208.90843V8.67489H7.86686C8.33154%208.67489%208.68005%209.0257%208.73813%209.43313L9.55132%2013.8086L11.6403%208.67489H13.6723L10.5377%2016.2582ZM14.834%2016.2582H12.8601L14.4855%208.67489H16.4593L14.834%2016.2582ZM19.013%2010.7757C19.0711%2010.3673%2019.4196%2010.1337%2019.8262%2010.1337C20.4651%2010.0751%2021.1611%2010.1924%2021.742%2010.4835L22.0905%208.85081C21.5096%208.61727%2020.8707%208.5%2020.2909%208.5C18.3751%208.5%2016.9811%209.55041%2016.9811%2011.0082C16.9811%2012.1173%2017.9685%2012.6996%2018.6655%2013.0504C19.4196%2013.4002%2019.71%2013.6338%2019.652%2013.9835C19.652%2014.5082%2019.0711%2014.7418%2018.4913%2014.7418C17.7943%2014.7418%2017.0972%2014.5669%2016.4593%2014.2747L16.1108%2015.9085C16.8078%2016.1996%2017.5619%2016.3169%2018.2589%2016.3169C20.4071%2016.3745%2021.742%2015.3251%2021.742%2013.75C21.742%2011.7665%2019.013%2011.6502%2019.013%2010.7757ZM28.65%2016.2582L27.0827%208.67489H25.3993C25.0508%208.67489%2024.7023%208.90843%2024.5861%209.25823L21.6839%2016.2582H23.7159L24.1214%2015.1502H26.6181L26.8504%2016.2582H28.65ZM25.6897%2010.7171L26.2695%2013.5751H24.6442L25.6897%2010.7171Z'%20fill='%23172B85'/%3e%3c/svg%3e",an="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='white'%20stroke='%23D9D9D9'/%3e%3cpath%20d='M19.9148%2011.9175C19.9148%2016.0141%2016.6319%2019.335%2012.5824%2019.335C8.53282%2019.335%205.25%2016.0141%205.25%2011.9175C5.25%207.82093%208.53282%204.5%2012.5824%204.5C16.6319%204.5%2019.9148%207.82093%2019.9148%2011.9175Z'%20fill='%23ED0006'/%3e%3cpath%20d='M29.4271%2011.9175C29.4271%2016.0141%2026.1442%2019.335%2022.0947%2019.335C18.0451%2019.335%2014.7623%2016.0141%2014.7623%2011.9175C14.7623%207.82093%2018.0451%204.5%2022.0947%204.5C26.1442%204.5%2029.4271%207.82093%2029.4271%2011.9175Z'%20fill='%230099DF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.3386%2017.563C18.9151%2016.2025%2019.9148%2014.1781%2019.9148%2011.9175C19.9148%209.65689%2018.9151%207.63248%2017.3386%206.27197C15.762%207.63248%2014.7624%209.65689%2014.7624%2011.9175C14.7624%2014.1781%2015.762%2016.2025%2017.3386%2017.563Z'%20fill='%236C6BBD'/%3e%3c/svg%3e",on="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='%231F72CD'%20stroke='%23D9D9D9'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.71646%208.43066L3.5%2015.8641H7.35055L7.8279%2014.6789H8.91903L9.39639%2015.8641H13.6348V14.9595L14.0124%2015.8641H16.2048L16.5825%2014.9404V15.8641H25.3972L26.469%2014.7097L27.4726%2015.8641L32%2015.8737L28.7734%2012.1681L32%208.43066H27.5428L26.4995%209.56375L25.5275%208.43066H15.9383L15.1148%2010.3493L14.2721%208.43066H10.4296V9.30447L10.0021%208.43066H6.71646ZM19.8794%209.48622H24.9412L26.4893%2011.2327L28.0874%209.48622H29.6356L27.2833%2012.1671L29.6356%2014.8171H28.0172L26.469%2013.0503L24.8628%2014.8171H19.8794V9.48622ZM21.1294%2011.5643V10.5906V10.5897H24.2878L25.666%2012.1469L24.2267%2013.7127H21.1294V12.6496H23.8908V11.5643H21.1294ZM7.46147%209.48622H9.33841L11.4719%2014.5269V9.48622H13.528L15.1759%2013.1004L16.6946%209.48622H18.7404V14.8202H17.4955L17.4854%2010.6405L15.6705%2014.8202H14.5569L12.7319%2010.6405V14.8202H10.171L9.68549%2013.6244H7.06249L6.57799%2014.8192H5.20587L7.46147%209.48622ZM7.51038%2012.5189L8.37455%2010.3887L9.23772%2012.5189H7.51038Z'%20fill='white'/%3e%3c/svg%3e",rn="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='white'%20stroke='%23D9D9D9'/%3e%3cpath%20d='M14.025%2022.55L33.025%2016.8V21C33.025%2021.8561%2032.331%2022.55%2031.475%2022.55H14.025Z'%20fill='%23FD6020'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M29.3937%209.11084C30.439%209.11084%2031.0139%209.59438%2031.0139%2010.5077C31.0661%2011.2062%2030.5957%2011.7972%2029.9686%2011.9046L31.3797%2013.8925H30.2822L29.0801%2011.9584H28.9755V13.8925H28.087V9.11084H29.3937ZM28.9755%2011.3137H29.2369C29.8118%2011.3137%2030.0731%2011.045%2030.0731%2010.5615C30.0731%2010.1317%2029.8118%209.86304%2029.2369%209.86304H28.9755V11.3137ZM25.0034%2013.8925H27.5121V13.0866H25.8919V11.7972H27.4599V10.9913H25.8919V9.91674H27.5121V9.11084H25.0034V13.8925ZM22.3902%2012.3345L21.1881%209.11084H20.2473L22.1811%2014H22.6515L24.5853%209.11084H23.6445L22.3902%2012.3345ZM11.7805%2011.5286C11.7805%2012.8717%2012.8258%2014%2014.1324%2014C14.5505%2014%2014.9163%2013.8925%2015.2822%2013.7314V12.6568C15.0209%2012.9792%2014.655%2013.1941%2014.2369%2013.1941C13.4007%2013.1941%2012.7212%2012.5494%2012.7212%2011.6897V11.5823C12.669%2010.7227%2013.3484%209.97048%2014.1846%209.91675C14.6028%209.91675%2015.0209%2010.1317%2015.2822%2010.454V9.37948C14.9686%209.16458%2014.5505%209.11085%2014.1846%209.11085C12.8258%209.0034%2011.7805%2010.1317%2011.7805%2011.5286ZM10.1602%2010.9376C9.6376%2010.7227%209.4808%2010.6152%209.4808%2010.3466C9.53307%2010.0242%209.79439%209.75557%2010.108%209.8093C10.3693%209.8093%2010.6306%209.97048%2010.8397%2010.1854L11.3101%209.54066C10.9442%209.2183%2010.4738%209.00339%2010.0035%209.00339C9.27175%208.94967%208.64457%209.54066%208.5923%2010.2928V10.3466C8.5923%2010.9913%208.85363%2011.3674%209.68986%2011.636C9.89892%2011.6897%2010.108%2011.7972%2010.317%2011.9046C10.4738%2012.0121%2010.5784%2012.1733%2010.5784%2012.3882C10.5784%2012.7643%2010.2648%2013.0866%209.95119%2013.0866H9.89892C9.4808%2013.0866%209.11495%2012.818%208.95816%2012.4419L8.38325%2013.0329C8.69683%2013.6239%209.32401%2013.9463%209.95119%2013.9463C10.7874%2014%2011.4669%2013.3553%2011.5191%2012.4956V12.3345C11.4669%2011.6897%2011.2055%2011.3674%2010.1602%2010.9376ZM7.12889%2013.8925H8.01739V9.11084H7.12889V13.8925ZM2.99997%209.11086H4.30659H4.56791C5.82226%209.16459%206.81529%2010.2391%206.76303%2011.5286C6.76303%2012.227%206.44944%2012.8718%205.92679%2013.3553C5.45641%2013.7314%204.8815%2013.9463%204.30659%2013.8926H2.99997V9.11086ZM4.1498%2013.0866C4.56792%2013.1404%205.0383%2012.9792%205.35189%2012.7106C5.66548%2012.3882%205.82227%2011.9584%205.82227%2011.4748C5.82227%2011.045%205.66548%2010.6152%205.35189%2010.2928C5.0383%2010.0242%204.56792%209.86302%204.1498%209.91675H3.88848V13.0866H4.1498Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.9477%209C16.6411%209%2015.5435%2010.0745%2015.5435%2011.4714C15.5435%2012.8146%2016.5888%2013.9429%2017.9477%2013.9966C19.3066%2014.0503%2020.3519%2012.9221%2020.4041%2011.5252C20.3519%2010.1283%2019.3066%209%2017.9477%209V9Z'%20fill='%23FD6020'/%3e%3c/svg%3e",sn="/assets/payment-method-5-hN08f33O.svg",ln="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='white'%20stroke='%23D9D9D9'/%3e%3cpath%20d='M7.95531%207.14465C7.98447%205.95059%209.0337%204.91992%2010.2029%204.90246C11.3704%204.89882%2012.5381%204.90194%2013.7056%204.90088C13.7024%208.89597%2013.712%2012.8915%2013.7008%2016.8864C13.6558%2018.0659%2012.6181%2019.0769%2011.4616%2019.0978C10.2919%2019.1021%209.12201%2019.0984%207.95224%2019.0996V14.1126C9.08847%2014.385%2010.28%2014.5009%2011.4391%2014.3202C12.132%2014.2071%2012.8901%2013.8619%2013.1247%2013.1327C13.2973%2012.5089%2013.2001%2011.8524%2013.2258%2011.2121V9.72527H11.2198C11.2108%2010.7086%2011.2383%2011.6937%2011.2053%2012.6759C11.1512%2013.2796%2010.5619%2013.6632%2010.0006%2013.6427C9.3046%2013.6502%207.92529%2013.131%207.92529%2013.131C7.92182%2011.2885%207.94548%208.98116%207.95531%207.14483V7.14465Z'%20fill='url(%23paint0_linear_378_3354)'/%3e%3cpath%20d='M21.9994%2012.2875C22.5057%2012.2987%2023.0149%2012.2648%2023.5192%2012.3051C24.03%2012.4018%2024.1531%2013.1861%2023.6993%2013.443C23.3897%2013.6123%2023.0219%2013.5061%2022.6863%2013.5359H21.9994V12.2875ZM23.812%2010.8745C23.9245%2011.2773%2023.5417%2011.639%2023.1593%2011.5835H21.9994C22.0075%2011.2037%2021.9835%2010.7913%2022.0111%2010.4314C22.4758%2010.4447%2022.9448%2010.4044%2023.4067%2010.4525C23.6052%2010.5031%2023.7714%2010.6687%2023.812%2010.8745ZM26.6035%204.90066C26.6251%205.66996%2026.6066%206.47993%2026.6128%207.26483C26.6114%2010.456%2026.6158%2013.647%2026.6103%2016.8384C26.59%2018.0343%2025.5452%2019.0735%2024.3745%2019.0974C23.2027%2019.1022%2022.0306%2019.0981%2020.8586%2019.0994V14.2751C22.1356%2014.2684%2023.4132%2014.2887%2024.6896%2014.265C25.2818%2014.2273%2025.9304%2013.8309%2025.9579%2013.1698C26.0277%2012.5059%2025.4106%2012.0467%2024.8248%2011.9741C24.5996%2011.9682%2024.6062%2011.9075%2024.8248%2011.8811C25.3836%2011.7586%2025.8223%2011.1719%2025.6579%2010.5844C25.5178%209.96642%2024.8446%209.72725%2024.2846%209.72844C23.1428%209.72057%2022.0007%209.72734%2020.8589%209.72505C20.8663%208.8244%2020.8435%207.92279%2020.8711%207.0228C20.9616%205.84843%2022.0327%204.87996%2023.1869%204.90097C24.3259%204.90079%2025.4648%204.90079%2026.6035%204.90075V4.90066Z'%20fill='url(%23paint1_linear_378_3354)'/%3e%3cpath%20d='M14.4538%2010.3247C14.3482%2010.3475%2014.4325%209.95984%2014.4055%209.81281C14.4127%208.8831%2014.3905%207.95239%2014.4178%207.02334C14.508%205.84401%2015.5873%204.87312%2016.7462%204.90072H20.1592C20.156%208.89581%2020.1655%2012.8913%2020.1544%2016.8862C20.1094%2018.0658%2019.0715%2019.0767%2017.915%2019.0977C16.7452%2019.1021%2015.5753%2019.0984%2014.4055%2019.0995V13.6356C15.2044%2014.3006%2016.2903%2014.4041%2017.2857%2014.4059C18.0361%2014.4057%2018.7821%2014.2883%2019.5108%2014.1127V13.1117C18.6896%2013.527%2017.7242%2013.7907%2016.8138%2013.5521C16.1788%2013.3918%2015.7178%2012.7692%2015.7281%2012.1043C15.6545%2011.4129%2016.054%2010.6829%2016.7237%2010.4774C17.5553%2010.2133%2018.4616%2010.4153%2019.241%2010.7586C19.408%2010.8473%2019.5775%2010.9574%2019.5107%2010.6742V9.8874C18.2071%209.57275%2016.8198%209.45697%2015.5101%209.79927C15.131%209.90775%2014.7617%2010.0723%2014.4538%2010.3248V10.3247Z'%20fill='url(%23paint2_linear_378_3354)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_378_3354'%20x1='7.82983'%20y1='12.1362'%20x2='13.6113'%20y2='12.1362'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230F6EB6'/%3e%3cstop%20offset='1'%20stop-color='%23006DBA'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_378_3354'%20x1='20.8193'%20y1='11.6965'%20x2='26.5765'%20y2='11.6965'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2358B03A'/%3e%3cstop%20offset='1'%20stop-color='%2355B330'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_378_3354'%20x1='14.3971'%20y1='11.8341'%20x2='20.1581'%20y2='11.8341'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23DE0D3D'/%3e%3cstop%20offset='1'%20stop-color='%23E30138'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",dn={class:"method"},cn={class:"method__header"},un={class:"method__type"},mn={key:0,class:"method__logo"},_n={class:"method__content-wrapper"},pn=L({__name:"NewPaymentMethod",props:{open:{type:Boolean},method:{},modelValue:{},testId:{}},emits:["update:model-value"],setup(a){const n=a,e=k(null);Y(()=>n.open,()=>{t(n.open)}),me(()=>{t(n.open,0)});const t=(o,r=.3)=>{if(!e.value)return null;o?re.to(e.value,{height:"auto",opacity:1,duration:r}):re.to(e.value,{height:"0",opacity:0,padding:0,duration:r})};return(o,r)=>(i(),C("div",dn,[l("div",cn,[l("div",un,[g(Be,{value:o.method,"model-value":o.modelValue,"test-id":o.testId,"onUpdate:modelValue":r[0]||(r[0]=c=>o.$emit("update:model-value",c))},{default:_(()=>[oe(o.$slots,"title",{},void 0,!0)]),_:3},8,["value","model-value","test-id"])]),o.$slots.logo?(i(),C("div",mn,[oe(o.$slots,"logo",{},void 0,!0)])):M("",!0)]),l("div",{ref_key:"collapsedContent",ref:e,class:"method__content"},[l("div",_n,[oe(o.$slots,"content",{},void 0,!0)])],512)]))}}),_e=N(pn,[["__scopeId","data-v-5f558693"]]);var Ye="https://js.stripe.com/v3",hn=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Ee="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",yn=function(){for(var n=document.querySelectorAll('script[src^="'.concat(Ye,'"]')),e=0;e<n.length;e++){var t=n[e];if(hn.test(t.src))return t}return null},vn=function(n){var e="",t=document.createElement("script");t.src="".concat(Ye).concat(e);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(t),t},fn=function(n,e){!n||!n._registerWrapper||n._registerWrapper({name:"stripe-js",version:"1.46.0",startTime:e})},ne=null,Cn=function(n){return ne!==null||(ne=new Promise(function(e,t){if(typeof window>"u"){e(null);return}if(window.Stripe&&n&&console.warn(Ee),window.Stripe){e(window.Stripe);return}try{var o=yn();o&&n?console.warn(Ee):o||(o=vn(n)),o.addEventListener("load",function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}),o.addEventListener("error",function(){t(new Error("Failed to load Stripe.js"))})}catch(r){t(r);return}})),ne},gn=function(n,e,t){if(n===null)return null;var o=n.apply(void 0,e);return fn(o,t),o},Qe=Promise.resolve().then(function(){return Cn(null)}),je=!1;Qe.catch(function(a){je||console.warn(a)});var zn=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];je=!0;var o=Date.now();return Qe.then(function(r){return gn(r,e,o)})};function bn(a){const n=Q(),e=vt();return W({...a,mutationFn:t=>{const o=e.query.publicParticipantId||se.get("publicParticipantId")||void 0,r=se.get(de.APPLY_VIP_ID)||void 0;return U.createCardPaymentMethod(t.cardService,t.paymentMetas,t.isFavorite,t.currency,{publicParticipantId:o,applyId:r})},onSuccess:(t,o)=>{var m;const{data:r}=n.getQueryData([T.PAYMENT_METHODS,o.currency])||{data:[],meta:{}};let c=[];t.data.primary?c=[...r.map(u=>(u.primary=!1,u))]:c=[...r];const d={data:[t.data,...c]};n.setQueryData([T.PAYMENT_METHODS,o.currency],d),(m=a==null?void 0:a.onSuccess)==null||m.call(a,t)}})}const wn={class:"method__fields"},Mn={class:"method__input-wrapper"},En={class:"method__input-wrapper"},Sn={class:"method__input-wrapper"},We=L({__name:"StripeCardFields",props:{open:{type:Boolean},currency:{}},emits:["new-card"],setup(a,{emit:n}){const e=a,t=n,o=k(null),r=k(null),c=k(null),d=k(null),m=k(null),u=k(null),v=k(null),h=k(null),E=k(null),F=k(!1),y=$e(),w=Q(),{getCssColorValue:R}=zt(v),{t:B}=H(),{toast:f}=Le(),{value:z}=Te("primary",void 0,{standalone:!0,initialValue:!1,syncVModel:!0}),S=q(()=>e.currency),{data:G}=ce({queryKey:[T.PAYMENT_METHODS,S],queryFn:()=>U.getPaymentMethods(),enabled:()=>y.isLoggedIn}),O=q(()=>{var A;return(((A=G==null?void 0:G.value)==null?void 0:A.data.length)||0)>1}),{isSuccess:j,isLoading:at,data:te,refetch:ot}=ce({queryKey:[T.GET_STRIPE_PAYMENT_INTENT,S],queryFn:()=>U.getStripePaymentIntent(S.value),gcTime:0,staleTime:0,enabled:!1}),{isPending:rt,mutate:st}=bn({onSuccess:A=>{f({type:ae.SUCCESS,title:B("new_payment_added.title"),text:B("new_payment_added.text")}),it(),w.invalidateQueries({queryKey:[T.GET_STRIPE_PAYMENT_INTENT]}),t("new-card",A.data.id)},onError:A=>{console.error({e:A}),f({type:ae.ERROR,text:A.message})}});Y(()=>e.open,()=>{e.open&&ot()},{immediate:!0}),Y(j,()=>{j.value&&te.value&&lt(te.value.data)});const lt=async A=>{if(h.value||(h.value=await zn(S.value==="EUR"?"pk_live_51N8PzwGLYuebmQlP2zGxbRacS2wl4od37cJ8OTKwkuy3WQOjJEVG4DigfsPYLSTMMGebfgPbYvl5EAlP6c4qlMJw00YeXNdIq2":"pk_live_SeDDh4sIe6jtJs2IvokQKhJe00dQmHiTat")),!h.value)throw new Error("Stripe is not init.");if(!E.value){E.value=h.value.elements({clientSecret:A.client_secret,appearance:{theme:"none"}});const I={base:{fontFamily:R("--font"),"::placeholder":{color:R("--theme-text-color--secondary")}},invalid:{color:R("--theme-error-color")}};d.value=E.value.create("cardNumber",{style:I}),m.value=E.value.create("cardExpiry",{style:I}),u.value=E.value.create("cardCvc",{style:I}),o.value&&d.value.mount(o.value),r.value&&m.value.mount(r.value),c.value&&u.value.mount(c.value)}},it=()=>{var A,I,x;(A=d.value)==null||A.clear(),(I=m.value)==null||I.clear(),(x=u.value)==null||x.clear()},dt=async()=>{var A;if(F.value)return null;try{if(F.value=!0,!h.value)throw new Error("Stripe is not init.");if(!E.value)throw new Error("Stripe Elements are not init.");if(!((A=te.value)!=null&&A.data.client_secret))throw new Error("No payment intent client secret.");const I=E.value.getElement("cardNumber");if(!I)throw new Error("No card number element found.");const x=await h.value.confirmCardSetup(te.value.data.client_secret,{payment_method:{card:I}});if(x.error)throw f({type:ae.ERROR,text:x.error.message});st({cardService:xe.STRIPE,isFavorite:z.value,paymentMetas:x.setupIntent,currency:S.value})}finally{F.value=!1}};return(A,I)=>(i(),C("div",{ref_key:"methodEl",ref:v,class:"method"},[s(at)?(i(),b(He,{key:0,class:"method__loader"})):M("",!0),Ne(l("div",null,[l("div",wn,[g(le,{class:"method__field method__field--number",required:""},{label:_(()=>[P(p(s(B)("card_number")),1)]),default:_(()=>[l("div",Mn,[l("div",{ref_key:"cardNumberEl",ref:o,class:"method__field","data-testId":"card-number"},null,512)])]),_:1}),g(le,{required:""},{label:_(()=>[P(p(s(B)("card_expiration_date")),1)]),default:_(()=>[l("div",En,[l("div",{ref_key:"cardExpiryEl",ref:r,class:"method__field","data-testId":"card-expiration-date"},null,512)])]),_:1}),g(le,{required:""},{label:_(()=>[P(p(s(B)("card_cvc")),1)]),default:_(()=>[l("div",Sn,[l("div",{ref_key:"cardCvcEl",ref:c,class:"method__field","data-testId":"card-cvc"},null,512)])]),_:1})]),O.value?(i(),b(gt,{key:0,modelValue:s(z),"onUpdate:modelValue":I[0]||(I[0]=x=>Ct(z)?z.value=x:null),class:"method__favorite","data-testId":"set-favorite"},{default:_(()=>[P(p(s(B)("favorite_payment_method")),1)]),_:1},8,["modelValue"])):M("",!0),g(J,{class:"method__validate",size:s(X).SMALL,pending:s(rt)||F.value,disabled:!1,"test-id":"save-card",onClick:dt},{default:_(()=>[P(p(s(B)("save")),1)]),_:1},8,["size","pending"])],512),[[ft,s(j)]])],512))}});function Se(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{card_number:e=>{const{normalize:t}=e;return t(["Numéro de carte"])},card_expiration_date:e=>{const{normalize:t}=e;return t(["Date d'expiration"])},card_cvc:e=>{const{normalize:t}=e;return t(["CVV"])},favorite_payment_method:e=>{const{normalize:t}=e;return t(["Définir comme mode de paiement favori"])},save:e=>{const{normalize:t}=e;return t(["Enregistrer"])},new_payment_added:{title:e=>{const{normalize:t}=e;return t(["Enregistré"])},text:e=>{const{normalize:t}=e;return t(["Votre nouvelle méthode de paiement a bien été enregistrée."])}}},en:{card_number:e=>{const{normalize:t}=e;return t(["Card number"])},card_expiration_date:e=>{const{normalize:t}=e;return t(["Expiration date"])},card_cvc:e=>{const{normalize:t}=e;return t(["CVV"])},favorite_payment_method:e=>{const{normalize:t}=e;return t(["Define as a favorite payment method"])},save:e=>{const{normalize:t}=e;return t(["Save"])},new_payment_added:{title:e=>{const{normalize:t}=e;return t(["Saved"])},text:e=>{const{normalize:t}=e;return t(["Your new payment method has been saved."])}}}}})}typeof Se=="function"&&Se(We);const kn=N(We,[["__scopeId","data-v-149ded17"]]),Pn={class:"method__logos"},An=["alt"],Dn=["alt"],Vn=["alt"],Ln=["alt"],Nn=["alt"],Rn=["alt"],In=["alt"],Xe=L({__name:"NewPaymentMethodCard",props:{open:{type:Boolean},modelValue:{},currency:{}},emits:["new-payment-method","update:model-value"],setup(a,{emit:n}){const e=n,{t}=H(),o=r=>{e("new-payment-method",r)};return(r,c)=>(i(),b(_e,{class:"method",open:r.open,method:s(V).CARD,"model-value":r.modelValue,"test-id":"payment-new-card","onUpdate:modelValue":c[0]||(c[0]=d=>r.$emit("update:model-value",d))},{title:_(()=>[P(p(s(t)("card")),1)]),logo:_(()=>[l("div",Pn,[l("img",{class:"method__logo",src:nn,alt:s(t)("card")},null,8,An),l("img",{class:"method__logo method__logo",src:Mt,alt:s(t)("card")},null,8,Dn),l("img",{class:"method__logo method__logo--hiddeable",src:an,alt:s(t)("card")},null,8,Vn),l("img",{class:"method__logo method__logo--hiddeable",src:on,alt:s(t)("card")},null,8,Ln),l("img",{class:"method__logo method__logo--hiddeable",src:rn,alt:s(t)("card")},null,8,Nn),l("img",{class:"method__logo method__logo--hiddeable",src:sn,alt:s(t)("card")},null,8,Rn),l("img",{class:"method__logo method__logo--hiddeable",src:ln,alt:s(t)("card")},null,8,In)])]),content:_(()=>[g(kn,{open:r.open,currency:r.currency,onNewCard:o},null,8,["open","currency"])]),_:1},8,["open","method","model-value"]))}});function ke(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{card:e=>{const{normalize:t}=e;return t(["Carte"])}},en:{card:e=>{const{normalize:t}=e;return t(["Card"])}}}})}typeof ke=="function"&&ke(Xe);const $n=N(Xe,[["__scopeId","data-v-f5be9481"]]),Tn="data:image/svg+xml,%3csvg%20width='35'%20height='24'%20viewBox='0%200%2035%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='0.5'%20width='33.5'%20height='23'%20rx='2'%20fill='white'%20stroke='%23D9D9D9'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.355%203.97131C9.10534%205.49745%206.88982%2013.2678%2011.4064%2017.8204C16.5255%2022.9807%2025.042%2019.3197%2025.0636%2011.9497C25.0685%2010.2503%2025.0427%2010.2124%2023.8572%2010.1782C20.9236%2010.094%2017.0885%2010.1962%2017.0885%2010.3587C17.0885%2010.4567%2018.3143%2011.8442%2019.8124%2013.4418C21.3106%2015.0394%2022.5364%2016.4335%2022.5364%2016.5398C22.5364%2017.6528%2019.246%2017.9773%2017.3571%2017.0506C13.2935%2015.0569%2010.4021%208.60123%2012.6206%206.47564C13.8053%205.3406%2015.7063%205.79181%2019.9455%208.21392C21.4987%209.10147%2022.8294%209.79058%2022.9024%209.7455C22.9756%209.70027%2022.3809%208.38743%2021.5812%206.82778L20.1271%203.99245L19.4745%203.87654C18.465%203.69742%2016.2703%203.74777%2015.355%203.97131Z'%20fill='%231E1A14'/%3e%3c/svg%3e",Hn={class:"title_description"},Je=L({__name:"NewPaymentMethodGoCardless",props:{open:{type:Boolean},modelValue:{},currency:{}},emits:["new-payment-method","update:model-value"],setup(a,{emit:n}){const e=a,t=n,{t:o}=H(),r=Q(),c=k(!1),d=k(!1),m="live",{mutate:u}=W({mutationFn:()=>{d.value=!0;const y=se.get(de.APPLY_VIP_ID)||void 0,w=e.currency==="USD"?"ach":"sepa";return U.initPaymentMethodGoCardless(w,y)},onSuccess:y=>{var R;const w=(R=window.GoCardlessDropin)==null?void 0:R.create({billingRequestFlowID:y.data.id,environment:m,onSuccess:E,onExit:F});w==null||w.open()},onError:()=>{d.value=!1}}),{mutate:v}=W({mutationFn:y=>U.createCardPaymentMethod("gocardless",y.billingRequest,!1,e.currency,{applyId:se.get(de.APPLY_VIP_ID)||void 0}),onSuccess:y=>{const{data:w}=r.getQueryData([T.PAYMENT_METHODS,e.currency]),R=[...w],B={data:[y.data,...R]};r.setQueryData([T.PAYMENT_METHODS,e.currency],B),t("new-payment-method",y.data.id)},onError:y=>{console.error(y),bt({type:"error",title:o("error_activate_title"),text:o("error_activate_text")})}}),h=()=>{c.value=!0},E=(y,w)=>{d.value=!1,v({billingRequest:y,billingRequestFlow:w})},F=()=>{d.value=!1};return me(()=>{if(document.getElementById("lib-gocardless")){h();return}const y=document.createElement("script");y.src="https://pay.gocardless.com/billing/static/dropin/v2/initialise.js",y.id="lib-gocardless",y.onload=h,document.getElementsByTagName("head")[0].appendChild(y)}),(y,w)=>(i(),b(_e,{open:y.open,method:s(V).GOCARDLESS,"model-value":y.modelValue,"onUpdate:modelValue":w[0]||(w[0]=R=>y.$emit("update:model-value",R))},{title:_(()=>[P(p(s(o)(`title_${y.currency}`))+" ",1),l("p",Hn,p(s(o)(`title_description_${y.currency}`)),1)]),logo:_(()=>w[1]||(w[1]=[l("img",{src:Tn,alt:"GoCardless"},null,-1)])),content:_(()=>[c.value?(i(),b(J,{key:1,class:"validate",size:s(X).SMALL,pending:d.value,onClick:s(u)},{default:_(()=>[P(p(s(o)(`create_${y.currency}`)),1)]),_:1},8,["size","pending","onClick"])):(i(),b(He,{key:0}))]),_:1},8,["open","method","model-value"]))}});function Pe(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{title_USD:e=>{const{normalize:t}=e;return t(["Prélèvement ACH GoCardless"])},title_EUR:e=>{const{normalize:t}=e;return t(["Prélèvement SEPA GoCardless"])},create_USD:e=>{const{normalize:t}=e;return t(["Créer un mandat ACH"])},create_EUR:e=>{const{normalize:t}=e;return t(["Créer un mandat SEPA"])},error_activate_title:e=>{const{normalize:t}=e;return t(["Une erreur s'est produite"])},error_activate_text:e=>{const{normalize:t}=e;return t(["Nous n'avons pas pu ajouter votre méthode de paiement. Veuillez réessayer plus tard."])},title_description_USD:e=>{const{normalize:t}=e;return t(["(nécessite un compte bancaire en US$)"])},title_description_EUR:e=>{const{normalize:t}=e;return t(["(nécessite un compte bancaire en euros)"])}},en:{title_USD:e=>{const{normalize:t}=e;return t(["Prevailing ACH Gocardless"])},title_EUR:e=>{const{normalize:t}=e;return t(["Prevailing SEPA GoCardless"])},create_USD:e=>{const{normalize:t}=e;return t(["Create an ACH mandate"])},create_EUR:e=>{const{normalize:t}=e;return t(["Create a SEPA mandate"])},error_activate_title:e=>{const{normalize:t}=e;return t(["An error has occurred"])},error_activate_text:e=>{const{normalize:t}=e;return t(["We could not add your payment method.Please try again later."])},title_description_USD:e=>{const{normalize:t}=e;return t(["(requires a bank account in US$)"])},title_description_EUR:e=>{const{normalize:t}=e;return t(["(requires a bank account in euros)"])}}}})}typeof Pe=="function"&&Pe(Je);const Bn=N(Je,[["__scopeId","data-v-fd3b6d58"]]),et=L({__name:"NewPaymentMethodBankTransfer",props:{open:{type:Boolean},modelValue:{},currency:{}},emits:["new-payment-method","update:model-value"],setup(a,{emit:n}){const e=a,t=n,o={id:D.BANK_TRANSFER,primary:!0,status:K.VALID,gateway:D.BANK_TRANSFER},{t:r}=H(),c=Q(),d=()=>{const{data:m}=c.getQueryData([T.PAYMENT_METHODS,e.currency]),u=[...m];if(m.find(E=>E.id===o.id)){t("new-payment-method",D.BANK_TRANSFER);return}const h={data:[o,...u]};c.setQueryData([T.PAYMENT_METHODS,e.currency],h),t("new-payment-method",D.BANK_TRANSFER)};return(m,u)=>(i(),b(_e,{open:m.open,method:s(V).BANK_TRANSFER,"model-value":m.modelValue,"onUpdate:modelValue":u[0]||(u[0]=v=>m.$emit("update:model-value",v))},{title:_(()=>[P(p(s(r)("brand")),1)]),content:_(()=>[g(J,{class:"validate",size:s(X).SMALL,onClick:d},{default:_(()=>[P(p(s(r)("create")),1)]),_:1},8,["size"])]),_:1},8,["open","method","model-value"]))}});function Ae(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{brand:e=>{const{normalize:t}=e;return t(["Virement bancaire"])},create:e=>{const{normalize:t}=e;return t(["Créer un virement"])}},en:{brand:e=>{const{normalize:t}=e;return t(["Bank transfer"])},create:e=>{const{normalize:t}=e;return t(["Create a transfer"])}}}})}typeof Ae=="function"&&Ae(et);const Fn=N(et,[["__scopeId","data-v-d44ff4b7"]]),xn={class:"module"},Un={class:"module__close--title"},Gn={class:"module__title"},On={class:"module__methods"},tt=L({__name:"AddNewPaymentMethod",props:{supportedPaymentMethods:{},openAddNewPaymentMethod:{type:Boolean},modelValue:{},currency:{}},emits:["update:model-value","payment-method-added"],setup(a,{emit:n}){const e=a,t=n,o=k(e.openAddNewPaymentMethod),{t:r}=H(),c=k(null);Y(()=>o.value,()=>{d(o.value)}),Y(()=>e.openAddNewPaymentMethod,(v,h)=>{v&&!h&&(o.value=v)}),me(()=>{d(o.value,0)});const d=(v,h=.3)=>{if(!c.value)return null;v?re.to(c.value,{height:"auto",opacity:1,duration:h,overflow:"auto"}):re.to(c.value,{height:"0",opacity:0,padding:0,overflow:"hidden",duration:h})},m=v=>{switch(v){case V.CARD:return $n;case V.BANK_TRANSFER:return Fn;default:return Bn}},u=v=>{t("update:model-value",v),t("payment-method-added",v)};return(v,h)=>(i(),C("div",xn,[o.value?M("",!0):(i(),C("div",{key:0,class:"module__close","data-testid":"payment-add-new-method",onClick:h[0]||(h[0]=E=>o.value=!0)},[g(Re,{legacy:"",name:"plus"}),l("h2",Un,p(s(r)("add-new-method")),1)])),l("div",{ref_key:"collapsedContent",ref:c},[l("h2",Gn,p(s(r)("select-method")),1),g(Z,{class:"module__separator module__separator--small"}),l("div",On,[(i(!0),C($,null,ee(v.supportedPaymentMethods,(E,F)=>(i(),C($,{key:E},[(i(),b(Ie(m(E)),{method:E,open:E===v.modelValue,"model-value":v.modelValue,currency:v.currency,onNewPaymentMethod:u,"onUpdate:modelValue":h[1]||(h[1]=y=>v.$emit("update:model-value",y))},null,40,["method","open","model-value","currency"])),F<v.supportedPaymentMethods.length-1?(i(),b(Z,{key:0,class:"module__separator module__separator--small"})):M("",!0)],64))),128))])],512)]))}});function De(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{"add-new-method":e=>{const{normalize:t}=e;return t(["Ajouter un mode de paiement"])},"select-method":e=>{const{normalize:t}=e;return t(["Choisir un mode de paiement"])}},en:{"add-new-method":e=>{const{normalize:t}=e;return t(["Add a payment method"])},"select-method":e=>{const{normalize:t}=e;return t(["Choose a payment method"])}}}})}typeof De=="function"&&De(tt);const qn=N(tt,[["__scopeId","data-v-7e1c42e0"]]),Zn={class:"module"},nt=L({__name:"PaymentModule",props:{supportedMethods:{default:()=>[V.CARD,V.GOCARDLESS]},name:{default:void 0},currency:{default:"USD"},modelValue:{default:void 0}},emits:["update:model-value","validate-payment-form"],setup(a,{emit:n}){const e=a,t=q(()=>(Math.random()+1).toString(36).substring(2)),o=q(()=>e.currency),{value:r,setValue:c}=Te(e.name??t,y,{initialValue:e.modelValue||void 0,standalone:!e.name,syncVModel:!0}),d=n,m=k(!1),u=k(null),v=$e(),{data:h,isLoading:E,isSuccess:F}=ce({queryKey:[T.PAYMENT_METHODS,o],queryFn:()=>U.getPaymentMethods(),enabled:()=>v.isLoggedIn});Y(()=>u.value,()=>{var S;const f=(S=h.value)==null?void 0:S.data;if(u.value===D.BANK_TRANSFER){r.value=u.value;return}if(!f)return r.value=null,null;const z=f==null?void 0:f.find(G=>G.id===u.value);r.value=(z==null?void 0:z.id)??null});function y(f){return f===D.BANK_TRANSFER?!0:!(!f||[V.CARD,V.GOCARDLESS,V.PAYPAL].includes(f))}const w=q(()=>{var f,z;return F.value&&((f=h.value)!=null&&f.data)?((z=h.value)!=null&&z.data?[...h.value.data]:[]).reverse().filter(G=>{let O="";switch(G.gateway){case D.BRAINTREE:case D.STRIPE:{O=V.CARD;break}case D.GOCARDLESS:{O=V.GOCARDLESS;break}case D.BANK_TRANSFER:{O=V.BANK_TRANSFER;break}}return O?!!e.supportedMethods.find(j=>j===O):!1}):[]}),R=q(()=>!!(w.value&&w.value.length>0));Y(h,()=>{var f,z;if(!h.value)return u.value=null,null;h.value.data.length===0?(m.value=!0,u.value="card",e.supportedMethods.length===1&&c(e.supportedMethods[0])):(u.value=((z=(f=h.value)==null?void 0:f.data.find(S=>S.primary))==null?void 0:z.id)||null,c(u.value))},{immediate:!0});const B=f=>{wt(()=>{var z,S;((S=(z=h.value)==null?void 0:z.data)==null?void 0:S.length)===1&&d("validate-payment-form"),typeof f=="string"&&(u.value=f)})};return(f,z)=>(i(),C("div",Zn,[R.value?(i(),b(tn,{key:0,modelValue:u.value,"onUpdate:modelValue":z[0]||(z[0]=S=>u.value=S),"my-payment-methods":w.value,loading:s(E)&&s(v).isLoggedIn,"name-field":f.name},null,8,["modelValue","my-payment-methods","loading","name-field"])):M("",!0),R.value?(i(),b(Z,{key:1,class:"module__separator module__separator--small"})):M("",!0),g(qn,{modelValue:u.value,"onUpdate:modelValue":z[1]||(z[1]=S=>u.value=S),"supported-payment-methods":f.supportedMethods,"open-add-new-payment-method":m.value,currency:f.currency,onPaymentMethodAdded:B},null,8,["modelValue","supported-payment-methods","open-add-new-payment-method","currency"])]))}});function Ve(a){const n=a;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{pay:e=>{const{normalize:t}=e;return t(["Payer"])}},en:{pay:e=>{const{normalize:t}=e;return t(["Pay"])}}}})}typeof Ve=="function"&&Ve(nt);const Xn=N(nt,[["__scopeId","data-v-2ba0791c"]]);export{Xn as P,V as S};
//# sourceMappingURL=PaymentModule-DkZVnhdW.js.map