rebill-web-components-sdk 1.8.13 → 1.8.15

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 (41) hide show
  1. package/dist/cjs/card-identification_5.cjs.entry.js +1 -1
  2. package/dist/cjs/{installment-utils-D4qKgjN9.js → installment-utils-CaZDiH-J.js} +10 -7
  3. package/dist/cjs/installment-utils-CaZDiH-J.js.map +1 -0
  4. package/dist/cjs/otp-component_7.cjs.entry.js +1 -1
  5. package/dist/collection/utils/installment-utils.js +8 -5
  6. package/dist/collection/utils/installment-utils.js.map +1 -1
  7. package/dist/components/card-fields-wrapper.js +1 -1
  8. package/dist/components/{p-Y1V1tI5U.js → p-BQYAXUmg.js} +11 -8
  9. package/dist/components/p-BQYAXUmg.js.map +1 -0
  10. package/dist/components/{p-DioD4ps1.js → p-BW4DxIWR.js} +4 -4
  11. package/dist/components/{p-DioD4ps1.js.map → p-BW4DxIWR.js.map} +1 -1
  12. package/dist/components/{p-Ds8iyCAd.js → p-CU82jZID.js} +3 -3
  13. package/dist/components/{p-Ds8iyCAd.js.map → p-CU82jZID.js.map} +1 -1
  14. package/dist/components/{p-BIat5a1z.js → p-D5G2GZlN.js} +3 -3
  15. package/dist/components/{p-BIat5a1z.js.map → p-D5G2GZlN.js.map} +1 -1
  16. package/dist/components/{p-CW7bdfSw.js → p-Sh874KyF.js} +3 -3
  17. package/dist/components/{p-CW7bdfSw.js.map → p-Sh874KyF.js.map} +1 -1
  18. package/dist/components/{p-DG3R157p.js → p-puDOAJZP.js} +3 -3
  19. package/dist/components/{p-DG3R157p.js.map → p-puDOAJZP.js.map} +1 -1
  20. package/dist/components/payment-method-selector.js +1 -1
  21. package/dist/components/rebill-checkout.js +5 -5
  22. package/dist/components/rebill-installments.js +1 -1
  23. package/dist/components/rebill-renewal.js +3 -3
  24. package/dist/components/rebill-summary.js +1 -1
  25. package/dist/components/success-page.js +1 -1
  26. package/dist/esm/card-identification_5.entry.js +1 -1
  27. package/dist/esm/{installment-utils-BCJJSszJ.js → installment-utils-CxQxVtur.js} +10 -7
  28. package/dist/esm/installment-utils-CxQxVtur.js.map +1 -0
  29. package/dist/esm/otp-component_7.entry.js +1 -1
  30. package/dist/rebill-web-components-sdk/{p-c41119c0.entry.js → p-91432c62.entry.js} +2 -2
  31. package/dist/rebill-web-components-sdk/{p-KStTLJ_c.js → p-DKzHMy1G.js} +2 -2
  32. package/dist/rebill-web-components-sdk/p-DKzHMy1G.js.map +1 -0
  33. package/dist/rebill-web-components-sdk/{p-7f487ad7.entry.js → p-ad9bd33b.entry.js} +2 -2
  34. package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
  35. package/package.json +9 -1
  36. package/dist/cjs/installment-utils-D4qKgjN9.js.map +0 -1
  37. package/dist/components/p-Y1V1tI5U.js.map +0 -1
  38. package/dist/esm/installment-utils-BCJJSszJ.js.map +0 -1
  39. package/dist/rebill-web-components-sdk/p-KStTLJ_c.js.map +0 -1
  40. /package/dist/rebill-web-components-sdk/{p-c41119c0.entry.js.map → p-91432c62.entry.js.map} +0 -0
  41. /package/dist/rebill-web-components-sdk/{p-7f487ad7.entry.js.map → p-ad9bd33b.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as e,h as r,c as o,g as t}from"./p-D8cwEAmw.js";import{a as i}from"./p-CTo1s54i.js";import{I as l,s,e as a,a as c,o as n}from"./p-CP6XOgmg.js";import{r as d,o as b,R as h}from"./p-DSucGJz2.js";import{g as p}from"./p-D339jHg4.js";import{c as f,d as u,E as m,e as g,b as y}from"./p-KStTLJ_c.js";import{C as x}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";const v=class{constructor(r){e(this,r)}documentTypes=[];country="";currentLanguage=l.getCurrentLanguage();documentTypeError="";documentNumberError="";disabled=false;loadDocumentTypes=async()=>{const e=d.isInitialized?d.data?.price?.country:s?.data?.pricing?.country;if(e&&e!==this.country){try{const r=await i.data.getDocumentTypes(e);this.documentTypes=r.data;this.country=e}catch(e){console.error("Error loading document types:",e)}}};async componentWillLoad(){a.on("languageChanged",this.handleLanguageChange);c.onChange("data",(()=>{if(!d.isInitialized){this.loadDocumentTypes()}}));b("data",(()=>{if(d.isInitialized){this.loadDocumentTypes()}}));await this.loadDocumentTypes()}handleInputChange=e=>{const{id:r,value:o}=e.detail;if(d.isInitialized){h.setUserIdentification({[r]:o})}else{c.setUserInformation({[r]:o})}};disconnectedCallback(){a.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=l.getCurrentLanguage()};render(){const e=this.documentTypeError||this.documentNumberError;const o=this.documentTypes.map((e=>({label:e.value,value:e.value})));return r(r.Fragment,null,r("rebill-input-combo",{key:"8674049058cbc284684869c31ac4de3b8fdcecc9","select-id":"documentType","input-id":"documentNumber","on-input":this.handleInputChange,"select-placeholder":l.translate("document.typePlaceholder"),"input-placeholder":l.translate("document.numberPlaceholder"),error:l.translate(e),options:o,disabled:this.disabled}))}};const k=class{constructor(r){e(this,r)}customCSS;iframeLoaded=false;currentLang=s.currentLocale;initialLang=s.currentLocale;iframeHeight="100px";getIframeURL(){const e=p().iframeURL;const r=new URL(e);r.searchParams.set("lang",this.initialLang);if(d.data?.subscription?.customerId&&d.token){r.searchParams.set("customerId",d.data.subscription.customerId);r.searchParams.set("token",d.token)}return r.toString()}iframeRef;unsubscribeCurrentLocaleStore;unsubscribeDataStore;unsubscribeRenewalStore;postInitialDataToIframe(){if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}this.postLanguageToIframe();this.postTotalPriceToIframe();this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}else{if(s.data?.organization?.id){this.postOrganizationIdToIframe(s.data.organization.id)}if(s?.currentLocale){this.postLanguageToIframe()}this.postTotalPriceToIframe();this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}this.postCustomCSSToIframe()}postTotalPriceToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){let e;if(d.isInitialized){e=d.data?.price?.amount||0}else{e=s.data?.pricing?.totalWithoutInstallment||0}this.iframeRef.contentWindow.postMessage({type:"SET_TOTAL_PRICE",payload:{total:e}},"*")}}postCustomerIdToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&d.data?.subscription?.customerId){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOMER_ID",payload:{customerId:d.data.subscription.customerId}},"*")}else if(this.iframeRef&&this.iframeRef.contentWindow&&s.data.customerId){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOMER_ID",payload:{customerId:s.data.customerId}},"*")}}postLanguageToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){this.iframeRef.contentWindow.postMessage({type:"SET_LANGUAGE",payload:{lang:this.currentLang}},"*")}}postOrganizationIdToIframe(e){if(!!this.iframeRef&&!!this.iframeRef.contentWindow){this.iframeRef.contentWindow.postMessage({type:"SET_ORGANIZATION_ID",payload:{organizationId:e}},"*")}}postTokenToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&d.token){this.iframeRef.contentWindow.postMessage({type:"SET_TOKEN",payload:{token:d.token}},"*")}else if(this.iframeRef&&this.iframeRef.contentWindow&&s.data.accessToken){this.iframeRef.contentWindow.postMessage({type:"SET_TOKEN",payload:{token:s.data.accessToken}},"*")}}postItemTypeToIframe(){if(!this.iframeRef||!this.iframeRef.contentWindow){return}if(d.isInitialized&&d.data?.subscription?.type){this.iframeRef.contentWindow.postMessage({type:"SET_ITEM_TYPE",payload:{itemType:d.data.subscription.type}},"*")}else if(s.data?.itemInformation?.type){this.iframeRef.contentWindow.postMessage({type:"SET_ITEM_TYPE",payload:{itemType:s.data.itemInformation.type}},"*")}}postCurrencyToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){let e;if(d.isInitialized){e=d.data?.price?.currency||""}else{e=s.data?.pricing?.currency||""}if(e){this.iframeRef.contentWindow.postMessage({type:"SET_CURRENCY",payload:{currency:e}},"*")}}}postCustomCSSToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&this.customCSS){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOM_CSS",payload:{css:this.customCSS}},"*")}}postClearCustomerIdToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&(!s.data.customerId||!s.data.accessToken)){this.iframeRef.contentWindow.postMessage({type:"CLEAR_CUSTOMER_ID_AND_TOKEN"},"*")}}componentWillLoad(){this.initialLang=s.currentLocale;this.unsubscribeCurrentLocaleStore=n("currentLocale",(()=>{this.currentLang=s.currentLocale;this.postLanguageToIframe()}));this.unsubscribeDataStore=n("data",(()=>{if(!d.isInitialized){if(s.data?.organization?.id){this.postOrganizationIdToIframe(s.data.organization.id)}if(s.data?.pricing?.totalWithoutInstallment!==undefined&&s.data?.pricing?.totalWithoutInstallment!==null){this.postTotalPriceToIframe()}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe();this.postClearCustomerIdToIframe()}}));this.unsubscribeRenewalStore=b("data",(()=>{if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}if(d.data?.price?.amount!==undefined){this.postTotalPriceToIframe()}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}}));setTimeout((()=>{this.postInitialDataToIframe()}),1e3)}componentWillUpdate(){if(this.iframeLoaded){this.postCustomCSSToIframe()}}componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore)this.unsubscribeCurrentLocaleStore();if(this.unsubscribeDataStore)this.unsubscribeDataStore();if(this.unsubscribeRenewalStore)this.unsubscribeRenewalStore();window.removeEventListener("message",this.handleIframeMessage)}handleIframeLoad=()=>{this.iframeLoaded=true;this.postLanguageToIframe();if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}this.postCustomCSSToIframe();setTimeout((()=>{this.postInitialDataToIframe()}),500)};handleIframeMessage=e=>{if(e.data&&e.data.type==="IFRAME_HEIGHT"&&e.data.payload&&typeof e.data.payload.height==="number"){this.iframeHeight=`${e.data.payload.height}px`}if(e.data&&e.data.type==="FORM_STATE"){if(d.isInitialized){if(!e.data.payload?.complete){h.setCardId(null);h.setCardTokenId(null)}}else if(s.isInitialized){if(!e.data.payload?.complete){c.setCardId(null);c.setCardTokenId(null)}}}if(e.data&&e.data.type==="INSTALLMENTS"&&e.data.payload){if(d.isInitialized){h.setCardInformation(e.data.payload)}else{c.setCardInformation(e.data.payload)}}if(e.data&&e.data.type==="CARD_TOKENIZED"){if(d.isInitialized){h.setCardTokenId(e.data?.payload?.token)}else if(s.isInitialized){c.setCardTokenId(e.data?.payload?.token)}}if(e.data&&e.data.type==="CARD_ID"){if(d.isInitialized){h.setCardId(e.data.payload?.id)}else if(s.isInitialized){c.setCardId(e.data.payload?.id)}}if(e.data&&e.data.type==="SAVE_CARD"){if(s.isInitialized){c.setSaveCard(e.data.payload?.saveCard)}}if(e.data&&e.data.type==="FETCHING_INSTALLMENTS"){const r=e.data.payload?.fetching||false;if(d.isInitialized){h.setFetchingInstallments(r)}else if(s.isInitialized){c.setFetchingInstallments(r)}}if(e.data&&e.data.type==="NEW_CARD_MODE"){const r=e.data.payload?.mode;if(r&&(r==="input"||r==="select")){if(d.isInitialized){h.setCardMode(r)}else if(s.isInitialized){c.setCardMode(r)}}}};render(){return r("div",{key:"b28640a8e570d298b1f8109a08b1b20dd18a12f8",style:{width:"100%",height:this.iframeHeight,position:"relative",overflow:"hidden"}},!this.iframeLoaded&&r("card-skeleton",{key:"3a3bfa83c0bb0109d3a0d891b4a95d1ef120053c"}),r("iframe",{key:"f8623c6cddc37c8fc1a2ad93c1a29ab6c9c15a93",ref:e=>this.iframeRef=e,src:this.getIframeURL(),style:{width:"100%",height:"100%",border:"none",overflow:"hidden"},title:"Card Payment Component",allow:"payment",onLoad:this.handleIframeLoad}))}};const w=":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}.iframe-skeleton{display:flex;flex-direction:column;gap:16px}.input-skeleton{width:100%;height:40px;background:var(--rebill-color-border-primary);border-radius:8px;border:1px solid var(--rebill-color-border-primary)}";const T=class{constructor(r){e(this,r)}render(){return r("div",{key:"1e18aa1c68fcbeb09523cf2f6f0a1099cf8381ea",class:"iframe-skeleton"},r("div",{key:"1ad5c58df5b64cf8c3fc85a0be3fd5638faa606d",class:"input-skeleton"}),r("div",{key:"321ff1c40c3cfaee21d3e6870151fe9d717dcd8c",class:"input-skeleton"}))}};T.style=w;const I=".input-container{display:flex;flex-direction:column}.input-label{font-size:0.875rem;color:var(--rebill-color-text-primary);font-weight:500;margin-bottom:0.375rem}.input-label.disabled{cursor:not-allowed}.input-element{border-radius:var(--input-group-inner-border-radius, 8px);border:1.5px solid var(--rebill-color-border);padding:10px 14px;font-size:0.875rem;color:var(--rebill-color-text-primary);outline:none;transition:border-color 0.2s;background:var(--rebill-color-background);height:38.33px;box-sizing:border-box}.input-element.input-error{border-color:var(--rebill-color-error)}.input-element:disabled{background-color:var(--rebill-color-background);border-color:var(--rebill-color-disabled);color:var(--rebill-color-text-secondary);cursor:not-allowed;opacity:0.7}select.input-element{padding:10px 30px 10px 14px;appearance:none;cursor:pointer}select.input-element:disabled{cursor:not-allowed}.input-element:focus{border-color:var(--rebill-color-primary)}.input-element:disabled:focus{border-color:var(--rebill-color-disabled)}.input-element::placeholder{color:var(--rebill-color-text-secondary-light);font-size:0.875rem;opacity:1}.select-wrapper.disabled .select-icon{color:var(--rebill-color-disabled)}.error-message{color:var(--rebill-color-error);font-size:0.75rem;margin-top:0.375rem}:host{display:block;width:100%;box-sizing:border-box}.combo-wrapper{display:flex;align-items:stretch;width:100%;height:38.33px;border-radius:var(--input-group-inner-border-radius, 8px);border:1.5px solid var(--rebill-color-border);background:var(--rebill-color-background);transition:border-color 0.2s;position:relative;box-sizing:border-box}.combo-wrapper:focus-within{border-color:var(--rebill-color-primary);box-shadow:0 0 0 2px var(--rebill-color-primary-light)}.combo-wrapper.error{border-color:var(--rebill-color-error)}.combo-wrapper.disabled{background-color:var(--rebill-color-background);border-color:var(--rebill-color-disabled);color:var(--rebill-color-text-secondary);cursor:not-allowed;opacity:0.7}.select-section{position:relative;flex-shrink:0;min-width:80px;display:flex;align-items:center}.select-combo-trigger{width:100%;height:100%;padding:0 30px 0 14px;font-size:0.875rem;font-weight:normal;color:var(--rebill-color-text-primary);background:transparent;border:none;outline:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;user-select:none;box-sizing:border-box;position:relative;transition:border-color 0.2s}.select-combo-trigger:focus{outline:none}.select-combo-trigger:hover:not(.disabled){border-color:var(--rebill-color-primary)}.select-combo-trigger.placeholder .select-value{color:var(--rebill-color-text-secondary-light)}.combo-wrapper.disabled .select-combo-trigger{cursor:not-allowed;color:var(--rebill-color-text-secondary)}.select-value{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-section .icon-wrapper{position:absolute;right:0.75rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;height:20px;width:20px}.select-icon{color:var(--rebill-color-text-secondary);transition:transform 0.2s ease;transform-origin:50% 50%;display:block}.combo-wrapper.disabled .select-icon{color:var(--rebill-color-disabled)}.select-dropdown{position:absolute;top:100%;left:0;right:0;z-index:1000;background-color:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:0.375rem;box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1),\n 0 2px 4px -1px rgba(0, 0, 0, 0.06);margin-top:0.25rem;max-height:200px;overflow-y:auto;animation:slideDown 0.15s ease-out;box-sizing:border-box;width:100%}.select-option{padding:0.75rem;font-size:0.875rem;color:var(--rebill-color-text-primary);cursor:pointer;border-bottom:1px solid var(--rebill-color-border);transition:background-color 0.15s ease}.select-option:last-child{border-bottom:none}.select-option:hover,.select-option.highlighted{background-color:#f0f9ff}.select-option.selected{background-color:var(--rebill-color-primary);color:white}.select-option.selected:hover,.select-option.selected.highlighted{background-color:var(--rebill-color-primary)}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-track{background:transparent}.select-dropdown::-webkit-scrollbar-thumb{background-color:var(--rebill-color-border);border-radius:3px}.select-dropdown::-webkit-scrollbar-thumb:hover{background-color:var(--rebill-color-text-secondary)}.combo-divider{width:1px;background-color:var(--rebill-color-border);margin:0;flex-shrink:0}.input-section{flex:1;min-width:0;display:flex;align-items:center}.combo-input{width:100%;height:100%;padding:0 14px;font-size:0.875rem;color:var(--rebill-color-text-primary);background:transparent;border:none;outline:none;box-sizing:border-box}.combo-input:focus{outline:none}.combo-input::placeholder{color:var(--rebill-color-text-secondary-light);font-size:0.875rem;opacity:1}.combo-wrapper.disabled .combo-input{color:var(--rebill-color-text-secondary);cursor:not-allowed}.combo-wrapper.disabled .combo-input::placeholder{color:var(--rebill-color-text-secondary)}@keyframes slideDown{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-track{background:transparent}.select-dropdown::-webkit-scrollbar-thumb{background-color:var(--rebill-color-border);border-radius:3px}.select-dropdown::-webkit-scrollbar-thumb:hover{background-color:var(--rebill-color-text-secondary)}";const E=class{constructor(r){e(this,r);this.blur=o(this,"blur");this.selectChange=o(this,"selectChange");this.input=o(this,"input")}dropdownRef;triggerRef;label="";options=[];selectValue="";inputValue="";inputPlaceholder="";selectPlaceholder="";error="";selectId="";inputId="";disabled=false;selectWidth="120px";isOpen=false;highlightedIndex=-1;componentId="";blur;selectChange;input;componentWillLoad(){this.componentId=this.selectId||`combo-${Math.random().toString(36).substr(2,9)}`}handleFormChange(e){const r=e.detail;if(r){if(this.selectId&&this.selectId in r){const e=r[this.selectId];if(typeof e==="string"){this.selectValue=e}}if(this.inputId&&this.inputId in r){const e=r[this.inputId];if(typeof e==="string"){this.inputValue=e}}}}handleCloseAllSelects(e){if(e.detail!==this.componentId){this.closeDropdown()}}handleDocumentClick(e){if(this.dropdownRef&&this.triggerRef&&!this.dropdownRef.contains(e.target)&&!this.triggerRef.contains(e.target)){this.closeDropdown()}}toggleDropdown=()=>{if(this.disabled)return;const e=this.isOpen;this.isOpen=!this.isOpen;if(this.isOpen){if(!e){document.dispatchEvent(new CustomEvent("closeAllSelects",{detail:this.componentId}))}this.highlightedIndex=this.options.findIndex((e=>e.value===this.selectValue));if(this.highlightedIndex===-1){this.highlightedIndex=0}}};openDropdown=()=>{if(this.disabled)return;document.dispatchEvent(new CustomEvent("closeAllSelects",{detail:this.componentId}));this.isOpen=true;this.highlightedIndex=this.options.findIndex((e=>e.value===this.selectValue));if(this.highlightedIndex===-1){this.highlightedIndex=0}};closeDropdown=()=>{this.isOpen=false;this.highlightedIndex=-1};selectOption=e=>{if(this.disabled)return;this.selectValue=e.value;this.closeDropdown();this.input.emit({id:this.selectId,value:this.selectValue})};onInputChange=e=>{if(this.disabled)return;const r=e.target;this.inputValue=r.value;this.input.emit({id:this.inputId,value:this.inputValue})};onSelectBlur=()=>{this.blur.emit({id:this.selectId,value:this.selectValue})};onInputBlur=()=>{const e=this.inputValue.trim();if(e!==this.inputValue){this.inputValue=e;this.input.emit({id:this.inputId,value:this.inputValue})}this.blur.emit({id:this.inputId,value:this.inputValue})};handleKeyDown=e=>{if(this.disabled)return;switch(e.key){case"Enter":case" ":e.preventDefault();if(this.isOpen&&this.highlightedIndex>=0){this.selectOption(this.options[this.highlightedIndex])}else{this.toggleDropdown()}break;case"Escape":e.preventDefault();this.closeDropdown();break;case"ArrowDown":e.preventDefault();if(!this.isOpen){this.openDropdown()}else{this.highlightedIndex=Math.min(this.highlightedIndex+1,this.options.length-1)}break;case"ArrowUp":e.preventDefault();if(this.isOpen){this.highlightedIndex=Math.max(this.highlightedIndex-1,0)}break}};getSelectedOptionLabel=()=>{const e=this.options.find((e=>e.value===this.selectValue));return e?e.label:this.selectPlaceholder};render(){const e=this.getSelectedOptionLabel();const o=this.selectValue!=="";return r("div",{key:"39848fbd98d3a34521523fccdcdcd03873a01691",class:"input-container"},this.label&&r("label",{key:"53c269f86e4a87fa4eb4befaa12db92babac0bf9",class:`input-label ${this.disabled?"disabled":""}`},this.label),r("div",{key:"919e8e8c5ce3eb62732e530977dc6fd46ef9a710",class:`input-combo-wrapper combo-wrapper ${this.disabled?"disabled":""} ${this.error?"error":""}`},r("div",{key:"d8091d176ebdd7cf3d1fd7c9a807c4ef619b0015",class:"select-section",style:{width:this.selectWidth}},r("div",{key:"84cedc0716d01d48c8dd06888b5ba49672b1d210",ref:e=>this.triggerRef=e,class:`input-combo-select select-combo-trigger ${!o?"placeholder":""}`,onClick:this.toggleDropdown,onKeyDown:this.handleKeyDown,onBlur:this.onSelectBlur,tabIndex:this.disabled?-1:0,role:"combobox","aria-expanded":this.isOpen.toString(),"aria-haspopup":"listbox"},r("span",{key:"0d4da045a1cbc67e9a93147e98221e58fc0b51d1",class:"select-value"},e),r("div",{key:"6c63e9286e2713328febbc1a66d06cd9d81beb55",class:"icon-wrapper"},r("rebill-icon",{key:"13c3c0ab0d94dc2c7a8c7db782b4d8170bdd33fc",name:"chevron-up-down",size:"20px",class:"select-icon"}))),this.isOpen&&r("div",{key:"889b4816dfbb835fc6d431060b47c56c2fcfefc7",ref:e=>this.dropdownRef=e,class:"select-dropdown",role:"listbox"},this.options.map(((e,o)=>r("div",{class:`select-option ${this.selectValue===e.value?"selected":""} ${this.highlightedIndex===o?"highlighted":""}`,onClick:()=>this.selectOption(e),role:"option","aria-selected":this.selectValue===e.value?"true":"false"},e.label))))),r("div",{key:"5536121c34638cfb3acbe0ee411b712d1bba9c66",class:"combo-divider"}),r("div",{key:"df4334ff14c32559e429e7d7126188dcbd5256d1",class:"input-section"},r("input",{key:"28d580f027d3844a6d0d17a22d69d624fe1f54a0",type:"text",class:"input-combo-element combo-input",placeholder:this.inputPlaceholder,value:this.inputValue,onInput:this.onInputChange,onBlur:this.onInputBlur,disabled:this.disabled}))),this.error&&r("span",{key:"fb0acb0be7980dca2ee0c4f57113cc95bbfdb1d7",class:"error-message"},this.error))}};E.style=I;const C="";const S=class{constructor(r){e(this,r)}get el(){return t(this)}error;currentValue=null;isDisabled=false;value=null;placeholder=null;handleInstallments=e=>{if(this.isDisabled){const e=new CustomEvent("input",{detail:{id:"installments",value:"",disabled:true},bubbles:true});this.el.dispatchEvent(e);return}this.currentValue=e.detail.value;c.setSelectedInstallment(e.detail.value)};componentWillLoad(){c.onChange("data",(()=>{this.isDisabled=!s.data.cardInformation?.installments?.isAvailableInstallments;this.placeholder=!s.data.cardInformation?.installments?.isAvailableInstallments?f(s.data.pricing?.currency):u(s.data.pricing?.currency);this.value=this.isDisabled?"":this.value;if(this.isDisabled){const e=new CustomEvent("input",{detail:{id:"installments",value:"",disabled:true},bubbles:true});this.el.dispatchEvent(e)}}))}render(){return r("div",{key:"30a65486392b49310154f7b7d05fd03f5285988f"},r("rebill-input-select",{key:this.isDisabled.toString(),id:"installments",variant:"outlined",value:this.value,options:s.data.cardInformation?.installments?.installments.map((e=>({label:g(e.installment,y(e.installmentAmount),s.data.pricing?.currency,e.cft,e.model),value:e?.installment?.toString()})))||[],loading:s.data.fetchingInstallments,placeholder:this.placeholder,disabled:this.isDisabled,"on-input":this.handleInstallments,error:l.translate(this.error)}),s.data.cardInformation?.installments?.installments.find((e=>e.installment===s.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===m.CUSTOMER_FINANCED&&r("rebill-typography",{key:"62e4bb9ef93b4480c2bdd01fb9382980d4254352",variant:"italic",color:x.SECONDARY},l.translate("installments.interest")))}};S.style=C;export{v as card_identification,k as card_iframe,T as card_skeleton,E as rebill_input_combo,S as rebill_installments};
2
- //# sourceMappingURL=p-7f487ad7.entry.js.map
1
+ import{r as e,h as r,c as o,g as t}from"./p-D8cwEAmw.js";import{a as i}from"./p-CTo1s54i.js";import{I as l,s,e as a,a as c,o as n}from"./p-CP6XOgmg.js";import{r as d,o as b,R as h}from"./p-DSucGJz2.js";import{g as p}from"./p-D339jHg4.js";import{c as f,d as u,E as m,e as g,b as y}from"./p-DKzHMy1G.js";import{C as x}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";const v=class{constructor(r){e(this,r)}documentTypes=[];country="";currentLanguage=l.getCurrentLanguage();documentTypeError="";documentNumberError="";disabled=false;loadDocumentTypes=async()=>{const e=d.isInitialized?d.data?.price?.country:s?.data?.pricing?.country;if(e&&e!==this.country){try{const r=await i.data.getDocumentTypes(e);this.documentTypes=r.data;this.country=e}catch(e){console.error("Error loading document types:",e)}}};async componentWillLoad(){a.on("languageChanged",this.handleLanguageChange);c.onChange("data",(()=>{if(!d.isInitialized){this.loadDocumentTypes()}}));b("data",(()=>{if(d.isInitialized){this.loadDocumentTypes()}}));await this.loadDocumentTypes()}handleInputChange=e=>{const{id:r,value:o}=e.detail;if(d.isInitialized){h.setUserIdentification({[r]:o})}else{c.setUserInformation({[r]:o})}};disconnectedCallback(){a.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=l.getCurrentLanguage()};render(){const e=this.documentTypeError||this.documentNumberError;const o=this.documentTypes.map((e=>({label:e.value,value:e.value})));return r(r.Fragment,null,r("rebill-input-combo",{key:"8674049058cbc284684869c31ac4de3b8fdcecc9","select-id":"documentType","input-id":"documentNumber","on-input":this.handleInputChange,"select-placeholder":l.translate("document.typePlaceholder"),"input-placeholder":l.translate("document.numberPlaceholder"),error:l.translate(e),options:o,disabled:this.disabled}))}};const k=class{constructor(r){e(this,r)}customCSS;iframeLoaded=false;currentLang=s.currentLocale;initialLang=s.currentLocale;iframeHeight="100px";getIframeURL(){const e=p().iframeURL;const r=new URL(e);r.searchParams.set("lang",this.initialLang);if(d.data?.subscription?.customerId&&d.token){r.searchParams.set("customerId",d.data.subscription.customerId);r.searchParams.set("token",d.token)}return r.toString()}iframeRef;unsubscribeCurrentLocaleStore;unsubscribeDataStore;unsubscribeRenewalStore;postInitialDataToIframe(){if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}this.postLanguageToIframe();this.postTotalPriceToIframe();this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}else{if(s.data?.organization?.id){this.postOrganizationIdToIframe(s.data.organization.id)}if(s?.currentLocale){this.postLanguageToIframe()}this.postTotalPriceToIframe();this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}this.postCustomCSSToIframe()}postTotalPriceToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){let e;if(d.isInitialized){e=d.data?.price?.amount||0}else{e=s.data?.pricing?.totalWithoutInstallment||0}this.iframeRef.contentWindow.postMessage({type:"SET_TOTAL_PRICE",payload:{total:e}},"*")}}postCustomerIdToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&d.data?.subscription?.customerId){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOMER_ID",payload:{customerId:d.data.subscription.customerId}},"*")}else if(this.iframeRef&&this.iframeRef.contentWindow&&s.data.customerId){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOMER_ID",payload:{customerId:s.data.customerId}},"*")}}postLanguageToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){this.iframeRef.contentWindow.postMessage({type:"SET_LANGUAGE",payload:{lang:this.currentLang}},"*")}}postOrganizationIdToIframe(e){if(!!this.iframeRef&&!!this.iframeRef.contentWindow){this.iframeRef.contentWindow.postMessage({type:"SET_ORGANIZATION_ID",payload:{organizationId:e}},"*")}}postTokenToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&d.token){this.iframeRef.contentWindow.postMessage({type:"SET_TOKEN",payload:{token:d.token}},"*")}else if(this.iframeRef&&this.iframeRef.contentWindow&&s.data.accessToken){this.iframeRef.contentWindow.postMessage({type:"SET_TOKEN",payload:{token:s.data.accessToken}},"*")}}postItemTypeToIframe(){if(!this.iframeRef||!this.iframeRef.contentWindow){return}if(d.isInitialized&&d.data?.subscription?.type){this.iframeRef.contentWindow.postMessage({type:"SET_ITEM_TYPE",payload:{itemType:d.data.subscription.type}},"*")}else if(s.data?.itemInformation?.type){this.iframeRef.contentWindow.postMessage({type:"SET_ITEM_TYPE",payload:{itemType:s.data.itemInformation.type}},"*")}}postCurrencyToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow){let e;if(d.isInitialized){e=d.data?.price?.currency||""}else{e=s.data?.pricing?.currency||""}if(e){this.iframeRef.contentWindow.postMessage({type:"SET_CURRENCY",payload:{currency:e}},"*")}}}postCustomCSSToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&this.customCSS){this.iframeRef.contentWindow.postMessage({type:"SET_CUSTOM_CSS",payload:{css:this.customCSS}},"*")}}postClearCustomerIdToIframe(){if(this.iframeRef&&this.iframeRef.contentWindow&&(!s.data.customerId||!s.data.accessToken)){this.iframeRef.contentWindow.postMessage({type:"CLEAR_CUSTOMER_ID_AND_TOKEN"},"*")}}componentWillLoad(){this.initialLang=s.currentLocale;this.unsubscribeCurrentLocaleStore=n("currentLocale",(()=>{this.currentLang=s.currentLocale;this.postLanguageToIframe()}));this.unsubscribeDataStore=n("data",(()=>{if(!d.isInitialized){if(s.data?.organization?.id){this.postOrganizationIdToIframe(s.data.organization.id)}if(s.data?.pricing?.totalWithoutInstallment!==undefined&&s.data?.pricing?.totalWithoutInstallment!==null){this.postTotalPriceToIframe()}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe();this.postClearCustomerIdToIframe()}}));this.unsubscribeRenewalStore=b("data",(()=>{if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}if(d.data?.price?.amount!==undefined){this.postTotalPriceToIframe()}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}}));setTimeout((()=>{this.postInitialDataToIframe()}),1e3)}componentWillUpdate(){if(this.iframeLoaded){this.postCustomCSSToIframe()}}componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore)this.unsubscribeCurrentLocaleStore();if(this.unsubscribeDataStore)this.unsubscribeDataStore();if(this.unsubscribeRenewalStore)this.unsubscribeRenewalStore();window.removeEventListener("message",this.handleIframeMessage)}handleIframeLoad=()=>{this.iframeLoaded=true;this.postLanguageToIframe();if(d.isInitialized){if(d.data?.organization?.id){this.postOrganizationIdToIframe(d.data.organization.id)}this.postCurrencyToIframe();this.postCustomerIdToIframe();this.postTokenToIframe();this.postItemTypeToIframe()}this.postCustomCSSToIframe();setTimeout((()=>{this.postInitialDataToIframe()}),500)};handleIframeMessage=e=>{if(e.data&&e.data.type==="IFRAME_HEIGHT"&&e.data.payload&&typeof e.data.payload.height==="number"){this.iframeHeight=`${e.data.payload.height}px`}if(e.data&&e.data.type==="FORM_STATE"){if(d.isInitialized){if(!e.data.payload?.complete){h.setCardId(null);h.setCardTokenId(null)}}else if(s.isInitialized){if(!e.data.payload?.complete){c.setCardId(null);c.setCardTokenId(null)}}}if(e.data&&e.data.type==="INSTALLMENTS"&&e.data.payload){if(d.isInitialized){h.setCardInformation(e.data.payload)}else{c.setCardInformation(e.data.payload)}}if(e.data&&e.data.type==="CARD_TOKENIZED"){if(d.isInitialized){h.setCardTokenId(e.data?.payload?.token)}else if(s.isInitialized){c.setCardTokenId(e.data?.payload?.token)}}if(e.data&&e.data.type==="CARD_ID"){if(d.isInitialized){h.setCardId(e.data.payload?.id)}else if(s.isInitialized){c.setCardId(e.data.payload?.id)}}if(e.data&&e.data.type==="SAVE_CARD"){if(s.isInitialized){c.setSaveCard(e.data.payload?.saveCard)}}if(e.data&&e.data.type==="FETCHING_INSTALLMENTS"){const r=e.data.payload?.fetching||false;if(d.isInitialized){h.setFetchingInstallments(r)}else if(s.isInitialized){c.setFetchingInstallments(r)}}if(e.data&&e.data.type==="NEW_CARD_MODE"){const r=e.data.payload?.mode;if(r&&(r==="input"||r==="select")){if(d.isInitialized){h.setCardMode(r)}else if(s.isInitialized){c.setCardMode(r)}}}};render(){return r("div",{key:"b28640a8e570d298b1f8109a08b1b20dd18a12f8",style:{width:"100%",height:this.iframeHeight,position:"relative",overflow:"hidden"}},!this.iframeLoaded&&r("card-skeleton",{key:"3a3bfa83c0bb0109d3a0d891b4a95d1ef120053c"}),r("iframe",{key:"f8623c6cddc37c8fc1a2ad93c1a29ab6c9c15a93",ref:e=>this.iframeRef=e,src:this.getIframeURL(),style:{width:"100%",height:"100%",border:"none",overflow:"hidden"},title:"Card Payment Component",allow:"payment",onLoad:this.handleIframeLoad}))}};const w=":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}.iframe-skeleton{display:flex;flex-direction:column;gap:16px}.input-skeleton{width:100%;height:40px;background:var(--rebill-color-border-primary);border-radius:8px;border:1px solid var(--rebill-color-border-primary)}";const T=class{constructor(r){e(this,r)}render(){return r("div",{key:"1e18aa1c68fcbeb09523cf2f6f0a1099cf8381ea",class:"iframe-skeleton"},r("div",{key:"1ad5c58df5b64cf8c3fc85a0be3fd5638faa606d",class:"input-skeleton"}),r("div",{key:"321ff1c40c3cfaee21d3e6870151fe9d717dcd8c",class:"input-skeleton"}))}};T.style=w;const I=".input-container{display:flex;flex-direction:column}.input-label{font-size:0.875rem;color:var(--rebill-color-text-primary);font-weight:500;margin-bottom:0.375rem}.input-label.disabled{cursor:not-allowed}.input-element{border-radius:var(--input-group-inner-border-radius, 8px);border:1.5px solid var(--rebill-color-border);padding:10px 14px;font-size:0.875rem;color:var(--rebill-color-text-primary);outline:none;transition:border-color 0.2s;background:var(--rebill-color-background);height:38.33px;box-sizing:border-box}.input-element.input-error{border-color:var(--rebill-color-error)}.input-element:disabled{background-color:var(--rebill-color-background);border-color:var(--rebill-color-disabled);color:var(--rebill-color-text-secondary);cursor:not-allowed;opacity:0.7}select.input-element{padding:10px 30px 10px 14px;appearance:none;cursor:pointer}select.input-element:disabled{cursor:not-allowed}.input-element:focus{border-color:var(--rebill-color-primary)}.input-element:disabled:focus{border-color:var(--rebill-color-disabled)}.input-element::placeholder{color:var(--rebill-color-text-secondary-light);font-size:0.875rem;opacity:1}.select-wrapper.disabled .select-icon{color:var(--rebill-color-disabled)}.error-message{color:var(--rebill-color-error);font-size:0.75rem;margin-top:0.375rem}:host{display:block;width:100%;box-sizing:border-box}.combo-wrapper{display:flex;align-items:stretch;width:100%;height:38.33px;border-radius:var(--input-group-inner-border-radius, 8px);border:1.5px solid var(--rebill-color-border);background:var(--rebill-color-background);transition:border-color 0.2s;position:relative;box-sizing:border-box}.combo-wrapper:focus-within{border-color:var(--rebill-color-primary);box-shadow:0 0 0 2px var(--rebill-color-primary-light)}.combo-wrapper.error{border-color:var(--rebill-color-error)}.combo-wrapper.disabled{background-color:var(--rebill-color-background);border-color:var(--rebill-color-disabled);color:var(--rebill-color-text-secondary);cursor:not-allowed;opacity:0.7}.select-section{position:relative;flex-shrink:0;min-width:80px;display:flex;align-items:center}.select-combo-trigger{width:100%;height:100%;padding:0 30px 0 14px;font-size:0.875rem;font-weight:normal;color:var(--rebill-color-text-primary);background:transparent;border:none;outline:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;user-select:none;box-sizing:border-box;position:relative;transition:border-color 0.2s}.select-combo-trigger:focus{outline:none}.select-combo-trigger:hover:not(.disabled){border-color:var(--rebill-color-primary)}.select-combo-trigger.placeholder .select-value{color:var(--rebill-color-text-secondary-light)}.combo-wrapper.disabled .select-combo-trigger{cursor:not-allowed;color:var(--rebill-color-text-secondary)}.select-value{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-section .icon-wrapper{position:absolute;right:0.75rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;height:20px;width:20px}.select-icon{color:var(--rebill-color-text-secondary);transition:transform 0.2s ease;transform-origin:50% 50%;display:block}.combo-wrapper.disabled .select-icon{color:var(--rebill-color-disabled)}.select-dropdown{position:absolute;top:100%;left:0;right:0;z-index:1000;background-color:var(--rebill-color-background);border:1px solid var(--rebill-color-border);border-radius:0.375rem;box-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1),\n 0 2px 4px -1px rgba(0, 0, 0, 0.06);margin-top:0.25rem;max-height:200px;overflow-y:auto;animation:slideDown 0.15s ease-out;box-sizing:border-box;width:100%}.select-option{padding:0.75rem;font-size:0.875rem;color:var(--rebill-color-text-primary);cursor:pointer;border-bottom:1px solid var(--rebill-color-border);transition:background-color 0.15s ease}.select-option:last-child{border-bottom:none}.select-option:hover,.select-option.highlighted{background-color:#f0f9ff}.select-option.selected{background-color:var(--rebill-color-primary);color:white}.select-option.selected:hover,.select-option.selected.highlighted{background-color:var(--rebill-color-primary)}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-track{background:transparent}.select-dropdown::-webkit-scrollbar-thumb{background-color:var(--rebill-color-border);border-radius:3px}.select-dropdown::-webkit-scrollbar-thumb:hover{background-color:var(--rebill-color-text-secondary)}.combo-divider{width:1px;background-color:var(--rebill-color-border);margin:0;flex-shrink:0}.input-section{flex:1;min-width:0;display:flex;align-items:center}.combo-input{width:100%;height:100%;padding:0 14px;font-size:0.875rem;color:var(--rebill-color-text-primary);background:transparent;border:none;outline:none;box-sizing:border-box}.combo-input:focus{outline:none}.combo-input::placeholder{color:var(--rebill-color-text-secondary-light);font-size:0.875rem;opacity:1}.combo-wrapper.disabled .combo-input{color:var(--rebill-color-text-secondary);cursor:not-allowed}.combo-wrapper.disabled .combo-input::placeholder{color:var(--rebill-color-text-secondary)}@keyframes slideDown{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-track{background:transparent}.select-dropdown::-webkit-scrollbar-thumb{background-color:var(--rebill-color-border);border-radius:3px}.select-dropdown::-webkit-scrollbar-thumb:hover{background-color:var(--rebill-color-text-secondary)}";const E=class{constructor(r){e(this,r);this.blur=o(this,"blur");this.selectChange=o(this,"selectChange");this.input=o(this,"input")}dropdownRef;triggerRef;label="";options=[];selectValue="";inputValue="";inputPlaceholder="";selectPlaceholder="";error="";selectId="";inputId="";disabled=false;selectWidth="120px";isOpen=false;highlightedIndex=-1;componentId="";blur;selectChange;input;componentWillLoad(){this.componentId=this.selectId||`combo-${Math.random().toString(36).substr(2,9)}`}handleFormChange(e){const r=e.detail;if(r){if(this.selectId&&this.selectId in r){const e=r[this.selectId];if(typeof e==="string"){this.selectValue=e}}if(this.inputId&&this.inputId in r){const e=r[this.inputId];if(typeof e==="string"){this.inputValue=e}}}}handleCloseAllSelects(e){if(e.detail!==this.componentId){this.closeDropdown()}}handleDocumentClick(e){if(this.dropdownRef&&this.triggerRef&&!this.dropdownRef.contains(e.target)&&!this.triggerRef.contains(e.target)){this.closeDropdown()}}toggleDropdown=()=>{if(this.disabled)return;const e=this.isOpen;this.isOpen=!this.isOpen;if(this.isOpen){if(!e){document.dispatchEvent(new CustomEvent("closeAllSelects",{detail:this.componentId}))}this.highlightedIndex=this.options.findIndex((e=>e.value===this.selectValue));if(this.highlightedIndex===-1){this.highlightedIndex=0}}};openDropdown=()=>{if(this.disabled)return;document.dispatchEvent(new CustomEvent("closeAllSelects",{detail:this.componentId}));this.isOpen=true;this.highlightedIndex=this.options.findIndex((e=>e.value===this.selectValue));if(this.highlightedIndex===-1){this.highlightedIndex=0}};closeDropdown=()=>{this.isOpen=false;this.highlightedIndex=-1};selectOption=e=>{if(this.disabled)return;this.selectValue=e.value;this.closeDropdown();this.input.emit({id:this.selectId,value:this.selectValue})};onInputChange=e=>{if(this.disabled)return;const r=e.target;this.inputValue=r.value;this.input.emit({id:this.inputId,value:this.inputValue})};onSelectBlur=()=>{this.blur.emit({id:this.selectId,value:this.selectValue})};onInputBlur=()=>{const e=this.inputValue.trim();if(e!==this.inputValue){this.inputValue=e;this.input.emit({id:this.inputId,value:this.inputValue})}this.blur.emit({id:this.inputId,value:this.inputValue})};handleKeyDown=e=>{if(this.disabled)return;switch(e.key){case"Enter":case" ":e.preventDefault();if(this.isOpen&&this.highlightedIndex>=0){this.selectOption(this.options[this.highlightedIndex])}else{this.toggleDropdown()}break;case"Escape":e.preventDefault();this.closeDropdown();break;case"ArrowDown":e.preventDefault();if(!this.isOpen){this.openDropdown()}else{this.highlightedIndex=Math.min(this.highlightedIndex+1,this.options.length-1)}break;case"ArrowUp":e.preventDefault();if(this.isOpen){this.highlightedIndex=Math.max(this.highlightedIndex-1,0)}break}};getSelectedOptionLabel=()=>{const e=this.options.find((e=>e.value===this.selectValue));return e?e.label:this.selectPlaceholder};render(){const e=this.getSelectedOptionLabel();const o=this.selectValue!=="";return r("div",{key:"39848fbd98d3a34521523fccdcdcd03873a01691",class:"input-container"},this.label&&r("label",{key:"53c269f86e4a87fa4eb4befaa12db92babac0bf9",class:`input-label ${this.disabled?"disabled":""}`},this.label),r("div",{key:"919e8e8c5ce3eb62732e530977dc6fd46ef9a710",class:`input-combo-wrapper combo-wrapper ${this.disabled?"disabled":""} ${this.error?"error":""}`},r("div",{key:"d8091d176ebdd7cf3d1fd7c9a807c4ef619b0015",class:"select-section",style:{width:this.selectWidth}},r("div",{key:"84cedc0716d01d48c8dd06888b5ba49672b1d210",ref:e=>this.triggerRef=e,class:`input-combo-select select-combo-trigger ${!o?"placeholder":""}`,onClick:this.toggleDropdown,onKeyDown:this.handleKeyDown,onBlur:this.onSelectBlur,tabIndex:this.disabled?-1:0,role:"combobox","aria-expanded":this.isOpen.toString(),"aria-haspopup":"listbox"},r("span",{key:"0d4da045a1cbc67e9a93147e98221e58fc0b51d1",class:"select-value"},e),r("div",{key:"6c63e9286e2713328febbc1a66d06cd9d81beb55",class:"icon-wrapper"},r("rebill-icon",{key:"13c3c0ab0d94dc2c7a8c7db782b4d8170bdd33fc",name:"chevron-up-down",size:"20px",class:"select-icon"}))),this.isOpen&&r("div",{key:"889b4816dfbb835fc6d431060b47c56c2fcfefc7",ref:e=>this.dropdownRef=e,class:"select-dropdown",role:"listbox"},this.options.map(((e,o)=>r("div",{class:`select-option ${this.selectValue===e.value?"selected":""} ${this.highlightedIndex===o?"highlighted":""}`,onClick:()=>this.selectOption(e),role:"option","aria-selected":this.selectValue===e.value?"true":"false"},e.label))))),r("div",{key:"5536121c34638cfb3acbe0ee411b712d1bba9c66",class:"combo-divider"}),r("div",{key:"df4334ff14c32559e429e7d7126188dcbd5256d1",class:"input-section"},r("input",{key:"28d580f027d3844a6d0d17a22d69d624fe1f54a0",type:"text",class:"input-combo-element combo-input",placeholder:this.inputPlaceholder,value:this.inputValue,onInput:this.onInputChange,onBlur:this.onInputBlur,disabled:this.disabled}))),this.error&&r("span",{key:"fb0acb0be7980dca2ee0c4f57113cc95bbfdb1d7",class:"error-message"},this.error))}};E.style=I;const C="";const S=class{constructor(r){e(this,r)}get el(){return t(this)}error;currentValue=null;isDisabled=false;value=null;placeholder=null;handleInstallments=e=>{if(this.isDisabled){const e=new CustomEvent("input",{detail:{id:"installments",value:"",disabled:true},bubbles:true});this.el.dispatchEvent(e);return}this.currentValue=e.detail.value;c.setSelectedInstallment(e.detail.value)};componentWillLoad(){c.onChange("data",(()=>{this.isDisabled=!s.data.cardInformation?.installments?.isAvailableInstallments;this.placeholder=!s.data.cardInformation?.installments?.isAvailableInstallments?f(s.data.pricing?.currency):u(s.data.pricing?.currency);this.value=this.isDisabled?"":this.value;if(this.isDisabled){const e=new CustomEvent("input",{detail:{id:"installments",value:"",disabled:true},bubbles:true});this.el.dispatchEvent(e)}}))}render(){return r("div",{key:"30a65486392b49310154f7b7d05fd03f5285988f"},r("rebill-input-select",{key:this.isDisabled.toString(),id:"installments",variant:"outlined",value:this.value,options:s.data.cardInformation?.installments?.installments.map((e=>({label:g(e.installment,y(e.installmentAmount),s.data.pricing?.currency,e.cft,e.model),value:e?.installment?.toString()})))||[],loading:s.data.fetchingInstallments,placeholder:this.placeholder,disabled:this.isDisabled,"on-input":this.handleInstallments,error:l.translate(this.error)}),s.data.cardInformation?.installments?.installments.find((e=>e.installment===s.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===m.CUSTOMER_FINANCED&&r("rebill-typography",{key:"62e4bb9ef93b4480c2bdd01fb9382980d4254352",variant:"italic",color:x.SECONDARY},l.translate("installments.interest")))}};S.style=C;export{v as card_identification,k as card_iframe,T as card_skeleton,E as rebill_input_combo,S as rebill_installments};
2
+ //# sourceMappingURL=p-ad9bd33b.entry.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-D8cwEAmw.js";export{s as setNonce}from"./p-D8cwEAmw.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-5dac3ade",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-43eca659",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-79c50f5d",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-6c7962fd",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-fe8302ef",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-d486597b",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-3af0544a",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[8,"total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[8,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"forceUpdate":[32]}]]],["p-782cd61c",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-d8aa7baf",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}]]],["p-a758a555",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-38ea4f03",[[256,"rebill-divider"]]],["p-1212f7d2",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-fa04bbb1",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-5d5ff870",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-3af13b9d",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-19018019",[[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-e1b86d84",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-c7c48b15",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-543e45fc",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-567ae839",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-062f07dc",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-c41119c0",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-7f487ad7",[[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-a3ad56d1",[[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-processing-payment",{"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"apm-download",{"data":[16]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}]]]]'),e)}));
1
+ import{p as e,b as t}from"./p-D8cwEAmw.js";export{s as setNonce}from"./p-D8cwEAmw.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-5dac3ade",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-43eca659",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-79c50f5d",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-6c7962fd",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-fe8302ef",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-d486597b",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-3af0544a",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[8,"total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[8,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"forceUpdate":[32]}]]],["p-782cd61c",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-d8aa7baf",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}]]],["p-a758a555",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-38ea4f03",[[256,"rebill-divider"]]],["p-1212f7d2",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-fa04bbb1",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-5d5ff870",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-3af13b9d",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-19018019",[[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-e1b86d84",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-c7c48b15",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-543e45fc",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-567ae839",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-062f07dc",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-91432c62",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-ad9bd33b",[[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-a3ad56d1",[[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-processing-payment",{"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"apm-download",{"data":[16]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}]]]]'),e)}));
2
2
  //# sourceMappingURL=rebill-web-components-sdk.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebill-web-components-sdk",
3
- "version": "1.8.13",
3
+ "version": "1.8.15",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -14,10 +14,18 @@
14
14
  ],
15
15
  "exports": {
16
16
  ".": {
17
+ "import": "./dist/components/rebill-checkout.js",
18
+ "types": "./dist/components/rebill-checkout.d.ts"
19
+ },
20
+ "./config": {
17
21
  "import": "./dist/index.js",
18
22
  "require": "./dist/index.cjs.js",
19
23
  "types": "./dist/types/index.d.ts"
20
24
  },
25
+ "./rebill-checkout": {
26
+ "import": "./dist/components/rebill-checkout.js",
27
+ "types": "./dist/components/rebill-checkout.d.ts"
28
+ },
21
29
  "./components": {
22
30
  "import": "./dist/components/index.js",
23
31
  "types": "./dist/components/index.d.ts"
@@ -1 +0,0 @@
1
- {"version":3,"file":"installment-utils-D4qKgjN9.js","sources":["src/models/enums/installment.enum.ts","src/utils/installment-utils.ts"],"sourcesContent":["export enum ENUM_INSTALLMENT_MODEL {\n CUSTOMER_FINANCED = 'customer_financed',\n MERCHANT_FINANCED = 'merchant_financed',\n ISSUER_FINANCED = 'issuer_financed',\n}\n","import { I18nService } from '../i18n/i18n.service';\nimport { CURRENCY_ENUM } from '../models/enums/currency.enum';\nimport { ENUM_INSTALLMENT_MODEL } from '../models/enums/installment.enum';\nimport { sessionState } from '../store/session.store';\nimport { formatAmountToIntlFormat } from './currency-formatter';\n\n/**\n * Obtiene la descripción de cuotas\n */\nexport const getInstallmentDescription = (installment: number, amount: number): string => {\n return I18nService.translate('summary.installmentDescription', {\n installment,\n amount: formatAmountToIntlFormat(amount, sessionState.data.pricing?.currency),\n });\n};\n\n/**\n * Obtiene el texto de cuota según la moneda\n * @param installment - El número de cuotas\n * @param currency - La moneda para determinar el texto apropiado\n * @returns String del texto de cuota según la moneda\n */\nconst getInstallmentTextByCurrency = (installment: number, currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.brazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return installment === 1\n ? I18nService.translate('installments.singleMexican')\n : I18nService.translate('installments.pluralMexican');\n }\n\n return installment === 1\n ? I18nService.translate('installments.single')\n : I18nService.translate('installments.plural');\n};\n\n/**\n * Obtiene el placeholder del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder apropiado\n * @returns String del placeholder según la moneda\n */\nexport const getInstallmentPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.selectBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.selectMexican');\n }\n\n return I18nService.translate('installments.select');\n};\n\n/**\n * Obtiene el placeholder disabled del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder disabled apropiado\n * @returns String del placeholder disabled según la moneda\n */\nexport const getInstallmentDisabledPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.disabledBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.disabledMexican');\n }\n\n return I18nService.translate('installments.disabled');\n};\n\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabel = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : installment === 1\n ? ''\n : `<span style=\"background-color: rgba(183, 233, 221, 1); border-radius: 4px; padding: 2px 6px; display: inline-flex; align-items: center; color: #257c67; font-size: 0.75rem; font-weight: 600; margin-left: 4px;\">${I18nService.translate('installments.samePrice')}</span>`;\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText}`;\n};\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabelSummary = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : '';\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText} `;\n};\n\n/**\n * Recalcula el monto de la cuota considerando descuentos aplicados\n * @param installmentAmount - El monto original de la cuota\n * @returns El monto recalculado de la cuota con descuento aplicado\n */\nexport const getRecalculatedInstallmentAmount = (installmentAmount: number): number => {\n // Si hay un descuento aplicado, recalcular el monto de la cuota\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(installmentAmount * discountRatio * 100) / 100;\n }\n\n return installmentAmount;\n};\n"],"names":["ENUM_INSTALLMENT_MODEL","I18nService","formatAmountToIntlFormat","sessionState","CURRENCY_ENUM"],"mappings":";;;;AAAYA;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJWA,8BAAsB,KAAtBA,8BAAsB,GAIjC,EAAA,CAAA,CAAA;;ACED;;AAEG;MACU,yBAAyB,GAAG,CAAC,WAAmB,EAAE,MAAc,KAAY;AACvF,IAAA,OAAOC,wBAAW,CAAC,SAAS,CAAC,gCAAgC,EAAE;QAC7D,WAAW;AACX,QAAA,MAAM,EAAEC,qCAAwB,CAAC,MAAM,EAAEC,kBAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC9E,KAAA,CAAC;AACJ;AAEA;;;;;AAKG;AACH,MAAM,4BAA4B,GAAG,CAAC,WAAmB,EAAE,QAAuB,KAAY;AAC5F,IAAA,IAAI,QAAQ,KAAKC,0BAAa,CAAC,GAAG,EAAE;AAClC,QAAA,OAAOH,wBAAW,CAAC,SAAS,CAAC,wBAAwB,CAAC;;AAGxD,IAAA,IAAI,QAAQ,KAAKG,0BAAa,CAAC,GAAG,EAAE;QAClC,OAAO,WAAW,KAAK;AACrB,cAAEH,wBAAW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CAAC,CAAI,CAAA,EAAA,OAAO,EAAE;AACrG;AACA;;;;;;;AAOG;AACI,MAAM,0BAA0B,GAAG,CACxC,WAAmB,EACnB,MAAc,EACd,QAAuB,EACvB,GAAW,EACX,KAA6B,KACnB;IACV,MAAM,eAAe,GAAG,4BAA4B,CAAC,WAAW,EAAE,QAAQ,CAAC;AAC3E,IAAA,MAAM,OAAO,GACX,GAAG,GAAG,CAAC;QACP,KAAK,KAAK,sBAAsB,CAAC,iBAAiB;QAClDA,KAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,KAAK,aAAa,CAAC;UAClD,CAAS,MAAA,EAAA,GAAG,CAAK,GAAA;UACjB,EAAE;AAER,IAAA,OAAO,CAAG,EAAA,WAAW,CAAI,CAAA,EAAA,eAAe,IAAI,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAI,CAAA,EAAA,OAAO,GAAG;AACtG;AAEA;;;;AAIG;AACU,MAAA,gCAAgC,GAAG,CAAC,iBAAyB,KAAY;;IAEpF,IAAIA,KAAY,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC,EAAE;QAChD,MAAM,aAAa,GAAGA,KAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ;QACxD,MAAM,YAAY,GAAGA,KAAY,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB;AACtE,QAAA,MAAM,aAAa,GAAG,YAAY,GAAG,aAAa;AAElD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,GAAG,aAAa,GAAG,GAAG,CAAC,GAAG,GAAG;;AAGlE,IAAA,OAAO,iBAAiB;AAC1B;;;;","names":["sessionState"],"sources":["src/models/enums/installment.enum.ts","src/utils/installment-utils.ts"],"sourcesContent":["export enum ENUM_INSTALLMENT_MODEL {\n CUSTOMER_FINANCED = 'customer_financed',\n MERCHANT_FINANCED = 'merchant_financed',\n ISSUER_FINANCED = 'issuer_financed',\n}\n","import { I18nService } from '../i18n/i18n.service';\nimport { CURRENCY_ENUM } from '../models/enums/currency.enum';\nimport { ENUM_INSTALLMENT_MODEL } from '../models/enums/installment.enum';\nimport { sessionState } from '../store/session.store';\nimport { formatAmountToIntlFormat } from './currency-formatter';\n\n/**\n * Obtiene la descripción de cuotas\n */\nexport const getInstallmentDescription = (installment: number, amount: number): string => {\n return I18nService.translate('summary.installmentDescription', {\n installment,\n amount: formatAmountToIntlFormat(amount, sessionState.data.pricing?.currency),\n });\n};\n\n/**\n * Obtiene el texto de cuota según la moneda\n * @param installment - El número de cuotas\n * @param currency - La moneda para determinar el texto apropiado\n * @returns String del texto de cuota según la moneda\n */\nconst getInstallmentTextByCurrency = (installment: number, currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.brazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return installment === 1\n ? I18nService.translate('installments.singleMexican')\n : I18nService.translate('installments.pluralMexican');\n }\n\n return installment === 1\n ? I18nService.translate('installments.single')\n : I18nService.translate('installments.plural');\n};\n\n/**\n * Obtiene el placeholder del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder apropiado\n * @returns String del placeholder según la moneda\n */\nexport const getInstallmentPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.selectBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.selectMexican');\n }\n\n return I18nService.translate('installments.select');\n};\n\n/**\n * Obtiene el placeholder disabled del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder disabled apropiado\n * @returns String del placeholder disabled según la moneda\n */\nexport const getInstallmentDisabledPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.disabledBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.disabledMexican');\n }\n\n return I18nService.translate('installments.disabled');\n};\n\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabel = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : installment === 1\n ? ''\n : `<span style=\"background-color: rgba(183, 233, 221, 1); border-radius: 4px; padding: 2px 6px; display: inline-flex; align-items: center; color: #257c67; font-size: 0.75rem; font-weight: 600; margin-left: 4px;\">${I18nService.translate('installments.samePrice')}</span>`;\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText}`;\n};\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabelSummary = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : '';\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText} `;\n};\n\n/**\n * Recalcula el monto de la cuota considerando descuentos aplicados\n * @param installmentAmount - El monto original de la cuota\n * @returns El monto recalculado de la cuota con descuento aplicado\n */\nexport const getRecalculatedInstallmentAmount = (installmentAmount: number): number => {\n // Si hay un descuento aplicado, recalcular el monto de la cuota\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(installmentAmount * discountRatio * 100) / 100;\n }\n\n return installmentAmount;\n};\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"file":"installment-utils-BCJJSszJ.js","sources":["src/models/enums/installment.enum.ts","src/utils/installment-utils.ts"],"sourcesContent":["export enum ENUM_INSTALLMENT_MODEL {\n CUSTOMER_FINANCED = 'customer_financed',\n MERCHANT_FINANCED = 'merchant_financed',\n ISSUER_FINANCED = 'issuer_financed',\n}\n","import { I18nService } from '../i18n/i18n.service';\nimport { CURRENCY_ENUM } from '../models/enums/currency.enum';\nimport { ENUM_INSTALLMENT_MODEL } from '../models/enums/installment.enum';\nimport { sessionState } from '../store/session.store';\nimport { formatAmountToIntlFormat } from './currency-formatter';\n\n/**\n * Obtiene la descripción de cuotas\n */\nexport const getInstallmentDescription = (installment: number, amount: number): string => {\n return I18nService.translate('summary.installmentDescription', {\n installment,\n amount: formatAmountToIntlFormat(amount, sessionState.data.pricing?.currency),\n });\n};\n\n/**\n * Obtiene el texto de cuota según la moneda\n * @param installment - El número de cuotas\n * @param currency - La moneda para determinar el texto apropiado\n * @returns String del texto de cuota según la moneda\n */\nconst getInstallmentTextByCurrency = (installment: number, currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.brazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return installment === 1\n ? I18nService.translate('installments.singleMexican')\n : I18nService.translate('installments.pluralMexican');\n }\n\n return installment === 1\n ? I18nService.translate('installments.single')\n : I18nService.translate('installments.plural');\n};\n\n/**\n * Obtiene el placeholder del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder apropiado\n * @returns String del placeholder según la moneda\n */\nexport const getInstallmentPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.selectBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.selectMexican');\n }\n\n return I18nService.translate('installments.select');\n};\n\n/**\n * Obtiene el placeholder disabled del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder disabled apropiado\n * @returns String del placeholder disabled según la moneda\n */\nexport const getInstallmentDisabledPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.disabledBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.disabledMexican');\n }\n\n return I18nService.translate('installments.disabled');\n};\n\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabel = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : installment === 1\n ? ''\n : `<span style=\"background-color: rgba(183, 233, 221, 1); border-radius: 4px; padding: 2px 6px; display: inline-flex; align-items: center; color: #257c67; font-size: 0.75rem; font-weight: 600; margin-left: 4px;\">${I18nService.translate('installments.samePrice')}</span>`;\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText}`;\n};\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabelSummary = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : '';\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText} `;\n};\n\n/**\n * Recalcula el monto de la cuota considerando descuentos aplicados\n * @param installmentAmount - El monto original de la cuota\n * @returns El monto recalculado de la cuota con descuento aplicado\n */\nexport const getRecalculatedInstallmentAmount = (installmentAmount: number): number => {\n // Si hay un descuento aplicado, recalcular el monto de la cuota\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(installmentAmount * discountRatio * 100) / 100;\n }\n\n return installmentAmount;\n};\n"],"names":["sessionState"],"mappings":";;AAAY,IAAA;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,GAIjC,EAAA,CAAA,CAAA;;ACED;;AAEG;MACU,yBAAyB,GAAG,CAAC,WAAmB,EAAE,MAAc,KAAY;AACvF,IAAA,OAAO,WAAW,CAAC,SAAS,CAAC,gCAAgC,EAAE;QAC7D,WAAW;AACX,QAAA,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAEA,KAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC9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OAAO,CAAC,cAAc,GAAG,CAAC,EAAE;QAChD,MAAM,aAAa,GAAGA,KAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ;QACxD,MAAM,YAAY,GAAGA,KAAY,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB;AACtE,QAAA,MAAM,aAAa,GAAG,YAAY,GAAG,aAAa;AAElD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,GAAG,aAAa,GAAG,GAAG,CAAC,GAAG,GAAG;;AAGlE,IAAA,OAAO,iBAAiB;AAC1B;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"p-KStTLJ_c.js","sources":["src/models/enums/installment.enum.ts","src/utils/installment-utils.ts"],"sourcesContent":["export enum ENUM_INSTALLMENT_MODEL {\n CUSTOMER_FINANCED = 'customer_financed',\n MERCHANT_FINANCED = 'merchant_financed',\n ISSUER_FINANCED = 'issuer_financed',\n}\n","import { I18nService } from '../i18n/i18n.service';\nimport { CURRENCY_ENUM } from '../models/enums/currency.enum';\nimport { ENUM_INSTALLMENT_MODEL } from '../models/enums/installment.enum';\nimport { sessionState } from '../store/session.store';\nimport { formatAmountToIntlFormat } from './currency-formatter';\n\n/**\n * Obtiene la descripción de cuotas\n */\nexport const getInstallmentDescription = (installment: number, amount: number): string => {\n return I18nService.translate('summary.installmentDescription', {\n installment,\n amount: formatAmountToIntlFormat(amount, sessionState.data.pricing?.currency),\n });\n};\n\n/**\n * Obtiene el texto de cuota según la moneda\n * @param installment - El número de cuotas\n * @param currency - La moneda para determinar el texto apropiado\n * @returns String del texto de cuota según la moneda\n */\nconst getInstallmentTextByCurrency = (installment: number, currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.brazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return installment === 1\n ? I18nService.translate('installments.singleMexican')\n : I18nService.translate('installments.pluralMexican');\n }\n\n return installment === 1\n ? I18nService.translate('installments.single')\n : I18nService.translate('installments.plural');\n};\n\n/**\n * Obtiene el placeholder del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder apropiado\n * @returns String del placeholder según la moneda\n */\nexport const getInstallmentPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.selectBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.selectMexican');\n }\n\n return I18nService.translate('installments.select');\n};\n\n/**\n * Obtiene el placeholder disabled del selector de cuotas según la moneda\n * @param currency - La moneda para determinar el placeholder disabled apropiado\n * @returns String del placeholder disabled según la moneda\n */\nexport const getInstallmentDisabledPlaceholderByCurrency = (currency: CURRENCY_ENUM): string => {\n if (currency === CURRENCY_ENUM.BRL) {\n return I18nService.translate('installments.disabledBrazilian');\n }\n\n if (currency === CURRENCY_ENUM.MXN) {\n return I18nService.translate('installments.disabledMexican');\n }\n\n return I18nService.translate('installments.disabled');\n};\n\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabel = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : installment === 1\n ? ''\n : `<span style=\"background-color: rgba(183, 233, 221, 1); border-radius: 4px; padding: 2px 6px; display: inline-flex; align-items: center; color: #257c67; font-size: 0.75rem; font-weight: 600; margin-left: 4px;\">${I18nService.translate('installments.samePrice')}</span>`;\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText}`;\n};\n/**\n * Genera la etiqueta para una cuota específica\n * @param installment - El número de cuotas\n * @param amount - El monto por cuota\n * @param currency - La moneda a usar para el formateo\n * @param cft - El interés de la cuota\n * @returns String formateado de la etiqueta de cuota\n */\nexport const getInstallmentLabelSummary = (\n installment: number,\n amount: number,\n currency: CURRENCY_ENUM,\n cft: number,\n model: ENUM_INSTALLMENT_MODEL,\n): string => {\n const installmentText = getInstallmentTextByCurrency(installment, currency);\n const cftText =\n cft > 0 &&\n model === ENUM_INSTALLMENT_MODEL.CUSTOMER_FINANCED &&\n sessionState.data.pricing?.currency === CURRENCY_ENUM.ARS\n ? `- CFT ${cft}% *`\n : '';\n\n return `${installment} ${installmentText} ${formatAmountToIntlFormat(amount, currency)} ${cftText} `;\n};\n\n/**\n * Recalcula el monto de la cuota considerando descuentos aplicados\n * @param installmentAmount - El monto original de la cuota\n * @returns El monto recalculado de la cuota con descuento aplicado\n */\nexport const getRecalculatedInstallmentAmount = (installmentAmount: number): number => {\n // Si hay un descuento aplicado, recalcular el monto de la cuota\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(installmentAmount * discountRatio * 100) / 100;\n }\n\n return installmentAmount;\n};\n"],"names":["sessionState"],"mappings":";;AAAY,IAAA;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACrC,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,GAIjC,EAAA,CAAA,CAAA;;ACED;;AAEG;MACU,yBAAyB,GAAG,CAAC,WAAmB,EAAE,MAAc,KAAY;AACvF,IAAA,OAAO,WAAW,CAAC,SAAS,CAAC,gCAAgC,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