@forgeroute/ui 0.4.39 → 0.4.41
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/fesm2022/forgeroute-ui-messaging.mjs +4 -2
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +743 -5
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui.mjs +505 -65
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-messaging.d.ts +4 -4
- package/types/forgeroute-ui-stripe.d.ts +246 -2
- package/types/forgeroute-ui.d.ts +192 -25
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injectable, InjectionToken, PLATFORM_ID, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injectable, InjectionToken, PLATFORM_ID, ViewEncapsulation, computed, effect, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { DOCUMENT, isPlatformBrowser } from "@angular/common";
|
|
4
|
-
import { AlertComponent, BadgeComponent, ButtonComponent, FormRowComponent, FormSectionComponent, ModalComponent, SkeletonComponent, TextComponent, TextInputComponent } from "@forgeroute/ui";
|
|
4
|
+
import { AlertComponent, BadgeComponent, ButtonComponent, DetailCardComponent, FormRowComponent, FormSectionComponent, ModalComponent, SkeletonComponent, StackComponent, TextComponent, TextInputComponent } from "@forgeroute/ui";
|
|
5
5
|
import * as i1 from "@angular/forms";
|
|
6
6
|
import { FormsModule } from "@angular/forms";
|
|
7
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
7
8
|
const sdkImporter = { load: () => import("@stripe/stripe-js") };
|
|
8
9
|
const defaultStripeLoader = async (publishableKey, options) => {
|
|
9
10
|
const sdk = await sdkImporter.load();
|
|
@@ -1405,7 +1406,8 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1405
1406
|
"dismissAriaLabel",
|
|
1406
1407
|
"quiet",
|
|
1407
1408
|
"compact",
|
|
1408
|
-
"inline"
|
|
1409
|
+
"inline",
|
|
1410
|
+
"fill"
|
|
1409
1411
|
],
|
|
1410
1412
|
outputs: ["dismissed"]
|
|
1411
1413
|
},
|
|
@@ -2391,7 +2393,8 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2391
2393
|
"dismissAriaLabel",
|
|
2392
2394
|
"quiet",
|
|
2393
2395
|
"compact",
|
|
2394
|
-
"inline"
|
|
2396
|
+
"inline",
|
|
2397
|
+
"fill"
|
|
2395
2398
|
],
|
|
2396
2399
|
outputs: ["dismissed"]
|
|
2397
2400
|
},
|
|
@@ -2822,6 +2825,741 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2822
2825
|
}]
|
|
2823
2826
|
}
|
|
2824
2827
|
});
|
|
2825
|
-
|
|
2828
|
+
function isStripeUrl(url) {
|
|
2829
|
+
if (!url) return false;
|
|
2830
|
+
try {
|
|
2831
|
+
const u = new URL(url);
|
|
2832
|
+
return u.protocol === "https:" && (u.hostname === "stripe.com" || u.hostname.endsWith(".stripe.com"));
|
|
2833
|
+
} catch {
|
|
2834
|
+
return false;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
var StripeConnectFlow = class {
|
|
2838
|
+
constructor(o) {
|
|
2839
|
+
this.o = o;
|
|
2840
|
+
this.tabOpened = false;
|
|
2841
|
+
}
|
|
2842
|
+
get blocked() {
|
|
2843
|
+
return this.o.state.loading() || !!this.o.disabled?.();
|
|
2844
|
+
}
|
|
2845
|
+
start() {
|
|
2846
|
+
const create = this.o.createAccount();
|
|
2847
|
+
if (!create || this.blocked) return;
|
|
2848
|
+
this.o.state.loading.set(true);
|
|
2849
|
+
const tab = this.openBlankTab();
|
|
2850
|
+
create().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({
|
|
2851
|
+
next: (result) => {
|
|
2852
|
+
this.o.state.accountId.set(result.accountId);
|
|
2853
|
+
this.o.state.loading.set(false);
|
|
2854
|
+
this.openStripe(tab, result.onboardingUrl);
|
|
2855
|
+
},
|
|
2856
|
+
error: (error) => {
|
|
2857
|
+
this.closeTab(tab);
|
|
2858
|
+
this.o.state.loading.set(false);
|
|
2859
|
+
this.o.emit({
|
|
2860
|
+
kind: "failed",
|
|
2861
|
+
action: "start",
|
|
2862
|
+
error
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
check() {
|
|
2868
|
+
const status = this.o.getStatus();
|
|
2869
|
+
if (!status || this.blocked) return;
|
|
2870
|
+
this.o.state.loading.set(true);
|
|
2871
|
+
status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({
|
|
2872
|
+
next: (s) => {
|
|
2873
|
+
this.o.state.complete.set(s.isComplete);
|
|
2874
|
+
this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);
|
|
2875
|
+
this.o.state.loading.set(false);
|
|
2876
|
+
if (s.isComplete) this.o.emit({
|
|
2877
|
+
kind: "complete",
|
|
2878
|
+
source: "check"
|
|
2879
|
+
});
|
|
2880
|
+
else if (s.detailsSubmitted) this.o.emit({
|
|
2881
|
+
kind: "verifying",
|
|
2882
|
+
source: "check"
|
|
2883
|
+
});
|
|
2884
|
+
else if (s.onboardingUrl) this.o.emit({ kind: "incomplete" });
|
|
2885
|
+
},
|
|
2886
|
+
error: (error) => {
|
|
2887
|
+
this.o.state.loading.set(false);
|
|
2888
|
+
this.o.emit({
|
|
2889
|
+
kind: "failed",
|
|
2890
|
+
action: "check",
|
|
2891
|
+
error
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2894
|
+
});
|
|
2895
|
+
}
|
|
2896
|
+
resume() {
|
|
2897
|
+
const status = this.o.getStatus();
|
|
2898
|
+
if (!status || this.blocked) return;
|
|
2899
|
+
this.o.state.loading.set(true);
|
|
2900
|
+
const tab = this.openBlankTab();
|
|
2901
|
+
status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({
|
|
2902
|
+
next: (s) => {
|
|
2903
|
+
this.o.state.loading.set(false);
|
|
2904
|
+
if (s.isComplete) {
|
|
2905
|
+
this.closeTab(tab);
|
|
2906
|
+
this.o.state.complete.set(true);
|
|
2907
|
+
this.o.emit({
|
|
2908
|
+
kind: "complete",
|
|
2909
|
+
source: "resume"
|
|
2910
|
+
});
|
|
2911
|
+
} else if (s.detailsSubmitted) {
|
|
2912
|
+
this.closeTab(tab);
|
|
2913
|
+
this.o.state.detailsSubmitted.set(true);
|
|
2914
|
+
this.o.emit({
|
|
2915
|
+
kind: "verifying",
|
|
2916
|
+
source: "resume"
|
|
2917
|
+
});
|
|
2918
|
+
} else this.openStripe(tab, s.onboardingUrl);
|
|
2919
|
+
},
|
|
2920
|
+
error: (error) => {
|
|
2921
|
+
this.closeTab(tab);
|
|
2922
|
+
this.o.state.loading.set(false);
|
|
2923
|
+
this.o.emit({
|
|
2924
|
+
kind: "failed",
|
|
2925
|
+
action: "resume",
|
|
2926
|
+
error
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
});
|
|
2930
|
+
}
|
|
2931
|
+
readStatusOnReturn() {
|
|
2932
|
+
const status = this.o.getStatus();
|
|
2933
|
+
if (!status) return;
|
|
2934
|
+
status().pipe(takeUntilDestroyed(this.o.destroyRef)).subscribe({
|
|
2935
|
+
next: (s) => {
|
|
2936
|
+
this.o.state.complete.set(s.isComplete);
|
|
2937
|
+
this.o.state.detailsSubmitted.set(s.detailsSubmitted ?? false);
|
|
2938
|
+
if (s.isComplete) this.o.emit({
|
|
2939
|
+
kind: "complete",
|
|
2940
|
+
source: "return"
|
|
2941
|
+
});
|
|
2942
|
+
else if (s.detailsSubmitted) this.o.emit({
|
|
2943
|
+
kind: "verifying",
|
|
2944
|
+
source: "return"
|
|
2945
|
+
});
|
|
2946
|
+
},
|
|
2947
|
+
error: () => {}
|
|
2948
|
+
});
|
|
2949
|
+
}
|
|
2950
|
+
openStripe(tab, url) {
|
|
2951
|
+
if (isStripeUrl(url) && tab) {
|
|
2952
|
+
tab.location.href = url;
|
|
2953
|
+
this.tabOpened = true;
|
|
2954
|
+
} else if (isStripeUrl(url)) this.navigateCurrentTab(url);
|
|
2955
|
+
else {
|
|
2956
|
+
this.closeTab(tab);
|
|
2957
|
+
this.o.emit({ kind: "link-unavailable" });
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
openBlankTab() {
|
|
2961
|
+
const tab = window.open("about:blank", "_blank");
|
|
2962
|
+
if (tab) try {
|
|
2963
|
+
tab.opener = null;
|
|
2964
|
+
} catch {}
|
|
2965
|
+
return tab;
|
|
2966
|
+
}
|
|
2967
|
+
navigateCurrentTab(url) {
|
|
2968
|
+
if (this.o.navigate) this.o.navigate(url);
|
|
2969
|
+
else window.location.href = url;
|
|
2970
|
+
}
|
|
2971
|
+
closeTab(tab) {
|
|
2972
|
+
try {
|
|
2973
|
+
tab?.close();
|
|
2974
|
+
} catch {}
|
|
2975
|
+
}
|
|
2976
|
+
};
|
|
2977
|
+
function stripeConnectNotice(outcome) {
|
|
2978
|
+
switch (outcome.kind) {
|
|
2979
|
+
case "complete": return {
|
|
2980
|
+
variant: "success",
|
|
2981
|
+
message: outcome.source === "resume" ? "Payment account setup is already complete!" : "Payment account setup complete!"
|
|
2982
|
+
};
|
|
2983
|
+
case "verifying": return {
|
|
2984
|
+
variant: "success",
|
|
2985
|
+
message: "Setup submitted! Stripe is verifying your account. This usually takes a few minutes. Click \"Check Status\" to refresh."
|
|
2986
|
+
};
|
|
2987
|
+
case "incomplete": return {
|
|
2988
|
+
variant: "error",
|
|
2989
|
+
message: "Payment account setup is not yet complete. Please continue setup."
|
|
2990
|
+
};
|
|
2991
|
+
case "link-unavailable": return {
|
|
2992
|
+
variant: "error",
|
|
2993
|
+
message: "Unable to retrieve onboarding link. Please try again."
|
|
2994
|
+
};
|
|
2995
|
+
case "failed": return {
|
|
2996
|
+
variant: "error",
|
|
2997
|
+
message: outcome.action === "start" ? "Failed to start payment account setup" : outcome.action === "check" ? "Failed to check payment account status" : "Failed to retrieve onboarding link"
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
var StripeConnectComponent = class StripeConnectComponent {
|
|
3002
|
+
constructor() {
|
|
3003
|
+
this.destroyRef = inject(DestroyRef);
|
|
3004
|
+
this.createAccount = input(null, ...ngDevMode ? [{ debugName: "createAccount" }] : /* istanbul ignore next */ []);
|
|
3005
|
+
this.getStatus = input(null, ...ngDevMode ? [{ debugName: "getStatus" }] : /* istanbul ignore next */ []);
|
|
3006
|
+
this.accountId = model(null, ...ngDevMode ? [{ debugName: "accountId" }] : /* istanbul ignore next */ []);
|
|
3007
|
+
this.complete = model(false, ...ngDevMode ? [{ debugName: "complete" }] : /* istanbul ignore next */ []);
|
|
3008
|
+
this.detailsSubmitted = model(false, ...ngDevMode ? [{ debugName: "detailsSubmitted" }] : /* istanbul ignore next */ []);
|
|
3009
|
+
this.title = input("Stripe Connect Account", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
3010
|
+
this.showWhenNoAccount = input(false, ...ngDevMode ? [{ debugName: "showWhenNoAccount" }] : /* istanbul ignore next */ []);
|
|
3011
|
+
this.startTitle = input("Connect your Stripe account", ...ngDevMode ? [{ debugName: "startTitle" }] : /* istanbul ignore next */ []);
|
|
3012
|
+
this.startText = input("Collect your customers' payments online. You finish setting up your account on Stripe, then come back here.", ...ngDevMode ? [{ debugName: "startText" }] : /* istanbul ignore next */ []);
|
|
3013
|
+
this.startLabel = input("Set Up Payment Account", ...ngDevMode ? [{ debugName: "startLabel" }] : /* istanbul ignore next */ []);
|
|
3014
|
+
this.disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
3015
|
+
this.refreshOnReturn = input(false, ...ngDevMode ? [{ debugName: "refreshOnReturn" }] : /* istanbul ignore next */ []);
|
|
3016
|
+
this.dashboardUrl = input("https://dashboard.stripe.com", ...ngDevMode ? [{ debugName: "dashboardUrl" }] : /* istanbul ignore next */ []);
|
|
3017
|
+
this.outcome = output();
|
|
3018
|
+
this.loading = model(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
3019
|
+
this.navigateTab = input(null, ...ngDevMode ? [{ debugName: "navigateTab" }] : /* istanbul ignore next */ []);
|
|
3020
|
+
this.visible = computed(() => !!this.accountId() || this.showWhenNoAccount(), ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
3021
|
+
this.flow = new StripeConnectFlow({
|
|
3022
|
+
createAccount: () => this.createAccount(),
|
|
3023
|
+
getStatus: () => this.getStatus(),
|
|
3024
|
+
state: {
|
|
3025
|
+
accountId: this.accountId,
|
|
3026
|
+
complete: this.complete,
|
|
3027
|
+
detailsSubmitted: this.detailsSubmitted,
|
|
3028
|
+
loading: this.loading
|
|
3029
|
+
},
|
|
3030
|
+
emit: (outcome) => this.outcome.emit(outcome),
|
|
3031
|
+
disabled: () => this.disabled(),
|
|
3032
|
+
navigate: (url) => this.navigateCurrentTab(url),
|
|
3033
|
+
destroyRef: this.destroyRef
|
|
3034
|
+
});
|
|
3035
|
+
if (typeof document !== "undefined") {
|
|
3036
|
+
const onVisible = () => {
|
|
3037
|
+
if (document.visibilityState !== "visible" || !this.flow.tabOpened || !this.refreshOnReturn() || this.loading()) return;
|
|
3038
|
+
this.flow.tabOpened = false;
|
|
3039
|
+
this.flow.readStatusOnReturn();
|
|
3040
|
+
};
|
|
3041
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
3042
|
+
this.destroyRef.onDestroy(() => document.removeEventListener("visibilitychange", onVisible));
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
start() {
|
|
3046
|
+
this.flow.start();
|
|
3047
|
+
}
|
|
3048
|
+
check() {
|
|
3049
|
+
this.flow.check();
|
|
3050
|
+
}
|
|
3051
|
+
resume() {
|
|
3052
|
+
this.flow.resume();
|
|
3053
|
+
}
|
|
3054
|
+
openDashboard() {
|
|
3055
|
+
window.open(this.dashboardUrl(), "_blank", "noopener,noreferrer");
|
|
3056
|
+
}
|
|
3057
|
+
navigateCurrentTab(url) {
|
|
3058
|
+
const navigate = this.navigateTab();
|
|
3059
|
+
if (navigate) navigate(url);
|
|
3060
|
+
else window.location.href = url;
|
|
3061
|
+
}
|
|
3062
|
+
static {
|
|
3063
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3064
|
+
minVersion: "12.0.0",
|
|
3065
|
+
version: "22.2.2",
|
|
3066
|
+
ngImport: i0,
|
|
3067
|
+
type: StripeConnectComponent,
|
|
3068
|
+
deps: [],
|
|
3069
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3070
|
+
});
|
|
3071
|
+
}
|
|
3072
|
+
static {
|
|
3073
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3074
|
+
minVersion: "17.0.0",
|
|
3075
|
+
version: "22.2.2",
|
|
3076
|
+
type: StripeConnectComponent,
|
|
3077
|
+
isStandalone: true,
|
|
3078
|
+
selector: "ui-stripe-connect",
|
|
3079
|
+
inputs: {
|
|
3080
|
+
createAccount: {
|
|
3081
|
+
classPropertyName: "createAccount",
|
|
3082
|
+
publicName: "createAccount",
|
|
3083
|
+
isSignal: true,
|
|
3084
|
+
isRequired: false,
|
|
3085
|
+
transformFunction: null
|
|
3086
|
+
},
|
|
3087
|
+
getStatus: {
|
|
3088
|
+
classPropertyName: "getStatus",
|
|
3089
|
+
publicName: "getStatus",
|
|
3090
|
+
isSignal: true,
|
|
3091
|
+
isRequired: false,
|
|
3092
|
+
transformFunction: null
|
|
3093
|
+
},
|
|
3094
|
+
accountId: {
|
|
3095
|
+
classPropertyName: "accountId",
|
|
3096
|
+
publicName: "accountId",
|
|
3097
|
+
isSignal: true,
|
|
3098
|
+
isRequired: false,
|
|
3099
|
+
transformFunction: null
|
|
3100
|
+
},
|
|
3101
|
+
complete: {
|
|
3102
|
+
classPropertyName: "complete",
|
|
3103
|
+
publicName: "complete",
|
|
3104
|
+
isSignal: true,
|
|
3105
|
+
isRequired: false,
|
|
3106
|
+
transformFunction: null
|
|
3107
|
+
},
|
|
3108
|
+
detailsSubmitted: {
|
|
3109
|
+
classPropertyName: "detailsSubmitted",
|
|
3110
|
+
publicName: "detailsSubmitted",
|
|
3111
|
+
isSignal: true,
|
|
3112
|
+
isRequired: false,
|
|
3113
|
+
transformFunction: null
|
|
3114
|
+
},
|
|
3115
|
+
title: {
|
|
3116
|
+
classPropertyName: "title",
|
|
3117
|
+
publicName: "title",
|
|
3118
|
+
isSignal: true,
|
|
3119
|
+
isRequired: false,
|
|
3120
|
+
transformFunction: null
|
|
3121
|
+
},
|
|
3122
|
+
showWhenNoAccount: {
|
|
3123
|
+
classPropertyName: "showWhenNoAccount",
|
|
3124
|
+
publicName: "showWhenNoAccount",
|
|
3125
|
+
isSignal: true,
|
|
3126
|
+
isRequired: false,
|
|
3127
|
+
transformFunction: null
|
|
3128
|
+
},
|
|
3129
|
+
startTitle: {
|
|
3130
|
+
classPropertyName: "startTitle",
|
|
3131
|
+
publicName: "startTitle",
|
|
3132
|
+
isSignal: true,
|
|
3133
|
+
isRequired: false,
|
|
3134
|
+
transformFunction: null
|
|
3135
|
+
},
|
|
3136
|
+
startText: {
|
|
3137
|
+
classPropertyName: "startText",
|
|
3138
|
+
publicName: "startText",
|
|
3139
|
+
isSignal: true,
|
|
3140
|
+
isRequired: false,
|
|
3141
|
+
transformFunction: null
|
|
3142
|
+
},
|
|
3143
|
+
startLabel: {
|
|
3144
|
+
classPropertyName: "startLabel",
|
|
3145
|
+
publicName: "startLabel",
|
|
3146
|
+
isSignal: true,
|
|
3147
|
+
isRequired: false,
|
|
3148
|
+
transformFunction: null
|
|
3149
|
+
},
|
|
3150
|
+
disabled: {
|
|
3151
|
+
classPropertyName: "disabled",
|
|
3152
|
+
publicName: "disabled",
|
|
3153
|
+
isSignal: true,
|
|
3154
|
+
isRequired: false,
|
|
3155
|
+
transformFunction: null
|
|
3156
|
+
},
|
|
3157
|
+
refreshOnReturn: {
|
|
3158
|
+
classPropertyName: "refreshOnReturn",
|
|
3159
|
+
publicName: "refreshOnReturn",
|
|
3160
|
+
isSignal: true,
|
|
3161
|
+
isRequired: false,
|
|
3162
|
+
transformFunction: null
|
|
3163
|
+
},
|
|
3164
|
+
dashboardUrl: {
|
|
3165
|
+
classPropertyName: "dashboardUrl",
|
|
3166
|
+
publicName: "dashboardUrl",
|
|
3167
|
+
isSignal: true,
|
|
3168
|
+
isRequired: false,
|
|
3169
|
+
transformFunction: null
|
|
3170
|
+
},
|
|
3171
|
+
loading: {
|
|
3172
|
+
classPropertyName: "loading",
|
|
3173
|
+
publicName: "loading",
|
|
3174
|
+
isSignal: true,
|
|
3175
|
+
isRequired: false,
|
|
3176
|
+
transformFunction: null
|
|
3177
|
+
},
|
|
3178
|
+
navigateTab: {
|
|
3179
|
+
classPropertyName: "navigateTab",
|
|
3180
|
+
publicName: "navigateTab",
|
|
3181
|
+
isSignal: true,
|
|
3182
|
+
isRequired: false,
|
|
3183
|
+
transformFunction: null
|
|
3184
|
+
}
|
|
3185
|
+
},
|
|
3186
|
+
outputs: {
|
|
3187
|
+
accountId: "accountIdChange",
|
|
3188
|
+
complete: "completeChange",
|
|
3189
|
+
detailsSubmitted: "detailsSubmittedChange",
|
|
3190
|
+
outcome: "outcome",
|
|
3191
|
+
loading: "loadingChange"
|
|
3192
|
+
},
|
|
3193
|
+
ngImport: i0,
|
|
3194
|
+
template: `
|
|
3195
|
+
@if (visible()) {
|
|
3196
|
+
<ui-detail-card [collapsible]="false" [title]="title()" [headingLevel]="3" data-testid="connect-account-card">
|
|
3197
|
+
@if (!accountId()) {
|
|
3198
|
+
<ui-alert variant="info" [quiet]="true" [title]="startTitle()" data-testid="connect-status-none">
|
|
3199
|
+
<ui-stack gap="sm">
|
|
3200
|
+
<ui-text size="sm" [text]="startText()" />
|
|
3201
|
+
<ui-stack direction="horizontal">
|
|
3202
|
+
<ui-button variant="primary" size="sm" data-testid="connect-start-button" [disabled]="loading() || disabled()" (click)="start()">{{ loading() ? 'Loading...' : startLabel() }}</ui-button>
|
|
3203
|
+
</ui-stack>
|
|
3204
|
+
</ui-stack>
|
|
3205
|
+
</ui-alert>
|
|
3206
|
+
} @else if (complete()) {
|
|
3207
|
+
<ui-alert variant="success" [quiet]="true" title="Account setup complete" data-testid="connect-status-complete">
|
|
3208
|
+
<ui-stack gap="sm">
|
|
3209
|
+
<ui-text size="sm" tone="muted" [text]="'Account ID: ' + accountId()" />
|
|
3210
|
+
<ui-stack direction="horizontal">
|
|
3211
|
+
<ui-button variant="secondary" size="sm" data-testid="connect-dashboard-button" (click)="openDashboard()">View Stripe Dashboard</ui-button>
|
|
3212
|
+
</ui-stack>
|
|
3213
|
+
</ui-stack>
|
|
3214
|
+
</ui-alert>
|
|
3215
|
+
} @else if (detailsSubmitted()) {
|
|
3216
|
+
<ui-alert variant="info" [quiet]="true" title="Stripe is verifying your account" data-testid="connect-status-verifying">
|
|
3217
|
+
<ui-stack gap="sm">
|
|
3218
|
+
<ui-text size="sm" text="Your setup has been submitted. Stripe is reviewing your information — this usually takes a few minutes. Payment collection will be enabled automatically once approved." />
|
|
3219
|
+
<ui-stack direction="horizontal">
|
|
3220
|
+
<ui-button variant="primary" size="sm" data-testid="connect-check-status-button" [disabled]="loading() || disabled()" (click)="check()">{{ loading() ? 'Checking...' : 'Check Status' }}</ui-button>
|
|
3221
|
+
</ui-stack>
|
|
3222
|
+
</ui-stack>
|
|
3223
|
+
</ui-alert>
|
|
3224
|
+
} @else {
|
|
3225
|
+
<ui-alert variant="warning" [quiet]="true" title="Account setup incomplete" data-testid="connect-status-incomplete">
|
|
3226
|
+
<ui-stack gap="sm">
|
|
3227
|
+
<ui-text size="sm" text="Complete your Stripe account setup to start collecting payments from customers." />
|
|
3228
|
+
<ui-stack direction="horizontal">
|
|
3229
|
+
<ui-button variant="primary" size="sm" data-testid="connect-complete-setup-button" [disabled]="loading() || disabled()" (click)="resume()">{{ loading() ? 'Loading...' : 'Complete Setup' }}</ui-button>
|
|
3230
|
+
</ui-stack>
|
|
3231
|
+
</ui-stack>
|
|
3232
|
+
</ui-alert>
|
|
3233
|
+
}
|
|
3234
|
+
</ui-detail-card>
|
|
3235
|
+
}
|
|
3236
|
+
`,
|
|
3237
|
+
isInline: true,
|
|
3238
|
+
styles: ["ui-stripe-connect{display:block;min-width:0}\n"],
|
|
3239
|
+
dependencies: [
|
|
3240
|
+
{
|
|
3241
|
+
kind: "component",
|
|
3242
|
+
type: AlertComponent,
|
|
3243
|
+
selector: "ui-alert",
|
|
3244
|
+
inputs: [
|
|
3245
|
+
"variant",
|
|
3246
|
+
"title",
|
|
3247
|
+
"dismissible",
|
|
3248
|
+
"dismissAriaLabel",
|
|
3249
|
+
"quiet",
|
|
3250
|
+
"compact",
|
|
3251
|
+
"inline",
|
|
3252
|
+
"fill"
|
|
3253
|
+
],
|
|
3254
|
+
outputs: ["dismissed"]
|
|
3255
|
+
},
|
|
3256
|
+
{
|
|
3257
|
+
kind: "component",
|
|
3258
|
+
type: ButtonComponent,
|
|
3259
|
+
selector: "ui-button",
|
|
3260
|
+
inputs: [
|
|
3261
|
+
"variant",
|
|
3262
|
+
"routerLink",
|
|
3263
|
+
"queryParams",
|
|
3264
|
+
"fragment",
|
|
3265
|
+
"state",
|
|
3266
|
+
"href",
|
|
3267
|
+
"target",
|
|
3268
|
+
"rel",
|
|
3269
|
+
"shortLabel",
|
|
3270
|
+
"shortBelow",
|
|
3271
|
+
"color",
|
|
3272
|
+
"active",
|
|
3273
|
+
"size",
|
|
3274
|
+
"type",
|
|
3275
|
+
"disabled",
|
|
3276
|
+
"loading",
|
|
3277
|
+
"fullWidth",
|
|
3278
|
+
"ariaLabel",
|
|
3279
|
+
"ariaExpanded",
|
|
3280
|
+
"ariaPressed",
|
|
3281
|
+
"ariaDescribedBy",
|
|
3282
|
+
"modal-footer-left",
|
|
3283
|
+
"modal-footer-right"
|
|
3284
|
+
]
|
|
3285
|
+
},
|
|
3286
|
+
{
|
|
3287
|
+
kind: "component",
|
|
3288
|
+
type: DetailCardComponent,
|
|
3289
|
+
selector: "ui-detail-card",
|
|
3290
|
+
inputs: [
|
|
3291
|
+
"title",
|
|
3292
|
+
"uppercaseTitle",
|
|
3293
|
+
"headingLevel",
|
|
3294
|
+
"titleId",
|
|
3295
|
+
"ariaLabel",
|
|
3296
|
+
"subtitle",
|
|
3297
|
+
"background",
|
|
3298
|
+
"headerBackground",
|
|
3299
|
+
"footerBackground",
|
|
3300
|
+
"textColor",
|
|
3301
|
+
"showHeader",
|
|
3302
|
+
"collapsible",
|
|
3303
|
+
"expanded",
|
|
3304
|
+
"showEdit",
|
|
3305
|
+
"editLabel",
|
|
3306
|
+
"editTestId",
|
|
3307
|
+
"editIcon",
|
|
3308
|
+
"editAriaLabel",
|
|
3309
|
+
"fill",
|
|
3310
|
+
"maxBodyHeight",
|
|
3311
|
+
"selectable",
|
|
3312
|
+
"selected",
|
|
3313
|
+
"selectedColor",
|
|
3314
|
+
"selectedBackground"
|
|
3315
|
+
],
|
|
3316
|
+
outputs: [
|
|
3317
|
+
"expandedChange",
|
|
3318
|
+
"editClick",
|
|
3319
|
+
"selectedChange"
|
|
3320
|
+
]
|
|
3321
|
+
},
|
|
3322
|
+
{
|
|
3323
|
+
kind: "component",
|
|
3324
|
+
type: StackComponent,
|
|
3325
|
+
selector: "ui-stack",
|
|
3326
|
+
inputs: [
|
|
3327
|
+
"gap",
|
|
3328
|
+
"direction",
|
|
3329
|
+
"align",
|
|
3330
|
+
"justify",
|
|
3331
|
+
"wrap",
|
|
3332
|
+
"minHeight",
|
|
3333
|
+
"width",
|
|
3334
|
+
"maxWidth",
|
|
3335
|
+
"padding",
|
|
3336
|
+
"centered"
|
|
3337
|
+
]
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
kind: "component",
|
|
3341
|
+
type: TextComponent,
|
|
3342
|
+
selector: "ui-text",
|
|
3343
|
+
inputs: [
|
|
3344
|
+
"text",
|
|
3345
|
+
"size",
|
|
3346
|
+
"tone",
|
|
3347
|
+
"color",
|
|
3348
|
+
"strong",
|
|
3349
|
+
"weight"
|
|
3350
|
+
]
|
|
3351
|
+
}
|
|
3352
|
+
],
|
|
3353
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3354
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
3355
|
+
});
|
|
3356
|
+
}
|
|
3357
|
+
};
|
|
3358
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3359
|
+
minVersion: "12.0.0",
|
|
3360
|
+
version: "22.2.2",
|
|
3361
|
+
ngImport: i0,
|
|
3362
|
+
type: StripeConnectComponent,
|
|
3363
|
+
decorators: [{
|
|
3364
|
+
type: Component,
|
|
3365
|
+
args: [{
|
|
3366
|
+
selector: "ui-stripe-connect",
|
|
3367
|
+
standalone: true,
|
|
3368
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3369
|
+
imports: [
|
|
3370
|
+
AlertComponent,
|
|
3371
|
+
ButtonComponent,
|
|
3372
|
+
DetailCardComponent,
|
|
3373
|
+
StackComponent,
|
|
3374
|
+
TextComponent
|
|
3375
|
+
],
|
|
3376
|
+
template: `
|
|
3377
|
+
@if (visible()) {
|
|
3378
|
+
<ui-detail-card [collapsible]="false" [title]="title()" [headingLevel]="3" data-testid="connect-account-card">
|
|
3379
|
+
@if (!accountId()) {
|
|
3380
|
+
<ui-alert variant="info" [quiet]="true" [title]="startTitle()" data-testid="connect-status-none">
|
|
3381
|
+
<ui-stack gap="sm">
|
|
3382
|
+
<ui-text size="sm" [text]="startText()" />
|
|
3383
|
+
<ui-stack direction="horizontal">
|
|
3384
|
+
<ui-button variant="primary" size="sm" data-testid="connect-start-button" [disabled]="loading() || disabled()" (click)="start()">{{ loading() ? 'Loading...' : startLabel() }}</ui-button>
|
|
3385
|
+
</ui-stack>
|
|
3386
|
+
</ui-stack>
|
|
3387
|
+
</ui-alert>
|
|
3388
|
+
} @else if (complete()) {
|
|
3389
|
+
<ui-alert variant="success" [quiet]="true" title="Account setup complete" data-testid="connect-status-complete">
|
|
3390
|
+
<ui-stack gap="sm">
|
|
3391
|
+
<ui-text size="sm" tone="muted" [text]="'Account ID: ' + accountId()" />
|
|
3392
|
+
<ui-stack direction="horizontal">
|
|
3393
|
+
<ui-button variant="secondary" size="sm" data-testid="connect-dashboard-button" (click)="openDashboard()">View Stripe Dashboard</ui-button>
|
|
3394
|
+
</ui-stack>
|
|
3395
|
+
</ui-stack>
|
|
3396
|
+
</ui-alert>
|
|
3397
|
+
} @else if (detailsSubmitted()) {
|
|
3398
|
+
<ui-alert variant="info" [quiet]="true" title="Stripe is verifying your account" data-testid="connect-status-verifying">
|
|
3399
|
+
<ui-stack gap="sm">
|
|
3400
|
+
<ui-text size="sm" text="Your setup has been submitted. Stripe is reviewing your information — this usually takes a few minutes. Payment collection will be enabled automatically once approved." />
|
|
3401
|
+
<ui-stack direction="horizontal">
|
|
3402
|
+
<ui-button variant="primary" size="sm" data-testid="connect-check-status-button" [disabled]="loading() || disabled()" (click)="check()">{{ loading() ? 'Checking...' : 'Check Status' }}</ui-button>
|
|
3403
|
+
</ui-stack>
|
|
3404
|
+
</ui-stack>
|
|
3405
|
+
</ui-alert>
|
|
3406
|
+
} @else {
|
|
3407
|
+
<ui-alert variant="warning" [quiet]="true" title="Account setup incomplete" data-testid="connect-status-incomplete">
|
|
3408
|
+
<ui-stack gap="sm">
|
|
3409
|
+
<ui-text size="sm" text="Complete your Stripe account setup to start collecting payments from customers." />
|
|
3410
|
+
<ui-stack direction="horizontal">
|
|
3411
|
+
<ui-button variant="primary" size="sm" data-testid="connect-complete-setup-button" [disabled]="loading() || disabled()" (click)="resume()">{{ loading() ? 'Loading...' : 'Complete Setup' }}</ui-button>
|
|
3412
|
+
</ui-stack>
|
|
3413
|
+
</ui-stack>
|
|
3414
|
+
</ui-alert>
|
|
3415
|
+
}
|
|
3416
|
+
</ui-detail-card>
|
|
3417
|
+
}
|
|
3418
|
+
`,
|
|
3419
|
+
encapsulation: ViewEncapsulation.None,
|
|
3420
|
+
styles: ["ui-stripe-connect{display:block;min-width:0}\n"]
|
|
3421
|
+
}]
|
|
3422
|
+
}],
|
|
3423
|
+
ctorParameters: () => [],
|
|
3424
|
+
propDecorators: {
|
|
3425
|
+
createAccount: [{
|
|
3426
|
+
type: i0.Input,
|
|
3427
|
+
args: [{
|
|
3428
|
+
isSignal: true,
|
|
3429
|
+
alias: "createAccount",
|
|
3430
|
+
required: false
|
|
3431
|
+
}]
|
|
3432
|
+
}],
|
|
3433
|
+
getStatus: [{
|
|
3434
|
+
type: i0.Input,
|
|
3435
|
+
args: [{
|
|
3436
|
+
isSignal: true,
|
|
3437
|
+
alias: "getStatus",
|
|
3438
|
+
required: false
|
|
3439
|
+
}]
|
|
3440
|
+
}],
|
|
3441
|
+
accountId: [{
|
|
3442
|
+
type: i0.Input,
|
|
3443
|
+
args: [{
|
|
3444
|
+
isSignal: true,
|
|
3445
|
+
alias: "accountId",
|
|
3446
|
+
required: false
|
|
3447
|
+
}]
|
|
3448
|
+
}, {
|
|
3449
|
+
type: i0.Output,
|
|
3450
|
+
args: ["accountIdChange"]
|
|
3451
|
+
}],
|
|
3452
|
+
complete: [{
|
|
3453
|
+
type: i0.Input,
|
|
3454
|
+
args: [{
|
|
3455
|
+
isSignal: true,
|
|
3456
|
+
alias: "complete",
|
|
3457
|
+
required: false
|
|
3458
|
+
}]
|
|
3459
|
+
}, {
|
|
3460
|
+
type: i0.Output,
|
|
3461
|
+
args: ["completeChange"]
|
|
3462
|
+
}],
|
|
3463
|
+
detailsSubmitted: [{
|
|
3464
|
+
type: i0.Input,
|
|
3465
|
+
args: [{
|
|
3466
|
+
isSignal: true,
|
|
3467
|
+
alias: "detailsSubmitted",
|
|
3468
|
+
required: false
|
|
3469
|
+
}]
|
|
3470
|
+
}, {
|
|
3471
|
+
type: i0.Output,
|
|
3472
|
+
args: ["detailsSubmittedChange"]
|
|
3473
|
+
}],
|
|
3474
|
+
title: [{
|
|
3475
|
+
type: i0.Input,
|
|
3476
|
+
args: [{
|
|
3477
|
+
isSignal: true,
|
|
3478
|
+
alias: "title",
|
|
3479
|
+
required: false
|
|
3480
|
+
}]
|
|
3481
|
+
}],
|
|
3482
|
+
showWhenNoAccount: [{
|
|
3483
|
+
type: i0.Input,
|
|
3484
|
+
args: [{
|
|
3485
|
+
isSignal: true,
|
|
3486
|
+
alias: "showWhenNoAccount",
|
|
3487
|
+
required: false
|
|
3488
|
+
}]
|
|
3489
|
+
}],
|
|
3490
|
+
startTitle: [{
|
|
3491
|
+
type: i0.Input,
|
|
3492
|
+
args: [{
|
|
3493
|
+
isSignal: true,
|
|
3494
|
+
alias: "startTitle",
|
|
3495
|
+
required: false
|
|
3496
|
+
}]
|
|
3497
|
+
}],
|
|
3498
|
+
startText: [{
|
|
3499
|
+
type: i0.Input,
|
|
3500
|
+
args: [{
|
|
3501
|
+
isSignal: true,
|
|
3502
|
+
alias: "startText",
|
|
3503
|
+
required: false
|
|
3504
|
+
}]
|
|
3505
|
+
}],
|
|
3506
|
+
startLabel: [{
|
|
3507
|
+
type: i0.Input,
|
|
3508
|
+
args: [{
|
|
3509
|
+
isSignal: true,
|
|
3510
|
+
alias: "startLabel",
|
|
3511
|
+
required: false
|
|
3512
|
+
}]
|
|
3513
|
+
}],
|
|
3514
|
+
disabled: [{
|
|
3515
|
+
type: i0.Input,
|
|
3516
|
+
args: [{
|
|
3517
|
+
isSignal: true,
|
|
3518
|
+
alias: "disabled",
|
|
3519
|
+
required: false
|
|
3520
|
+
}]
|
|
3521
|
+
}],
|
|
3522
|
+
refreshOnReturn: [{
|
|
3523
|
+
type: i0.Input,
|
|
3524
|
+
args: [{
|
|
3525
|
+
isSignal: true,
|
|
3526
|
+
alias: "refreshOnReturn",
|
|
3527
|
+
required: false
|
|
3528
|
+
}]
|
|
3529
|
+
}],
|
|
3530
|
+
dashboardUrl: [{
|
|
3531
|
+
type: i0.Input,
|
|
3532
|
+
args: [{
|
|
3533
|
+
isSignal: true,
|
|
3534
|
+
alias: "dashboardUrl",
|
|
3535
|
+
required: false
|
|
3536
|
+
}]
|
|
3537
|
+
}],
|
|
3538
|
+
outcome: [{
|
|
3539
|
+
type: i0.Output,
|
|
3540
|
+
args: ["outcome"]
|
|
3541
|
+
}],
|
|
3542
|
+
loading: [{
|
|
3543
|
+
type: i0.Input,
|
|
3544
|
+
args: [{
|
|
3545
|
+
isSignal: true,
|
|
3546
|
+
alias: "loading",
|
|
3547
|
+
required: false
|
|
3548
|
+
}]
|
|
3549
|
+
}, {
|
|
3550
|
+
type: i0.Output,
|
|
3551
|
+
args: ["loadingChange"]
|
|
3552
|
+
}],
|
|
3553
|
+
navigateTab: [{
|
|
3554
|
+
type: i0.Input,
|
|
3555
|
+
args: [{
|
|
3556
|
+
isSignal: true,
|
|
3557
|
+
alias: "navigateTab",
|
|
3558
|
+
required: false
|
|
3559
|
+
}]
|
|
3560
|
+
}]
|
|
3561
|
+
}
|
|
3562
|
+
});
|
|
3563
|
+
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 };
|
|
2826
3564
|
|
|
2827
3565
|
//# sourceMappingURL=forgeroute-ui-stripe.mjs.map
|