@forgeroute/ui 0.5.6 → 0.5.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -524,6 +524,20 @@ export declare class StripePaymentComponent {
524
524
  * SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.
525
525
  */
526
526
  readonly payableRef: import("@angular/core").InputSignal<string | null>;
527
+ /**
528
+ * Opt-in for `mode="setup"` (a SetupIntent: saves a card WITHOUT charging it): with `duplicateProtection` AND `protectSetup` the same protection runs for the save, driven by the same inputs
529
+ * (`payableRef`, `attemptKey`, `checkStatus`, `paid`, `readinessCheck`, the timeouts): synchronous lock, attempt key (also in `createIntent({ mode: 'setup', attemptKey, payableRef })` of a
530
+ * deferred setup), UNKNOWN state with `checkStatus` polling, offline refusal, readiness gate and the reload / second-tab lock. The texts say "payment method" instead of "payment". Default OFF: a
531
+ * setup form ignores `duplicateProtection` exactly as before. Ignored in `mode="payment"`.
532
+ */
533
+ readonly protectSetup: import("@angular/core").InputSignal<boolean>;
534
+ /**
535
+ * Only for `mode="setup"` with `protectSetup` (default true = unchanged). With the default, a saved card leaves a 24-hour "paid" lock under the `payableRef` (every form of the payable mounted later the same day starts locked with
536
+ * "A payment method was just saved for this"; only `resetPaid()` or a new `payableRef` unlocks it). `false`: the success is still reported (`(confirmed)`, `(outcome)` `succeeded`) but leaves NO lock and no 24-hour record,
537
+ * the epoch moves (the next save derives a NEW attempt key, `..._e1`) and the form can be used again (a "replace the card" screen opened later the same day). A save in flight or unknown still blocks a second submit.
538
+ * A host `attemptKey` is used as it is: with it the host must supply a new key for the next save itself. Ignored in `mode="payment"`.
539
+ */
540
+ readonly lockAfterSuccess: import("@angular/core").InputSignal<boolean>;
527
541
  /** A key the host supplies; empty = generated per payment attempt session. It reaches `createIntent({ attemptKey })`. */
528
542
  readonly attemptKey: import("@angular/core").InputSignal<string | null>;
529
543
  /** The host's status check by attempt key: resolves an UNKNOWN outcome. */
@@ -538,6 +552,8 @@ export declare class StripePaymentComponent {
538
552
  readonly statusCheckTimeoutMs: import("@angular/core").InputSignal<number>;
539
553
  /** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */
540
554
  readonly statusFailGraceMs: import("@angular/core").InputSignal<number>;
555
+ /** While the attempt's own request is NEVER settled (a hung request), a status answer `failed` / `not_found` is ignored for this long after the attempt became unknown (ms, default 180000): the original request may still land. */
556
+ readonly statusHardMaxMs: import("@angular/core").InputSignal<number>;
541
557
  /** Offer "Start over" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */
542
558
  readonly allowStartOver: import("@angular/core").InputSignal<boolean>;
543
559
  /** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */
@@ -603,7 +619,10 @@ export declare class StripePaymentComponent {
603
619
  readonly elementChange: import("@angular/core").OutputEmitterRef<StripeElementChange>;
604
620
  /** A ConfirmationToken of the typed card was created (`collectConfirmationToken` during `confirm()`, or `createConfirmationToken()`). Only emitted for a card. */
605
621
  readonly confirmationToken: import("@angular/core").OutputEmitterRef<StripeConfirmationTokenEvent>;
606
- /** The intent was confirmed (succeeded, processing, needs bank verification, or needs a further action). */
622
+ /**
623
+ * The intent was confirmed (succeeded, processing, needs bank verification, or needs a further action). NOT always a success: a host must check `event.outcome === 'succeeded'` (or `'processing'`) before it treats the
624
+ * payment / saved method as done. With the protection on, a setup that `requires_action` or `requires_verification` is still emitted here but the attempt is UNKNOWN (locked, the status check decides): see `(outcome)`.
625
+ */
607
626
  readonly confirmed: import("@angular/core").OutputEmitterRef<StripeConfirmedEvent>;
608
627
  /** A step failed (validation, intent creation, confirmation). `message` is ready to show. */
609
628
  readonly failed: import("@angular/core").OutputEmitterRef<StripeFailure>;
@@ -654,12 +673,12 @@ export declare class StripePaymentComponent {
654
673
  /** What the element was last given, so a change made while it loaded is applied once it is ready. */
655
674
  private appliedDefaultValues;
656
675
  private appliedDisabled;
657
- /** The protection applies to PAYMENTS only: saving a card (`mode="setup"`) moves no money, so there is nothing to double-charge and the flag is ignored there. */
676
+ /** The protection applies to PAYMENTS; `mode="setup"` (saving a card, nothing is charged) ignores `duplicateProtection` unless the host ALSO sets `protectSetup`. */
658
677
  protected readonly protectionOn: import("@angular/core").Signal<boolean>;
659
- /** The duplicate-payment protection (only active with `duplicateProtection` in payment mode). */
678
+ /** The duplicate-payment protection (the attempt: lock, key, unknown state). Only active with `duplicateProtection` in payment mode, or in setup mode with `protectSetup` too; with the protection off it does nothing. */
660
679
  readonly attempt: PaymentAttempt;
680
+ /** The readiness gate (same condition as {@link attempt}). */
661
681
  readonly readiness: PaymentReadiness;
662
- /** The key of the attempt that is running (passed to `createIntent`); `null` with protection off. */
663
682
  /** Bumped by "Retry loading": the init effect runs again. */
664
683
  private readonly retryTick;
665
684
  constructor();
@@ -727,12 +746,24 @@ export declare class StripePaymentComponent {
727
746
  /**
728
747
  * After Stripe redirected the customer back to `returnUrl`: retrieves the intent (client secret from the URL by default) and reports it like `confirm()`
729
748
  * (`confirmed` for succeeded / processing / needs verification / needs action, `failed` otherwise). `{ event: null, failure: null }` when the URL has no intent.
749
+ * With the duplicate protection on (payment, or setup with `protectSetup`) the result also settles the attempt (see `settleReturn`). A `(confirmed)` event is NOT always a success (`requires_action`, `requires_verification`):
750
+ * a host must check `event.outcome === 'succeeded'` (or `processing`) before it treats the intent as paid / saved.
751
+ * BEHAVIOUR WITH THE PROTECTION ON (also for `mode="payment"`: a host that opts in with `duplicateProtection` and calls this method gets it; without the protection nothing changes): the attempt is settled by the intent that came back, so a
752
+ * `succeeded` / `requires_capture` (and, for a payment, `processing`) intent is a success (`succeeded`, reason `return`), `requires_payment_method` / `canceled` a definitive failure (new key, reason `return`), a bank verification or a further
753
+ * action unknown, a SETUP that is still `processing` unknown (`setup_processing`: a bank debit can still fail) and an intent that could not be read unknown (`error`). Calling it again after a success (a reload of the return page) settles and reports nothing a second time.
754
+ * THE LIBRARY DOES NOT ASK THE BACKEND on this path: a return with `requires_payment_method` / `canceled` fails the attempt at once, so the host's backend must still cancel the SetupIntent / PaymentIntent itself (a SetupIntent that carries an error is
755
+ * still confirmable by a late browser request, which could save a card after the form said "not saved").
730
756
  */
731
757
  handleReturn(options?: {
732
758
  clientSecret?: string;
733
759
  kind?: StripeIntentKind;
734
760
  search?: string;
735
761
  }): Promise<StripeReturnResult>;
762
+ /**
763
+ * With the protection on, the intent a redirect brought back also decides the attempt (so a redirect flow does not stay unknown until the host calls `markSucceeded()`): succeeded / processing / requires_capture = success,
764
+ * `requires_payment_method` / `canceled` = a definitive failure (new key), a bank verification or a further action = unknown (the status check decides), an intent that could not be read = unknown. Nothing without the protection.
765
+ */
766
+ private settleReturn;
736
767
  private errorOptions;
737
768
  /** Something Stripe.js threw (an IntegrationError, a network failure) as a failure, with the text chosen like any Stripe error. */
738
769
  private thrownFailure;
@@ -913,6 +944,16 @@ export declare class StripePaymentComponent {
913
944
  "required": false;
914
945
  "isSignal": true;
915
946
  };
947
+ "protectSetup": {
948
+ "alias": "protectSetup";
949
+ "required": false;
950
+ "isSignal": true;
951
+ };
952
+ "lockAfterSuccess": {
953
+ "alias": "lockAfterSuccess";
954
+ "required": false;
955
+ "isSignal": true;
956
+ };
916
957
  "attemptKey": {
917
958
  "alias": "attemptKey";
918
959
  "required": false;
@@ -953,6 +994,11 @@ export declare class StripePaymentComponent {
953
994
  "required": false;
954
995
  "isSignal": true;
955
996
  };
997
+ "statusHardMaxMs": {
998
+ "alias": "statusHardMaxMs";
999
+ "required": false;
1000
+ "isSignal": true;
1001
+ };
956
1002
  "allowStartOver": {
957
1003
  "alias": "allowStartOver";
958
1004
  "required": false;
@@ -2753,6 +2753,29 @@ export declare const UI_DEFAULT_LABELS: {
2753
2753
  readonly 'paymentReadiness.generic': "Payments are not available right now. Please try again shortly.";
2754
2754
  readonly 'paymentReadiness.retryLoad': "Retry loading the payment form";
2755
2755
  readonly 'paymentReadiness.storageWarning': "Your browser limits storage, so a page reload or a second tab during a payment cannot be recovered automatically. Please do not reload or open this page twice while paying.";
2756
+ readonly 'paymentSetup.checking': "Checking that your payment method was saved...";
2757
+ readonly 'paymentSetup.checkingHelp': "Please wait and do not save it again. We are making sure your payment method was saved.";
2758
+ readonly 'paymentSetup.stillUnknown': "We could not confirm yet that your payment method was saved. Please check again in a moment and do not save it again.";
2759
+ readonly 'paymentSetup.waiting': "Waiting for your payment method to be confirmed...";
2760
+ readonly 'paymentSetup.paid': "A payment method was just saved for this. If you need to save another one, please wait a moment or contact support.";
2761
+ readonly 'paymentSetup.queuedOffline': "You appear to be offline. Your payment method was not saved. Please check your connection and try again.";
2762
+ readonly 'paymentSetup.offline': "You are offline. Reconnect to the internet to save your payment method: nothing was sent.";
2763
+ readonly 'paymentSetup.awaitingVerification': "Bank verification required: your bank account has NOT been saved yet. Until you verify the small deposits (or descriptor code) from your bank, it cannot be used and nothing will be charged.";
2764
+ readonly 'paymentSetup.slowConnection': "Your connection is too slow to save your payment method safely. Please try again on a better connection.";
2765
+ readonly 'paymentSetup.serviceUnavailable': "Saving payment methods is temporarily unavailable. Please try again in a few minutes.";
2766
+ readonly 'paymentSetup.outcomeUnknown': "We are still confirming the result of an earlier attempt to save a payment method. Please wait and do not save it again.";
2767
+ readonly 'paymentSetup.inFlight': "A payment method for this is already being saved. Please wait and check again shortly.";
2768
+ readonly 'paymentSetup.readinessChecking': "Checking that saving a payment method is available...";
2769
+ readonly 'paymentSetup.readinessGeneric': "Saving a payment method is not available right now. Please try again shortly.";
2770
+ readonly 'paymentSetup.alreadySaved': "A payment method has already been saved for this.";
2771
+ readonly 'paymentSetup.storageWarning': "Your browser limits storage, so a page reload or a second tab while your payment method is being saved cannot be recovered automatically. Please do not reload or open this page twice while saving.";
2772
+ readonly 'paymentSetup.unsupportedBrowser': "This browser cannot save payment methods safely. Please use a current version of Chrome, Edge, Firefox or Safari over a secure (https) connection.";
2773
+ readonly 'paymentSetup.merchantNotReady': "This business cannot save this kind of payment method right now. Please contact the business.";
2774
+ readonly 'paymentSetup.eventsBacklog': "Saving payment methods is paused for a moment while we catch up. Please try again shortly.";
2775
+ readonly 'paymentSetup.payableChanged': "The details on this page changed after it loaded. Reload the page to see the current details before you save a payment method.";
2776
+ readonly 'paymentSetup.reconnectRequired': "Saving payment methods is not available right now: this business must reconnect its payment account. Please contact the business.";
2777
+ readonly 'paymentSetup.requiresPaymentMethod': "Your payment method was not saved. Please try a different payment method.";
2778
+ readonly 'paymentSetup.processing': "Your bank is still confirming your payment method and it has NOT been saved yet. Please wait and do not save it again.";
2756
2779
  readonly 'qboHostedPay.title': "Pay {{ amount }}";
2757
2780
  readonly 'qboHostedPay.titleNoAmount': "Secure payment";
2758
2781
  readonly 'qboHostedPay.pay': "Pay {{ amount }}";
@@ -3564,7 +3587,7 @@ export declare class SelectComponent implements ControlValueAccessor, Validator,
3564
3587
  readonly error: import("@angular/core").InputSignal<string>;
3565
3588
  /** The host's "tried to submit" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */
3566
3589
  readonly showErrors: import("@angular/core").InputSignal<boolean>;
3567
- readonly size: import("@angular/core").InputSignal<"sm" | "default">;
3590
+ readonly size: import("@angular/core").InputSignal<"default" | "sm">;
3568
3591
  readonly _disabledInput: import("@angular/core").InputSignal<boolean>;
3569
3592
  private readonly _cvaDisabled;
3570
3593
  protected readonly disabled: import("@angular/core").Signal<boolean>;
@@ -6977,7 +7000,7 @@ export declare class CheckboxComponent implements ControlValueAccessor, Validato
6977
7000
  * clicking it still toggles the box - e.g. a product name that is both the heading of its card and the label of its checkbox.
6978
7001
  * Default null: plain label text, exactly as before. Single mode only.
6979
7002
  */
6980
- readonly headingLevel: import("@angular/core").InputSignal<1 | 4 | 2 | 3 | 5 | 6 | null>;
7003
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
6981
7004
  readonly indeterminate: import("@angular/core").InputSignal<boolean>;
6982
7005
  readonly checked: import("@angular/core").ModelSignal<boolean>;
6983
7006
  /**
@@ -8074,7 +8097,7 @@ export declare class ButtonComponent {
8074
8097
  * `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
8075
8098
  * background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
8076
8099
  */
8077
- readonly variant: import("@angular/core").InputSignal<"link" | "primary" | "secondary" | "danger" | "warning" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
8100
+ readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "danger" | "warning" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
8078
8101
  /** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
8079
8102
  readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
8080
8103
  /** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
@@ -9254,7 +9277,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
9254
9277
  readonly passwordRequirements: import("@angular/core").InputSignal<boolean>;
9255
9278
  /** Rules for `passwordRequirements`; default = the library's five rules (8+ characters, upper, lower, digit, special). */
9256
9279
  readonly passwordRules: import("@angular/core").InputSignal<readonly PasswordRule[] | undefined>;
9257
- readonly type: import("@angular/core").InputSignal<"number" | "email" | "text" | "tel" | "password" | "url">;
9280
+ readonly type: import("@angular/core").InputSignal<"number" | "email" | "text" | "password" | "tel" | "url">;
9258
9281
  readonly maxlength: import("@angular/core").InputSignal<number | undefined>;
9259
9282
  readonly required: import("@angular/core").InputSignal<boolean>;
9260
9283
  readonly autocomplete: import("@angular/core").InputSignal<string>;
@@ -9263,7 +9286,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
9263
9286
  * `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
9264
9287
  * It only picks the keyboard; it does not restrict what can be typed or pasted.
9265
9288
  */
9266
- readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "search" | "none" | "text" | "tel" | "numeric" | "decimal" | "url">;
9289
+ readonly inputmode: import("@angular/core").InputSignal<"" | "numeric" | "decimal" | "email" | "text" | "none" | "search" | "tel" | "url">;
9267
9290
  readonly readonly: import("@angular/core").InputSignal<boolean>;
9268
9291
  readonly hint: import("@angular/core").InputSignal<string>;
9269
9292
  /** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */
@@ -9335,7 +9358,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
9335
9358
  protected readonly _stepAttr: import("@angular/core").Signal<string | null>;
9336
9359
  protected readonly _revealable: import("@angular/core").Signal<boolean>;
9337
9360
  protected readonly _shown: import("@angular/core").WritableSignal<boolean>;
9338
- protected readonly _inputType: import("@angular/core").Signal<"number" | "email" | "text" | "tel" | "password" | "url">;
9361
+ protected readonly _inputType: import("@angular/core").Signal<"number" | "email" | "text" | "password" | "tel" | "url">;
9339
9362
  protected readonly _eyePath: string;
9340
9363
  protected readonly _eyeOffPath: string;
9341
9364
  protected readonly _showRequirements: import("@angular/core").Signal<boolean>;
@@ -9954,7 +9977,7 @@ export declare class CopyFieldComponent implements OnDestroy {
9954
9977
  /** Neither the Clipboard API nor the fallback could copy. */
9955
9978
  readonly copyFailed: import("@angular/core").OutputEmitterRef<void>;
9956
9979
  protected readonly _id: string;
9957
- protected readonly _state: import("@angular/core").WritableSignal<"failed" | "idle" | "copied">;
9980
+ protected readonly _state: import("@angular/core").WritableSignal<"idle" | "copied" | "failed">;
9958
9981
  protected readonly _announcement: import("@angular/core").Signal<string>;
9959
9982
  protected readonly _buttonName: import("@angular/core").Signal<string>;
9960
9983
  protected readonly _describedBy: import("@angular/core").Signal<string | null>;
@@ -10767,7 +10790,7 @@ export declare class DropdownComponent {
10767
10790
  readonly loader: import("@angular/core").InputSignal<(() => Promise<DropdownItem[]>) | null>;
10768
10791
  readonly active: import("@angular/core").InputSignal<boolean>;
10769
10792
  readonly activeValue: import("@angular/core").InputSignal<string>;
10770
- readonly variant: import("@angular/core").InputSignal<"button" | "badge">;
10793
+ readonly variant: import("@angular/core").InputSignal<"badge" | "button">;
10771
10794
  /** Trigger size for `variant="button"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */
10772
10795
  readonly size: import("@angular/core").InputSignal<"sm" | "md">;
10773
10796
  readonly menuWidth: import("@angular/core").InputSignal<string>;
@@ -11083,7 +11106,7 @@ export declare class FormSectionComponent {
11083
11106
  }, {}, never, ["*"], true, never>;
11084
11107
  }
11085
11108
  export declare class FormRowComponent {
11086
- readonly cols: import("@angular/core").InputSignal<1 | 4 | 2 | 3>;
11109
+ readonly cols: import("@angular/core").InputSignal<1 | 2 | 3 | 4>;
11087
11110
  static ɵfac: i0.ɵɵFactoryDeclaration<FormRowComponent, never>;
11088
11111
  static ɵcmp: i0.ɵɵComponentDeclaration<FormRowComponent, "ui-form-row", never, {
11089
11112
  "cols": {
@@ -12878,7 +12901,7 @@ export declare class IconComponent {
12878
12901
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
12879
12902
  /** Icon size in px. */
12880
12903
  readonly size: import("@angular/core").InputSignal<number>;
12881
- readonly variant: import("@angular/core").InputSignal<"danger" | "default">;
12904
+ readonly variant: import("@angular/core").InputSignal<"default" | "danger">;
12882
12905
  readonly disabled: import("@angular/core").InputSignal<boolean>;
12883
12906
  /** The host is running the request this icon started: a spinner replaces the picture and the button is disabled (no click) until it is false again. */
12884
12907
  readonly loading: import("@angular/core").InputSignal<boolean>;
@@ -15359,7 +15382,7 @@ export declare class DetailCardComponent {
15359
15382
  /** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */
15360
15383
  readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
15361
15384
  /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
15362
- readonly headingLevel: import("@angular/core").InputSignal<1 | 4 | 2 | 3 | 5 | 6 | null>;
15385
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
15363
15386
  /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
15364
15387
  readonly titleId: import("@angular/core").InputSignal<string>;
15365
15388
  /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */
@@ -15373,7 +15396,7 @@ export declare class DetailCardComponent {
15373
15396
  /** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */
15374
15397
  readonly footerBackground: import("@angular/core").InputSignal<string>;
15375
15398
  /** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */
15376
- readonly footerAlign: import("@angular/core").InputSignal<"end" | "start">;
15399
+ readonly footerAlign: import("@angular/core").InputSignal<"start" | "end">;
15377
15400
  /** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */
15378
15401
  readonly textColor: import("@angular/core").InputSignal<string>;
15379
15402
  /** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */
@@ -20456,7 +20479,7 @@ export declare class PaymentSidePanelComponent {
20456
20479
  private readonly terminalAvailable;
20457
20480
  /** value -> label of every live method the rendered plugins contribute (the first plugin wins a duplicate value). */
20458
20481
  private readonly liveMethods;
20459
- protected readonly kind: import("@angular/core").Signal<"none" | "manual" | "live" | "terminal">;
20482
+ protected readonly kind: import("@angular/core").Signal<"none" | "live" | "terminal" | "manual">;
20460
20483
  private kindOf;
20461
20484
  /** The method list as shown: record-only built-ins (a plugin takes over its own values), plugin extras, and only manual ones while a split is being built. */
20462
20485
  readonly methodList: import("@angular/core").Signal<PaymentMethodOption[]>;
@@ -20723,7 +20746,10 @@ export type PaymentAttemptRefusal = 'locked' | 'paid' | 'unknown' | 'offline';
20723
20746
  export type PaymentAttemptOutcomeKind = 'succeeded' | 'failed' | 'unknown' | 'refused' | 'pending';
20724
20747
  /**
20725
20748
  * The unified outcome event of a payment form: `reason` is `timeout`, `microdeposits` (a bank payment waits for the payer to verify micro-deposits: unknown-until-verified, never paid), `offline`, `host`, `host_error`, `host_silent`, `status_check`, `error`, `auth_abandoned`, `paid`, `reload`, `other_tab`, `token`,
20726
- * `duplicate_suspected` (an attempt that started after an older one turned out paid ALSO produced a payment: the host must resolve the duplicate), ...
20749
+ * `duplicate_suspected` (an attempt that started after an older one turned out paid ALSO produced a payment: the host must resolve the duplicate),
20750
+ * `setup_action` (a SetupIntent that still `requires_action` after `confirmSetup`: the status check decides), `unexpected_status` (an intent state that proves nothing: no intent, an unexpected status, a SetupIntent without a payment method id; the status check decides),
20751
+ * `setup_processing` (a protected SetupIntent that is `processing`, e.g. a bank debit: it can still fail, so it is unknown until the status check says it was saved), `return` (the intent a redirect brought back decided the attempt: `succeeded` /
20752
+ * `failed`), `return_action` (the redirect brought back an intent that proves nothing, e.g. an unknown status: unknown, the status check decides), `start_over` (the payer chose "Start over": a `failed` outcome with a new key), `no_result`, ...
20727
20753
  */
20728
20754
  export interface PaymentAttemptOutcome {
20729
20755
  kind: PaymentAttemptOutcomeKind;
@@ -20886,6 +20912,14 @@ export interface PaymentAttemptOptions {
20886
20912
  failGraceMs?: () => number;
20887
20913
  /** While the attempt's own request is unsettled a `failed` / `not_found` is ignored for this long after the attempt became unknown (default 180 s). */
20888
20914
  statusHardMaxMs?: () => number;
20915
+ /**
20916
+ * Default true. False (a setup form that saves a payment method and may be used again later): a success does NOT lock the payable for 24 hours. It writes no `#paid` record, does not set `succeeded` / `paidLocked`,
20917
+ * ignores the succeeded tombstone and paid record when a new attempt starts or a form mounts, and moves the epoch (the next attempt has a NEW derived key). The `succeeded` outcome is still emitted and an attempt
20918
+ * is still never started while another is in flight or unknown. A success that arrives after the form was destroyed or the payable changed also moves the epoch (no tombstone is written). A second `succeed()` with no attempt started in between
20919
+ * (a host `markSucceeded()` after `(confirmed)`, a repeated `handleReturn()`) settles nothing again; a late success of a key already reported is silent, and one of ANOTHER key (e.g. an older epoch that answers after a start over and a newer save)
20920
+ * is reported once as `unknown` / `duplicate_suspected` for the host to resolve.
20921
+ */
20922
+ lockAfterSuccess?: () => boolean;
20889
20923
  /** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (default 300 s). */
20890
20924
  authTimeoutMs?: () => number;
20891
20925
  /** A token-only form whose host never reports becomes unknown after this long (default 120 s). */
@@ -20953,6 +20987,10 @@ export declare class PaymentAttempt {
20953
20987
  private paidKey;
20954
20988
  /** Keys already reported as `duplicate_suspected` (reported once each). */
20955
20989
  private readonly duplicates;
20990
+ /** Only with `lockAfterSuccess` false: a success was already settled and no new attempt began since, so a second `succeed()` (a host `markSucceeded()` after `(confirmed)`, a repeated `handleReturn()`) settles nothing again. Cleared by `begin()`, `resetPaid()` and a payable change. */
20991
+ private lastSuccessIdle;
20992
+ /** Only with `lockAfterSuccess` false: keys whose success was already reported, so a late answer for the same key is silent and a distinct key is reported as `duplicate_suspected`. */
20993
+ private readonly reportedKeys;
20956
20994
  /** The request timeout of the newest `run()` (the status grace is measured against it, not against the default). */
20957
20995
  private requestMs;
20958
20996
  private pollTimer;
@@ -21030,6 +21068,8 @@ export declare class PaymentAttempt {
21030
21068
  /** Applies the result of a step to THIS attempt (see {@link PaymentAttemptKind}). */
21031
21069
  apply<T>(result: PaymentAttemptResult<T>): void;
21032
21070
  private now;
21071
+ /** A success locks the payable as paid (default); `false` only for a form that opted out with `lockAfterSuccess`. */
21072
+ private keepsLock;
21033
21073
  /** Newest run that is still THE attempt in progress (same pinned key, not replaced by a newer run). */
21034
21074
  private isCurrent;
21035
21075
  private applyRun;
@@ -21221,6 +21261,8 @@ export interface PaymentProtectionInputs {
21221
21261
  statusCheckTimeoutMs: Signal<number>;
21222
21262
  /** A status answer `failed` is ignored this long while the attempt's own request is unsettled. */
21223
21263
  statusFailGraceMs: Signal<number>;
21264
+ /** While the attempt's own request is unsettled a status answer `failed` / `not_found` is ignored this long after it became unknown (optional: default 180 s). */
21265
+ statusHardMaxMs?: Signal<number>;
21224
21266
  /** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (optional: default 300 s). */
21225
21267
  authTimeoutMs?: Signal<number>;
21226
21268
  /** A token-only form whose host never reports becomes unknown after this long (optional: default 120 s). */
@@ -21238,6 +21280,8 @@ export interface PaymentProtectionOptions {
21238
21280
  sdk?: () => PaymentSdkState;
21239
21281
  /** The Stripe form turns everything off unless its duplicate-protection flag is on (existing behaviour stays exactly as it was). */
21240
21282
  enabled?: () => boolean;
21283
+ /** `false` = a success does not lock the payable for 24 hours (a setup form that opted out with `lockAfterSuccess`); default true. */
21284
+ lockAfterSuccess?: () => boolean;
21241
21285
  /** A form that only TOKENIZES keeps its lock to the token call: going offline then does not make the outcome unknown. */
21242
21286
  offlineMidFlight?: boolean;
21243
21287
  onOutcome?: (outcome: PaymentAttemptOutcome) => void;
@@ -21253,6 +21297,10 @@ export declare function createPaymentProtection(inputs: PaymentProtectionInputs,
21253
21297
  attempt: PaymentAttempt;
21254
21298
  readiness: PaymentReadiness;
21255
21299
  };
21300
+ /** What a protected attempt is for: a payment (default) or saving a payment method (a SetupIntent: nothing is charged). */
21301
+ export type PaymentAttemptPurpose = 'payment' | 'setup';
21302
+ /** The label key to show for `key` in an attempt of `kind` (the same key for a payment). */
21303
+ export declare function attemptLabelKey(key: UiLabelKey, kind: PaymentAttemptPurpose): UiLabelKey;
21256
21304
  /**
21257
21305
  * What the payer reads while a payment attempt is not a plain "form" any more: "Checking your payment..." (the outcome is unknown: Pay stays locked, never "failed, try again"), the
21258
21306
  * offline notice, and the paid state. A polite live region announces each state. Used by every payment form of the library; hosts normally never place it themselves.
@@ -21269,6 +21317,10 @@ export declare class PaymentAttemptStatusComponent {
21269
21317
  readonly readiness: import("@angular/core").InputSignal<PaymentReadiness | null>;
21270
21318
  /** "Retry loading the payment form" was pressed (shown for `sdk_blocked`). */
21271
21319
  readonly retryLoad: import("@angular/core").OutputEmitterRef<void>;
21320
+ /** What the attempt is for: `'setup'` (saving a payment method) shows the setup wording instead of the payment wording. */
21321
+ readonly kind: import("@angular/core").InputSignal<PaymentAttemptPurpose>;
21322
+ /** The text of `key` for this attempt's kind. */
21323
+ protected text(key: UiLabelKey): string;
21272
21324
  protected readonly firstReason: import("@angular/core").Signal<string>;
21273
21325
  /** The translated text of the first blocking reason; a reason the library does not know blocks with the generic text. */
21274
21326
  protected readonly readinessText: import("@angular/core").Signal<string>;
@@ -21296,6 +21348,11 @@ export declare class PaymentAttemptStatusComponent {
21296
21348
  "required": false;
21297
21349
  "isSignal": true;
21298
21350
  };
21351
+ "kind": {
21352
+ "alias": "kind";
21353
+ "required": false;
21354
+ "isSignal": true;
21355
+ };
21299
21356
  }, {
21300
21357
  "retryLoad": "retryLoad";
21301
21358
  }, never, never, true, never>;