rebill-web-components-sdk 1.10.8 → 1.10.9

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.
@@ -617,7 +617,7 @@ const Summary = class {
617
617
  } }, i18n_service.I18nService.translate('summary.free')))));
618
618
  }
619
619
  render() {
620
- const renderItemDetails = (title = true, description = true, amount = true) => (index.h("div", { class: "summary-card" }, (title || description) && (index.h("div", { class: "summary-card-info" }, title && (index.h("rebill-typography", { variant: "subtitle-bold", gutterBottom: true }, this.itemTitle)), description && this.itemDescription && (index.h("rebill-typography", { variant: "body2" }, this.itemDescription)))), amount && (index.h("div", { class: "summary-card-amount" }, index.h("rebill-typography", { variant: "body2" }, i18n_service.state.data?.itemInformation?.type === i18n_service.SESSION_ITEM_TYPE_ENUM.PLAN &&
620
+ const renderItemDetails = (title = true, description = true, amount = true) => (index.h("div", { class: "summary-card" }, (title || description) && (index.h("div", { class: "summary-card-info" }, title && (index.h("rebill-typography", { variant: "subtitle-bold", gutterBottom: true }, this.itemTitle)), description && this.itemDescription && (index.h("rebill-typography", { variant: "body2" }, index.h("span", { innerHTML: this.itemDescription }))))), amount && (index.h("div", { class: "summary-card-amount" }, index.h("rebill-typography", { variant: "body2" }, i18n_service.state.data?.itemInformation?.type === i18n_service.SESSION_ITEM_TYPE_ENUM.PLAN &&
621
621
  i18n_service.state.data?.itemInformation?.debitStrategy
622
622
  ? i18n_service.formatAmount(i18n_service.state.data?.pricing?.planAmount, this.currency)
623
623
  : i18n_service.formatAmount(this.subtotal, this.currency))))));
@@ -152,7 +152,7 @@ export class Summary {
152
152
  } }, I18nService.translate('summary.free')))));
153
153
  }
154
154
  render() {
155
- const renderItemDetails = (title = true, description = true, amount = true) => (h("div", { class: "summary-card" }, (title || description) && (h("div", { class: "summary-card-info" }, title && (h("rebill-typography", { variant: "subtitle-bold", gutterBottom: true }, this.itemTitle)), description && this.itemDescription && (h("rebill-typography", { variant: "body2" }, this.itemDescription)))), amount && (h("div", { class: "summary-card-amount" }, h("rebill-typography", { variant: "body2" }, sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&
155
+ const renderItemDetails = (title = true, description = true, amount = true) => (h("div", { class: "summary-card" }, (title || description) && (h("div", { class: "summary-card-info" }, title && (h("rebill-typography", { variant: "subtitle-bold", gutterBottom: true }, this.itemTitle)), description && this.itemDescription && (h("rebill-typography", { variant: "body2" }, h("span", { innerHTML: this.itemDescription }))))), amount && (h("div", { class: "summary-card-amount" }, h("rebill-typography", { variant: "body2" }, sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&
156
156
  sessionState.data?.itemInformation?.debitStrategy
157
157
  ? formatAmount(sessionState.data?.pricing?.planAmount, this.currency)
158
158
  : formatAmount(this.subtotal, this.currency))))));
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../../src/components/checkout/summary/summary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAO7E,MAAM,OAAO,OAAO;IAClB,kBAAkB;IACV,WAAW,CAAmB;IACtC,sBAAsB;IACd,SAAS,CAAU;IAC3B,2BAA2B;IACnB,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Listen, Prop, State } from '@stencil/core';\nimport 'number-flow';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport {\n PLAN_FREQUENCY_ENUM,\n SESSION_DISCOUNT_TYPE_ENUM,\n SESSION_ITEM_TYPE_ENUM,\n} from '../../../models';\nimport { sessionState } from '../../../store/session.store';\nimport { BREAKPOINT_ENUM, isBreakpointBelow } from '../../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\nimport { getInstallmentDescription } from '../../../utils/installment-utils';\n\n@Component({\n tag: 'rebill-summary',\n styleUrl: 'summary.css',\n shadow: false,\n})\nexport class Summary {\n /** Monto total */\n @Prop() totalAmount!: number | string;\n /** Título del item */\n @Prop() itemTitle!: string;\n /** Descripción del item */\n @Prop() itemDescription!: string;\n /** Monto del item */\n @Prop() itemAmount!: number | string;\n /** Frecuencia del plan */\n @Prop() planFrequency?: PLAN_FREQUENCY_ENUM;\n /** Cantidad de frecuencia del plan */\n @Prop() planFrequencyCount?: number;\n /** Subtotal */\n @Prop() subtotal!: number | string;\n /** Descuento (opcional) */\n @Prop() discount?: number | string;\n @Prop() currency: string;\n @Prop() displayedComponents: (\n | 'totalAmount'\n | 'discount'\n | 'itemDetails'\n | 'priceDetails'\n | 'timelineFreeTrial'\n | 'timelineDebitDay'\n )[] = [\n 'totalAmount',\n 'discount',\n 'itemDetails',\n 'priceDetails',\n 'timelineFreeTrial',\n 'timelineDebitDay',\n ];\n @Prop() allowCoupon: boolean = false;\n @Prop() currentBreakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() discountApplied: boolean = false;\n private totalFlow?: HTMLElement & { update: (value: number) => void; format?: any };\n @Prop() discountType: SESSION_DISCOUNT_TYPE_ENUM;\n @Prop() discountedPercentage: number = 0;\n @Prop() discountDuration: number = 0;\n @Prop() discountAmount: number = 0;\n\n private getDurationTranslation(duration: number): string {\n const frequency = this.planFrequency || PLAN_FREQUENCY_ENUM.MONTH;\n\n if (duration === 1) {\n return I18nService.translate(`summary.${frequency}_one`);\n } else {\n return I18nService.translate(`summary.${frequency}_other`, { count: duration });\n }\n }\n componentDidLoad() {\n this.updateTotalFlow();\n // this.initializeDiscountState();\n }\n\n componentDidUpdate() {\n this.updateTotalFlow();\n }\n\n private updateTotalFlow() {\n if (this.totalFlow) {\n this.totalFlow.format = { style: 'currency', currency: this.currency };\n this.totalFlow.update(Number(sessionState.data.pricing.total));\n }\n }\n @Listen('discountApplied')\n handleDiscountApplied(event: CustomEvent) {\n this.discountApplied = event.detail;\n }\n\n private getRecalculatedInstallmentAmount(): number {\n const selectedInstallment =\n sessionState.data?.cardInformation?.installments?.selectedInstallment;\n if (!selectedInstallment) {\n return 0;\n }\n\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(selectedInstallment.installmentAmount * discountRatio * 100) / 100;\n }\n\n return selectedInstallment.installmentAmount;\n }\n\n private renderTotalForPlan() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmountToday')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data.pricing.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTotalForPlanGeneral() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data?.pricing?.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTotalForNonPlan() {\n return (\n sessionState.data?.itemInformation?.type !== SESSION_ITEM_TYPE_ENUM.PLAN && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data.pricing.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTrialPeriod() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.totalAmountLastTrialPeriod')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {formatAmount(sessionState.data?.pricing?.total, this.currency)}\n {`/${I18nService.translate(`summary.${this.planFrequency}`, {\n count: this.planFrequencyCount || 1,\n })} `}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderDiscountAlertWrapper() {\n return (\n sessionState.data?.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"summary-row\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.trialPeriodDaysDetails', {\n trialDays: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n count: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n })}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.free')}\n </rebill-typography>\n </div>\n )\n );\n }\n\n render() {\n const renderItemDetails = (\n title: boolean = true,\n description: boolean = true,\n amount: boolean = true,\n ) => (\n <div class=\"summary-card\">\n {(title || description) && (\n <div class=\"summary-card-info\">\n {title && (\n <rebill-typography variant=\"subtitle-bold\" gutterBottom>\n {this.itemTitle}\n </rebill-typography>\n )}\n {description && this.itemDescription && (\n <rebill-typography variant=\"body2\">{this.itemDescription}</rebill-typography>\n )}\n </div>\n )}\n {amount && (\n <div class=\"summary-card-amount\">\n <rebill-typography variant=\"body2\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy\n ? formatAmount(sessionState.data?.pricing?.planAmount, this.currency)\n : formatAmount(this.subtotal, this.currency)}\n </rebill-typography>\n </div>\n )}\n </div>\n );\n const renderPriceDetails = () => {\n const detailsBlocks = [\n this.renderTotalForPlan(),\n this.renderTotalForPlanGeneral(),\n this.renderTotalForNonPlan(),\n this.renderTrialPeriod(),\n this.renderDiscountAlertWrapper(),\n ].filter(Boolean);\n\n if (detailsBlocks.length > 1) {\n detailsBlocks.splice(detailsBlocks.length - 1, 0, <rebill-divider />);\n }\n\n return (\n <div class=\"summary-details\">\n {/* Subtotal se queda inline */}\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.subtotal')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy\n ? formatAmount(sessionState.data.pricing.planAmount, this.currency)\n : formatAmount(this.subtotal, this.currency)}\n </rebill-typography>\n </div>\n {/* Installments y coupon también inline */}\n {sessionState.data.pricing.installments && (\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.installments')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {getInstallmentDescription(\n sessionState.data?.pricing?.installments,\n this.getRecalculatedInstallmentAmount(),\n )}\n </rebill-typography>\n </div>\n )}\n {this.allowCoupon &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <discount-coupon />\n )}\n {!sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy && <rebill-divider />}\n {detailsBlocks.map(block => (\n <div class=\"summary-detail-wrapper\">{block}</div>\n ))}\n </div>\n );\n };\n const renderDiscountAlert = () =>\n this.planFrequency &&\n this.discountApplied &&\n (this.discountedPercentage > 0 || this.discountAmount > 0) && (\n <rebill-alert\n variant=\"filled\"\n type=\"success\"\n icon=\"tag-sale\"\n size=\"medium\"\n colorIcon={COLORS_ENUM.GREEN}\n message={\n this.discountDuration\n ? I18nService.translate(`summary.planDiscountDescriptionWithDuration`, {\n discount:\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency),\n duration: this.getDurationTranslation(this.discountDuration),\n })\n : I18nService.translate(`summary.planDiscountDescriptionWithoutDuration`, {\n discount:\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency),\n })\n }\n />\n );\n return (\n <div class=\"summary-container\">\n {this.displayedComponents.includes('totalAmount') && (\n <div class=\"summary-header\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"trial-pill\">\n <rebill-typography variant=\"body2\" align=\"center\" color={COLORS_ENUM.GREEN_TEXT}>\n {I18nService.translate('summary.trialPill', {\n days: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n count: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n })}\n </rebill-typography>\n </div>\n )}\n <div class=\"total-amount-container\">\n <rebill-typography variant=\"h4-span\" align=\"center\" gutterBottom>\n <number-flow ref={el => (this.totalFlow = el as any)}></number-flow>\n </rebill-typography>\n {this.planFrequency && (\n <rebill-typography\n variant=\"body1\"\n color={COLORS_ENUM.SECONDARY}\n align=\"center\"\n gutterBottom\n style={{ fontWeight: 'normal' }}\n >\n {`/ ${I18nService.translate(`summary.${this.planFrequency}`, {\n count: this.planFrequencyCount || 1,\n })}`}\n </rebill-typography>\n )}\n </div>\n {sessionState.data?.itemInformation?.type !== SESSION_ITEM_TYPE_ENUM.PLAN && (\n <rebill-typography variant=\"body2\" align=\"center\" gutterBottom>\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n )}\n {this.allowCoupon &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <discount-coupon hide-label />\n )}\n </div>\n )}\n {this.displayedComponents.includes('itemDetails') &&\n (isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) ? (\n <collapsible-card header={I18nService.translate('summary.details')}>\n {renderItemDetails(true, true, true)}\n </collapsible-card>\n ) : (\n <collapsible-card header={this.itemTitle}>\n {renderItemDetails(false, !!this.itemDescription, true)}\n </collapsible-card>\n ))}\n {this.displayedComponents.includes('discount') &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy &&\n renderDiscountAlert()}\n {this.displayedComponents.includes('timelineFreeTrial') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-free-trial\n trial-period-ends-at={sessionState.data?.itemInformation?.trial?.trialPeriodEndsAt}\n trial-period-ends-reminder-at={\n sessionState.data?.itemInformation?.trial?.trialPeriodEndsReminderAt\n }\n trial-period-days={sessionState.data?.itemInformation?.trial?.trialPeriodDays}\n subtotal={sessionState.data.pricing.subtotal}\n currency={sessionState.data.pricing.currency}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('timelineDebitDay') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy &&\n sessionState.data?.itemInformation?.debitDay &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-debit-day\n debit-day={sessionState.data?.itemInformation?.debitDay}\n total-amount={sessionState.data?.pricing?.total}\n plan-amount={sessionState.data?.pricing?.planAmount}\n currency={sessionState.data?.pricing?.currency}\n debit-strategy={sessionState.data?.itemInformation?.debitStrategy}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('priceDetails') &&\n (isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) ? (\n <collapsible-card header={I18nService.translate('summary.summary')}>\n {renderPriceDetails()}\n </collapsible-card>\n ) : (\n renderPriceDetails()\n ))}\n {this.displayedComponents.includes('timelineFreeTrial') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-free-trial\n trial-period-ends-at={sessionState.data?.itemInformation?.trial?.trialPeriodEndsAt}\n trial-period-ends-reminder-at={\n sessionState.data?.itemInformation?.trial?.trialPeriodEndsReminderAt\n }\n trial-period-days={sessionState.data?.itemInformation?.trial?.trialPeriodDays}\n subtotal={sessionState.data?.pricing?.subtotal}\n currency={sessionState.data?.pricing?.currency}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('timelineDebitDay') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy &&\n sessionState.data?.itemInformation?.debitDay &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-debit-day\n debit-day={sessionState.data?.itemInformation?.debitDay}\n total-amount={sessionState.data?.pricing?.total}\n plan-amount={sessionState.data?.pricing?.planAmount}\n currency={sessionState.data?.pricing?.currency}\n debit-strategy={sessionState.data?.itemInformation?.debitStrategy}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('discount') &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy &&\n renderDiscountAlert()}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../../src/components/checkout/summary/summary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,mBAAm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CAAC,YAAY,2BACT,IAAI,CAAC,oBAAoB,uBAC7B,IAAI,CAAC,gBAAgB,qBACvB,IAAI,CAAC,cAAc,GACpC,CACH;YACF,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC5C,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,OAAO,CAAC;gBACnE,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe;gBAC3D,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,aAAa;gBAClD,mBAAmB,EAAE,CACnB,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Listen, Prop, State } from '@stencil/core';\nimport 'number-flow';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport {\n PLAN_FREQUENCY_ENUM,\n SESSION_DISCOUNT_TYPE_ENUM,\n SESSION_ITEM_TYPE_ENUM,\n} from '../../../models';\nimport { sessionState } from '../../../store/session.store';\nimport { BREAKPOINT_ENUM, isBreakpointBelow } from '../../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../../utils/color-class-mapper';\nimport { formatAmount } from '../../../utils/currency-formatter';\nimport { getInstallmentDescription } from '../../../utils/installment-utils';\n\n@Component({\n tag: 'rebill-summary',\n styleUrl: 'summary.css',\n shadow: false,\n})\nexport class Summary {\n /** Monto total */\n @Prop() totalAmount!: number | string;\n /** Título del item */\n @Prop() itemTitle!: string;\n /** Descripción del item */\n @Prop() itemDescription!: string;\n /** Monto del item */\n @Prop() itemAmount!: number | string;\n /** Frecuencia del plan */\n @Prop() planFrequency?: PLAN_FREQUENCY_ENUM;\n /** Cantidad de frecuencia del plan */\n @Prop() planFrequencyCount?: number;\n /** Subtotal */\n @Prop() subtotal!: number | string;\n /** Descuento (opcional) */\n @Prop() discount?: number | string;\n @Prop() currency: string;\n @Prop() displayedComponents: (\n | 'totalAmount'\n | 'discount'\n | 'itemDetails'\n | 'priceDetails'\n | 'timelineFreeTrial'\n | 'timelineDebitDay'\n )[] = [\n 'totalAmount',\n 'discount',\n 'itemDetails',\n 'priceDetails',\n 'timelineFreeTrial',\n 'timelineDebitDay',\n ];\n @Prop() allowCoupon: boolean = false;\n @Prop() currentBreakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() discountApplied: boolean = false;\n private totalFlow?: HTMLElement & { update: (value: number) => void; format?: any };\n @Prop() discountType: SESSION_DISCOUNT_TYPE_ENUM;\n @Prop() discountedPercentage: number = 0;\n @Prop() discountDuration: number = 0;\n @Prop() discountAmount: number = 0;\n\n private getDurationTranslation(duration: number): string {\n const frequency = this.planFrequency || PLAN_FREQUENCY_ENUM.MONTH;\n\n if (duration === 1) {\n return I18nService.translate(`summary.${frequency}_one`);\n } else {\n return I18nService.translate(`summary.${frequency}_other`, { count: duration });\n }\n }\n componentDidLoad() {\n this.updateTotalFlow();\n // this.initializeDiscountState();\n }\n\n componentDidUpdate() {\n this.updateTotalFlow();\n }\n\n private updateTotalFlow() {\n if (this.totalFlow) {\n this.totalFlow.format = { style: 'currency', currency: this.currency };\n this.totalFlow.update(Number(sessionState.data.pricing.total));\n }\n }\n @Listen('discountApplied')\n handleDiscountApplied(event: CustomEvent) {\n this.discountApplied = event.detail;\n }\n\n private getRecalculatedInstallmentAmount(): number {\n const selectedInstallment =\n sessionState.data?.cardInformation?.installments?.selectedInstallment;\n if (!selectedInstallment) {\n return 0;\n }\n\n if (sessionState.data.pricing.discountAmount > 0) {\n const originalTotal = sessionState.data.pricing.subtotal;\n const currentTotal = sessionState.data.pricing.totalWithoutInstallment;\n const discountRatio = currentTotal / originalTotal;\n\n return Math.round(selectedInstallment.installmentAmount * discountRatio * 100) / 100;\n }\n\n return selectedInstallment.installmentAmount;\n }\n\n private renderTotalForPlan() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmountToday')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data.pricing.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTotalForPlanGeneral() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data?.pricing?.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTotalForNonPlan() {\n return (\n sessionState.data?.itemInformation?.type !== SESSION_ITEM_TYPE_ENUM.PLAN && (\n <div class=\"summary-row total\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {formatAmount(sessionState.data.pricing.total, this.currency)}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderTrialPeriod() {\n return (\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.totalAmountLastTrialPeriod')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {formatAmount(sessionState.data?.pricing?.total, this.currency)}\n {`/${I18nService.translate(`summary.${this.planFrequency}`, {\n count: this.planFrequencyCount || 1,\n })} `}\n </rebill-typography>\n </div>\n )\n );\n }\n\n private renderDiscountAlertWrapper() {\n return (\n sessionState.data?.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"summary-row\">\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.trialPeriodDaysDetails', {\n trialDays: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n count: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n })}\n </rebill-typography>\n <rebill-typography\n variant={\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'subtitle1'\n : 'body3'\n }\n style={{\n fontWeight: isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP)\n ? 'normal'\n : 'bold',\n }}\n >\n {I18nService.translate('summary.free')}\n </rebill-typography>\n </div>\n )\n );\n }\n\n render() {\n const renderItemDetails = (\n title: boolean = true,\n description: boolean = true,\n amount: boolean = true,\n ) => (\n <div class=\"summary-card\">\n {(title || description) && (\n <div class=\"summary-card-info\">\n {title && (\n <rebill-typography variant=\"subtitle-bold\" gutterBottom>\n {this.itemTitle}\n </rebill-typography>\n )}\n {description && this.itemDescription && (\n <rebill-typography variant=\"body2\">\n <span innerHTML={this.itemDescription}></span>\n </rebill-typography>\n )}\n </div>\n )}\n {amount && (\n <div class=\"summary-card-amount\">\n <rebill-typography variant=\"body2\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy\n ? formatAmount(sessionState.data?.pricing?.planAmount, this.currency)\n : formatAmount(this.subtotal, this.currency)}\n </rebill-typography>\n </div>\n )}\n </div>\n );\n const renderPriceDetails = () => {\n const detailsBlocks = [\n this.renderTotalForPlan(),\n this.renderTotalForPlanGeneral(),\n this.renderTotalForNonPlan(),\n this.renderTrialPeriod(),\n this.renderDiscountAlertWrapper(),\n ].filter(Boolean);\n\n if (detailsBlocks.length > 1) {\n detailsBlocks.splice(detailsBlocks.length - 1, 0, <rebill-divider />);\n }\n\n return (\n <div class=\"summary-details\">\n {/* Subtotal se queda inline */}\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.subtotal')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy\n ? formatAmount(sessionState.data.pricing.planAmount, this.currency)\n : formatAmount(this.subtotal, this.currency)}\n </rebill-typography>\n </div>\n {/* Installments y coupon también inline */}\n {sessionState.data.pricing.installments && (\n <div class=\"summary-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('summary.installments')}\n </rebill-typography>\n <rebill-typography variant=\"body2\">\n {getInstallmentDescription(\n sessionState.data?.pricing?.installments,\n this.getRecalculatedInstallmentAmount(),\n )}\n </rebill-typography>\n </div>\n )}\n {this.allowCoupon &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <discount-coupon />\n )}\n {!sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy && <rebill-divider />}\n {detailsBlocks.map(block => (\n <div class=\"summary-detail-wrapper\">{block}</div>\n ))}\n </div>\n );\n };\n const renderDiscountAlert = () =>\n this.planFrequency &&\n this.discountApplied &&\n (this.discountedPercentage > 0 || this.discountAmount > 0) && (\n <rebill-alert\n variant=\"filled\"\n type=\"success\"\n icon=\"tag-sale\"\n size=\"medium\"\n colorIcon={COLORS_ENUM.GREEN}\n message={\n this.discountDuration\n ? I18nService.translate(`summary.planDiscountDescriptionWithDuration`, {\n discount:\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency),\n duration: this.getDurationTranslation(this.discountDuration),\n })\n : I18nService.translate(`summary.planDiscountDescriptionWithoutDuration`, {\n discount:\n this.discountType === SESSION_DISCOUNT_TYPE_ENUM.PERCENTAGE\n ? `${this.discountedPercentage}%`\n : formatAmount(this.discountAmount, this.currency),\n })\n }\n />\n );\n return (\n <div class=\"summary-container\">\n {this.displayedComponents.includes('totalAmount') && (\n <div class=\"summary-header\">\n {sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data.itemInformation?.trial?.trialPeriodDays && (\n <div class=\"trial-pill\">\n <rebill-typography variant=\"body2\" align=\"center\" color={COLORS_ENUM.GREEN_TEXT}>\n {I18nService.translate('summary.trialPill', {\n days: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n count: sessionState.data?.itemInformation?.trial?.trialPeriodDays,\n })}\n </rebill-typography>\n </div>\n )}\n <div class=\"total-amount-container\">\n <rebill-typography variant=\"h4-span\" align=\"center\" gutterBottom>\n <number-flow ref={el => (this.totalFlow = el as any)}></number-flow>\n </rebill-typography>\n {this.planFrequency && (\n <rebill-typography\n variant=\"body1\"\n color={COLORS_ENUM.SECONDARY}\n align=\"center\"\n gutterBottom\n style={{ fontWeight: 'normal' }}\n >\n {`/ ${I18nService.translate(`summary.${this.planFrequency}`, {\n count: this.planFrequencyCount || 1,\n })}`}\n </rebill-typography>\n )}\n </div>\n {sessionState.data?.itemInformation?.type !== SESSION_ITEM_TYPE_ENUM.PLAN && (\n <rebill-typography variant=\"body2\" align=\"center\" gutterBottom>\n {I18nService.translate('summary.totalAmount')}\n </rebill-typography>\n )}\n {this.allowCoupon &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <discount-coupon hide-label />\n )}\n </div>\n )}\n {this.displayedComponents.includes('itemDetails') &&\n (isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) ? (\n <collapsible-card header={I18nService.translate('summary.details')}>\n {renderItemDetails(true, true, true)}\n </collapsible-card>\n ) : (\n <collapsible-card header={this.itemTitle}>\n {renderItemDetails(false, !!this.itemDescription, true)}\n </collapsible-card>\n ))}\n {this.displayedComponents.includes('discount') &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy &&\n renderDiscountAlert()}\n {this.displayedComponents.includes('timelineFreeTrial') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-free-trial\n trial-period-ends-at={sessionState.data?.itemInformation?.trial?.trialPeriodEndsAt}\n trial-period-ends-reminder-at={\n sessionState.data?.itemInformation?.trial?.trialPeriodEndsReminderAt\n }\n trial-period-days={sessionState.data?.itemInformation?.trial?.trialPeriodDays}\n subtotal={sessionState.data.pricing.subtotal}\n currency={sessionState.data.pricing.currency}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('timelineDebitDay') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy &&\n sessionState.data?.itemInformation?.debitDay &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-debit-day\n debit-day={sessionState.data?.itemInformation?.debitDay}\n total-amount={sessionState.data?.pricing?.total}\n plan-amount={sessionState.data?.pricing?.planAmount}\n currency={sessionState.data?.pricing?.currency}\n debit-strategy={sessionState.data?.itemInformation?.debitStrategy}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('priceDetails') &&\n (isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) ? (\n <collapsible-card header={I18nService.translate('summary.summary')}>\n {renderPriceDetails()}\n </collapsible-card>\n ) : (\n renderPriceDetails()\n ))}\n {this.displayedComponents.includes('timelineFreeTrial') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-free-trial\n trial-period-ends-at={sessionState.data?.itemInformation?.trial?.trialPeriodEndsAt}\n trial-period-ends-reminder-at={\n sessionState.data?.itemInformation?.trial?.trialPeriodEndsReminderAt\n }\n trial-period-days={sessionState.data?.itemInformation?.trial?.trialPeriodDays}\n subtotal={sessionState.data?.pricing?.subtotal}\n currency={sessionState.data?.pricing?.currency}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('timelineDebitDay') &&\n sessionState.data?.itemInformation?.type === SESSION_ITEM_TYPE_ENUM.PLAN &&\n sessionState.data?.itemInformation?.debitStrategy &&\n sessionState.data?.itemInformation?.debitDay &&\n isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <rebill-timeline-debit-day\n debit-day={sessionState.data?.itemInformation?.debitDay}\n total-amount={sessionState.data?.pricing?.total}\n plan-amount={sessionState.data?.pricing?.planAmount}\n currency={sessionState.data?.pricing?.currency}\n debit-strategy={sessionState.data?.itemInformation?.debitStrategy}\n discount-applied={this.discountApplied}\n discount-type={this.discountType}\n discounted-percentage={this.discountedPercentage}\n discount-duration={this.discountDuration}\n discount-amount={this.discountAmount}\n />\n )}\n {this.displayedComponents.includes('discount') &&\n !isBreakpointBelow(this.currentBreakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n !sessionState.data?.itemInformation?.trial?.trialPeriodDays &&\n !sessionState.data?.itemInformation?.debitStrategy &&\n renderDiscountAlert()}\n </div>\n );\n }\n}\n"]}