rebill-web-components-sdk 1.8.5 → 1.8.6

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 (54) hide show
  1. package/dist/cjs/apm-checkout_16.cjs.entry.js +1 -1
  2. package/dist/cjs/{get-payment-method-display-name-oo6lOpoC.js → get-payment-method-display-name-C6mdzTEs.js} +86 -86
  3. package/dist/cjs/{get-payment-method-display-name-oo6lOpoC.js.map → get-payment-method-display-name-C6mdzTEs.js.map} +1 -1
  4. package/dist/cjs/{index-N1yCtvXq.js → index-DLv8bgA4.js} +3 -3
  5. package/dist/cjs/{index-N1yCtvXq.js.map → index-DLv8bgA4.js.map} +1 -1
  6. package/dist/cjs/{jspdf.es.min-BW0eLZgN.js → jspdf.es.min-CV0yEJ9o.js} +4 -4
  7. package/dist/cjs/{jspdf.es.min-BW0eLZgN.js.map → jspdf.es.min-CV0yEJ9o.js.map} +1 -1
  8. package/dist/cjs/otp-component_7.cjs.entry.js +1 -1
  9. package/dist/cjs/renewal-success-page_2.cjs.entry.js +1 -1
  10. package/dist/collection/utils/pdf-generator.js +1 -1
  11. package/dist/collection/utils/pdf-generator.js.map +1 -1
  12. package/dist/collection/utils/receipt-Cardtemplate.js +81 -81
  13. package/dist/collection/utils/receipt-Cardtemplate.js.map +1 -1
  14. package/dist/components/apm-checkout.js +1 -1
  15. package/dist/components/{p-LFMU1iYh.js → p-1tbGUoeo.js} +4 -4
  16. package/dist/components/{p-LFMU1iYh.js.map → p-1tbGUoeo.js.map} +1 -1
  17. package/dist/components/{p-CMnoxL8G.js → p-BnidisYn.js} +3 -3
  18. package/dist/components/{p-CMnoxL8G.js.map → p-BnidisYn.js.map} +1 -1
  19. package/dist/components/{p-fwl9Z4PT.js → p-C1THyrZh.js} +3 -3
  20. package/dist/components/{p-fwl9Z4PT.js.map → p-C1THyrZh.js.map} +1 -1
  21. package/dist/components/{p-BBEMTBwW.js → p-C69QonMT.js} +3 -3
  22. package/dist/components/{p-BBEMTBwW.js.map → p-C69QonMT.js.map} +1 -1
  23. package/dist/components/{p-ByJrcRsN.js → p-DZI13wtJ.js} +3 -3
  24. package/dist/components/{p-ByJrcRsN.js.map → p-DZI13wtJ.js.map} +1 -1
  25. package/dist/components/{p-tWMR1_gF.js → p-fStqPH4y.js} +86 -86
  26. package/dist/components/p-fStqPH4y.js.map +1 -0
  27. package/dist/components/rebill-checkout.js +2 -2
  28. package/dist/components/rebill-renewal.js +2 -2
  29. package/dist/components/renewal-success-page.js +1 -1
  30. package/dist/components/success-page.js +1 -1
  31. package/dist/esm/apm-checkout_16.entry.js +1 -1
  32. package/dist/esm/{get-payment-method-display-name-Dj7gQJ-R.js → get-payment-method-display-name-B59DbHr6.js} +86 -86
  33. package/dist/esm/{get-payment-method-display-name-Dj7gQJ-R.js.map → get-payment-method-display-name-B59DbHr6.js.map} +1 -1
  34. package/dist/esm/{index-wfvNOgYw.js → index-DtxAsmPA.js} +3 -3
  35. package/dist/esm/{index-wfvNOgYw.js.map → index-DtxAsmPA.js.map} +1 -1
  36. package/dist/esm/{jspdf.es.min-ssPVxe3c.js → jspdf.es.min-APwmCmmv.js} +4 -4
  37. package/dist/esm/{jspdf.es.min-ssPVxe3c.js.map → jspdf.es.min-APwmCmmv.js.map} +1 -1
  38. package/dist/esm/otp-component_7.entry.js +1 -1
  39. package/dist/esm/renewal-success-page_2.entry.js +1 -1
  40. package/dist/rebill-web-components-sdk/{p-6762520a.entry.js → p-07de4442.entry.js} +2 -2
  41. package/dist/rebill-web-components-sdk/{p-DeorBmj5.js → p-2D2ZgtY0.js} +2 -2
  42. package/dist/rebill-web-components-sdk/{p-DeorBmj5.js.map → p-2D2ZgtY0.js.map} +1 -1
  43. package/dist/rebill-web-components-sdk/{p-075927af.entry.js → p-4e35c3c8.entry.js} +2 -2
  44. package/dist/rebill-web-components-sdk/{p-BldcNI96.js → p-D5uLuMja.js} +9 -9
  45. package/dist/rebill-web-components-sdk/{p-BldcNI96.js.map → p-D5uLuMja.js.map} +1 -1
  46. package/dist/rebill-web-components-sdk/{p-6b756131.entry.js → p-ce0793c8.entry.js} +2 -2
  47. package/dist/rebill-web-components-sdk/{p-BWqURJ0r.js → p-ymT8AXMV.js} +5 -5
  48. package/dist/rebill-web-components-sdk/{p-BWqURJ0r.js.map → p-ymT8AXMV.js.map} +1 -1
  49. package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/components/p-tWMR1_gF.js.map +0 -1
  52. /package/dist/rebill-web-components-sdk/{p-6762520a.entry.js.map → p-07de4442.entry.js.map} +0 -0
  53. /package/dist/rebill-web-components-sdk/{p-075927af.entry.js.map → p-4e35c3c8.entry.js.map} +0 -0
  54. /package/dist/rebill-web-components-sdk/{p-6b756131.entry.js.map → p-ce0793c8.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as e,h as t,g as i,c as a,H as s}from"./p-D8cwEAmw.js";import{a as n}from"./p-CTo1s54i.js";import{I as r,c as o,s as l,b as c,f as d,d as p,e as h,a as b,P as m}from"./p-_KJrM-e7.js";import{C as u}from"./p-DA598vBj.js";import{c as f}from"./p-bcHxwlBu.js";import{B as y,i as g,g as x}from"./p-Do_vNuMa.js";import{g as v,a as _,E as w,b as k}from"./p-tIhL6zxg.js";import{g as C}from"./p-B96SyP8A.js";import{P as $,g as j}from"./p-DeorBmj5.js";import{f as D}from"./p-Bridn86q.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const T=(e,t,i)=>{const a=document.createElement(e),[s,n]=Array.isArray(t)?[void 0,t]:[t,i];return s&&Object.assign(a,s),n==null||n.forEach((e=>a.appendChild(e))),a},z=(e,t)=>{var i;return t==="left"?e.offsetLeft:(((i=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:i.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},S=e=>e.offsetWidth>0&&e.offsetHeight>0,A=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function P(e,t,{reverse:i=false}={}){const a=e.length;for(let s=i?a-1:0;i?s>=0:s<a;i?s--:s++)t(e[s],s)}function M(e,t,i,a){const s=t.formatToParts(e);i&&s.unshift({type:"prefix",value:i}),a&&s.push({type:"suffix",value:a});const n=[],r=[],o=[],l=[],c={},d=e=>`${e}:${c[e]=(c[e]??-1)+1}`;let p="",h=false,b=false;for(const e of s){p+=e.value;const t=e.type==="minusSign"||e.type==="plusSign"?"sign":e.type;t==="integer"?(h=true,r.push(...e.value.split("").map((e=>({type:t,value:parseInt(e)}))))):t==="group"?r.push({type:t,value:e.value}):t==="decimal"?(b=true,o.push({type:t,value:e.value,key:d(t)})):t==="fraction"?o.push(...e.value.split("").map((e=>({type:t,value:parseInt(e),key:d(t),pos:-1-c[t]})))):(h||b?l:n).push({type:t,value:e.value,key:d(t)})}const m=[];for(let e=r.length-1;e>=0;e--){const t=r[e];m.unshift(t.type==="integer"?{...t,key:d(t.type),pos:c[t.type]}:{...t,key:d(t.type)})}return{pre:n,integer:m,fraction:o,post:l,valueAsString:p,value:typeof e=="string"?parseFloat(e):e}}const L=String.raw,I=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return false}return true})(),N=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),E=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,B="--_number-flow-d-opacity",R="--_number-flow-d-width",F="--_number-flow-dx",U="--_number-flow-d",V=(()=>{try{return CSS.registerProperty({name:B,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:F,syntax:"<length>",inherits:true,initialValue:"0px"}),CSS.registerProperty({name:R,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:true,initialValue:"0"}),true}catch{return false}})(),W="var(--number-flow-char-height, 1em)",Y="var(--number-flow-mask-height, 0.25em)",X=`calc(${Y} / 2)`,q="var(--number-flow-mask-width, 0.5em)",O=`calc(${q} / var(--scale-x))`,H="#000 0, transparent 71%",Z=L`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${W} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${R}) / var(--width));transform:translateX(var(${F})) scaleX(var(--scale-x));margin:0 calc(-1 * ${q});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${O},#000 calc(100% - ${O}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Y},#000 calc(100% - ${Y}),transparent 100% ),radial-gradient(at bottom right,${H}),radial-gradient(at bottom left,${H}),radial-gradient(at top left,${H}),radial-gradient(at top right,${H});-webkit-mask-size:100% calc(100% - ${Y} * 2),calc(100% - ${O} * 2) 100%,${O} ${Y},${O} ${Y},${O} ${Y},${O} ${Y};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${X} ${q};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${F})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${U})}.digit__num,.number .section::after{padding:${X} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${B}))}`,G=HTMLElement,K=N&&I&&V;let J;class Q extends G{constructor(){super(),this.created=false,this.batched=false;const{animated:e,...t}=this.constructor.defaultProps;this._animated=this.computedAnimated=e,Object.assign(this,t)}get animated(){return this._animated}set animated(e){var t;this.animated!==e&&(this._animated=e,(t=this.shadowRoot)==null||t.getAnimations().forEach((e=>e.finish())))}set data(e){var t;if(e==null)return;const{pre:i,integer:a,fraction:s,post:n,value:r}=e;if(this.created){const o=this._data;this._data=e,this.computedTrend=typeof this.trend=="function"?this.trend(o.value,r):this.trend,this.computedAnimated=K&&this._animated&&(!this.respectMotionPreference||!(E!=null&&E.matches))&&S(this),(t=this.plugins)==null||t.forEach((t=>{var i;return(i=t.onUpdate)==null?void 0:i.call(t,e,o,this)})),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:a,fraction:s}),this._post.update(n),this.batched||this.didUpdate()}else{this._data=e,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)J||(J=new CSSStyleSheet,J.replaceSync(Z)),this.shadowRoot.adoptedStyleSheets=[J];else{const e=document.createElement("style");e.textContent=Z,this.shadowRoot.appendChild(e)}this._pre=new ae(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new ee(this,a,s),this.shadowRoot.appendChild(this._num.el),this._post=new ae(this,n,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=true}try{this._internals.ariaLabel=e.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const e=new AbortController;Promise.all(this.shadowRoot.getAnimations().map((e=>e.finished))).then((()=>{e.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)})),this._abortAnimationsFinish=e}}Q.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:true,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:true,plugins:void 0,digits:void 0};class ee{constructor(e,t,i,{className:a,...s}={}){this.flow=e,this._integer=new ie(e,t,{justify:"right",part:"integer"}),this._fraction=new ie(e,i,{justify:"left",part:"fraction"}),this._inner=T("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=T("span",{...s,part:"number",className:`number ${a??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:e,fraction:t}){this._integer.update(e),this._fraction.update(t)}didUpdate(){const e=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const t=this._prevLeft-e.left,i=this.el.offsetWidth,a=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[F]:[`${t}px`,"0px"],[R]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class te{constructor(e,t,{justify:i,className:a,...s},n){this.flow=e,this.children=new Map,this.onCharRemove=e=>()=>{this.children.delete(e)},this.justify=i;const r=t.map((e=>this.addChar(e).el));this.el=T("span",{...s,className:`section section--justify-${i} ${a??""}`},n?n(r):r)}addChar(e,{startDigitsAtZero:t=false,...i}={}){const a=e.type==="integer"||e.type==="fraction"?new re(this,e.type,t?0:e.value,e.pos,{...i,onRemove:this.onCharRemove(e.key)}):new oe(this,e.type,e.value,{...i,onRemove:this.onCharRemove(e.key)});return this.children.set(e.key,a),a}unpop(e){e.el.removeAttribute("inert"),e.el.style.top="",e.el.style[this.justify]=""}pop(e){e.forEach((e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${z(e.el,this.justify)}px`})),e.forEach((e=>{e.el.setAttribute("inert",""),e.present=false}))}addNewAndUpdateExisting(e){const t=new Map,i=new Map,a=this.justify==="left",s=a?"prepend":"append";if(P(e,(e=>{let a;this.children.has(e.key)?(a=this.children.get(e.key),i.set(e,a),this.unpop(a),a.present=true):(a=this.addChar(e,{startDigitsAtZero:true,animateIn:true}),t.set(e,a)),this.el[s](a.el)}),{reverse:a}),this.flow.computedAnimated){const e=this.el.getBoundingClientRect();t.forEach((t=>{t.willUpdate(e)}))}t.forEach(((e,t)=>{e.update(t.value)})),i.forEach(((e,t)=>{e.update(t.value)}))}willUpdate(){const e=this.el.getBoundingClientRect();this._prevOffset=e[this.justify],this.children.forEach((t=>t.willUpdate(e)))}didUpdate(){const e=this.el.getBoundingClientRect();this.children.forEach((t=>t.didUpdate(e)));const t=e[this.justify],i=this._prevOffset-t;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class ie extends te{update(e){const t=new Map;this.children.forEach(((i,a)=>{e.find((e=>e.key===a))||t.set(a,i),this.unpop(i)})),this.addNewAndUpdateExisting(e),t.forEach((e=>{e instanceof re&&e.update(0)})),this.pop(t)}}class ae extends te{update(e){const t=new Map;this.children.forEach(((i,a)=>{e.find((e=>e.key===a))||t.set(a,i)})),this.pop(t),this.addNewAndUpdateExisting(e)}}class se{constructor(e,t,{onRemove:i,animateIn:a=false}={}){this.flow=e,this.el=t,this._present=true,this._remove=()=>{var e;this.el.remove(),(e=this._onRemove)==null||e.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&a&&this.el.animate({[B]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(e){if(this._present!==e){if(this._present=e,e?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){e||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",e?"0":"-.999"),this.el.animate({[B]:e?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),e?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:true})}}}class ne extends se{constructor(e,t,i,a){super(e.flow,i,a),this.section=e,this.value=t,this.el=i}}class re extends ne{constructor(e,t,i,a,s){var n,r;const o=(((r=(n=e.flow.digits)==null?void 0:n[a])==null?void 0:r.max)??9)+1,l=Array.from({length:o}).map(((e,t)=>{const a=T("span",{className:"digit__num"},[document.createTextNode(String(t))]);return t!==i&&a.setAttribute("inert",""),a.style.setProperty("--n",String(t)),a})),c=T("span",{part:`digit ${t}-digit`,className:"digit"},l);c.style.setProperty("--current",String(i)),c.style.setProperty("--length",String(o)),super(e,i,c,s),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=o}willUpdate(e){const t=this.el.getBoundingClientRect();this._prevValue=this.value;const i=t[this.section.justify]-e[this.section.justify],a=t.width/2;this._prevCenter=this.section.justify==="left"?i+a:i-a}update(e){this.el.style.setProperty("--current",String(e)),this._numbers.forEach(((t,i)=>i===e?t.removeAttribute("inert"):t.setAttribute("inert",""))),this.value=e}didUpdate(e){const t=this.el.getBoundingClientRect(),i=t[this.section.justify]-e[this.section.justify],a=t.width/2,s=this.section.justify==="left"?i+a:i-a,n=this._prevCenter-s;n&&this.el.animate({transform:[`translateX(${n}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const r=this.getDelta();r&&(this.el.classList.add("is-spinning"),this.el.animate({[U]:[-r,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:true}))}getDelta(){var e;if(this.flow.plugins)for(const t of this.flow.plugins){const i=(e=t.getDelta)==null?void 0:e.call(t,this.value,this._prevValue,this);if(i!=null)return i}const t=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(t);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:t}}class oe extends ne{constructor(e,t,i,a){const s=T("span",{className:"symbol__value",textContent:i});super(e,i,T("span",{part:`symbol ${t}`,className:"symbol"},[s]),a),this.type=t,this._children=new Map,this._onChildRemove=e=>()=>{this._children.delete(e)},this._children.set(i,new se(this.flow,s,{onRemove:this._onChildRemove(i)}))}willUpdate(e){if(this.type==="decimal")return;const t=this.el.getBoundingClientRect();this._prevOffset=t[this.section.justify]-e[this.section.justify]}update(e){if(this.value!==e){const t=this._children.get(this.value);t&&(t.present=false);const i=this._children.get(e);if(i)i.present=true;else{const t=T("span",{className:"symbol__value",textContent:e});this.el.appendChild(t),this._children.set(e,new se(this.flow,t,{animateIn:true,onRemove:this._onChildRemove(e)}))}}this.value=e}didUpdate(e){if(this.type==="decimal")return;const t=this.el.getBoundingClientRect()[this.section.justify]-e[this.section.justify],i=this._prevOffset-t;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const le="number-flow-connect",ce="number-flow-update";class de extends Q{constructor(){super(...arguments),this.connected=false}connectedCallback(){this.connected=true,this.dispatchEvent(new Event(le,{bubbles:true}))}disconnectedCallback(){this.connected=false}get value(){return this._value}update(e){(!this._formatter||this._prevFormat!==this.format||this._prevLocales!==this.locales)&&(this._formatter=new Intl.NumberFormat(this.locales,this.format),this._prevFormat=this.format,this._prevLocales=this.locales),e!=null&&(this._value=e),this.dispatchEvent(new Event(ce,{bubbles:true})),this.data=M(this._value,this._formatter,this.numberPrefix,this.numberSuffix)}}A("number-flow",de);const pe=".summary-container {\n width: 100%;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 40px;\n background-color: var(--rebill-color-background-right);\n}\n.summary-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n}\n\n.trial-pill {\n background-color: var(--rebill-color-green-light-2);\n border-radius: 4px;\n padding: 4px 6px 4px 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.total-amount-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n}\n\n@media (max-width: 1024px) {\n .summary-container {\n gap: 1.5rem !important;\n background-color: var(--rebill-color-background);\n }\n .summary-header {\n margin-top: 24px;\n }\n .summary-row.total {\n margin-top: 0 !important;\n }\n}\n\n.summary-card {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 24px;\n padding: 0px;\n background: #ffffff;\n}\n\n.summary-card-info {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.summary-card-amount {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.summary-details {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.summary-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n & > :nth-child(2) {\n text-align: right;\n }\n}\n\n.summary-row.total {\n margin-top: 1rem;\n font-weight: bold;\n}\n\n@media (min-width: 1025px) and (max-width: 1450px) {\n .summary-container {\n margin: 0px 10px;\n max-width: 400px;\n }\n}\n";const he=class{constructor(t){e(this,t)}totalAmount;itemTitle;itemDescription;itemAmount;planFrequency;planFrequencyCount;subtotal;discount;currency;displayedComponents=["totalAmount","discount","itemDetails","priceDetails","timelineFreeTrial","timelineDebitDay"];allowCoupon=false;currentBreakpoint=y.DESKTOP;discountApplied=false;totalFlow;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;getDurationTranslation(e){const t=this.planFrequency||o.MONTH;if(e===1){return r.translate(`summary.${t}_one`)}else{return r.translate(`summary.${t}_other`,{count:e})}}componentDidLoad(){this.updateTotalFlow()}componentDidUpdate(){this.updateTotalFlow()}updateTotalFlow(){if(this.totalFlow){this.totalFlow.format={style:"currency",currency:this.currency};this.totalFlow.update(Number(l.data.pricing.total))}}handleDiscountApplied(e){this.discountApplied=e.detail}getRecalculatedInstallmentAmount(){const e=l.data?.cardInformation?.installments?.selectedInstallment;if(!e){return 0}if(l.data.pricing.discountAmount>0){const t=l.data.pricing.subtotal;const i=l.data.pricing.totalWithoutInstallment;const a=i/t;return Math.round(e.installmentAmount*a*100)/100}return e.installmentAmount}renderTotalForPlan(){return l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmountToday")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data.pricing.total,this.currency)))}renderTotalForPlanGeneral(){return l.data?.itemInformation?.type===c.PLAN&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data?.pricing?.total,this.currency)))}renderTotalForNonPlan(){return l.data?.itemInformation?.type!==c.PLAN&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data.pricing.total,this.currency)))}renderTrialPeriod(){return l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.totalAmountLastTrialPeriod")),t("rebill-typography",{variant:"body2"},d(l.data?.pricing?.total,this.currency),`/${r.translate(`summary.${this.planFrequency}`,{count:this.planFrequencyCount||1})} `))}renderDiscountAlertWrapper(){return l.data?.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"summary-row"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.trialPeriodDaysDetails",{trialDays:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays})),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.free")))}render(){const e=(e=true,i=true,a=true)=>t("div",{class:"summary-card"},(e||i)&&t("div",{class:"summary-card-info"},e&&t("rebill-typography",{variant:"subtitle-bold",gutterBottom:true},this.itemTitle),i&&this.itemDescription&&t("rebill-typography",{variant:"body2"},this.itemDescription)),a&&t("div",{class:"summary-card-amount"},t("rebill-typography",{variant:"body2"},l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy?d(l.data?.pricing?.planAmount,this.currency):d(this.subtotal,this.currency))));const i=()=>{const e=[this.renderTotalForPlan(),this.renderTotalForPlanGeneral(),this.renderTotalForNonPlan(),this.renderTrialPeriod(),this.renderDiscountAlertWrapper()].filter(Boolean);if(e.length>1){e.splice(e.length-1,0,t("rebill-divider",null))}return t("div",{class:"summary-details"},t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.subtotal")),t("rebill-typography",{variant:"body2"},l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy?d(l.data.pricing.planAmount,this.currency):d(this.subtotal,this.currency))),l.data.pricing.installments&&t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.installments")),t("rebill-typography",{variant:"body2"},v(l.data?.pricing?.installments,this.getRecalculatedInstallmentAmount()))),this.allowCoupon&&!g(this.currentBreakpoint,y.DESKTOP)&&t("discount-coupon",null),!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&t("rebill-divider",null),e.map((e=>t("div",{class:"summary-detail-wrapper"},e))))};const a=()=>this.planFrequency&&this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)&&t("rebill-alert",{variant:"filled",type:"success",icon:"tag-sale",size:"medium",colorIcon:u.GREEN,message:this.discountDuration?r.translate(`summary.planDiscountDescriptionWithDuration`,{discount:this.discountType===p.PERCENTAGE?`${this.discountedPercentage}%`:d(this.discountAmount,this.currency),duration:this.getDurationTranslation(this.discountDuration)}):r.translate(`summary.planDiscountDescriptionWithoutDuration`,{discount:this.discountType===p.PERCENTAGE?`${this.discountedPercentage}%`:d(this.discountAmount,this.currency)})});return t("div",{class:"summary-container"},this.displayedComponents.includes("totalAmount")&&t("div",{class:"summary-header"},l.data?.itemInformation?.type===c.PLAN&&l.data.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"trial-pill"},t("rebill-typography",{variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("summary.trialPill",{days:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays}))),t("div",{class:"total-amount-container"},t("rebill-typography",{variant:"h4-span",align:"center",gutterBottom:true},t("number-flow",{ref:e=>this.totalFlow=e})),this.planFrequency&&t("rebill-typography",{variant:"body1",color:u.SECONDARY,align:"center",gutterBottom:true,style:{fontWeight:"normal"}},`/ ${r.translate(`summary.${this.planFrequency}`,{count:this.planFrequencyCount||1})}`)),l.data?.itemInformation?.type!==c.PLAN&&t("rebill-typography",{variant:"body2",align:"center",gutterBottom:true},r.translate("summary.totalAmount")),this.allowCoupon&&g(this.currentBreakpoint,y.DESKTOP)&&t("discount-coupon",{"hide-label":true})),this.displayedComponents.includes("itemDetails")&&(g(this.currentBreakpoint,y.DESKTOP)?t("collapsible-card",{header:r.translate("summary.details")},e(true,true,true)):t("collapsible-card",{header:this.itemTitle},e(false,!!this.itemDescription,true))),this.displayedComponents.includes("discount")&&g(this.currentBreakpoint,y.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a(),this.displayedComponents.includes("timelineFreeTrial")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&!g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-free-trial",{"trial-period-ends-at":l.data?.itemInformation?.trial?.trialPeriodEndsAt,"trial-period-ends-reminder-at":l.data?.itemInformation?.trial?.trialPeriodEndsReminderAt,"trial-period-days":l.data?.itemInformation?.trial?.trialPeriodDays,subtotal:l.data.pricing.subtotal,currency:l.data.pricing.currency,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("timelineDebitDay")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&l.data?.itemInformation?.debitDay&&!g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-debit-day",{"debit-day":l.data?.itemInformation?.debitDay,"total-amount":l.data?.pricing?.total,"plan-amount":l.data?.pricing?.planAmount,currency:l.data?.pricing?.currency,"debit-strategy":l.data?.itemInformation?.debitStrategy,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("priceDetails")&&(g(this.currentBreakpoint,y.DESKTOP)?t("collapsible-card",{header:r.translate("summary.summary")},i()):i()),this.displayedComponents.includes("timelineFreeTrial")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-free-trial",{"trial-period-ends-at":l.data?.itemInformation?.trial?.trialPeriodEndsAt,"trial-period-ends-reminder-at":l.data?.itemInformation?.trial?.trialPeriodEndsReminderAt,"trial-period-days":l.data?.itemInformation?.trial?.trialPeriodDays,subtotal:l.data?.pricing?.subtotal,currency:l.data?.pricing?.currency,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("timelineDebitDay")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&l.data?.itemInformation?.debitDay&&g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-debit-day",{"debit-day":l.data?.itemInformation?.debitDay,"total-amount":l.data?.pricing?.total,"plan-amount":l.data?.pricing?.planAmount,currency:l.data?.pricing?.currency,"debit-strategy":l.data?.itemInformation?.debitStrategy,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("discount")&&!g(this.currentBreakpoint,y.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a())}};he.style=pe;async function be(e){try{await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy text: ",e);throw e}}const me=":host{display:block;position:relative}.test-mode-container{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.info-icon{margin-right:4px;display:flex;align-items:center}.test-mode-chip{display:flex;min-width:149px;height:40px;background:#ffffff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;position:relative;z-index:10}.test-mode-chip.expanded{max-width:579px;height:40px;flex-direction:row;border-radius:20px;justify-content:space-between}.test-mode-container.cards-visible .test-mode-chip.expanded{border-radius:0 0 20px 20px;width:579px}.chip-content{display:flex;align-items:center;gap:2px;justify-content:space-between;min-height:24px;flex-shrink:0;margin-left:18px;margin-right:8px}.chip-content .info-icon{display:flex !important;align-items:center !important;vertical-align:middle !important}.chip-content rebill-typography{display:flex !important;align-items:center !important;line-height:1.5 !important}.test-mode-chip.expanded .chip-content{justify-content:flex-start;width:auto;margin-right:12px}.test-mode-panel{display:flex;align-items:center;width:100%;justify-content:space-between;animation:slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.test-mode-panel.closing{animation:slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.panel-sections{display:flex;align-items:center;gap:12px;flex:1;justify-content:space-between;margin:8px}.cards-section{display:flex;align-items:center;cursor:pointer;border-radius:8px;transition:background-color 0.2s ease}.cards-section .cards-button{display:flex !important;align-items:center !important;justify-content:flex-start !important;margin-left:4px !important}.cards-section .cards-button .card-icon{display:flex !important;align-items:center !important;margin-right:8px !important;vertical-align:middle !important}.cards-section .cards-button rebill-typography{display:flex !important;align-items:center !important;line-height:1 !important}.registration-section{display:flex;align-items:center;gap:2px;cursor:pointer;transition:background-color 0.2s ease;flex:1;min-width:0}.cards-dropdown-panel{position:absolute;bottom:40px;left:0;width:579px;background:#ffffff;border-top:1px solid #e5e7eb;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;border-bottom:none;border-radius:16px 16px 0 0;z-index:15;animation:expandUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);transform-origin:bottom center;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.cards-dropdown-panel.closing{animation:collapseDown 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.card-section{display:flex;flex-direction:column;justify-content:space-between}.header-content{display:flex;align-items:center;gap:8px;margin:8px}.card-details{background:#fafafa;border-radius:8px;border:1px solid #e5e7eb;margin:8px;min-height:223.7px;display:flex;flex-direction:column;justify-content:space-around;padding:16px}.card-row{display:flex;flex-direction:row;gap:24px;align-items:center;background:#ffffff;justify-content:space-around;border-radius:8px;border:1px solid #e5e7eb;width:531px;height:68px}.card-field{display:flex;flex-direction:column;gap:8px;flex:1}.field-value{display:flex;flex-direction:row;align-items:center;gap:8px;max-height:20px}.copy-button{align-items:center}@keyframes slideIn{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}@keyframes slideOut{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-20px)}}@keyframes expandUp{from{opacity:0;transform:translateY(10px) scaleY(0.9)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes collapseDown{from{opacity:1;transform:translateY(0) scaleY(1)}to{opacity:0;transform:translateY(10px) scaleY(0.9)}}";const ue=class{constructor(t){e(this,t)}get el(){return i(this)}isPanelVisible=false;isPanelClosing=false;isCardsPanelVisible=false;isCardsPanelClosing=false;currentLanguage=r.getCurrentLanguage();componentWillLoad(){h.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){h.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=r.getCurrentLanguage()};togglePanel=()=>{if(this.isPanelVisible){this.isPanelClosing=true;if(this.isCardsPanelVisible){this.isCardsPanelClosing=true}setTimeout((()=>{this.isPanelVisible=false;this.isPanelClosing=false;this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)}else{this.isPanelVisible=true}};togglePanelCards=()=>{if(this.isCardsPanelVisible){this.isCardsPanelClosing=true;setTimeout((()=>{this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)}else{this.isCardsPanelVisible=true}};handleCopy=e=>{be(e);this.isCardsPanelClosing=true;setTimeout((()=>{this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)};handleDocsClick=()=>{window.open("https://v3.docs.rebill.com/sdk/checkout","_blank")};renderBasicChip(){return t("div",{class:"chip-content"},t("div",{class:"info-icon"},t("rebill-icon",{name:"circle-info",size:"16px",color:u.ORANGE})),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK,style:{display:"flex",alignItems:"center",justifyContent:"center"}},r.translate("sandbox.testMode")),!this.isPanelVisible&&t("div",{class:"arrow-icon"},t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"arrow-right-circle"}))))}renderExpandedChip(){return t("div",{class:`test-mode-panel ${this.isPanelClosing?"closing":""}`},t("div",{class:"panel-sections"},t("div",{class:"cards-section",onClick:this.togglePanelCards},t("rebill-button",{variant:"text",size:"small",class:"cards-button"},t("rebill-icon",{name:"card-test",class:"card-icon"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},`${r.translate("sandbox.cards")} `),t("rebill-icon",{key:this.isCardsPanelVisible?"chevron-up":"chevron-down",name:this.isCardsPanelVisible?"chevron-up":"chevron-down",style:{marginLeft:"8px"}}))),t("div",{class:"docs-section"},t("rebill-button",{variant:"text",size:"small",onClick:this.handleDocsClick},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY},r.translate("sandbox.docs")),t("rebill-icon",{name:"external-link",style:{marginLeft:"8px"}}))),t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"close"}))))}renderCardsPanel(){return t("div",{class:`cards-dropdown-panel ${this.isCardsPanelClosing?"closing":""}`},t("div",{class:"card-details"},t("div",{class:"card-section"},t("div",{class:"header-content"},t("rebill-icon",{name:"succes",color:u.GREEN}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.successPayment"))),t("div",{class:"card-row"},t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4539148803436467"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.expiryDate")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4539148803436467 01/99 123")},t("rebill-icon",{name:"copy"}))))))),t("div",{class:"card-section"},t("div",{class:"header-content"},t("rebill-icon",{name:"rejected",color:u.ERROR}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.rejectedPayment"))),t("div",{class:"card-row"},t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4485364739527352"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.expiryDate")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4485364739527352 01/99 123")},t("rebill-icon",{name:"copy"})))))))))}render(){return t("div",{key:"905c70ccad56c89a60684ef05f135f2262e5ae38",class:`test-mode-container ${this.isCardsPanelVisible||this.isCardsPanelClosing?"cards-visible":""}`},t("div",{key:"37d3686b5274b640cbcbb3cfff30b1712111a64a",class:`test-mode-chip ${this.isPanelVisible?"expanded":""}`},this.renderBasicChip(),(this.isPanelVisible||this.isPanelClosing)&&this.renderExpandedChip()),(this.isPanelVisible||this.isCardsPanelClosing)&&(this.isCardsPanelVisible||this.isCardsPanelClosing)&&this.renderCardsPanel())}};ue.style=me;const fe=".otp__otp-container{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;position:relative;margin-top:2rem}.otp__user-information{display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;gap:8px}.otp__otp-description-container{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px}.otp__change-email{cursor:pointer;text-decoration:underline;margin-left:0}.otp__change-email:hover{color:var(--rebill-primary-color);text-decoration:underline}.otp__alternative{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:16px;margin:32px;width:100%}.otp__rebill-alert{width:100%}.otp__guest-options{display:flex;flex-direction:column;width:100%;gap:8px;margin-top:auto}.otp__verifying-container{display:flex;align-items:center;justify-content:center;gap:16px;margin:8px 0}.otp__code-resent-container rebill-typography{display:flex;line-height:1}.otp__code-resent-container rebill-icon{flex-shrink:0;display:inline-flex;vertical-align:middle;margin-right:8px}.otp__spinner{width:15px;height:15px;border:2px solid rgba(255, 255, 255, 0.3);border-radius:50%;border-top-color:var(--rebill-color-primary);animation:spin 1s linear infinite;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}@media (max-width: 1024px){.otp__otp-container{min-height:calc(100vh - 40px)}.otp__guest-options{margin-top:32px}}@media (min-width: 1025px){.otp__otp-container{justify-content:flex-start}.otp__guest-options{margin-top:auto;padding-bottom:2rem}}";const ye=class{constructor(t){e(this,t);this.changeEmailClick=a(this,"changeEmailClick");this.returnForm=a(this,"returnForm");this.codeVerified=a(this,"codeVerified")}changeEmailClick;timeLeft=59;isTimerRunning=false;codeResent=false;isVerifying=false;otpValue="";returnForm;codeVerified;error=false;timer=f({duration:59,onTick:e=>{this.timeLeft=e},onComplete:()=>{this.isTimerRunning=false}});messageTimer=f({duration:5,onComplete:()=>{this.codeResent=false}});disconnectedCallback(){this.timer.stop()}startTimer(){this.timer.start();this.isTimerRunning=true}handleResendCode=async()=>{if(!this.isTimerRunning){await n.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.codeResent=true;this.messageTimer.start();this.startTimer();this.error=false}};handleOtpChange=e=>{this.otpValue=e;if(e.length===6){this.handleVerifyOtp(e);this.error=false}};handleVerifyOtp=async e=>{this.isVerifying=true;try{const t=await n.otp.verify(l.data.sessionId,{email:l.data.userInformation.email,code:e});this.codeVerified.emit(t.data);b.setUserInformation({...t.data.customer,fullName:`${t.data.customer.firstName} ${t.data.customer.lastName}`.trim(),phoneNumber:{number:t.data.customer.phoneNumbers[0].number,countryCode:t.data.customer.phoneNumbers[0].countryCode},address:{billingAddress:{address:t.data.customer.addresses[0].lineOne,zip:t.data.customer.addresses[0].zipCode,city:t.data.customer.addresses[0].city,state:t.data.customer.addresses[0].state,country:t.data.customer.addresses[0].country}},documentType:t.data.customer.identifications[0].type,documentNumber:t.data.customer.identifications[0].value});b.setAccessToken(t.data.accessToken);b.setCustomerId(t.data.customer.id);this.otpValue="";this.error=false}catch(e){this.error=true}finally{this.isVerifying=false}};render(){return t("div",{key:"342b5631b2dfe15cc24880cf7d6d77b6c10ab12d",class:"otp__otp-container"},t("div",{key:"c6bf7502fa3f9c1940d1d07360a47c17cc2fdeb2",class:"otp__user-information"},t("div",{key:"078a4cb4dd563ff1ddfbc02f70e8c923f6973d0f",class:"otp__otp-description-container"},t("rebill-typography",{key:"d8ae4e71ee4e35b033347c6bc99200e48e5b9705",variant:"body2",class:"otp__otp-description"},r.translate("otp.description")),t("rebill-typography",{key:"2466a357c835bcd8314aa5f53aefabb474fdf55f",variant:"subtitle-bold",class:"otp__otp-description-digits"}," ",t("strong",{key:"3a4263b93f5ad7f9aec482f1d1eef76952cf60d3"},r.translate("otp.descriptionDigits"))," "),t("rebill-typography",{key:"d77b23e3581d353e2fdd73debe4fbc0e987376c4",variant:"body2",class:"otp__otp-description-email"},r.translate("otp.descriptionEmail"))),t("rebill-typography",{key:"723a510062706eed71186cf6b1a252f58554a4fc",variant:"body2",class:"otp__otp-email-line"},l.data.userInformation.email," ",!l.data.prefilledData?.email&&t("span",{key:"46fb8563cb20d2ae7a6d8bc8d369d8a985ff85f3",class:"otp__change-email",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.change")))),t("input-otp",{key:"8ed8dc00b9131753f6f23178e607049e6bc4ea72",otp:this.otpValue,onOtpChange:e=>this.handleOtpChange(e.detail),error:this.error?r.translate("otp.error"):""}),this.isVerifying&&t("div",{key:"364e208afc986a3272bf24b282c169fb243b86db",class:"otp__verifying-container"},t("rebill-typography",{key:"02cec9d49145d0f953b84d9ee0fbf015f5004d8d",variant:"subtitle2",color:u.PRIMARY},r.translate("otp.verifyingCode")),t("div",{key:"b436acb222dd7db455a86e4063567519e309d85e",class:"otp__spinner"})),t("rebill-button",{key:"ac5bcb96f2fac2426579ac33ca2f84f36e3dda51",type:"button",variant:"outline",theme:this.isTimerRunning?"secondary":"primary",disabled:this.isTimerRunning,onClick:this.handleResendCode,size:"small",style:{height:"24px",marginBottom:"8px"}},this.isTimerRunning?`${r.translate("otp.resendCodeIn")} (${this.timer.getFormattedTime()})`:r.translate("otp.resendCode")),this.codeResent&&t("div",{key:"b5f54b7f537c0e382d2c1a3ff79a24f2cf4e63a9",class:"otp__code-resent-container"},t("rebill-typography",{key:"4aeaeb7d4d37eab63ca63419dccb54e1b7d2fda8",variant:"subtitle2",color:u.GREEN},t("rebill-icon",{key:"4fea914f167a28bb06e0cf69d833fda493752d55",name:"check-radio"}),r.translate("otp.codeResent"))),t("rebill-alert",{key:"a8bcbdbc5af7a9e6a12bc842dd8142812638f3fa",class:"otp__rebill-alert",type:"secure",variant:"variant-info",message:r.translate("otp.infoMessage"),icon:"circle-info",alertTitle:r.translate("otp.infoTitle"),colorIcon:u.PRIMARY_DARK_LIGHT}),t("div",{key:"9ff81fa5dce0deaec0a292d2e25d396f559a27a5",class:"otp__alternative"},t("rebill-typography",{key:"b8e4f23db473f1049f4f6eae5a489722053aa24a",variant:"body2",color:u.PRIMARY_DARK},"o")),t("div",{key:"87a52e07d7c709c95517f0f3606d843c6580f9bf",class:"otp__guest-options"},t("rebill-button",{key:"3fb138f038065cb6ec2852f313de1eae3d194748",type:"button",variant:"outline",theme:"secondary",size:"medium",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.continueAsGuest")),t("rebill-alert",{key:"3bd11b6a8a91c2690998c2f7af36e872e485fffe",type:"secure",variant:"variant-secure",icon:"lock-outline",message:r.translate("otp.secureMessage")})))}};ye.style=fe;const ge=".modal-overlay{position:fixed;top:0;left:0;right:0;background-color:transparent;display:flex;align-items:center;justify-content:center;z-index:10000;padding:12px 16px;box-sizing:border-box}.modal-content{background:white;border-radius:8px;padding:16px 20px;width:350px;box-shadow:0 4px 12px -2px rgba(0, 0, 0, 0.15),\n 0 2px 4px -1px rgba(0, 0, 0, 0.1);position:relative;display:flex;align-items:center;gap:12px}.modal-content .alert{margin:0;flex:1;padding:0;background:transparent;border:none;box-shadow:none}.modal-content .alert{background-color:transparent !important;border-color:transparent !important}.modal-content .alert-message{display:flex;flex-direction:column;gap:4px}.modal-content .close-button{position:absolute;top:8px;right:8px;width:20px;height:20px;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color 0.2s ease;padding:0;margin:0;outline:none;box-shadow:none;line-height:1}.modal-content .close-button:focus{outline:none;box-shadow:none}.modal-content .close-button:hover{background-color:#f0f0f0}.modal-content .close-button rebill-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}@media (max-width: 768px){.modal-overlay{padding:8px 12px}.modal-content{padding:12px 16px;flex-direction:column;gap:8px;text-align:center}.modal-content .close-button{width:100%}}";const xe=class{constructor(t){e(this,t)}visible=true;languageUpdateTrigger=0;unsubscribeCurrentLocaleStore;autoCloseTimer;componentDidLoad(){this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.languageUpdateTrigger++}));this.autoCloseTimer=f({duration:30,onComplete:()=>{this.closeModal()}});this.autoCloseTimer.start()}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}if(this.autoCloseTimer){this.autoCloseTimer.stop()}}closeModal=()=>{this.visible=false;if(this.autoCloseTimer){this.autoCloseTimer.stop()}};render(){if(!this.visible)return null;return t("div",{class:"modal-overlay"},t("div",{class:"modal-content"},t("div",{class:"alert info filled medium"},t("div",{class:"alert-icon"},t("rebill-icon",{name:"circle-info",size:"16px",color:u.ORANGE})),t("div",{class:"alert-message"},t("div",{class:"alert-title"},t("rebill-typography",{variant:"subtitle-bold",color:u.PRIMARY_DARK},r.translate("session.refreshedTitle"))),t("div",{class:"alert-message-text"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("session.refreshedMessage"))))),t("button",{onClick:this.closeModal,class:"close-button",type:"button"},t("rebill-icon",{name:"close",size:"20px"}))))}};xe.style=ge;const ve=":host{display:flex;position:relative;width:100%;justify-content:center;align-items:center}.mode-sandbox-mobile__test-mode-container{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.mode-sandbox-mobile__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.5);z-index:5;animation:fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);pointer-events:auto;cursor:pointer}.mode-sandbox-mobile__test-mode-chip-mobile{display:flex;width:100%;min-width:auto;max-width:100%;height:40px;background:#ffffff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;position:relative;z-index:20}.mode-sandbox-mobile__chip-content-mobile{display:flex;align-items:center;gap:2px;justify-content:flex-end;min-height:24px;flex-shrink:0;width:100%;margin:8px}.mode-sandbox-mobile__info-icon{display:flex;align-items:center}.mode-sandbox-mobile__test-mode-chip-mobile.expanded .mode-sandbox-mobile__chip-content-mobile{justify-content:flex-end;width:100%}.mode-sandbox-mobile__cards-dropdown-panel-header{display:flex;align-items:center;gap:8px;padding:8px}.mode-sandbox-mobile__docs-section{display:flex;align-items:center;gap:8px;cursor:pointer;margin-left:0;transition:background-color 0.2s ease;justify-content:flex-end;padding:8px;margin-top:8px}.mode-sandbox-mobile__cards-dropdown-panel{position:absolute;top:100%;left:0;right:0;width:100%;background:#ffffff;border-top:none;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb;margin-top:16px;z-index:25;animation:expandDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);transform-origin:top center}.mode-sandbox-mobile__card-section{display:flex;flex-direction:column;justify-content:space-between}.mode-sandbox-mobile__header-content{display:flex;align-items:center;gap:8px;margin:8px}.mode-sandbox-mobile__card-details{background:#fafafa;border-radius:8px;border:1px solid #e5e7eb;margin:8px;min-height:208px;display:flex;flex-direction:column}.mode-sandbox-mobile__card-row{display:flex;gap:12px;align-items:stretch;background:#ffffff;justify-content:space-around;border-radius:8px;border:1px solid #e5e7eb;height:auto;padding:8px;margin:8px}.mode-sandbox-mobile__card-value{display:flex;flex-direction:column;gap:6px;flex:1}.mode-sandbox-mobile__field-value{display:flex;flex-direction:row;align-items:center;gap:8px;max-height:20px}.mode-sandbox-mobile__copy-button{align-items:center;margin-left:auto;margin-right:0}.mode-sandbox-mobile__icon-button{margin-left:auto;margin-right:16px}@keyframes expandDown{from{opacity:0;transform:translateY(-10px) scaleY(0.9)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}";const _e=class{constructor(t){e(this,t)}get el(){return i(this)}isPanelVisible=false;currentLanguage=r.getCurrentLanguage();componentWillLoad(){h.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){h.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=r.getCurrentLanguage()};togglePanel=()=>{this.isPanelVisible=!this.isPanelVisible};handleCopy=e=>{be(e);this.isPanelVisible=false};handleDocsClick=()=>{window.open("https://v3.docs.rebill.com/sdk/checkout","_blank")};renderBasicChip(){return t("div",{class:"mode-sandbox-mobile__chip-content-mobile"},t("div",{class:"mode-sandbox-mobile__info-icon"},t("rebill-icon",{name:"circle-info",size:"24px",color:u.ORANGE})),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.testMode")),t("div",{class:"mode-sandbox-mobile__icon-button"},t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"hamburger"}))))}renderCardsPanel(){return t("div",{class:"mode-sandbox-mobile__cards-dropdown-panel"},t("div",{class:"mode-sandbox-mobile__cards-dropdown-panel-header"},t("rebill-icon",{name:"card-test"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.cardTest"))),t("div",{class:"mode-sandbox-mobile__card-details"},t("div",{class:"mode-sandbox-mobile__card-section"},t("div",{class:"mode-sandbox-mobile__header-content"},t("rebill-icon",{name:"succes",color:u.GREEN}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.successPayment"))),t("div",{class:"mode-sandbox-mobile__card-row"},t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4539148803436467"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.exp")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"mode-sandbox-mobile__copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4539148803436467 01/99 123")},t("rebill-icon",{name:"copy"}))))))),t("div",{class:"mode-sandbox-mobile__card-section"},t("div",{class:"mode-sandbox-mobile__header-content"},t("rebill-icon",{name:"rejected",color:u.ERROR}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.rejectedPayment"))),t("div",{class:"mode-sandbox-mobile__card-row"},t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4485364739527352"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.exp")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"mode-sandbox-mobile__copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4485364739527352 01/99 123")},t("rebill-icon",{name:"copy"})))))))),t("div",{class:"mode-sandbox-mobile__docs-section",onClick:this.handleDocsClick},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY},r.translate("sandbox.docs")),t("rebill-icon",{name:"external-link"})))}render(){return t("div",{key:"2051c42d557dcdfc491dc679684aa585e6b8375a",class:`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible?"cards-visible":""}`},this.isPanelVisible&&t("div",{key:"90291e86c59667a2055457ad99aad90deb8f1dd7",class:"mode-sandbox-mobile__overlay"}),t("div",{key:"c405adb07262da6175badba97245914469480905",class:`mode-sandbox-mobile__test-mode-chip-mobile ${this.isPanelVisible?"expanded":""}`},this.renderBasicChip()),this.isPanelVisible&&this.renderCardsPanel())}};_e.style=ve;const we=":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}.success-page__text-content{margin-bottom:2rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.success-page__success-content{display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%;overflow-x:hidden;box-sizing:border-box}.success-page__lottie-container{width:80px;height:80px}.success-page__success-content rebill-typography[variant='h3']{margin:0 !important;padding:0 !important}.success-page__success-icon{display:flex;justify-content:center;margin:0.5rem 0}.success-page__info-card{padding:24px;gap:16px;width:100%;max-width:450px;border:1px solid #ebedef;border-radius:8px;display:flex;flex-direction:column;box-sizing:border-box}.success-page__card-row{display:flex;justify-content:space-between;align-items:start;min-height:20px;gap:15%}.success-page__card-row:last-of-type{margin-bottom:0}.success-page__card-value{display:flex;align-items:center;gap:0.5rem}.success-page__payment-method-display{display:flex;align-items:center;gap:8px;justify-content:center}.success-page__payment-method-display rebill-card-icon{display:inline-block;flex-shrink:0;margin-right:8px;vertical-align:middle}.success-page__payment-method-display rebill-card-icon svg{display:block}.success-page__payment-method-display rebill-icon{display:inline-block;vertical-align:middle;margin-right:8px}.success-page__payment-method-display rebill-icon div{display:block}.success-page__card-divider{height:1px;background:#e5e7eb}.success-page__download-container{display:flex;align-items:center;justify-content:flex-start;gap:2px;text-decoration:none;cursor:pointer}.success-page__contact-info{text-align:left}.success-page__reference-number{word-break:break-all;overflow-wrap:break-word;hyphens:auto;max-width:100%;text-align:right}.success-page__total-amount-container{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-direction:row}.success-page__trial-pill{background-color:var(--rebill-color-green-light-2);border-radius:4px;padding:4px 6px 4px 6px;display:flex;align-items:center;justify-content:center}.success-page__next-charge-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}.success-page__next-charge-details{display:flex;justify-content:space-between;align-items:flex-start}.success-page__next-charge-amount{display:flex;flex-direction:row;align-items:center;gap:4px}.success-page__next-charge-date{text-align:right}.success-page__next-charge-section{margin-top:12px;padding-top:12px}@media (max-width: 1024px){.success-page__success-content{max-width:100%;gap:1.5rem;margin-left:16px;margin-right:16px}.success-page__info-card{width:100%;max-width:100%;padding:12px}.success-page__text-content{gap:12px}}@media (max-width: 767px){.success-page__info-card{padding:12px}.success-page__processing-container{padding:0 16px}}";const ke=class{constructor(t){e(this,t);this.successRedirect=a(this,"successRedirect")}typePaymentMethod=m.CARD;country="";bank="";paymentMethodName="";cardLastFour="";paymentDate="";referenceNumber="";trialPeriodDays=0;debitDay=0;planAmount=0;currentLocale=l.currentLocale;breakpoint=y.DESKTOP;successRedirect;loaderProgress=0;isLoadingLottie=true;showRedirectMessage=false;timeToRedirect=3e3;progressInterval;lottieContainer;lottieAnimation;unsubscribeCurrentLocaleStore;successDisplayTimeout;applyStartCaseToBrand=e=>{if(!e)return"";return e.toLowerCase().split(/[\s-]+/).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")};getPaymentDate=()=>{const e=l?.data?.payment;if(!e)return"";if("createdAt"in e){return e.createdAt}return""};componentWillLoad(){this.breakpoint=x(window.innerWidth);this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.currentLocale=l.currentLocale}));if(l.data?.itemInformation?.redirectSuccess){this.successDisplayTimeout=window.setTimeout((()=>{this.showRedirectMessage=true;this.loadLottieAnimation()}),1500);setTimeout((()=>{let e=l.data?.itemInformation?.redirectSuccess;if(e){this.successRedirect.emit({redirectUrl:e});this.stopLoaderAnimation()}}),this.timeToRedirect)}}componentDidLoad(){window.addEventListener("resize",this.handleResize);if(!l.data?.itemInformation?.redirectSuccess||this.showRedirectMessage){this.loadLottieAnimation()}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}if(this.successDisplayTimeout){clearTimeout(this.successDisplayTimeout)}window.removeEventListener("resize",this.handleResize);this.stopLoaderAnimation()}handleResize=()=>{this.breakpoint=x(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-GK75wIKe.js").then((function(e){return e.l}));const t=await fetch(C(`loader-redirect1.json`));const i=await t.json();if(this.lottieContainer){this.lottieAnimation=e.default.loadAnimation({container:this.lottieContainer,renderer:"svg",loop:true,autoplay:true,animationData:i})}else{this.startLoaderAnimation()}}catch(e){this.startLoaderAnimation()}};startLoaderAnimation=()=>{const e=3e3;const t=50;const i=t/e*100;this.progressInterval=window.setInterval((()=>{this.loaderProgress=Math.min(this.loaderProgress+i,100);if(this.loaderProgress>=100){this.stopLoaderAnimation()}}),t)};stopLoaderAnimation=()=>{if(this.progressInterval){clearInterval(this.progressInterval);this.progressInterval=undefined}if(this.lottieAnimation){this.lottieAnimation.destroy();this.lottieAnimation=undefined}};handleDownloadReceipt=async()=>{try{await $.generateAndDownloadReceipt({paymentMethod:this.typePaymentMethod===m.CARD?this.textPaymentMethodCard():this.paymentMethodName,...this.typePaymentMethod===m.BANK_TRANSFER&&{bank:this.bank},...this.typePaymentMethod===m.CARD&&{cardBrand:this.applyStartCaseToBrand(l.data.cardInformation?.brand||"")},...this.typePaymentMethod===m.CARD&&{cardLastFour:this.cardLastFour??l.data.cardInformation?.lastFour},paymentDate:D(this.getPaymentDate())||"",email:l?.data?.userInformation?.email||"",referenceNumber:this.referenceNumber,productTitle:l?.data?.itemInformation?.title||"",subtotal:this.getFormattedSubtotal(),total:this.getFormattedTotal(),currency:l?.data?.pricing?.currency||" ",installments:l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment?`${_(l.data?.cardInformation?.installments?.selectedInstallment?.installment,k(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)}\n( ${r.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )${l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===w.CUSTOMER_FINANCED?`\n${r.translate("installments.interest")}`:""}`:"",discountAmount:this.getFormattedDiscountAmount(),trialPeriodDays:this.trialPeriodDays||l.data?.itemInformation?.trial?.trialPeriodDays,debitDay:this.debitDay||l.data?.itemInformation?.debitDay,planAmount:this.getFormattedSubtotal(this.planAmount),trialEndDate:this.hasFreeTrial()?this.getTrialEndDateFormatted():undefined,debitDate:this.hasDebitDay()?this.getDebitDateFormatted():undefined,isBankTransfer:this.typePaymentMethod===m.BANK_TRANSFER})}catch(e){console.error("Error downloading receipt:",e)}};getFormattedDiscountAmount=()=>{if(l?.data?.pricing?.discountAmount>0){const e=d(l.data?.pricing?.discountAmount,l.data?.pricing?.currency);return`-${e}`}return undefined};getFormattedSubtotal=(e=null)=>d(e||l?.data?.pricing?.subtotal,l?.data?.pricing?.currency);getFormattedTotal=()=>{if(this.trialPeriodDays>0){return d(0,l?.data?.pricing?.currency)}return d(l?.data?.pricing?.total,l?.data?.pricing?.currency)};hasFreeTrial=()=>l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&l.data?.itemInformation?.trial?.trialPeriodDays>0;hasDebitDay=()=>{const e=l.data?.itemInformation?.debitDay;return e&&e>0};getTrialEndDateFormatted=()=>{const e=l.data?.itemInformation?.trial?.trialPeriodEndsAt;if(!e)return"";const t=new Date(e);const i=r.getCurrentLanguage();const a=i==="es"?"es-ES":i==="pt"?"pt-BR":"en-US";if(i==="en"){return`${t.toLocaleDateString(a,{month:"long"})} ${t.getDate()}`}else{return`${t.getDate()} de ${t.toLocaleDateString(a,{month:"long"})}`}};getDebitDateFormatted=()=>{const e=l.data?.itemInformation?.debitDay;if(!e||e<=0)return"";const t=new Date;const i=new Date(t);const a=r.getCurrentLanguage();const s=a==="es"?"es-ES":a==="pt"?"pt-BR":"en-US";if(e<t.getDate()){i.setMonth(t.getMonth()+1)}i.setDate(e);while(i.getDate()!==e){i.setDate(i.getDate()-1)}if(a==="en"){return`${i.toLocaleDateString(s,{month:"long"})} ${i.getDate()}`}else{return`${i.getDate()} de ${i.toLocaleDateString(s,{month:"long"})}`}};textPaymentMethodCard=()=>{const e=l.data?.cardInformation?.brand;const t=this.cardLastFour||l?.data?.cardInformation?.lastFour;const i=this.applyStartCaseToBrand(e||"");return e&&t?`${i} - ${t}`:i};render(){const e=l.data?.itemInformation?.redirectSuccess;return t("rebill-checkout-single-column",{key:"d8a814c5353cd2dcaa053ea6c205be11870f7629"},t("div",{key:"cf05e7f864a87a41db23b76f366c7c8516a721c0",class:"success-page__success-content"},t("rebill-typography",{key:"729d64601641e56b8551d5c3d74daae3a18b6b0a",variant:"h3",color:u.PRIMARY_DARK_TEXT},e&&this.showRedirectMessage?r.translate("processing.redirectMessage"):r.translate("processing.successTitle")),e&&this.showRedirectMessage?t("div",{class:"redirect-message"},t("div",{class:"success-page__lottie-container"},t("div",{ref:e=>this.lottieContainer=e,class:"lottie-animation"}))):t("div",{class:"success-page__success-icon"},t("svg",{width:g(this.breakpoint,y.DESKTOP)?"64":"96",height:g(this.breakpoint,y.DESKTOP)?"64":"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z",fill:"#35B093"}))),t("div",{key:"cb7dc105388b2db7c3b34057c5c4ffd98910bee2",class:"success-page__info-card"},t("div",{key:"00819afd49ef6aeef2411dff4f942385c80ba07e",class:"success-page__card-row"},t("rebill-typography",{key:"4a9a03c161b12037b47e1eae87e22c5160806e2c",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentMethod")),t("div",{key:"dc27668c563154151bdaec58410b8c73086f61fd",class:"success-page__card-value"},t("div",{key:"7c96a29c17134201c004cd65fb515de5cf691340",class:"success-page__payment-method-display"},this.typePaymentMethod===m.CARD&&t(t.Fragment,null,t("rebill-card-icon",{key:"530f18b793bbf92cf2a9e61eaad6f68a609dc1a7","card-brand":l.data?.cardInformation?.brand||""}),t("rebill-typography",{key:"52e4866e3a05a30e5bb7cd715720178bb787c600",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===m.BANK_TRANSFER&&t("div",{key:"acfeb7d49fb573410f7f9df7f794c784b119accd",style:{display:"flex",alignItems:"center",gap:"8px"}},t("rebill-icon",{key:"dec188702fe1c02ea3aa01697b466564c3cce778",name:j(m.BANK_TRANSFER,this.country)?.toLowerCase()||"card"}),t("rebill-typography",{key:"2e2a40216a852b0fbc40670e92fd639f9b3af795",variant:"body2",color:u.PRIMARY_DARK_TEXT},r.translate("paymentMethods.bank_transfer")))))),l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment&&t("div",{key:"ea79aae58cfaaeb3df39224ed29189aa14d82f45"},t("div",{key:"4335fe58d7e4f4f91881f9dd629cf7ae93945a54",class:"success-page__card-row"},t("rebill-typography",{key:"ef6fbe06758da4e54f3dfd529f7c188167ef70de",variant:"body2",color:u.SECONDARY},r.translate("summary.installments")),t("div",{key:"6881217b5feea6fa09bee824d4b7aace4950f603",style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"end"}},t("rebill-typography",{key:"e8225b7a2450e67e46902263af208633e21c852d",variant:"body2",color:u.PRIMARY_DARK_TEXT,style:{textAlign:"end"}},_(l.data?.cardInformation?.installments?.selectedInstallment?.installment,k(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)),t("rebill-typography",{key:"fb989d76d8ed0ef97e74e5a9a9f2be4ebc36b044",variant:"body2",color:u.PRIMARY_DARK_TEXT},`( ${r.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )`),l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===w.CUSTOMER_FINANCED&&t("rebill-typography",{key:"5a278b1b9a0ead71519bccf12d80f5a0f6d6c667",variant:"italic",color:u.SECONDARY,style:{textAlign:"end"}},`${r.translate("installments.interest")}`)))),t("div",{key:"4ca2babffc451d62f60da51dfaf8cf5ef903ee6b",class:"success-page__card-row"},t("rebill-typography",{key:"6e20687a11a8cac9cb519978bee200ca846b6bf4",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentDate")),t("rebill-typography",{key:"eae77c8ddcadc04f4c359aee9cf2d663889d4f82",variant:"body2",color:u.PRIMARY_DARK_TEXT},D(this.paymentDate||this.getPaymentDate()||l.createdAt)||"")),t("div",{key:"72ae70f80bbf27fa7ab72107d3075ba13721c8f2",class:"success-page__card-row"},t("rebill-typography",{key:"d85fbe86c79e7c18186bd23e2ab7123525f67ca6",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentEmail")),t("rebill-typography",{key:"8f4db224d31ad6294badbef2c05344b11887fa27",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.userInformation?.email)),t("div",{key:"05e205e63cb7958a749b0fe8297ccde914f421e1",class:"success-page__card-row"},t("rebill-typography",{key:"63c726338cb62abff925f7787a2d6b0d731133a0",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentReference")),t("rebill-typography",{key:"12186b7939c0ebbdb2548c4513af1822aebb67c8",variant:"body2",color:u.PRIMARY_DARK_TEXT,class:"success-page__reference-number"},this.referenceNumber||""))),t("div",{key:"00d9b3804dd02addd8011e29533929a56d7aa58c",class:"success-page__info-card"},t("rebill-typography",{key:"ed5ae2237d800cf0cac6e9f880a9c7b6ec9bd8a3",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.purchaseDetails")),t("div",{key:"d13b348ce1ee55c83db8c10d0b3b4aca972b7f3a",class:"success-page__card-row"},t("rebill-typography",{key:"55d16b897fe8c34131eeec05587cef14313bfd62",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseDetail")),t("rebill-typography",{key:"97123778ac864648a4e330915bafe84514460d24",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.itemInformation?.title||"")),!this.trialPeriodDays&&t("div",{key:"537f89e71e8fb8c6079befb71ff1a61e99187cf6",class:"success-page__card-row"},t("rebill-typography",{key:"0e9e1cf4ae6d5bca97dfd51ed4a12b275d19719a",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseSubtotal")),t("rebill-typography",{key:"d45380840cdf35ffc18ecd618cb94c0f0eb5bdd3",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),l?.data?.pricing?.discountAmount>0&&t("div",{key:"c34df5787398ba9c6339ac1348052c4a47fc7c79",class:"success-page__card-row"},t("rebill-typography",{key:"a733017918477463f73cd32a6475e8d2e4c37781",variant:"body2",color:u.SECONDARY},r.translate("summary.discount")),t("rebill-typography",{key:"ccb6e46656104b12c8f93ba34c96f3bc97c836ed",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedDiscountAmount())),t("div",{key:"03c41ca60d1306aac047efb56a7fcec0e8842b17",class:"success-page__card-row"},t("rebill-typography",{key:"0418a54826aaea0d2b878d9da6f3093494e53ad3",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseMontoTotal")),t("div",{key:"14d58e7438a6d3cc621753568d83da25585eb5e0",class:"success-page__total-amount-container"},this.trialPeriodDays>0&&t("div",{key:"eecdaa2ca9577bbedf05e35d0518353a88952e17",class:"success-page__trial-pill"},t("rebill-typography",{key:"4ec8fbe451b03ab6489db62abb44725a3f42ccfc",variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("processing.trialPill",{days:this.trialPeriodDays,count:this.trialPeriodDays}))),t("rebill-typography",{key:"d6e12a5401f68e01d2c7ea1706cf6c885a69e021",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),(this.trialPeriodDays||this.hasDebitDay())&&t("div",{key:"a7ee99c9416ad1d995c59927909214300e021491",class:"success-page__card-divider"}),(this.hasFreeTrial()||this.hasDebitDay())&&t("div",{key:"c167a90f0ce8da005833a89f3acaebf1e8079b19",class:"success-page__next-charge-section"},t("div",{key:"c0817733aa17655d5578c96c07a87b5a3d847c03",class:"success-page__next-charge-header"},t("rebill-typography",{key:"3e218d2bbe78b3542e7f53d784d735b6e4480c34",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.nextCharge")),t("rebill-typography",{key:"03a7c5048d6e952b7532fb45974dcb47512d34dd",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.onDate",{date:this.hasFreeTrial()?this.getTrialEndDateFormatted():this.getDebitDateFormatted()}))),t("div",{key:"ac92777a58bd9fd68b16c3c545718f2885893253",class:"success-page__card-row"},t("rebill-typography",{key:"680b1b3386cff3bdc72e059cbfd5901fe65a86ce",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.hasFreeTrial()?r.translate("processing.atEndOfTrial"):""),t("rebill-typography",{key:"9dc76d0befc14922fda0a3ba66fd020cf08098f6",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal(this.planAmount)," ",r.translate("processing.perMonth")))),t("div",{key:"6c91add3a1941d5aeef60406841391cf2a420ea8",class:"success-page__card-divider"}),t("div",{key:"f8f64653e37c1a2c2b8540adf6175168789d6bdb",class:"success-page__download-container"},t("svg",{key:"d865caf674a68d00550b8312d941fec103879ca6",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"b3b7b7042666e928af0e1928b46a4289049ff03a",d:"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})),t("rebill-button",{key:"437f61a8a544e8681c84b09dabb18afbfcd01fb8",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},t("rebill-typography",{key:"7613ff0df859a82ebd04f36829378a28d5f789de",variant:"overline",color:u.PRIMARY_DARK_TEXT},r.translate("processing.download")))),t("div",{key:"6c4c9be607a1007244c4ce8b97c0d25d28723575",class:"success-page__contact-info"},t("rebill-typography",{key:"ce01fffce36a31c6a30672c552a438805276201b",variant:"information-text",color:u.SECONDARY},r.translate("processing.downloadDescription"))))))}};ke.style=we;const Ce=":host{display:block}.inputs-container{display:flex;flex-direction:column;gap:16px;width:100%}.customer-exists{display:flex;justify-content:flex-end;margin-bottom:16px}";const $e=class{constructor(t){e(this,t);this.onRebillAccountClick=a(this,"onRebillAccountClick")}userInformation={email:"",fullName:"",countryCode:""};errors=null;customerExists=false;disabled=false;onRebillAccountClick;translateError(e){if(!e)return"";if(e.includes("validation.")||e.includes("paymentErrors.")){return r.translate(e)}return e}handleInputChange(e){if(!e.detail)return;const{id:t,value:i}=e.detail;b.setUserInformation({[t]:i})}handleBlur(e){if(!e.detail)return;const{id:t,value:i}=e.detail;b.setUserInformation({[t]:i})}getCardLabels(){const e=[];if(l.data.prefilledData.email){e.push({label:r.translate("userInformation.emailPlaceholder"),value:l.data.prefilledData.email});b.setUserInformation({...l.data.userInformation,email:l.data.prefilledData.email})}if(l.data.prefilledData.fullName){e.push({label:r.translate("userInformation.fullNamePlaceholder"),value:l.data.prefilledData.fullName});b.setUserInformation({...l.data.userInformation,fullName:l.data.prefilledData.fullName})}return e}async handleRebillAccountClick(){n.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.onRebillAccountClick.emit(true)}renderInputs(){const e=l.data.prefilledData.email;const i=l.data.prefilledData.fullName;const a=[];if(!e){a.push(t("rebill-input-text",{id:"email",variant:"floating",label:r.translate("userInformation.emailPlaceholder"),placeholder:r.translate("userInformation.emailPlaceholder"),"left-icon":"email",clearable:true,disabled:this.disabled,error:this.translateError(this.errors?.email)}))}if(!i){a.push(t("rebill-input-text",{id:"fullName",variant:"floating",label:r.translate("userInformation.fullNamePlaceholder"),placeholder:r.translate("userInformation.fullNamePlaceholder"),disabled:this.disabled,error:this.translateError(this.errors?.fullName)}))}return a.length>0?t("div",{class:"inputs-container",style:{marginTop:a.length>0&&(e||i)?"1rem":"0"}},a):null}render(){const e=t("div",{key:"46bb2f98219e56c8723289e3348514c4f27b4a53",class:"customer-exists"},t("rebill-button",{key:"eb6f81a732df9ef04a4c278588cd57998cbb6c25",style:{visibility:this.customerExists?"visible":"hidden",opacity:this.customerExists?"1":"0",transition:"opacity 0.3s ease-in-out"},variant:"text",size:"small",onClick:()=>this.handleRebillAccountClick(),icon:"lock"},r.translate("userInformation.rebillAccount"),t("rebill-icon",{key:"d270f5d5f8e2fecb9a6b39d439172c99233cc86d",name:"arrow-right"})));const i=l.data.prefilledData.email;const a=l.data.prefilledData.fullName;const n=i||a;return t(s,{key:"97e0d4dd9b6d3c798eee919274d4ed9be854319d"},e,n&&t("rebill-card",{key:"18f3d53e0386be0b4dff09bcfdcf69885d0093e7",cardTitle:r.translate("userInformation.personalInformation"),cardLabels:this.getCardLabels()}),this.renderInputs())}};$e.style=Ce;export{ye as otp_component,xe as rebill_modal_overlay,ue as rebill_mode_sandbox,_e as rebill_mode_sandbox_mobile,he as rebill_summary,ke as success_page,$e as user_information};
2
- //# sourceMappingURL=p-075927af.entry.js.map
1
+ import{r as e,h as t,g as i,c as a,H as s}from"./p-D8cwEAmw.js";import{a as n}from"./p-CTo1s54i.js";import{I as r,c as o,s as l,b as c,f as d,d as p,e as h,a as b,P as m}from"./p-_KJrM-e7.js";import{C as u}from"./p-DA598vBj.js";import{c as f}from"./p-bcHxwlBu.js";import{B as y,i as g,g as x}from"./p-Do_vNuMa.js";import{g as v,a as _,E as w,b as k}from"./p-tIhL6zxg.js";import{g as C}from"./p-B96SyP8A.js";import{P as $,g as j}from"./p-2D2ZgtY0.js";import{f as D}from"./p-Bridn86q.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const T=(e,t,i)=>{const a=document.createElement(e),[s,n]=Array.isArray(t)?[void 0,t]:[t,i];return s&&Object.assign(a,s),n==null||n.forEach((e=>a.appendChild(e))),a},z=(e,t)=>{var i;return t==="left"?e.offsetLeft:(((i=e.offsetParent instanceof HTMLElement?e.offsetParent:null)==null?void 0:i.offsetWidth)??0)-e.offsetWidth-e.offsetLeft},S=e=>e.offsetWidth>0&&e.offsetHeight>0,A=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function P(e,t,{reverse:i=false}={}){const a=e.length;for(let s=i?a-1:0;i?s>=0:s<a;i?s--:s++)t(e[s],s)}function M(e,t,i,a){const s=t.formatToParts(e);i&&s.unshift({type:"prefix",value:i}),a&&s.push({type:"suffix",value:a});const n=[],r=[],o=[],l=[],c={},d=e=>`${e}:${c[e]=(c[e]??-1)+1}`;let p="",h=false,b=false;for(const e of s){p+=e.value;const t=e.type==="minusSign"||e.type==="plusSign"?"sign":e.type;t==="integer"?(h=true,r.push(...e.value.split("").map((e=>({type:t,value:parseInt(e)}))))):t==="group"?r.push({type:t,value:e.value}):t==="decimal"?(b=true,o.push({type:t,value:e.value,key:d(t)})):t==="fraction"?o.push(...e.value.split("").map((e=>({type:t,value:parseInt(e),key:d(t),pos:-1-c[t]})))):(h||b?l:n).push({type:t,value:e.value,key:d(t)})}const m=[];for(let e=r.length-1;e>=0;e--){const t=r[e];m.unshift(t.type==="integer"?{...t,key:d(t.type),pos:c[t.type]}:{...t,key:d(t.type)})}return{pre:n,integer:m,fraction:o,post:l,valueAsString:p,value:typeof e=="string"?parseFloat(e):e}}const L=String.raw,I=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return false}return true})(),N=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),E=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,B="--_number-flow-d-opacity",R="--_number-flow-d-width",F="--_number-flow-dx",U="--_number-flow-d",V=(()=>{try{return CSS.registerProperty({name:B,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:F,syntax:"<length>",inherits:true,initialValue:"0px"}),CSS.registerProperty({name:R,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:true,initialValue:"0"}),true}catch{return false}})(),W="var(--number-flow-char-height, 1em)",Y="var(--number-flow-mask-height, 0.25em)",X=`calc(${Y} / 2)`,q="var(--number-flow-mask-width, 0.5em)",O=`calc(${q} / var(--scale-x))`,H="#000 0, transparent 71%",Z=L`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${W} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${R}) / var(--width));transform:translateX(var(${F})) scaleX(var(--scale-x));margin:0 calc(-1 * ${q});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${O},#000 calc(100% - ${O}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${Y},#000 calc(100% - ${Y}),transparent 100% ),radial-gradient(at bottom right,${H}),radial-gradient(at bottom left,${H}),radial-gradient(at top left,${H}),radial-gradient(at top right,${H});-webkit-mask-size:100% calc(100% - ${Y} * 2),calc(100% - ${O} * 2) 100%,${O} ${Y},${O} ${Y},${O} ${Y},${O} ${Y};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${X} ${q};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${F})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${U})}.digit__num,.number .section::after{padding:${X} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${B}))}`,G=HTMLElement,K=N&&I&&V;let J;class Q extends G{constructor(){super(),this.created=false,this.batched=false;const{animated:e,...t}=this.constructor.defaultProps;this._animated=this.computedAnimated=e,Object.assign(this,t)}get animated(){return this._animated}set animated(e){var t;this.animated!==e&&(this._animated=e,(t=this.shadowRoot)==null||t.getAnimations().forEach((e=>e.finish())))}set data(e){var t;if(e==null)return;const{pre:i,integer:a,fraction:s,post:n,value:r}=e;if(this.created){const o=this._data;this._data=e,this.computedTrend=typeof this.trend=="function"?this.trend(o.value,r):this.trend,this.computedAnimated=K&&this._animated&&(!this.respectMotionPreference||!(E!=null&&E.matches))&&S(this),(t=this.plugins)==null||t.forEach((t=>{var i;return(i=t.onUpdate)==null?void 0:i.call(t,e,o,this)})),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:a,fraction:s}),this._post.update(n),this.batched||this.didUpdate()}else{this._data=e,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)J||(J=new CSSStyleSheet,J.replaceSync(Z)),this.shadowRoot.adoptedStyleSheets=[J];else{const e=document.createElement("style");e.textContent=Z,this.shadowRoot.appendChild(e)}this._pre=new ae(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new ee(this,a,s),this.shadowRoot.appendChild(this._num.el),this._post=new ae(this,n,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=true}try{this._internals.ariaLabel=e.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const e=new AbortController;Promise.all(this.shadowRoot.getAnimations().map((e=>e.finished))).then((()=>{e.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)})),this._abortAnimationsFinish=e}}Q.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:true,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:true,plugins:void 0,digits:void 0};class ee{constructor(e,t,i,{className:a,...s}={}){this.flow=e,this._integer=new ie(e,t,{justify:"right",part:"integer"}),this._fraction=new ie(e,i,{justify:"left",part:"fraction"}),this._inner=T("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=T("span",{...s,part:"number",className:`number ${a??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:e,fraction:t}){this._integer.update(e),this._fraction.update(t)}didUpdate(){const e=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const t=this._prevLeft-e.left,i=this.el.offsetWidth,a=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[F]:[`${t}px`,"0px"],[R]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class te{constructor(e,t,{justify:i,className:a,...s},n){this.flow=e,this.children=new Map,this.onCharRemove=e=>()=>{this.children.delete(e)},this.justify=i;const r=t.map((e=>this.addChar(e).el));this.el=T("span",{...s,className:`section section--justify-${i} ${a??""}`},n?n(r):r)}addChar(e,{startDigitsAtZero:t=false,...i}={}){const a=e.type==="integer"||e.type==="fraction"?new re(this,e.type,t?0:e.value,e.pos,{...i,onRemove:this.onCharRemove(e.key)}):new oe(this,e.type,e.value,{...i,onRemove:this.onCharRemove(e.key)});return this.children.set(e.key,a),a}unpop(e){e.el.removeAttribute("inert"),e.el.style.top="",e.el.style[this.justify]=""}pop(e){e.forEach((e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${z(e.el,this.justify)}px`})),e.forEach((e=>{e.el.setAttribute("inert",""),e.present=false}))}addNewAndUpdateExisting(e){const t=new Map,i=new Map,a=this.justify==="left",s=a?"prepend":"append";if(P(e,(e=>{let a;this.children.has(e.key)?(a=this.children.get(e.key),i.set(e,a),this.unpop(a),a.present=true):(a=this.addChar(e,{startDigitsAtZero:true,animateIn:true}),t.set(e,a)),this.el[s](a.el)}),{reverse:a}),this.flow.computedAnimated){const e=this.el.getBoundingClientRect();t.forEach((t=>{t.willUpdate(e)}))}t.forEach(((e,t)=>{e.update(t.value)})),i.forEach(((e,t)=>{e.update(t.value)}))}willUpdate(){const e=this.el.getBoundingClientRect();this._prevOffset=e[this.justify],this.children.forEach((t=>t.willUpdate(e)))}didUpdate(){const e=this.el.getBoundingClientRect();this.children.forEach((t=>t.didUpdate(e)));const t=e[this.justify],i=this._prevOffset-t;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class ie extends te{update(e){const t=new Map;this.children.forEach(((i,a)=>{e.find((e=>e.key===a))||t.set(a,i),this.unpop(i)})),this.addNewAndUpdateExisting(e),t.forEach((e=>{e instanceof re&&e.update(0)})),this.pop(t)}}class ae extends te{update(e){const t=new Map;this.children.forEach(((i,a)=>{e.find((e=>e.key===a))||t.set(a,i)})),this.pop(t),this.addNewAndUpdateExisting(e)}}class se{constructor(e,t,{onRemove:i,animateIn:a=false}={}){this.flow=e,this.el=t,this._present=true,this._remove=()=>{var e;this.el.remove(),(e=this._onRemove)==null||e.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&a&&this.el.animate({[B]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(e){if(this._present!==e){if(this._present=e,e?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){e||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",e?"0":"-.999"),this.el.animate({[B]:e?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),e?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:true})}}}class ne extends se{constructor(e,t,i,a){super(e.flow,i,a),this.section=e,this.value=t,this.el=i}}class re extends ne{constructor(e,t,i,a,s){var n,r;const o=(((r=(n=e.flow.digits)==null?void 0:n[a])==null?void 0:r.max)??9)+1,l=Array.from({length:o}).map(((e,t)=>{const a=T("span",{className:"digit__num"},[document.createTextNode(String(t))]);return t!==i&&a.setAttribute("inert",""),a.style.setProperty("--n",String(t)),a})),c=T("span",{part:`digit ${t}-digit`,className:"digit"},l);c.style.setProperty("--current",String(i)),c.style.setProperty("--length",String(o)),super(e,i,c,s),this.pos=a,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=o}willUpdate(e){const t=this.el.getBoundingClientRect();this._prevValue=this.value;const i=t[this.section.justify]-e[this.section.justify],a=t.width/2;this._prevCenter=this.section.justify==="left"?i+a:i-a}update(e){this.el.style.setProperty("--current",String(e)),this._numbers.forEach(((t,i)=>i===e?t.removeAttribute("inert"):t.setAttribute("inert",""))),this.value=e}didUpdate(e){const t=this.el.getBoundingClientRect(),i=t[this.section.justify]-e[this.section.justify],a=t.width/2,s=this.section.justify==="left"?i+a:i-a,n=this._prevCenter-s;n&&this.el.animate({transform:[`translateX(${n}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const r=this.getDelta();r&&(this.el.classList.add("is-spinning"),this.el.animate({[U]:[-r,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:true}))}getDelta(){var e;if(this.flow.plugins)for(const t of this.flow.plugins){const i=(e=t.getDelta)==null?void 0:e.call(t,this.value,this._prevValue,this);if(i!=null)return i}const t=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(t);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:t}}class oe extends ne{constructor(e,t,i,a){const s=T("span",{className:"symbol__value",textContent:i});super(e,i,T("span",{part:`symbol ${t}`,className:"symbol"},[s]),a),this.type=t,this._children=new Map,this._onChildRemove=e=>()=>{this._children.delete(e)},this._children.set(i,new se(this.flow,s,{onRemove:this._onChildRemove(i)}))}willUpdate(e){if(this.type==="decimal")return;const t=this.el.getBoundingClientRect();this._prevOffset=t[this.section.justify]-e[this.section.justify]}update(e){if(this.value!==e){const t=this._children.get(this.value);t&&(t.present=false);const i=this._children.get(e);if(i)i.present=true;else{const t=T("span",{className:"symbol__value",textContent:e});this.el.appendChild(t),this._children.set(e,new se(this.flow,t,{animateIn:true,onRemove:this._onChildRemove(e)}))}}this.value=e}didUpdate(e){if(this.type==="decimal")return;const t=this.el.getBoundingClientRect()[this.section.justify]-e[this.section.justify],i=this._prevOffset-t;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const le="number-flow-connect",ce="number-flow-update";class de extends Q{constructor(){super(...arguments),this.connected=false}connectedCallback(){this.connected=true,this.dispatchEvent(new Event(le,{bubbles:true}))}disconnectedCallback(){this.connected=false}get value(){return this._value}update(e){(!this._formatter||this._prevFormat!==this.format||this._prevLocales!==this.locales)&&(this._formatter=new Intl.NumberFormat(this.locales,this.format),this._prevFormat=this.format,this._prevLocales=this.locales),e!=null&&(this._value=e),this.dispatchEvent(new Event(ce,{bubbles:true})),this.data=M(this._value,this._formatter,this.numberPrefix,this.numberSuffix)}}A("number-flow",de);const pe=".summary-container {\n width: 100%;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n gap: 40px;\n background-color: var(--rebill-color-background-right);\n}\n.summary-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n}\n\n.trial-pill {\n background-color: var(--rebill-color-green-light-2);\n border-radius: 4px;\n padding: 4px 6px 4px 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.total-amount-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n}\n\n@media (max-width: 1024px) {\n .summary-container {\n gap: 1.5rem !important;\n background-color: var(--rebill-color-background);\n }\n .summary-header {\n margin-top: 24px;\n }\n .summary-row.total {\n margin-top: 0 !important;\n }\n}\n\n.summary-card {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 24px;\n padding: 0px;\n background: #ffffff;\n}\n\n.summary-card-info {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.summary-card-amount {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.summary-details {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.summary-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n & > :nth-child(2) {\n text-align: right;\n }\n}\n\n.summary-row.total {\n margin-top: 1rem;\n font-weight: bold;\n}\n\n@media (min-width: 1025px) and (max-width: 1450px) {\n .summary-container {\n margin: 0px 10px;\n max-width: 400px;\n }\n}\n";const he=class{constructor(t){e(this,t)}totalAmount;itemTitle;itemDescription;itemAmount;planFrequency;planFrequencyCount;subtotal;discount;currency;displayedComponents=["totalAmount","discount","itemDetails","priceDetails","timelineFreeTrial","timelineDebitDay"];allowCoupon=false;currentBreakpoint=y.DESKTOP;discountApplied=false;totalFlow;discountType;discountedPercentage=0;discountDuration=0;discountAmount=0;getDurationTranslation(e){const t=this.planFrequency||o.MONTH;if(e===1){return r.translate(`summary.${t}_one`)}else{return r.translate(`summary.${t}_other`,{count:e})}}componentDidLoad(){this.updateTotalFlow()}componentDidUpdate(){this.updateTotalFlow()}updateTotalFlow(){if(this.totalFlow){this.totalFlow.format={style:"currency",currency:this.currency};this.totalFlow.update(Number(l.data.pricing.total))}}handleDiscountApplied(e){this.discountApplied=e.detail}getRecalculatedInstallmentAmount(){const e=l.data?.cardInformation?.installments?.selectedInstallment;if(!e){return 0}if(l.data.pricing.discountAmount>0){const t=l.data.pricing.subtotal;const i=l.data.pricing.totalWithoutInstallment;const a=i/t;return Math.round(e.installmentAmount*a*100)/100}return e.installmentAmount}renderTotalForPlan(){return l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmountToday")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data.pricing.total,this.currency)))}renderTotalForPlanGeneral(){return l.data?.itemInformation?.type===c.PLAN&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data?.pricing?.total,this.currency)))}renderTotalForNonPlan(){return l.data?.itemInformation?.type!==c.PLAN&&t("div",{class:"summary-row total"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},d(l.data.pricing.total,this.currency)))}renderTrialPeriod(){return l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.totalAmountLastTrialPeriod")),t("rebill-typography",{variant:"body2"},d(l.data?.pricing?.total,this.currency),`/${r.translate(`summary.${this.planFrequency}`,{count:this.planFrequencyCount||1})} `))}renderDiscountAlertWrapper(){return l.data?.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"summary-row"},t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.trialPeriodDaysDetails",{trialDays:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays})),t("rebill-typography",{variant:g(this.currentBreakpoint,y.DESKTOP)?"subtitle1":"body3",style:{fontWeight:g(this.currentBreakpoint,y.DESKTOP)?"normal":"bold"}},r.translate("summary.free")))}render(){const e=(e=true,i=true,a=true)=>t("div",{class:"summary-card"},(e||i)&&t("div",{class:"summary-card-info"},e&&t("rebill-typography",{variant:"subtitle-bold",gutterBottom:true},this.itemTitle),i&&this.itemDescription&&t("rebill-typography",{variant:"body2"},this.itemDescription)),a&&t("div",{class:"summary-card-amount"},t("rebill-typography",{variant:"body2"},l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy?d(l.data?.pricing?.planAmount,this.currency):d(this.subtotal,this.currency))));const i=()=>{const e=[this.renderTotalForPlan(),this.renderTotalForPlanGeneral(),this.renderTotalForNonPlan(),this.renderTrialPeriod(),this.renderDiscountAlertWrapper()].filter(Boolean);if(e.length>1){e.splice(e.length-1,0,t("rebill-divider",null))}return t("div",{class:"summary-details"},t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.subtotal")),t("rebill-typography",{variant:"body2"},l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy?d(l.data.pricing.planAmount,this.currency):d(this.subtotal,this.currency))),l.data.pricing.installments&&t("div",{class:"summary-row"},t("rebill-typography",{variant:"body2"},r.translate("summary.installments")),t("rebill-typography",{variant:"body2"},v(l.data?.pricing?.installments,this.getRecalculatedInstallmentAmount()))),this.allowCoupon&&!g(this.currentBreakpoint,y.DESKTOP)&&t("discount-coupon",null),!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&t("rebill-divider",null),e.map((e=>t("div",{class:"summary-detail-wrapper"},e))))};const a=()=>this.planFrequency&&this.discountApplied&&(this.discountedPercentage>0||this.discountAmount>0)&&t("rebill-alert",{variant:"filled",type:"success",icon:"tag-sale",size:"medium",colorIcon:u.GREEN,message:this.discountDuration?r.translate(`summary.planDiscountDescriptionWithDuration`,{discount:this.discountType===p.PERCENTAGE?`${this.discountedPercentage}%`:d(this.discountAmount,this.currency),duration:this.getDurationTranslation(this.discountDuration)}):r.translate(`summary.planDiscountDescriptionWithoutDuration`,{discount:this.discountType===p.PERCENTAGE?`${this.discountedPercentage}%`:d(this.discountAmount,this.currency)})});return t("div",{class:"summary-container"},this.displayedComponents.includes("totalAmount")&&t("div",{class:"summary-header"},l.data?.itemInformation?.type===c.PLAN&&l.data.itemInformation?.trial?.trialPeriodDays&&t("div",{class:"trial-pill"},t("rebill-typography",{variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("summary.trialPill",{days:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays}))),t("div",{class:"total-amount-container"},t("rebill-typography",{variant:"h4-span",align:"center",gutterBottom:true},t("number-flow",{ref:e=>this.totalFlow=e})),this.planFrequency&&t("rebill-typography",{variant:"body1",color:u.SECONDARY,align:"center",gutterBottom:true,style:{fontWeight:"normal"}},`/ ${r.translate(`summary.${this.planFrequency}`,{count:this.planFrequencyCount||1})}`)),l.data?.itemInformation?.type!==c.PLAN&&t("rebill-typography",{variant:"body2",align:"center",gutterBottom:true},r.translate("summary.totalAmount")),this.allowCoupon&&g(this.currentBreakpoint,y.DESKTOP)&&t("discount-coupon",{"hide-label":true})),this.displayedComponents.includes("itemDetails")&&(g(this.currentBreakpoint,y.DESKTOP)?t("collapsible-card",{header:r.translate("summary.details")},e(true,true,true)):t("collapsible-card",{header:this.itemTitle},e(false,!!this.itemDescription,true))),this.displayedComponents.includes("discount")&&g(this.currentBreakpoint,y.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a(),this.displayedComponents.includes("timelineFreeTrial")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&!g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-free-trial",{"trial-period-ends-at":l.data?.itemInformation?.trial?.trialPeriodEndsAt,"trial-period-ends-reminder-at":l.data?.itemInformation?.trial?.trialPeriodEndsReminderAt,"trial-period-days":l.data?.itemInformation?.trial?.trialPeriodDays,subtotal:l.data.pricing.subtotal,currency:l.data.pricing.currency,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("timelineDebitDay")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&l.data?.itemInformation?.debitDay&&!g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-debit-day",{"debit-day":l.data?.itemInformation?.debitDay,"total-amount":l.data?.pricing?.total,"plan-amount":l.data?.pricing?.planAmount,currency:l.data?.pricing?.currency,"debit-strategy":l.data?.itemInformation?.debitStrategy,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("priceDetails")&&(g(this.currentBreakpoint,y.DESKTOP)?t("collapsible-card",{header:r.translate("summary.summary")},i()):i()),this.displayedComponents.includes("timelineFreeTrial")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-free-trial",{"trial-period-ends-at":l.data?.itemInformation?.trial?.trialPeriodEndsAt,"trial-period-ends-reminder-at":l.data?.itemInformation?.trial?.trialPeriodEndsReminderAt,"trial-period-days":l.data?.itemInformation?.trial?.trialPeriodDays,subtotal:l.data?.pricing?.subtotal,currency:l.data?.pricing?.currency,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("timelineDebitDay")&&l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.debitStrategy&&l.data?.itemInformation?.debitDay&&g(this.currentBreakpoint,y.DESKTOP)&&t("rebill-timeline-debit-day",{"debit-day":l.data?.itemInformation?.debitDay,"total-amount":l.data?.pricing?.total,"plan-amount":l.data?.pricing?.planAmount,currency:l.data?.pricing?.currency,"debit-strategy":l.data?.itemInformation?.debitStrategy,"discount-applied":this.discountApplied,"discount-type":this.discountType,"discounted-percentage":this.discountedPercentage,"discount-duration":this.discountDuration,"discount-amount":this.discountAmount}),this.displayedComponents.includes("discount")&&!g(this.currentBreakpoint,y.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a())}};he.style=pe;async function be(e){try{await navigator.clipboard.writeText(e)}catch(e){console.error("Failed to copy text: ",e);throw e}}const me=":host{display:block;position:relative}.test-mode-container{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.info-icon{margin-right:4px;display:flex;align-items:center}.test-mode-chip{display:flex;min-width:149px;height:40px;background:#ffffff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;position:relative;z-index:10}.test-mode-chip.expanded{max-width:579px;height:40px;flex-direction:row;border-radius:20px;justify-content:space-between}.test-mode-container.cards-visible .test-mode-chip.expanded{border-radius:0 0 20px 20px;width:579px}.chip-content{display:flex;align-items:center;gap:2px;justify-content:space-between;min-height:24px;flex-shrink:0;margin-left:18px;margin-right:8px}.chip-content .info-icon{display:flex !important;align-items:center !important;vertical-align:middle !important}.chip-content rebill-typography{display:flex !important;align-items:center !important;line-height:1.5 !important}.test-mode-chip.expanded .chip-content{justify-content:flex-start;width:auto;margin-right:12px}.test-mode-panel{display:flex;align-items:center;width:100%;justify-content:space-between;animation:slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.test-mode-panel.closing{animation:slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.panel-sections{display:flex;align-items:center;gap:12px;flex:1;justify-content:space-between;margin:8px}.cards-section{display:flex;align-items:center;cursor:pointer;border-radius:8px;transition:background-color 0.2s ease}.cards-section .cards-button{display:flex !important;align-items:center !important;justify-content:flex-start !important;margin-left:4px !important}.cards-section .cards-button .card-icon{display:flex !important;align-items:center !important;margin-right:8px !important;vertical-align:middle !important}.cards-section .cards-button rebill-typography{display:flex !important;align-items:center !important;line-height:1 !important}.registration-section{display:flex;align-items:center;gap:2px;cursor:pointer;transition:background-color 0.2s ease;flex:1;min-width:0}.cards-dropdown-panel{position:absolute;bottom:40px;left:0;width:579px;background:#ffffff;border-top:1px solid #e5e7eb;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;border-bottom:none;border-radius:16px 16px 0 0;z-index:15;animation:expandUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);transform-origin:bottom center;transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.cards-dropdown-panel.closing{animation:collapseDown 0.3s cubic-bezier(0.4, 0, 0.2, 1)}.card-section{display:flex;flex-direction:column;justify-content:space-between}.header-content{display:flex;align-items:center;gap:8px;margin:8px}.card-details{background:#fafafa;border-radius:8px;border:1px solid #e5e7eb;margin:8px;min-height:223.7px;display:flex;flex-direction:column;justify-content:space-around;padding:16px}.card-row{display:flex;flex-direction:row;gap:24px;align-items:center;background:#ffffff;justify-content:space-around;border-radius:8px;border:1px solid #e5e7eb;width:531px;height:68px}.card-field{display:flex;flex-direction:column;gap:8px;flex:1}.field-value{display:flex;flex-direction:row;align-items:center;gap:8px;max-height:20px}.copy-button{align-items:center}@keyframes slideIn{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}@keyframes slideOut{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-20px)}}@keyframes expandUp{from{opacity:0;transform:translateY(10px) scaleY(0.9)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes collapseDown{from{opacity:1;transform:translateY(0) scaleY(1)}to{opacity:0;transform:translateY(10px) scaleY(0.9)}}";const ue=class{constructor(t){e(this,t)}get el(){return i(this)}isPanelVisible=false;isPanelClosing=false;isCardsPanelVisible=false;isCardsPanelClosing=false;currentLanguage=r.getCurrentLanguage();componentWillLoad(){h.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){h.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=r.getCurrentLanguage()};togglePanel=()=>{if(this.isPanelVisible){this.isPanelClosing=true;if(this.isCardsPanelVisible){this.isCardsPanelClosing=true}setTimeout((()=>{this.isPanelVisible=false;this.isPanelClosing=false;this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)}else{this.isPanelVisible=true}};togglePanelCards=()=>{if(this.isCardsPanelVisible){this.isCardsPanelClosing=true;setTimeout((()=>{this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)}else{this.isCardsPanelVisible=true}};handleCopy=e=>{be(e);this.isCardsPanelClosing=true;setTimeout((()=>{this.isCardsPanelVisible=false;this.isCardsPanelClosing=false}),300)};handleDocsClick=()=>{window.open("https://v3.docs.rebill.com/sdk/checkout","_blank")};renderBasicChip(){return t("div",{class:"chip-content"},t("div",{class:"info-icon"},t("rebill-icon",{name:"circle-info",size:"16px",color:u.ORANGE})),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK,style:{display:"flex",alignItems:"center",justifyContent:"center"}},r.translate("sandbox.testMode")),!this.isPanelVisible&&t("div",{class:"arrow-icon"},t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"arrow-right-circle"}))))}renderExpandedChip(){return t("div",{class:`test-mode-panel ${this.isPanelClosing?"closing":""}`},t("div",{class:"panel-sections"},t("div",{class:"cards-section",onClick:this.togglePanelCards},t("rebill-button",{variant:"text",size:"small",class:"cards-button"},t("rebill-icon",{name:"card-test",class:"card-icon"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},`${r.translate("sandbox.cards")} `),t("rebill-icon",{key:this.isCardsPanelVisible?"chevron-up":"chevron-down",name:this.isCardsPanelVisible?"chevron-up":"chevron-down",style:{marginLeft:"8px"}}))),t("div",{class:"docs-section"},t("rebill-button",{variant:"text",size:"small",onClick:this.handleDocsClick},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY},r.translate("sandbox.docs")),t("rebill-icon",{name:"external-link",style:{marginLeft:"8px"}}))),t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"close"}))))}renderCardsPanel(){return t("div",{class:`cards-dropdown-panel ${this.isCardsPanelClosing?"closing":""}`},t("div",{class:"card-details"},t("div",{class:"card-section"},t("div",{class:"header-content"},t("rebill-icon",{name:"succes",color:u.GREEN}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.successPayment"))),t("div",{class:"card-row"},t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4539148803436467"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.expiryDate")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4539148803436467 01/99 123")},t("rebill-icon",{name:"copy"}))))))),t("div",{class:"card-section"},t("div",{class:"header-content"},t("rebill-icon",{name:"rejected",color:u.ERROR}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.rejectedPayment"))),t("div",{class:"card-row"},t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4485364739527352"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.expiryDate")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4485364739527352 01/99 123")},t("rebill-icon",{name:"copy"})))))))))}render(){return t("div",{key:"905c70ccad56c89a60684ef05f135f2262e5ae38",class:`test-mode-container ${this.isCardsPanelVisible||this.isCardsPanelClosing?"cards-visible":""}`},t("div",{key:"37d3686b5274b640cbcbb3cfff30b1712111a64a",class:`test-mode-chip ${this.isPanelVisible?"expanded":""}`},this.renderBasicChip(),(this.isPanelVisible||this.isPanelClosing)&&this.renderExpandedChip()),(this.isPanelVisible||this.isCardsPanelClosing)&&(this.isCardsPanelVisible||this.isCardsPanelClosing)&&this.renderCardsPanel())}};ue.style=me;const fe=".otp__otp-container{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%;position:relative;margin-top:2rem}.otp__user-information{display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;gap:8px}.otp__otp-description-container{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px}.otp__change-email{cursor:pointer;text-decoration:underline;margin-left:0}.otp__change-email:hover{color:var(--rebill-primary-color);text-decoration:underline}.otp__alternative{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:16px;margin:32px;width:100%}.otp__rebill-alert{width:100%}.otp__guest-options{display:flex;flex-direction:column;width:100%;gap:8px;margin-top:auto}.otp__verifying-container{display:flex;align-items:center;justify-content:center;gap:16px;margin:8px 0}.otp__code-resent-container rebill-typography{display:flex;line-height:1}.otp__code-resent-container rebill-icon{flex-shrink:0;display:inline-flex;vertical-align:middle;margin-right:8px}.otp__spinner{width:15px;height:15px;border:2px solid rgba(255, 255, 255, 0.3);border-radius:50%;border-top-color:var(--rebill-color-primary);animation:spin 1s linear infinite;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}@media (max-width: 1024px){.otp__otp-container{min-height:calc(100vh - 40px)}.otp__guest-options{margin-top:32px}}@media (min-width: 1025px){.otp__otp-container{justify-content:flex-start}.otp__guest-options{margin-top:auto;padding-bottom:2rem}}";const ye=class{constructor(t){e(this,t);this.changeEmailClick=a(this,"changeEmailClick");this.returnForm=a(this,"returnForm");this.codeVerified=a(this,"codeVerified")}changeEmailClick;timeLeft=59;isTimerRunning=false;codeResent=false;isVerifying=false;otpValue="";returnForm;codeVerified;error=false;timer=f({duration:59,onTick:e=>{this.timeLeft=e},onComplete:()=>{this.isTimerRunning=false}});messageTimer=f({duration:5,onComplete:()=>{this.codeResent=false}});disconnectedCallback(){this.timer.stop()}startTimer(){this.timer.start();this.isTimerRunning=true}handleResendCode=async()=>{if(!this.isTimerRunning){await n.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.codeResent=true;this.messageTimer.start();this.startTimer();this.error=false}};handleOtpChange=e=>{this.otpValue=e;if(e.length===6){this.handleVerifyOtp(e);this.error=false}};handleVerifyOtp=async e=>{this.isVerifying=true;try{const t=await n.otp.verify(l.data.sessionId,{email:l.data.userInformation.email,code:e});this.codeVerified.emit(t.data);b.setUserInformation({...t.data.customer,fullName:`${t.data.customer.firstName} ${t.data.customer.lastName}`.trim(),phoneNumber:{number:t.data.customer.phoneNumbers[0].number,countryCode:t.data.customer.phoneNumbers[0].countryCode},address:{billingAddress:{address:t.data.customer.addresses[0].lineOne,zip:t.data.customer.addresses[0].zipCode,city:t.data.customer.addresses[0].city,state:t.data.customer.addresses[0].state,country:t.data.customer.addresses[0].country}},documentType:t.data.customer.identifications[0].type,documentNumber:t.data.customer.identifications[0].value});b.setAccessToken(t.data.accessToken);b.setCustomerId(t.data.customer.id);this.otpValue="";this.error=false}catch(e){this.error=true}finally{this.isVerifying=false}};render(){return t("div",{key:"342b5631b2dfe15cc24880cf7d6d77b6c10ab12d",class:"otp__otp-container"},t("div",{key:"c6bf7502fa3f9c1940d1d07360a47c17cc2fdeb2",class:"otp__user-information"},t("div",{key:"078a4cb4dd563ff1ddfbc02f70e8c923f6973d0f",class:"otp__otp-description-container"},t("rebill-typography",{key:"d8ae4e71ee4e35b033347c6bc99200e48e5b9705",variant:"body2",class:"otp__otp-description"},r.translate("otp.description")),t("rebill-typography",{key:"2466a357c835bcd8314aa5f53aefabb474fdf55f",variant:"subtitle-bold",class:"otp__otp-description-digits"}," ",t("strong",{key:"3a4263b93f5ad7f9aec482f1d1eef76952cf60d3"},r.translate("otp.descriptionDigits"))," "),t("rebill-typography",{key:"d77b23e3581d353e2fdd73debe4fbc0e987376c4",variant:"body2",class:"otp__otp-description-email"},r.translate("otp.descriptionEmail"))),t("rebill-typography",{key:"723a510062706eed71186cf6b1a252f58554a4fc",variant:"body2",class:"otp__otp-email-line"},l.data.userInformation.email," ",!l.data.prefilledData?.email&&t("span",{key:"46fb8563cb20d2ae7a6d8bc8d369d8a985ff85f3",class:"otp__change-email",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.change")))),t("input-otp",{key:"8ed8dc00b9131753f6f23178e607049e6bc4ea72",otp:this.otpValue,onOtpChange:e=>this.handleOtpChange(e.detail),error:this.error?r.translate("otp.error"):""}),this.isVerifying&&t("div",{key:"364e208afc986a3272bf24b282c169fb243b86db",class:"otp__verifying-container"},t("rebill-typography",{key:"02cec9d49145d0f953b84d9ee0fbf015f5004d8d",variant:"subtitle2",color:u.PRIMARY},r.translate("otp.verifyingCode")),t("div",{key:"b436acb222dd7db455a86e4063567519e309d85e",class:"otp__spinner"})),t("rebill-button",{key:"ac5bcb96f2fac2426579ac33ca2f84f36e3dda51",type:"button",variant:"outline",theme:this.isTimerRunning?"secondary":"primary",disabled:this.isTimerRunning,onClick:this.handleResendCode,size:"small",style:{height:"24px",marginBottom:"8px"}},this.isTimerRunning?`${r.translate("otp.resendCodeIn")} (${this.timer.getFormattedTime()})`:r.translate("otp.resendCode")),this.codeResent&&t("div",{key:"b5f54b7f537c0e382d2c1a3ff79a24f2cf4e63a9",class:"otp__code-resent-container"},t("rebill-typography",{key:"4aeaeb7d4d37eab63ca63419dccb54e1b7d2fda8",variant:"subtitle2",color:u.GREEN},t("rebill-icon",{key:"4fea914f167a28bb06e0cf69d833fda493752d55",name:"check-radio"}),r.translate("otp.codeResent"))),t("rebill-alert",{key:"a8bcbdbc5af7a9e6a12bc842dd8142812638f3fa",class:"otp__rebill-alert",type:"secure",variant:"variant-info",message:r.translate("otp.infoMessage"),icon:"circle-info",alertTitle:r.translate("otp.infoTitle"),colorIcon:u.PRIMARY_DARK_LIGHT}),t("div",{key:"9ff81fa5dce0deaec0a292d2e25d396f559a27a5",class:"otp__alternative"},t("rebill-typography",{key:"b8e4f23db473f1049f4f6eae5a489722053aa24a",variant:"body2",color:u.PRIMARY_DARK},"o")),t("div",{key:"87a52e07d7c709c95517f0f3606d843c6580f9bf",class:"otp__guest-options"},t("rebill-button",{key:"3fb138f038065cb6ec2852f313de1eae3d194748",type:"button",variant:"outline",theme:"secondary",size:"medium",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.continueAsGuest")),t("rebill-alert",{key:"3bd11b6a8a91c2690998c2f7af36e872e485fffe",type:"secure",variant:"variant-secure",icon:"lock-outline",message:r.translate("otp.secureMessage")})))}};ye.style=fe;const ge=".modal-overlay{position:fixed;top:0;left:0;right:0;background-color:transparent;display:flex;align-items:center;justify-content:center;z-index:10000;padding:12px 16px;box-sizing:border-box}.modal-content{background:white;border-radius:8px;padding:16px 20px;width:350px;box-shadow:0 4px 12px -2px rgba(0, 0, 0, 0.15),\n 0 2px 4px -1px rgba(0, 0, 0, 0.1);position:relative;display:flex;align-items:center;gap:12px}.modal-content .alert{margin:0;flex:1;padding:0;background:transparent;border:none;box-shadow:none}.modal-content .alert{background-color:transparent !important;border-color:transparent !important}.modal-content .alert-message{display:flex;flex-direction:column;gap:4px}.modal-content .close-button{position:absolute;top:8px;right:8px;width:20px;height:20px;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color 0.2s ease;padding:0;margin:0;outline:none;box-shadow:none;line-height:1}.modal-content .close-button:focus{outline:none;box-shadow:none}.modal-content .close-button:hover{background-color:#f0f0f0}.modal-content .close-button rebill-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center}@media (max-width: 768px){.modal-overlay{padding:8px 12px}.modal-content{padding:12px 16px;flex-direction:column;gap:8px;text-align:center}.modal-content .close-button{width:100%}}";const xe=class{constructor(t){e(this,t)}visible=true;languageUpdateTrigger=0;unsubscribeCurrentLocaleStore;autoCloseTimer;componentDidLoad(){this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.languageUpdateTrigger++}));this.autoCloseTimer=f({duration:30,onComplete:()=>{this.closeModal()}});this.autoCloseTimer.start()}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}if(this.autoCloseTimer){this.autoCloseTimer.stop()}}closeModal=()=>{this.visible=false;if(this.autoCloseTimer){this.autoCloseTimer.stop()}};render(){if(!this.visible)return null;return t("div",{class:"modal-overlay"},t("div",{class:"modal-content"},t("div",{class:"alert info filled medium"},t("div",{class:"alert-icon"},t("rebill-icon",{name:"circle-info",size:"16px",color:u.ORANGE})),t("div",{class:"alert-message"},t("div",{class:"alert-title"},t("rebill-typography",{variant:"subtitle-bold",color:u.PRIMARY_DARK},r.translate("session.refreshedTitle"))),t("div",{class:"alert-message-text"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("session.refreshedMessage"))))),t("button",{onClick:this.closeModal,class:"close-button",type:"button"},t("rebill-icon",{name:"close",size:"20px"}))))}};xe.style=ge;const ve=":host{display:flex;position:relative;width:100%;justify-content:center;align-items:center}.mode-sandbox-mobile__test-mode-container{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.mode-sandbox-mobile__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.5);z-index:5;animation:fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);pointer-events:auto;cursor:pointer}.mode-sandbox-mobile__test-mode-chip-mobile{display:flex;width:100%;min-width:auto;max-width:100%;height:40px;background:#ffffff;border:1px solid #e5e7eb;border-radius:20px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;position:relative;z-index:20}.mode-sandbox-mobile__chip-content-mobile{display:flex;align-items:center;gap:2px;justify-content:flex-end;min-height:24px;flex-shrink:0;width:100%;margin:8px}.mode-sandbox-mobile__info-icon{display:flex;align-items:center}.mode-sandbox-mobile__test-mode-chip-mobile.expanded .mode-sandbox-mobile__chip-content-mobile{justify-content:flex-end;width:100%}.mode-sandbox-mobile__cards-dropdown-panel-header{display:flex;align-items:center;gap:8px;padding:8px}.mode-sandbox-mobile__docs-section{display:flex;align-items:center;gap:8px;cursor:pointer;margin-left:0;transition:background-color 0.2s ease;justify-content:flex-end;padding:8px;margin-top:8px}.mode-sandbox-mobile__cards-dropdown-panel{position:absolute;top:100%;left:0;right:0;width:100%;background:#ffffff;border-top:none;border-left:1px solid #e5e7eb;border-right:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb;margin-top:16px;z-index:25;animation:expandDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);transform-origin:top center}.mode-sandbox-mobile__card-section{display:flex;flex-direction:column;justify-content:space-between}.mode-sandbox-mobile__header-content{display:flex;align-items:center;gap:8px;margin:8px}.mode-sandbox-mobile__card-details{background:#fafafa;border-radius:8px;border:1px solid #e5e7eb;margin:8px;min-height:208px;display:flex;flex-direction:column}.mode-sandbox-mobile__card-row{display:flex;gap:12px;align-items:stretch;background:#ffffff;justify-content:space-around;border-radius:8px;border:1px solid #e5e7eb;height:auto;padding:8px;margin:8px}.mode-sandbox-mobile__card-value{display:flex;flex-direction:column;gap:6px;flex:1}.mode-sandbox-mobile__field-value{display:flex;flex-direction:row;align-items:center;gap:8px;max-height:20px}.mode-sandbox-mobile__copy-button{align-items:center;margin-left:auto;margin-right:0}.mode-sandbox-mobile__icon-button{margin-left:auto;margin-right:16px}@keyframes expandDown{from{opacity:0;transform:translateY(-10px) scaleY(0.9)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}";const _e=class{constructor(t){e(this,t)}get el(){return i(this)}isPanelVisible=false;currentLanguage=r.getCurrentLanguage();componentWillLoad(){h.on("languageChanged",this.handleLanguageChange)}disconnectedCallback(){h.off("languageChanged",this.handleLanguageChange)}handleLanguageChange=()=>{this.currentLanguage=r.getCurrentLanguage()};togglePanel=()=>{this.isPanelVisible=!this.isPanelVisible};handleCopy=e=>{be(e);this.isPanelVisible=false};handleDocsClick=()=>{window.open("https://v3.docs.rebill.com/sdk/checkout","_blank")};renderBasicChip(){return t("div",{class:"mode-sandbox-mobile__chip-content-mobile"},t("div",{class:"mode-sandbox-mobile__info-icon"},t("rebill-icon",{name:"circle-info",size:"24px",color:u.ORANGE})),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.testMode")),t("div",{class:"mode-sandbox-mobile__icon-button"},t("rebill-button",{variant:"text",size:"small",onClick:this.togglePanel},t("rebill-icon",{name:"hamburger"}))))}renderCardsPanel(){return t("div",{class:"mode-sandbox-mobile__cards-dropdown-panel"},t("div",{class:"mode-sandbox-mobile__cards-dropdown-panel-header"},t("rebill-icon",{name:"card-test"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.cardTest"))),t("div",{class:"mode-sandbox-mobile__card-details"},t("div",{class:"mode-sandbox-mobile__card-section"},t("div",{class:"mode-sandbox-mobile__header-content"},t("rebill-icon",{name:"succes",color:u.GREEN}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.successPayment"))),t("div",{class:"mode-sandbox-mobile__card-row"},t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4539148803436467"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.exp")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"mode-sandbox-mobile__copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4539148803436467 01/99 123")},t("rebill-icon",{name:"copy"}))))))),t("div",{class:"mode-sandbox-mobile__card-section"},t("div",{class:"mode-sandbox-mobile__header-content"},t("rebill-icon",{name:"rejected",color:u.ERROR}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},r.translate("sandbox.rejectedPayment"))),t("div",{class:"mode-sandbox-mobile__card-row"},t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cardNumber")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-icon",{name:"visa"}),t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"4485364739527352"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.exp")),t("div",{class:"mode-sandbox-mobile__field-value"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"01/99"))),t("div",{class:"mode-sandbox-mobile__card-value"},t("rebill-typography",{variant:"subtitle3",color:u.GREY_700},r.translate("sandbox.cvv")),t("div",{class:"mode-sandbox-mobile__field-value mode-sandbox-mobile__field-value-with-copy"},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY_DARK},"123"),t("div",{class:"mode-sandbox-mobile__copy-button"},t("rebill-button",{variant:"text",size:"small",onClick:()=>this.handleCopy("4485364739527352 01/99 123")},t("rebill-icon",{name:"copy"})))))))),t("div",{class:"mode-sandbox-mobile__docs-section",onClick:this.handleDocsClick},t("rebill-typography",{variant:"subtitle2",color:u.PRIMARY},r.translate("sandbox.docs")),t("rebill-icon",{name:"external-link"})))}render(){return t("div",{key:"2051c42d557dcdfc491dc679684aa585e6b8375a",class:`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible?"cards-visible":""}`},this.isPanelVisible&&t("div",{key:"90291e86c59667a2055457ad99aad90deb8f1dd7",class:"mode-sandbox-mobile__overlay"}),t("div",{key:"c405adb07262da6175badba97245914469480905",class:`mode-sandbox-mobile__test-mode-chip-mobile ${this.isPanelVisible?"expanded":""}`},this.renderBasicChip()),this.isPanelVisible&&this.renderCardsPanel())}};_e.style=ve;const we=":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}.success-page__text-content{margin-bottom:2rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.success-page__success-content{display:flex;flex-direction:column;align-items:center;gap:1rem;width:100%;overflow-x:hidden;box-sizing:border-box}.success-page__lottie-container{width:80px;height:80px}.success-page__success-content rebill-typography[variant='h3']{margin:0 !important;padding:0 !important}.success-page__success-icon{display:flex;justify-content:center;margin:0.5rem 0}.success-page__info-card{padding:24px;gap:16px;width:100%;max-width:450px;border:1px solid #ebedef;border-radius:8px;display:flex;flex-direction:column;box-sizing:border-box}.success-page__card-row{display:flex;justify-content:space-between;align-items:start;min-height:20px;gap:15%}.success-page__card-row:last-of-type{margin-bottom:0}.success-page__card-value{display:flex;align-items:center;gap:0.5rem}.success-page__payment-method-display{display:flex;align-items:center;gap:8px;justify-content:center}.success-page__payment-method-display rebill-card-icon{display:inline-block;flex-shrink:0;margin-right:8px;vertical-align:middle}.success-page__payment-method-display rebill-card-icon svg{display:block}.success-page__payment-method-display rebill-icon{display:inline-block;vertical-align:middle;margin-right:8px}.success-page__payment-method-display rebill-icon div{display:block}.success-page__card-divider{height:1px;background:#e5e7eb}.success-page__download-container{display:flex;align-items:center;justify-content:flex-start;gap:2px;text-decoration:none;cursor:pointer}.success-page__contact-info{text-align:left}.success-page__reference-number{word-break:break-all;overflow-wrap:break-word;hyphens:auto;max-width:100%;text-align:right}.success-page__total-amount-container{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-direction:row}.success-page__trial-pill{background-color:var(--rebill-color-green-light-2);border-radius:4px;padding:4px 6px 4px 6px;display:flex;align-items:center;justify-content:center}.success-page__next-charge-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:12px}.success-page__next-charge-details{display:flex;justify-content:space-between;align-items:flex-start}.success-page__next-charge-amount{display:flex;flex-direction:row;align-items:center;gap:4px}.success-page__next-charge-date{text-align:right}.success-page__next-charge-section{margin-top:12px;padding-top:12px}@media (max-width: 1024px){.success-page__success-content{max-width:100%;gap:1.5rem;margin-left:16px;margin-right:16px}.success-page__info-card{width:100%;max-width:100%;padding:12px}.success-page__text-content{gap:12px}}@media (max-width: 767px){.success-page__info-card{padding:12px}.success-page__processing-container{padding:0 16px}}";const ke=class{constructor(t){e(this,t);this.successRedirect=a(this,"successRedirect")}typePaymentMethod=m.CARD;country="";bank="";paymentMethodName="";cardLastFour="";paymentDate="";referenceNumber="";trialPeriodDays=0;debitDay=0;planAmount=0;currentLocale=l.currentLocale;breakpoint=y.DESKTOP;successRedirect;loaderProgress=0;isLoadingLottie=true;showRedirectMessage=false;timeToRedirect=3e3;progressInterval;lottieContainer;lottieAnimation;unsubscribeCurrentLocaleStore;successDisplayTimeout;applyStartCaseToBrand=e=>{if(!e)return"";return e.toLowerCase().split(/[\s-]+/).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")};getPaymentDate=()=>{const e=l?.data?.payment;if(!e)return"";if("createdAt"in e){return e.createdAt}return""};componentWillLoad(){this.breakpoint=x(window.innerWidth);this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.currentLocale=l.currentLocale}));if(l.data?.itemInformation?.redirectSuccess){this.successDisplayTimeout=window.setTimeout((()=>{this.showRedirectMessage=true;this.loadLottieAnimation()}),1500);setTimeout((()=>{let e=l.data?.itemInformation?.redirectSuccess;if(e){this.successRedirect.emit({redirectUrl:e});this.stopLoaderAnimation()}}),this.timeToRedirect)}}componentDidLoad(){window.addEventListener("resize",this.handleResize);if(!l.data?.itemInformation?.redirectSuccess||this.showRedirectMessage){this.loadLottieAnimation()}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}if(this.successDisplayTimeout){clearTimeout(this.successDisplayTimeout)}window.removeEventListener("resize",this.handleResize);this.stopLoaderAnimation()}handleResize=()=>{this.breakpoint=x(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-GK75wIKe.js").then((function(e){return e.l}));const t=await fetch(C(`loader-redirect1.json`));const i=await t.json();if(this.lottieContainer){this.lottieAnimation=e.default.loadAnimation({container:this.lottieContainer,renderer:"svg",loop:true,autoplay:true,animationData:i})}else{this.startLoaderAnimation()}}catch(e){this.startLoaderAnimation()}};startLoaderAnimation=()=>{const e=3e3;const t=50;const i=t/e*100;this.progressInterval=window.setInterval((()=>{this.loaderProgress=Math.min(this.loaderProgress+i,100);if(this.loaderProgress>=100){this.stopLoaderAnimation()}}),t)};stopLoaderAnimation=()=>{if(this.progressInterval){clearInterval(this.progressInterval);this.progressInterval=undefined}if(this.lottieAnimation){this.lottieAnimation.destroy();this.lottieAnimation=undefined}};handleDownloadReceipt=async()=>{try{await $.generateAndDownloadReceipt({paymentMethod:this.typePaymentMethod===m.CARD?this.textPaymentMethodCard():this.paymentMethodName,...this.typePaymentMethod===m.BANK_TRANSFER&&{bank:this.bank},...this.typePaymentMethod===m.CARD&&{cardBrand:this.applyStartCaseToBrand(l.data.cardInformation?.brand||"")},...this.typePaymentMethod===m.CARD&&{cardLastFour:this.cardLastFour??l.data.cardInformation?.lastFour},paymentDate:D(this.getPaymentDate())||"",email:l?.data?.userInformation?.email||"",referenceNumber:this.referenceNumber,productTitle:l?.data?.itemInformation?.title||"",subtotal:this.getFormattedSubtotal(),total:this.getFormattedTotal(),currency:l?.data?.pricing?.currency||" ",installments:l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment?`${_(l.data?.cardInformation?.installments?.selectedInstallment?.installment,k(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)}\n( ${r.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )${l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===w.CUSTOMER_FINANCED?`\n${r.translate("installments.interest")}`:""}`:"",discountAmount:this.getFormattedDiscountAmount(),trialPeriodDays:this.trialPeriodDays||l.data?.itemInformation?.trial?.trialPeriodDays,debitDay:this.debitDay||l.data?.itemInformation?.debitDay,planAmount:this.getFormattedSubtotal(this.planAmount),trialEndDate:this.hasFreeTrial()?this.getTrialEndDateFormatted():undefined,debitDate:this.hasDebitDay()?this.getDebitDateFormatted():undefined,isBankTransfer:this.typePaymentMethod===m.BANK_TRANSFER})}catch(e){console.error("Error downloading receipt:",e)}};getFormattedDiscountAmount=()=>{if(l?.data?.pricing?.discountAmount>0){const e=d(l.data?.pricing?.discountAmount,l.data?.pricing?.currency);return`-${e}`}return undefined};getFormattedSubtotal=(e=null)=>d(e||l?.data?.pricing?.subtotal,l?.data?.pricing?.currency);getFormattedTotal=()=>{if(this.trialPeriodDays>0){return d(0,l?.data?.pricing?.currency)}return d(l?.data?.pricing?.total,l?.data?.pricing?.currency)};hasFreeTrial=()=>l.data?.itemInformation?.type===c.PLAN&&l.data?.itemInformation?.trial?.trialPeriodDays&&l.data?.itemInformation?.trial?.trialPeriodDays>0;hasDebitDay=()=>{const e=l.data?.itemInformation?.debitDay;return e&&e>0};getTrialEndDateFormatted=()=>{const e=l.data?.itemInformation?.trial?.trialPeriodEndsAt;if(!e)return"";const t=new Date(e);const i=r.getCurrentLanguage();const a=i==="es"?"es-ES":i==="pt"?"pt-BR":"en-US";if(i==="en"){return`${t.toLocaleDateString(a,{month:"long"})} ${t.getDate()}`}else{return`${t.getDate()} de ${t.toLocaleDateString(a,{month:"long"})}`}};getDebitDateFormatted=()=>{const e=l.data?.itemInformation?.debitDay;if(!e||e<=0)return"";const t=new Date;const i=new Date(t);const a=r.getCurrentLanguage();const s=a==="es"?"es-ES":a==="pt"?"pt-BR":"en-US";if(e<t.getDate()){i.setMonth(t.getMonth()+1)}i.setDate(e);while(i.getDate()!==e){i.setDate(i.getDate()-1)}if(a==="en"){return`${i.toLocaleDateString(s,{month:"long"})} ${i.getDate()}`}else{return`${i.getDate()} de ${i.toLocaleDateString(s,{month:"long"})}`}};textPaymentMethodCard=()=>{const e=l.data?.cardInformation?.brand;const t=this.cardLastFour||l?.data?.cardInformation?.lastFour;const i=this.applyStartCaseToBrand(e||"");return e&&t?`${i} - ${t}`:i};render(){const e=l.data?.itemInformation?.redirectSuccess;return t("rebill-checkout-single-column",{key:"d8a814c5353cd2dcaa053ea6c205be11870f7629"},t("div",{key:"cf05e7f864a87a41db23b76f366c7c8516a721c0",class:"success-page__success-content"},t("rebill-typography",{key:"729d64601641e56b8551d5c3d74daae3a18b6b0a",variant:"h3",color:u.PRIMARY_DARK_TEXT},e&&this.showRedirectMessage?r.translate("processing.redirectMessage"):r.translate("processing.successTitle")),e&&this.showRedirectMessage?t("div",{class:"redirect-message"},t("div",{class:"success-page__lottie-container"},t("div",{ref:e=>this.lottieContainer=e,class:"lottie-animation"}))):t("div",{class:"success-page__success-icon"},t("svg",{width:g(this.breakpoint,y.DESKTOP)?"64":"96",height:g(this.breakpoint,y.DESKTOP)?"64":"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.99219 47.998C7.99219 25.9067 25.9008 7.99805 47.9922 7.99805C70.0836 7.99805 87.9922 25.9067 87.9922 47.998C87.9922 70.0894 70.0836 87.998 47.9922 87.998C25.9008 87.998 7.99219 70.0894 7.99219 47.998ZM61.5401 39.2645C62.2396 38.4096 62.1136 37.1496 61.2587 36.4501C60.4038 35.7507 59.1437 35.8767 58.4443 36.7316L41.8437 57.0211L35.4064 50.5838C34.6254 49.8028 33.359 49.8028 32.578 50.5838C31.7969 51.3649 31.7969 52.6312 32.578 53.4123L40.578 61.4123C40.9775 61.8118 41.5275 62.0237 42.0918 61.9956C42.6562 61.9674 43.1823 61.7019 43.5401 61.2645L61.5401 39.2645Z",fill:"#35B093"}))),t("div",{key:"cb7dc105388b2db7c3b34057c5c4ffd98910bee2",class:"success-page__info-card"},t("div",{key:"00819afd49ef6aeef2411dff4f942385c80ba07e",class:"success-page__card-row"},t("rebill-typography",{key:"4a9a03c161b12037b47e1eae87e22c5160806e2c",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentMethod")),t("div",{key:"dc27668c563154151bdaec58410b8c73086f61fd",class:"success-page__card-value"},t("div",{key:"7c96a29c17134201c004cd65fb515de5cf691340",class:"success-page__payment-method-display"},this.typePaymentMethod===m.CARD&&t(t.Fragment,null,t("rebill-card-icon",{key:"530f18b793bbf92cf2a9e61eaad6f68a609dc1a7","card-brand":l.data?.cardInformation?.brand||""}),t("rebill-typography",{key:"52e4866e3a05a30e5bb7cd715720178bb787c600",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===m.BANK_TRANSFER&&t("div",{key:"acfeb7d49fb573410f7f9df7f794c784b119accd",style:{display:"flex",alignItems:"center",gap:"8px"}},t("rebill-icon",{key:"dec188702fe1c02ea3aa01697b466564c3cce778",name:j(m.BANK_TRANSFER,this.country)?.toLowerCase()||"card"}),t("rebill-typography",{key:"2e2a40216a852b0fbc40670e92fd639f9b3af795",variant:"body2",color:u.PRIMARY_DARK_TEXT},r.translate("paymentMethods.bank_transfer")))))),l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment&&t("div",{key:"ea79aae58cfaaeb3df39224ed29189aa14d82f45"},t("div",{key:"4335fe58d7e4f4f91881f9dd629cf7ae93945a54",class:"success-page__card-row"},t("rebill-typography",{key:"ef6fbe06758da4e54f3dfd529f7c188167ef70de",variant:"body2",color:u.SECONDARY},r.translate("summary.installments")),t("div",{key:"6881217b5feea6fa09bee824d4b7aace4950f603",style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"end"}},t("rebill-typography",{key:"e8225b7a2450e67e46902263af208633e21c852d",variant:"body2",color:u.PRIMARY_DARK_TEXT,style:{textAlign:"end"}},_(l.data?.cardInformation?.installments?.selectedInstallment?.installment,k(l.data?.cardInformation?.installments?.selectedInstallment?.installmentAmount||0),l.data?.pricing?.currency,l.data?.cardInformation?.installments?.selectedInstallment?.cft,l.data?.cardInformation?.installments?.selectedInstallment?.model)),t("rebill-typography",{key:"fb989d76d8ed0ef97e74e5a9a9f2be4ebc36b044",variant:"body2",color:u.PRIMARY_DARK_TEXT},`( ${r.translate("processing.purchaseTotal")}: ${this.getFormattedTotal()} )`),l.data.cardInformation?.installments?.installments.find((e=>e.installment===l.data.cardInformation?.installments?.selectedInstallment?.installment))?.model===w.CUSTOMER_FINANCED&&t("rebill-typography",{key:"5a278b1b9a0ead71519bccf12d80f5a0f6d6c667",variant:"italic",color:u.SECONDARY,style:{textAlign:"end"}},`${r.translate("installments.interest")}`)))),t("div",{key:"4ca2babffc451d62f60da51dfaf8cf5ef903ee6b",class:"success-page__card-row"},t("rebill-typography",{key:"6e20687a11a8cac9cb519978bee200ca846b6bf4",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentDate")),t("rebill-typography",{key:"eae77c8ddcadc04f4c359aee9cf2d663889d4f82",variant:"body2",color:u.PRIMARY_DARK_TEXT},D(this.paymentDate||this.getPaymentDate()||l.createdAt)||"")),t("div",{key:"72ae70f80bbf27fa7ab72107d3075ba13721c8f2",class:"success-page__card-row"},t("rebill-typography",{key:"d85fbe86c79e7c18186bd23e2ab7123525f67ca6",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentEmail")),t("rebill-typography",{key:"8f4db224d31ad6294badbef2c05344b11887fa27",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.userInformation?.email)),t("div",{key:"05e205e63cb7958a749b0fe8297ccde914f421e1",class:"success-page__card-row"},t("rebill-typography",{key:"63c726338cb62abff925f7787a2d6b0d731133a0",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentReference")),t("rebill-typography",{key:"12186b7939c0ebbdb2548c4513af1822aebb67c8",variant:"body2",color:u.PRIMARY_DARK_TEXT,class:"success-page__reference-number"},this.referenceNumber||""))),t("div",{key:"00d9b3804dd02addd8011e29533929a56d7aa58c",class:"success-page__info-card"},t("rebill-typography",{key:"ed5ae2237d800cf0cac6e9f880a9c7b6ec9bd8a3",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.purchaseDetails")),t("div",{key:"d13b348ce1ee55c83db8c10d0b3b4aca972b7f3a",class:"success-page__card-row"},t("rebill-typography",{key:"55d16b897fe8c34131eeec05587cef14313bfd62",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseDetail")),t("rebill-typography",{key:"97123778ac864648a4e330915bafe84514460d24",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.itemInformation?.title||"")),!this.trialPeriodDays&&t("div",{key:"537f89e71e8fb8c6079befb71ff1a61e99187cf6",class:"success-page__card-row"},t("rebill-typography",{key:"0e9e1cf4ae6d5bca97dfd51ed4a12b275d19719a",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseSubtotal")),t("rebill-typography",{key:"d45380840cdf35ffc18ecd618cb94c0f0eb5bdd3",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),l?.data?.pricing?.discountAmount>0&&t("div",{key:"c34df5787398ba9c6339ac1348052c4a47fc7c79",class:"success-page__card-row"},t("rebill-typography",{key:"a733017918477463f73cd32a6475e8d2e4c37781",variant:"body2",color:u.SECONDARY},r.translate("summary.discount")),t("rebill-typography",{key:"ccb6e46656104b12c8f93ba34c96f3bc97c836ed",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedDiscountAmount())),t("div",{key:"03c41ca60d1306aac047efb56a7fcec0e8842b17",class:"success-page__card-row"},t("rebill-typography",{key:"0418a54826aaea0d2b878d9da6f3093494e53ad3",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseMontoTotal")),t("div",{key:"14d58e7438a6d3cc621753568d83da25585eb5e0",class:"success-page__total-amount-container"},this.trialPeriodDays>0&&t("div",{key:"eecdaa2ca9577bbedf05e35d0518353a88952e17",class:"success-page__trial-pill"},t("rebill-typography",{key:"4ec8fbe451b03ab6489db62abb44725a3f42ccfc",variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("processing.trialPill",{days:this.trialPeriodDays,count:this.trialPeriodDays}))),t("rebill-typography",{key:"d6e12a5401f68e01d2c7ea1706cf6c885a69e021",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),(this.trialPeriodDays||this.hasDebitDay())&&t("div",{key:"a7ee99c9416ad1d995c59927909214300e021491",class:"success-page__card-divider"}),(this.hasFreeTrial()||this.hasDebitDay())&&t("div",{key:"c167a90f0ce8da005833a89f3acaebf1e8079b19",class:"success-page__next-charge-section"},t("div",{key:"c0817733aa17655d5578c96c07a87b5a3d847c03",class:"success-page__next-charge-header"},t("rebill-typography",{key:"3e218d2bbe78b3542e7f53d784d735b6e4480c34",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.nextCharge")),t("rebill-typography",{key:"03a7c5048d6e952b7532fb45974dcb47512d34dd",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.onDate",{date:this.hasFreeTrial()?this.getTrialEndDateFormatted():this.getDebitDateFormatted()}))),t("div",{key:"ac92777a58bd9fd68b16c3c545718f2885893253",class:"success-page__card-row"},t("rebill-typography",{key:"680b1b3386cff3bdc72e059cbfd5901fe65a86ce",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.hasFreeTrial()?r.translate("processing.atEndOfTrial"):""),t("rebill-typography",{key:"9dc76d0befc14922fda0a3ba66fd020cf08098f6",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal(this.planAmount)," ",r.translate("processing.perMonth")))),t("div",{key:"6c91add3a1941d5aeef60406841391cf2a420ea8",class:"success-page__card-divider"}),t("div",{key:"f8f64653e37c1a2c2b8540adf6175168789d6bdb",class:"success-page__download-container"},t("svg",{key:"d865caf674a68d00550b8312d941fec103879ca6",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"b3b7b7042666e928af0e1928b46a4289049ff03a",d:"M13.498 9.83333V12.1667C13.498 12.903 12.9011 13.5 12.1647 13.5H3.83138C3.095 13.5 2.49805 12.903 2.49805 12.1667V9.83333M7.99804 10V2.5M7.99804 10L5.66471 7.66667M7.99804 10L10.3314 7.66667",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})),t("rebill-button",{key:"437f61a8a544e8681c84b09dabb18afbfcd01fb8",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},t("rebill-typography",{key:"7613ff0df859a82ebd04f36829378a28d5f789de",variant:"overline",color:u.PRIMARY_DARK_TEXT},r.translate("processing.download")))),t("div",{key:"6c4c9be607a1007244c4ce8b97c0d25d28723575",class:"success-page__contact-info"},t("rebill-typography",{key:"ce01fffce36a31c6a30672c552a438805276201b",variant:"information-text",color:u.SECONDARY},r.translate("processing.downloadDescription"))))))}};ke.style=we;const Ce=":host{display:block}.inputs-container{display:flex;flex-direction:column;gap:16px;width:100%}.customer-exists{display:flex;justify-content:flex-end;margin-bottom:16px}";const $e=class{constructor(t){e(this,t);this.onRebillAccountClick=a(this,"onRebillAccountClick")}userInformation={email:"",fullName:"",countryCode:""};errors=null;customerExists=false;disabled=false;onRebillAccountClick;translateError(e){if(!e)return"";if(e.includes("validation.")||e.includes("paymentErrors.")){return r.translate(e)}return e}handleInputChange(e){if(!e.detail)return;const{id:t,value:i}=e.detail;b.setUserInformation({[t]:i})}handleBlur(e){if(!e.detail)return;const{id:t,value:i}=e.detail;b.setUserInformation({[t]:i})}getCardLabels(){const e=[];if(l.data.prefilledData.email){e.push({label:r.translate("userInformation.emailPlaceholder"),value:l.data.prefilledData.email});b.setUserInformation({...l.data.userInformation,email:l.data.prefilledData.email})}if(l.data.prefilledData.fullName){e.push({label:r.translate("userInformation.fullNamePlaceholder"),value:l.data.prefilledData.fullName});b.setUserInformation({...l.data.userInformation,fullName:l.data.prefilledData.fullName})}return e}async handleRebillAccountClick(){n.otp.generate(l.data.sessionId,{email:l.data.userInformation.email});this.onRebillAccountClick.emit(true)}renderInputs(){const e=l.data.prefilledData.email;const i=l.data.prefilledData.fullName;const a=[];if(!e){a.push(t("rebill-input-text",{id:"email",variant:"floating",label:r.translate("userInformation.emailPlaceholder"),placeholder:r.translate("userInformation.emailPlaceholder"),"left-icon":"email",clearable:true,disabled:this.disabled,error:this.translateError(this.errors?.email)}))}if(!i){a.push(t("rebill-input-text",{id:"fullName",variant:"floating",label:r.translate("userInformation.fullNamePlaceholder"),placeholder:r.translate("userInformation.fullNamePlaceholder"),disabled:this.disabled,error:this.translateError(this.errors?.fullName)}))}return a.length>0?t("div",{class:"inputs-container",style:{marginTop:a.length>0&&(e||i)?"1rem":"0"}},a):null}render(){const e=t("div",{key:"46bb2f98219e56c8723289e3348514c4f27b4a53",class:"customer-exists"},t("rebill-button",{key:"eb6f81a732df9ef04a4c278588cd57998cbb6c25",style:{visibility:this.customerExists?"visible":"hidden",opacity:this.customerExists?"1":"0",transition:"opacity 0.3s ease-in-out"},variant:"text",size:"small",onClick:()=>this.handleRebillAccountClick(),icon:"lock"},r.translate("userInformation.rebillAccount"),t("rebill-icon",{key:"d270f5d5f8e2fecb9a6b39d439172c99233cc86d",name:"arrow-right"})));const i=l.data.prefilledData.email;const a=l.data.prefilledData.fullName;const n=i||a;return t(s,{key:"97e0d4dd9b6d3c798eee919274d4ed9be854319d"},e,n&&t("rebill-card",{key:"18f3d53e0386be0b4dff09bcfdcf69885d0093e7",cardTitle:r.translate("userInformation.personalInformation"),cardLabels:this.getCardLabels()}),this.renderInputs())}};$e.style=Ce;export{ye as otp_component,xe as rebill_modal_overlay,ue as rebill_mode_sandbox,_e as rebill_mode_sandbox_mobile,he as rebill_summary,ke as success_page,$e as user_information};
2
+ //# sourceMappingURL=p-4e35c3c8.entry.js.map