@forgeroute/ui 0.4.71 → 0.4.73

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injectable, InjectionToken, Injector, PLATFORM_ID, ViewEncapsulation, afterNextRender, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injectable, InjectionToken, Injector, PLATFORM_ID, ViewEncapsulation, afterNextRender, computed, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
3
3
  import { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
4
- import { AlertComponent, BadgeComponent, ButtonComponent, DetailCardComponent, FormRowComponent, FormSectionComponent, ModalComponent, SkeletonComponent, StackComponent, TextComponent, TextInputComponent } from "@forgeroute/ui";
4
+ import { AlertComponent, BadgeComponent, ButtonComponent, DetailCardComponent, FormRowComponent, FormSectionComponent, HintComponent, KpiCardComponent, ModalComponent, PAYMENT_METHOD_PLUGIN, PaymentMethodPlugin, SkeletonComponent, StackComponent, TextComponent, TextInputComponent, callHost, formatCurrency } from "@forgeroute/ui";
5
5
  import * as i1 from "@angular/forms";
6
6
  import { FormsModule } from "@angular/forms";
7
7
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
@@ -2511,8 +2511,10 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
2511
2511
  "label",
2512
2512
  "ariaLabel",
2513
2513
  "inputTestId",
2514
+ "inputName",
2514
2515
  "placeholder",
2515
2516
  "prefix",
2517
+ "leadingIcon",
2516
2518
  "revealable",
2517
2519
  "passwordRequirements",
2518
2520
  "passwordRules",
@@ -3372,6 +3374,7 @@ var StripeConnectComponent = class StripeConnectComponent {
3372
3374
  "background",
3373
3375
  "headerBackground",
3374
3376
  "footerBackground",
3377
+ "footerAlign",
3375
3378
  "textColor",
3376
3379
  "showHeader",
3377
3380
  "collapsible",
@@ -3650,6 +3653,895 @@ i0.ɵɵngDeclareClassMetadata({
3650
3653
  }]
3651
3654
  }
3652
3655
  });
3653
- export { MICRODEPOSIT_COPY, MicrodepositVerifyComponent, STRIPE_A11Y_MESSAGES, STRIPE_ACH_NOTICE, STRIPE_DEFAULT_ERROR_MESSAGE, STRIPE_ERROR_MESSAGES, STRIPE_LOADER, STRIPE_PAYMENT_DEFAULTS, STRIPE_TECHNICAL_ERROR_MESSAGES, StripeConnectComponent, StripeConnectFlow, StripePaymentComponent, StripePaymentService, buildLoadOptions, defaultStripeLoader, depositAmountError, descriptorCodeError, getStripeErrorMessage, isDarkPage, isStripeUrl, microdepositArrivalText, microdepositCancelMessage, microdepositKeepsActiveText, microdepositProcessingText, microdepositStepsText, normalizeDescriptorCode, normalizeIntent, outcomeOf, paymentMethodIdOf, provideStripePayment, readStripeAppearance, readStripeReturnParams, retrieveIntent, stripeConnectNotice, verificationOf, verifyMicrodeposits };
3656
+ const STRIPE_PAYMENT_METHODS = [{
3657
+ value: "CARD",
3658
+ label: "Card"
3659
+ }, {
3660
+ value: "ACH",
3661
+ label: "ACH / Bank Transfer"
3662
+ }];
3663
+ const stripeMethodType = (method) => method === "ACH" ? "us_bank_account" : "card";
3664
+ const STRIPE_METHOD_TEXTS = {
3665
+ amountNeeded: "Enter an amount to continue.",
3666
+ notCompleted: "Payment was not completed. Please try again or choose another method.",
3667
+ achTitle: "ACH Payment Submitted",
3668
+ achMessage: (amount) => `Your bank payment of ${amount} has been submitted for processing. ACH payments typically take 3–5 business days to complete.`,
3669
+ verificationTitle: "Bank Verification Needed",
3670
+ verificationMessage: (amount) => `Your bank payment of ${amount} was submitted. The bank account must be verified with the small deposits Stripe sends, then the payment completes.`,
3671
+ receiptNote: "A receipt is sent once the payment has been fully processed and settled."
3672
+ };
3673
+ const WALLETS = {
3674
+ applePay: "never",
3675
+ googlePay: "never"
3676
+ };
3677
+ const FIELDS = { billingDetails: { address: {
3678
+ country: "auto",
3679
+ postalCode: "auto"
3680
+ } } };
3681
+ var PaymentStripeBodyComponent = class PaymentStripeBodyComponent {
3682
+ constructor() {
3683
+ this.injector = inject(Injector);
3684
+ this.host = inject(ElementRef);
3685
+ this.ctx = input.required(...ngDevMode ? [{ debugName: "ctx" }] : /* istanbul ignore next */ []);
3686
+ this.config = input.required(...ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []);
3687
+ this.payment = viewChild(StripePaymentComponent, ...ngDevMode ? [{ debugName: "payment" }] : /* istanbul ignore next */ []);
3688
+ this.texts = STRIPE_METHOD_TEXTS;
3689
+ this.wallets = WALLETS;
3690
+ this.fields = FIELDS;
3691
+ this.complete = signal(false, ...ngDevMode ? [{ debugName: "complete" }] : /* istanbul ignore next */ []);
3692
+ this.processing = signal(false, ...ngDevMode ? [{ debugName: "processing" }] : /* istanbul ignore next */ []);
3693
+ this.done = signal(false, ...ngDevMode ? [{ debugName: "done" }] : /* istanbul ignore next */ []);
3694
+ this.error = signal("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
3695
+ this.estimate = signal(null, ...ngDevMode ? [{ debugName: "estimate" }] : /* istanbul ignore next */ []);
3696
+ this.estimating = signal(false, ...ngDevMode ? [{ debugName: "estimating" }] : /* istanbul ignore next */ []);
3697
+ this.estimateError = signal("", ...ngDevMode ? [{ debugName: "estimateError" }] : /* istanbul ignore next */ []);
3698
+ this.estimateTick = signal(0, ...ngDevMode ? [{ debugName: "estimateTick" }] : /* istanbul ignore next */ []);
3699
+ this.intentFees = signal(null, ...ngDevMode ? [{ debugName: "intentFees" }] : /* istanbul ignore next */ []);
3700
+ this.confirmation = signal(null, ...ngDevMode ? [{ debugName: "confirmation" }] : /* istanbul ignore next */ []);
3701
+ this.lastAmount = signal(null, ...ngDevMode ? [{ debugName: "lastAmount" }] : /* istanbul ignore next */ []);
3702
+ this.intent = null;
3703
+ this.estimateRun = 0;
3704
+ this.estimateStale = false;
3705
+ this.amountValue = computed(() => this.ctx().amount, ...ngDevMode ? [{ debugName: "amountValue" }] : /* istanbul ignore next */ []);
3706
+ this.methodValue = computed(() => this.ctx().method, ...ngDevMode ? [{ debugName: "methodValue" }] : /* istanbul ignore next */ []);
3707
+ this.methodType = computed(() => stripeMethodType(this.ctx().method), ...ngDevMode ? [{ debugName: "methodType" }] : /* istanbul ignore next */ []);
3708
+ this.total = computed(() => this.estimate()?.totalAmount ?? this.lastAmount() ?? 0, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
3709
+ this.receiptNote = computed(() => this.config().receiptNote(), ...ngDevMode ? [{ debugName: "receiptNote" }] : /* istanbul ignore next */ []);
3710
+ this.deferred = computed(() => ({
3711
+ mode: "payment",
3712
+ amount: Math.round(this.total() * 100),
3713
+ currency: this.ctx().currency.toLowerCase()
3714
+ }), ...ngDevMode ? [{ debugName: "deferred" }] : /* istanbul ignore next */ []);
3715
+ this.defaultValues = computed(() => {
3716
+ const b = this.config().billingDetails();
3717
+ return b ? { billingDetails: b } : null;
3718
+ }, ...ngDevMode ? [{ debugName: "defaultValues" }] : /* istanbul ignore next */ []);
3719
+ this.feeRows = computed(() => {
3720
+ const fees = this.intentFees() ?? this.estimate();
3721
+ const amount = this.lastAmount();
3722
+ if (!fees || amount == null || fees.stripeFee === void 0 && fees.platformFee === void 0) return [];
3723
+ const money = (n) => formatCurrency(n, { currency: this.ctx().currency });
3724
+ const rows = [{
3725
+ key: "amount",
3726
+ label: "Payment amount",
3727
+ value: money(amount)
3728
+ }];
3729
+ if (fees.stripeFee !== void 0) rows.push({
3730
+ key: "processing",
3731
+ label: `Processing fee${fees.stripeFeeLabel ? ` (${fees.stripeFeeLabel})` : ""}`,
3732
+ value: money(fees.stripeFee)
3733
+ });
3734
+ if (fees.platformFee !== void 0) rows.push({
3735
+ key: "platform",
3736
+ label: `Platform fee${fees.platformFeeLabel ? ` (${fees.platformFeeLabel})` : ""}`,
3737
+ value: money(fees.platformFee)
3738
+ });
3739
+ return rows;
3740
+ }, ...ngDevMode ? [{ debugName: "feeRows" }] : /* istanbul ignore next */ []);
3741
+ this.totalCard = computed(() => {
3742
+ const fees = this.intentFees() ?? this.estimate();
3743
+ if (!fees || this.lastAmount() == null || fees.totalAmount === void 0) return null;
3744
+ return {
3745
+ value: formatCurrency(fees.totalAmount, { currency: this.ctx().currency }),
3746
+ subtitle: "Payment amount plus fees"
3747
+ };
3748
+ }, ...ngDevMode ? [{ debugName: "totalCard" }] : /* istanbul ignore next */ []);
3749
+ this.createIntentFn = async () => {
3750
+ const create = this.config().createIntent();
3751
+ const ctx = this.ctx();
3752
+ if (!create || ctx.amount == null) throw new Error("Card payments are not available right now.");
3753
+ this.cancelIntent(true);
3754
+ const info = await callHost(() => create({
3755
+ amount: ctx.amount,
3756
+ paymentMethod: ctx.method,
3757
+ paymentMethodType: this.methodType(),
3758
+ receivedDate: ctx.receivedDate,
3759
+ notes: ctx.note || null,
3760
+ ...ctx.allocation
3761
+ }));
3762
+ if (!info?.clientSecret) throw new Error("Failed to initialize payment. Please try again.");
3763
+ this.intent = info;
3764
+ this.intentFees.set({
3765
+ stripeFee: info.stripeFee,
3766
+ platformFee: info.platformFee,
3767
+ totalAmount: info.totalAmount,
3768
+ stripeFeeLabel: info.stripeFeeLabel,
3769
+ platformFeeLabel: info.platformFeeLabel
3770
+ });
3771
+ return info.clientSecret;
3772
+ };
3773
+ effect(() => {
3774
+ const amount = this.amountValue();
3775
+ if (amount != null) untracked(() => this.lastAmount.set(amount));
3776
+ });
3777
+ effect(() => {
3778
+ const ctx = this.ctx();
3779
+ const processing = this.processing();
3780
+ const notice = this.confirmation();
3781
+ const complete = this.complete();
3782
+ const estimating = this.estimating();
3783
+ const done = this.done();
3784
+ const estimateFailed = !!this.estimateError();
3785
+ const label = notice ? "Done" : ctx.amount != null ? `Pay ${formatCurrency(this.total(), { currency: ctx.currency })}` : "Pay";
3786
+ untracked(() => ctx.setPrimary({
3787
+ label,
3788
+ loading: processing && !notice,
3789
+ disabled: notice ? done : !complete || processing || estimating || estimateFailed || ctx.amount == null || done,
3790
+ onClick: () => notice ? this.finish() : void this.pay()
3791
+ }));
3792
+ });
3793
+ effect((onCleanup) => {
3794
+ const estimate = this.config().estimateFees();
3795
+ const amount = this.amountValue();
3796
+ const method = this.methodValue();
3797
+ this.estimateTick();
3798
+ const run = ++this.estimateRun;
3799
+ untracked(() => {
3800
+ this.estimate.set(null);
3801
+ this.intentFees.set(null);
3802
+ this.estimateError.set("");
3803
+ });
3804
+ if (!estimate || amount == null) {
3805
+ untracked(() => this.estimating.set(false));
3806
+ return;
3807
+ }
3808
+ untracked(() => this.estimating.set(true));
3809
+ let hung = null;
3810
+ const failure = "Could not calculate the fees. Please try again.";
3811
+ const timer = setTimeout(async () => {
3812
+ hung = setTimeout(() => {
3813
+ if (run !== this.estimateRun) return;
3814
+ this.estimating.set(false);
3815
+ this.estimateError.set(failure);
3816
+ }, Math.max(1, this.config().estimateTimeoutMs()));
3817
+ let fees = null;
3818
+ try {
3819
+ fees = await callHost(() => estimate({
3820
+ amount,
3821
+ paymentMethod: method,
3822
+ paymentMethodType: stripeMethodType(method)
3823
+ })) ?? null;
3824
+ } catch {
3825
+ fees = null;
3826
+ }
3827
+ if (hung) {
3828
+ clearTimeout(hung);
3829
+ hung = null;
3830
+ }
3831
+ if (run !== this.estimateRun) return;
3832
+ this.estimating.set(false);
3833
+ if (this.processing()) {
3834
+ this.estimateStale = true;
3835
+ return;
3836
+ }
3837
+ if (fees) {
3838
+ this.estimate.set(fees);
3839
+ this.estimateError.set("");
3840
+ } else {
3841
+ this.estimate.set(null);
3842
+ this.estimateError.set(this.config().feesRequired() ? failure : "");
3843
+ }
3844
+ }, 300);
3845
+ onCleanup(() => {
3846
+ clearTimeout(timer);
3847
+ if (hung) clearTimeout(hung);
3848
+ });
3849
+ });
3850
+ effect(() => {
3851
+ if (this.processing()) return;
3852
+ untracked(() => {
3853
+ if (!this.estimateStale) return;
3854
+ this.estimateStale = false;
3855
+ if (!this.done() && !this.confirmation()) this.estimateTick.update((n) => n + 1);
3856
+ });
3857
+ });
3858
+ effect(() => {
3859
+ this.methodValue();
3860
+ untracked(() => {
3861
+ this.complete.set(false);
3862
+ this.error.set("");
3863
+ });
3864
+ });
3865
+ effect(() => {
3866
+ const ctx = this.ctx();
3867
+ untracked(() => ctx.onCancel(() => this.confirmation() ? this.finish() : this.cancelIntent()));
3868
+ });
3869
+ inject(DestroyRef).onDestroy(() => {
3870
+ this.estimateRun++;
3871
+ this.cancelIntent();
3872
+ });
3873
+ }
3874
+ retryEstimate() {
3875
+ this.estimateTick.update((n) => n + 1);
3876
+ }
3877
+ onReady() {
3878
+ this.complete.set(false);
3879
+ this.ctx().announce("Payment form ready");
3880
+ }
3881
+ onFailed(failure) {
3882
+ this.error.set(failure.message);
3883
+ this.processing.set(false);
3884
+ this.ctx().report("failed", { message: failure.message });
3885
+ }
3886
+ async pay() {
3887
+ const ctx = this.ctx();
3888
+ const payment = this.payment();
3889
+ if (this.processing() || this.estimating() || this.done() || !payment) return;
3890
+ if (!ctx.validate() || ctx.amount == null) return;
3891
+ this.error.set("");
3892
+ this.processing.set(true);
3893
+ ctx.setBusy(true);
3894
+ ctx.announce("Processing payment");
3895
+ let finished = false;
3896
+ try {
3897
+ const event = await payment.confirm();
3898
+ if (event) finished = await this.afterConfirm(event, ctx);
3899
+ } finally {
3900
+ this.processing.set(false);
3901
+ if (!finished) ctx.setBusy(false);
3902
+ }
3903
+ }
3904
+ async afterConfirm(event, ctx) {
3905
+ const amount = ctx.amount;
3906
+ const money = formatCurrency(amount, { currency: ctx.currency });
3907
+ if (event.outcome !== "succeeded" && event.outcome !== "processing" && event.outcome !== "requires_verification") {
3908
+ this.error.set(this.texts.notCompleted);
3909
+ return false;
3910
+ }
3911
+ const info = this.intent;
3912
+ this.intent = null;
3913
+ let finalizeFailed = false;
3914
+ const finalize = this.config().finalize();
3915
+ if (finalize && info) try {
3916
+ await callHost(() => finalize(info));
3917
+ } catch {
3918
+ finalizeFailed = true;
3919
+ }
3920
+ const result = {
3921
+ type: "stripe",
3922
+ paymentMethod: ctx.method,
3923
+ amount
3924
+ };
3925
+ if (event.outcome === "succeeded") {
3926
+ ctx.report(finalizeFailed ? "finalize-failed" : "paid", { result });
3927
+ this.done.set(true);
3928
+ ctx.complete(result);
3929
+ return true;
3930
+ }
3931
+ const verification = event.outcome === "requires_verification";
3932
+ ctx.report(finalizeFailed ? "finalize-failed" : verification ? "verification" : "processing", { result });
3933
+ this.confirmation.set(verification ? {
3934
+ title: this.texts.verificationTitle,
3935
+ message: this.texts.verificationMessage(money)
3936
+ } : {
3937
+ title: this.texts.achTitle,
3938
+ message: this.texts.achMessage(money)
3939
+ });
3940
+ ctx.setExclusive(true);
3941
+ ctx.setBusy(false);
3942
+ afterNextRender(() => this.host.nativeElement.querySelector(".psm-notice")?.focus(), { injector: this.injector });
3943
+ return true;
3944
+ }
3945
+ finish() {
3946
+ const ctx = this.ctx();
3947
+ if (this.done()) return;
3948
+ this.done.set(true);
3949
+ ctx.complete({
3950
+ type: "stripe",
3951
+ paymentMethod: ctx.method,
3952
+ amount: ctx.amount ?? this.lastAmount() ?? 0
3953
+ });
3954
+ }
3955
+ cancelIntent(force = false) {
3956
+ const info = this.intent;
3957
+ if (!info || this.processing() && !force) return;
3958
+ this.intent = null;
3959
+ const cancel = this.config().cancel();
3960
+ if (cancel) callHost(() => cancel(info)).catch(() => {});
3961
+ }
3962
+ static {
3963
+ this.ɵfac = i0.ɵɵngDeclareFactory({
3964
+ minVersion: "12.0.0",
3965
+ version: "22.2.2",
3966
+ ngImport: i0,
3967
+ type: PaymentStripeBodyComponent,
3968
+ deps: [],
3969
+ target: i0.ɵɵFactoryTarget.Component
3970
+ });
3971
+ }
3972
+ static {
3973
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
3974
+ minVersion: "17.0.0",
3975
+ version: "22.2.2",
3976
+ type: PaymentStripeBodyComponent,
3977
+ isStandalone: true,
3978
+ selector: "ui-payment-stripe-body",
3979
+ inputs: {
3980
+ ctx: {
3981
+ classPropertyName: "ctx",
3982
+ publicName: "ctx",
3983
+ isSignal: true,
3984
+ isRequired: true,
3985
+ transformFunction: null
3986
+ },
3987
+ config: {
3988
+ classPropertyName: "config",
3989
+ publicName: "config",
3990
+ isSignal: true,
3991
+ isRequired: true,
3992
+ transformFunction: null
3993
+ }
3994
+ },
3995
+ viewQueries: [{
3996
+ propertyName: "payment",
3997
+ first: true,
3998
+ predicate: StripePaymentComponent,
3999
+ descendants: true,
4000
+ isSignal: true
4001
+ }],
4002
+ ngImport: i0,
4003
+ template: `
4004
+ <div class="psm">
4005
+ @if (confirmation(); as notice) {
4006
+ <ui-alert variant="success" [title]="notice.title" tabindex="-1" class="psm-notice" data-testid="stripe-method-confirmation">
4007
+ <p>{{ notice.message }}</p>
4008
+ <p>{{ receiptNote() }}</p>
4009
+ </ui-alert>
4010
+ } @else {
4011
+ @if (ctx().amount == null) {
4012
+ <ui-hint data-testid="stripe-method-amount-needed">{{ texts.amountNeeded }}</ui-hint>
4013
+ }
4014
+ @if (estimateError()) {
4015
+ <div class="psm-error">
4016
+ <ui-alert variant="warning" data-testid="stripe-method-estimate-error">{{ estimateError() }}
4017
+ <ui-button variant="secondary" size="sm" data-testid="stripe-method-estimate-retry" (click)="retryEstimate()">Try again</ui-button>
4018
+ </ui-alert>
4019
+ </div>
4020
+ }
4021
+ @if (lastAmount() != null) {
4022
+ <ui-stripe-payment #payment mode="payment" [publishableKey]="config().publishableKey()" [stripeAccount]="config().stripeAccount()" [deferred]="deferred()"
4023
+ [createIntent]="createIntentFn" [paymentMethodTypes]="[methodType()]" [showSubmit]="false" [showErrors]="false" [autoHandleCardAction]="true"
4024
+ [wallets]="wallets" [fields]="fields" [defaultValues]="defaultValues()" [appearance]="$any(config().appearance())" [appearanceFromTokens]="true" label="Payment details"
4025
+ (ready)="onReady()" (elementChange)="complete.set($event.complete)" (failed)="onFailed($event)" (loadError)="onFailed($event)" />
4026
+ @if (totalCard(); as card) {
4027
+ <ui-kpi-card class="psm-total" data-testid="stripe-method-total" label="Total charged" [value]="card.value" [subtitle]="card.subtitle" icon="dollar" color="blue" valueColor="blue" />
4028
+ }
4029
+ @if (feeRows().length) {
4030
+ <dl class="psm-fees" data-testid="stripe-method-fees" aria-label="Payment total">
4031
+ @for (row of feeRows(); track row.key) {
4032
+ <div class="psm-fee" [attr.data-testid]="'stripe-fee-' + row.key"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>
4033
+ }
4034
+ </dl>
4035
+ }
4036
+ @if (error()) { <div class="psm-error"><ui-alert variant="danger" data-testid="stripe-method-error">{{ error() }}</ui-alert></div> }
4037
+ }
4038
+ }
4039
+ </div>
4040
+ `,
4041
+ isInline: true,
4042
+ styles: ["ui-payment-stripe-body{display:block;min-width:0}ui-payment-stripe-body .psm-error{margin-top:12px}ui-payment-stripe-body .psm-total{display:block;margin-top:16px}ui-payment-stripe-body .psm-fees{margin:16px 0 0;padding:14px 16px;border:1px solid var(--ui-psp-border, #e2e8f0);border-radius:10px;font-size:.8125rem}ui-payment-stripe-body .psm-fee{display:flex;justify-content:space-between;padding:4px 0;color:var(--ui-psp-muted, #475569)}ui-payment-stripe-body .psm-fee dt,ui-payment-stripe-body .psm-fee dd{margin:0}ui-payment-stripe-body .psm-notice:focus{outline:none}ui-payment-stripe-body .psm-notice p{margin:0 0 6px}\n"],
4043
+ dependencies: [
4044
+ {
4045
+ kind: "component",
4046
+ type: AlertComponent,
4047
+ selector: "ui-alert",
4048
+ inputs: [
4049
+ "variant",
4050
+ "title",
4051
+ "dismissible",
4052
+ "dismissAriaLabel",
4053
+ "quiet",
4054
+ "compact",
4055
+ "inline",
4056
+ "fill"
4057
+ ],
4058
+ outputs: ["dismissed"]
4059
+ },
4060
+ {
4061
+ kind: "component",
4062
+ type: ButtonComponent,
4063
+ selector: "ui-button",
4064
+ inputs: [
4065
+ "variant",
4066
+ "routerLink",
4067
+ "queryParams",
4068
+ "fragment",
4069
+ "state",
4070
+ "href",
4071
+ "target",
4072
+ "rel",
4073
+ "shortLabel",
4074
+ "shortBelow",
4075
+ "color",
4076
+ "active",
4077
+ "size",
4078
+ "type",
4079
+ "disabled",
4080
+ "loading",
4081
+ "fullWidth",
4082
+ "ariaLabel",
4083
+ "ariaExpanded",
4084
+ "ariaPressed",
4085
+ "ariaDescribedBy",
4086
+ "modal-footer-left",
4087
+ "modal-footer-right"
4088
+ ]
4089
+ },
4090
+ {
4091
+ kind: "component",
4092
+ type: HintComponent,
4093
+ selector: "ui-hint"
4094
+ },
4095
+ {
4096
+ kind: "component",
4097
+ type: KpiCardComponent,
4098
+ selector: "ui-kpi-card",
4099
+ inputs: [
4100
+ "label",
4101
+ "value",
4102
+ "subtitle",
4103
+ "icon",
4104
+ "color",
4105
+ "highlight",
4106
+ "clickable",
4107
+ "valueColor",
4108
+ "loading",
4109
+ "loadingLabel",
4110
+ "background",
4111
+ "progress",
4112
+ "progressMax",
4113
+ "progressSize",
4114
+ "progressStrokeWidth",
4115
+ "progressVariant",
4116
+ "progressAriaLabel",
4117
+ "progressValueText"
4118
+ ]
4119
+ },
4120
+ {
4121
+ kind: "component",
4122
+ type: StripePaymentComponent,
4123
+ selector: "ui-stripe-payment",
4124
+ inputs: [
4125
+ "mountOnly",
4126
+ "mode",
4127
+ "publishableKey",
4128
+ "clientSecret",
4129
+ "deferred",
4130
+ "createIntent",
4131
+ "stripeAccount",
4132
+ "locale",
4133
+ "stripeOptions",
4134
+ "paymentMethodTypes",
4135
+ "elementsOptions",
4136
+ "layout",
4137
+ "paymentMethodOrder",
4138
+ "wallets",
4139
+ "fields",
4140
+ "defaultValues",
4141
+ "business",
4142
+ "terms",
4143
+ "paymentElementOptions",
4144
+ "appearance",
4145
+ "appearanceFromTokens",
4146
+ "returnUrl",
4147
+ "billingDetails",
4148
+ "confirmParams",
4149
+ "redirect",
4150
+ "submitBeforeConfirm",
4151
+ "autoHandleCardAction",
4152
+ "submitLabel",
4153
+ "showSubmit",
4154
+ "disabled",
4155
+ "pending",
4156
+ "label",
4157
+ "required",
4158
+ "mountId",
4159
+ "mountClass",
4160
+ "showAchNotice",
4161
+ "achNotice",
4162
+ "achNoticeTestId",
4163
+ "initialPaymentMethodType",
4164
+ "showErrors",
4165
+ "errorDisplay",
4166
+ "errorDisplayByStage",
4167
+ "errorFallback",
4168
+ "errorFallbackByStage",
4169
+ "errorMessages",
4170
+ "loadErrorMessage",
4171
+ "a11yMessages"
4172
+ ],
4173
+ outputs: [
4174
+ "stripeReady",
4175
+ "ready",
4176
+ "paymentMethodTypeChange",
4177
+ "elementChange",
4178
+ "confirmed",
4179
+ "failed",
4180
+ "loadError"
4181
+ ]
4182
+ }
4183
+ ],
4184
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
4185
+ encapsulation: i0.ViewEncapsulation.None
4186
+ });
4187
+ }
4188
+ };
4189
+ i0.ɵɵngDeclareClassMetadata({
4190
+ minVersion: "12.0.0",
4191
+ version: "22.2.2",
4192
+ ngImport: i0,
4193
+ type: PaymentStripeBodyComponent,
4194
+ decorators: [{
4195
+ type: Component,
4196
+ args: [{
4197
+ selector: "ui-payment-stripe-body",
4198
+ standalone: true,
4199
+ changeDetection: ChangeDetectionStrategy.OnPush,
4200
+ encapsulation: ViewEncapsulation.None,
4201
+ imports: [
4202
+ AlertComponent,
4203
+ ButtonComponent,
4204
+ HintComponent,
4205
+ KpiCardComponent,
4206
+ StripePaymentComponent
4207
+ ],
4208
+ template: `
4209
+ <div class="psm">
4210
+ @if (confirmation(); as notice) {
4211
+ <ui-alert variant="success" [title]="notice.title" tabindex="-1" class="psm-notice" data-testid="stripe-method-confirmation">
4212
+ <p>{{ notice.message }}</p>
4213
+ <p>{{ receiptNote() }}</p>
4214
+ </ui-alert>
4215
+ } @else {
4216
+ @if (ctx().amount == null) {
4217
+ <ui-hint data-testid="stripe-method-amount-needed">{{ texts.amountNeeded }}</ui-hint>
4218
+ }
4219
+ @if (estimateError()) {
4220
+ <div class="psm-error">
4221
+ <ui-alert variant="warning" data-testid="stripe-method-estimate-error">{{ estimateError() }}
4222
+ <ui-button variant="secondary" size="sm" data-testid="stripe-method-estimate-retry" (click)="retryEstimate()">Try again</ui-button>
4223
+ </ui-alert>
4224
+ </div>
4225
+ }
4226
+ @if (lastAmount() != null) {
4227
+ <ui-stripe-payment #payment mode="payment" [publishableKey]="config().publishableKey()" [stripeAccount]="config().stripeAccount()" [deferred]="deferred()"
4228
+ [createIntent]="createIntentFn" [paymentMethodTypes]="[methodType()]" [showSubmit]="false" [showErrors]="false" [autoHandleCardAction]="true"
4229
+ [wallets]="wallets" [fields]="fields" [defaultValues]="defaultValues()" [appearance]="$any(config().appearance())" [appearanceFromTokens]="true" label="Payment details"
4230
+ (ready)="onReady()" (elementChange)="complete.set($event.complete)" (failed)="onFailed($event)" (loadError)="onFailed($event)" />
4231
+ @if (totalCard(); as card) {
4232
+ <ui-kpi-card class="psm-total" data-testid="stripe-method-total" label="Total charged" [value]="card.value" [subtitle]="card.subtitle" icon="dollar" color="blue" valueColor="blue" />
4233
+ }
4234
+ @if (feeRows().length) {
4235
+ <dl class="psm-fees" data-testid="stripe-method-fees" aria-label="Payment total">
4236
+ @for (row of feeRows(); track row.key) {
4237
+ <div class="psm-fee" [attr.data-testid]="'stripe-fee-' + row.key"><dt>{{ row.label }}</dt><dd>{{ row.value }}</dd></div>
4238
+ }
4239
+ </dl>
4240
+ }
4241
+ @if (error()) { <div class="psm-error"><ui-alert variant="danger" data-testid="stripe-method-error">{{ error() }}</ui-alert></div> }
4242
+ }
4243
+ }
4244
+ </div>
4245
+ `,
4246
+ styles: ["ui-payment-stripe-body{display:block;min-width:0}ui-payment-stripe-body .psm-error{margin-top:12px}ui-payment-stripe-body .psm-total{display:block;margin-top:16px}ui-payment-stripe-body .psm-fees{margin:16px 0 0;padding:14px 16px;border:1px solid var(--ui-psp-border, #e2e8f0);border-radius:10px;font-size:.8125rem}ui-payment-stripe-body .psm-fee{display:flex;justify-content:space-between;padding:4px 0;color:var(--ui-psp-muted, #475569)}ui-payment-stripe-body .psm-fee dt,ui-payment-stripe-body .psm-fee dd{margin:0}ui-payment-stripe-body .psm-notice:focus{outline:none}ui-payment-stripe-body .psm-notice p{margin:0 0 6px}\n"]
4247
+ }]
4248
+ }],
4249
+ ctorParameters: () => [],
4250
+ propDecorators: {
4251
+ ctx: [{
4252
+ type: i0.Input,
4253
+ args: [{
4254
+ isSignal: true,
4255
+ alias: "ctx",
4256
+ required: true
4257
+ }]
4258
+ }],
4259
+ config: [{
4260
+ type: i0.Input,
4261
+ args: [{
4262
+ isSignal: true,
4263
+ alias: "config",
4264
+ required: true
4265
+ }]
4266
+ }],
4267
+ payment: [{
4268
+ type: i0.ViewChild,
4269
+ args: [i0.forwardRef(() => StripePaymentComponent), { isSignal: true }]
4270
+ }]
4271
+ }
4272
+ });
4273
+ var StripePaymentMethodComponent = class StripePaymentMethodComponent extends PaymentMethodPlugin {
4274
+ constructor() {
4275
+ super(...arguments);
4276
+ this.self = this;
4277
+ this.createIntent = input(null, ...ngDevMode ? [{ debugName: "createIntent" }] : /* istanbul ignore next */ []);
4278
+ this.finalize = input(null, ...ngDevMode ? [{ debugName: "finalize" }] : /* istanbul ignore next */ []);
4279
+ this.cancel = input(null, ...ngDevMode ? [{ debugName: "cancel" }] : /* istanbul ignore next */ []);
4280
+ this.estimateFees = input(null, ...ngDevMode ? [{ debugName: "estimateFees" }] : /* istanbul ignore next */ []);
4281
+ this.publishableKey = input(null, ...ngDevMode ? [{ debugName: "publishableKey" }] : /* istanbul ignore next */ []);
4282
+ this.stripeAccount = input(null, ...ngDevMode ? [{ debugName: "stripeAccount" }] : /* istanbul ignore next */ []);
4283
+ this.billingDetails = input(null, ...ngDevMode ? [{ debugName: "billingDetails" }] : /* istanbul ignore next */ []);
4284
+ this.appearance = input(null, ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
4285
+ this.methodList = input(STRIPE_PAYMENT_METHODS, ...ngDevMode ? [{ debugName: "methodList" }] : /* istanbul ignore next */ []);
4286
+ this.estimateTimeoutMs = input(1e4, ...ngDevMode ? [{ debugName: "estimateTimeoutMs" }] : /* istanbul ignore next */ []);
4287
+ this.feesRequired = input(false, ...ngDevMode ? [{ debugName: "feesRequired" }] : /* istanbul ignore next */ []);
4288
+ this.receiptNote = input(STRIPE_METHOD_TEXTS.receiptNote, ...ngDevMode ? [{ debugName: "receiptNote" }] : /* istanbul ignore next */ []);
4289
+ this.body = viewChild("body", ...ngDevMode ? [{ debugName: "body" }] : /* istanbul ignore next */ []);
4290
+ this.methods = this.methodList;
4291
+ this.template = this.body;
4292
+ }
4293
+ static {
4294
+ this.ɵfac = i0.ɵɵngDeclareFactory({
4295
+ minVersion: "12.0.0",
4296
+ version: "22.2.2",
4297
+ ngImport: i0,
4298
+ type: StripePaymentMethodComponent,
4299
+ deps: null,
4300
+ target: i0.ɵɵFactoryTarget.Component
4301
+ });
4302
+ }
4303
+ static {
4304
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
4305
+ minVersion: "17.2.0",
4306
+ version: "22.2.2",
4307
+ type: StripePaymentMethodComponent,
4308
+ isStandalone: true,
4309
+ selector: "ui-payment-stripe-method",
4310
+ inputs: {
4311
+ createIntent: {
4312
+ classPropertyName: "createIntent",
4313
+ publicName: "createIntent",
4314
+ isSignal: true,
4315
+ isRequired: false,
4316
+ transformFunction: null
4317
+ },
4318
+ finalize: {
4319
+ classPropertyName: "finalize",
4320
+ publicName: "finalize",
4321
+ isSignal: true,
4322
+ isRequired: false,
4323
+ transformFunction: null
4324
+ },
4325
+ cancel: {
4326
+ classPropertyName: "cancel",
4327
+ publicName: "cancel",
4328
+ isSignal: true,
4329
+ isRequired: false,
4330
+ transformFunction: null
4331
+ },
4332
+ estimateFees: {
4333
+ classPropertyName: "estimateFees",
4334
+ publicName: "estimateFees",
4335
+ isSignal: true,
4336
+ isRequired: false,
4337
+ transformFunction: null
4338
+ },
4339
+ publishableKey: {
4340
+ classPropertyName: "publishableKey",
4341
+ publicName: "publishableKey",
4342
+ isSignal: true,
4343
+ isRequired: false,
4344
+ transformFunction: null
4345
+ },
4346
+ stripeAccount: {
4347
+ classPropertyName: "stripeAccount",
4348
+ publicName: "stripeAccount",
4349
+ isSignal: true,
4350
+ isRequired: false,
4351
+ transformFunction: null
4352
+ },
4353
+ billingDetails: {
4354
+ classPropertyName: "billingDetails",
4355
+ publicName: "billingDetails",
4356
+ isSignal: true,
4357
+ isRequired: false,
4358
+ transformFunction: null
4359
+ },
4360
+ appearance: {
4361
+ classPropertyName: "appearance",
4362
+ publicName: "appearance",
4363
+ isSignal: true,
4364
+ isRequired: false,
4365
+ transformFunction: null
4366
+ },
4367
+ methodList: {
4368
+ classPropertyName: "methodList",
4369
+ publicName: "methodList",
4370
+ isSignal: true,
4371
+ isRequired: false,
4372
+ transformFunction: null
4373
+ },
4374
+ estimateTimeoutMs: {
4375
+ classPropertyName: "estimateTimeoutMs",
4376
+ publicName: "estimateTimeoutMs",
4377
+ isSignal: true,
4378
+ isRequired: false,
4379
+ transformFunction: null
4380
+ },
4381
+ feesRequired: {
4382
+ classPropertyName: "feesRequired",
4383
+ publicName: "feesRequired",
4384
+ isSignal: true,
4385
+ isRequired: false,
4386
+ transformFunction: null
4387
+ },
4388
+ receiptNote: {
4389
+ classPropertyName: "receiptNote",
4390
+ publicName: "receiptNote",
4391
+ isSignal: true,
4392
+ isRequired: false,
4393
+ transformFunction: null
4394
+ }
4395
+ },
4396
+ host: { styleAttribute: "display: none" },
4397
+ providers: [{
4398
+ provide: PAYMENT_METHOD_PLUGIN,
4399
+ useExisting: forwardRef(() => StripePaymentMethodComponent)
4400
+ }],
4401
+ viewQueries: [{
4402
+ propertyName: "body",
4403
+ first: true,
4404
+ predicate: ["body"],
4405
+ descendants: true,
4406
+ isSignal: true
4407
+ }],
4408
+ usesInheritance: true,
4409
+ ngImport: i0,
4410
+ template: `<ng-template #body let-ctx><ui-payment-stripe-body [ctx]="ctx" [config]="self" /></ng-template>`,
4411
+ isInline: true,
4412
+ dependencies: [{
4413
+ kind: "component",
4414
+ type: PaymentStripeBodyComponent,
4415
+ selector: "ui-payment-stripe-body",
4416
+ inputs: ["ctx", "config"]
4417
+ }],
4418
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
4419
+ });
4420
+ }
4421
+ };
4422
+ i0.ɵɵngDeclareClassMetadata({
4423
+ minVersion: "12.0.0",
4424
+ version: "22.2.2",
4425
+ ngImport: i0,
4426
+ type: StripePaymentMethodComponent,
4427
+ decorators: [{
4428
+ type: Component,
4429
+ args: [{
4430
+ selector: "ui-payment-stripe-method",
4431
+ standalone: true,
4432
+ changeDetection: ChangeDetectionStrategy.OnPush,
4433
+ imports: [PaymentStripeBodyComponent],
4434
+ providers: [{
4435
+ provide: PAYMENT_METHOD_PLUGIN,
4436
+ useExisting: forwardRef(() => StripePaymentMethodComponent)
4437
+ }],
4438
+ host: { style: "display: none" },
4439
+ template: `<ng-template #body let-ctx><ui-payment-stripe-body [ctx]="ctx" [config]="self" /></ng-template>`
4440
+ }]
4441
+ }],
4442
+ propDecorators: {
4443
+ createIntent: [{
4444
+ type: i0.Input,
4445
+ args: [{
4446
+ isSignal: true,
4447
+ alias: "createIntent",
4448
+ required: false
4449
+ }]
4450
+ }],
4451
+ finalize: [{
4452
+ type: i0.Input,
4453
+ args: [{
4454
+ isSignal: true,
4455
+ alias: "finalize",
4456
+ required: false
4457
+ }]
4458
+ }],
4459
+ cancel: [{
4460
+ type: i0.Input,
4461
+ args: [{
4462
+ isSignal: true,
4463
+ alias: "cancel",
4464
+ required: false
4465
+ }]
4466
+ }],
4467
+ estimateFees: [{
4468
+ type: i0.Input,
4469
+ args: [{
4470
+ isSignal: true,
4471
+ alias: "estimateFees",
4472
+ required: false
4473
+ }]
4474
+ }],
4475
+ publishableKey: [{
4476
+ type: i0.Input,
4477
+ args: [{
4478
+ isSignal: true,
4479
+ alias: "publishableKey",
4480
+ required: false
4481
+ }]
4482
+ }],
4483
+ stripeAccount: [{
4484
+ type: i0.Input,
4485
+ args: [{
4486
+ isSignal: true,
4487
+ alias: "stripeAccount",
4488
+ required: false
4489
+ }]
4490
+ }],
4491
+ billingDetails: [{
4492
+ type: i0.Input,
4493
+ args: [{
4494
+ isSignal: true,
4495
+ alias: "billingDetails",
4496
+ required: false
4497
+ }]
4498
+ }],
4499
+ appearance: [{
4500
+ type: i0.Input,
4501
+ args: [{
4502
+ isSignal: true,
4503
+ alias: "appearance",
4504
+ required: false
4505
+ }]
4506
+ }],
4507
+ methodList: [{
4508
+ type: i0.Input,
4509
+ args: [{
4510
+ isSignal: true,
4511
+ alias: "methodList",
4512
+ required: false
4513
+ }]
4514
+ }],
4515
+ estimateTimeoutMs: [{
4516
+ type: i0.Input,
4517
+ args: [{
4518
+ isSignal: true,
4519
+ alias: "estimateTimeoutMs",
4520
+ required: false
4521
+ }]
4522
+ }],
4523
+ feesRequired: [{
4524
+ type: i0.Input,
4525
+ args: [{
4526
+ isSignal: true,
4527
+ alias: "feesRequired",
4528
+ required: false
4529
+ }]
4530
+ }],
4531
+ receiptNote: [{
4532
+ type: i0.Input,
4533
+ args: [{
4534
+ isSignal: true,
4535
+ alias: "receiptNote",
4536
+ required: false
4537
+ }]
4538
+ }],
4539
+ body: [{
4540
+ type: i0.ViewChild,
4541
+ args: ["body", { isSignal: true }]
4542
+ }]
4543
+ }
4544
+ });
4545
+ export { MICRODEPOSIT_COPY, MicrodepositVerifyComponent, STRIPE_A11Y_MESSAGES, STRIPE_ACH_NOTICE, STRIPE_DEFAULT_ERROR_MESSAGE, STRIPE_ERROR_MESSAGES, STRIPE_LOADER, STRIPE_METHOD_TEXTS, STRIPE_PAYMENT_DEFAULTS, STRIPE_PAYMENT_METHODS, STRIPE_TECHNICAL_ERROR_MESSAGES, StripeConnectComponent, StripeConnectFlow, StripePaymentComponent, StripePaymentMethodComponent, StripePaymentService, buildLoadOptions, defaultStripeLoader, depositAmountError, descriptorCodeError, getStripeErrorMessage, isDarkPage, isStripeUrl, microdepositArrivalText, microdepositCancelMessage, microdepositKeepsActiveText, microdepositProcessingText, microdepositStepsText, normalizeDescriptorCode, normalizeIntent, outcomeOf, paymentMethodIdOf, provideStripePayment, readStripeAppearance, readStripeReturnParams, retrieveIntent, stripeConnectNotice, verificationOf, verifyMicrodeposits };
3654
4546
 
3655
4547
  //# sourceMappingURL=forgeroute-ui-stripe.mjs.map