rebill-web-components-sdk 1.8.3-beta.9 → 1.8.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.cjs.js.map +1 -1
  2. package/dist/cjs/otp-component_7.cjs.entry.js +9 -9
  3. package/dist/cjs/otp-component_7.cjs.entry.js.map +1 -1
  4. package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
  5. package/dist/cjs/rebill-renewal.cjs.entry.js.map +1 -1
  6. package/dist/cjs/rebill-renewal.entry.cjs.js.map +1 -1
  7. package/dist/cjs/renewal-success-page.cjs.entry.js +2 -2
  8. package/dist/cjs/renewal-success-page.cjs.entry.js.map +1 -1
  9. package/dist/cjs/renewal-success-page.entry.cjs.js.map +1 -1
  10. package/dist/cjs/renewal-success-page.renewal-summary.entry.cjs.js.map +1 -1
  11. package/dist/cjs/renewal-success-page_2.cjs.entry.js +2 -2
  12. package/dist/cjs/renewal-success-page_2.cjs.entry.js.map +1 -1
  13. package/dist/cjs/success-page.cjs.entry.js +9 -9
  14. package/dist/cjs/success-page.cjs.entry.js.map +1 -1
  15. package/dist/cjs/success-page.entry.cjs.js.map +1 -1
  16. package/dist/collection/components/checkout/card-success-page/success-page.css +27 -22
  17. package/dist/collection/components/checkout/card-success-page/success-page.js +8 -8
  18. package/dist/collection/components/checkout/card-success-page/success-page.js.map +1 -1
  19. package/dist/collection/components/renewal/rebill-renewal.js +1 -1
  20. package/dist/collection/components/renewal/rebill-renewal.js.map +1 -1
  21. package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.css +21 -76
  22. package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.js +1 -1
  23. package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.js.map +1 -1
  24. package/dist/components/{p-C-B8iTeF.js → p-8yLdsIgK.js} +4 -4
  25. package/dist/components/p-8yLdsIgK.js.map +1 -0
  26. package/dist/components/{p-BEEjWgM3.js → p-R_YFY6AY.js} +11 -11
  27. package/dist/components/p-R_YFY6AY.js.map +1 -0
  28. package/dist/components/rebill-renewal.js +1 -1
  29. package/dist/components/rebill-renewal.js.map +1 -1
  30. package/dist/components/renewal-success-page2.js +2 -2
  31. package/dist/components/renewal-success-page2.js.map +1 -1
  32. package/dist/components/success-page2.js +9 -9
  33. package/dist/components/success-page2.js.map +1 -1
  34. package/dist/esm/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.js.map +1 -1
  35. package/dist/esm/otp-component_7.entry.js +9 -9
  36. package/dist/esm/otp-component_7.entry.js.map +1 -1
  37. package/dist/esm/rebill-renewal.entry.js +1 -1
  38. package/dist/esm/rebill-renewal.entry.js.map +1 -1
  39. package/dist/esm/renewal-success-page.entry.js +2 -2
  40. package/dist/esm/renewal-success-page.entry.js.map +1 -1
  41. package/dist/esm/renewal-success-page.renewal-summary.entry.js.map +1 -1
  42. package/dist/esm/renewal-success-page_2.entry.js +2 -2
  43. package/dist/esm/renewal-success-page_2.entry.js.map +1 -1
  44. package/dist/esm/success-page.entry.js +9 -9
  45. package/dist/esm/success-page.entry.js.map +1 -1
  46. package/dist/rebill-web-components-sdk/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.esm.js.map +1 -1
  47. package/dist/rebill-web-components-sdk/{p-d51a9b31.entry.js → p-02c8d5ca.entry.js} +2 -2
  48. package/dist/rebill-web-components-sdk/{p-d51a9b31.entry.js.map → p-02c8d5ca.entry.js.map} +1 -1
  49. package/dist/rebill-web-components-sdk/p-70b7d9c8.entry.js +2 -0
  50. package/dist/rebill-web-components-sdk/p-70b7d9c8.entry.js.map +1 -0
  51. package/dist/rebill-web-components-sdk/p-836f16da.entry.js +2 -0
  52. package/dist/rebill-web-components-sdk/p-836f16da.entry.js.map +1 -0
  53. package/dist/rebill-web-components-sdk/rebill-renewal.entry.esm.js.map +1 -1
  54. package/dist/rebill-web-components-sdk/rebill-renewal.entry.js +1 -1
  55. package/dist/rebill-web-components-sdk/rebill-renewal.entry.js.map +1 -1
  56. package/dist/rebill-web-components-sdk/renewal-success-page.entry.esm.js.map +1 -1
  57. package/dist/rebill-web-components-sdk/renewal-success-page.entry.js +2 -2
  58. package/dist/rebill-web-components-sdk/renewal-success-page.entry.js.map +1 -1
  59. package/dist/rebill-web-components-sdk/renewal-success-page.renewal-summary.entry.esm.js.map +1 -1
  60. package/dist/rebill-web-components-sdk/success-page.entry.esm.js.map +1 -1
  61. package/dist/rebill-web-components-sdk/success-page.entry.js +9 -9
  62. package/dist/rebill-web-components-sdk/success-page.entry.js.map +1 -1
  63. package/package.json +1 -1
  64. package/dist/components/p-BEEjWgM3.js.map +0 -1
  65. package/dist/components/p-C-B8iTeF.js.map +0 -1
  66. package/dist/rebill-web-components-sdk/p-2d406e83.entry.js +0 -2
  67. package/dist/rebill-web-components-sdk/p-2d406e83.entry.js.map +0 -1
  68. package/dist/rebill-web-components-sdk/p-8db3574a.entry.js +0 -2
  69. package/dist/rebill-web-components-sdk/p-8db3574a.entry.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as i}from"./p-DyaDabZ4.js";import{c as r}from"./p-BFhvUZPU.js";import{a as o,C as n}from"./p-C6wUNEUc.js";import{P as a,G as s,a as l}from"./p-DDeOZpZn.js";import{P as c,I as d}from"./p-B2B19LUC.js";import{r as h,R as m,o as u}from"./p-Dcf7Or4N.js";import{B as p,g as f,i as b}from"./p-Do_vNuMa.js";import{C as y}from"./p-DA598vBj.js";import{m as g,i as x,g as w,P as k,a as v}from"./p-CAKTSGNY.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";import"./p-uZj1dMLQ.js";import"./p-UlyTyHvM.js";import"./p-BYrqevT1.js";import"./p-Bf6g23G6.js";import"./p-lWh04UqG.js";const j=async(e,t,i)=>{const r=await o.checkout.getRequiredFields({currency:e,method:t},i);return{fields:g(r.data),original:r.data}};const q=async()=>{const e=[...new Set(h.data.paymentMethods.map((e=>e.type)))];const t=e.map((async e=>{try{const t=a.mapToAPMPaymentMethod(e,h.data.price.country);const i=await j(h.data.price.currency,t,h.data.organization.id);return{paymentMethod:e,...i}}catch(t){console.error(`Error getting required fields for ${e}:`,t);return{paymentMethod:e,fields:[],original:[]}}}));const i=await Promise.all(t);const r={};i.forEach((e=>{r[e.paymentMethod]={fields:e.fields,original:e.original}}));return r};const C=(e,t)=>{const i=t[e];if(i){return i}else{return{fields:[],original:[]}}};const D=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}@media (max-width: 1024px){.rebill-checkout-renewal{flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%;margin-top:24px}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}}@media (min-width: 1025px){.rebill-checkout-renewal{width:100vw;min-height:100vh;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;margin-top:24px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const N=class{constructor(i){e(this,i);this.success=t(this,"success");this.paymentError=t(this,"paymentError");this.paymentMethodSelected=t(this,"paymentMethodSelected")}renewalData;renewalToken;currentPaymentMethod=c.CARD;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;errorMessage=null;breakpoint=p.DESKTOP;errorPaymentCard=false;errorPaymentAPM=false;initialData={};checkoutResponse=null;currentApmPaymentMethod=null;countries=[];allRequiredFields={};currentRequiredFields=[];errorCardInvalid=false;cardMode="select";success;paymentError;paymentMethodSelected;validationSchema={phoneNumber:r().when([],{is:()=>x("phoneNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.phoneRequired"),otherwise:e=>e.notRequired()}),"billing-country":r().when([],{is:()=>x("billing-country",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.countryRequired"),otherwise:e=>e.notRequired()}),"billing-state":r().when([],{is:()=>x("billing-state",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.stateRequired"),otherwise:e=>e.notRequired()}),"billing-address":r().when([],{is:()=>x("billing-address",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.addressRequired"),otherwise:e=>e.notRequired()}),"billing-city":r().when([],{is:()=>x("billing-city",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.cityRequired"),otherwise:e=>e.notRequired()}),"billing-zip":r().when([],{is:()=>x("billing-zip",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.zipRequired"),otherwise:e=>e.notRequired()}),bankId:r().when([],{is:()=>x("bankId",this.currentRequiredFields),then:e=>e.required("validation.bankRequired"),otherwise:e=>e.notRequired()}),documentType:r().when([],{is:()=>x("documentType",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentTypeRequired"),otherwise:e=>e.notRequired()}),documentNumber:r().when([],{is:()=>x("documentNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:e=>e.notRequired()})};resizeHandler=()=>{this.breakpoint=f(window.innerWidth)};async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=typeof this.renewalData==="string"?JSON.parse(this.renewalData):this.renewalData;m.initializeRenewal({...e,token:this.renewalToken});s.loadGoogleMapsScript();try{const e=await o.data.getCountries();this.countries=e.data}catch(e){console.error("Error loading countries:",e)}try{this.allRequiredFields=await q()}catch(e){console.error("Error loading required fields:",e)}if(h.data.paymentMethods.length>0){const e=h.data.paymentMethods[0].type;this.currentPaymentMethod=e;m.setSelectedPaymentMethod(e);try{this.currentRequiredFields=C(e,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(e)}this.initialData=this.getInitialData();this.cardMode=h.cardMode;u("cardMode",(()=>{this.cardMode=h.cardMode}))}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async handlePaymentMethodSelected(e){e.stopPropagation();if(this.currentPaymentMethod===e.detail){return}this.currentPaymentMethod=e.detail;m.setSelectedPaymentMethod(this.currentPaymentMethod);if(this.currentPaymentMethod!==c.CARD){this.cardMode="input";m.setCardMode("input")}try{this.currentRequiredFields=C(this.currentPaymentMethod,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(this.currentPaymentMethod);this.paymentMethodSelected.emit(e.detail)}async initializeFingerprint(e){if(e===c.CARD&&!h.deviceId){try{const e=crypto.randomUUID();const t=await o.fingerPrint.getFingerPrint(e);m.setDeviceId(e);const i=t.result.script;const r=document.createElement("script");r.innerHTML=i;document.body.appendChild(r)}catch(e){console.error("Failed to initialize fingerprint:",e)}}}handleBankSelected(e){e.stopPropagation();m.setSelectedBankId(e.detail)}handleCardSelected(e){const{card:t,cvv:i}=e.detail;m.setSelectedCard(t);m.setCvv(i||"")}get currentPaymentError(){if(this.currentPaymentMethod===c.CARD){return this.errorPaymentCard}else if(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER){return this.errorPaymentAPM}return false}async handleSubmit(e){if(this.isSubmitting){return}if(this.currentPaymentMethod===c.CARD){await this.handleCardRenewal(e)}else{await this.handleAPMRenewal(e)}}async handleCardRenewal(e){const t=e?.detail||this.getInitialData();if(!h.data.cardId&&!h.data.cardTokenId){this.errorCardInvalid=true;return}if(!h.data.cardInformation&&!h.data.cardId){this.errorCardInvalid=true;return}this.errorCardInvalid=false;this.isSubmitting=true;this.isCardSubmitting=true;m.setLoading(true);try{const e={transaction:{quantity:1},...h.data.cardId&&{cardId:h.data.cardId},...h.data.cardTokenId&&{cardTokenId:h.data.cardTokenId},customAttributes:{...h.deviceId&&{deviceId:h.deviceId}},...this.cardMode==="input"&&{customer:{firstName:t.fullName?.split(" ")[0]||h.data.subscription.customerName?.split(" ")[0],lastName:t.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName?.split(" ").slice(1).join(" "),email:t.email||h.data.subscription.customerEmail,phone:{countryCode:t.countryCodePhoneNumber||"",number:t.phoneNumber||""}},billingDetails:{address:{lineOne:t["billing-address"]||"",city:t["billing-city"]||"",state:t["billing-state"]||"",country:t["billing-country"]||"",zipCode:t["billing-zip"]||""},identification:{type:t.documentType||"",value:t.documentNumber||""}}}};const i=w();const r=await o.checkout.createCardCheckoutRequest(h.data.id,i,e,h.token);this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);m.setCheckoutResponse(r.data);if(r.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.isCardSuccess=false;this.errorPaymentCard=true;this.errorMessage={message:r.data.error?.error?.message}}}catch(e){this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);this.errorPaymentCard=true;this.errorMessage={message:e.data?.error?.message}}}async handleAPMRenewal(e){this.isSubmitting=true;m.setLoading(true);try{const t=a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data.price.country);const i=e?.detail||this.getFormData();const r={address:{country:i["billing-country"],state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||""},identification:{type:i.documentType||"dni",value:i.documentNumber||""}};const s={transaction:{quantity:1},method:t,billingDetails:r,redirect:{approved:window.location.origin+"/renewal/success",rejected:window.location.origin+"/renewal/failure"},paymentMetadata:{orderId:h.data.id,source:"renewal-web"},customAttributes:{bank:i.bankId||""},...t!==l.CO_TRANSFERENCE_PSE&&{targetCurrency:h.data.price.currency}};s.customer={firstName:i.fullName?.split(" ")[0]||h.data.subscription.customerName.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName.split(" ").slice(1).join(" ")||"",email:i.email||h.data.subscription.customerEmail,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}};const c=w();const d=await o.checkout.createAPMCheckoutRequest(h.data.id,c,s);this.isSubmitting=false;m.setLoading(false);m.setCheckoutResponse(d.data);this.checkoutResponse=d.data;if(d.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.paymentError.emit(d.data);m.setCheckoutResponse(d.data);this.errorPaymentAPM=true;this.errorMessage={alertTitle:d.data?.error?.message,message:d.data.error?.message}}}catch(e){this.isSubmitting=false;m.setLoading(false);this.paymentError.emit(e);this.errorPaymentAPM=true;this.errorMessage={alertTitle:e.data?.error?.message,message:e.data?.error?.message}}}getFormData=()=>this.initialData;getInitialData=()=>({email:h.data.subscription.customerEmail,fullName:h.data.subscription.customerName,card:"","billing-country":"","billing-state":"","billing-address":"","billing-city":"","billing-zip":"",bankId:"",phoneNumber:"",countryCodePhoneNumber:"",documentType:"",documentNumber:""});hasPrefilledAddress=()=>{const e=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return e.some((e=>{const t=this.initialData[e];return t&&t.trim()!==""}))};getPaymentDate=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};getReferenceNumber=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("traceId"in e){return e.traceId}return""};render(){if(!h.isInitialized){return i("div",{class:"loading"},d.translate("renewal.loading"))}const e=e=>i("renewal-summary",{totalAmount:h.data.price.amount,currency:h.data.price.currency,subscriptionTitle:h.data.subscription.name[0]?.text||"Subscription",subscriptionAmount:h.data.subscription.amount,nextChargeDate:h.data.subscription.nextChargeDate,frequency:h.data.subscription.frequency,...e});return i(i.Fragment,null,i("rebill-processing-payment",{style:{display:this.isCardSubmitting?"block":"none"}}),this.isCardSuccess?i("renewal-success-page",{typePaymentMethod:this.currentPaymentMethod,paymentDate:this.getPaymentDate(),referenceNumber:this.getReferenceNumber(),cardLastFour:h.data.subscription.cardLastFour,country:h.data.price.country,paymentMethodName:a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data?.price?.country),bank:h.form?.selectedBankId||""}):i("rebill-checkout-form",{style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:e=>this.handleSubmit(e),renderForm:({submit:t,formData:r,errors:o})=>i("div",{class:"rebill-checkout-renewal"},i("div",{class:"left-section"},i("div",{class:"left-section-container"},i("organization-logo",{organization:h.data.organization}),i("div",{class:"checkout-form-section"},i("user-information-static",{userInfo:{customerName:h.data.subscription.customerName,customerEmail:h.data.subscription.customerEmail}}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"header"}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"details"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"32px"}},i("payment-method-selector",{enabledPaymentMethods:[...new Set(h.data.paymentMethods.map((e=>e.type)))],defaultSelected:this.currentPaymentMethod,errorComponent:{showErrorComponent:this.currentPaymentError,alertTitle:k.getErrorTitle(this.currentPaymentMethod,h.data.price.country,this.errorMessage?.alertTitle),message:k.getErrorMessage(this.errorMessage.message,this.currentPaymentMethod,h.data.price.country)},cardError:{showCardInvalid:this.errorCardInvalid,type:null},country:h.data.price.country,documentTypeError:o?.documentType,documentNumberError:o?.documentNumber,showDocument:this.cardMode==="input"&&(x("documentType",this.currentRequiredFields)||x("documentNumber",this.currentRequiredFields))}),this.currentPaymentMethod!==c.CARD&&i("rebill-alert",{type:"info",message:d.translate("renewal.paymentMethodAlert",{cardLastFour:h.data.subscription.cardLastFour||"****"}),icon:"calendar-edit",variant:"outlined",colorIcon:y.PRIMARY}),this.cardMode==="input"&&x("bankId",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod]?.original)||[],defaultSelectedBankId:r.bankId||"",error:o?.bankId}))),this.cardMode==="input"&&(x("billing-country",this.currentRequiredFields)||x("billing-state",this.currentRequiredFields)||x("billing-address",this.currentRequiredFields)||x("billing-city",this.currentRequiredFields)||x("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{countryOptions:this.countries.map((e=>({label:e.country,value:e.isoCountryCode}))),billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),this.cardMode==="input"&&x("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{error:o?.phoneNumber})),this.checkoutResponse?.result&&(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER)&&i("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===c.CASH?this.checkoutResponse.result.data.referenceId:undefined,qrCodeData:this.currentPaymentMethod===c.BANK_TRANSFER?this.checkoutResponse.result.data.qrCode:undefined,providerName:h.data.organization?.name||"",expirationDate:(()=>{const e=new Date;e.setDate(e.getDate()+30);return e.toISOString()})(),country:h.data.price.country,redirectUrl:this.checkoutResponse.result.data.url}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"summary"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,isRenewal:true,trialPeriodDays:h.data.subscription.trialPeriodDays,redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:5e3,country:h.data.price.country,isDisabled:h.fetchingInstallments,onSubmit:()=>t()}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),i("rebill-footer",null))),!b(this.breakpoint,p.DESKTOP)&&i("div",{class:"right-section"},i("div",{class:"checkout-summary-section"},e({displayedComponents:["header","details","summary"]}))))}))}};N.style=D;export{N as rebill_renewal};
2
- //# sourceMappingURL=p-d51a9b31.entry.js.map
1
+ import{r as e,c as t,h as i}from"./p-DyaDabZ4.js";import{c as r}from"./p-BFhvUZPU.js";import{a as o,C as n}from"./p-C6wUNEUc.js";import{P as a,G as s,a as l}from"./p-DDeOZpZn.js";import{P as c,I as d}from"./p-B2B19LUC.js";import{r as h,R as m,o as u}from"./p-Dcf7Or4N.js";import{B as p,g as f,i as b}from"./p-Do_vNuMa.js";import{C as y}from"./p-DA598vBj.js";import{m as g,i as x,g as w,P as k,a as v}from"./p-CAKTSGNY.js";import"./p-BFTU3MAI.js";import"./p-B2LDUv1-.js";import"./p-uZj1dMLQ.js";import"./p-UlyTyHvM.js";import"./p-BYrqevT1.js";import"./p-Bf6g23G6.js";import"./p-lWh04UqG.js";const j=async(e,t,i)=>{const r=await o.checkout.getRequiredFields({currency:e,method:t},i);return{fields:g(r.data),original:r.data}};const q=async()=>{const e=[...new Set(h.data.paymentMethods.map((e=>e.type)))];const t=e.map((async e=>{try{const t=a.mapToAPMPaymentMethod(e,h.data.price.country);const i=await j(h.data.price.currency,t,h.data.organization.id);return{paymentMethod:e,...i}}catch(t){console.error(`Error getting required fields for ${e}:`,t);return{paymentMethod:e,fields:[],original:[]}}}));const i=await Promise.all(t);const r={};i.forEach((e=>{r[e.paymentMethod]={fields:e.fields,original:e.original}}));return r};const C=(e,t)=>{const i=t[e];if(i){return i}else{return{fields:[],original:[]}}};const D=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}@media (max-width: 1024px){.rebill-checkout-renewal{flex-direction:column;gap:0;justify-content:flex-start;background:var(--rebill-color-background);padding:20px}.right-section .left-section{width:100%;height:100%;background:var(--rebill-color-background)}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;gap:24px;height:100%;margin-top:24px}.otp-container{display:flex;flex-direction:column;justify-content:flex-start;gap:24px}}@media (min-width: 1025px){.rebill-checkout-renewal{width:100vw;min-height:100vh;display:flex;flex-direction:row;justify-content:center;overflow-y:auto}.left-section{display:flex;width:60%;background:var(--rebill-color-background-left);justify-content:space-around}.right-section{display:flex;padding-top:72px;width:40%;background:var(--rebill-color-background-right);position:sticky;top:0;justify-content:center}.checkout-form-section{display:flex;flex-direction:column;justify-content:flex-start;margin-bottom:36px;margin-top:24px;gap:32px}.left-section-container{max-width:450px;min-width:450px;margin:2.5rem 2rem 1.5rem 2rem;display:flex;flex-direction:column}.checkout-summary-section{max-width:450px;min-width:350px;margin:0rem 2rem;background:var(--rebill-color-background-right);display:flex;flex-direction:column;justify-content:flex-start;width:100%}.checkout-form-section user-information,.checkout-form-section payment-method-selector,.checkout-form-section rebill-address,.checkout-summary-section rebill-summary{width:100%}.pac-container{border-radius:4px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border:1px solid #e0e0e0;margin-top:4px;font-family:inherit}.pac-item{padding:10px 12px;cursor:pointer;border-top:none}.pac-item:first-child{border-top:none}.pac-item:hover{background-color:#f5f5f5}.pac-item-query{font-weight:500}.pac-icon{display:none}}.payment-button-container{display:flex;flex-direction:column;gap:16px;margin-bottom:16px}.animated-component{transition:all 0.3s ease-in-out;overflow:visible}.fade-in{animation:fadeIn 0.4s ease-in-out}.slide-in{animation:slideIn 0.5s ease-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{from{opacity:0;transform:translateX(-20px);max-height:0}to{opacity:1;transform:translateX(0);max-height:450px}}.animated-component.hide{animation:fadeOut 0.3s ease-in-out forwards}@keyframes fadeOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}rebill-mode-sandbox{position:fixed;bottom:50px;left:50%;transform:translateX(-50%);z-index:1000}@media (max-width: 1024px){rebill-test-mode-chip{bottom:46px}}@media (min-width: 1025px){rebill-test-mode-chip{bottom:46px}}.mode-sandbox-mobile-container{display:flex;align-items:center;width:100%;padding:0;margin:0;box-sizing:border-box}@media (min-width: 1451px){.left-section-container{min-width:450px;margin:2.5rem 5rem 1.5rem 5rem}.checkout-summary-section{min-width:450px;margin:0rem 5rem}}";const N=class{constructor(i){e(this,i);this.success=t(this,"success");this.paymentError=t(this,"paymentError");this.paymentMethodSelected=t(this,"paymentMethodSelected")}renewalData;renewalToken;currentPaymentMethod=c.CARD;isSubmitting=false;isCardSubmitting=false;isCardSuccess=false;errorMessage=null;breakpoint=p.DESKTOP;errorPaymentCard=false;errorPaymentAPM=false;initialData={};checkoutResponse=null;currentApmPaymentMethod=null;countries=[];allRequiredFields={};currentRequiredFields=[];errorCardInvalid=false;cardMode="select";success;paymentError;paymentMethodSelected;validationSchema={phoneNumber:r().when([],{is:()=>x("phoneNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.phoneRequired"),otherwise:e=>e.notRequired()}),"billing-country":r().when([],{is:()=>x("billing-country",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.countryRequired"),otherwise:e=>e.notRequired()}),"billing-state":r().when([],{is:()=>x("billing-state",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.stateRequired"),otherwise:e=>e.notRequired()}),"billing-address":r().when([],{is:()=>x("billing-address",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.addressRequired"),otherwise:e=>e.notRequired()}),"billing-city":r().when([],{is:()=>x("billing-city",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.cityRequired"),otherwise:e=>e.notRequired()}),"billing-zip":r().when([],{is:()=>x("billing-zip",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.zipRequired"),otherwise:e=>e.notRequired()}),bankId:r().when([],{is:()=>x("bankId",this.currentRequiredFields),then:e=>e.required("validation.bankRequired"),otherwise:e=>e.notRequired()}),documentType:r().when([],{is:()=>x("documentType",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentTypeRequired"),otherwise:e=>e.notRequired()}),documentNumber:r().when([],{is:()=>x("documentNumber",this.currentRequiredFields)&&this.cardMode==="input",then:e=>e.required("validation.documentNumberRequired").min(7,"validation.documentInvalid"),otherwise:e=>e.notRequired()})};resizeHandler=()=>{this.breakpoint=f(window.innerWidth)};async componentWillLoad(){this.resizeHandler();window.addEventListener("resize",this.resizeHandler);const e=typeof this.renewalData==="string"?JSON.parse(this.renewalData):this.renewalData;m.initializeRenewal({...e,token:this.renewalToken});s.loadGoogleMapsScript();try{const e=await o.data.getCountries();this.countries=e.data}catch(e){console.error("Error loading countries:",e)}try{this.allRequiredFields=await q()}catch(e){console.error("Error loading required fields:",e)}if(h.data.paymentMethods.length>0){const e=h.data.paymentMethods[0].type;this.currentPaymentMethod=e;m.setSelectedPaymentMethod(e);try{this.currentRequiredFields=C(e,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(e)}this.initialData=this.getInitialData();this.cardMode=h.cardMode;u("cardMode",(()=>{this.cardMode=h.cardMode}))}disconnectedCallback(){window.removeEventListener("resize",this.resizeHandler)}async handlePaymentMethodSelected(e){e.stopPropagation();if(this.currentPaymentMethod===e.detail){return}this.currentPaymentMethod=e.detail;m.setSelectedPaymentMethod(this.currentPaymentMethod);if(this.currentPaymentMethod!==c.CARD){this.cardMode="input";m.setCardMode("input")}try{this.currentRequiredFields=C(this.currentPaymentMethod,this.allRequiredFields).fields}catch(e){console.error("Error getting required fields for method:",e)}await this.initializeFingerprint(this.currentPaymentMethod);this.paymentMethodSelected.emit(e.detail)}async initializeFingerprint(e){if(e===c.CARD&&!h.deviceId){try{const e=crypto.randomUUID();const t=await o.fingerPrint.getFingerPrint(e);m.setDeviceId(e);const i=t.result.script;const r=document.createElement("script");r.innerHTML=i;document.body.appendChild(r)}catch(e){console.error("Failed to initialize fingerprint:",e)}}}handleBankSelected(e){e.stopPropagation();m.setSelectedBankId(e.detail)}handleCardSelected(e){const{card:t,cvv:i}=e.detail;m.setSelectedCard(t);m.setCvv(i||"")}get currentPaymentError(){if(this.currentPaymentMethod===c.CARD){return this.errorPaymentCard}else if(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER){return this.errorPaymentAPM}return false}async handleSubmit(e){if(this.isSubmitting){return}if(this.currentPaymentMethod===c.CARD){await this.handleCardRenewal(e)}else{await this.handleAPMRenewal(e)}}async handleCardRenewal(e){const t=e?.detail||this.getInitialData();if(!h.data.cardId&&!h.data.cardTokenId){this.errorCardInvalid=true;return}if(!h.data.cardInformation&&!h.data.cardId){this.errorCardInvalid=true;return}this.errorCardInvalid=false;this.isSubmitting=true;this.isCardSubmitting=true;m.setLoading(true);try{const e={transaction:{quantity:1},...h.data.cardId&&{cardId:h.data.cardId},...h.data.cardTokenId&&{cardTokenId:h.data.cardTokenId},customAttributes:{...h.deviceId&&{deviceId:h.deviceId}},...this.cardMode==="input"&&{customer:{firstName:t.fullName?.split(" ")[0]||h.data.subscription.customerName?.split(" ")[0],lastName:t.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName?.split(" ").slice(1).join(" "),email:t.email||h.data.subscription.customerEmail,phone:{countryCode:t.countryCodePhoneNumber||"",number:t.phoneNumber||""}},billingDetails:{address:{lineOne:t["billing-address"]||"",city:t["billing-city"]||"",state:t["billing-state"]||"",country:t["billing-country"]||"",zipCode:t["billing-zip"]||""},identification:{type:t.documentType||"",value:t.documentNumber||""}}}};const i=w();const r=await o.checkout.createCardCheckoutRequest(h.data.id,i,e,h.token);this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);m.setCheckoutResponse(r.data);if(r.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.isCardSuccess=false;this.errorPaymentCard=true;this.errorMessage={message:r.data.error?.error?.message}}}catch(e){this.isSubmitting=false;this.isCardSubmitting=false;m.setLoading(false);this.errorPaymentCard=true;this.errorMessage={message:e.data?.error?.message}}}async handleAPMRenewal(e){this.isSubmitting=true;m.setLoading(true);try{const t=a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data.price.country);const i=e?.detail||this.getFormData();const r={address:{country:i["billing-country"],state:i["billing-state"]||"",city:i["billing-city"]||"",zipCode:i["billing-zip"]||"",lineOne:i["billing-address"]||""},identification:{type:i.documentType||"dni",value:i.documentNumber||""}};const s={transaction:{quantity:1},method:t,billingDetails:r,redirect:{approved:window.location.origin+"/renewal/success",rejected:window.location.origin+"/renewal/failure"},paymentMetadata:{orderId:h.data.id,source:"renewal-web"},customAttributes:{bank:i.bankId||""},...t!==l.CO_TRANSFERENCE_PSE&&{targetCurrency:h.data.price.currency}};s.customer={firstName:i.fullName?.split(" ")[0]||h.data.subscription.customerName.split(" ")[0]||"",lastName:i.fullName?.split(" ").slice(1).join(" ")||h.data.subscription.customerName.split(" ").slice(1).join(" ")||"",email:i.email||h.data.subscription.customerEmail,phone:{countryCode:i.countryCodePhoneNumber||"",number:i.phoneNumber||""}};const c=w();const d=await o.checkout.createAPMCheckoutRequest(h.data.id,c,s);this.isSubmitting=false;m.setLoading(false);m.setCheckoutResponse(d.data);this.checkoutResponse=d.data;if(d.data.result?.status.toUpperCase()===n.APPROVED){this.isCardSuccess=true}else{this.paymentError.emit(d.data);m.setCheckoutResponse(d.data);this.errorPaymentAPM=true;this.errorMessage={alertTitle:d.data?.error?.message,message:d.data.error?.message}}}catch(e){this.isSubmitting=false;m.setLoading(false);this.paymentError.emit(e);this.errorPaymentAPM=true;this.errorMessage={alertTitle:e.data?.error?.message,message:e.data?.error?.message}}}getFormData=()=>this.initialData;getInitialData=()=>({email:h.data.subscription.customerEmail,fullName:h.data.subscription.customerName,card:"","billing-country":"","billing-state":"","billing-address":"","billing-city":"","billing-zip":"",bankId:"",phoneNumber:"",countryCodePhoneNumber:"",documentType:"",documentNumber:""});hasPrefilledAddress=()=>{const e=["billing-country","billing-state","billing-address","billing-city","billing-zip"];return e.some((e=>{const t=this.initialData[e];return t&&t.trim()!==""}))};getPaymentDate=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};getReferenceNumber=()=>{const e=h.form.checkoutResponse;if(!e)return"";if("traceId"in e){return e.traceId}return""};render(){if(!h.isInitialized){return i("div",{class:"loading"},d.translate("renewal.loading"))}const e=e=>i("renewal-summary",{totalAmount:h.data.price.amount,currency:h.data.price.currency,subscriptionTitle:h.data.subscription.name[0]?.text||"Subscription",subscriptionAmount:h.data.subscription.amount,nextChargeDate:h.data.subscription.nextChargeDate,frequency:h.data.subscription.frequency,...e});return i(i.Fragment,null,i("rebill-processing-payment",{style:{display:this.isCardSubmitting?"block":"none"}}),this.isCardSuccess?i("renewal-success-page",{typePaymentMethod:this.currentPaymentMethod,paymentDate:this.getPaymentDate(),referenceNumber:this.getReferenceNumber(),cardLastFour:h.data.subscription.cardLastFour,country:h.data.price.country,paymentMethodName:a.mapToAPMPaymentMethod(this.currentPaymentMethod,h.data?.price?.country),bank:h.form?.selectedBankId||""}):i("rebill-checkout-form",{style:{display:this.isCardSubmitting||this.isCardSuccess?"none":"block"},validationSchema:this.validationSchema,initialData:this.initialData,onSubmit:e=>this.handleSubmit(e),renderForm:({submit:t,formData:r,errors:o})=>i("div",{class:"rebill-checkout-renewal"},i("div",{class:"left-section"},i("div",{class:"left-section-container"},i("organization-logo",{organization:h.data.organization}),i("div",{class:"checkout-form-section"},i("user-information-static",{userInfo:{customerName:h.data.subscription.customerName,customerEmail:h.data.subscription.customerEmail}}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"header"}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"details"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"32px"}},i("payment-method-selector",{enabledPaymentMethods:[...new Set(h.data.paymentMethods.map((e=>e.type)))],defaultSelected:this.currentPaymentMethod,errorComponent:{showErrorComponent:this.currentPaymentError,alertTitle:k.getErrorTitle(this.currentPaymentMethod,h.data.price.country,this.errorMessage?.alertTitle),message:k.getErrorMessage(this.errorMessage?.message,this.currentPaymentMethod,h.data.price.country)},cardError:{showCardInvalid:this.errorCardInvalid,type:null},country:h.data.price.country,documentTypeError:o?.documentType,documentNumberError:o?.documentNumber,showDocument:this.cardMode==="input"&&(x("documentType",this.currentRequiredFields)||x("documentNumber",this.currentRequiredFields))}),this.currentPaymentMethod!==c.CARD&&i("rebill-alert",{type:"info",message:d.translate("renewal.paymentMethodAlert",{cardLastFour:h.data.subscription.cardLastFour||"****"}),icon:"calendar-edit",variant:"outlined",colorIcon:y.PRIMARY}),this.cardMode==="input"&&x("bankId",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("rebill-bank-selector",{banks:v("bank",this.allRequiredFields[this.currentPaymentMethod]?.original)||[],defaultSelectedBankId:r.bankId||"",error:o?.bankId}))),this.cardMode==="input"&&(x("billing-country",this.currentRequiredFields)||x("billing-state",this.currentRequiredFields)||x("billing-address",this.currentRequiredFields)||x("billing-city",this.currentRequiredFields)||x("billing-zip",this.currentRequiredFields))&&i("div",{class:"animated-component slide-in"},i("rebill-address",{countryOptions:this.countries.map((e=>({label:e.country,value:e.isoCountryCode}))),billingView:this.hasPrefilledAddress()?"form":"search",errors:{"billing-country":o["billing-country"],"billing-state":o["billing-state"],"billing-address":o["billing-address"],"billing-city":o["billing-city"],"billing-zip":o["billing-zip"]}})),this.cardMode==="input"&&x("phoneNumber",this.currentRequiredFields)&&i("div",{class:"animated-component fade-in"},i("user-information-phone",{error:o?.phoneNumber})),this.checkoutResponse?.result&&(this.currentPaymentMethod===c.CASH||this.currentPaymentMethod===c.BANK_TRANSFER)&&i("apm-checkout",{paymentMethod:this.currentPaymentMethod,referenceId:this.currentPaymentMethod===c.CASH?this.checkoutResponse.result.data.referenceId:undefined,qrCodeData:this.currentPaymentMethod===c.BANK_TRANSFER?this.checkoutResponse.result.data.qrCode:undefined,providerName:h.data.organization?.name||"",expirationDate:(()=>{const e=new Date;e.setDate(e.getDate()+30);return e.toISOString()})(),country:h.data.price.country,redirectUrl:this.checkoutResponse.result.data.url}),b(this.breakpoint,p.DESKTOP)&&e({displayedComponents:"summary"}),i("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},i("payment-button",{paymentMethod:this.currentPaymentMethod,isLoading:this.isSubmitting,isRenewal:true,trialPeriodDays:h.data.subscription.trialPeriodDays,redirectUrl:!!this.checkoutResponse?.result?.data?.url,timeToRedirect:5e3,country:h.data.price.country,isDisabled:h.fetchingInstallments,onSubmit:()=>t()}),i("rebill-alert",{type:"secure",variant:"variant-secure",icon:"lock-outline",message:d.translate("otp.secureMessage")}))),i("rebill-footer",null))),!b(this.breakpoint,p.DESKTOP)&&i("div",{class:"right-section"},i("div",{class:"checkout-summary-section"},e({displayedComponents:["header","details","summary"]}))))}))}};N.style=D;export{N as rebill_renewal};
2
+ //# sourceMappingURL=p-02c8d5ca.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getRequiredFields","async","currency","method","organizationId","requiredFieldsResponse","api","checkout","fields","mapRequiredFields","data","original","getAllRequiredFieldsRenewal","paymentMethods","Set","renewalState","map","pm","type","promises","paymentMethod","apiPaymentMethod","PaymentMethodMapper","mapToAPMPaymentMethod","price","country","result","organization","id","error","console","results","Promise","all","fieldsMap","forEach","getRequiredFieldsForMethod","allRequiredFields","storedFields","rebillRenewalCss","RebillRenewal","renewalData","renewalToken","currentPaymentMethod","PAYMENT_METHOD_ENUM","CARD","isSubmitting","isCardSubmitting","isCardSuccess","errorMessage","breakpoint","BREAKPOINT_ENUM","DESKTOP","errorPaymentCard","errorPaymentAPM","initialData","checkoutResponse","currentApmPaymentMethod","countries","currentRequiredFields","errorCardInvalid","cardMode","success","paymentError","paymentMethodSelected","validationSchema","phoneNumber","yup.string","when","is","isFieldRequired","this","then","schema","required","otherwise","notRequired","bankId","documentType","documentNumber","min","resizeHandler","getBreakpoint","window","innerWidth","componentWillLoad","addEventListener","renewalProps","JSON","parse","RenewalStore","initializeRenewal","token","GoogleMapsService","loadGoogleMapsScript","response","getCountries","length","firstPaymentMethod","setSelectedPaymentMethod","initializeFingerprint","getInitialData","renewalOnChange","disconnectedCallback","removeEventListener","handlePaymentMethodSelected","event","stopPropagation","detail","setCardMode","emit","deviceId","uuid","crypto","randomUUID","fingerprintResponse","fingerPrint","getFingerPrint","setDeviceId","script","scriptElement","document","createElement","innerHTML","body","appendChild","handleBankSelected","setSelectedBankId","handleCardSelected","card","cvv","setSelectedCard","setCvv","currentPaymentError","CASH","BANK_TRANSFER","handleSubmit","handleCardRenewal","handleAPMRenewal","formData","cardId","cardTokenId","cardInformation","setLoading","renewalRequest","transaction","quantity","customAttributes","customer","firstName","fullName","split","subscription","customerName","lastName","slice","join","email","customerEmail","phone","countryCode","countryCodePhoneNumber","number","billingDetails","address","lineOne","city","state","zipCode","identification","value","idempotencyKey","generateIdempotencyKey","createCardCheckoutRequest","setCheckoutResponse","status","toUpperCase","CheckoutStatusE","APPROVED","message","apmPaymentMethod","getFormData","redirect","approved","location","origin","rejected","paymentMetadata","orderId","source","bank","PaymentMethodNameE","CO_TRANSFERENCE_PSE","targetCurrency","createAPMCheckoutRequest","alertTitle","hasPrefilledAddress","billingFields","some","key","trim","getPaymentDate","payment","form","date","getReferenceNumber","traceId","render","isInitialized","h","class","I18nService","translate","renderRenewalSummary","props","totalAmount","amount","subscriptionTitle","name","text","subscriptionAmount","nextChargeDate","frequency","Fragment","style","display","typePaymentMethod","paymentDate","referenceNumber","cardLastFour","paymentMethodName","selectedBankId","onSubmit","args","renderForm","submit","errors","userInfo","isBreakpointBelow","displayedComponents","flexDirection","gap","enabledPaymentMethods","defaultSelected","errorComponent","showErrorComponent","PaymentErrorMapper","getErrorTitle","getErrorMessage","cardError","showCardInvalid","documentTypeError","documentNumberError","showDocument","icon","variant","colorIcon","COLORS_ENUM","PRIMARY","banks","getFieldValues","defaultSelectedBankId","countryOptions","label","isoCountryCode","billingView","referenceId","undefined","qrCodeData","qrCode","providerName","expirationDate","Date","setDate","getDate","toISOString","redirectUrl","url","isLoading","isRenewal","trialPeriodDays","timeToRedirect","isDisabled","fetchingInstallments"],"sources":["src/components/renewal/utils/getRequiredFieldsRenewal.ts","src/components/renewal/rebill-renewal.css?tag=rebill-renewal","src/components/renewal/rebill-renewal.tsx"],"sourcesContent":["import { api } from '../../../api';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { renewalState } from '../../../store/renewal.store';\nimport { PaymentMethodMapper } from '../../../utils/payment-method-mapper';\nimport { mapRequiredFields, RequiredField } from '../../../utils/required-fields-mappers';\n\nexport interface RequiredFieldsResult {\n fields: string[];\n original: RequiredField[];\n}\n\nexport interface AllRequiredFieldsMap {\n [key: string]: RequiredFieldsResult;\n}\n\nconst getRequiredFields = async (\n currency: string,\n method: string,\n organizationId: string,\n): Promise<RequiredFieldsResult> => {\n const requiredFieldsResponse = await api.checkout.getRequiredFields(\n {\n currency,\n method,\n },\n organizationId,\n );\n\n return {\n fields: mapRequiredFields(requiredFieldsResponse.data),\n original: requiredFieldsResponse.data,\n };\n};\n\nexport const getAllRequiredFieldsRenewal = async (): Promise<AllRequiredFieldsMap> => {\n const paymentMethods = [\n ...new Set(renewalState.data.paymentMethods.map(pm => pm.type as PAYMENT_METHOD_ENUM)),\n ];\n const promises = paymentMethods.map(async paymentMethod => {\n try {\n const apiPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n paymentMethod,\n renewalState.data.price.country,\n );\n\n const result = await getRequiredFields(\n renewalState.data.price.currency,\n apiPaymentMethod,\n renewalState.data.organization.id,\n );\n\n return {\n paymentMethod,\n ...result,\n };\n } catch (error) {\n console.error(`Error getting required fields for ${paymentMethod}:`, error);\n return {\n paymentMethod,\n fields: [],\n original: [],\n };\n }\n });\n\n const results = await Promise.all(promises);\n const fieldsMap: AllRequiredFieldsMap = {};\n\n results.forEach(result => {\n fieldsMap[result.paymentMethod] = {\n fields: result.fields,\n original: result.original,\n };\n });\n return fieldsMap;\n};\n\nexport const getRequiredFieldsForMethod = (\n paymentMethod: PAYMENT_METHOD_ENUM,\n allRequiredFields: AllRequiredFieldsMap,\n): RequiredFieldsResult => {\n const storedFields = allRequiredFields[paymentMethod];\n if (storedFields) {\n return storedFields;\n } else {\n return {\n fields: [],\n original: [],\n };\n }\n};\n","@import '../../styles/variables.css';\n\n@media (max-width: 1024px) {\n .rebill-checkout-renewal {\n flex-direction: column;\n gap: 0;\n justify-content: flex-start;\n background: var(--rebill-color-background);\n padding: 20px;\n }\n .right-section .left-section {\n width: 100%;\n height: 100%;\n background: var(--rebill-color-background);\n }\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n height: 100%;\n margin-top: 24px;\n }\n .otp-container {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n\n@media (min-width: 1025px) {\n .rebill-checkout-renewal {\n width: 100vw;\n min-height: 100vh;\n display: flex;\n flex-direction: row;\n justify-content: center;\n overflow-y: auto;\n }\n\n .left-section {\n display: flex;\n width: 60%;\n background: var(--rebill-color-background-left);\n justify-content: space-around;\n }\n\n .right-section {\n display: flex;\n padding-top: 72px;\n width: 40%;\n background: var(--rebill-color-background-right);\n position: sticky;\n top: 0;\n\n justify-content: center;\n }\n\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n margin-bottom: 36px;\n margin-top: 24px;\n gap: 32px;\n }\n .left-section-container {\n max-width: 450px;\n min-width: 450px;\n margin: 2.5rem 2rem 1.5rem 2rem;\n display: flex;\n flex-direction: column;\n }\n\n .checkout-summary-section {\n max-width: 450px;\n min-width: 350px;\n margin: 0rem 2rem;\n background: var(--rebill-color-background-right);\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n width: 100%;\n }\n\n .checkout-form-section user-information,\n .checkout-form-section payment-method-selector,\n .checkout-form-section rebill-address,\n .checkout-summary-section rebill-summary {\n width: 100%;\n }\n\n /* Google Maps Autocomplete Styles */\n .pac-container {\n border-radius: 4px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n border: 1px solid #e0e0e0;\n margin-top: 4px;\n font-family: inherit;\n }\n\n .pac-item {\n padding: 10px 12px;\n cursor: pointer;\n border-top: none;\n }\n\n .pac-item:first-child {\n border-top: none;\n }\n\n .pac-item:hover {\n background-color: #f5f5f5;\n }\n\n .pac-item-query {\n font-weight: 500;\n }\n\n .pac-icon {\n display: none;\n }\n}\n\n.payment-button-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin-bottom: 16px;\n}\n/* Animaciones para componentes condicionales */\n.animated-component {\n transition: all 0.3s ease-in-out;\n overflow: visible;\n}\n\n/* Keep overflow hidden only for sliding height animations */\n/* .animated-component.slide-in {\n overflow: hidden;\n} */\n\n.fade-in {\n animation: fadeIn 0.4s ease-in-out;\n}\n\n.slide-in {\n animation: slideIn 0.5s ease-out;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes slideIn {\n from {\n opacity: 0;\n transform: translateX(-20px);\n max-height: 0;\n }\n to {\n opacity: 1;\n transform: translateX(0);\n max-height: 450px;\n }\n}\n\n/* Animación para cuando se ocultan los componentes */\n.animated-component.hide {\n animation: fadeOut 0.3s ease-in-out forwards;\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(20px);\n }\n}\n\n/* Test Mode Chip Positioning */\nrebill-mode-sandbox {\n position: fixed;\n bottom: 50px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1000;\n}\n\n/* Ensure the chip is visible on all screen sizes */\n@media (max-width: 1024px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n\n@media (min-width: 1025px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n.mode-sandbox-mobile-container {\n display: flex;\n align-items: center;\n width: 100%;\n\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* Desktop grande - mantener tamaños originales */\n@media (min-width: 1451px) {\n .left-section-container {\n min-width: 450px;\n margin: 2.5rem 5rem 1.5rem 5rem;\n }\n\n .checkout-summary-section {\n min-width: 450px;\n margin: 0rem 5rem;\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport * as yup from 'yup';\nimport { api, Country } from '../../api';\nimport { SavedCard } from '../../api/entities/cards/types';\nimport {\n CheckoutStatusE,\n CreateAPMCheckoutRequest,\n CreateAPMCheckoutResponse,\n CreateCardCheckoutRequest,\n} from '../../api/entities/checkout/types';\nimport '../../components/checkout/apm/apm-checkout/apm-checkout';\nimport '../../components/checkout/processing-payment/processing-payment';\nimport { I18nService } from '../../i18n/i18n.service';\n\nimport { PaymentMethodNameE } from '../../models/enums/payment-method-name.enum';\nimport { PAYMENT_METHOD_ENUM } from '../../models/enums/payment-methods.enum';\nimport { PaymentMessageE } from '../../models/enums/payment-status.enum';\nimport { onChange as renewalOnChange, renewalState, RenewalStore } from '../../store/renewal.store';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../utils/color-class-mapper';\nimport { generateIdempotencyKey } from '../../utils/generate-idempotency-key';\nimport { GoogleMapsService } from '../../utils/google-maps.service';\nimport { AlertErrorKeys, PaymentErrorMapper } from '../../utils/payment-error-mapper';\nimport { PaymentMethodMapper } from '../../utils/payment-method-mapper';\nimport { getFieldValues, isFieldRequired } from '../../utils/required-fields-mappers';\nimport {\n AllRequiredFieldsMap,\n getAllRequiredFieldsRenewal,\n getRequiredFieldsForMethod,\n} from './utils/getRequiredFieldsRenewal';\n\n@Component({\n tag: 'rebill-renewal',\n styleUrl: 'rebill-renewal.css',\n shadow: false,\n})\nexport class RebillRenewal {\n @Prop() renewalData!: string;\n @Prop() renewalToken!: string;\n\n @State() currentPaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @State() isSubmitting: boolean = false;\n @State() isCardSubmitting: boolean = false;\n @State() isCardSuccess: boolean = false;\n @State() errorMessage: AlertErrorKeys | null = null;\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() errorPaymentCard: boolean = false;\n @State() errorPaymentAPM: boolean = false;\n @State() initialData: any = {};\n @State() checkoutResponse: CreateAPMCheckoutResponse | null = null;\n @State() currentApmPaymentMethod: PaymentMethodNameE | null = null;\n @State() countries: Country[] = [];\n @State() allRequiredFields: AllRequiredFieldsMap = {};\n @State() currentRequiredFields: string[] = [];\n @State() errorCardInvalid: boolean = false;\n @State() cardMode: 'input' | 'select' | null = 'select';\n\n @Event() success: EventEmitter<any>;\n @Event() paymentError: EventEmitter<any>;\n @Event() paymentMethodSelected: EventEmitter<PAYMENT_METHOD_ENUM>;\n\n private validationSchema = {\n 'phoneNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('phoneNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.phoneRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-country': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-country', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.countryRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-state': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-state', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.stateRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-address': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-address', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.addressRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-city': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-city', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.cityRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-zip': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-zip', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.zipRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'bankId': yup.string().when([], {\n is: () => isFieldRequired('bankId', this.currentRequiredFields),\n then: schema => schema.required('validation.bankRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentType': yup.string().when([], {\n is: () =>\n isFieldRequired('documentType', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.documentTypeRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('documentNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema =>\n schema.required('validation.documentNumberRequired').min(7, 'validation.documentInvalid'),\n otherwise: schema => schema.notRequired(),\n }),\n };\n\n private resizeHandler = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n\n async componentWillLoad() {\n this.resizeHandler();\n window.addEventListener('resize', this.resizeHandler);\n\n const renewalProps =\n typeof this.renewalData === 'string' ? JSON.parse(this.renewalData) : this.renewalData;\n\n RenewalStore.initializeRenewal({\n ...renewalProps,\n token: this.renewalToken,\n });\n\n // Load Google Maps script for address autocomplete\n GoogleMapsService.loadGoogleMapsScript();\n\n // Load countries data\n try {\n const response = await api.data.getCountries();\n this.countries = response.data;\n } catch (error) {\n console.error('Error loading countries:', error);\n }\n\n // Load required fields data\n try {\n this.allRequiredFields = await getAllRequiredFieldsRenewal();\n } catch (error) {\n console.error('Error loading required fields:', error);\n }\n\n if (renewalState.data.paymentMethods.length > 0) {\n const firstPaymentMethod = renewalState.data.paymentMethods[0].type as PAYMENT_METHOD_ENUM;\n this.currentPaymentMethod = firstPaymentMethod;\n RenewalStore.setSelectedPaymentMethod(firstPaymentMethod);\n\n // Set required fields for the initial payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n firstPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Initialize fingerprint for the first payment method\n await this.initializeFingerprint(firstPaymentMethod);\n }\n\n this.initialData = this.getInitialData();\n\n this.cardMode = renewalState.cardMode;\n renewalOnChange('cardMode', () => {\n this.cardMode = renewalState.cardMode;\n });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.resizeHandler);\n }\n\n @Listen('paymentMethodSelected')\n async handlePaymentMethodSelected(event: CustomEvent<PAYMENT_METHOD_ENUM>) {\n event.stopPropagation();\n\n if (this.currentPaymentMethod === event.detail) {\n return;\n }\n\n this.currentPaymentMethod = event.detail;\n RenewalStore.setSelectedPaymentMethod(this.currentPaymentMethod);\n\n // Change cardMode to 'input' if payment method is not CARD\n if (this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD) {\n this.cardMode = 'input';\n RenewalStore.setCardMode('input');\n }\n\n // Update required fields for the new payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n this.currentPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Note: Fingerprint is handled in componentWillLoad\n\n // Initialize fingerprint for the new payment method\n await this.initializeFingerprint(this.currentPaymentMethod);\n\n this.paymentMethodSelected.emit(event.detail);\n }\n\n private async initializeFingerprint(paymentMethod: PAYMENT_METHOD_ENUM) {\n // Only initialize fingerprint for card payments and if not already generated\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD && !renewalState.deviceId) {\n try {\n const uuid = crypto.randomUUID();\n const fingerprintResponse = await api.fingerPrint.getFingerPrint(uuid);\n RenewalStore.setDeviceId(uuid);\n const script = fingerprintResponse.result.script;\n const scriptElement = document.createElement('script');\n scriptElement.innerHTML = script;\n document.body.appendChild(scriptElement);\n } catch (error) {\n console.error('Failed to initialize fingerprint:', error);\n }\n }\n }\n\n @Listen('bankSelected')\n handleBankSelected(event: CustomEvent<string>) {\n event.stopPropagation();\n RenewalStore.setSelectedBankId(event.detail);\n }\n\n @Listen('cardSelected')\n handleCardSelected(event: CustomEvent<{ card: SavedCard; cvv?: string }>) {\n const { card, cvv } = event.detail;\n RenewalStore.setSelectedCard(card);\n RenewalStore.setCvv(cvv || '');\n }\n\n private get currentPaymentError(): boolean {\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return this.errorPaymentCard;\n } else if (\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ) {\n return this.errorPaymentAPM;\n }\n return false;\n }\n\n private async handleSubmit(event?: CustomEvent) {\n if (this.isSubmitting) {\n return;\n }\n\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n await this.handleCardRenewal(event);\n } else {\n await this.handleAPMRenewal(event);\n }\n }\n\n private async handleCardRenewal(event?: CustomEvent) {\n const formData = event?.detail || this.getInitialData();\n\n if (!renewalState.data.cardId && !renewalState.data.cardTokenId) {\n this.errorCardInvalid = true;\n return;\n }\n if (!renewalState.data.cardInformation && !renewalState.data.cardId) {\n this.errorCardInvalid = true;\n return;\n }\n this.errorCardInvalid = false;\n this.isSubmitting = true;\n this.isCardSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const renewalRequest: CreateCardCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n ...(renewalState.data.cardId && { cardId: renewalState.data.cardId }),\n ...(renewalState.data.cardTokenId && { cardTokenId: renewalState.data.cardTokenId }),\n customAttributes: {\n ...(renewalState.deviceId && { deviceId: renewalState.deviceId }),\n },\n ...(this.cardMode === 'input' && {\n customer: {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName?.split(' ')[0],\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName?.split(' ').slice(1).join(' '),\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n },\n billingDetails: {\n address: {\n lineOne: formData['billing-address'] || '',\n city: formData['billing-city'] || '',\n state: formData['billing-state'] || '',\n country: formData['billing-country'] || '',\n zipCode: formData['billing-zip'] || '',\n },\n identification: {\n type: formData.documentType || '',\n value: formData.documentNumber || '',\n },\n },\n }),\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createCardCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n renewalState.token,\n );\n\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.isCardSuccess = false;\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: response.data.error?.error?.message as PaymentMessageE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: error.data?.error?.message as PaymentMessageE,\n };\n }\n }\n\n private async handleAPMRenewal(event?: CustomEvent) {\n this.isSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const apmPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n );\n\n // Get form data for billing details and customer info\n const formData = event?.detail || this.getFormData();\n\n // Transform form data to match CreateAPMCheckoutRequest structure\n const billingDetails = {\n address: {\n country: formData['billing-country'],\n state: formData['billing-state'] || '',\n city: formData['billing-city'] || '',\n zipCode: formData['billing-zip'] || '',\n lineOne: formData['billing-address'] || '',\n },\n identification: {\n type: formData.documentType || 'dni',\n value: formData.documentNumber || '',\n },\n };\n\n const renewalRequest: CreateAPMCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n method: apmPaymentMethod,\n billingDetails,\n redirect: {\n approved: window.location.origin + '/renewal/success',\n rejected: window.location.origin + '/renewal/failure',\n },\n paymentMetadata: {\n orderId: renewalState.data.id,\n source: 'renewal-web',\n },\n customAttributes: {\n bank: formData.bankId || '',\n },\n // Remove targetCurrency for PSE payments as it's not supported\n ...(apmPaymentMethod !== PaymentMethodNameE.CO_TRANSFERENCE_PSE && {\n targetCurrency: renewalState.data.price.currency,\n }),\n };\n\n // Add customer data for renewal\n renewalRequest.customer = {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName.split(' ')[0] ||\n '',\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName.split(' ').slice(1).join(' ') ||\n '',\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createAPMCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n );\n\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n this.checkoutResponse = response.data;\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.paymentError.emit(response.data);\n RenewalStore.setCheckoutResponse(response.data);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: response.data?.error?.message as PaymentMessageE,\n message: response.data.error?.message as PaymentMessageE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n this.paymentError.emit(error);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: error.data?.error?.message as PaymentMessageE,\n message: error.data?.error?.message,\n };\n }\n }\n\n private getFormData = () => {\n return this.initialData;\n };\n\n private getInitialData = () => {\n return {\n 'email': renewalState.data.subscription.customerEmail,\n 'fullName': renewalState.data.subscription.customerName,\n 'card': '',\n 'billing-country': '',\n 'billing-state': '',\n 'billing-address': '',\n 'billing-city': '',\n 'billing-zip': '',\n 'bankId': '',\n 'phoneNumber': '',\n 'countryCodePhoneNumber': '',\n 'documentType': '',\n 'documentNumber': '',\n };\n };\n\n private hasPrefilledAddress = () => {\n const billingFields = [\n 'billing-country',\n 'billing-state',\n 'billing-address',\n 'billing-city',\n 'billing-zip',\n ];\n return billingFields.some(key => {\n const value = this.initialData[key];\n return value && value.trim() !== '';\n });\n };\n\n private getPaymentDate = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n\n if ('date' in payment) {\n return payment.date as string;\n }\n\n return '';\n };\n\n private getReferenceNumber = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n if ('traceId' in payment) {\n return payment.traceId as string;\n }\n\n return '';\n };\n\n render() {\n if (!renewalState.isInitialized) {\n return <div class=\"loading\">{I18nService.translate('renewal.loading')}</div>;\n }\n\n const renderRenewalSummary = props => (\n <renewal-summary\n totalAmount={renewalState.data.price.amount}\n currency={renewalState.data.price.currency}\n subscriptionTitle={renewalState.data.subscription.name[0]?.text || 'Subscription'}\n subscriptionAmount={renewalState.data.subscription.amount}\n nextChargeDate={renewalState.data.subscription.nextChargeDate}\n frequency={renewalState.data.subscription.frequency}\n {...props}\n />\n );\n\n return (\n <>\n <rebill-processing-payment style={{ display: this.isCardSubmitting ? 'block' : 'none' }} />\n {this.isCardSuccess ? (\n <renewal-success-page\n typePaymentMethod={this.currentPaymentMethod}\n paymentDate={this.getPaymentDate()}\n referenceNumber={this.getReferenceNumber()}\n cardLastFour={renewalState.data.subscription.cardLastFour}\n country={renewalState.data.price.country}\n paymentMethodName={PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data?.price?.country,\n )}\n bank={renewalState.form?.selectedBankId || ''}\n />\n ) : (\n <rebill-checkout-form\n style={{ display: this.isCardSubmitting || this.isCardSuccess ? 'none' : 'block' }}\n validationSchema={this.validationSchema}\n initialData={this.initialData}\n onSubmit={(args: any) => this.handleSubmit(args)}\n renderForm={({ submit, formData, errors }) => (\n <div class=\"rebill-checkout-renewal\">\n <div class=\"left-section\">\n <div class=\"left-section-container\">\n <organization-logo organization={renewalState.data.organization} />\n\n <div class=\"checkout-form-section\">\n {/* Customer Information - Readonly */}\n <user-information-static\n userInfo={{\n customerName: renewalState.data.subscription.customerName,\n customerEmail: renewalState.data.subscription.customerEmail,\n }}\n />\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'header',\n })}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'details',\n })}\n\n {/* Payment Method Selection */}\n <div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>\n <payment-method-selector\n enabledPaymentMethods={[\n ...new Set(\n renewalState.data.paymentMethods.map(\n pm => pm.type as PAYMENT_METHOD_ENUM,\n ),\n ),\n ]}\n defaultSelected={this.currentPaymentMethod}\n errorComponent={{\n showErrorComponent: this.currentPaymentError,\n alertTitle: PaymentErrorMapper.getErrorTitle(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n this.errorMessage?.alertTitle,\n ),\n message: PaymentErrorMapper.getErrorMessage(\n this.errorMessage.message,\n this.currentPaymentMethod,\n renewalState.data.price.country,\n ),\n }}\n cardError={{\n showCardInvalid: this.errorCardInvalid,\n type: null,\n }}\n country={renewalState.data.price.country}\n documentTypeError={errors?.documentType}\n documentNumberError={errors?.documentNumber}\n showDocument={\n this.cardMode === 'input' &&\n (isFieldRequired('documentType', this.currentRequiredFields) ||\n isFieldRequired('documentNumber', this.currentRequiredFields))\n }\n />\n {/* Alert for non-card payment methods */}\n {this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD && (\n <rebill-alert\n type=\"info\"\n message={I18nService.translate('renewal.paymentMethodAlert', {\n cardLastFour: renewalState.data.subscription.cardLastFour || '****',\n })}\n icon=\"calendar-edit\"\n variant=\"outlined\"\n colorIcon={COLORS_ENUM.PRIMARY}\n />\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('bankId', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <rebill-bank-selector\n banks={\n getFieldValues(\n 'bank',\n this.allRequiredFields[this.currentPaymentMethod]?.original,\n ) || []\n }\n defaultSelectedBankId={formData.bankId || ''}\n error={errors?.bankId}\n />\n </div>\n )}\n </div>\n {this.cardMode === 'input' &&\n (isFieldRequired('billing-country', this.currentRequiredFields) ||\n isFieldRequired('billing-state', this.currentRequiredFields) ||\n isFieldRequired('billing-address', this.currentRequiredFields) ||\n isFieldRequired('billing-city', this.currentRequiredFields) ||\n isFieldRequired('billing-zip', this.currentRequiredFields)) && (\n <div class=\"animated-component slide-in\">\n <rebill-address\n countryOptions={this.countries.map(country => ({\n label: country.country,\n value: country.isoCountryCode,\n }))}\n billingView={this.hasPrefilledAddress() ? 'form' : 'search'}\n errors={{\n 'billing-country': errors['billing-country'],\n 'billing-state': errors['billing-state'],\n 'billing-address': errors['billing-address'],\n 'billing-city': errors['billing-city'],\n 'billing-zip': errors['billing-zip'],\n }}\n />\n </div>\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('phoneNumber', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <user-information-phone error={errors?.phoneNumber} />\n </div>\n )}\n\n {/* Show APM checkout response after successful payment submission */}\n {this.checkoutResponse?.result &&\n (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) && (\n <apm-checkout\n paymentMethod={this.currentPaymentMethod}\n referenceId={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH\n ? this.checkoutResponse.result.data.referenceId\n : undefined\n }\n qrCodeData={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ? this.checkoutResponse.result.data.qrCode\n : undefined\n }\n providerName={renewalState.data.organization?.name || ''}\n expirationDate={(() => {\n const expirationDate = new Date();\n expirationDate.setDate(expirationDate.getDate() + 30);\n return expirationDate.toISOString();\n })()}\n country={renewalState.data.price.country}\n redirectUrl={this.checkoutResponse.result.data.url}\n />\n )}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'summary',\n })}\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n {/* Payment Button */}\n <payment-button\n paymentMethod={this.currentPaymentMethod}\n isLoading={this.isSubmitting}\n isRenewal={true}\n trialPeriodDays={renewalState.data.subscription.trialPeriodDays}\n redirectUrl={!!this.checkoutResponse?.result?.data?.url}\n timeToRedirect={5000}\n country={renewalState.data.price.country}\n isDisabled={renewalState.fetchingInstallments}\n onSubmit={() => submit()}\n />\n\n {/* Disabled Button Below */}\n <rebill-alert\n type=\"secure\"\n variant=\"variant-secure\"\n icon=\"lock-outline\"\n message={I18nService.translate('otp.secureMessage')}\n />\n </div>\n </div>\n <rebill-footer />\n </div>\n </div>\n\n {/* Desktop Summary */}\n {!isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <div class=\"right-section\">\n <div class=\"checkout-summary-section\">\n {renderRenewalSummary({\n displayedComponents: ['header', 'details', 'summary'],\n })}\n </div>\n </div>\n )}\n </div>\n )}\n />\n )}\n </>\n );\n }\n}\n"],"mappings":"8kBAeA,MAAMA,EAAoBC,MACxBC,EACAC,EACAC,KAEA,MAAMC,QAA+BC,EAAIC,SAASP,kBAChD,CACEE,WACAC,UAEFC,GAGF,MAAO,CACLI,OAAQC,EAAkBJ,EAAuBK,MACjDC,SAAUN,EAAuBK,KAClC,EAGI,MAAME,EAA8BX,UACzC,MAAMY,EAAiB,IAClB,IAAIC,IAAIC,EAAaL,KAAKG,eAAeG,KAAIC,GAAMA,EAAGC,SAE3D,MAAMC,EAAWN,EAAeG,KAAIf,MAAMmB,IACxC,IACE,MAAMC,EAAmBC,EAAoBC,sBAC3CH,EACAL,EAAaL,KAAKc,MAAMC,SAG1B,MAAMC,QAAe1B,EACnBe,EAAaL,KAAKc,MAAMtB,SACxBmB,EACAN,EAAaL,KAAKiB,aAAaC,IAGjC,MAAO,CACLR,mBACGM,E,CAEL,MAAOG,GACPC,QAAQD,MAAM,qCAAqCT,KAAkBS,GACrE,MAAO,CACLT,gBACAZ,OAAQ,GACRG,SAAU,G,KAKhB,MAAMoB,QAAgBC,QAAQC,IAAId,GAClC,MAAMe,EAAkC,GAExCH,EAAQI,SAAQT,IACdQ,EAAUR,EAAON,eAAiB,CAChCZ,OAAQkB,EAAOlB,OACfG,SAAUe,EAAOf,SAClB,IAEH,OAAOuB,CAAS,EAGX,MAAME,EAA6B,CACxChB,EACAiB,KAEA,MAAMC,EAAeD,EAAkBjB,GACvC,GAAIkB,EAAc,CAChB,OAAOA,C,KACF,CACL,MAAO,CACL9B,OAAQ,GACRG,SAAU,G,GCvFhB,MAAM4B,EAAmB,8sJ,MCoCZC,EAAa,M,4JAChBC,YACAC,aAECC,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OAClCF,UAENG,aAAc/P,EAAaL,KAAKiB,cAAc+L,MAAQ,GACtDqD,eAAgB,MACd,MAAMA,EAAiB,IAAIC,KAC3BD,EAAeE,QAAQF,EAAeG,UAAY,IAClD,OAAOH,EAAeI,aACvB,EAJe,GAKhB1P,QAASV,EAAaL,KAAKc,MAAMC,QACjC2P,YAAa7M,KAAKf,iBAAiB9B,OAAOhB,KAAK2Q,MAIpDvC,EAAkBvK,KAAKrB,WAAYC,EAAgBC,UAClDiK,EAAqB,CACnB0B,oBAAqB,YAGzB9B,EAAA,OAAKe,MAAO,CAAEC,QAAS,OAAQe,cAAe,SAAUC,IAAK,SAE3DhC,EAAA,kBACE7L,cAAemD,KAAK5B,qBACpB2O,UAAW/M,KAAKzB,aAChByO,UAAW,KACXC,gBAAiBzQ,EAAaL,KAAK8I,aAAagI,gBAChDJ,cAAe7M,KAAKf,kBAAkB9B,QAAQhB,MAAM2Q,IACpDI,eAAgB,IAChBhQ,QAASV,EAAaL,KAAKc,MAAMC,QACjCiQ,WAAY3Q,EAAa4Q,qBACzBnD,SAAU,IAAMG,MAIlB1B,EACE,gBAAA/L,KAAK,SACL6O,QAAQ,iBACRD,KAAK,eACL3E,QAASgC,EAAYC,UAAU,yBAIrCH,EAAA,yBAKF6B,EAAkBvK,KAAKrB,WAAYC,EAAgBC,UACnD6J,EAAK,OAAAC,MAAM,iBACTD,EAAA,OAAKC,MAAM,4BACRG,EAAqB,CACpB0B,oBAAqB,CAAC,SAAU,UAAW,kB","ignoreList":[]}
1
+ {"version":3,"names":["getRequiredFields","async","currency","method","organizationId","requiredFieldsResponse","api","checkout","fields","mapRequiredFields","data","original","getAllRequiredFieldsRenewal","paymentMethods","Set","renewalState","map","pm","type","promises","paymentMethod","apiPaymentMethod","PaymentMethodMapper","mapToAPMPaymentMethod","price","country","result","organization","id","error","console","results","Promise","all","fieldsMap","forEach","getRequiredFieldsForMethod","allRequiredFields","storedFields","rebillRenewalCss","RebillRenewal","renewalData","renewalToken","currentPaymentMethod","PAYMENT_METHOD_ENUM","CARD","isSubmitting","isCardSubmitting","isCardSuccess","errorMessage","breakpoint","BREAKPOINT_ENUM","DESKTOP","errorPaymentCard","errorPaymentAPM","initialData","checkoutResponse","currentApmPaymentMethod","countries","currentRequiredFields","errorCardInvalid","cardMode","success","paymentError","paymentMethodSelected","validationSchema","phoneNumber","yup.string","when","is","isFieldRequired","this","then","schema","required","otherwise","notRequired","bankId","documentType","documentNumber","min","resizeHandler","getBreakpoint","window","innerWidth","componentWillLoad","addEventListener","renewalProps","JSON","parse","RenewalStore","initializeRenewal","token","GoogleMapsService","loadGoogleMapsScript","response","getCountries","length","firstPaymentMethod","setSelectedPaymentMethod","initializeFingerprint","getInitialData","renewalOnChange","disconnectedCallback","removeEventListener","handlePaymentMethodSelected","event","stopPropagation","detail","setCardMode","emit","deviceId","uuid","crypto","randomUUID","fingerprintResponse","fingerPrint","getFingerPrint","setDeviceId","script","scriptElement","document","createElement","innerHTML","body","appendChild","handleBankSelected","setSelectedBankId","handleCardSelected","card","cvv","setSelectedCard","setCvv","currentPaymentError","CASH","BANK_TRANSFER","handleSubmit","handleCardRenewal","handleAPMRenewal","formData","cardId","cardTokenId","cardInformation","setLoading","renewalRequest","transaction","quantity","customAttributes","customer","firstName","fullName","split","subscription","customerName","lastName","slice","join","email","customerEmail","phone","countryCode","countryCodePhoneNumber","number","billingDetails","address","lineOne","city","state","zipCode","identification","value","idempotencyKey","generateIdempotencyKey","createCardCheckoutRequest","setCheckoutResponse","status","toUpperCase","CheckoutStatusE","APPROVED","message","apmPaymentMethod","getFormData","redirect","approved","location","origin","rejected","paymentMetadata","orderId","source","bank","PaymentMethodNameE","CO_TRANSFERENCE_PSE","targetCurrency","createAPMCheckoutRequest","alertTitle","hasPrefilledAddress","billingFields","some","key","trim","getPaymentDate","payment","form","date","getReferenceNumber","traceId","render","isInitialized","h","class","I18nService","translate","renderRenewalSummary","props","totalAmount","amount","subscriptionTitle","name","text","subscriptionAmount","nextChargeDate","frequency","Fragment","style","display","typePaymentMethod","paymentDate","referenceNumber","cardLastFour","paymentMethodName","selectedBankId","onSubmit","args","renderForm","submit","errors","userInfo","isBreakpointBelow","displayedComponents","flexDirection","gap","enabledPaymentMethods","defaultSelected","errorComponent","showErrorComponent","PaymentErrorMapper","getErrorTitle","getErrorMessage","cardError","showCardInvalid","documentTypeError","documentNumberError","showDocument","icon","variant","colorIcon","COLORS_ENUM","PRIMARY","banks","getFieldValues","defaultSelectedBankId","countryOptions","label","isoCountryCode","billingView","referenceId","undefined","qrCodeData","qrCode","providerName","expirationDate","Date","setDate","getDate","toISOString","redirectUrl","url","isLoading","isRenewal","trialPeriodDays","timeToRedirect","isDisabled","fetchingInstallments"],"sources":["src/components/renewal/utils/getRequiredFieldsRenewal.ts","src/components/renewal/rebill-renewal.css?tag=rebill-renewal","src/components/renewal/rebill-renewal.tsx"],"sourcesContent":["import { api } from '../../../api';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { renewalState } from '../../../store/renewal.store';\nimport { PaymentMethodMapper } from '../../../utils/payment-method-mapper';\nimport { mapRequiredFields, RequiredField } from '../../../utils/required-fields-mappers';\n\nexport interface RequiredFieldsResult {\n fields: string[];\n original: RequiredField[];\n}\n\nexport interface AllRequiredFieldsMap {\n [key: string]: RequiredFieldsResult;\n}\n\nconst getRequiredFields = async (\n currency: string,\n method: string,\n organizationId: string,\n): Promise<RequiredFieldsResult> => {\n const requiredFieldsResponse = await api.checkout.getRequiredFields(\n {\n currency,\n method,\n },\n organizationId,\n );\n\n return {\n fields: mapRequiredFields(requiredFieldsResponse.data),\n original: requiredFieldsResponse.data,\n };\n};\n\nexport const getAllRequiredFieldsRenewal = async (): Promise<AllRequiredFieldsMap> => {\n const paymentMethods = [\n ...new Set(renewalState.data.paymentMethods.map(pm => pm.type as PAYMENT_METHOD_ENUM)),\n ];\n const promises = paymentMethods.map(async paymentMethod => {\n try {\n const apiPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n paymentMethod,\n renewalState.data.price.country,\n );\n\n const result = await getRequiredFields(\n renewalState.data.price.currency,\n apiPaymentMethod,\n renewalState.data.organization.id,\n );\n\n return {\n paymentMethod,\n ...result,\n };\n } catch (error) {\n console.error(`Error getting required fields for ${paymentMethod}:`, error);\n return {\n paymentMethod,\n fields: [],\n original: [],\n };\n }\n });\n\n const results = await Promise.all(promises);\n const fieldsMap: AllRequiredFieldsMap = {};\n\n results.forEach(result => {\n fieldsMap[result.paymentMethod] = {\n fields: result.fields,\n original: result.original,\n };\n });\n return fieldsMap;\n};\n\nexport const getRequiredFieldsForMethod = (\n paymentMethod: PAYMENT_METHOD_ENUM,\n allRequiredFields: AllRequiredFieldsMap,\n): RequiredFieldsResult => {\n const storedFields = allRequiredFields[paymentMethod];\n if (storedFields) {\n return storedFields;\n } else {\n return {\n fields: [],\n original: [],\n };\n }\n};\n","@import '../../styles/variables.css';\n\n@media (max-width: 1024px) {\n .rebill-checkout-renewal {\n flex-direction: column;\n gap: 0;\n justify-content: flex-start;\n background: var(--rebill-color-background);\n padding: 20px;\n }\n .right-section .left-section {\n width: 100%;\n height: 100%;\n background: var(--rebill-color-background);\n }\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n height: 100%;\n margin-top: 24px;\n }\n .otp-container {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n\n@media (min-width: 1025px) {\n .rebill-checkout-renewal {\n width: 100vw;\n min-height: 100vh;\n display: flex;\n flex-direction: row;\n justify-content: center;\n overflow-y: auto;\n }\n\n .left-section {\n display: flex;\n width: 60%;\n background: var(--rebill-color-background-left);\n justify-content: space-around;\n }\n\n .right-section {\n display: flex;\n padding-top: 72px;\n width: 40%;\n background: var(--rebill-color-background-right);\n position: sticky;\n top: 0;\n\n justify-content: center;\n }\n\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n margin-bottom: 36px;\n margin-top: 24px;\n gap: 32px;\n }\n .left-section-container {\n max-width: 450px;\n min-width: 450px;\n margin: 2.5rem 2rem 1.5rem 2rem;\n display: flex;\n flex-direction: column;\n }\n\n .checkout-summary-section {\n max-width: 450px;\n min-width: 350px;\n margin: 0rem 2rem;\n background: var(--rebill-color-background-right);\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n width: 100%;\n }\n\n .checkout-form-section user-information,\n .checkout-form-section payment-method-selector,\n .checkout-form-section rebill-address,\n .checkout-summary-section rebill-summary {\n width: 100%;\n }\n\n /* Google Maps Autocomplete Styles */\n .pac-container {\n border-radius: 4px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n border: 1px solid #e0e0e0;\n margin-top: 4px;\n font-family: inherit;\n }\n\n .pac-item {\n padding: 10px 12px;\n cursor: pointer;\n border-top: none;\n }\n\n .pac-item:first-child {\n border-top: none;\n }\n\n .pac-item:hover {\n background-color: #f5f5f5;\n }\n\n .pac-item-query {\n font-weight: 500;\n }\n\n .pac-icon {\n display: none;\n }\n}\n\n.payment-button-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin-bottom: 16px;\n}\n/* Animaciones para componentes condicionales */\n.animated-component {\n transition: all 0.3s ease-in-out;\n overflow: visible;\n}\n\n/* Keep overflow hidden only for sliding height animations */\n/* .animated-component.slide-in {\n overflow: hidden;\n} */\n\n.fade-in {\n animation: fadeIn 0.4s ease-in-out;\n}\n\n.slide-in {\n animation: slideIn 0.5s ease-out;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes slideIn {\n from {\n opacity: 0;\n transform: translateX(-20px);\n max-height: 0;\n }\n to {\n opacity: 1;\n transform: translateX(0);\n max-height: 450px;\n }\n}\n\n/* Animación para cuando se ocultan los componentes */\n.animated-component.hide {\n animation: fadeOut 0.3s ease-in-out forwards;\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(20px);\n }\n}\n\n/* Test Mode Chip Positioning */\nrebill-mode-sandbox {\n position: fixed;\n bottom: 50px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1000;\n}\n\n/* Ensure the chip is visible on all screen sizes */\n@media (max-width: 1024px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n\n@media (min-width: 1025px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n.mode-sandbox-mobile-container {\n display: flex;\n align-items: center;\n width: 100%;\n\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* Desktop grande - mantener tamaños originales */\n@media (min-width: 1451px) {\n .left-section-container {\n min-width: 450px;\n margin: 2.5rem 5rem 1.5rem 5rem;\n }\n\n .checkout-summary-section {\n min-width: 450px;\n margin: 0rem 5rem;\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport * as yup from 'yup';\nimport { api, Country } from '../../api';\nimport { SavedCard } from '../../api/entities/cards/types';\nimport {\n CheckoutStatusE,\n CreateAPMCheckoutRequest,\n CreateAPMCheckoutResponse,\n CreateCardCheckoutRequest,\n} from '../../api/entities/checkout/types';\nimport '../../components/checkout/apm/apm-checkout/apm-checkout';\nimport '../../components/checkout/processing-payment/processing-payment';\nimport { I18nService } from '../../i18n/i18n.service';\n\nimport { PaymentMethodNameE } from '../../models/enums/payment-method-name.enum';\nimport { PAYMENT_METHOD_ENUM } from '../../models/enums/payment-methods.enum';\nimport { PaymentMessageE } from '../../models/enums/payment-status.enum';\nimport { onChange as renewalOnChange, renewalState, RenewalStore } from '../../store/renewal.store';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../utils/color-class-mapper';\nimport { generateIdempotencyKey } from '../../utils/generate-idempotency-key';\nimport { GoogleMapsService } from '../../utils/google-maps.service';\nimport { AlertErrorKeys, PaymentErrorMapper } from '../../utils/payment-error-mapper';\nimport { PaymentMethodMapper } from '../../utils/payment-method-mapper';\nimport { getFieldValues, isFieldRequired } from '../../utils/required-fields-mappers';\nimport {\n AllRequiredFieldsMap,\n getAllRequiredFieldsRenewal,\n getRequiredFieldsForMethod,\n} from './utils/getRequiredFieldsRenewal';\n\n@Component({\n tag: 'rebill-renewal',\n styleUrl: 'rebill-renewal.css',\n shadow: false,\n})\nexport class RebillRenewal {\n @Prop() renewalData!: string;\n @Prop() renewalToken!: string;\n\n @State() currentPaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @State() isSubmitting: boolean = false;\n @State() isCardSubmitting: boolean = false;\n @State() isCardSuccess: boolean = false;\n @State() errorMessage: AlertErrorKeys | null = null;\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() errorPaymentCard: boolean = false;\n @State() errorPaymentAPM: boolean = false;\n @State() initialData: any = {};\n @State() checkoutResponse: CreateAPMCheckoutResponse | null = null;\n @State() currentApmPaymentMethod: PaymentMethodNameE | null = null;\n @State() countries: Country[] = [];\n @State() allRequiredFields: AllRequiredFieldsMap = {};\n @State() currentRequiredFields: string[] = [];\n @State() errorCardInvalid: boolean = false;\n @State() cardMode: 'input' | 'select' | null = 'select';\n\n @Event() success: EventEmitter<any>;\n @Event() paymentError: EventEmitter<any>;\n @Event() paymentMethodSelected: EventEmitter<PAYMENT_METHOD_ENUM>;\n\n private validationSchema = {\n 'phoneNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('phoneNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.phoneRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-country': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-country', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.countryRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-state': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-state', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.stateRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-address': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-address', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.addressRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-city': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-city', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.cityRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-zip': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-zip', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.zipRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'bankId': yup.string().when([], {\n is: () => isFieldRequired('bankId', this.currentRequiredFields),\n then: schema => schema.required('validation.bankRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentType': yup.string().when([], {\n is: () =>\n isFieldRequired('documentType', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.documentTypeRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('documentNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema =>\n schema.required('validation.documentNumberRequired').min(7, 'validation.documentInvalid'),\n otherwise: schema => schema.notRequired(),\n }),\n };\n\n private resizeHandler = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n\n async componentWillLoad() {\n this.resizeHandler();\n window.addEventListener('resize', this.resizeHandler);\n\n const renewalProps =\n typeof this.renewalData === 'string' ? JSON.parse(this.renewalData) : this.renewalData;\n\n RenewalStore.initializeRenewal({\n ...renewalProps,\n token: this.renewalToken,\n });\n\n // Load Google Maps script for address autocomplete\n GoogleMapsService.loadGoogleMapsScript();\n\n // Load countries data\n try {\n const response = await api.data.getCountries();\n this.countries = response.data;\n } catch (error) {\n console.error('Error loading countries:', error);\n }\n\n // Load required fields data\n try {\n this.allRequiredFields = await getAllRequiredFieldsRenewal();\n } catch (error) {\n console.error('Error loading required fields:', error);\n }\n\n if (renewalState.data.paymentMethods.length > 0) {\n const firstPaymentMethod = renewalState.data.paymentMethods[0].type as PAYMENT_METHOD_ENUM;\n this.currentPaymentMethod = firstPaymentMethod;\n RenewalStore.setSelectedPaymentMethod(firstPaymentMethod);\n\n // Set required fields for the initial payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n firstPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Initialize fingerprint for the first payment method\n await this.initializeFingerprint(firstPaymentMethod);\n }\n\n this.initialData = this.getInitialData();\n\n this.cardMode = renewalState.cardMode;\n renewalOnChange('cardMode', () => {\n this.cardMode = renewalState.cardMode;\n });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.resizeHandler);\n }\n\n @Listen('paymentMethodSelected')\n async handlePaymentMethodSelected(event: CustomEvent<PAYMENT_METHOD_ENUM>) {\n event.stopPropagation();\n\n if (this.currentPaymentMethod === event.detail) {\n return;\n }\n\n this.currentPaymentMethod = event.detail;\n RenewalStore.setSelectedPaymentMethod(this.currentPaymentMethod);\n\n // Change cardMode to 'input' if payment method is not CARD\n if (this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD) {\n this.cardMode = 'input';\n RenewalStore.setCardMode('input');\n }\n\n // Update required fields for the new payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n this.currentPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Note: Fingerprint is handled in componentWillLoad\n\n // Initialize fingerprint for the new payment method\n await this.initializeFingerprint(this.currentPaymentMethod);\n\n this.paymentMethodSelected.emit(event.detail);\n }\n\n private async initializeFingerprint(paymentMethod: PAYMENT_METHOD_ENUM) {\n // Only initialize fingerprint for card payments and if not already generated\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD && !renewalState.deviceId) {\n try {\n const uuid = crypto.randomUUID();\n const fingerprintResponse = await api.fingerPrint.getFingerPrint(uuid);\n RenewalStore.setDeviceId(uuid);\n const script = fingerprintResponse.result.script;\n const scriptElement = document.createElement('script');\n scriptElement.innerHTML = script;\n document.body.appendChild(scriptElement);\n } catch (error) {\n console.error('Failed to initialize fingerprint:', error);\n }\n }\n }\n\n @Listen('bankSelected')\n handleBankSelected(event: CustomEvent<string>) {\n event.stopPropagation();\n RenewalStore.setSelectedBankId(event.detail);\n }\n\n @Listen('cardSelected')\n handleCardSelected(event: CustomEvent<{ card: SavedCard; cvv?: string }>) {\n const { card, cvv } = event.detail;\n RenewalStore.setSelectedCard(card);\n RenewalStore.setCvv(cvv || '');\n }\n\n private get currentPaymentError(): boolean {\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return this.errorPaymentCard;\n } else if (\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ) {\n return this.errorPaymentAPM;\n }\n return false;\n }\n\n private async handleSubmit(event?: CustomEvent) {\n if (this.isSubmitting) {\n return;\n }\n\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n await this.handleCardRenewal(event);\n } else {\n await this.handleAPMRenewal(event);\n }\n }\n\n private async handleCardRenewal(event?: CustomEvent) {\n const formData = event?.detail || this.getInitialData();\n\n if (!renewalState.data.cardId && !renewalState.data.cardTokenId) {\n this.errorCardInvalid = true;\n return;\n }\n if (!renewalState.data.cardInformation && !renewalState.data.cardId) {\n this.errorCardInvalid = true;\n return;\n }\n this.errorCardInvalid = false;\n this.isSubmitting = true;\n this.isCardSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const renewalRequest: CreateCardCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n ...(renewalState.data.cardId && { cardId: renewalState.data.cardId }),\n ...(renewalState.data.cardTokenId && { cardTokenId: renewalState.data.cardTokenId }),\n customAttributes: {\n ...(renewalState.deviceId && { deviceId: renewalState.deviceId }),\n },\n ...(this.cardMode === 'input' && {\n customer: {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName?.split(' ')[0],\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName?.split(' ').slice(1).join(' '),\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n },\n billingDetails: {\n address: {\n lineOne: formData['billing-address'] || '',\n city: formData['billing-city'] || '',\n state: formData['billing-state'] || '',\n country: formData['billing-country'] || '',\n zipCode: formData['billing-zip'] || '',\n },\n identification: {\n type: formData.documentType || '',\n value: formData.documentNumber || '',\n },\n },\n }),\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createCardCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n renewalState.token,\n );\n\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.isCardSuccess = false;\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: response.data.error?.error?.message as PaymentMessageE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: error.data?.error?.message as PaymentMessageE,\n };\n }\n }\n\n private async handleAPMRenewal(event?: CustomEvent) {\n this.isSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const apmPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n );\n\n // Get form data for billing details and customer info\n const formData = event?.detail || this.getFormData();\n\n // Transform form data to match CreateAPMCheckoutRequest structure\n const billingDetails = {\n address: {\n country: formData['billing-country'],\n state: formData['billing-state'] || '',\n city: formData['billing-city'] || '',\n zipCode: formData['billing-zip'] || '',\n lineOne: formData['billing-address'] || '',\n },\n identification: {\n type: formData.documentType || 'dni',\n value: formData.documentNumber || '',\n },\n };\n\n const renewalRequest: CreateAPMCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n method: apmPaymentMethod,\n billingDetails,\n redirect: {\n approved: window.location.origin + '/renewal/success',\n rejected: window.location.origin + '/renewal/failure',\n },\n paymentMetadata: {\n orderId: renewalState.data.id,\n source: 'renewal-web',\n },\n customAttributes: {\n bank: formData.bankId || '',\n },\n // Remove targetCurrency for PSE payments as it's not supported\n ...(apmPaymentMethod !== PaymentMethodNameE.CO_TRANSFERENCE_PSE && {\n targetCurrency: renewalState.data.price.currency,\n }),\n };\n\n // Add customer data for renewal\n renewalRequest.customer = {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName.split(' ')[0] ||\n '',\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName.split(' ').slice(1).join(' ') ||\n '',\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createAPMCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n );\n\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n this.checkoutResponse = response.data;\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.paymentError.emit(response.data);\n RenewalStore.setCheckoutResponse(response.data);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: response.data?.error?.message as PaymentMessageE,\n message: response.data.error?.message as PaymentMessageE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n this.paymentError.emit(error);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: error.data?.error?.message as PaymentMessageE,\n message: error.data?.error?.message,\n };\n }\n }\n\n private getFormData = () => {\n return this.initialData;\n };\n\n private getInitialData = () => {\n return {\n 'email': renewalState.data.subscription.customerEmail,\n 'fullName': renewalState.data.subscription.customerName,\n 'card': '',\n 'billing-country': '',\n 'billing-state': '',\n 'billing-address': '',\n 'billing-city': '',\n 'billing-zip': '',\n 'bankId': '',\n 'phoneNumber': '',\n 'countryCodePhoneNumber': '',\n 'documentType': '',\n 'documentNumber': '',\n };\n };\n\n private hasPrefilledAddress = () => {\n const billingFields = [\n 'billing-country',\n 'billing-state',\n 'billing-address',\n 'billing-city',\n 'billing-zip',\n ];\n return billingFields.some(key => {\n const value = this.initialData[key];\n return value && value.trim() !== '';\n });\n };\n\n private getPaymentDate = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n\n if ('date' in payment) {\n return payment.date as string;\n }\n\n return '';\n };\n\n private getReferenceNumber = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n if ('traceId' in payment) {\n return payment.traceId as string;\n }\n\n return '';\n };\n\n render() {\n if (!renewalState.isInitialized) {\n return <div class=\"loading\">{I18nService.translate('renewal.loading')}</div>;\n }\n\n const renderRenewalSummary = props => (\n <renewal-summary\n totalAmount={renewalState.data.price.amount}\n currency={renewalState.data.price.currency}\n subscriptionTitle={renewalState.data.subscription.name[0]?.text || 'Subscription'}\n subscriptionAmount={renewalState.data.subscription.amount}\n nextChargeDate={renewalState.data.subscription.nextChargeDate}\n frequency={renewalState.data.subscription.frequency}\n {...props}\n />\n );\n\n return (\n <>\n <rebill-processing-payment style={{ display: this.isCardSubmitting ? 'block' : 'none' }} />\n {this.isCardSuccess ? (\n <renewal-success-page\n typePaymentMethod={this.currentPaymentMethod}\n paymentDate={this.getPaymentDate()}\n referenceNumber={this.getReferenceNumber()}\n cardLastFour={renewalState.data.subscription.cardLastFour}\n country={renewalState.data.price.country}\n paymentMethodName={PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data?.price?.country,\n )}\n bank={renewalState.form?.selectedBankId || ''}\n />\n ) : (\n <rebill-checkout-form\n style={{ display: this.isCardSubmitting || this.isCardSuccess ? 'none' : 'block' }}\n validationSchema={this.validationSchema}\n initialData={this.initialData}\n onSubmit={(args: any) => this.handleSubmit(args)}\n renderForm={({ submit, formData, errors }) => (\n <div class=\"rebill-checkout-renewal\">\n <div class=\"left-section\">\n <div class=\"left-section-container\">\n <organization-logo organization={renewalState.data.organization} />\n\n <div class=\"checkout-form-section\">\n {/* Customer Information - Readonly */}\n <user-information-static\n userInfo={{\n customerName: renewalState.data.subscription.customerName,\n customerEmail: renewalState.data.subscription.customerEmail,\n }}\n />\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'header',\n })}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'details',\n })}\n\n {/* Payment Method Selection */}\n <div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>\n <payment-method-selector\n enabledPaymentMethods={[\n ...new Set(\n renewalState.data.paymentMethods.map(\n pm => pm.type as PAYMENT_METHOD_ENUM,\n ),\n ),\n ]}\n defaultSelected={this.currentPaymentMethod}\n errorComponent={{\n showErrorComponent: this.currentPaymentError,\n alertTitle: PaymentErrorMapper.getErrorTitle(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n this.errorMessage?.alertTitle,\n ),\n message: PaymentErrorMapper.getErrorMessage(\n this.errorMessage?.message,\n this.currentPaymentMethod,\n renewalState.data.price.country,\n ),\n }}\n cardError={{\n showCardInvalid: this.errorCardInvalid,\n type: null,\n }}\n country={renewalState.data.price.country}\n documentTypeError={errors?.documentType}\n documentNumberError={errors?.documentNumber}\n showDocument={\n this.cardMode === 'input' &&\n (isFieldRequired('documentType', this.currentRequiredFields) ||\n isFieldRequired('documentNumber', this.currentRequiredFields))\n }\n />\n {/* Alert for non-card payment methods */}\n {this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD && (\n <rebill-alert\n type=\"info\"\n message={I18nService.translate('renewal.paymentMethodAlert', {\n cardLastFour: renewalState.data.subscription.cardLastFour || '****',\n })}\n icon=\"calendar-edit\"\n variant=\"outlined\"\n colorIcon={COLORS_ENUM.PRIMARY}\n />\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('bankId', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <rebill-bank-selector\n banks={\n getFieldValues(\n 'bank',\n this.allRequiredFields[this.currentPaymentMethod]?.original,\n ) || []\n }\n defaultSelectedBankId={formData.bankId || ''}\n error={errors?.bankId}\n />\n </div>\n )}\n </div>\n {this.cardMode === 'input' &&\n (isFieldRequired('billing-country', this.currentRequiredFields) ||\n isFieldRequired('billing-state', this.currentRequiredFields) ||\n isFieldRequired('billing-address', this.currentRequiredFields) ||\n isFieldRequired('billing-city', this.currentRequiredFields) ||\n isFieldRequired('billing-zip', this.currentRequiredFields)) && (\n <div class=\"animated-component slide-in\">\n <rebill-address\n countryOptions={this.countries.map(country => ({\n label: country.country,\n value: country.isoCountryCode,\n }))}\n billingView={this.hasPrefilledAddress() ? 'form' : 'search'}\n errors={{\n 'billing-country': errors['billing-country'],\n 'billing-state': errors['billing-state'],\n 'billing-address': errors['billing-address'],\n 'billing-city': errors['billing-city'],\n 'billing-zip': errors['billing-zip'],\n }}\n />\n </div>\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('phoneNumber', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <user-information-phone error={errors?.phoneNumber} />\n </div>\n )}\n\n {/* Show APM checkout response after successful payment submission */}\n {this.checkoutResponse?.result &&\n (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) && (\n <apm-checkout\n paymentMethod={this.currentPaymentMethod}\n referenceId={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH\n ? this.checkoutResponse.result.data.referenceId\n : undefined\n }\n qrCodeData={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ? this.checkoutResponse.result.data.qrCode\n : undefined\n }\n providerName={renewalState.data.organization?.name || ''}\n expirationDate={(() => {\n const expirationDate = new Date();\n expirationDate.setDate(expirationDate.getDate() + 30);\n return expirationDate.toISOString();\n })()}\n country={renewalState.data.price.country}\n redirectUrl={this.checkoutResponse.result.data.url}\n />\n )}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'summary',\n })}\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n {/* Payment Button */}\n <payment-button\n paymentMethod={this.currentPaymentMethod}\n isLoading={this.isSubmitting}\n isRenewal={true}\n trialPeriodDays={renewalState.data.subscription.trialPeriodDays}\n redirectUrl={!!this.checkoutResponse?.result?.data?.url}\n timeToRedirect={5000}\n country={renewalState.data.price.country}\n isDisabled={renewalState.fetchingInstallments}\n onSubmit={() => submit()}\n />\n\n {/* Disabled Button Below */}\n <rebill-alert\n type=\"secure\"\n variant=\"variant-secure\"\n icon=\"lock-outline\"\n message={I18nService.translate('otp.secureMessage')}\n />\n </div>\n </div>\n <rebill-footer />\n </div>\n </div>\n\n {/* Desktop Summary */}\n {!isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <div class=\"right-section\">\n <div class=\"checkout-summary-section\">\n {renderRenewalSummary({\n displayedComponents: ['header', 'details', 'summary'],\n })}\n </div>\n </div>\n )}\n </div>\n )}\n />\n )}\n </>\n );\n }\n}\n"],"mappings":"8kBAeA,MAAMA,EAAoBC,MACxBC,EACAC,EACAC,KAEA,MAAMC,QAA+BC,E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AgBC,UAClDiK,EAAqB,CACnB0B,oBAAqB,YAGzB9B,EAAA,OAAKe,MAAO,CAAEC,QAAS,OAAQe,cAAe,SAAUC,IAAK,SAE3DhC,EAAA,kBACE7L,cAAemD,KAAK5B,qBACpB2O,UAAW/M,KAAKzB,aAChByO,UAAW,KACXC,gBAAiBzQ,EAAaL,KAAK8I,aAAagI,gBAChDJ,cAAe7M,KAAKf,kBAAkB9B,QAAQhB,MAAM2Q,IACpDI,eAAgB,IAChBhQ,QAASV,EAAaL,KAAKc,MAAMC,QACjCiQ,WAAY3Q,EAAa4Q,qBACzBnD,SAAU,IAAMG,MAIlB1B,EACE,gBAAA/L,KAAK,SACL6O,QAAQ,iBACRD,KAAK,eACL3E,QAASgC,EAAYC,UAAU,yBAIrCH,EAAA,yBAKF6B,EAAkBvK,KAAKrB,WAAYC,EAAgBC,UACnD6J,EAAK,OAAAC,MAAM,iBACTD,EAAA,OAAKC,MAAM,4BACRG,EAAqB,CACpB0B,oBAAqB,CAAC,SAAU,UAAW,kB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as a,d as r,h as t}from"./p-DyaDabZ4.js";import{P as i,a as o,I as s,i as l,s as c}from"./p-B2B19LUC.js";import{r as n}from"./p-Dcf7Or4N.js";import"./p-BFhvUZPU.js";import"./p-BYrqevT1.js";import{P as d}from"./p-UlyTyHvM.js";import"./p-uZj1dMLQ.js";import{f as b,a as p}from"./p-C67uAF9_.js";import{B as f,g as h,i as g}from"./p-Do_vNuMa.js";import{C as y}from"./p-DA598vBj.js";import{g as m}from"./p-DUlU_fi_.js";import"./p-BFTU3MAI.js";import"./p-Bf6g23G6.js";const u=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}.renewal-success-page__success-content{display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%;overflow-x:hidden;box-sizing:border-box}.renewal-success-page__success-content rebill-typography[variant='h3']{margin:0 !important;padding:0 !important}.renewal-success-page__success-icon{display:flex;justify-content:center;margin:0.5rem 0}.renewal-success-page__info-card{padding:24px;gap:16px;width:100%;max-width:450px;border:1px solid #ebedef;border-radius:8px;display:flex;flex-direction:column;box-sizing:border-box}.renewal-success-page__card-row{display:flex;justify-content:space-between;align-items:start;min-height:20px;gap:15%}.renewal-success-page__card-row:last-of-type{margin-bottom:0}.renewal-success-page__card-value{display:flex;align-items:center;gap:0.5rem}.renewal-success-page__payment-method-display{display:flex;align-items:center;gap:8px;justify-content:center}.renewal-success-page__payment-method-display rebill-card-icon{display:inline-block;flex-shrink:0;margin-right:8px;vertical-align:middle}.renewal-success-page__payment-method-display rebill-card-icon svg{display:block}.renewal-success-page__payment-method-display rebill-icon{display:inline-block;vertical-align:middle;margin-right:8px}.renewal-success-page__payment-method-display rebill-icon div{display:block}.renewal-success-page__card-divider{height:1px;background:#e5e7eb}.renewal-success-page__download-container{display:flex;align-items:center;justify-content:flex-start;gap:2px;text-decoration:none;cursor:pointer}.renewal-success-page__contact-info{text-align:left}.renewal-success-page__reference-number{word-break:break-all;overflow-wrap:break-word;hyphens:auto;max-width:100%;text-align:right}.renewal-success-page__total-amount-container{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-direction:row}@media (max-width: 1024px){.renewal-success-page__success-content{max-width:100%;gap:1.5rem;margin-left:16px;margin-right:16px}.renewal-success-page__info-card{width:100%;max-width:100%;padding:12px}}@media (max-width: 767px){.renewal-success-page__info-card{padding:12px}}";const w=class{constructor(r){e(this,r);this.successRedirect=a(this,"successRedirect")}typePaymentMethod=i.CARD;country="";bank="";paymentMethodName="";cardLastFour="";paymentDate="";referenceNumber="";trialPeriodDays=0;debitDay=0;planAmount=0;currentLocale="es";breakpoint=f.DESKTOP;successRedirect;loaderProgress=0;isLoadingLottie=true;showRedirectMessage=false;timeToRedirect=3e3;progressInterval;lottieContainer;lottieAnimation;successDisplayTimeout;applyStartCaseToBrand=e=>{if(!e)return"";return e.toLowerCase().split(/[\s-]+/).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")};getPaymentDate=()=>{const e=n.form.checkoutResponse;if(!e)return"";if("date"in e){return e.date}return""};componentWillLoad(){this.breakpoint=h(window.innerWidth);if(this.showRedirectMessage){this.successDisplayTimeout=window.setTimeout((()=>{this.showRedirectMessage=true;this.loadLottieAnimation()}),1500);setTimeout((()=>{this.stopLoaderAnimation()}),this.timeToRedirect)}}componentDidLoad(){window.addEventListener("resize",this.handleResize);if(!this.showRedirectMessage){this.loadLottieAnimation()}}disconnectedCallback(){if(this.successDisplayTimeout){clearTimeout(this.successDisplayTimeout)}window.removeEventListener("resize",this.handleResize);this.stopLoaderAnimation()}handleResize=()=>{this.breakpoint=h(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-DdEjhWUP.js").then((function(e){return e.l}));const a=await fetch(r(`./assets/loader-redirect1.json`));const t=await a.json();if(this.lottieContainer){this.lottieAnimation=e.default.loadAnimation({container:this.lottieContainer,renderer:"svg",loop:true,autoplay:true,animationData:t})}else{this.startLoaderAnimation()}}catch(e){this.startLoaderAnimation()}};startLoaderAnimation=()=>{const e=3e3;const a=50;const r=a/e*100;this.progressInterval=window.setInterval((()=>{this.loaderProgress=Math.min(this.loaderProgress+r,100);if(this.loaderProgress>=100){this.stopLoaderAnimation()}}),a)};stopLoaderAnimation=()=>{if(this.progressInterval){clearInterval(this.progressInterval);this.progressInterval=undefined}if(this.lottieAnimation){this.lottieAnimation.destroy();this.lottieAnimation=undefined}};handleDownloadReceipt=async()=>{try{await d.generateAndDownloadReceipt({paymentMethod:this.typePaymentMethod===i.CARD?this.textPaymentMethodCard():this.paymentMethodName,...this.typePaymentMethod===i.BANK_TRANSFER&&{bank:this.bank},...this.typePaymentMethod===i.CARD&&{cardBrand:this.applyStartCaseToBrand(n.data.cardInformation?.brand||"")},...this.typePaymentMethod===i.CARD&&{cardLastFour:this.cardLastFour??n.data.cardInformation?.lastFour},paymentDate:b(this.getPaymentDate())||"",email:n.data.subscription.customerEmail||"",referenceNumber:this.referenceNumber,productTitle:n.data.subscription.name[0]?.text||"Subscription",subtotal:this.getFormattedSubtotal(),total:this.getFormattedTotal(),currency:n.data.price.currency||" ",discountAmount:this.getFormattedDiscountAmount(),trialPeriodDays:this.trialPeriodDays,debitDay:this.debitDay,planAmount:this.getFormattedSubtotal(this.planAmount),isBankTransfer:this.typePaymentMethod===i.BANK_TRANSFER})}catch(e){console.error("Error downloading receipt:",e)}};getFormattedDiscountAmount=()=>undefined;getFormattedSubtotal=(e=null)=>o(e||n.data.price.amount,n.data.price.currency);getFormattedTotal=()=>{if(this.trialPeriodDays>0){return o(0,n.data.price.currency)}return o(n.data.price.amount,n.data.price.currency)};textPaymentMethodCard=()=>{const e=n.data?.cardInformation?.brand;const a=this.cardLastFour||n.data?.cardInformation?.lastFour;const r=this.applyStartCaseToBrand(e||"");return e&&a?`${r} - ${a}`:r};render(){return t("rebill-checkout-single-column",{key:"22e8c13beb16726da16fbeb3907f92b757f1c74f"},t("div",{key:"3089079b61f93ed76d24546c5eb122d070a6e079",class:"renewal-success-page__success-content"},t("rebill-typography",{key:"2aa31ccaa4654376d00a854bab7401a27b116499",variant:"h3",color:y.PRIMARY_DARK_TEXT},s.translate("processing.successTitle")),t("div",{key:"ba0114812a2a8e9a225b4d49181221ee21bde1a1",class:"renewal-success-page__success-icon"},t("svg",{key:"5d54434aa653512d5e5742c2faa2b5680f873a89",width:g(this.breakpoint,f.DESKTOP)?"64":"96",height:g(this.breakpoint,f.DESKTOP)?"64":"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"f964af5a32cc2cfcc5e823ffbc2aeed35eab05ef","fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z",fill:"#35B093"}))),t("div",{key:"615734f5d5e0695b94a526586f9f9a35cadaec15",class:"renewal-success-page__info-card"},t("div",{key:"333ac43ba36202067e52585df703449c93e76e0e",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"7e81a6e8e7184f0107d05da1e83020146f38185c",variant:"body2",color:y.SECONDARY},s.translate("processing.paymentMethod")),t("div",{key:"a6099aaeb4db666dc23b55cf31464ca9b6f4e741",class:"renewal-success-page__card-value"},t("div",{key:"cc8cadace90e91eac3b711416a16eeb0c82b4bf4",class:"renewal-success-page__payment-method-display"},this.typePaymentMethod===i.CARD&&t(t.Fragment,null,t("rebill-card-icon",{key:"3f3b5421084b360bab9d42192bfe61fe611a09e9","card-brand":n.data?.cardInformation?.brand||""}),t("rebill-typography",{key:"ed46bf21b98151265ced84fdb9a6c77f8bd54e78",variant:"body2",color:y.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===i.BANK_TRANSFER&&t("div",{key:"b800e3eb1ca8c4f01f0adeb0b3f8d7b243b2ef6e",style:{display:"flex",alignItems:"center",gap:"8px"}},t("rebill-icon",{key:"61728b15ed20c48388cdf5f4605282321dadcea4",name:m(i.BANK_TRANSFER,this.country).toLowerCase()}),t("rebill-typography",{key:"880b4494f608ad95a13b7af1153f07ceb11a4cb2",variant:"body2",color:y.PRIMARY_DARK_TEXT},s.translate("paymentMethods.bank_transfer")))))),t("div",{key:"0ce54346a35c5e60e309ca682cdce6a4261748ff",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"74c5e16bc547240cb58148c6a265058d79c99cec",variant:"body2",color:y.SECONDARY},s.translate("processing.paymentDate")),t("rebill-typography",{key:"6759bdf9aa21772e58f54b4e02f9293f078302fa",variant:"body2",color:y.PRIMARY_DARK_TEXT},b(this.paymentDate||this.getPaymentDate())||"")),t("div",{key:"756ef978e932ee0b39d17ed92fad8cc49d0f2f3a",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"b905f100b2b4da1337421478a128e22125e52319",variant:"body2",color:y.SECONDARY},s.translate("processing.paymentEmail")),t("rebill-typography",{key:"023c308d8ef2ae710c7008e56af6d966536eb5e4",variant:"body2",color:y.PRIMARY_DARK_TEXT},n.data.subscription.customerEmail)),t("div",{key:"9f7d1adb8d5d4379adb0980ff2fe7733cc0b82c2",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"6f1f62401ad73ceecfffc42257cfb89e4de0e2b9",variant:"body2",color:y.SECONDARY},s.translate("processing.paymentReference")),t("rebill-typography",{key:"784d10962c5bd537a55bf68a85c48ad885e6f6a2",variant:"body2",color:y.PRIMARY_DARK_TEXT,class:"renewal-success-page__reference-number"},this.referenceNumber||""))),t("div",{key:"a4eaf4ca38eac98c9257ed45a238b4b2489d86b8",class:"renewal-success-page__info-card"},t("rebill-typography",{key:"cb36cd30ff78a4110deb108b66ba9e3aa1a227c7",variant:"subtitle-bold",color:y.PRIMARY_DARK_TEXT},s.translate("processing.purchaseDetails")),t("div",{key:"6539086311dd95fc61f9bfc6619b908ef1f191b8",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"ac002409e20935f57873dd860e762f3874c2b382",variant:"body2",color:y.SECONDARY},s.translate("processing.purchaseDetail")),t("rebill-typography",{key:"8184b75d4c6920327af717abe913c3c5103ac5da",variant:"body2",color:y.PRIMARY_DARK_TEXT},n.data.subscription.name[0]?.text||"Subscription")),t("div",{key:"597c5f764d0ed5a43d6a545518f005139dd6b46d",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"7d737c4043f8359acab1c7e3d9f8ed66ba412fdd",variant:"body2",color:y.SECONDARY},s.translate("processing.purchaseSubtotal")),t("rebill-typography",{key:"3babadb3bb63c8ad00897125b28b4018d5409149",variant:"body2",color:y.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),t("div",{key:"8f1c1b92d98825ea2e8f4778b519f6da1f6b81d8",class:"renewal-success-page__card-row"},t("rebill-typography",{key:"f545c4ebdabb374ecb602c8156522bff5d0453e7",variant:"body2",color:y.SECONDARY},s.translate("processing.purchaseMontoTotal")),t("div",{key:"86030e48acae8ba185ea919382f028f4abe13ca6",class:"renewal-success-page__total-amount-container"},t("rebill-typography",{key:"204882807d213e41837c472dda0910240bf7897e",variant:"body2",color:y.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),t("div",{key:"55d01018b5c33c3d350b37c66ba6790706c6957e",class:"renewal-success-page__card-divider"}),t("div",{key:"514c022d98b47781c27816ce02caa287c55a16da",class:"renewal-success-page__download-container"},t("svg",{key:"abdacdcb5e98d843d8e88464e2bf88d5b232e52e",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"881cdd290a2b2f57cd939b2006d80bcafce7ea9b",d:"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})),t("rebill-button",{key:"a34543047b0f77a8f088ac972b1c5a0dbea44e4a",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},t("rebill-typography",{key:"293bcd4e24c8f25cfdfc44e2c85b35485a8bb30b",variant:"overline",color:y.PRIMARY_DARK_TEXT},s.translate("processing.download")))),t("div",{key:"5178d135e2c92e1af5c077ed507dd8ebe3885665",class:"renewal-success-page__contact-info"},t("rebill-typography",{key:"528e2fbd77b5e48c617c7a8845718c3b6bd52f06",variant:"information-text",color:y.SECONDARY},s.translate("processing.downloadDescription"))))))}};w.style=u;const x=".wrapper{margin:0 auto;display:flex;flex-direction:column;align-items:center}.header{display:flex;flex-direction:column;align-items:center;gap:8px}.title{font-size:1rem;font-weight:500;color:var(--rebill-color-primary-dark-text);text-align:center}.amount{font-size:2.25rem;font-weight:500;color:var(--rebill-color-primary-dark-text);margin:0 0 1.5rem 0;text-align:center;line-height:1.1}.per{font-size:1.1rem;font-weight:400;color:var(--rebill-color-text-secondary)}.label-muted{font-size:1rem;color:var(--rebill-color-primary-dark);margin:0 0 1.5rem 0;text-align:center}.info{width:100%;margin-top:1.5rem;margin-bottom:3rem;display:flex;flex-direction:column;gap:1.4rem}.row{display:flex;justify-content:space-between;align-items:center;font-size:1rem;line-height:1.4;width:100%}.left{color:var(--rebill-color-text-secondary);font-weight:400}.right{color:var(--rebill-color-primary-dark-text);font-weight:400;text-align:right}.divider{border:none;border-top:1px solid var(--rebill-color-border);margin:1rem 0}@media (max-width: 1024px){.amount{margin-bottom:0}.row{font-size:0.9rem}.row:not(:last-child){margin-bottom:0.5rem}.left{color:var(--rebill-color-primary-dark-text)}}.total-row{width:100%;display:flex;justify-content:space-between;align-items:center;font-size:1.1rem;font-weight:600}.total-row .left{color:var(--rebill-color-primary-dark-text)}";const v=class{constructor(a){e(this,a)}forceUpdate=0;displayedComponents=["header","details","summary"];componentWillLoad(){l.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){l.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.forceUpdate=this.forceUpdate+1};totalAmount;subscriptionTitle;subscriptionAmount;nextChargeDate;frequency;currency;getFrequencyText(){if(!this.frequency||!this.frequency.period)return"";const e=this.frequency.period.toLowerCase();const a=this.frequency.count;const r=`summary.${e}`;return s.translate(r,{count:a})}renderHeader=()=>t("div",{class:"header"},t("p",{class:"title"},s.translate("renewal.title")),t("p",{class:"amount"},o(this.totalAmount,this.currency)," ",t("span",{class:"per"},"/ ",this.getFrequencyText().toLowerCase())));renderInfoRow=(e,a)=>t("div",{class:"row"},t("div",{class:"left"},e),t("div",{class:"right"},a));renderProduct=()=>this.renderInfoRow(this.subscriptionTitle,o(this.subscriptionAmount,this.currency));renderNextRenewal=()=>this.renderInfoRow(s.translate("renewal.nextRenewal"),p(this.nextChargeDate,undefined,c.currentLocale));renderSubtotal=()=>this.renderInfoRow(s.translate("renewal.subtotal"),o(this.totalAmount,this.currency));renderTotal=()=>t("div",{class:"total-row"},t("div",{class:"left"},s.translate("renewal.totalToRenew")),t("div",{class:"right"},o(this.totalAmount,this.currency)));renderDesktop=()=>t("div",{class:"wrapper"},this.renderHeader(),t("div",{class:"info"},t("div",{class:"row"},t("div",{class:""},s.translate("renewal.subscriptionDetails"))),this.renderProduct(),this.renderNextRenewal(),this.renderSubtotal()),this.renderTotal());render(){if(this.displayedComponents.includes("header")&&this.displayedComponents.includes("details")&&this.displayedComponents.includes("summary")){return this.renderDesktop()}if(this.displayedComponents.includes("header")){return this.renderHeader()}if(this.displayedComponents.includes("details")){return t("collapsible-card",{header:s.translate("summary.details")},this.renderProduct(),this.renderNextRenewal())}if(this.displayedComponents.includes("summary")){return t("collapsible-card",{header:s.translate("summary.summary")},this.renderInfoRow(this.subscriptionTitle,"1 x "+o(this.subscriptionAmount,this.currency)),this.renderSubtotal(),t("hr",{color:"#F4F5F6"}),this.renderInfoRow(s.translate("renewal.totalToRenew"),o(this.totalAmount,this.currency)))}}};v.style=x;export{w as renewal_success_page,v as renewal_summary};
2
+ //# sourceMappingURL=p-70b7d9c8.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["renewalSuccessPageCss","RenewalSuccessPage","typePaymentMethod","PAYMENT_METHOD_ENUM","CARD","country","bank","paymentMethodName","cardLastFour","paymentDate","referenceNumber","trialPeriodDays","debitDay","planAmount","currentLocale","breakpoint","BREAKPOINT_ENUM","DESKTOP","successRedirect","loaderProgress","isLoadingLottie","showRedirectMessage","timeToRedirect","progressInterval","lottieContainer","lottieAnimation","successDisplayTimeout","applyStartCaseToBrand","brand","toLowerCase","split","map","word","charAt","toUpperCase","slice","join","getPaymentDate","payment","renewalState","form","checkoutResponse","date","componentWillLoad","this","getBreakpoint","window","innerWidth","setTimeout","loadLottieAnimation","stopLoaderAnimation","componentDidLoad","addEventListener","handleResize","disconnectedCallback","clearTimeout","removeEventListener","async","lottie","import","then","n","l","animationData","fetch","getAssetPath","animationJson","json","default","loadAnimation","container","renderer","loop","autoplay","startLoaderAnimation","error","duration","interval","increment","setInterval","Math","min","clearInterval","undefined","destroy","handleDownloadReceipt","PDFGenerator","generateAndDownloadReceipt","paymentMethod","textPaymentMethodCard","BANK_TRANSFER","cardBrand","data","cardInformation","lastFour","formatDateTime","email","subscription","customerEmail","productTitle","name","text","subtotal","getFormattedSubtotal","total","getFormattedTotal","currency","price","discountAmount","getFormattedDiscountAmount","isBankTransfer","console","formatAmount","amount","formattedBrand","render","h","key","class","variant","color","COLORS_ENUM","PRIMARY_DARK_TEXT","I18nService","translate","width","isBreakpointBelow","height","viewBox","fill","xmlns","d","SECONDARY","Fragment","style","display","alignItems","gap","getPaymentMethodDisplayName","stroke","type","size","onClick","renewalSummaryCss","RenewalSummary","forceUpdate","displayedComponents","i18n","on","handleLanguageChange","off","totalAmount","subscriptionTitle","subscriptionAmount","nextChargeDate","frequency","getFrequencyText","period","count","translationKey","renderHeader","renderInfoRow","label","value","renderProduct","renderNextRenewal","formatDateByLocale","sessionState","renderSubtotal","renderTotal","renderDesktop","includes","header"],"sources":["src/components/renewal/renewal-success-page/renewal-success-page.css?tag=renewal-success-page","src/components/renewal/renewal-success-page/renewal-success-page.tsx","src/components/renewal/renewal-summary/renewal-summary.css?tag=renewal-summary","src/components/renewal/renewal-summary/renewal-summary.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n/* Success View Styles */\n.renewal-success-page__success-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1rem;\n width: 100%;\n overflow-x: hidden;\n box-sizing: border-box;\n}\n\n/* Eliminar márgenes del h3 en el componente de éxito */\n.renewal-success-page__success-content rebill-typography[variant='h3'] {\n margin: 0 !important;\n padding: 0 !important;\n}\n\n.renewal-success-page__success-icon {\n display: flex;\n justify-content: center;\n margin: 0.5rem 0;\n}\n\n/* Info Cards */\n.renewal-success-page__info-card {\n padding: 24px;\n gap: 16px;\n width: 100%;\n max-width: 450px;\n border: 1px solid #ebedef;\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n\n.renewal-success-page__card-row {\n display: flex;\n justify-content: space-between;\n align-items: start;\n min-height: 20px;\n gap: 15%;\n}\n\n.renewal-success-page__card-row:last-of-type {\n margin-bottom: 0;\n}\n\n.renewal-success-page__card-value {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.renewal-success-page__payment-method-display {\n display: flex;\n align-items: center;\n gap: 8px;\n justify-content: center;\n}\n\n.renewal-success-page__payment-method-display rebill-card-icon {\n display: inline-block;\n flex-shrink: 0;\n margin-right: 8px;\n vertical-align: middle;\n}\n\n.renewal-success-page__payment-method-display rebill-card-icon svg {\n display: block;\n}\n\n.renewal-success-page__payment-method-display rebill-icon {\n display: inline-block;\n vertical-align: middle;\n margin-right: 8px;\n}\n\n.renewal-success-page__payment-method-display rebill-icon div {\n display: block;\n}\n\n.renewal-success-page__card-divider {\n height: 1px;\n background: #e5e7eb;\n}\n\n.renewal-success-page__download-container {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 2px;\n text-decoration: none;\n cursor: pointer;\n}\n\n.renewal-success-page__contact-info {\n text-align: left;\n}\n\n.renewal-success-page__reference-number {\n word-break: break-all;\n overflow-wrap: break-word;\n hyphens: auto;\n max-width: 100%;\n text-align: right;\n}\n\n.renewal-success-page__total-amount-container {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n flex-direction: row;\n}\n\n/* Responsive Styles */\n@media (max-width: 1024px) {\n .renewal-success-page__success-content {\n max-width: 100%;\n gap: 1.5rem;\n margin-left: 16px;\n margin-right: 16px;\n }\n\n .renewal-success-page__info-card {\n width: 100%;\n max-width: 100%;\n padding: 12px;\n }\n}\n\n@media (max-width: 767px) {\n .renewal-success-page__info-card {\n padding: 12px;\n }\n}\n","import { Component, Event, EventEmitter, getAssetPath, h, Prop, State } from '@stencil/core';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { renewalState } from '../../../store/renewal.store';\nimport { formatDateTime } from '../../../utils';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\nimport { getPaymentMethodDisplayName } from '../../../utils/get-payment-method-display-name';\nimport { PDFGenerator } from '../../../utils/pdf-generator';\n\n@Component({\n tag: 'renewal-success-page',\n styleUrl: 'renewal-success-page.css',\n shadow: false,\n})\nexport class RenewalSuccessPage {\n @Prop() typePaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @Prop() country?: string = '';\n @Prop() bank?: string = '';\n @Prop() paymentMethodName?: string = '';\n @Prop() cardLastFour?: string = '';\n @Prop() paymentDate: string = '';\n @Prop() referenceNumber: string = '';\n @Prop() trialPeriodDays?: number = 0;\n @Prop() debitDay?: number = 0;\n @Prop() planAmount?: number = 0;\n @State() currentLocale: string = 'es';\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n\n @Event() successRedirect: EventEmitter<any>;\n @State() loaderProgress: number = 0;\n @State() isLoadingLottie: boolean = true;\n @State() showRedirectMessage: boolean = false;\n @Prop() timeToRedirect: number = 3000;\n private progressInterval?: number;\n private lottieContainer?: HTMLElement;\n private lottieAnimation?: any;\n private successDisplayTimeout?: number;\n\n private applyStartCaseToBrand = (brand: string): string => {\n if (!brand) return '';\n\n return brand\n .toLowerCase()\n .split(/[\\s-]+/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n };\n\n private getPaymentDate = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n\n // El response tiene una propiedad 'date' en el nivel superior\n if ('date' in payment) {\n return payment.date as string;\n }\n\n return '';\n };\n\n componentWillLoad() {\n this.breakpoint = getBreakpoint(window.innerWidth);\n\n // Para renewal, no hay redirect por defecto, pero podríamos agregarlo si es necesario\n if (this.showRedirectMessage) {\n this.successDisplayTimeout = window.setTimeout(() => {\n this.showRedirectMessage = true;\n this.loadLottieAnimation();\n }, 1500);\n\n setTimeout(() => {\n // Aquí podrías agregar lógica de redirect si es necesaria\n this.stopLoaderAnimation();\n }, this.timeToRedirect);\n }\n }\n\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n if (!this.showRedirectMessage) {\n this.loadLottieAnimation();\n }\n }\n\n disconnectedCallback() {\n if (this.successDisplayTimeout) {\n clearTimeout(this.successDisplayTimeout);\n }\n window.removeEventListener('resize', this.handleResize);\n this.stopLoaderAnimation();\n }\n\n private handleResize = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n\n private loadLottieAnimation = async () => {\n try {\n const lottie = await import('lottie-web');\n const animationData = await fetch(getAssetPath(`./assets/loader-redirect1.json`));\n const animationJson = await animationData.json();\n\n if (this.lottieContainer) {\n this.lottieAnimation = lottie.default.loadAnimation({\n container: this.lottieContainer,\n renderer: 'svg',\n loop: true,\n autoplay: true,\n animationData: animationJson,\n });\n } else {\n this.startLoaderAnimation();\n }\n } catch (error) {\n this.startLoaderAnimation();\n }\n };\n\n private startLoaderAnimation = () => {\n const duration = 3000;\n const interval = 50;\n const increment = (interval / duration) * 100;\n\n this.progressInterval = window.setInterval(() => {\n this.loaderProgress = Math.min(this.loaderProgress + increment, 100);\n if (this.loaderProgress >= 100) {\n this.stopLoaderAnimation();\n }\n }, interval);\n };\n\n private stopLoaderAnimation = () => {\n if (this.progressInterval) {\n clearInterval(this.progressInterval);\n this.progressInterval = undefined;\n }\n if (this.lottieAnimation) {\n this.lottieAnimation.destroy();\n this.lottieAnimation = undefined;\n }\n };\n\n private handleDownloadReceipt = async () => {\n try {\n await PDFGenerator.generateAndDownloadReceipt({\n paymentMethod:\n this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD\n ? this.textPaymentMethodCard()\n : this.paymentMethodName,\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && { bank: this.bank }),\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && {\n cardBrand: this.applyStartCaseToBrand(renewalState.data.cardInformation?.brand || ''),\n }),\n ...(this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && {\n cardLastFour: this.cardLastFour ?? renewalState.data.cardInformation?.lastFour,\n }),\n paymentDate: formatDateTime(this.getPaymentDate()) || '',\n email: renewalState.data.subscription.customerEmail || '',\n referenceNumber: this.referenceNumber,\n productTitle: renewalState.data.subscription.name[0]?.text || 'Subscription',\n subtotal: this.getFormattedSubtotal(),\n total: this.getFormattedTotal(),\n currency: (renewalState.data.price.currency as any) || ' ',\n discountAmount: this.getFormattedDiscountAmount(),\n trialPeriodDays: this.trialPeriodDays,\n debitDay: this.debitDay,\n planAmount: this.getFormattedSubtotal(this.planAmount),\n isBankTransfer: this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER,\n });\n } catch (error) {\n console.error('Error downloading receipt:', error);\n }\n };\n\n private getFormattedDiscountAmount = () => {\n // Para renewal, no hay descuentos por defecto\n return undefined;\n };\n\n private getFormattedSubtotal = (planAmount: number = 0 || null) => {\n return formatAmount(\n planAmount || renewalState.data.price.amount,\n renewalState.data.price.currency as any,\n );\n };\n\n private getFormattedTotal = () => {\n if (this.trialPeriodDays > 0) {\n return formatAmount(0, renewalState.data.price.currency as any);\n }\n return formatAmount(renewalState.data.price.amount, renewalState.data.price.currency as any);\n };\n\n private textPaymentMethodCard = () => {\n const cardBrand = renewalState.data?.cardInformation?.brand;\n const cardLastFour = this.cardLastFour || renewalState.data?.cardInformation?.lastFour;\n\n const formattedBrand = this.applyStartCaseToBrand(cardBrand || '');\n return cardBrand && cardLastFour ? `${formattedBrand} - ${cardLastFour}` : formattedBrand;\n };\n\n render() {\n return (\n <rebill-checkout-single-column>\n <div class=\"renewal-success-page__success-content\">\n <rebill-typography variant=\"h3\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.successTitle')}\n </rebill-typography>\n\n <div class=\"renewal-success-page__success-icon\">\n <svg\n width={isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) ? '64' : '96'}\n height={isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) ? '64' : '96'}\n viewBox=\"0 0 96 96\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z\"\n fill=\"#35B093\"\n />\n </svg>\n </div>\n\n {/* Payment Details Card */}\n <div class=\"renewal-success-page__info-card\">\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentMethod')}\n </rebill-typography>\n <div class=\"renewal-success-page__card-value\">\n <div class=\"renewal-success-page__payment-method-display\">\n {this.typePaymentMethod === PAYMENT_METHOD_ENUM.CARD && (\n <>\n <rebill-card-icon\n card-brand={renewalState.data?.cardInformation?.brand || ''}\n />\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.textPaymentMethodCard()}\n </rebill-typography>\n </>\n )}\n {this.typePaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER && (\n <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>\n <rebill-icon\n name={getPaymentMethodDisplayName(\n PAYMENT_METHOD_ENUM.BANK_TRANSFER,\n this.country,\n ).toLowerCase()}\n />\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('paymentMethods.bank_transfer')}\n </rebill-typography>\n </div>\n )}\n </div>\n </div>\n </div>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentDate')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {formatDateTime(this.paymentDate || this.getPaymentDate()) || ''}\n </rebill-typography>\n </div>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentEmail')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {renewalState.data.subscription.customerEmail}\n </rebill-typography>\n </div>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.paymentReference')}\n </rebill-typography>\n <rebill-typography\n variant=\"body2\"\n color={COLORS_ENUM.PRIMARY_DARK_TEXT}\n class=\"renewal-success-page__reference-number\"\n >\n {this.referenceNumber || ''}\n </rebill-typography>\n </div>\n </div>\n\n {/* Purchase Details Card */}\n <div class=\"renewal-success-page__info-card\">\n <rebill-typography variant=\"subtitle-bold\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.purchaseDetails')}\n </rebill-typography>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseDetail')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {renewalState.data.subscription.name[0]?.text || 'Subscription'}\n </rebill-typography>\n </div>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseSubtotal')}\n </rebill-typography>\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedSubtotal()}\n </rebill-typography>\n </div>\n <div class=\"renewal-success-page__card-row\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.purchaseMontoTotal')}\n </rebill-typography>\n <div class=\"renewal-success-page__total-amount-container\">\n <rebill-typography variant=\"body2\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {this.getFormattedTotal()}\n </rebill-typography>\n </div>\n </div>\n <div class=\"renewal-success-page__card-divider\"></div>\n <div class=\"renewal-success-page__download-container\">\n <svg\n class=\"download-icon\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <rebill-button\n type=\"button\"\n variant=\"download\"\n size=\"small\"\n onClick={this.handleDownloadReceipt}\n >\n <rebill-typography variant=\"overline\" color={COLORS_ENUM.PRIMARY_DARK_TEXT}>\n {I18nService.translate('processing.download')}\n </rebill-typography>\n </rebill-button>\n </div>\n\n {/* Contact Info */}\n <div class=\"renewal-success-page__contact-info\">\n <rebill-typography variant=\"information-text\" color={COLORS_ENUM.SECONDARY}>\n {I18nService.translate('processing.downloadDescription')}\n </rebill-typography>\n </div>\n </div>\n </div>\n </rebill-checkout-single-column>\n );\n }\n}\n",".wrapper {\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.header {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n}\n.title {\n font-size: 1rem;\n font-weight: 500;\n color: var(--rebill-color-primary-dark-text);\n text-align: center;\n}\n\n.amount {\n font-size: 2.25rem;\n font-weight: 500;\n color: var(--rebill-color-primary-dark-text);\n margin: 0 0 1.5rem 0;\n text-align: center;\n line-height: 1.1;\n}\n\n.per {\n font-size: 1.1rem;\n font-weight: 400;\n color: var(--rebill-color-text-secondary);\n}\n\n.label-muted {\n font-size: 1rem;\n color: var(--rebill-color-primary-dark);\n margin: 0 0 1.5rem 0;\n text-align: center;\n}\n\n.info {\n width: 100%;\n margin-top: 1.5rem;\n margin-bottom: 3rem;\n display: flex;\n flex-direction: column;\n gap: 1.4rem;\n}\n\n.row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1rem;\n line-height: 1.4;\n width: 100%;\n}\n\n.left {\n color: var(--rebill-color-text-secondary);\n font-weight: 400;\n}\n\n.right {\n color: var(--rebill-color-primary-dark-text);\n font-weight: 400;\n text-align: right;\n}\n\n.divider {\n border: none;\n border-top: 1px solid var(--rebill-color-border);\n margin: 1rem 0;\n}\n\n@media (max-width: 1024px) {\n .amount {\n margin-bottom: 0;\n }\n .row {\n font-size: 0.9rem;\n }\n .row:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n .left {\n color: var(--rebill-color-primary-dark-text);\n }\n}\n\n.total-row {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1.1rem;\n font-weight: 600;\n}\n\n.total-row .left {\n color: var(--rebill-color-primary-dark-text);\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport i18n from '../../../i18n/i18n.config';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { sessionState } from '../../../store/session.store';\nimport { formatAmount } from '../../../utils/currency-formatter';\nimport { formatDate as formatDateByLocale } from '../../../utils/date-formatter';\n\n@Component({\n tag: 'renewal-summary',\n styleUrl: 'renewal-summary.css',\n shadow: false,\n})\nexport class RenewalSummary {\n @State() private forceUpdate = 0;\n @Prop() displayedComponents: ('header' | 'details' | 'summary')[] = [\n 'header',\n 'details',\n 'summary',\n ];\n\n componentWillLoad() {\n i18n.on('languageChanged', this.handleLanguageChange);\n }\n\n disconnectedCallback() {\n i18n.off('languageChanged', this.handleLanguageChange);\n }\n\n private handleLanguageChange = () => {\n this.forceUpdate = this.forceUpdate + 1;\n };\n\n @Prop() totalAmount!: number | string;\n @Prop() subscriptionTitle!: string;\n @Prop() subscriptionAmount!: number | string;\n @Prop() nextChargeDate?: string;\n @Prop() frequency?: { count: number; period: string };\n @Prop() currency: string;\n\n private getFrequencyText(): string {\n if (!this.frequency || !this.frequency.period) return '';\n\n const period = this.frequency.period.toLowerCase();\n const count = this.frequency.count;\n\n const translationKey = `summary.${period}`;\n return I18nService.translate(translationKey, { count });\n }\n\n renderHeader = () => {\n return (\n <div class=\"header\">\n <p class=\"title\">{I18nService.translate('renewal.title')}</p>\n <p class=\"amount\">\n {formatAmount(this.totalAmount, this.currency)}{' '}\n <span class=\"per\">/ {this.getFrequencyText().toLowerCase()}</span>\n </p>\n </div>\n );\n };\n\n renderInfoRow = (label: string, value: string) => {\n return (\n <div class=\"row\">\n <div class=\"left\">{label}</div>\n <div class=\"right\">{value}</div>\n </div>\n );\n };\n\n renderProduct = () => {\n return this.renderInfoRow(\n this.subscriptionTitle,\n formatAmount(this.subscriptionAmount, this.currency),\n );\n };\n\n renderNextRenewal = () => {\n return this.renderInfoRow(\n I18nService.translate('renewal.nextRenewal'),\n formatDateByLocale(this.nextChargeDate, undefined, sessionState.currentLocale),\n );\n };\n\n renderSubtotal = () => {\n return this.renderInfoRow(\n I18nService.translate('renewal.subtotal'),\n formatAmount(this.totalAmount, this.currency),\n );\n };\n\n renderTotal = () => {\n return (\n <div class=\"total-row\">\n <div class=\"left\">{I18nService.translate('renewal.totalToRenew')}</div>\n <div class=\"right\">{formatAmount(this.totalAmount, this.currency)}</div>\n </div>\n );\n };\n\n renderDesktop = () => {\n return (\n <div class=\"wrapper\">\n {this.renderHeader()}\n <div class=\"info\">\n <div class=\"row\">\n <div class=\"\">{I18nService.translate('renewal.subscriptionDetails')}</div>\n </div>\n {this.renderProduct()}\n {this.renderNextRenewal()}\n {this.renderSubtotal()}\n </div>\n {this.renderTotal()}\n </div>\n );\n };\n\n render() {\n if (\n this.displayedComponents.includes('header') &&\n this.displayedComponents.includes('details') &&\n this.displayedComponents.includes('summary')\n ) {\n return this.renderDesktop();\n }\n if (this.displayedComponents.includes('header')) {\n return this.renderHeader();\n }\n if (this.displayedComponents.includes('details')) {\n return (\n <collapsible-card header={I18nService.translate('summary.details')}>\n {this.renderProduct()}\n {this.renderNextRenewal()}\n </collapsible-card>\n );\n }\n if (this.displayedComponents.includes('summary')) {\n return (\n <collapsible-card header={I18nService.translate('summary.summary')}>\n {this.renderInfoRow(\n this.subscriptionTitle,\n '1 x ' + formatAmount(this.subscriptionAmount, this.currency),\n )}\n {this.renderSubtotal()}\n <hr color=\"#F4F5F6\" />\n {this.renderInfoRow(\n I18nService.translate('renewal.totalToRenew'),\n formatAmount(this.totalAmount, this.currency),\n )}\n </collapsible-card>\n );\n }\n }\n}\n"],"mappings":"8dAAA,MAAMA,EAAwB,w3H,MCgBjBC,EAAkB,M,wEACrBC,kBAAyCC,EAAoBC,KAC7DC,QAAmB,GACnBC,KAAgB,GAChBC,kBAA6B,GAC7BC,aAAwB,GACxBC,YAAsB,GACtBC,gBAA0B,GAC1BC,gBAA2B,EAC3BC,SAAoB,EACpBC,WAAsB,EACrBC,cAAwB,KACxBC,WAA8BC,EAAgBC,QAE9CC,gBACAC,eAAyB,EACzBC,gBAA2B,KAC3BC,oBAA+B,MAChCC,eAAyB,IACzBC,iBACAC,gBAC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