rebill-web-components-sdk 1.8.35 → 1.8.37

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 (106) hide show
  1. package/dist/cjs/apm-checkout_19.cjs.entry.js +2 -2
  2. package/dist/cjs/card-identification_5.cjs.entry.js +2 -2
  3. package/dist/cjs/{config-ClgjQet_.js → config-Wx7Bi6_T.js} +3 -3
  4. package/dist/cjs/config-Wx7Bi6_T.js.map +1 -0
  5. package/dist/cjs/discount-coupon_2.cjs.entry.js +2 -2
  6. package/dist/cjs/index-C-VTnc0I.js.map +1 -1
  7. package/dist/cjs/{index-BCzOaoSU.js → index-D4-MOr9h.js} +3 -3
  8. package/dist/cjs/{index-BCzOaoSU.js.map → index-D4-MOr9h.js.map} +1 -1
  9. package/dist/cjs/index.cjs.js +1 -1
  10. package/dist/cjs/otp-component_7.cjs.entry.js +2 -2
  11. package/dist/cjs/rebill-checkout.cjs.entry.js +4 -5
  12. package/dist/cjs/rebill-checkout.entry.cjs.js.map +1 -1
  13. package/dist/cjs/rebill-renewal.cjs.entry.js +2 -2
  14. package/dist/cjs/renewal-success-page.renewal-summary.entry.cjs.js.map +1 -1
  15. package/dist/cjs/renewal-success-page_2.cjs.entry.js +0 -3
  16. package/dist/collection/api/config.js +1 -1
  17. package/dist/collection/api/config.js.map +1 -1
  18. package/dist/collection/components/checkout/rebill-checkout.js +2 -3
  19. package/dist/collection/components/checkout/rebill-checkout.js.map +1 -1
  20. package/dist/collection/components/renewal/renewal-summary/renewal-summary.js +0 -3
  21. package/dist/collection/components/renewal/renewal-summary/renewal-summary.js.map +1 -1
  22. package/dist/components/apm-checkout.js +1 -1
  23. package/dist/components/card-fields-wrapper.js +1 -1
  24. package/dist/components/card-identification.js +1 -1
  25. package/dist/components/card-iframe.js +1 -1
  26. package/dist/components/discount-coupon.js +1 -1
  27. package/dist/components/index.js +2 -2
  28. package/dist/components/otp-component.js +1 -1
  29. package/dist/components/{p-BjaEn-3m.js → p-2qMho_xL.js} +3 -3
  30. package/dist/{esm/config-BuNv9JwG.js.map → components/p-2qMho_xL.js.map} +1 -1
  31. package/dist/components/p-8BpuJ_V5.js.map +1 -1
  32. package/dist/components/{p-DvgE3hKC.js → p-B-3lImmb.js} +3 -3
  33. package/dist/components/{p-DvgE3hKC.js.map → p-B-3lImmb.js.map} +1 -1
  34. package/dist/components/{p-D5TXI2Hb.js → p-BD1NqdR9.js} +3 -3
  35. package/dist/components/{p-D5TXI2Hb.js.map → p-BD1NqdR9.js.map} +1 -1
  36. package/dist/components/{p-VskO2WrV.js → p-Be6Svr7E.js} +3 -3
  37. package/dist/components/{p-VskO2WrV.js.map → p-Be6Svr7E.js.map} +1 -1
  38. package/dist/components/{p-DDVDLDRI.js → p-Bel0mbz7.js} +3 -3
  39. package/dist/components/{p-DDVDLDRI.js.map → p-Bel0mbz7.js.map} +1 -1
  40. package/dist/components/{p-mqJmoJIO.js → p-BlD-dFYd.js} +3 -6
  41. package/dist/components/p-BlD-dFYd.js.map +1 -0
  42. package/dist/components/{p-Dk10IZbR.js → p-CQS1pU-N.js} +3 -3
  43. package/dist/components/{p-Dk10IZbR.js.map → p-CQS1pU-N.js.map} +1 -1
  44. package/dist/components/{p-B4_i6BFO.js → p-CyKDtSI2.js} +3 -3
  45. package/dist/components/{p-B4_i6BFO.js.map → p-CyKDtSI2.js.map} +1 -1
  46. package/dist/components/{p-Bln3wBD6.js → p-DZRApK5D.js} +5 -5
  47. package/dist/components/{p-Bln3wBD6.js.map → p-DZRApK5D.js.map} +1 -1
  48. package/dist/components/{p-DPpE0kdy.js → p-D_lNAXr_.js} +4 -4
  49. package/dist/components/{p-DPpE0kdy.js.map → p-D_lNAXr_.js.map} +1 -1
  50. package/dist/components/{p-OSC_8G2_.js → p-c7IoEGtU.js} +3 -3
  51. package/dist/components/{p-OSC_8G2_.js.map → p-c7IoEGtU.js.map} +1 -1
  52. package/dist/components/{p-Dh-yfb0D.js → p-hdBb2rTT.js} +3 -3
  53. package/dist/components/{p-Dh-yfb0D.js.map → p-hdBb2rTT.js.map} +1 -1
  54. package/dist/components/{p-BJUr_-ZO.js → p-kh0HdPk5.js} +3 -3
  55. package/dist/components/{p-BJUr_-ZO.js.map → p-kh0HdPk5.js.map} +1 -1
  56. package/dist/components/payment-method-selector.js +1 -1
  57. package/dist/components/rebill-address.js +1 -1
  58. package/dist/components/rebill-checkout.js +13 -14
  59. package/dist/components/rebill-checkout.js.map +1 -1
  60. package/dist/components/rebill-renewal.js +9 -9
  61. package/dist/components/rebill-summary.js +1 -1
  62. package/dist/components/renewal-summary.js +1 -1
  63. package/dist/components/user-information.js +1 -1
  64. package/dist/esm/apm-checkout_19.entry.js +2 -2
  65. package/dist/esm/card-identification_5.entry.js +2 -2
  66. package/dist/esm/{config-BuNv9JwG.js → config-CnVJ8ACO.js} +3 -3
  67. package/dist/{cjs/config-ClgjQet_.js.map → esm/config-CnVJ8ACO.js.map} +1 -1
  68. package/dist/esm/discount-coupon_2.entry.js +2 -2
  69. package/dist/esm/{index-BOj-Hiz8.js → index-8R_YGXw4.js} +3 -3
  70. package/dist/esm/{index-BOj-Hiz8.js.map → index-8R_YGXw4.js.map} +1 -1
  71. package/dist/esm/index-D8cwEAmw.js.map +1 -1
  72. package/dist/esm/index.js +2 -2
  73. package/dist/esm/otp-component_7.entry.js +2 -2
  74. package/dist/esm/rebill-checkout.entry.js +4 -5
  75. package/dist/esm/rebill-checkout.entry.js.map +1 -1
  76. package/dist/esm/rebill-renewal.entry.js +2 -2
  77. package/dist/esm/renewal-success-page.renewal-summary.entry.js.map +1 -1
  78. package/dist/esm/renewal-success-page_2.entry.js +0 -3
  79. package/dist/rebill-web-components-sdk/index.esm.js +1 -1
  80. package/dist/rebill-web-components-sdk/{p-28d04513.entry.js → p-2ddabd39.entry.js} +2 -2
  81. package/dist/rebill-web-components-sdk/{p-bde8f6aa.entry.js → p-3a585ddc.entry.js} +2 -2
  82. package/dist/rebill-web-components-sdk/p-3a585ddc.entry.js.map +1 -0
  83. package/dist/rebill-web-components-sdk/{p-736d2bdc.entry.js → p-3d02e7e9.entry.js} +2 -2
  84. package/dist/rebill-web-components-sdk/p-405ab8da.entry.js +2 -0
  85. package/dist/rebill-web-components-sdk/{p-6667496c.entry.js.map → p-405ab8da.entry.js.map} +1 -1
  86. package/dist/rebill-web-components-sdk/{p-D339jHg4.js → p-B5khCLtC.js} +2 -2
  87. package/dist/rebill-web-components-sdk/{p-D339jHg4.js.map → p-B5khCLtC.js.map} +1 -1
  88. package/dist/rebill-web-components-sdk/{p-CTo1s54i.js → p-D2_UL7f8.js} +4 -4
  89. package/dist/rebill-web-components-sdk/{p-CTo1s54i.js.map → p-D2_UL7f8.js.map} +1 -1
  90. package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
  91. package/dist/rebill-web-components-sdk/{p-392fb691.entry.js → p-b8613f04.entry.js} +2 -2
  92. package/dist/rebill-web-components-sdk/{p-852bb04c.entry.js → p-d016b0d6.entry.js} +2 -2
  93. package/dist/rebill-web-components-sdk/{p-8bf5ce94.entry.js → p-ee460f6c.entry.js} +2 -2
  94. package/dist/rebill-web-components-sdk/rebill-checkout.entry.esm.js.map +1 -1
  95. package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
  96. package/dist/rebill-web-components-sdk/renewal-success-page.renewal-summary.entry.esm.js.map +1 -1
  97. package/package.json +1 -1
  98. package/dist/components/p-BjaEn-3m.js.map +0 -1
  99. package/dist/components/p-mqJmoJIO.js.map +0 -1
  100. package/dist/rebill-web-components-sdk/p-6667496c.entry.js +0 -2
  101. package/dist/rebill-web-components-sdk/p-bde8f6aa.entry.js.map +0 -1
  102. /package/dist/rebill-web-components-sdk/{p-28d04513.entry.js.map → p-2ddabd39.entry.js.map} +0 -0
  103. /package/dist/rebill-web-components-sdk/{p-736d2bdc.entry.js.map → p-3d02e7e9.entry.js.map} +0 -0
  104. /package/dist/rebill-web-components-sdk/{p-392fb691.entry.js.map → p-b8613f04.entry.js.map} +0 -0
  105. /package/dist/rebill-web-components-sdk/{p-852bb04c.entry.js.map → p-d016b0d6.entry.js.map} +0 -0
  106. /package/dist/rebill-web-components-sdk/{p-8bf5ce94.entry.js.map → p-ee460f6c.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-DkbFAMha.js";import{C as u}from"./p-DA598vBj.js";import{c as f,a as y}from"./p-BIOWiROZ.js";import{B as g,i as x,g as v}from"./p-Do_vNuMa.js";import{g as _,a as w,E as k,b as C}from"./p-wvcrPcSK.js";import{g as $}from"./p-C5OYI4I6.js";import{g as D,P as j}from"./p-Catt3XCa.js";import{f as T}from"./p--EE-bffI.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const z=(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},M=(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,P=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function A(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 I(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,N=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return false}return true})(),E=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),R=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,F="--_number-flow-d-opacity",B="--_number-flow-d-width",U="--_number-flow-dx",W="--_number-flow-d",V=(()=>{try{return CSS.registerProperty({name:F,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:U,syntax:"<length>",inherits:true,initialValue:"0px"}),CSS.registerProperty({name:B,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:W,syntax:"<number>",inherits:true,initialValue:"0"}),true}catch{return false}})(),Y="var(--number-flow-char-height, 1em)",X="var(--number-flow-mask-height, 0.25em)",O=`calc(${X} / 2)`,q="var(--number-flow-mask-width, 0.5em)",Z=`calc(${q} / var(--scale-x))`,H="#000 0, transparent 71%",G=L`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${Y} !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(${B}) / var(--width));transform:translateX(var(${U})) scaleX(var(--scale-x));margin:0 calc(-1 * ${q});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Z},#000 calc(100% - ${Z}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${X},#000 calc(100% - ${X}),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% - ${X} * 2),calc(100% - ${Z} * 2) 100%,${Z} ${X},${Z} ${X},${Z} ${X},${Z} ${X};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${O} ${q};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${U})))}: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(${W})}.digit__num,.number .section::after{padding:${O} 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(${F}))}`,K=HTMLElement,J=E&&N&&V;let Q;class ee extends K{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=J&&this._animated&&(!this.respectMotionPreference||!(R!=null&&R.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)Q||(Q=new CSSStyleSheet,Q.replaceSync(G)),this.shadowRoot.adoptedStyleSheets=[Q];else{const e=document.createElement("style");e.textContent=G,this.shadowRoot.appendChild(e)}this._pre=new se(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new te(this,a,s),this.shadowRoot.appendChild(this._num.el),this._post=new se(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}}ee.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 te{constructor(e,t,i,{className:a,...s}={}){this.flow=e,this._integer=new ae(e,t,{justify:"right",part:"integer"}),this._fraction=new ae(e,i,{justify:"left",part:"fraction"}),this._inner=z("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=z("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({[U]:[`${t}px`,"0px"],[B]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class ie{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=z("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 oe(this,e.type,t?0:e.value,e.pos,{...i,onRemove:this.onCharRemove(e.key)}):new le(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]=`${M(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(A(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 ae extends ie{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 oe&&e.update(0)})),this.pop(t)}}class se extends ie{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 ne{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({[F]:[-.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({[F]: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 re extends ne{constructor(e,t,i,a){super(e.flow,i,a),this.section=e,this.value=t,this.el=i}}class oe extends re{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=z("span",{className:"digit__num"},[document.createTextNode(String(t))]);return t!==i&&a.setAttribute("inert",""),a.style.setProperty("--n",String(t)),a})),c=z("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({[W]:[-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 le extends re{constructor(e,t,i,a){const s=z("span",{className:"symbol__value",textContent:i});super(e,i,z("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 ne(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=z("span",{className:"symbol__value",textContent:e});this.el.appendChild(t),this._children.set(e,new ne(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 ce="number-flow-connect",de="number-flow-update";class pe extends ee{constructor(){super(...arguments),this.connected=false}connectedCallback(){this.connected=true,this.dispatchEvent(new Event(ce,{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(de,{bubbles:true})),this.data=I(this._value,this._formatter,this.numberPrefix,this.numberSuffix)}}P("number-flow",pe);const he=".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 be=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=g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmountToday")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.trialPeriodDaysDetails",{trialDays:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays})),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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"},_(l.data?.pricing?.installments,this.getRecalculatedInstallmentAmount()))),this.allowCoupon&&!x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.DESKTOP)&&t("discount-coupon",{"hide-label":true})),this.displayedComponents.includes("itemDetails")&&(x(this.currentBreakpoint,g.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")&&x(this.currentBreakpoint,g.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&&!x(this.currentBreakpoint,g.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&&!x(this.currentBreakpoint,g.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")&&(x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.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")&&!x(this.currentBreakpoint,g.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a())}};be.style=he;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=>{f(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:"fde7a239adcecb9f762a151c7dfc6d4ff8c9fac4",class:`test-mode-container ${this.isCardsPanelVisible||this.isCardsPanelClosing?"cards-visible":""}`},t("div",{key:"d529f91d83bb8f16872e6d388cf60c9e42ba89c9",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=y({duration:59,onTick:e=>{this.timeLeft=e},onComplete:()=>{this.isTimerRunning=false}});messageTimer=y({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:"a60f4778e7b8c9d12db4f91f1052efb529421f61",class:"otp__otp-container"},t("div",{key:"27f07a33bb7f89884e9f7c7451dde4d45ec70fa0",class:"otp__user-information"},t("div",{key:"dff426cbad1d5104cb190b577b62ace1f80c0397",class:"otp__otp-description-container"},t("rebill-typography",{key:"46056e3d98013ec69b2f94ce09453741393a84d5",variant:"body2",class:"otp__otp-description"},r.translate("otp.description")),t("rebill-typography",{key:"1ce410c937cc81a6d3d94ba9ba324463c17d2e1a",variant:"subtitle-bold",class:"otp__otp-description-digits"}," ",t("strong",{key:"5cb7f9fc7dc6bcb884719bc6dfb36d46d67e7c3b"},r.translate("otp.descriptionDigits"))," "),t("rebill-typography",{key:"08374eda7ff4ae8deadfec171a086d31c4c9160d",variant:"body2",class:"otp__otp-description-email"},r.translate("otp.descriptionEmail"))),t("rebill-typography",{key:"3bca7a94df9819bd9a235c0963b2190a0f7dcb2f",variant:"body2",class:"otp__otp-email-line"},l.data.userInformation.email," ",!l.data.prefilledData?.email&&t("span",{key:"53ac959b54950773538dbce0c236bbd2a75fa906",class:"otp__change-email",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.change")))),t("input-otp",{key:"53416598d254b6f42b1771136d43f8ac612f3b43",otp:this.otpValue,onOtpChange:e=>this.handleOtpChange(e.detail),error:this.error?r.translate("otp.error"):""}),this.isVerifying&&t("div",{key:"41c766a5e21c9d810dca97de5c720450df6924af",class:"otp__verifying-container"},t("rebill-typography",{key:"93ba72b7c85cb622f8fd3d1b1175817a736c7ede",variant:"subtitle2",color:u.PRIMARY},r.translate("otp.verifyingCode")),t("div",{key:"d8b11cf317c4d8cbbb3f840fe8c411738c8f095c",class:"otp__spinner"})),t("rebill-button",{key:"c07d1abbce11ca0a2f1f139d9b93c6808c85bfd0",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:"04892ba96af1f0cc56e8a662b4e758f8539d8181",class:"otp__code-resent-container"},t("rebill-typography",{key:"d5406c0cb371a85f796bb33950db186703aa2a96",variant:"subtitle2",color:u.GREEN},t("rebill-icon",{key:"d125a0363f9b5b584638b148e285323d57c507ee",name:"check-radio"}),r.translate("otp.codeResent"))),t("rebill-alert",{key:"00f6d0350530b1ec22027a91dcafa7bd6de2887d",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:"9a8c49f2d07459f11f447a430c5addf11da5d68c",class:"otp__alternative"},t("rebill-typography",{key:"aa6421edade435a60f2086666aadee7059c4381b",variant:"body2",color:u.PRIMARY_DARK},"o")),t("div",{key:"cd8efa383a62cc1362e50dd854812bf80c3a930c",class:"otp__guest-options"},t("rebill-button",{key:"95db9dfa82140c9de4fcf22d513f8401779d0bb5",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:"d1f56385971910aed328b740498945e05d6a91ac",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;width:100%;max-width:350px;flex-direction:row;gap:12px;text-align:left}.modal-content .close-button{position:absolute;top:8px;right:8px;width:20px;height:20px;flex-shrink:0}}";const xe=class{constructor(t){e(this,t)}visible=true;languageUpdateTrigger=0;unsubscribeCurrentLocaleStore;autoCloseTimer;componentDidLoad(){this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.languageUpdateTrigger++}));this.autoCloseTimer=y({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=>{f(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:"34d295a882ae24833dfb641d74dc788f27bc3b4c",class:`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible?"cards-visible":""}`},this.isPanelVisible&&t("div",{key:"eaaca55e68741335925fc92269b468f6c3a66d10",class:"mode-sandbox-mobile__overlay"}),t("div",{key:"56ca1c96014f19e6695bbacf514e0a581b5beb5d",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=g.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(" ")};getPaymentMethodConfig(e){const t=this.country?D(this.country):null;const i=t?.find((t=>t.type===e));const a={[m.CARD]:{key:m.CARD,label:r.translate("paymentMethods.card"),icons:["doblecard"]},[m.CASH]:{key:m.CASH,label:r.translate("paymentMethods.cash"),icons:["pago-facil"]},[m.BANK_TRANSFER]:{key:m.BANK_TRANSFER,label:r.translate("paymentMethods.bank_transfer"),icons:["plus"]}};const s=a[e];return{...s,icons:i?.icons||s.icons}}getPaymentDate=()=>this.paymentDate||"";componentWillLoad(){this.breakpoint=v(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=v(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-GK75wIKe.js").then((function(e){return e.l}));const t=await fetch($(`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 j.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:T(this.getPaymentDate())||T((new Date).toISOString()),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?`${w(l.data?.cardInformation?.installments?.selectedInstallment?.installment,C(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===k.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:"8850d42e7eec964b2d8bed3f6d03cd81838f11e6"},t("div",{key:"c1912c1984aac958f22a10b10e826458140d48a8",class:"success-page__success-content"},t("rebill-typography",{key:"434d57089b9bac608b625464e590a86f23333ff9",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:x(this.breakpoint,g.DESKTOP)?"64":"96",height:x(this.breakpoint,g.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:"45fc15cc7523047543821420e79c3ef7d6d7ad0f",class:"success-page__info-card"},t("div",{key:"c37a2f5862c98baa34beb6ebf0720a115909cc22",class:"success-page__card-row"},t("rebill-typography",{key:"b84a0d5f79acb5b3958ab1661674133e6b4dbedf",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentMethod")),t("div",{key:"65b986fa303209f8e8edd8e7e594b3ca096af7aa",class:"success-page__card-value"},t("div",{key:"c90de5c5a1e479c8cedffdbcd08c5e481dda5683",class:"success-page__payment-method-display"},this.typePaymentMethod===m.CARD&&t(t.Fragment,null,t("rebill-card-icon",{key:"eb5fc43b59a168cd22ac0aaf4fb3d00ba07fc3c6","card-brand":l.data?.cardInformation?.brand||""}),t("rebill-typography",{key:"5a8e9364ecfc529a36d402bda004366a69689476",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===m.BANK_TRANSFER&&t("div",{key:"0ddd63193aa9592282315247a2008cf14dd8ec10",style:{display:"flex",alignItems:"center",gap:"8px"}},t("div",{key:"fe3c0b2ebfc1cefaa73510a9d74dd775cf2f4a70",style:{display:"flex",alignItems:"center",gap:"8px"}},this.getPaymentMethodConfig(m.BANK_TRANSFER).icons.map((e=>t("rebill-icon",{name:e,size:"24px"})))),t("rebill-typography",{key:"24ae082e5b985e1bb6ee768b6502eaba68145f78",variant:"body2",color:u.PRIMARY_DARK_TEXT},r.translate("paymentMethods.bank_transfer")))))),l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment&&t("div",{key:"ee5f05be29c8f3124e5881d9ccb3c045108990d2"},t("div",{key:"2aacd0d22c9c0f15312597e7b6afbadc220593c8",class:"success-page__card-row"},t("rebill-typography",{key:"ab15d4ac4beadc340e2ad0040519309c5cd74b0f",variant:"body2",color:u.SECONDARY},r.translate("summary.installments")),t("div",{key:"5017568016b912b956194781c336c28ee8e69da0",style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"end"}},t("rebill-typography",{key:"0aba7d80b7415ce6c365d7cd2658a63f55b5469a",variant:"body2",color:u.PRIMARY_DARK_TEXT,style:{textAlign:"end"}},w(l.data?.cardInformation?.installments?.selectedInstallment?.installment,C(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:"154680cfc946275be76e7518e073829c319b8bed",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===k.CUSTOMER_FINANCED&&t("rebill-typography",{key:"f3adf2a4d2934a679946ed56dd13bbf5ea453ee1",variant:"italic",color:u.SECONDARY,style:{textAlign:"end"}},`${r.translate("installments.interest")}`)))),t("div",{key:"cfc6cf64b0a217032027fea8e5cb3fd25322e785",class:"success-page__card-row"},t("rebill-typography",{key:"05d4e2e87aa64384090cc52bc48a22dd00dcaf84",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentDate")),t("rebill-typography",{key:"804b597f8b765f779236c4320e87ac4723342423",variant:"body2",color:u.PRIMARY_DARK_TEXT},T(this.paymentDate||this.getPaymentDate()||l.createdAt)||"")),t("div",{key:"bef6d96d628c59705756680a5f48edd967f90ff2",class:"success-page__card-row"},t("rebill-typography",{key:"6a4db26e899bccdb1618323efc6cfa598ad3e14c",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentEmail")),t("rebill-typography",{key:"777897e56c9abe2e4ff67ab4add9ada586f4931c",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.userInformation?.email)),t("div",{key:"95c5b64f8391ac1a1b8a2e8bc09becb207f4bfe1",class:"success-page__card-row"},t("rebill-typography",{key:"bc2f7a4884d0a9b337dd3f399a6fe708ae4dda1d",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentReference")),t("rebill-typography",{key:"5d2800f91fc5793d0baf475b4b99fe1e6177eeb6",variant:"body2",color:u.PRIMARY_DARK_TEXT,class:"success-page__reference-number"},this.referenceNumber||""))),t("div",{key:"511eeb8bc993429246682e20fe0adce5e4bc7493",class:"success-page__info-card"},t("rebill-typography",{key:"63e347bffaedc3150f3c842e77f2f3cf5191fe6e",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.purchaseDetails")),t("div",{key:"1342344f9487731463b4416203fe6263ecac8fb4",class:"success-page__card-row"},t("rebill-typography",{key:"08a7b6b37a338d0971ca779b1b8e7d76f3302c48",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseDetail")),t("rebill-typography",{key:"38fe4237fc945d42a48b890ae93eeacc35538546",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.itemInformation?.title||"")),!this.trialPeriodDays&&t("div",{key:"55382214ce1dc2674d89fd8a75e4e6b94f8569cc",class:"success-page__card-row"},t("rebill-typography",{key:"d79f6e8be2b22a3ba8fd32d20614f98d8d56f9c1",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseSubtotal")),t("rebill-typography",{key:"4aa1d91b20545df6966239ad496ab1dc4fd466e5",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),l?.data?.pricing?.discountAmount>0&&t("div",{key:"9b2706fa579973229674c5159e85eb6e30352a35",class:"success-page__card-row"},t("rebill-typography",{key:"59f06a275851c4b62c44245ac3069c83af9e167b",variant:"body2",color:u.SECONDARY},r.translate("summary.discount")),t("rebill-typography",{key:"35e90386216272d6e6d15df447a12843a3f9a0a8",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedDiscountAmount())),t("div",{key:"f9657ea676129c46e2fe67c50f3ea9da8790391c",class:"success-page__card-row"},t("rebill-typography",{key:"bafb5e1de552babb50c13ee551bfa27071271023",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseMontoTotal")),t("div",{key:"13aa6baf3f694d94226cca5c1b9ae582e641a4b9",class:"success-page__total-amount-container"},this.trialPeriodDays>0&&t("div",{key:"5c10243bb2ffc6eb2b7c6daa102573fe4d874fd2",class:"success-page__trial-pill"},t("rebill-typography",{key:"30786814422eb8ce9596529bc3c4c9b3473f22ed",variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("processing.trialPill",{days:this.trialPeriodDays,count:this.trialPeriodDays}))),t("rebill-typography",{key:"f3e3d3495d8b36569ed259a616dcba708683f26b",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),(this.trialPeriodDays||this.hasDebitDay())&&t("div",{key:"a0bf33955a9b0128d7d8435aefee69848987fadb",class:"success-page__card-divider"}),(this.hasFreeTrial()||this.hasDebitDay())&&t("div",{key:"afacb83e77879d88182f9045776cf783cbed6e1c",class:"success-page__next-charge-section"},t("div",{key:"be6ca968cb7354afd233486922235a75ab8d99da",class:"success-page__next-charge-header"},t("rebill-typography",{key:"54c490179f72777b3e790c75f9b1679089dee918",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.nextCharge")),t("rebill-typography",{key:"e588b0b4c154a145270c1c17d8078339671b542a",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.onDate",{date:this.hasFreeTrial()?this.getTrialEndDateFormatted():this.getDebitDateFormatted()}))),t("div",{key:"6b1ef676d252c1302f30e87e45af2854383cb1f6",class:"success-page__card-row"},t("rebill-typography",{key:"c7a2a0a4a0bc210444e603dc6e366ec8eeebbcf4",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.hasFreeTrial()?r.translate("processing.atEndOfTrial"):""),t("rebill-typography",{key:"338d96d5851ff68bc548cf2cc1c90dd0f6706ea1",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal(this.planAmount)," ",r.translate("processing.perMonth")))),t("div",{key:"e3d2264ad9d5be0f17036134fef9e552c90f7217",class:"success-page__card-divider"}),t("div",{key:"6ae1bc14c9aabeb9f8b6c6e3a452117a5a04f1ed",class:"success-page__download-container"},t("svg",{key:"1f26b9261496287407ecd20196375cfeffe8958b",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"19c92208d5e1f9bb0afe1d943dee020a2eb2cfef",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:"7bedd8595f7554cb5e39434552ac8cd902655070",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},t("rebill-typography",{key:"f6346ef3bd62c8617e6354f6790e939d8c68805b",variant:"overline",color:u.PRIMARY_DARK_TEXT},r.translate("processing.download")))),t("div",{key:"c022dcb3cff565943af39a0cd354f55ffab90bbc",class:"success-page__contact-info"},t("rebill-typography",{key:"7eb1e927adcbf56d5c7611f67307079f3b9efe5c",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:"d8dc2e7c9eb4eda6f95ccd4d5472c068730cdfd5",class:"customer-exists"},t("rebill-button",{key:"1b7ae09782e0fcbcb98f2fb6f140b5a9113092c7",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:"697b2e05137658b4f427bce9533d2506ce5ee87f",name:"arrow-right"})));const i=l.data.prefilledData.email;const a=l.data.prefilledData.fullName;const n=i||a;return t(s,{key:"94cb7e47341a7bd014a69b172e9cf807349d4a59"},e,n&&t("rebill-card",{key:"d69d87bbd3733b0be65251b2eaf8f974933ebf1b",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,be as rebill_summary,ke as success_page,$e as user_information};
2
- //# sourceMappingURL=p-852bb04c.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-D2_UL7f8.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-DkbFAMha.js";import{C as u}from"./p-DA598vBj.js";import{c as f,a as y}from"./p-BIOWiROZ.js";import{B as g,i as x,g as v}from"./p-Do_vNuMa.js";import{g as _,a as w,E as k,b as C}from"./p-wvcrPcSK.js";import{g as $}from"./p-C5OYI4I6.js";import{g as D,P as j}from"./p-Catt3XCa.js";import{f as T}from"./p--EE-bffI.js";import"./p-E-ZsRS8r.js";import"./p-B5khCLtC.js";const z=(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},M=(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,P=(e,t)=>{!customElements.get(e)&&customElements.define(e,t)};function A(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 I(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,N=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return false}return true})(),E=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),R=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,B="--_number-flow-d-opacity",F="--_number-flow-d-width",U="--_number-flow-dx",W="--_number-flow-d",V=(()=>{try{return CSS.registerProperty({name:B,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:U,syntax:"<length>",inherits:true,initialValue:"0px"}),CSS.registerProperty({name:F,syntax:"<number>",inherits:false,initialValue:"0"}),CSS.registerProperty({name:W,syntax:"<number>",inherits:true,initialValue:"0"}),true}catch{return false}})(),Y="var(--number-flow-char-height, 1em)",X="var(--number-flow-mask-height, 0.25em)",O=`calc(${X} / 2)`,q="var(--number-flow-mask-width, 0.5em)",Z=`calc(${q} / var(--scale-x))`,H="#000 0, transparent 71%",G=L`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${Y} !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(${F}) / var(--width));transform:translateX(var(${U})) scaleX(var(--scale-x));margin:0 calc(-1 * ${q});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${Z},#000 calc(100% - ${Z}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${X},#000 calc(100% - ${X}),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% - ${X} * 2),calc(100% - ${Z} * 2) 100%,${Z} ${X},${Z} ${X},${Z} ${X},${Z} ${X};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${O} ${q};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${U})))}: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(${W})}.digit__num,.number .section::after{padding:${O} 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}))}`,K=HTMLElement,J=E&&N&&V;let Q;class ee extends K{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=J&&this._animated&&(!this.respectMotionPreference||!(R!=null&&R.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)Q||(Q=new CSSStyleSheet,Q.replaceSync(G)),this.shadowRoot.adoptedStyleSheets=[Q];else{const e=document.createElement("style");e.textContent=G,this.shadowRoot.appendChild(e)}this._pre=new se(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new te(this,a,s),this.shadowRoot.appendChild(this._num.el),this._post=new se(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}}ee.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 te{constructor(e,t,i,{className:a,...s}={}){this.flow=e,this._integer=new ae(e,t,{justify:"right",part:"integer"}),this._fraction=new ae(e,i,{justify:"left",part:"fraction"}),this._inner=z("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=z("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({[U]:[`${t}px`,"0px"],[F]:[a,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class ie{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=z("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 oe(this,e.type,t?0:e.value,e.pos,{...i,onRemove:this.onCharRemove(e.key)}):new le(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]=`${M(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(A(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 ae extends ie{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 oe&&e.update(0)})),this.pop(t)}}class se extends ie{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 ne{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 re extends ne{constructor(e,t,i,a){super(e.flow,i,a),this.section=e,this.value=t,this.el=i}}class oe extends re{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=z("span",{className:"digit__num"},[document.createTextNode(String(t))]);return t!==i&&a.setAttribute("inert",""),a.style.setProperty("--n",String(t)),a})),c=z("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({[W]:[-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 le extends re{constructor(e,t,i,a){const s=z("span",{className:"symbol__value",textContent:i});super(e,i,z("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 ne(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=z("span",{className:"symbol__value",textContent:e});this.el.appendChild(t),this._children.set(e,new ne(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 ce="number-flow-connect",de="number-flow-update";class pe extends ee{constructor(){super(...arguments),this.connected=false}connectedCallback(){this.connected=true,this.dispatchEvent(new Event(ce,{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(de,{bubbles:true})),this.data=I(this._value,this._formatter,this.numberPrefix,this.numberSuffix)}}P("number-flow",pe);const he=".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 be=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=g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmountToday")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.totalAmount")),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.DESKTOP)?"normal":"bold"}},r.translate("summary.trialPeriodDaysDetails",{trialDays:l.data?.itemInformation?.trial?.trialPeriodDays,count:l.data?.itemInformation?.trial?.trialPeriodDays})),t("rebill-typography",{variant:x(this.currentBreakpoint,g.DESKTOP)?"subtitle1":"body3",style:{fontWeight:x(this.currentBreakpoint,g.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"},_(l.data?.pricing?.installments,this.getRecalculatedInstallmentAmount()))),this.allowCoupon&&!x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.DESKTOP)&&t("discount-coupon",{"hide-label":true})),this.displayedComponents.includes("itemDetails")&&(x(this.currentBreakpoint,g.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")&&x(this.currentBreakpoint,g.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&&!x(this.currentBreakpoint,g.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&&!x(this.currentBreakpoint,g.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")&&(x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.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&&x(this.currentBreakpoint,g.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")&&!x(this.currentBreakpoint,g.DESKTOP)&&!l.data?.itemInformation?.trial?.trialPeriodDays&&!l.data?.itemInformation?.debitStrategy&&a())}};be.style=he;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=>{f(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:"fde7a239adcecb9f762a151c7dfc6d4ff8c9fac4",class:`test-mode-container ${this.isCardsPanelVisible||this.isCardsPanelClosing?"cards-visible":""}`},t("div",{key:"d529f91d83bb8f16872e6d388cf60c9e42ba89c9",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=y({duration:59,onTick:e=>{this.timeLeft=e},onComplete:()=>{this.isTimerRunning=false}});messageTimer=y({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:"a60f4778e7b8c9d12db4f91f1052efb529421f61",class:"otp__otp-container"},t("div",{key:"27f07a33bb7f89884e9f7c7451dde4d45ec70fa0",class:"otp__user-information"},t("div",{key:"dff426cbad1d5104cb190b577b62ace1f80c0397",class:"otp__otp-description-container"},t("rebill-typography",{key:"46056e3d98013ec69b2f94ce09453741393a84d5",variant:"body2",class:"otp__otp-description"},r.translate("otp.description")),t("rebill-typography",{key:"1ce410c937cc81a6d3d94ba9ba324463c17d2e1a",variant:"subtitle-bold",class:"otp__otp-description-digits"}," ",t("strong",{key:"5cb7f9fc7dc6bcb884719bc6dfb36d46d67e7c3b"},r.translate("otp.descriptionDigits"))," "),t("rebill-typography",{key:"08374eda7ff4ae8deadfec171a086d31c4c9160d",variant:"body2",class:"otp__otp-description-email"},r.translate("otp.descriptionEmail"))),t("rebill-typography",{key:"3bca7a94df9819bd9a235c0963b2190a0f7dcb2f",variant:"body2",class:"otp__otp-email-line"},l.data.userInformation.email," ",!l.data.prefilledData?.email&&t("span",{key:"53ac959b54950773538dbce0c236bbd2a75fa906",class:"otp__change-email",onClick:()=>{this.otpValue="";this.error=false;this.returnForm.emit(false)}},r.translate("otp.change")))),t("input-otp",{key:"53416598d254b6f42b1771136d43f8ac612f3b43",otp:this.otpValue,onOtpChange:e=>this.handleOtpChange(e.detail),error:this.error?r.translate("otp.error"):""}),this.isVerifying&&t("div",{key:"41c766a5e21c9d810dca97de5c720450df6924af",class:"otp__verifying-container"},t("rebill-typography",{key:"93ba72b7c85cb622f8fd3d1b1175817a736c7ede",variant:"subtitle2",color:u.PRIMARY},r.translate("otp.verifyingCode")),t("div",{key:"d8b11cf317c4d8cbbb3f840fe8c411738c8f095c",class:"otp__spinner"})),t("rebill-button",{key:"c07d1abbce11ca0a2f1f139d9b93c6808c85bfd0",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:"04892ba96af1f0cc56e8a662b4e758f8539d8181",class:"otp__code-resent-container"},t("rebill-typography",{key:"d5406c0cb371a85f796bb33950db186703aa2a96",variant:"subtitle2",color:u.GREEN},t("rebill-icon",{key:"d125a0363f9b5b584638b148e285323d57c507ee",name:"check-radio"}),r.translate("otp.codeResent"))),t("rebill-alert",{key:"00f6d0350530b1ec22027a91dcafa7bd6de2887d",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:"9a8c49f2d07459f11f447a430c5addf11da5d68c",class:"otp__alternative"},t("rebill-typography",{key:"aa6421edade435a60f2086666aadee7059c4381b",variant:"body2",color:u.PRIMARY_DARK},"o")),t("div",{key:"cd8efa383a62cc1362e50dd854812bf80c3a930c",class:"otp__guest-options"},t("rebill-button",{key:"95db9dfa82140c9de4fcf22d513f8401779d0bb5",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:"d1f56385971910aed328b740498945e05d6a91ac",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;width:100%;max-width:350px;flex-direction:row;gap:12px;text-align:left}.modal-content .close-button{position:absolute;top:8px;right:8px;width:20px;height:20px;flex-shrink:0}}";const xe=class{constructor(t){e(this,t)}visible=true;languageUpdateTrigger=0;unsubscribeCurrentLocaleStore;autoCloseTimer;componentDidLoad(){this.unsubscribeCurrentLocaleStore=b.onChange("currentLocale",(()=>{this.languageUpdateTrigger++}));this.autoCloseTimer=y({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=>{f(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:"34d295a882ae24833dfb641d74dc788f27bc3b4c",class:`mode-sandbox-mobile__test-mode-container ${this.isPanelVisible?"cards-visible":""}`},this.isPanelVisible&&t("div",{key:"eaaca55e68741335925fc92269b468f6c3a66d10",class:"mode-sandbox-mobile__overlay"}),t("div",{key:"56ca1c96014f19e6695bbacf514e0a581b5beb5d",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=g.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(" ")};getPaymentMethodConfig(e){const t=this.country?D(this.country):null;const i=t?.find((t=>t.type===e));const a={[m.CARD]:{key:m.CARD,label:r.translate("paymentMethods.card"),icons:["doblecard"]},[m.CASH]:{key:m.CASH,label:r.translate("paymentMethods.cash"),icons:["pago-facil"]},[m.BANK_TRANSFER]:{key:m.BANK_TRANSFER,label:r.translate("paymentMethods.bank_transfer"),icons:["plus"]}};const s=a[e];return{...s,icons:i?.icons||s.icons}}getPaymentDate=()=>this.paymentDate||"";componentWillLoad(){this.breakpoint=v(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=v(window.innerWidth)};loadLottieAnimation=async()=>{try{const e=await import("./p-GK75wIKe.js").then((function(e){return e.l}));const t=await fetch($(`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 j.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:T(this.getPaymentDate())||T((new Date).toISOString()),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?`${w(l.data?.cardInformation?.installments?.selectedInstallment?.installment,C(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===k.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:"8850d42e7eec964b2d8bed3f6d03cd81838f11e6"},t("div",{key:"c1912c1984aac958f22a10b10e826458140d48a8",class:"success-page__success-content"},t("rebill-typography",{key:"434d57089b9bac608b625464e590a86f23333ff9",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:x(this.breakpoint,g.DESKTOP)?"64":"96",height:x(this.breakpoint,g.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:"45fc15cc7523047543821420e79c3ef7d6d7ad0f",class:"success-page__info-card"},t("div",{key:"c37a2f5862c98baa34beb6ebf0720a115909cc22",class:"success-page__card-row"},t("rebill-typography",{key:"b84a0d5f79acb5b3958ab1661674133e6b4dbedf",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentMethod")),t("div",{key:"65b986fa303209f8e8edd8e7e594b3ca096af7aa",class:"success-page__card-value"},t("div",{key:"c90de5c5a1e479c8cedffdbcd08c5e481dda5683",class:"success-page__payment-method-display"},this.typePaymentMethod===m.CARD&&t(t.Fragment,null,t("rebill-card-icon",{key:"eb5fc43b59a168cd22ac0aaf4fb3d00ba07fc3c6","card-brand":l.data?.cardInformation?.brand||""}),t("rebill-typography",{key:"5a8e9364ecfc529a36d402bda004366a69689476",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.textPaymentMethodCard())),this.typePaymentMethod===m.BANK_TRANSFER&&t("div",{key:"0ddd63193aa9592282315247a2008cf14dd8ec10",style:{display:"flex",alignItems:"center",gap:"8px"}},t("div",{key:"fe3c0b2ebfc1cefaa73510a9d74dd775cf2f4a70",style:{display:"flex",alignItems:"center",gap:"8px"}},this.getPaymentMethodConfig(m.BANK_TRANSFER).icons.map((e=>t("rebill-icon",{name:e,size:"24px"})))),t("rebill-typography",{key:"24ae082e5b985e1bb6ee768b6502eaba68145f78",variant:"body2",color:u.PRIMARY_DARK_TEXT},r.translate("paymentMethods.bank_transfer")))))),l?.data?.pricing?.installments&&l?.data?.cardInformation?.installments?.selectedInstallment&&t("div",{key:"ee5f05be29c8f3124e5881d9ccb3c045108990d2"},t("div",{key:"2aacd0d22c9c0f15312597e7b6afbadc220593c8",class:"success-page__card-row"},t("rebill-typography",{key:"ab15d4ac4beadc340e2ad0040519309c5cd74b0f",variant:"body2",color:u.SECONDARY},r.translate("summary.installments")),t("div",{key:"5017568016b912b956194781c336c28ee8e69da0",style:{display:"flex",flexDirection:"column",gap:"10px",alignItems:"end"}},t("rebill-typography",{key:"0aba7d80b7415ce6c365d7cd2658a63f55b5469a",variant:"body2",color:u.PRIMARY_DARK_TEXT,style:{textAlign:"end"}},w(l.data?.cardInformation?.installments?.selectedInstallment?.installment,C(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:"154680cfc946275be76e7518e073829c319b8bed",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===k.CUSTOMER_FINANCED&&t("rebill-typography",{key:"f3adf2a4d2934a679946ed56dd13bbf5ea453ee1",variant:"italic",color:u.SECONDARY,style:{textAlign:"end"}},`${r.translate("installments.interest")}`)))),t("div",{key:"cfc6cf64b0a217032027fea8e5cb3fd25322e785",class:"success-page__card-row"},t("rebill-typography",{key:"05d4e2e87aa64384090cc52bc48a22dd00dcaf84",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentDate")),t("rebill-typography",{key:"804b597f8b765f779236c4320e87ac4723342423",variant:"body2",color:u.PRIMARY_DARK_TEXT},T(this.paymentDate||this.getPaymentDate()||l.createdAt)||"")),t("div",{key:"bef6d96d628c59705756680a5f48edd967f90ff2",class:"success-page__card-row"},t("rebill-typography",{key:"6a4db26e899bccdb1618323efc6cfa598ad3e14c",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentEmail")),t("rebill-typography",{key:"777897e56c9abe2e4ff67ab4add9ada586f4931c",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.userInformation?.email)),t("div",{key:"95c5b64f8391ac1a1b8a2e8bc09becb207f4bfe1",class:"success-page__card-row"},t("rebill-typography",{key:"bc2f7a4884d0a9b337dd3f399a6fe708ae4dda1d",variant:"body2",color:u.SECONDARY},r.translate("processing.paymentReference")),t("rebill-typography",{key:"5d2800f91fc5793d0baf475b4b99fe1e6177eeb6",variant:"body2",color:u.PRIMARY_DARK_TEXT,class:"success-page__reference-number"},this.referenceNumber||""))),t("div",{key:"511eeb8bc993429246682e20fe0adce5e4bc7493",class:"success-page__info-card"},t("rebill-typography",{key:"63e347bffaedc3150f3c842e77f2f3cf5191fe6e",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.purchaseDetails")),t("div",{key:"1342344f9487731463b4416203fe6263ecac8fb4",class:"success-page__card-row"},t("rebill-typography",{key:"08a7b6b37a338d0971ca779b1b8e7d76f3302c48",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseDetail")),t("rebill-typography",{key:"38fe4237fc945d42a48b890ae93eeacc35538546",variant:"body2",color:u.PRIMARY_DARK_TEXT},l?.data?.itemInformation?.title||"")),!this.trialPeriodDays&&t("div",{key:"55382214ce1dc2674d89fd8a75e4e6b94f8569cc",class:"success-page__card-row"},t("rebill-typography",{key:"d79f6e8be2b22a3ba8fd32d20614f98d8d56f9c1",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseSubtotal")),t("rebill-typography",{key:"4aa1d91b20545df6966239ad496ab1dc4fd466e5",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal())),l?.data?.pricing?.discountAmount>0&&t("div",{key:"9b2706fa579973229674c5159e85eb6e30352a35",class:"success-page__card-row"},t("rebill-typography",{key:"59f06a275851c4b62c44245ac3069c83af9e167b",variant:"body2",color:u.SECONDARY},r.translate("summary.discount")),t("rebill-typography",{key:"35e90386216272d6e6d15df447a12843a3f9a0a8",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedDiscountAmount())),t("div",{key:"f9657ea676129c46e2fe67c50f3ea9da8790391c",class:"success-page__card-row"},t("rebill-typography",{key:"bafb5e1de552babb50c13ee551bfa27071271023",variant:"body2",color:u.SECONDARY},r.translate("processing.purchaseMontoTotal")),t("div",{key:"13aa6baf3f694d94226cca5c1b9ae582e641a4b9",class:"success-page__total-amount-container"},this.trialPeriodDays>0&&t("div",{key:"5c10243bb2ffc6eb2b7c6daa102573fe4d874fd2",class:"success-page__trial-pill"},t("rebill-typography",{key:"30786814422eb8ce9596529bc3c4c9b3473f22ed",variant:"body2",align:"center",color:u.GREEN_TEXT},r.translate("processing.trialPill",{days:this.trialPeriodDays,count:this.trialPeriodDays}))),t("rebill-typography",{key:"f3e3d3495d8b36569ed259a616dcba708683f26b",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedTotal()))),(this.trialPeriodDays||this.hasDebitDay())&&t("div",{key:"a0bf33955a9b0128d7d8435aefee69848987fadb",class:"success-page__card-divider"}),(this.hasFreeTrial()||this.hasDebitDay())&&t("div",{key:"afacb83e77879d88182f9045776cf783cbed6e1c",class:"success-page__next-charge-section"},t("div",{key:"be6ca968cb7354afd233486922235a75ab8d99da",class:"success-page__next-charge-header"},t("rebill-typography",{key:"54c490179f72777b3e790c75f9b1679089dee918",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.nextCharge")),t("rebill-typography",{key:"e588b0b4c154a145270c1c17d8078339671b542a",variant:"subtitle-bold",color:u.PRIMARY_DARK_TEXT},r.translate("processing.onDate",{date:this.hasFreeTrial()?this.getTrialEndDateFormatted():this.getDebitDateFormatted()}))),t("div",{key:"6b1ef676d252c1302f30e87e45af2854383cb1f6",class:"success-page__card-row"},t("rebill-typography",{key:"c7a2a0a4a0bc210444e603dc6e366ec8eeebbcf4",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.hasFreeTrial()?r.translate("processing.atEndOfTrial"):""),t("rebill-typography",{key:"338d96d5851ff68bc548cf2cc1c90dd0f6706ea1",variant:"body2",color:u.PRIMARY_DARK_TEXT},this.getFormattedSubtotal(this.planAmount)," ",r.translate("processing.perMonth")))),t("div",{key:"e3d2264ad9d5be0f17036134fef9e552c90f7217",class:"success-page__card-divider"}),t("div",{key:"6ae1bc14c9aabeb9f8b6c6e3a452117a5a04f1ed",class:"success-page__download-container"},t("svg",{key:"1f26b9261496287407ecd20196375cfeffe8958b",class:"download-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"19c92208d5e1f9bb0afe1d943dee020a2eb2cfef",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:"7bedd8595f7554cb5e39434552ac8cd902655070",type:"button",variant:"download",size:"small",onClick:this.handleDownloadReceipt},t("rebill-typography",{key:"f6346ef3bd62c8617e6354f6790e939d8c68805b",variant:"overline",color:u.PRIMARY_DARK_TEXT},r.translate("processing.download")))),t("div",{key:"c022dcb3cff565943af39a0cd354f55ffab90bbc",class:"success-page__contact-info"},t("rebill-typography",{key:"7eb1e927adcbf56d5c7611f67307079f3b9efe5c",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:"d8dc2e7c9eb4eda6f95ccd4d5472c068730cdfd5",class:"customer-exists"},t("rebill-button",{key:"1b7ae09782e0fcbcb98f2fb6f140b5a9113092c7",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:"697b2e05137658b4f427bce9533d2506ce5ee87f",name:"arrow-right"})));const i=l.data.prefilledData.email;const a=l.data.prefilledData.fullName;const n=i||a;return t(s,{key:"94cb7e47341a7bd014a69b172e9cf807349d4a59"},e,n&&t("rebill-card",{key:"d69d87bbd3733b0be65251b2eaf8f974933ebf1b",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,be as rebill_summary,ke as success_page,$e as user_information};
2
+ //# sourceMappingURL=p-d016b0d6.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as i,c as t,g as o,h as e}from"./p-D8cwEAmw.js";import{a as s}from"./p-CTo1s54i.js";import{s as n,a as r,g as l,I as a}from"./p-DkbFAMha.js";import{C as c}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";import"./p-D339jHg4.js";const u=".summary-row{gap:12px}.coupon-chip{display:flex;align-items:center;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border-primary);justify-content:space-between;border-radius:6px;padding:4px 8px;gap:8px;width:fit-content}.coupon-chip--readonly{cursor:default}.coupon-icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;vertical-align:middle}.coupon-close{cursor:pointer}.coupon-content{display:flex;flex-direction:row;align-items:flex-start;gap:4px}";var d;(function(i){i["EDITING"]="editing";i["APPLIED"]="applied";i["NOT_APPLIED"]="not_applied"})(d||(d={}));const p=class{constructor(o){i(this,o);this.discountApplied=t(this,"discountApplied")}get el(){return o(this)}hideLabel=false;displayMode="editable";readonlyCouponCode;readonlyDiscountAmount;readonlyCurrency;couponCode="";actionStatus=d.NOT_APPLIED;isLoading=false;isError=false;currentLocale=n.currentLocale;discountApplied;inputRef;unsubscribeCurrentLocaleStore;componentWillLoad(){this.unsubscribeCurrentLocaleStore=r.onChange("currentLocale",(()=>{this.currentLocale=n.currentLocale}));if(this.readonlyCouponCode){return}if(n.data.pricing.discountCouponCode&&n.data.pricing.discountAmount>0){this.actionStatus=d.APPLIED;this.couponCode=n.data.pricing.discountCouponCode}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}}componentDidUpdate(){if(this.readonlyCouponCode){return}if(this.actionStatus===d.EDITING&&this.inputRef){setTimeout((async()=>{const i=await this.inputRef.getInputElement();if(i){i.focus()}}),0)}}async onApplyCoupon(){if(this.readonlyCouponCode)return;const i=n.data.sessionId;if(!i){return}this.isLoading=true;try{const t=await s.discountCoupon.applyDiscountCoupon({couponCode:this.couponCode,quantity:1,sessionId:i,organizationId:n.data.organization.id});this.actionStatus=d.APPLIED;r.setDiscount({couponCode:this.couponCode,amount:t.amount,discountType:t.discountType,discountAmount:t.discountedAmount,discountedPercentage:t?.discountedPercentage||0,discountDuration:t?.discountDuration||null});this.discountApplied.emit(true)}catch(i){this.actionStatus=d.EDITING;this.discountApplied.emit(false);this.isError=true;r.setDiscount(null)}finally{this.isLoading=false}}onCancelCoupon(){if(this.readonlyCouponCode)return;this.actionStatus=d.NOT_APPLIED;this.couponCode="";this.isError=false}renderCouponChip({couponCode:i,discountAmount:t,currency:o,readonly:s=false,onClick:n,onRemove:r}){if(!i){return null}const a=typeof t==="number";return e("div",{class:`coupon-chip${s?" coupon-chip--readonly":""}`},e("rebill-icon",{name:"tag-sale",size:"16px"}),e("div",{class:"coupon-content",onClick:!s?n:undefined},e("rebill-typography",{variant:"overline",color:c.PRIMARY_DARK_TEXT},i),a&&e("rebill-typography",{variant:"overline",color:c.GREEN},"-$",l(t,o))),!s&&r&&e("div",{class:"coupon-close",onClick:r},e("rebill-icon",{name:"x",size:"20px",color:c.PRIMARY_DARK_TEXT})))}renderReadonlyView(){if(!this.readonlyCouponCode&&this.readonlyDiscountAmount){return null}return this.renderCouponChip({couponCode:this.readonlyCouponCode,discountAmount:this.readonlyDiscountAmount??null,currency:this.readonlyCurrency??null,readonly:true})}render(){if(this.readonlyCouponCode){return this.renderReadonlyView()}return e("div",null,e("div",{class:"summary-row",style:{alignItems:this.actionStatus===d.EDITING?"flex-start":"center",display:"flex"}},!this.hideLabel&&e("rebill-typography",{variant:"body2",style:{marginTop:this.actionStatus===d.EDITING?"7px":"0px"}},a.translate("discountCoupons.discount")),this.actionStatus===d.NOT_APPLIED&&e("rebill-button",{variant:"filled",size:"small",theme:"primary-dark",onClick:()=>this.actionStatus=d.EDITING},a.translate("discountCoupons.addDiscount")),this.actionStatus===d.EDITING&&e("div",{class:"summary-row",style:{alignItems:"flex-start",display:"flex"}},e("rebill-input-text",{ref:i=>this.inputRef=i,id:"discountCoupon",value:this.couponCode,placeholder:a.translate("discountCoupons.addDiscount"),disabled:this.isLoading,error:this.isError?a.translate("discountCoupons.error"):"",clearable:true,uppercase:true,onInput:i=>{i.stopPropagation();if(i.detail&&i.detail.value!==undefined){this.couponCode=i.detail.value}},onBlur:()=>{if(!this.couponCode.trim()){this.onCancelCoupon()}}}),e("rebill-button",{variant:"filled",theme:"primary-dark",size:"small",loading:this.isLoading,disabled:this.isLoading||!this.couponCode.trim(),onClick:()=>this.onApplyCoupon(),style:{marginTop:this.actionStatus===d.EDITING?"3px":"0px"}},a.translate("discountCoupons.apply"))),this.actionStatus===d.APPLIED&&this.renderCouponChip({couponCode:n.data.pricing.discountCouponCode,discountAmount:n.data.pricing.discountAmount,currency:n.data.pricing.currency,onClick:()=>this.actionStatus=d.EDITING,onRemove:()=>{this.actionStatus=d.NOT_APPLIED;this.couponCode="";r.setDiscount(null);this.discountApplied.emit(false)}})))}};p.style=u;const h=".rebill-divider{border:none;border-top:0.5px solid var(--rebill-color-border-primary);width:100%;height:0.5px}";const f=class{constructor(t){i(this,t)}render(){return e("div",{key:"235a217e9c4f42dacd8fffb3d73a47ca85b81d69",class:"rebill-divider"})}};f.style=h;export{p as discount_coupon,f as rebill_divider};
2
- //# sourceMappingURL=p-8bf5ce94.entry.js.map
1
+ import{r as i,c as t,g as o,h as e}from"./p-D8cwEAmw.js";import{a as s}from"./p-D2_UL7f8.js";import{s as n,a as r,g as l,I as a}from"./p-DkbFAMha.js";import{C as c}from"./p-DA598vBj.js";import"./p-E-ZsRS8r.js";import"./p-B5khCLtC.js";const u=".summary-row{gap:12px}.coupon-chip{display:flex;align-items:center;background:var(--rebill-color-background);border:1px solid var(--rebill-color-border-primary);justify-content:space-between;border-radius:6px;padding:4px 8px;gap:8px;width:fit-content}.coupon-chip--readonly{cursor:default}.coupon-icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;vertical-align:middle}.coupon-close{cursor:pointer}.coupon-content{display:flex;flex-direction:row;align-items:flex-start;gap:4px}";var d;(function(i){i["EDITING"]="editing";i["APPLIED"]="applied";i["NOT_APPLIED"]="not_applied"})(d||(d={}));const p=class{constructor(o){i(this,o);this.discountApplied=t(this,"discountApplied")}get el(){return o(this)}hideLabel=false;displayMode="editable";readonlyCouponCode;readonlyDiscountAmount;readonlyCurrency;couponCode="";actionStatus=d.NOT_APPLIED;isLoading=false;isError=false;currentLocale=n.currentLocale;discountApplied;inputRef;unsubscribeCurrentLocaleStore;componentWillLoad(){this.unsubscribeCurrentLocaleStore=r.onChange("currentLocale",(()=>{this.currentLocale=n.currentLocale}));if(this.readonlyCouponCode){return}if(n.data.pricing.discountCouponCode&&n.data.pricing.discountAmount>0){this.actionStatus=d.APPLIED;this.couponCode=n.data.pricing.discountCouponCode}}disconnectedCallback(){if(this.unsubscribeCurrentLocaleStore){this.unsubscribeCurrentLocaleStore()}}componentDidUpdate(){if(this.readonlyCouponCode){return}if(this.actionStatus===d.EDITING&&this.inputRef){setTimeout((async()=>{const i=await this.inputRef.getInputElement();if(i){i.focus()}}),0)}}async onApplyCoupon(){if(this.readonlyCouponCode)return;const i=n.data.sessionId;if(!i){return}this.isLoading=true;try{const t=await s.discountCoupon.applyDiscountCoupon({couponCode:this.couponCode,quantity:1,sessionId:i,organizationId:n.data.organization.id});this.actionStatus=d.APPLIED;r.setDiscount({couponCode:this.couponCode,amount:t.amount,discountType:t.discountType,discountAmount:t.discountedAmount,discountedPercentage:t?.discountedPercentage||0,discountDuration:t?.discountDuration||null});this.discountApplied.emit(true)}catch(i){this.actionStatus=d.EDITING;this.discountApplied.emit(false);this.isError=true;r.setDiscount(null)}finally{this.isLoading=false}}onCancelCoupon(){if(this.readonlyCouponCode)return;this.actionStatus=d.NOT_APPLIED;this.couponCode="";this.isError=false}renderCouponChip({couponCode:i,discountAmount:t,currency:o,readonly:s=false,onClick:n,onRemove:r}){if(!i){return null}const a=typeof t==="number";return e("div",{class:`coupon-chip${s?" coupon-chip--readonly":""}`},e("rebill-icon",{name:"tag-sale",size:"16px"}),e("div",{class:"coupon-content",onClick:!s?n:undefined},e("rebill-typography",{variant:"overline",color:c.PRIMARY_DARK_TEXT},i),a&&e("rebill-typography",{variant:"overline",color:c.GREEN},"-$",l(t,o))),!s&&r&&e("div",{class:"coupon-close",onClick:r},e("rebill-icon",{name:"x",size:"20px",color:c.PRIMARY_DARK_TEXT})))}renderReadonlyView(){if(!this.readonlyCouponCode&&this.readonlyDiscountAmount){return null}return this.renderCouponChip({couponCode:this.readonlyCouponCode,discountAmount:this.readonlyDiscountAmount??null,currency:this.readonlyCurrency??null,readonly:true})}render(){if(this.readonlyCouponCode){return this.renderReadonlyView()}return e("div",null,e("div",{class:"summary-row",style:{alignItems:this.actionStatus===d.EDITING?"flex-start":"center",display:"flex"}},!this.hideLabel&&e("rebill-typography",{variant:"body2",style:{marginTop:this.actionStatus===d.EDITING?"7px":"0px"}},a.translate("discountCoupons.discount")),this.actionStatus===d.NOT_APPLIED&&e("rebill-button",{variant:"filled",size:"small",theme:"primary-dark",onClick:()=>this.actionStatus=d.EDITING},a.translate("discountCoupons.addDiscount")),this.actionStatus===d.EDITING&&e("div",{class:"summary-row",style:{alignItems:"flex-start",display:"flex"}},e("rebill-input-text",{ref:i=>this.inputRef=i,id:"discountCoupon",value:this.couponCode,placeholder:a.translate("discountCoupons.addDiscount"),disabled:this.isLoading,error:this.isError?a.translate("discountCoupons.error"):"",clearable:true,uppercase:true,onInput:i=>{i.stopPropagation();if(i.detail&&i.detail.value!==undefined){this.couponCode=i.detail.value}},onBlur:()=>{if(!this.couponCode.trim()){this.onCancelCoupon()}}}),e("rebill-button",{variant:"filled",theme:"primary-dark",size:"small",loading:this.isLoading,disabled:this.isLoading||!this.couponCode.trim(),onClick:()=>this.onApplyCoupon(),style:{marginTop:this.actionStatus===d.EDITING?"3px":"0px"}},a.translate("discountCoupons.apply"))),this.actionStatus===d.APPLIED&&this.renderCouponChip({couponCode:n.data.pricing.discountCouponCode,discountAmount:n.data.pricing.discountAmount,currency:n.data.pricing.currency,onClick:()=>this.actionStatus=d.EDITING,onRemove:()=>{this.actionStatus=d.NOT_APPLIED;this.couponCode="";r.setDiscount(null);this.discountApplied.emit(false)}})))}};p.style=u;const h=".rebill-divider{border:none;border-top:0.5px solid var(--rebill-color-border-primary);width:100%;height:0.5px}";const f=class{constructor(t){i(this,t)}render(){return e("div",{key:"235a217e9c4f42dacd8fffb3d73a47ca85b81d69",class:"rebill-divider"})}};f.style=h;export{p as discount_coupon,f as rebill_divider};
2
+ //# sourceMappingURL=p-ee460f6c.entry.js.map