@aws-amplify/ui-angular 0.0.0-next-poc-202198192630

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/aws-amplify-ui-angular.d.ts +28 -0
  2. package/aws-amplify-ui-angular.metadata.json +1 -0
  3. package/bundles/aws-amplify-ui-angular.umd.js +3818 -0
  4. package/bundles/aws-amplify-ui-angular.umd.js.map +1 -0
  5. package/bundles/aws-amplify-ui-angular.umd.min.js +2 -0
  6. package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -0
  7. package/esm2015/aws-amplify-ui-angular.js +29 -0
  8. package/esm2015/index.js +12 -0
  9. package/esm2015/lib/common/helpers.js +3 -0
  10. package/esm2015/lib/common/index.js +3 -0
  11. package/esm2015/lib/common/types/auth-types.js +2 -0
  12. package/esm2015/lib/common/types/component-types.js +2 -0
  13. package/esm2015/lib/common/types/index.js +3 -0
  14. package/esm2015/lib/components/amplify-authenticator/amplify-authenticator.component.js +85 -0
  15. package/esm2015/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.js +91 -0
  16. package/esm2015/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.js +83 -0
  17. package/esm2015/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.js +37 -0
  18. package/esm2015/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.js +27 -0
  19. package/esm2015/lib/components/amplify-force-new-password/amplify-force-new-password.component.js +83 -0
  20. package/esm2015/lib/components/amplify-reset-password/amplify-reset-password.component.js +68 -0
  21. package/esm2015/lib/components/amplify-setup-totp/amplify-setup-totp.component.js +100 -0
  22. package/esm2015/lib/components/amplify-sign-in/amplify-sign-in.component.js +78 -0
  23. package/esm2015/lib/components/amplify-sign-up/amplify-sign-up.component.js +97 -0
  24. package/esm2015/lib/components/amplify-verify-user/amplify-verify-user.component.js +78 -0
  25. package/esm2015/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.js +76 -0
  26. package/esm2015/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.js +66 -0
  27. package/esm2015/lib/components/index.js +14 -0
  28. package/esm2015/lib/directives/amplify-slot.directive.js +21 -0
  29. package/esm2015/lib/primitives/amplify-button/amplify-button.component.js +38 -0
  30. package/esm2015/lib/primitives/amplify-error/amplify-error.component.js +10 -0
  31. package/esm2015/lib/primitives/amplify-form-field/amplify-form-field.component.js +91 -0
  32. package/esm2015/lib/primitives/amplify-password-field/amplify-password-field.component.js +39 -0
  33. package/esm2015/lib/primitives/amplify-select/amplify-select.component.js +17 -0
  34. package/esm2015/lib/primitives/amplify-text-field/amplify-text-field.component.js +29 -0
  35. package/esm2015/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.js +35 -0
  36. package/esm2015/lib/primitives/index.js +3 -0
  37. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +33 -0
  38. package/esm2015/lib/primitives/tab-item/tab-item.component.js +20 -0
  39. package/esm2015/lib/primitives/tabs/tabs.component.js +45 -0
  40. package/esm2015/lib/proxies.js +1839 -0
  41. package/esm2015/lib/services/authenticator-context.service.js +28 -0
  42. package/esm2015/lib/services/state-machine.service.js +51 -0
  43. package/esm2015/lib/ui-angular.module.js +103 -0
  44. package/fesm2015/aws-amplify-ui-angular.js +3209 -0
  45. package/fesm2015/aws-amplify-ui-angular.js.map +1 -0
  46. package/index.d.ts +8 -0
  47. package/lib/common/helpers.d.ts +2 -0
  48. package/lib/common/index.d.ts +2 -0
  49. package/lib/common/types/auth-types.d.ts +6 -0
  50. package/lib/common/types/component-types.d.ts +23 -0
  51. package/lib/common/types/index.d.ts +2 -0
  52. package/lib/components/amplify-authenticator/amplify-authenticator.component.d.ts +35 -0
  53. package/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.d.ts +31 -0
  54. package/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.d.ts +34 -0
  55. package/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.d.ts +16 -0
  56. package/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.d.ts +9 -0
  57. package/lib/components/amplify-force-new-password/amplify-force-new-password.component.d.ts +31 -0
  58. package/lib/components/amplify-reset-password/amplify-reset-password.component.d.ts +30 -0
  59. package/lib/components/amplify-setup-totp/amplify-setup-totp.component.d.ts +31 -0
  60. package/lib/components/amplify-sign-in/amplify-sign-in.component.d.ts +32 -0
  61. package/lib/components/amplify-sign-up/amplify-sign-up.component.d.ts +32 -0
  62. package/lib/components/amplify-verify-user/amplify-verify-user.component.d.ts +32 -0
  63. package/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +34 -0
  64. package/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +28 -0
  65. package/lib/components/index.d.ts +13 -0
  66. package/lib/directives/amplify-slot.directive.d.ts +7 -0
  67. package/lib/primitives/amplify-button/amplify-button.component.d.ts +15 -0
  68. package/lib/primitives/amplify-error/amplify-error.component.d.ts +2 -0
  69. package/lib/primitives/amplify-form-field/amplify-form-field.component.d.ts +34 -0
  70. package/lib/primitives/amplify-password-field/amplify-password-field.component.d.ts +14 -0
  71. package/lib/primitives/amplify-select/amplify-select.component.d.ts +7 -0
  72. package/lib/primitives/amplify-text-field/amplify-text-field.component.d.ts +11 -0
  73. package/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.d.ts +15 -0
  74. package/lib/primitives/index.d.ts +2 -0
  75. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +14 -0
  76. package/lib/primitives/tab-item/tab-item.component.d.ts +7 -0
  77. package/lib/primitives/tabs/tabs.component.d.ts +9 -0
  78. package/lib/proxies.d.ts +395 -0
  79. package/lib/services/authenticator-context.service.d.ts +10 -0
  80. package/lib/services/state-machine.service.d.ts +29 -0
  81. package/lib/ui-angular.module.d.ts +2 -0
  82. package/package.json +29 -0
  83. package/styles/component.css +169 -0
  84. package/theme.css +2 -0
@@ -0,0 +1,3209 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ContentChildren, HostBinding, EventEmitter, Output, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, NgZone, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { createAuthenticatorMachine, getSendEventAliases, translate, translations, getActorState, getActorContext, AuthChallengeNames, FederatedIdentityProviders, getConfiguredAliases, authInputAttributes, countryDialCodes, getAliasInfoFromContext } from '@aws-amplify/ui';
5
+ import { I18n, Logger, Auth } from 'aws-amplify';
6
+ import { interpret } from 'xstate';
7
+ import { __awaiter, __decorate } from 'tslib';
8
+ import QRCode from 'qrcode';
9
+ import { isEmpty } from 'lodash';
10
+ import { nanoid } from 'nanoid';
11
+ import { fromEvent } from 'rxjs';
12
+ import { AmplifyButton as AmplifyButton$1, AmplifyInput as AmplifyInput$1, AmplifyToast as AmplifyToast$1, AmplifyChatbot as AmplifyChatbot$1, AmplifyS3Album as AmplifyS3Album$1, AmplifyS3ImagePicker as AmplifyS3ImagePicker$1, AmplifyS3Text as AmplifyS3Text$1, AmplifyS3TextPicker as AmplifyS3TextPicker$1, AmplifyS3Image as AmplifyS3Image$1, AmplifyPicker as AmplifyPicker$1, AmplifyPhotoPicker as AmplifyPhotoPicker$1 } from '@aws-amplify/ui-components/dist/components';
13
+
14
+ class AmplifySlotDirective {
15
+ constructor(template) {
16
+ this.template = template;
17
+ }
18
+ set amplifySlot(component) {
19
+ this.name = component;
20
+ }
21
+ }
22
+ AmplifySlotDirective.decorators = [
23
+ { type: Directive, args: [{
24
+ selector: '[amplifySlot]',
25
+ },] }
26
+ ];
27
+ AmplifySlotDirective.ctorParameters = () => [
28
+ { type: TemplateRef }
29
+ ];
30
+ AmplifySlotDirective.propDecorators = {
31
+ amplifySlot: [{ type: Input }]
32
+ };
33
+
34
+ class AuthPropService {
35
+ constructor() {
36
+ this._customComponents = {};
37
+ this._props = {};
38
+ }
39
+ get customComponents() {
40
+ return this._customComponents;
41
+ }
42
+ set customComponents(customComponents) {
43
+ this._customComponents = Object.assign(Object.assign({}, this._customComponents), customComponents);
44
+ }
45
+ get props() {
46
+ return this._props;
47
+ }
48
+ set props(props) {
49
+ this._props = Object.assign(Object.assign({}, this._props), props);
50
+ }
51
+ }
52
+ AuthPropService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthPropService_Factory() { return new AuthPropService(); }, token: AuthPropService, providedIn: "root" });
53
+ AuthPropService.decorators = [
54
+ { type: Injectable, args: [{
55
+ providedIn: 'root',
56
+ },] }
57
+ ];
58
+ AuthPropService.ctorParameters = () => [];
59
+
60
+ /**
61
+ * AmplifyContextService contains access to the xstate machine
62
+ * and custom components passed by the user.
63
+ */
64
+ class StateMachineService {
65
+ startMachine({ initialState, loginMechanisms, }) {
66
+ const machine = createAuthenticatorMachine({
67
+ initialState,
68
+ loginMechanisms,
69
+ });
70
+ const authService = interpret(machine, {
71
+ devTools: process.env.NODE_ENV === 'development',
72
+ })
73
+ .onTransition((state) => {
74
+ this._user = state.context.user;
75
+ this._authState = state;
76
+ })
77
+ .start();
78
+ this._services = getSendEventAliases(authService.send);
79
+ this._authService = authService;
80
+ }
81
+ get services() {
82
+ return this._services;
83
+ }
84
+ get authState() {
85
+ return this._authState;
86
+ }
87
+ get authService() {
88
+ return this._authService;
89
+ }
90
+ get user() {
91
+ return this._user;
92
+ }
93
+ get context() {
94
+ return this._authState.context;
95
+ }
96
+ send(event) {
97
+ this.authService.send(event);
98
+ }
99
+ }
100
+ StateMachineService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StateMachineService_Factory() { return new StateMachineService(); }, token: StateMachineService, providedIn: "root" });
101
+ StateMachineService.decorators = [
102
+ { type: Injectable, args: [{
103
+ providedIn: 'root',
104
+ },] }
105
+ ];
106
+
107
+ class AmplifyAuthenticatorComponent {
108
+ constructor(stateMachine, contextService) {
109
+ this.stateMachine = stateMachine;
110
+ this.contextService = contextService;
111
+ this.customComponentQuery = null;
112
+ this.customComponents = {};
113
+ // translated texts
114
+ this.signInTitle = translate('Sign In');
115
+ this.signUpTitle = translate('Create Account');
116
+ }
117
+ ngOnInit() {
118
+ I18n.putVocabularies(translations);
119
+ const { initialState, loginMechanisms } = this;
120
+ this.stateMachine.startMachine({ initialState, loginMechanisms });
121
+ /**
122
+ * handling translations after content init, because authenticator and its
123
+ * translations might be initialized before the main app's `ngOnInit` is run.
124
+ **/
125
+ this.signInTitle = translate('Sign In');
126
+ this.signUpTitle = translate('Create Account');
127
+ }
128
+ /**
129
+ * Lifecycle Methods
130
+ */
131
+ ngAfterContentInit() {
132
+ this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
133
+ this.customComponents = this.contextService.customComponents;
134
+ }
135
+ /**
136
+ * Class Functions
137
+ */
138
+ get context() {
139
+ const { signOut } = this.stateMachine.services;
140
+ const user = this.stateMachine.user;
141
+ return { signOut, user };
142
+ }
143
+ get actorState() {
144
+ return getActorState(this.stateMachine.authState);
145
+ }
146
+ get authenticatorState() {
147
+ return this.stateMachine.authState;
148
+ }
149
+ onTabChange() {
150
+ const currentState = this.stateMachine.authState.value;
151
+ if (currentState === 'signIn') {
152
+ this.stateMachine.send('SIGN_UP');
153
+ }
154
+ else {
155
+ this.stateMachine.send('SIGN_IN');
156
+ }
157
+ }
158
+ mapCustomComponents(componentQuery) {
159
+ if (!componentQuery)
160
+ return {};
161
+ const customComponents = {};
162
+ componentQuery.forEach((component) => {
163
+ customComponents[component.name] = component.template;
164
+ });
165
+ return customComponents;
166
+ }
167
+ }
168
+ AmplifyAuthenticatorComponent.decorators = [
169
+ { type: Component, args: [{
170
+ selector: 'amplify-authenticator',
171
+ template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-authenticator>\n <div data-amplify-modal></div>\n\n <div data-amplify-container>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"actorState?.matches('signIn') || actorState?.matches('signUp')\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"actorState?.matches('signIn')\"\n >\n <!-- signIn component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n ></ng-container>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"actorState?.matches('signUp')\"\n >\n <!-- signUp component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n ></ng-container>\n </amplify-tab-item>\n </amplify-tabs>\n\n <!-- confirmSignUp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUp || confirmSignUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignUp')\"\n >\n </ng-container>\n\n <!-- confirmSignIn content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignIn || confirmSignIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignIn')\"\n >\n </ng-container>\n\n <!-- setupTotp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTOTP || setupTOTP\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('setupTOTP')\"\n >\n </ng-container>\n\n <!-- forceNewPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.forceNewPassword || forceNewPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('forceNewPassword')\"\n >\n </ng-container>\n\n <!-- resetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPassword || resetPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('resetPassword')\"\n >\n </ng-container>\n\n <!-- confirmResetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPassword || confirmResetPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmResetPassword')\"\n >\n </ng-container>\n\n <!-- verifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUser || verifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('verifyUser')\"\n >\n </ng-container>\n\n <!-- confirmVerifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUser || confirmVerifyUser\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmVerifyUser')\"\n >\n </ng-container>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
172
+ providers: [AuthPropService],
173
+ encapsulation: ViewEncapsulation.None
174
+ },] }
175
+ ];
176
+ AmplifyAuthenticatorComponent.ctorParameters = () => [
177
+ { type: StateMachineService },
178
+ { type: AuthPropService }
179
+ ];
180
+ AmplifyAuthenticatorComponent.propDecorators = {
181
+ initialState: [{ type: Input }],
182
+ loginMechanisms: [{ type: Input }],
183
+ customComponentQuery: [{ type: ContentChildren, args: [AmplifySlotDirective,] }]
184
+ };
185
+
186
+ const logger$3 = new Logger('ConfirmSignIn');
187
+ class AmplifyConfirmSignInComponent {
188
+ constructor(stateMachine, contextService) {
189
+ this.stateMachine = stateMachine;
190
+ this.contextService = contextService;
191
+ this.dataAttr = '';
192
+ this.customComponents = {};
193
+ this.remoteError = '';
194
+ this.isPending = false;
195
+ this.confirmText = translate('Confirm');
196
+ this.backToSignInText = translate('Back to Sign In');
197
+ }
198
+ ngOnInit() {
199
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => {
200
+ this.onStateUpdate(state);
201
+ });
202
+ this.setHeaderText();
203
+ }
204
+ ngAfterContentInit() {
205
+ this.customComponents = this.contextService.customComponents;
206
+ }
207
+ ngOnDestroy() {
208
+ this.authSubscription.unsubscribe();
209
+ }
210
+ get context() {
211
+ const { change, signIn, submit } = this.stateMachine.services;
212
+ const remoteError = this.remoteError;
213
+ return { change, remoteError, signIn, submit };
214
+ }
215
+ setHeaderText() {
216
+ const state = this.stateMachine.authState;
217
+ const actorContext = getActorContext(state);
218
+ const { challengeName } = actorContext;
219
+ switch (challengeName) {
220
+ case AuthChallengeNames.SOFTWARE_TOKEN_MFA:
221
+ // TODO: this string should be centralized and translated from ui.
222
+ this.headerText = translate('Confirm TOTP Code');
223
+ break;
224
+ case AuthChallengeNames.SMS_MFA:
225
+ this.headerText = translate('Confirm SMS Code');
226
+ break;
227
+ default:
228
+ logger$3.error('Unexpected challengeName', challengeName);
229
+ }
230
+ }
231
+ onStateUpdate(state) {
232
+ const actorState = getActorState(state);
233
+ this.remoteError = actorState.context.remoteError;
234
+ this.isPending = !actorState.matches('confirmSignIn.edit');
235
+ }
236
+ onInput(event) {
237
+ event.preventDefault();
238
+ const { name, value } = event.target;
239
+ this.stateMachine.send({
240
+ type: 'CHANGE',
241
+ data: { name, value },
242
+ });
243
+ }
244
+ onSubmit(event) {
245
+ event.preventDefault();
246
+ // TODO: handle form data within the state machine
247
+ const formData = new FormData(event.target);
248
+ this.stateMachine.send({
249
+ type: 'SUBMIT',
250
+ data: Object.fromEntries(formData),
251
+ });
252
+ }
253
+ toSignIn() {
254
+ this.stateMachine.send('SIGN_IN');
255
+ }
256
+ }
257
+ AmplifyConfirmSignInComponent.decorators = [
258
+ { type: Component, args: [{
259
+ selector: 'amplify-confirm-sign-in',
260
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignInButton || confirmSignInButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || confirmSignInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
261
+ },] }
262
+ ];
263
+ AmplifyConfirmSignInComponent.ctorParameters = () => [
264
+ { type: StateMachineService },
265
+ { type: AuthPropService }
266
+ ];
267
+ AmplifyConfirmSignInComponent.propDecorators = {
268
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }]
269
+ };
270
+
271
+ class AmplifyConfirmSignUpComponent {
272
+ constructor(stateMachine, contextService) {
273
+ this.stateMachine = stateMachine;
274
+ this.contextService = contextService;
275
+ this.dataAttr = '';
276
+ this.headerText = translate('Confirm Sign Up');
277
+ this.customComponents = {};
278
+ this.remoteError = '';
279
+ this.isPending = false;
280
+ // translated texts
281
+ this.resendCodeText = translate('Resend Code');
282
+ this.lostCodeText = translate('Lost your code? ');
283
+ this.confirmText = translate('Confirm');
284
+ }
285
+ ngOnInit() {
286
+ // TODO: alias for subscribe
287
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
288
+ }
289
+ ngAfterContentInit() {
290
+ this.customComponents = this.contextService.customComponents;
291
+ }
292
+ ngOnDestroy() {
293
+ this.authSubscription.unsubscribe();
294
+ }
295
+ onStateUpdate(state) {
296
+ const actorState = getActorState(state);
297
+ this.remoteError = actorState.context.remoteError;
298
+ this.isPending = !actorState.matches('confirmSignUp.edit');
299
+ }
300
+ get context() {
301
+ const { change, resend, signIn, submit } = this.stateMachine.services;
302
+ const remoteError = this.remoteError;
303
+ const username = this.username;
304
+ return { change, remoteError, resend, signIn, submit, username };
305
+ }
306
+ resend() {
307
+ this.stateMachine.send({
308
+ type: 'RESEND',
309
+ data: {
310
+ username: this.username,
311
+ },
312
+ });
313
+ }
314
+ onInput($event) {
315
+ $event.preventDefault();
316
+ const { name, value } = $event.target;
317
+ this.stateMachine.send({
318
+ type: 'CHANGE',
319
+ data: { name, value },
320
+ });
321
+ }
322
+ onSubmit(event) {
323
+ event.preventDefault();
324
+ const state = this.stateMachine.authState;
325
+ const actorContext = getActorContext(state);
326
+ const { formValues } = actorContext;
327
+ const { username, confirmation_code } = formValues;
328
+ this.stateMachine.send({
329
+ type: 'SUBMIT',
330
+ data: { username, confirmation_code },
331
+ });
332
+ }
333
+ }
334
+ AmplifyConfirmSignUpComponent.decorators = [
335
+ { type: Component, args: [{
336
+ selector: 'amplify-confirm-sign-up',
337
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignUpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignUpButton || confirmSignUpButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button amplify-button fontWeight=\"normal\" (click)=\"resend()\">\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render confirm sign up component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUpForm || confirmSignUpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
338
+ },] }
339
+ ];
340
+ AmplifyConfirmSignUpComponent.ctorParameters = () => [
341
+ { type: StateMachineService },
342
+ { type: AuthPropService }
343
+ ];
344
+ AmplifyConfirmSignUpComponent.propDecorators = {
345
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }],
346
+ headerText: [{ type: Input }]
347
+ };
348
+
349
+ class AmplifyFederatedSignInButtonComponent {
350
+ constructor(stateMachine) {
351
+ this.stateMachine = stateMachine;
352
+ this.onClick = () => {
353
+ this.stateMachine.send({
354
+ type: 'FEDERATED_SIGN_IN',
355
+ data: { provider: this.provider },
356
+ });
357
+ };
358
+ }
359
+ }
360
+ AmplifyFederatedSignInButtonComponent.decorators = [
361
+ { type: Component, args: [{
362
+ selector: 'amplify-federated-sign-in-button',
363
+ template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n style=\"display: block\"\n (click)=\"onClick()\"\n>\n <div\n class=\"amplify-flex federated-sign-in-button-row\"\n style=\"flex-direction: row; justify-content: center\"\n >\n <ng-content></ng-content>\n </div>\n</button>\n"
364
+ },] }
365
+ ];
366
+ AmplifyFederatedSignInButtonComponent.ctorParameters = () => [
367
+ { type: StateMachineService }
368
+ ];
369
+ AmplifyFederatedSignInButtonComponent.propDecorators = {
370
+ provider: [{ type: Input }],
371
+ text: [{ type: Input }]
372
+ };
373
+
374
+ class AmplifyFederatedSignInComponent {
375
+ constructor(stateMachine) {
376
+ this.stateMachine = stateMachine;
377
+ this.FederatedProviders = FederatedIdentityProviders;
378
+ this.includeFacebook = false;
379
+ this.includeGoogle = false;
380
+ this.includeAmazon = false;
381
+ this.shouldShowFederatedSignIn = false;
382
+ // translated texts
383
+ this.signInFacebookText = translate('Sign In with Facebook');
384
+ this.signInGoogleText = translate('Sign In with Google');
385
+ this.signInAmazonText = translate('Sign In with Amazon');
386
+ }
387
+ ngOnInit() {
388
+ var _a, _b;
389
+ const loginMechanisms = (_b = (_a = this.stateMachine.context) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.login_mechanisms;
390
+ this.includeFacebook = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('facebook');
391
+ this.includeGoogle = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('google');
392
+ this.includeAmazon = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('amazon');
393
+ this.shouldShowFederatedSignIn =
394
+ this.includeFacebook || this.includeGoogle || this.includeAmazon;
395
+ }
396
+ }
397
+ AmplifyFederatedSignInComponent.decorators = [
398
+ { type: Component, args: [{
399
+ selector: 'amplify-federated-sign-in',
400
+ template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <hr\n class=\"amplify-divider\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n style=\"margin: '1rem 0'\"\n />\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n</div>\n"
401
+ },] }
402
+ ];
403
+ AmplifyFederatedSignInComponent.ctorParameters = () => [
404
+ { type: StateMachineService }
405
+ ];
406
+
407
+ const logger$2 = new Logger('ForceNewPassword');
408
+ class AmplifyForceNewPasswordComponent {
409
+ constructor(stateMachine, contextService) {
410
+ this.stateMachine = stateMachine;
411
+ this.contextService = contextService;
412
+ this.dataAttr = '';
413
+ this.headerText = translate('Change Password');
414
+ this.customComponents = {};
415
+ this.remoteError = '';
416
+ this.isPending = false;
417
+ // translated texts
418
+ this.changePasswordText = translate('Change Password');
419
+ this.backToSignInText = translate('Back to Sign In');
420
+ }
421
+ ngOnInit() {
422
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
423
+ }
424
+ ngAfterContentInit() {
425
+ this.customComponents = this.contextService.customComponents;
426
+ }
427
+ ngOnDestroy() {
428
+ logger$2.log('sign in destroyed, unsubscribing from state machine...');
429
+ this.authSubscription.unsubscribe();
430
+ }
431
+ onStateUpdate(state) {
432
+ const actorState = getActorState(state);
433
+ this.remoteError = actorState.context.remoteError;
434
+ this.isPending = actorState.matches({
435
+ signUp: {
436
+ submission: 'idle',
437
+ },
438
+ });
439
+ }
440
+ get context() {
441
+ const { change, signIn, submit } = this.stateMachine.services;
442
+ const user = this.stateMachine.user;
443
+ const remoteError = this.remoteError;
444
+ return { change, remoteError, signIn, submit, user };
445
+ }
446
+ toSignIn() {
447
+ this.stateMachine.send('SIGN_IN');
448
+ }
449
+ onInput(event) {
450
+ event.preventDefault();
451
+ const { name, value } = event.target;
452
+ this.stateMachine.send({
453
+ type: 'CHANGE',
454
+ data: { name, value },
455
+ });
456
+ }
457
+ onSubmit(event) {
458
+ event.preventDefault();
459
+ // consider stateMachine directly providing actorState / actorContext
460
+ const state = this.stateMachine.authState;
461
+ const actorState = getActorContext(state);
462
+ const { formValues } = actorState;
463
+ this.stateMachine.send({
464
+ type: 'SUBMIT',
465
+ data: formValues,
466
+ });
467
+ }
468
+ }
469
+ AmplifyForceNewPasswordComponent.decorators = [
470
+ { type: Component, args: [{
471
+ selector: 'amplify-force-new-password',
472
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #forceNewPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.forceNewPasswordSubmitButton ||\n forceNewPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render force new password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
473
+ },] }
474
+ ];
475
+ AmplifyForceNewPasswordComponent.ctorParameters = () => [
476
+ { type: StateMachineService },
477
+ { type: AuthPropService }
478
+ ];
479
+ AmplifyForceNewPasswordComponent.propDecorators = {
480
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-forcenewpassword',] }],
481
+ headerText: [{ type: Input }]
482
+ };
483
+
484
+ class AmplifyResetPasswordComponent {
485
+ constructor(stateMachine, contextService) {
486
+ this.stateMachine = stateMachine;
487
+ this.contextService = contextService;
488
+ this.dataAttr = '';
489
+ this.headerText = translate('Reset your password');
490
+ this.customComponents = {};
491
+ this.remoteError = '';
492
+ this.isPending = false;
493
+ // translated texts
494
+ this.sendCodeText = translate('Send Code');
495
+ this.backToSignInText = translate('Back to Sign In');
496
+ }
497
+ ngOnInit() {
498
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
499
+ }
500
+ ngAfterContentInit() {
501
+ this.customComponents = this.contextService.customComponents;
502
+ }
503
+ ngOnDestroy() {
504
+ this.authSubscription.unsubscribe();
505
+ }
506
+ onStateUpdate(state) {
507
+ const actorState = getActorState(state);
508
+ this.remoteError = actorState.context.remoteError;
509
+ this.isPending = !actorState.matches('resetPassword.edit');
510
+ }
511
+ get context() {
512
+ const { change, signIn, submit } = this.stateMachine.services;
513
+ const remoteError = this.remoteError;
514
+ return { change, remoteError, signIn, submit };
515
+ }
516
+ toSignIn() {
517
+ this.stateMachine.send('SIGN_IN');
518
+ }
519
+ onInput(event) {
520
+ event.preventDefault();
521
+ const { name, value } = event.target;
522
+ this.stateMachine.send({
523
+ type: 'CHANGE',
524
+ data: { name, value },
525
+ });
526
+ }
527
+ onSubmit(event) {
528
+ event.preventDefault();
529
+ this.stateMachine.send('SUBMIT');
530
+ }
531
+ }
532
+ AmplifyResetPasswordComponent.decorators = [
533
+ { type: Component, args: [{
534
+ selector: 'amplify-reset-password',
535
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #resetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n\n<ng-template #resetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.resetPasswordSubmitButton ||\n resetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render reset passsword component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPasswordForm || resetPasswordForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
536
+ },] }
537
+ ];
538
+ AmplifyResetPasswordComponent.ctorParameters = () => [
539
+ { type: StateMachineService },
540
+ { type: AuthPropService }
541
+ ];
542
+ AmplifyResetPasswordComponent.propDecorators = {
543
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-resetPassword',] }],
544
+ headerText: [{ type: Input }]
545
+ };
546
+
547
+ const logger$1 = new Logger('SetupTotp');
548
+ class AmplifySetupTotpComponent {
549
+ constructor(stateMachine, contextService) {
550
+ this.stateMachine = stateMachine;
551
+ this.contextService = contextService;
552
+ this.customComponents = {};
553
+ this.remoteError = '';
554
+ this.isPending = false;
555
+ this.headerText = translate('Setup TOTP');
556
+ this.qrCodeSource = '';
557
+ // translated texts
558
+ this.backToSignInText = translate('Back to Sign In');
559
+ this.confirmText = translate('Confirm');
560
+ }
561
+ ngOnInit() {
562
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => {
563
+ this.onStateUpdate(state);
564
+ });
565
+ this.generateQRCode();
566
+ }
567
+ ngAfterContentInit() {
568
+ this.customComponents = this.contextService.customComponents;
569
+ }
570
+ ngOnDestroy() {
571
+ this.authSubscription.unsubscribe();
572
+ }
573
+ onStateUpdate(state) {
574
+ const actorState = getActorState(state);
575
+ this.remoteError = actorState.context.remoteError;
576
+ this.isPending = !actorState.matches('setupTOTP.edit');
577
+ }
578
+ get context() {
579
+ const { change, submit } = this.stateMachine.services;
580
+ const remoteError = this.remoteError;
581
+ const user = this.stateMachine.user;
582
+ return { change, remoteError, submit, user };
583
+ }
584
+ generateQRCode() {
585
+ var _a;
586
+ return __awaiter(this, void 0, void 0, function* () {
587
+ // TODO: This should be handled in core.
588
+ const state = this.stateMachine.authState;
589
+ const actorContext = getActorContext(state);
590
+ const { user } = actorContext;
591
+ try {
592
+ const secretKey = yield Auth.setupTOTP(user);
593
+ const issuer = 'AWSCognito';
594
+ const totpCode = `otpauth://totp/${issuer}:${user.username}?secret=${secretKey}&issuer=${issuer}`;
595
+ logger$1.info('totp code was generated:', totpCode);
596
+ this.qrCodeSource = yield QRCode.toDataURL(totpCode);
597
+ }
598
+ catch (err) {
599
+ this.remoteError = (_a = err.message) !== null && _a !== void 0 ? _a : err;
600
+ logger$1.error(err);
601
+ }
602
+ });
603
+ }
604
+ onInput(event) {
605
+ event.preventDefault();
606
+ const { name, value } = event.target;
607
+ this.stateMachine.send({
608
+ type: 'CHANGE',
609
+ data: { name, value },
610
+ });
611
+ }
612
+ onSubmit(event) {
613
+ event.preventDefault();
614
+ // TODO: handle form data within the state machine
615
+ const formData = new FormData(event.target);
616
+ this.stateMachine.send({
617
+ type: 'SUBMIT',
618
+ data: Object.fromEntries(formData),
619
+ });
620
+ }
621
+ toSignIn() {
622
+ this.stateMachine.send('SIGN_IN');
623
+ }
624
+ }
625
+ AmplifySetupTotpComponent.decorators = [
626
+ { type: Component, args: [{
627
+ selector: 'amplify-setup-totp',
628
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #setupTotpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #setupTotpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n />\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpButton || setupTotpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpForm || setupTotpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
629
+ },] }
630
+ ];
631
+ AmplifySetupTotpComponent.ctorParameters = () => [
632
+ { type: StateMachineService },
633
+ { type: AuthPropService }
634
+ ];
635
+ AmplifySetupTotpComponent.propDecorators = {
636
+ customComponents: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
637
+ };
638
+
639
+ const logger = new Logger('SignIn');
640
+ class AmplifySignInComponent {
641
+ constructor(stateMachine, contextService) {
642
+ this.stateMachine = stateMachine;
643
+ this.contextService = contextService;
644
+ this.dataAttr = '';
645
+ this.headerText = translate('Sign in to your account');
646
+ this.customComponents = {};
647
+ this.remoteError = '';
648
+ this.isPending = false;
649
+ // translated phrases
650
+ this.forgotPasswordText = translate('Forgot your password? ');
651
+ this.signInButtonText = translate('Sign in');
652
+ this.noAccountText = translate('No account? ');
653
+ }
654
+ ngOnInit() {
655
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
656
+ }
657
+ ngAfterContentInit() {
658
+ this.customComponents = this.contextService.customComponents;
659
+ }
660
+ ngOnDestroy() {
661
+ logger.log('sign in destroyed, unsubscribing from state machine...');
662
+ this.authSubscription.unsubscribe();
663
+ }
664
+ onStateUpdate(state) {
665
+ const actorState = getActorState(state);
666
+ this.remoteError = actorState.context.remoteError;
667
+ this.isPending = !actorState.matches('signIn.edit');
668
+ }
669
+ get context() {
670
+ const { change, resetPassword, signUp, submit } = this.stateMachine.services;
671
+ const remoteError = this.remoteError;
672
+ return { change, remoteError, resetPassword, signUp, submit };
673
+ }
674
+ toResetPassword() {
675
+ this.stateMachine.send('RESET_PASSWORD');
676
+ }
677
+ onInput(event) {
678
+ event.preventDefault();
679
+ const { name, value } = event.target;
680
+ this.stateMachine.send({
681
+ type: 'CHANGE',
682
+ data: { name, value },
683
+ });
684
+ }
685
+ onSubmit(event) {
686
+ return __awaiter(this, void 0, void 0, function* () {
687
+ event.preventDefault();
688
+ this.stateMachine.send({
689
+ type: 'SUBMIT',
690
+ });
691
+ });
692
+ }
693
+ }
694
+ AmplifySignInComponent.decorators = [
695
+ { type: Component, args: [{
696
+ selector: 'amplify-sign-in',
697
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #signInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ signInButtonText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-user-name-alias></amplify-user-name-alias>\n <amplify-form-field\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInButton || signInButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n (click)=\"toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
698
+ encapsulation: ViewEncapsulation.None
699
+ },] }
700
+ ];
701
+ AmplifySignInComponent.ctorParameters = () => [
702
+ { type: StateMachineService },
703
+ { type: AuthPropService }
704
+ ];
705
+ AmplifySignInComponent.propDecorators = {
706
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signin',] }],
707
+ headerText: [{ type: Input }]
708
+ };
709
+
710
+ class AmplifySignUpComponent {
711
+ constructor(stateMachine, contextService) {
712
+ this.stateMachine = stateMachine;
713
+ this.contextService = contextService;
714
+ this.dataAttr = '';
715
+ this.headerText = translate('Create a new account');
716
+ this.remoteError = '';
717
+ this.isPending = false;
718
+ this.primaryAlias = '';
719
+ this.secondaryAliases = [];
720
+ this.validationError = {};
721
+ // translated texts
722
+ this.createAccountText = translate('Create Account');
723
+ }
724
+ get context() {
725
+ const { change, signIn, submit } = this.stateMachine.services;
726
+ const remoteError = this.remoteError;
727
+ const validationError = this.validationError;
728
+ return {
729
+ change,
730
+ remoteError,
731
+ signIn,
732
+ submit,
733
+ validationError,
734
+ };
735
+ }
736
+ ngOnInit() {
737
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
738
+ const context = this.stateMachine.context;
739
+ const { primaryAlias, secondaryAliases } = getConfiguredAliases(context);
740
+ /**
741
+ * If the login_mechanisms are configured to use ONLY username, we need
742
+ * to ask for some sort of secondary contact information in order to
743
+ * verify the user for Cognito. Currently matching this to how Vue is
744
+ * set up.
745
+ */
746
+ if (primaryAlias === 'username' && isEmpty(secondaryAliases)) {
747
+ secondaryAliases.push('email', 'phone_number');
748
+ }
749
+ this.primaryAlias = primaryAlias;
750
+ this.secondaryAliases = secondaryAliases;
751
+ }
752
+ ngAfterContentInit() {
753
+ this.customComponents = this.contextService.customComponents;
754
+ }
755
+ ngOnDestroy() {
756
+ this.authSubscription.unsubscribe();
757
+ }
758
+ onStateUpdate(state) {
759
+ const actorState = getActorState(state);
760
+ const actorContext = getActorContext(state);
761
+ this.remoteError = actorContext.remoteError;
762
+ this.validationError = actorContext.validationError;
763
+ this.isPending = !actorState.matches({
764
+ signUp: {
765
+ submission: 'idle',
766
+ },
767
+ });
768
+ }
769
+ onSubmit($event) {
770
+ return __awaiter(this, void 0, void 0, function* () {
771
+ $event.preventDefault();
772
+ this.stateMachine.send('SUBMIT');
773
+ });
774
+ }
775
+ onInput(event) {
776
+ event.preventDefault();
777
+ const { name, value } = event.target;
778
+ this.stateMachine.send({
779
+ type: 'CHANGE',
780
+ data: { name, value },
781
+ });
782
+ }
783
+ }
784
+ AmplifySignUpComponent.decorators = [
785
+ { type: Component, args: [{
786
+ selector: 'amplify-sign-up',
787
+ template: "<ng-template #signUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ createAccountText }}\n </button>\n</ng-template>\n\n<ng-template #signUpUsername>\n <amplify-user-name-alias [name]=\"primaryAlias\"></amplify-user-name-alias>\n</ng-template>\n\n<ng-template #signUpPassword>\n <amplify-form-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpConfirmPassword>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpFieldset>\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpUsername || signUpUsername\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpPassword || signUpPassword\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.signUpConfirmPassword || signUpConfirmPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container *ngFor=\"let secondaryAlias of secondaryAliases\">\n <amplify-form-field [name]=\"secondaryAlias\"></amplify-form-field>\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpButton || signUpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n</ng-template>\n\n<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpFieldset || signUpFieldset\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n </form>\n</div>\n"
788
+ },] }
789
+ ];
790
+ AmplifySignUpComponent.ctorParameters = () => [
791
+ { type: StateMachineService },
792
+ { type: AuthPropService }
793
+ ];
794
+ AmplifySignUpComponent.propDecorators = {
795
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signup',] }],
796
+ headerText: [{ type: Input }]
797
+ };
798
+
799
+ const getAttributeMap = () => authInputAttributes;
800
+
801
+ class AmplifyVerifyUserComponent {
802
+ constructor(stateMachine, contextService) {
803
+ this.stateMachine = stateMachine;
804
+ this.contextService = contextService;
805
+ this.dataAttr = '';
806
+ this.headerText = translate('Account recovery requires verified contact information');
807
+ this.customComponents = {};
808
+ this.unverifiedAttributes = {};
809
+ this.remoteError = '';
810
+ this.isPending = false;
811
+ this.labelId = nanoid(12);
812
+ // translated texts
813
+ this.skipText = translate('Skip');
814
+ this.verifyText = translate('Verify');
815
+ }
816
+ ngOnInit() {
817
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
818
+ }
819
+ ngAfterContentInit() {
820
+ this.customComponents = this.contextService.customComponents;
821
+ }
822
+ ngOnDestroy() {
823
+ this.authSubscription.unsubscribe();
824
+ }
825
+ onStateUpdate(state) {
826
+ const actorState = getActorState(state);
827
+ this.unverifiedAttributes = actorState.context.unverifiedAttributes;
828
+ this.remoteError = actorState.context.remoteError;
829
+ this.isPending = !actorState.matches('verifyUser.edit');
830
+ }
831
+ get context() {
832
+ const { change, skip, submit } = this.stateMachine.services;
833
+ const remoteError = this.remoteError;
834
+ return { change, remoteError, skip, submit };
835
+ }
836
+ skipVerify() {
837
+ this.stateMachine.send('SKIP');
838
+ }
839
+ getLabelForAttr(authAttr) {
840
+ var _a;
841
+ const attributeMap = getAttributeMap();
842
+ const label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
843
+ return translate(label);
844
+ }
845
+ onSubmit(event) {
846
+ return __awaiter(this, void 0, void 0, function* () {
847
+ event.preventDefault();
848
+ const formData = new FormData(event.target);
849
+ this.stateMachine.send({
850
+ type: 'SUBMIT',
851
+ data: Object.fromEntries(formData),
852
+ });
853
+ });
854
+ }
855
+ }
856
+ AmplifyVerifyUserComponent.decorators = [
857
+ { type: Component, args: [{
858
+ selector: 'amplify-verify-user',
859
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ verifyText }}\n </button>\n</ng-template>\n\n<ng-template #verifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <!-- TODO: match React implementation -->\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedAttribute.key)\n }}</label>\n </div>\n\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyButton || verifyButton\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render verify user component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUserForm || verifyUserForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
860
+ encapsulation: ViewEncapsulation.None
861
+ },] }
862
+ ];
863
+ AmplifyVerifyUserComponent.ctorParameters = () => [
864
+ { type: StateMachineService },
865
+ { type: AuthPropService }
866
+ ];
867
+ AmplifyVerifyUserComponent.propDecorators = {
868
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
869
+ headerText: [{ type: Input }]
870
+ };
871
+
872
+ class ConfirmResetPasswordComponent {
873
+ constructor(stateMachine, contextService) {
874
+ this.stateMachine = stateMachine;
875
+ this.contextService = contextService;
876
+ this.dataAttr = '';
877
+ this.headerText = translate('Reset your password');
878
+ this.customComponents = {};
879
+ this.remoteError = '';
880
+ this.isPending = false;
881
+ // translated strings
882
+ this.sendCodeText = translate('Send Code');
883
+ this.backToSignInText = translate('Back to Sign In');
884
+ this.lostCodeText = translate('Lost your code? ');
885
+ this.resendCodeText = translate('Resend Code');
886
+ }
887
+ ngOnInit() {
888
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
889
+ }
890
+ ngAfterContentInit() {
891
+ this.customComponents = this.contextService.customComponents;
892
+ }
893
+ ngOnDestroy() {
894
+ this.authSubscription.unsubscribe();
895
+ }
896
+ onStateUpdate(state) {
897
+ const actorState = getActorState(state);
898
+ this.remoteError = actorState.context.remoteError;
899
+ this.isPending = !actorState.matches('confirmResetPassword.edit');
900
+ }
901
+ get context() {
902
+ const { change, resend, signIn, submit } = this.stateMachine.services;
903
+ const remoteError = this.remoteError;
904
+ return { change, resend, remoteError, signIn, submit };
905
+ }
906
+ toSignIn() {
907
+ this.stateMachine.send('SIGN_IN');
908
+ }
909
+ resend() {
910
+ this.stateMachine.send('RESEND');
911
+ }
912
+ onInput(event) {
913
+ event.preventDefault();
914
+ const { name, value } = event.target;
915
+ this.stateMachine.send({
916
+ type: 'CHANGE',
917
+ data: { name, value },
918
+ });
919
+ }
920
+ onSubmit(event) {
921
+ return __awaiter(this, void 0, void 0, function* () {
922
+ event.preventDefault();
923
+ this.stateMachine.send('SUBMIT');
924
+ });
925
+ }
926
+ }
927
+ ConfirmResetPasswordComponent.decorators = [
928
+ { type: Component, args: [{
929
+ selector: 'amplify-confirm-reset-password',
930
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmResetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n<ng-template #confirmResetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordSubmitButton ||\n confirmResetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"resend()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordForm || confirmResetPasswordForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
931
+ },] }
932
+ ];
933
+ ConfirmResetPasswordComponent.ctorParameters = () => [
934
+ { type: StateMachineService },
935
+ { type: AuthPropService }
936
+ ];
937
+ ConfirmResetPasswordComponent.propDecorators = {
938
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
939
+ headerText: [{ type: Input }]
940
+ };
941
+
942
+ class ConfirmVerifyUserComponent {
943
+ constructor(stateMachine, contextService) {
944
+ this.stateMachine = stateMachine;
945
+ this.contextService = contextService;
946
+ this.dataAttr = '';
947
+ this.headerText = translate('Account recovery requires verified contact information');
948
+ this.customComponents = {};
949
+ this.remoteError = '';
950
+ this.isPending = false;
951
+ // translated texts
952
+ this.skipText = translate('Skip');
953
+ this.submitText = translate('Submit');
954
+ }
955
+ ngOnInit() {
956
+ this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
957
+ }
958
+ ngAfterContentInit() {
959
+ this.customComponents = this.contextService.customComponents;
960
+ }
961
+ ngOnDestroy() {
962
+ this.authSubscription.unsubscribe();
963
+ }
964
+ onStateUpdate(state) {
965
+ const actorState = getActorState(state);
966
+ this.remoteError = actorState.context.remoteError;
967
+ this.isPending = !actorState.matches('confirmVerifyUser.edit');
968
+ }
969
+ get context() {
970
+ const { skip, submit } = this.stateMachine.services;
971
+ const remoteError = this.remoteError;
972
+ return { remoteError, skip, submit };
973
+ }
974
+ skipVerify() {
975
+ this.stateMachine.send('SKIP');
976
+ }
977
+ onSubmit(event) {
978
+ return __awaiter(this, void 0, void 0, function* () {
979
+ event.preventDefault();
980
+ const formData = new FormData(event.target);
981
+ this.stateMachine.send({
982
+ type: 'SUBMIT',
983
+ data: Object.fromEntries(formData),
984
+ });
985
+ });
986
+ }
987
+ }
988
+ ConfirmVerifyUserComponent.decorators = [
989
+ { type: Component, args: [{
990
+ selector: 'amplify-confirm-verify-user',
991
+ template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmVerifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ submitText }}\n </button>\n</ng-template>\n\n<ng-template #confirmVerifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyButton || confirmVerifyButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUserForm || confirmVerifyUserForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
992
+ },] }
993
+ ];
994
+ ConfirmVerifyUserComponent.ctorParameters = () => [
995
+ { type: StateMachineService },
996
+ { type: AuthPropService }
997
+ ];
998
+ ConfirmVerifyUserComponent.propDecorators = {
999
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
1000
+ headerText: [{ type: Input }]
1001
+ };
1002
+
1003
+ class AmplifyButtonComponent {
1004
+ constructor() {
1005
+ this.type = 'button';
1006
+ this.fullWidth = false;
1007
+ this.size = 'medium';
1008
+ this.variation = 'default';
1009
+ this.fontWeight = 'normal';
1010
+ this.defaultClass = true;
1011
+ }
1012
+ ngOnInit() {
1013
+ this.typeAttr = this.type;
1014
+ this.fullWidthAttr = this.fullWidth;
1015
+ this.sizeAttr = this.size;
1016
+ this.variationAttr = this.variation;
1017
+ this.fontWeightAttr = this.fontWeight;
1018
+ }
1019
+ }
1020
+ AmplifyButtonComponent.decorators = [
1021
+ { type: Component, args: [{
1022
+ selector: 'button[amplify-button]',
1023
+ template: "<ng-content></ng-content>\n"
1024
+ },] }
1025
+ ];
1026
+ AmplifyButtonComponent.propDecorators = {
1027
+ type: [{ type: Input }],
1028
+ fullWidth: [{ type: Input }],
1029
+ size: [{ type: Input }],
1030
+ variation: [{ type: Input }],
1031
+ fontWeight: [{ type: Input }],
1032
+ typeAttr: [{ type: HostBinding, args: ['type',] }],
1033
+ fullWidthAttr: [{ type: HostBinding, args: ['attr.data-fullwidth',] }],
1034
+ sizeAttr: [{ type: HostBinding, args: ['attr.data-size',] }],
1035
+ variationAttr: [{ type: HostBinding, args: ['attr.data-variation',] }],
1036
+ defaultClass: [{ type: HostBinding, args: ['class.amplify-button',] }],
1037
+ fontWeightAttr: [{ type: HostBinding, args: ['style.font-weight',] }]
1038
+ };
1039
+
1040
+ class AmplifyErrorComponent {
1041
+ }
1042
+ AmplifyErrorComponent.decorators = [
1043
+ { type: Component, args: [{
1044
+ selector: 'amplify-error',
1045
+ template: "<span data-ui-error>\n <ng-content></ng-content>\n</span>\n"
1046
+ },] }
1047
+ ];
1048
+
1049
+ /**
1050
+ * Input interface opinionated for authenticator usage.
1051
+ *
1052
+ * TODO: Separate this component out to two parts -- 1) amplify-auth-input that
1053
+ * contains authenticator opinionated logic and 2) amplify-text-field primitive
1054
+ * that does not make any auth-related inference.
1055
+ */
1056
+ class AmplifyFormFieldComponent {
1057
+ constructor(stateMachine) {
1058
+ this.stateMachine = stateMachine;
1059
+ this.required = true;
1060
+ this.placeholder = '';
1061
+ this.label = '';
1062
+ this.initialValue = '';
1063
+ this.disabled = false;
1064
+ this.autocomplete = '';
1065
+ this.countryDialCodes = countryDialCodes;
1066
+ }
1067
+ ngOnInit() {
1068
+ // TODO: field primtiives should have generate these by default.
1069
+ this.textFieldId = `amplify-field-${nanoid(12)}`;
1070
+ this.selectFieldId = `amplify-field-${nanoid(12)}`;
1071
+ // TODO: consider better default handling mechanisms across frameworks
1072
+ if (this.isPhoneField()) {
1073
+ const state = this.stateMachine.authState;
1074
+ const { country_code } = getActorContext(state);
1075
+ this.defaultCountryCode = country_code;
1076
+ // TODO: remove this side-effect
1077
+ this.stateMachine.send({
1078
+ type: 'CHANGE',
1079
+ data: { name: 'country_code', value: country_code },
1080
+ });
1081
+ }
1082
+ }
1083
+ get attributeMap() {
1084
+ return getAttributeMap();
1085
+ }
1086
+ get error() {
1087
+ const formContext = getActorContext(this.stateMachine.authState);
1088
+ const { validationError } = formContext;
1089
+ return validationError[this.name];
1090
+ }
1091
+ inferLabel() {
1092
+ var _a;
1093
+ const label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
1094
+ return translate(label);
1095
+ }
1096
+ inferPlaceholder() {
1097
+ var _a;
1098
+ const placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
1099
+ this.inferLabel();
1100
+ return translate(placeholder);
1101
+ }
1102
+ // infers what the `type` of underlying input element should be.
1103
+ inferType() {
1104
+ var _a, _b, _c;
1105
+ return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
1106
+ }
1107
+ // TODO(enhancement): use enum to differentiate special field types
1108
+ isPasswordField() {
1109
+ return this.inferType() === 'password';
1110
+ }
1111
+ isPhoneField() {
1112
+ return this.inferType() === 'tel';
1113
+ }
1114
+ }
1115
+ AmplifyFormFieldComponent.decorators = [
1116
+ { type: Component, args: [{
1117
+ selector: 'amplify-form-field',
1118
+ template: "<div class=\"amplify-flex\" style=\"flex-direction: column; gap: 0\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [selectFieldId]=\"selectFieldId\"\n [defaultCountryCode]=\"defaultCountryCode\"\n [textFieldId]=\"textFieldId\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [id]=\"textFieldId\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [id]=\"textFieldId\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
1119
+ },] }
1120
+ ];
1121
+ AmplifyFormFieldComponent.ctorParameters = () => [
1122
+ { type: StateMachineService }
1123
+ ];
1124
+ AmplifyFormFieldComponent.propDecorators = {
1125
+ name: [{ type: Input }],
1126
+ type: [{ type: Input }],
1127
+ required: [{ type: Input }],
1128
+ placeholder: [{ type: Input }],
1129
+ label: [{ type: Input }],
1130
+ initialValue: [{ type: Input }],
1131
+ disabled: [{ type: Input }],
1132
+ autocomplete: [{ type: Input }]
1133
+ };
1134
+
1135
+ class AmplifyPasswordFieldComponent {
1136
+ constructor() {
1137
+ this.autocomplete = 'new-password';
1138
+ this.disabled = false;
1139
+ this.initialValue = '';
1140
+ this.label = '';
1141
+ this.placeholder = '';
1142
+ this.required = true;
1143
+ this.type = 'password';
1144
+ this.showPassword = false;
1145
+ this.showPasswordButtonlabel = translate('Show password');
1146
+ }
1147
+ togglePasswordText() {
1148
+ this.showPassword = !this.showPassword;
1149
+ this.showPasswordButtonlabel = this.showPassword
1150
+ ? translate('Show password')
1151
+ : translate('Hide password');
1152
+ this.type = this.showPassword ? 'text' : 'password';
1153
+ }
1154
+ }
1155
+ AmplifyPasswordFieldComponent.decorators = [
1156
+ { type: Component, args: [{
1157
+ selector: 'amplify-password-field',
1158
+ template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"id\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n</div>\n"
1159
+ },] }
1160
+ ];
1161
+ AmplifyPasswordFieldComponent.propDecorators = {
1162
+ autocomplete: [{ type: Input }],
1163
+ disabled: [{ type: Input }],
1164
+ id: [{ type: Input }],
1165
+ initialValue: [{ type: Input }],
1166
+ label: [{ type: Input }],
1167
+ name: [{ type: Input }],
1168
+ placeholder: [{ type: Input }],
1169
+ required: [{ type: Input }]
1170
+ };
1171
+
1172
+ class AmplifySelectComponent {
1173
+ }
1174
+ AmplifySelectComponent.decorators = [
1175
+ { type: Component, args: [{
1176
+ selector: 'amplify-form-select',
1177
+ template: "<label class=\"amplify-label sr-only\" [for]=\"id\">{{ label }}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon-wrapper\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n"
1178
+ },] }
1179
+ ];
1180
+ AmplifySelectComponent.propDecorators = {
1181
+ items: [{ type: Input }],
1182
+ name: [{ type: Input }],
1183
+ label: [{ type: Input }],
1184
+ id: [{ type: Input }],
1185
+ defaultValue: [{ type: Input }]
1186
+ };
1187
+
1188
+ class TabItemComponent {
1189
+ constructor() {
1190
+ this.active = false;
1191
+ }
1192
+ }
1193
+ TabItemComponent.decorators = [
1194
+ { type: Component, args: [{
1195
+ selector: 'amplify-tab-item',
1196
+ template: "<div\n data-orientation=\"horizontal\"\n role=\"tabpanel\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.data-state]=\"active ? 'active' : 'inactive'\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n"
1197
+ },] }
1198
+ ];
1199
+ TabItemComponent.propDecorators = {
1200
+ title: [{ type: Input }],
1201
+ active: [{ type: Input }],
1202
+ id: [{ type: Input }],
1203
+ labelledById: [{ type: Input }],
1204
+ tabIndex: [{ type: Input }]
1205
+ };
1206
+
1207
+ class TabsComponent {
1208
+ constructor() {
1209
+ this.tabChange = new EventEmitter();
1210
+ }
1211
+ ngAfterContentInit() {
1212
+ // assign ids
1213
+ this.tabs.forEach((tab, index) => {
1214
+ tab.id = `radix-id-${nanoid(12)}-1-content-${index}`;
1215
+ tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
1216
+ });
1217
+ // find active tab
1218
+ // TODO(enhancement): more declarative way for choosing the initial tab to render
1219
+ const activeTabs = this.tabs.filter((tab) => tab.active);
1220
+ // set active tab
1221
+ if (activeTabs.length !== 1) {
1222
+ this.selectTab(this.tabs.first);
1223
+ }
1224
+ }
1225
+ selectTab(tab) {
1226
+ this.tabs.forEach((tab) => {
1227
+ tab.active = false;
1228
+ });
1229
+ tab.active = true;
1230
+ }
1231
+ handleTabClick(tab) {
1232
+ if (tab.active)
1233
+ return; // don't do anything if clicks the current active tab
1234
+ this.tabChange.emit();
1235
+ this.selectTab(tab);
1236
+ }
1237
+ }
1238
+ TabsComponent.decorators = [
1239
+ { type: Component, args: [{
1240
+ selector: 'amplify-tabs',
1241
+ template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
1242
+ },] }
1243
+ ];
1244
+ TabsComponent.propDecorators = {
1245
+ tabs: [{ type: ContentChildren, args: [TabItemComponent,] }],
1246
+ tabChange: [{ type: Output }]
1247
+ };
1248
+
1249
+ class AmplifyTextFieldComponent {
1250
+ constructor() {
1251
+ this.autocomplete = 'new-password';
1252
+ this.disabled = false;
1253
+ this.initialValue = '';
1254
+ this.label = '';
1255
+ this.placeholder = '';
1256
+ this.required = true;
1257
+ }
1258
+ }
1259
+ AmplifyTextFieldComponent.decorators = [
1260
+ { type: Component, args: [{
1261
+ selector: 'amplify-text-field',
1262
+ template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"id\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n/>\n"
1263
+ },] }
1264
+ ];
1265
+ AmplifyTextFieldComponent.propDecorators = {
1266
+ autocomplete: [{ type: Input }],
1267
+ disabled: [{ type: Input }],
1268
+ id: [{ type: Input }],
1269
+ initialValue: [{ type: Input }],
1270
+ label: [{ type: Input }],
1271
+ name: [{ type: Input }],
1272
+ placeholder: [{ type: Input }],
1273
+ required: [{ type: Input }],
1274
+ type: [{ type: Input }]
1275
+ };
1276
+
1277
+ class AmplifyUserNameAliasComponent {
1278
+ constructor(stateMachine) {
1279
+ this.stateMachine = stateMachine;
1280
+ this.name = 'username';
1281
+ this.disabled = false;
1282
+ this.initialValue = '';
1283
+ this.required = true;
1284
+ }
1285
+ ngOnInit() {
1286
+ const context = this.stateMachine.context;
1287
+ const { label, type } = getAliasInfoFromContext(context);
1288
+ this.label = label;
1289
+ this.type = type;
1290
+ this.placeholder = label;
1291
+ }
1292
+ }
1293
+ AmplifyUserNameAliasComponent.decorators = [
1294
+ { type: Component, args: [{
1295
+ selector: 'amplify-user-name-alias',
1296
+ template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [label]=\"label\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
1297
+ },] }
1298
+ ];
1299
+ AmplifyUserNameAliasComponent.ctorParameters = () => [
1300
+ { type: StateMachineService }
1301
+ ];
1302
+ AmplifyUserNameAliasComponent.propDecorators = {
1303
+ name: [{ type: Input }],
1304
+ disabled: [{ type: Input }],
1305
+ initialValue: [{ type: Input }],
1306
+ required: [{ type: Input }]
1307
+ };
1308
+
1309
+ const proxyInputs = (Cmp, inputs) => {
1310
+ const Prototype = Cmp.prototype;
1311
+ inputs.forEach((item) => {
1312
+ Object.defineProperty(Prototype, item, {
1313
+ get() {
1314
+ return this.el[item];
1315
+ },
1316
+ set(val) {
1317
+ this.z.runOutsideAngular(() => (this.el[item] = val));
1318
+ },
1319
+ });
1320
+ });
1321
+ };
1322
+ const proxyMethods = (Cmp, methods) => {
1323
+ const Prototype = Cmp.prototype;
1324
+ methods.forEach((methodName) => {
1325
+ Prototype[methodName] = function () {
1326
+ const args = arguments;
1327
+ return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
1328
+ };
1329
+ });
1330
+ };
1331
+ const proxyOutputs = (instance, el, events) => {
1332
+ events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
1333
+ };
1334
+ // tslint:disable-next-line: only-arrow-functions
1335
+ function ProxyCmp(opts) {
1336
+ const decorator = function (cls) {
1337
+ if (opts.inputs) {
1338
+ proxyInputs(cls, opts.inputs);
1339
+ }
1340
+ if (opts.methods) {
1341
+ proxyMethods(cls, opts.methods);
1342
+ }
1343
+ return cls;
1344
+ };
1345
+ return decorator;
1346
+ }
1347
+ let AmplifyAmazonButton = class AmplifyAmazonButton {
1348
+ constructor(c, r, z) {
1349
+ this.z = z;
1350
+ c.detach();
1351
+ this.el = r.nativeElement;
1352
+ }
1353
+ };
1354
+ AmplifyAmazonButton.decorators = [
1355
+ { type: Component, args: [{
1356
+ selector: 'amplify-amazon-button',
1357
+ changeDetection: ChangeDetectionStrategy.OnPush,
1358
+ template: '<ng-content></ng-content>',
1359
+ inputs: ['clientId', 'handleAuthStateChange']
1360
+ },] }
1361
+ ];
1362
+ AmplifyAmazonButton.ctorParameters = () => [
1363
+ { type: ChangeDetectorRef },
1364
+ { type: ElementRef },
1365
+ { type: NgZone }
1366
+ ];
1367
+ AmplifyAmazonButton = __decorate([
1368
+ ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
1369
+ ], AmplifyAmazonButton);
1370
+ class AmplifyAuthContainer {
1371
+ constructor(c, r, z) {
1372
+ this.z = z;
1373
+ c.detach();
1374
+ this.el = r.nativeElement;
1375
+ }
1376
+ }
1377
+ AmplifyAuthContainer.decorators = [
1378
+ { type: Component, args: [{
1379
+ selector: 'amplify-auth-container',
1380
+ changeDetection: ChangeDetectionStrategy.OnPush,
1381
+ template: '<ng-content></ng-content>'
1382
+ },] }
1383
+ ];
1384
+ AmplifyAuthContainer.ctorParameters = () => [
1385
+ { type: ChangeDetectorRef },
1386
+ { type: ElementRef },
1387
+ { type: NgZone }
1388
+ ];
1389
+ let AmplifyAuthFields = class AmplifyAuthFields {
1390
+ constructor(c, r, z) {
1391
+ this.z = z;
1392
+ c.detach();
1393
+ this.el = r.nativeElement;
1394
+ }
1395
+ };
1396
+ AmplifyAuthFields.decorators = [
1397
+ { type: Component, args: [{
1398
+ selector: 'amplify-auth-fields',
1399
+ changeDetection: ChangeDetectionStrategy.OnPush,
1400
+ template: '<ng-content></ng-content>',
1401
+ inputs: ['formFields']
1402
+ },] }
1403
+ ];
1404
+ AmplifyAuthFields.ctorParameters = () => [
1405
+ { type: ChangeDetectorRef },
1406
+ { type: ElementRef },
1407
+ { type: NgZone }
1408
+ ];
1409
+ AmplifyAuthFields = __decorate([
1410
+ ProxyCmp({ inputs: ['formFields'] })
1411
+ ], AmplifyAuthFields);
1412
+ let AmplifyAuth0Button = class AmplifyAuth0Button {
1413
+ constructor(c, r, z) {
1414
+ this.z = z;
1415
+ c.detach();
1416
+ this.el = r.nativeElement;
1417
+ }
1418
+ };
1419
+ AmplifyAuth0Button.decorators = [
1420
+ { type: Component, args: [{
1421
+ selector: 'amplify-auth0-button',
1422
+ changeDetection: ChangeDetectionStrategy.OnPush,
1423
+ template: '<ng-content></ng-content>',
1424
+ inputs: ['config', 'handleAuthStateChange']
1425
+ },] }
1426
+ ];
1427
+ AmplifyAuth0Button.ctorParameters = () => [
1428
+ { type: ChangeDetectorRef },
1429
+ { type: ElementRef },
1430
+ { type: NgZone }
1431
+ ];
1432
+ AmplifyAuth0Button = __decorate([
1433
+ ProxyCmp({ inputs: ['config', 'handleAuthStateChange'] })
1434
+ ], AmplifyAuth0Button);
1435
+ let AmplifyAuthenticator = class AmplifyAuthenticator {
1436
+ constructor(c, r, z) {
1437
+ this.z = z;
1438
+ c.detach();
1439
+ this.el = r.nativeElement;
1440
+ }
1441
+ };
1442
+ AmplifyAuthenticator.decorators = [
1443
+ { type: Component, args: [{
1444
+ selector: 'amplify-authenticator',
1445
+ changeDetection: ChangeDetectionStrategy.OnPush,
1446
+ template: '<ng-content></ng-content>',
1447
+ inputs: [
1448
+ 'federated',
1449
+ 'handleAuthStateChange',
1450
+ 'hideToast',
1451
+ 'initialAuthState',
1452
+ 'usernameAlias',
1453
+ ]
1454
+ },] }
1455
+ ];
1456
+ AmplifyAuthenticator.ctorParameters = () => [
1457
+ { type: ChangeDetectorRef },
1458
+ { type: ElementRef },
1459
+ { type: NgZone }
1460
+ ];
1461
+ AmplifyAuthenticator = __decorate([
1462
+ ProxyCmp({
1463
+ inputs: [
1464
+ 'federated',
1465
+ 'handleAuthStateChange',
1466
+ 'hideToast',
1467
+ 'initialAuthState',
1468
+ 'usernameAlias',
1469
+ ],
1470
+ })
1471
+ ], AmplifyAuthenticator);
1472
+ let AmplifyButton = class AmplifyButton {
1473
+ constructor(c, r, z) {
1474
+ this.z = z;
1475
+ c.detach();
1476
+ this.el = r.nativeElement;
1477
+ }
1478
+ };
1479
+ AmplifyButton.decorators = [
1480
+ { type: Component, args: [{
1481
+ selector: 'amplify-button',
1482
+ changeDetection: ChangeDetectionStrategy.OnPush,
1483
+ template: '<ng-content></ng-content>',
1484
+ inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant']
1485
+ },] }
1486
+ ];
1487
+ AmplifyButton.ctorParameters = () => [
1488
+ { type: ChangeDetectorRef },
1489
+ { type: ElementRef },
1490
+ { type: NgZone }
1491
+ ];
1492
+ AmplifyButton = __decorate([
1493
+ ProxyCmp({
1494
+ inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant'],
1495
+ })
1496
+ ], AmplifyButton);
1497
+ let AmplifyChatbot = class AmplifyChatbot {
1498
+ constructor(c, r, z) {
1499
+ this.z = z;
1500
+ c.detach();
1501
+ this.el = r.nativeElement;
1502
+ proxyOutputs(this, this.el, ['chatCompleted']);
1503
+ }
1504
+ };
1505
+ AmplifyChatbot.decorators = [
1506
+ { type: Component, args: [{
1507
+ selector: 'amplify-chatbot',
1508
+ changeDetection: ChangeDetectionStrategy.OnPush,
1509
+ template: '<ng-content></ng-content>',
1510
+ inputs: [
1511
+ 'botName',
1512
+ 'botTitle',
1513
+ 'clearOnComplete',
1514
+ 'conversationModeOn',
1515
+ 'silenceThreshold',
1516
+ 'silenceTime',
1517
+ 'textEnabled',
1518
+ 'voiceEnabled',
1519
+ 'welcomeMessage',
1520
+ ]
1521
+ },] }
1522
+ ];
1523
+ AmplifyChatbot.ctorParameters = () => [
1524
+ { type: ChangeDetectorRef },
1525
+ { type: ElementRef },
1526
+ { type: NgZone }
1527
+ ];
1528
+ AmplifyChatbot = __decorate([
1529
+ ProxyCmp({
1530
+ inputs: [
1531
+ 'botName',
1532
+ 'botTitle',
1533
+ 'clearOnComplete',
1534
+ 'conversationModeOn',
1535
+ 'silenceThreshold',
1536
+ 'silenceTime',
1537
+ 'textEnabled',
1538
+ 'voiceEnabled',
1539
+ 'welcomeMessage',
1540
+ ],
1541
+ })
1542
+ ], AmplifyChatbot);
1543
+ let AmplifyCheckbox = class AmplifyCheckbox {
1544
+ constructor(c, r, z) {
1545
+ this.z = z;
1546
+ c.detach();
1547
+ this.el = r.nativeElement;
1548
+ }
1549
+ };
1550
+ AmplifyCheckbox.decorators = [
1551
+ { type: Component, args: [{
1552
+ selector: 'amplify-checkbox',
1553
+ changeDetection: ChangeDetectionStrategy.OnPush,
1554
+ template: '<ng-content></ng-content>',
1555
+ inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value']
1556
+ },] }
1557
+ ];
1558
+ AmplifyCheckbox.ctorParameters = () => [
1559
+ { type: ChangeDetectorRef },
1560
+ { type: ElementRef },
1561
+ { type: NgZone }
1562
+ ];
1563
+ AmplifyCheckbox = __decorate([
1564
+ ProxyCmp({
1565
+ inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value'],
1566
+ })
1567
+ ], AmplifyCheckbox);
1568
+ let AmplifyCodeField = class AmplifyCodeField {
1569
+ constructor(c, r, z) {
1570
+ this.z = z;
1571
+ c.detach();
1572
+ this.el = r.nativeElement;
1573
+ }
1574
+ };
1575
+ AmplifyCodeField.decorators = [
1576
+ { type: Component, args: [{
1577
+ selector: 'amplify-code-field',
1578
+ changeDetection: ChangeDetectionStrategy.OnPush,
1579
+ template: '<ng-content></ng-content>',
1580
+ inputs: [
1581
+ 'disabled',
1582
+ 'fieldId',
1583
+ 'handleInputChange',
1584
+ 'hint',
1585
+ 'inputProps',
1586
+ 'label',
1587
+ 'placeholder',
1588
+ 'required',
1589
+ 'value',
1590
+ ]
1591
+ },] }
1592
+ ];
1593
+ AmplifyCodeField.ctorParameters = () => [
1594
+ { type: ChangeDetectorRef },
1595
+ { type: ElementRef },
1596
+ { type: NgZone }
1597
+ ];
1598
+ AmplifyCodeField = __decorate([
1599
+ ProxyCmp({
1600
+ inputs: [
1601
+ 'disabled',
1602
+ 'fieldId',
1603
+ 'handleInputChange',
1604
+ 'hint',
1605
+ 'inputProps',
1606
+ 'label',
1607
+ 'placeholder',
1608
+ 'required',
1609
+ 'value',
1610
+ ],
1611
+ })
1612
+ ], AmplifyCodeField);
1613
+ let AmplifyConfirmSignIn = class AmplifyConfirmSignIn {
1614
+ constructor(c, r, z) {
1615
+ this.z = z;
1616
+ c.detach();
1617
+ this.el = r.nativeElement;
1618
+ }
1619
+ };
1620
+ AmplifyConfirmSignIn.decorators = [
1621
+ { type: Component, args: [{
1622
+ selector: 'amplify-confirm-sign-in',
1623
+ changeDetection: ChangeDetectionStrategy.OnPush,
1624
+ template: '<ng-content></ng-content>',
1625
+ inputs: [
1626
+ 'formFields',
1627
+ 'handleAuthStateChange',
1628
+ 'handleSubmit',
1629
+ 'headerText',
1630
+ 'submitButtonText',
1631
+ 'user',
1632
+ ]
1633
+ },] }
1634
+ ];
1635
+ AmplifyConfirmSignIn.ctorParameters = () => [
1636
+ { type: ChangeDetectorRef },
1637
+ { type: ElementRef },
1638
+ { type: NgZone }
1639
+ ];
1640
+ AmplifyConfirmSignIn = __decorate([
1641
+ ProxyCmp({
1642
+ inputs: [
1643
+ 'formFields',
1644
+ 'handleAuthStateChange',
1645
+ 'handleSubmit',
1646
+ 'headerText',
1647
+ 'submitButtonText',
1648
+ 'user',
1649
+ ],
1650
+ })
1651
+ ], AmplifyConfirmSignIn);
1652
+ let AmplifyConfirmSignUp = class AmplifyConfirmSignUp {
1653
+ constructor(c, r, z) {
1654
+ this.z = z;
1655
+ c.detach();
1656
+ this.el = r.nativeElement;
1657
+ }
1658
+ };
1659
+ AmplifyConfirmSignUp.decorators = [
1660
+ { type: Component, args: [{
1661
+ selector: 'amplify-confirm-sign-up',
1662
+ changeDetection: ChangeDetectionStrategy.OnPush,
1663
+ template: '<ng-content></ng-content>',
1664
+ inputs: [
1665
+ 'formFields',
1666
+ 'handleAuthStateChange',
1667
+ 'handleSubmit',
1668
+ 'headerText',
1669
+ 'submitButtonText',
1670
+ 'user',
1671
+ 'usernameAlias',
1672
+ ]
1673
+ },] }
1674
+ ];
1675
+ AmplifyConfirmSignUp.ctorParameters = () => [
1676
+ { type: ChangeDetectorRef },
1677
+ { type: ElementRef },
1678
+ { type: NgZone }
1679
+ ];
1680
+ AmplifyConfirmSignUp = __decorate([
1681
+ ProxyCmp({
1682
+ inputs: [
1683
+ 'formFields',
1684
+ 'handleAuthStateChange',
1685
+ 'handleSubmit',
1686
+ 'headerText',
1687
+ 'submitButtonText',
1688
+ 'user',
1689
+ 'usernameAlias',
1690
+ ],
1691
+ })
1692
+ ], AmplifyConfirmSignUp);
1693
+ class AmplifyContainer {
1694
+ constructor(c, r, z) {
1695
+ this.z = z;
1696
+ c.detach();
1697
+ this.el = r.nativeElement;
1698
+ }
1699
+ }
1700
+ AmplifyContainer.decorators = [
1701
+ { type: Component, args: [{
1702
+ selector: 'amplify-container',
1703
+ changeDetection: ChangeDetectionStrategy.OnPush,
1704
+ template: '<ng-content></ng-content>'
1705
+ },] }
1706
+ ];
1707
+ AmplifyContainer.ctorParameters = () => [
1708
+ { type: ChangeDetectorRef },
1709
+ { type: ElementRef },
1710
+ { type: NgZone }
1711
+ ];
1712
+ let AmplifyCountryDialCode = class AmplifyCountryDialCode {
1713
+ constructor(c, r, z) {
1714
+ this.z = z;
1715
+ c.detach();
1716
+ this.el = r.nativeElement;
1717
+ }
1718
+ };
1719
+ AmplifyCountryDialCode.decorators = [
1720
+ { type: Component, args: [{
1721
+ selector: 'amplify-country-dial-code',
1722
+ changeDetection: ChangeDetectionStrategy.OnPush,
1723
+ template: '<ng-content></ng-content>',
1724
+ inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options']
1725
+ },] }
1726
+ ];
1727
+ AmplifyCountryDialCode.ctorParameters = () => [
1728
+ { type: ChangeDetectorRef },
1729
+ { type: ElementRef },
1730
+ { type: NgZone }
1731
+ ];
1732
+ AmplifyCountryDialCode = __decorate([
1733
+ ProxyCmp({ inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options'] })
1734
+ ], AmplifyCountryDialCode);
1735
+ let AmplifyEmailField = class AmplifyEmailField {
1736
+ constructor(c, r, z) {
1737
+ this.z = z;
1738
+ c.detach();
1739
+ this.el = r.nativeElement;
1740
+ }
1741
+ };
1742
+ AmplifyEmailField.decorators = [
1743
+ { type: Component, args: [{
1744
+ selector: 'amplify-email-field',
1745
+ changeDetection: ChangeDetectionStrategy.OnPush,
1746
+ template: '<ng-content></ng-content>',
1747
+ inputs: [
1748
+ 'disabled',
1749
+ 'fieldId',
1750
+ 'handleInputChange',
1751
+ 'hint',
1752
+ 'inputProps',
1753
+ 'label',
1754
+ 'placeholder',
1755
+ 'required',
1756
+ 'value',
1757
+ ]
1758
+ },] }
1759
+ ];
1760
+ AmplifyEmailField.ctorParameters = () => [
1761
+ { type: ChangeDetectorRef },
1762
+ { type: ElementRef },
1763
+ { type: NgZone }
1764
+ ];
1765
+ AmplifyEmailField = __decorate([
1766
+ ProxyCmp({
1767
+ inputs: [
1768
+ 'disabled',
1769
+ 'fieldId',
1770
+ 'handleInputChange',
1771
+ 'hint',
1772
+ 'inputProps',
1773
+ 'label',
1774
+ 'placeholder',
1775
+ 'required',
1776
+ 'value',
1777
+ ],
1778
+ })
1779
+ ], AmplifyEmailField);
1780
+ let AmplifyFacebookButton = class AmplifyFacebookButton {
1781
+ constructor(c, r, z) {
1782
+ this.z = z;
1783
+ c.detach();
1784
+ this.el = r.nativeElement;
1785
+ }
1786
+ };
1787
+ AmplifyFacebookButton.decorators = [
1788
+ { type: Component, args: [{
1789
+ selector: 'amplify-facebook-button',
1790
+ changeDetection: ChangeDetectionStrategy.OnPush,
1791
+ template: '<ng-content></ng-content>',
1792
+ inputs: ['appId', 'handleAuthStateChange']
1793
+ },] }
1794
+ ];
1795
+ AmplifyFacebookButton.ctorParameters = () => [
1796
+ { type: ChangeDetectorRef },
1797
+ { type: ElementRef },
1798
+ { type: NgZone }
1799
+ ];
1800
+ AmplifyFacebookButton = __decorate([
1801
+ ProxyCmp({ inputs: ['appId', 'handleAuthStateChange'] })
1802
+ ], AmplifyFacebookButton);
1803
+ let AmplifyFederatedButtons = class AmplifyFederatedButtons {
1804
+ constructor(c, r, z) {
1805
+ this.z = z;
1806
+ c.detach();
1807
+ this.el = r.nativeElement;
1808
+ }
1809
+ };
1810
+ AmplifyFederatedButtons.decorators = [
1811
+ { type: Component, args: [{
1812
+ selector: 'amplify-federated-buttons',
1813
+ changeDetection: ChangeDetectionStrategy.OnPush,
1814
+ template: '<ng-content></ng-content>',
1815
+ inputs: ['authState', 'federated', 'handleAuthStateChange']
1816
+ },] }
1817
+ ];
1818
+ AmplifyFederatedButtons.ctorParameters = () => [
1819
+ { type: ChangeDetectorRef },
1820
+ { type: ElementRef },
1821
+ { type: NgZone }
1822
+ ];
1823
+ AmplifyFederatedButtons = __decorate([
1824
+ ProxyCmp({ inputs: ['authState', 'federated', 'handleAuthStateChange'] })
1825
+ ], AmplifyFederatedButtons);
1826
+ let AmplifyFederatedSignIn = class AmplifyFederatedSignIn {
1827
+ constructor(c, r, z) {
1828
+ this.z = z;
1829
+ c.detach();
1830
+ this.el = r.nativeElement;
1831
+ }
1832
+ };
1833
+ AmplifyFederatedSignIn.decorators = [
1834
+ { type: Component, args: [{
1835
+ selector: 'amplify-federated-sign-in',
1836
+ changeDetection: ChangeDetectionStrategy.OnPush,
1837
+ template: '<ng-content></ng-content>',
1838
+ inputs: ['authState', 'federated']
1839
+ },] }
1840
+ ];
1841
+ AmplifyFederatedSignIn.ctorParameters = () => [
1842
+ { type: ChangeDetectorRef },
1843
+ { type: ElementRef },
1844
+ { type: NgZone }
1845
+ ];
1846
+ AmplifyFederatedSignIn = __decorate([
1847
+ ProxyCmp({ inputs: ['authState', 'federated'] })
1848
+ ], AmplifyFederatedSignIn);
1849
+ let AmplifyForgotPassword = class AmplifyForgotPassword {
1850
+ constructor(c, r, z) {
1851
+ this.z = z;
1852
+ c.detach();
1853
+ this.el = r.nativeElement;
1854
+ }
1855
+ };
1856
+ AmplifyForgotPassword.decorators = [
1857
+ { type: Component, args: [{
1858
+ selector: 'amplify-forgot-password',
1859
+ changeDetection: ChangeDetectionStrategy.OnPush,
1860
+ template: '<ng-content></ng-content>',
1861
+ inputs: [
1862
+ 'formFields',
1863
+ 'handleAuthStateChange',
1864
+ 'handleSend',
1865
+ 'handleSubmit',
1866
+ 'headerText',
1867
+ 'sendButtonText',
1868
+ 'submitButtonText',
1869
+ 'usernameAlias',
1870
+ ]
1871
+ },] }
1872
+ ];
1873
+ AmplifyForgotPassword.ctorParameters = () => [
1874
+ { type: ChangeDetectorRef },
1875
+ { type: ElementRef },
1876
+ { type: NgZone }
1877
+ ];
1878
+ AmplifyForgotPassword = __decorate([
1879
+ ProxyCmp({
1880
+ inputs: [
1881
+ 'formFields',
1882
+ 'handleAuthStateChange',
1883
+ 'handleSend',
1884
+ 'handleSubmit',
1885
+ 'headerText',
1886
+ 'sendButtonText',
1887
+ 'submitButtonText',
1888
+ 'usernameAlias',
1889
+ ],
1890
+ })
1891
+ ], AmplifyForgotPassword);
1892
+ let AmplifyFormField = class AmplifyFormField {
1893
+ constructor(c, r, z) {
1894
+ this.z = z;
1895
+ c.detach();
1896
+ this.el = r.nativeElement;
1897
+ }
1898
+ };
1899
+ AmplifyFormField.decorators = [
1900
+ { type: Component, args: [{
1901
+ selector: 'amplify-form-field',
1902
+ changeDetection: ChangeDetectionStrategy.OnPush,
1903
+ template: '<ng-content></ng-content>',
1904
+ inputs: [
1905
+ 'description',
1906
+ 'disabled',
1907
+ 'fieldId',
1908
+ 'handleInputChange',
1909
+ 'hint',
1910
+ 'inputProps',
1911
+ 'label',
1912
+ 'name',
1913
+ 'placeholder',
1914
+ 'required',
1915
+ 'type',
1916
+ 'value',
1917
+ ]
1918
+ },] }
1919
+ ];
1920
+ AmplifyFormField.ctorParameters = () => [
1921
+ { type: ChangeDetectorRef },
1922
+ { type: ElementRef },
1923
+ { type: NgZone }
1924
+ ];
1925
+ AmplifyFormField = __decorate([
1926
+ ProxyCmp({
1927
+ inputs: [
1928
+ 'description',
1929
+ 'disabled',
1930
+ 'fieldId',
1931
+ 'handleInputChange',
1932
+ 'hint',
1933
+ 'inputProps',
1934
+ 'label',
1935
+ 'name',
1936
+ 'placeholder',
1937
+ 'required',
1938
+ 'type',
1939
+ 'value',
1940
+ ],
1941
+ })
1942
+ ], AmplifyFormField);
1943
+ let AmplifyFormSection = class AmplifyFormSection {
1944
+ constructor(c, r, z) {
1945
+ this.z = z;
1946
+ c.detach();
1947
+ this.el = r.nativeElement;
1948
+ }
1949
+ };
1950
+ AmplifyFormSection.decorators = [
1951
+ { type: Component, args: [{
1952
+ selector: 'amplify-form-section',
1953
+ changeDetection: ChangeDetectionStrategy.OnPush,
1954
+ template: '<ng-content></ng-content>',
1955
+ inputs: [
1956
+ 'handleSubmit',
1957
+ 'headerText',
1958
+ 'loading',
1959
+ 'secondaryFooterContent',
1960
+ 'submitButtonText',
1961
+ 'testDataPrefix',
1962
+ ]
1963
+ },] }
1964
+ ];
1965
+ AmplifyFormSection.ctorParameters = () => [
1966
+ { type: ChangeDetectorRef },
1967
+ { type: ElementRef },
1968
+ { type: NgZone }
1969
+ ];
1970
+ AmplifyFormSection = __decorate([
1971
+ ProxyCmp({
1972
+ inputs: [
1973
+ 'handleSubmit',
1974
+ 'headerText',
1975
+ 'loading',
1976
+ 'secondaryFooterContent',
1977
+ 'submitButtonText',
1978
+ 'testDataPrefix',
1979
+ ],
1980
+ })
1981
+ ], AmplifyFormSection);
1982
+ let AmplifyGoogleButton = class AmplifyGoogleButton {
1983
+ constructor(c, r, z) {
1984
+ this.z = z;
1985
+ c.detach();
1986
+ this.el = r.nativeElement;
1987
+ }
1988
+ };
1989
+ AmplifyGoogleButton.decorators = [
1990
+ { type: Component, args: [{
1991
+ selector: 'amplify-google-button',
1992
+ changeDetection: ChangeDetectionStrategy.OnPush,
1993
+ template: '<ng-content></ng-content>',
1994
+ inputs: ['clientId', 'handleAuthStateChange']
1995
+ },] }
1996
+ ];
1997
+ AmplifyGoogleButton.ctorParameters = () => [
1998
+ { type: ChangeDetectorRef },
1999
+ { type: ElementRef },
2000
+ { type: NgZone }
2001
+ ];
2002
+ AmplifyGoogleButton = __decorate([
2003
+ ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
2004
+ ], AmplifyGoogleButton);
2005
+ let AmplifyGreetings = class AmplifyGreetings {
2006
+ constructor(c, r, z) {
2007
+ this.z = z;
2008
+ c.detach();
2009
+ this.el = r.nativeElement;
2010
+ }
2011
+ };
2012
+ AmplifyGreetings.decorators = [
2013
+ { type: Component, args: [{
2014
+ selector: 'amplify-greetings',
2015
+ changeDetection: ChangeDetectionStrategy.OnPush,
2016
+ template: '<ng-content></ng-content>',
2017
+ inputs: ['handleAuthStateChange', 'logo', 'username']
2018
+ },] }
2019
+ ];
2020
+ AmplifyGreetings.ctorParameters = () => [
2021
+ { type: ChangeDetectorRef },
2022
+ { type: ElementRef },
2023
+ { type: NgZone }
2024
+ ];
2025
+ AmplifyGreetings = __decorate([
2026
+ ProxyCmp({ inputs: ['handleAuthStateChange', 'logo', 'username'] })
2027
+ ], AmplifyGreetings);
2028
+ class AmplifyHint {
2029
+ constructor(c, r, z) {
2030
+ this.z = z;
2031
+ c.detach();
2032
+ this.el = r.nativeElement;
2033
+ }
2034
+ }
2035
+ AmplifyHint.decorators = [
2036
+ { type: Component, args: [{
2037
+ selector: 'amplify-hint',
2038
+ changeDetection: ChangeDetectionStrategy.OnPush,
2039
+ template: '<ng-content></ng-content>'
2040
+ },] }
2041
+ ];
2042
+ AmplifyHint.ctorParameters = () => [
2043
+ { type: ChangeDetectorRef },
2044
+ { type: ElementRef },
2045
+ { type: NgZone }
2046
+ ];
2047
+ let AmplifyIcon = class AmplifyIcon {
2048
+ constructor(c, r, z) {
2049
+ this.z = z;
2050
+ c.detach();
2051
+ this.el = r.nativeElement;
2052
+ }
2053
+ };
2054
+ AmplifyIcon.decorators = [
2055
+ { type: Component, args: [{
2056
+ selector: 'amplify-icon',
2057
+ changeDetection: ChangeDetectionStrategy.OnPush,
2058
+ template: '<ng-content></ng-content>',
2059
+ inputs: ['name']
2060
+ },] }
2061
+ ];
2062
+ AmplifyIcon.ctorParameters = () => [
2063
+ { type: ChangeDetectorRef },
2064
+ { type: ElementRef },
2065
+ { type: NgZone }
2066
+ ];
2067
+ AmplifyIcon = __decorate([
2068
+ ProxyCmp({ inputs: ['name'] })
2069
+ ], AmplifyIcon);
2070
+ let AmplifyIconButton = class AmplifyIconButton {
2071
+ constructor(c, r, z) {
2072
+ this.z = z;
2073
+ c.detach();
2074
+ this.el = r.nativeElement;
2075
+ }
2076
+ };
2077
+ AmplifyIconButton.decorators = [
2078
+ { type: Component, args: [{
2079
+ selector: 'amplify-icon-button',
2080
+ changeDetection: ChangeDetectionStrategy.OnPush,
2081
+ template: '<ng-content></ng-content>',
2082
+ inputs: ['autoShowTooltip', 'name', 'tooltip']
2083
+ },] }
2084
+ ];
2085
+ AmplifyIconButton.ctorParameters = () => [
2086
+ { type: ChangeDetectorRef },
2087
+ { type: ElementRef },
2088
+ { type: NgZone }
2089
+ ];
2090
+ AmplifyIconButton = __decorate([
2091
+ ProxyCmp({ inputs: ['autoShowTooltip', 'name', 'tooltip'] })
2092
+ ], AmplifyIconButton);
2093
+ let AmplifyInput = class AmplifyInput {
2094
+ constructor(c, r, z) {
2095
+ this.z = z;
2096
+ c.detach();
2097
+ this.el = r.nativeElement;
2098
+ }
2099
+ };
2100
+ AmplifyInput.decorators = [
2101
+ { type: Component, args: [{
2102
+ selector: 'amplify-input',
2103
+ changeDetection: ChangeDetectionStrategy.OnPush,
2104
+ template: '<ng-content></ng-content>',
2105
+ inputs: [
2106
+ 'description',
2107
+ 'disabled',
2108
+ 'fieldId',
2109
+ 'handleInputChange',
2110
+ 'inputProps',
2111
+ 'name',
2112
+ 'placeholder',
2113
+ 'required',
2114
+ 'type',
2115
+ 'value',
2116
+ ]
2117
+ },] }
2118
+ ];
2119
+ AmplifyInput.ctorParameters = () => [
2120
+ { type: ChangeDetectorRef },
2121
+ { type: ElementRef },
2122
+ { type: NgZone }
2123
+ ];
2124
+ AmplifyInput = __decorate([
2125
+ ProxyCmp({
2126
+ inputs: [
2127
+ 'description',
2128
+ 'disabled',
2129
+ 'fieldId',
2130
+ 'handleInputChange',
2131
+ 'inputProps',
2132
+ 'name',
2133
+ 'placeholder',
2134
+ 'required',
2135
+ 'type',
2136
+ 'value',
2137
+ ],
2138
+ })
2139
+ ], AmplifyInput);
2140
+ let AmplifyLabel = class AmplifyLabel {
2141
+ constructor(c, r, z) {
2142
+ this.z = z;
2143
+ c.detach();
2144
+ this.el = r.nativeElement;
2145
+ }
2146
+ };
2147
+ AmplifyLabel.decorators = [
2148
+ { type: Component, args: [{
2149
+ selector: 'amplify-label',
2150
+ changeDetection: ChangeDetectionStrategy.OnPush,
2151
+ template: '<ng-content></ng-content>',
2152
+ inputs: ['htmlFor']
2153
+ },] }
2154
+ ];
2155
+ AmplifyLabel.ctorParameters = () => [
2156
+ { type: ChangeDetectorRef },
2157
+ { type: ElementRef },
2158
+ { type: NgZone }
2159
+ ];
2160
+ AmplifyLabel = __decorate([
2161
+ ProxyCmp({ inputs: ['htmlFor'] })
2162
+ ], AmplifyLabel);
2163
+ let AmplifyLink = class AmplifyLink {
2164
+ constructor(c, r, z) {
2165
+ this.z = z;
2166
+ c.detach();
2167
+ this.el = r.nativeElement;
2168
+ }
2169
+ };
2170
+ AmplifyLink.decorators = [
2171
+ { type: Component, args: [{
2172
+ selector: 'amplify-link',
2173
+ changeDetection: ChangeDetectionStrategy.OnPush,
2174
+ template: '<ng-content></ng-content>',
2175
+ inputs: ['role']
2176
+ },] }
2177
+ ];
2178
+ AmplifyLink.ctorParameters = () => [
2179
+ { type: ChangeDetectorRef },
2180
+ { type: ElementRef },
2181
+ { type: NgZone }
2182
+ ];
2183
+ AmplifyLink = __decorate([
2184
+ ProxyCmp({ inputs: ['role'] })
2185
+ ], AmplifyLink);
2186
+ class AmplifyLoadingSpinner {
2187
+ constructor(c, r, z) {
2188
+ this.z = z;
2189
+ c.detach();
2190
+ this.el = r.nativeElement;
2191
+ }
2192
+ }
2193
+ AmplifyLoadingSpinner.decorators = [
2194
+ { type: Component, args: [{
2195
+ selector: 'amplify-loading-spinner',
2196
+ changeDetection: ChangeDetectionStrategy.OnPush,
2197
+ template: '<ng-content></ng-content>'
2198
+ },] }
2199
+ ];
2200
+ AmplifyLoadingSpinner.ctorParameters = () => [
2201
+ { type: ChangeDetectorRef },
2202
+ { type: ElementRef },
2203
+ { type: NgZone }
2204
+ ];
2205
+ class AmplifyNav {
2206
+ constructor(c, r, z) {
2207
+ this.z = z;
2208
+ c.detach();
2209
+ this.el = r.nativeElement;
2210
+ }
2211
+ }
2212
+ AmplifyNav.decorators = [
2213
+ { type: Component, args: [{
2214
+ selector: 'amplify-nav',
2215
+ changeDetection: ChangeDetectionStrategy.OnPush,
2216
+ template: '<ng-content></ng-content>'
2217
+ },] }
2218
+ ];
2219
+ AmplifyNav.ctorParameters = () => [
2220
+ { type: ChangeDetectorRef },
2221
+ { type: ElementRef },
2222
+ { type: NgZone }
2223
+ ];
2224
+ let AmplifyOauthButton = class AmplifyOauthButton {
2225
+ constructor(c, r, z) {
2226
+ this.z = z;
2227
+ c.detach();
2228
+ this.el = r.nativeElement;
2229
+ }
2230
+ };
2231
+ AmplifyOauthButton.decorators = [
2232
+ { type: Component, args: [{
2233
+ selector: 'amplify-oauth-button',
2234
+ changeDetection: ChangeDetectionStrategy.OnPush,
2235
+ template: '<ng-content></ng-content>',
2236
+ inputs: ['config']
2237
+ },] }
2238
+ ];
2239
+ AmplifyOauthButton.ctorParameters = () => [
2240
+ { type: ChangeDetectorRef },
2241
+ { type: ElementRef },
2242
+ { type: NgZone }
2243
+ ];
2244
+ AmplifyOauthButton = __decorate([
2245
+ ProxyCmp({ inputs: ['config'] })
2246
+ ], AmplifyOauthButton);
2247
+ let AmplifyPasswordField = class AmplifyPasswordField {
2248
+ constructor(c, r, z) {
2249
+ this.z = z;
2250
+ c.detach();
2251
+ this.el = r.nativeElement;
2252
+ }
2253
+ };
2254
+ AmplifyPasswordField.decorators = [
2255
+ { type: Component, args: [{
2256
+ selector: 'amplify-password-field',
2257
+ changeDetection: ChangeDetectionStrategy.OnPush,
2258
+ template: '<ng-content></ng-content>',
2259
+ inputs: [
2260
+ 'disabled',
2261
+ 'fieldId',
2262
+ 'handleInputChange',
2263
+ 'hint',
2264
+ 'inputProps',
2265
+ 'label',
2266
+ 'placeholder',
2267
+ 'required',
2268
+ 'value',
2269
+ ]
2270
+ },] }
2271
+ ];
2272
+ AmplifyPasswordField.ctorParameters = () => [
2273
+ { type: ChangeDetectorRef },
2274
+ { type: ElementRef },
2275
+ { type: NgZone }
2276
+ ];
2277
+ AmplifyPasswordField = __decorate([
2278
+ ProxyCmp({
2279
+ inputs: [
2280
+ 'disabled',
2281
+ 'fieldId',
2282
+ 'handleInputChange',
2283
+ 'hint',
2284
+ 'inputProps',
2285
+ 'label',
2286
+ 'placeholder',
2287
+ 'required',
2288
+ 'value',
2289
+ ],
2290
+ })
2291
+ ], AmplifyPasswordField);
2292
+ let AmplifyPhoneField = class AmplifyPhoneField {
2293
+ constructor(c, r, z) {
2294
+ this.z = z;
2295
+ c.detach();
2296
+ this.el = r.nativeElement;
2297
+ }
2298
+ };
2299
+ AmplifyPhoneField.decorators = [
2300
+ { type: Component, args: [{
2301
+ selector: 'amplify-phone-field',
2302
+ changeDetection: ChangeDetectionStrategy.OnPush,
2303
+ template: '<ng-content></ng-content>',
2304
+ inputs: [
2305
+ 'dialCode',
2306
+ 'disabled',
2307
+ 'fieldId',
2308
+ 'handleInputChange',
2309
+ 'hint',
2310
+ 'inputProps',
2311
+ 'label',
2312
+ 'placeholder',
2313
+ 'required',
2314
+ 'value',
2315
+ ]
2316
+ },] }
2317
+ ];
2318
+ AmplifyPhoneField.ctorParameters = () => [
2319
+ { type: ChangeDetectorRef },
2320
+ { type: ElementRef },
2321
+ { type: NgZone }
2322
+ ];
2323
+ AmplifyPhoneField = __decorate([
2324
+ ProxyCmp({
2325
+ inputs: [
2326
+ 'dialCode',
2327
+ 'disabled',
2328
+ 'fieldId',
2329
+ 'handleInputChange',
2330
+ 'hint',
2331
+ 'inputProps',
2332
+ 'label',
2333
+ 'placeholder',
2334
+ 'required',
2335
+ 'value',
2336
+ ],
2337
+ })
2338
+ ], AmplifyPhoneField);
2339
+ let AmplifyPhotoPicker = class AmplifyPhotoPicker {
2340
+ constructor(c, r, z) {
2341
+ this.z = z;
2342
+ c.detach();
2343
+ this.el = r.nativeElement;
2344
+ }
2345
+ };
2346
+ AmplifyPhotoPicker.decorators = [
2347
+ { type: Component, args: [{
2348
+ selector: 'amplify-photo-picker',
2349
+ changeDetection: ChangeDetectionStrategy.OnPush,
2350
+ template: '<ng-content></ng-content>',
2351
+ inputs: [
2352
+ 'buttonText',
2353
+ 'handleClick',
2354
+ 'headerHint',
2355
+ 'headerTitle',
2356
+ 'placeholderHint',
2357
+ 'previewSrc',
2358
+ ]
2359
+ },] }
2360
+ ];
2361
+ AmplifyPhotoPicker.ctorParameters = () => [
2362
+ { type: ChangeDetectorRef },
2363
+ { type: ElementRef },
2364
+ { type: NgZone }
2365
+ ];
2366
+ AmplifyPhotoPicker = __decorate([
2367
+ ProxyCmp({
2368
+ inputs: [
2369
+ 'buttonText',
2370
+ 'handleClick',
2371
+ 'headerHint',
2372
+ 'headerTitle',
2373
+ 'placeholderHint',
2374
+ 'previewSrc',
2375
+ ],
2376
+ })
2377
+ ], AmplifyPhotoPicker);
2378
+ let AmplifyPicker = class AmplifyPicker {
2379
+ constructor(c, r, z) {
2380
+ this.z = z;
2381
+ c.detach();
2382
+ this.el = r.nativeElement;
2383
+ }
2384
+ };
2385
+ AmplifyPicker.decorators = [
2386
+ { type: Component, args: [{
2387
+ selector: 'amplify-picker',
2388
+ changeDetection: ChangeDetectionStrategy.OnPush,
2389
+ template: '<ng-content></ng-content>',
2390
+ inputs: ['acceptValue', 'inputHandler', 'pickerText']
2391
+ },] }
2392
+ ];
2393
+ AmplifyPicker.ctorParameters = () => [
2394
+ { type: ChangeDetectorRef },
2395
+ { type: ElementRef },
2396
+ { type: NgZone }
2397
+ ];
2398
+ AmplifyPicker = __decorate([
2399
+ ProxyCmp({ inputs: ['acceptValue', 'inputHandler', 'pickerText'] })
2400
+ ], AmplifyPicker);
2401
+ let AmplifyRadioButton = class AmplifyRadioButton {
2402
+ constructor(c, r, z) {
2403
+ this.z = z;
2404
+ c.detach();
2405
+ this.el = r.nativeElement;
2406
+ }
2407
+ };
2408
+ AmplifyRadioButton.decorators = [
2409
+ { type: Component, args: [{
2410
+ selector: 'amplify-radio-button',
2411
+ changeDetection: ChangeDetectionStrategy.OnPush,
2412
+ template: '<ng-content></ng-content>',
2413
+ inputs: [
2414
+ 'checked',
2415
+ 'disabled',
2416
+ 'fieldId',
2417
+ 'handleInputChange',
2418
+ 'inputProps',
2419
+ 'label',
2420
+ 'name',
2421
+ 'placeholder',
2422
+ 'value',
2423
+ ]
2424
+ },] }
2425
+ ];
2426
+ AmplifyRadioButton.ctorParameters = () => [
2427
+ { type: ChangeDetectorRef },
2428
+ { type: ElementRef },
2429
+ { type: NgZone }
2430
+ ];
2431
+ AmplifyRadioButton = __decorate([
2432
+ ProxyCmp({
2433
+ inputs: [
2434
+ 'checked',
2435
+ 'disabled',
2436
+ 'fieldId',
2437
+ 'handleInputChange',
2438
+ 'inputProps',
2439
+ 'label',
2440
+ 'name',
2441
+ 'placeholder',
2442
+ 'value',
2443
+ ],
2444
+ })
2445
+ ], AmplifyRadioButton);
2446
+ let AmplifyRequireNewPassword = class AmplifyRequireNewPassword {
2447
+ constructor(c, r, z) {
2448
+ this.z = z;
2449
+ c.detach();
2450
+ this.el = r.nativeElement;
2451
+ }
2452
+ };
2453
+ AmplifyRequireNewPassword.decorators = [
2454
+ { type: Component, args: [{
2455
+ selector: 'amplify-require-new-password',
2456
+ changeDetection: ChangeDetectionStrategy.OnPush,
2457
+ template: '<ng-content></ng-content>',
2458
+ inputs: [
2459
+ 'formFields',
2460
+ 'handleAuthStateChange',
2461
+ 'handleSubmit',
2462
+ 'headerText',
2463
+ 'submitButtonText',
2464
+ 'user',
2465
+ ]
2466
+ },] }
2467
+ ];
2468
+ AmplifyRequireNewPassword.ctorParameters = () => [
2469
+ { type: ChangeDetectorRef },
2470
+ { type: ElementRef },
2471
+ { type: NgZone }
2472
+ ];
2473
+ AmplifyRequireNewPassword = __decorate([
2474
+ ProxyCmp({
2475
+ inputs: [
2476
+ 'formFields',
2477
+ 'handleAuthStateChange',
2478
+ 'handleSubmit',
2479
+ 'headerText',
2480
+ 'submitButtonText',
2481
+ 'user',
2482
+ ],
2483
+ })
2484
+ ], AmplifyRequireNewPassword);
2485
+ let AmplifyS3Album = class AmplifyS3Album {
2486
+ constructor(c, r, z) {
2487
+ this.z = z;
2488
+ c.detach();
2489
+ this.el = r.nativeElement;
2490
+ }
2491
+ };
2492
+ AmplifyS3Album.decorators = [
2493
+ { type: Component, args: [{
2494
+ selector: 'amplify-s3-album',
2495
+ changeDetection: ChangeDetectionStrategy.OnPush,
2496
+ template: '<ng-content></ng-content>',
2497
+ inputs: [
2498
+ 'contentType',
2499
+ 'fileToKey',
2500
+ 'filter',
2501
+ 'handleOnError',
2502
+ 'handleOnLoad',
2503
+ 'identityId',
2504
+ 'level',
2505
+ 'path',
2506
+ 'picker',
2507
+ 'pickerText',
2508
+ 'sort',
2509
+ 'track',
2510
+ ]
2511
+ },] }
2512
+ ];
2513
+ AmplifyS3Album.ctorParameters = () => [
2514
+ { type: ChangeDetectorRef },
2515
+ { type: ElementRef },
2516
+ { type: NgZone }
2517
+ ];
2518
+ AmplifyS3Album = __decorate([
2519
+ ProxyCmp({
2520
+ inputs: [
2521
+ 'contentType',
2522
+ 'fileToKey',
2523
+ 'filter',
2524
+ 'handleOnError',
2525
+ 'handleOnLoad',
2526
+ 'identityId',
2527
+ 'level',
2528
+ 'path',
2529
+ 'picker',
2530
+ 'pickerText',
2531
+ 'sort',
2532
+ 'track',
2533
+ ],
2534
+ })
2535
+ ], AmplifyS3Album);
2536
+ let AmplifyS3Image = class AmplifyS3Image {
2537
+ constructor(c, r, z) {
2538
+ this.z = z;
2539
+ c.detach();
2540
+ this.el = r.nativeElement;
2541
+ }
2542
+ };
2543
+ AmplifyS3Image.decorators = [
2544
+ { type: Component, args: [{
2545
+ selector: 'amplify-s3-image',
2546
+ changeDetection: ChangeDetectionStrategy.OnPush,
2547
+ template: '<ng-content></ng-content>',
2548
+ inputs: [
2549
+ 'alt',
2550
+ 'body',
2551
+ 'contentType',
2552
+ 'handleOnError',
2553
+ 'handleOnLoad',
2554
+ 'identityId',
2555
+ 'imgKey',
2556
+ 'imgProps',
2557
+ 'level',
2558
+ 'path',
2559
+ 'track',
2560
+ ]
2561
+ },] }
2562
+ ];
2563
+ AmplifyS3Image.ctorParameters = () => [
2564
+ { type: ChangeDetectorRef },
2565
+ { type: ElementRef },
2566
+ { type: NgZone }
2567
+ ];
2568
+ AmplifyS3Image = __decorate([
2569
+ ProxyCmp({
2570
+ inputs: [
2571
+ 'alt',
2572
+ 'body',
2573
+ 'contentType',
2574
+ 'handleOnError',
2575
+ 'handleOnLoad',
2576
+ 'identityId',
2577
+ 'imgKey',
2578
+ 'imgProps',
2579
+ 'level',
2580
+ 'path',
2581
+ 'track',
2582
+ ],
2583
+ })
2584
+ ], AmplifyS3Image);
2585
+ let AmplifyS3ImagePicker = class AmplifyS3ImagePicker {
2586
+ constructor(c, r, z) {
2587
+ this.z = z;
2588
+ c.detach();
2589
+ this.el = r.nativeElement;
2590
+ }
2591
+ };
2592
+ AmplifyS3ImagePicker.decorators = [
2593
+ { type: Component, args: [{
2594
+ selector: 'amplify-s3-image-picker',
2595
+ changeDetection: ChangeDetectionStrategy.OnPush,
2596
+ template: '<ng-content></ng-content>',
2597
+ inputs: [
2598
+ 'buttonText',
2599
+ 'contentType',
2600
+ 'fileToKey',
2601
+ 'headerHint',
2602
+ 'headerTitle',
2603
+ 'identityId',
2604
+ 'level',
2605
+ 'path',
2606
+ 'placeholderHint',
2607
+ 'track',
2608
+ ]
2609
+ },] }
2610
+ ];
2611
+ AmplifyS3ImagePicker.ctorParameters = () => [
2612
+ { type: ChangeDetectorRef },
2613
+ { type: ElementRef },
2614
+ { type: NgZone }
2615
+ ];
2616
+ AmplifyS3ImagePicker = __decorate([
2617
+ ProxyCmp({
2618
+ inputs: [
2619
+ 'buttonText',
2620
+ 'contentType',
2621
+ 'fileToKey',
2622
+ 'headerHint',
2623
+ 'headerTitle',
2624
+ 'identityId',
2625
+ 'level',
2626
+ 'path',
2627
+ 'placeholderHint',
2628
+ 'track',
2629
+ ],
2630
+ })
2631
+ ], AmplifyS3ImagePicker);
2632
+ let AmplifyS3Text = class AmplifyS3Text {
2633
+ constructor(c, r, z) {
2634
+ this.z = z;
2635
+ c.detach();
2636
+ this.el = r.nativeElement;
2637
+ }
2638
+ };
2639
+ AmplifyS3Text.decorators = [
2640
+ { type: Component, args: [{
2641
+ selector: 'amplify-s3-text',
2642
+ changeDetection: ChangeDetectionStrategy.OnPush,
2643
+ template: '<ng-content></ng-content>',
2644
+ inputs: [
2645
+ 'body',
2646
+ 'contentType',
2647
+ 'fallbackText',
2648
+ 'identityId',
2649
+ 'level',
2650
+ 'path',
2651
+ 'textKey',
2652
+ 'track',
2653
+ ]
2654
+ },] }
2655
+ ];
2656
+ AmplifyS3Text.ctorParameters = () => [
2657
+ { type: ChangeDetectorRef },
2658
+ { type: ElementRef },
2659
+ { type: NgZone }
2660
+ ];
2661
+ AmplifyS3Text = __decorate([
2662
+ ProxyCmp({
2663
+ inputs: [
2664
+ 'body',
2665
+ 'contentType',
2666
+ 'fallbackText',
2667
+ 'identityId',
2668
+ 'level',
2669
+ 'path',
2670
+ 'textKey',
2671
+ 'track',
2672
+ ],
2673
+ })
2674
+ ], AmplifyS3Text);
2675
+ let AmplifyS3TextPicker = class AmplifyS3TextPicker {
2676
+ constructor(c, r, z) {
2677
+ this.z = z;
2678
+ c.detach();
2679
+ this.el = r.nativeElement;
2680
+ }
2681
+ };
2682
+ AmplifyS3TextPicker.decorators = [
2683
+ { type: Component, args: [{
2684
+ selector: 'amplify-s3-text-picker',
2685
+ changeDetection: ChangeDetectionStrategy.OnPush,
2686
+ template: '<ng-content></ng-content>',
2687
+ inputs: [
2688
+ 'contentType',
2689
+ 'fallbackText',
2690
+ 'fileToKey',
2691
+ 'identityId',
2692
+ 'level',
2693
+ 'path',
2694
+ 'track',
2695
+ ]
2696
+ },] }
2697
+ ];
2698
+ AmplifyS3TextPicker.ctorParameters = () => [
2699
+ { type: ChangeDetectorRef },
2700
+ { type: ElementRef },
2701
+ { type: NgZone }
2702
+ ];
2703
+ AmplifyS3TextPicker = __decorate([
2704
+ ProxyCmp({
2705
+ inputs: [
2706
+ 'contentType',
2707
+ 'fallbackText',
2708
+ 'fileToKey',
2709
+ 'identityId',
2710
+ 'level',
2711
+ 'path',
2712
+ 'track',
2713
+ ],
2714
+ })
2715
+ ], AmplifyS3TextPicker);
2716
+ let AmplifySection = class AmplifySection {
2717
+ constructor(c, r, z) {
2718
+ this.z = z;
2719
+ c.detach();
2720
+ this.el = r.nativeElement;
2721
+ }
2722
+ };
2723
+ AmplifySection.decorators = [
2724
+ { type: Component, args: [{
2725
+ selector: 'amplify-section',
2726
+ changeDetection: ChangeDetectionStrategy.OnPush,
2727
+ template: '<ng-content></ng-content>',
2728
+ inputs: ['role']
2729
+ },] }
2730
+ ];
2731
+ AmplifySection.ctorParameters = () => [
2732
+ { type: ChangeDetectorRef },
2733
+ { type: ElementRef },
2734
+ { type: NgZone }
2735
+ ];
2736
+ AmplifySection = __decorate([
2737
+ ProxyCmp({ inputs: ['role'] })
2738
+ ], AmplifySection);
2739
+ let AmplifySelect = class AmplifySelect {
2740
+ constructor(c, r, z) {
2741
+ this.z = z;
2742
+ c.detach();
2743
+ this.el = r.nativeElement;
2744
+ }
2745
+ };
2746
+ AmplifySelect.decorators = [
2747
+ { type: Component, args: [{
2748
+ selector: 'amplify-select',
2749
+ changeDetection: ChangeDetectionStrategy.OnPush,
2750
+ template: '<ng-content></ng-content>',
2751
+ inputs: ['fieldId', 'handleInputChange', 'options', 'selected']
2752
+ },] }
2753
+ ];
2754
+ AmplifySelect.ctorParameters = () => [
2755
+ { type: ChangeDetectorRef },
2756
+ { type: ElementRef },
2757
+ { type: NgZone }
2758
+ ];
2759
+ AmplifySelect = __decorate([
2760
+ ProxyCmp({ inputs: ['fieldId', 'handleInputChange', 'options', 'selected'] })
2761
+ ], AmplifySelect);
2762
+ let AmplifySelectMfaType = class AmplifySelectMfaType {
2763
+ constructor(c, r, z) {
2764
+ this.z = z;
2765
+ c.detach();
2766
+ this.el = r.nativeElement;
2767
+ }
2768
+ };
2769
+ AmplifySelectMfaType.decorators = [
2770
+ { type: Component, args: [{
2771
+ selector: 'amplify-select-mfa-type',
2772
+ changeDetection: ChangeDetectionStrategy.OnPush,
2773
+ template: '<ng-content></ng-content>',
2774
+ inputs: ['MFATypes', 'authData', 'handleSubmit']
2775
+ },] }
2776
+ ];
2777
+ AmplifySelectMfaType.ctorParameters = () => [
2778
+ { type: ChangeDetectorRef },
2779
+ { type: ElementRef },
2780
+ { type: NgZone }
2781
+ ];
2782
+ AmplifySelectMfaType = __decorate([
2783
+ ProxyCmp({ inputs: ['MFATypes', 'authData', 'handleSubmit'] })
2784
+ ], AmplifySelectMfaType);
2785
+ let AmplifySignIn = class AmplifySignIn {
2786
+ constructor(c, r, z) {
2787
+ this.z = z;
2788
+ c.detach();
2789
+ this.el = r.nativeElement;
2790
+ }
2791
+ };
2792
+ AmplifySignIn.decorators = [
2793
+ { type: Component, args: [{
2794
+ selector: 'amplify-sign-in',
2795
+ changeDetection: ChangeDetectionStrategy.OnPush,
2796
+ template: '<ng-content></ng-content>',
2797
+ inputs: [
2798
+ 'federated',
2799
+ 'formFields',
2800
+ 'handleAuthStateChange',
2801
+ 'handleSubmit',
2802
+ 'headerText',
2803
+ 'hideSignUp',
2804
+ 'submitButtonText',
2805
+ 'usernameAlias',
2806
+ ]
2807
+ },] }
2808
+ ];
2809
+ AmplifySignIn.ctorParameters = () => [
2810
+ { type: ChangeDetectorRef },
2811
+ { type: ElementRef },
2812
+ { type: NgZone }
2813
+ ];
2814
+ AmplifySignIn = __decorate([
2815
+ ProxyCmp({
2816
+ inputs: [
2817
+ 'federated',
2818
+ 'formFields',
2819
+ 'handleAuthStateChange',
2820
+ 'handleSubmit',
2821
+ 'headerText',
2822
+ 'hideSignUp',
2823
+ 'submitButtonText',
2824
+ 'usernameAlias',
2825
+ ],
2826
+ })
2827
+ ], AmplifySignIn);
2828
+ let AmplifySignInButton = class AmplifySignInButton {
2829
+ constructor(c, r, z) {
2830
+ this.z = z;
2831
+ c.detach();
2832
+ this.el = r.nativeElement;
2833
+ }
2834
+ };
2835
+ AmplifySignInButton.decorators = [
2836
+ { type: Component, args: [{
2837
+ selector: 'amplify-sign-in-button',
2838
+ changeDetection: ChangeDetectionStrategy.OnPush,
2839
+ template: '<ng-content></ng-content>',
2840
+ inputs: ['provider']
2841
+ },] }
2842
+ ];
2843
+ AmplifySignInButton.ctorParameters = () => [
2844
+ { type: ChangeDetectorRef },
2845
+ { type: ElementRef },
2846
+ { type: NgZone }
2847
+ ];
2848
+ AmplifySignInButton = __decorate([
2849
+ ProxyCmp({ inputs: ['provider'] })
2850
+ ], AmplifySignInButton);
2851
+ let AmplifySignOut = class AmplifySignOut {
2852
+ constructor(c, r, z) {
2853
+ this.z = z;
2854
+ c.detach();
2855
+ this.el = r.nativeElement;
2856
+ }
2857
+ };
2858
+ AmplifySignOut.decorators = [
2859
+ { type: Component, args: [{
2860
+ selector: 'amplify-sign-out',
2861
+ changeDetection: ChangeDetectionStrategy.OnPush,
2862
+ template: '<ng-content></ng-content>',
2863
+ inputs: ['buttonText', 'handleAuthStateChange']
2864
+ },] }
2865
+ ];
2866
+ AmplifySignOut.ctorParameters = () => [
2867
+ { type: ChangeDetectorRef },
2868
+ { type: ElementRef },
2869
+ { type: NgZone }
2870
+ ];
2871
+ AmplifySignOut = __decorate([
2872
+ ProxyCmp({ inputs: ['buttonText', 'handleAuthStateChange'] })
2873
+ ], AmplifySignOut);
2874
+ let AmplifySignUp = class AmplifySignUp {
2875
+ constructor(c, r, z) {
2876
+ this.z = z;
2877
+ c.detach();
2878
+ this.el = r.nativeElement;
2879
+ }
2880
+ };
2881
+ AmplifySignUp.decorators = [
2882
+ { type: Component, args: [{
2883
+ selector: 'amplify-sign-up',
2884
+ changeDetection: ChangeDetectionStrategy.OnPush,
2885
+ template: '<ng-content></ng-content>',
2886
+ inputs: [
2887
+ 'formFields',
2888
+ 'handleAuthStateChange',
2889
+ 'handleSignUp',
2890
+ 'handleSubmit',
2891
+ 'haveAccountText',
2892
+ 'headerText',
2893
+ 'signInText',
2894
+ 'submitButtonText',
2895
+ 'usernameAlias',
2896
+ 'validationErrors',
2897
+ ]
2898
+ },] }
2899
+ ];
2900
+ AmplifySignUp.ctorParameters = () => [
2901
+ { type: ChangeDetectorRef },
2902
+ { type: ElementRef },
2903
+ { type: NgZone }
2904
+ ];
2905
+ AmplifySignUp = __decorate([
2906
+ ProxyCmp({
2907
+ inputs: [
2908
+ 'formFields',
2909
+ 'handleAuthStateChange',
2910
+ 'handleSignUp',
2911
+ 'handleSubmit',
2912
+ 'haveAccountText',
2913
+ 'headerText',
2914
+ 'signInText',
2915
+ 'submitButtonText',
2916
+ 'usernameAlias',
2917
+ 'validationErrors',
2918
+ ],
2919
+ })
2920
+ ], AmplifySignUp);
2921
+ class AmplifyStrike {
2922
+ constructor(c, r, z) {
2923
+ this.z = z;
2924
+ c.detach();
2925
+ this.el = r.nativeElement;
2926
+ }
2927
+ }
2928
+ AmplifyStrike.decorators = [
2929
+ { type: Component, args: [{
2930
+ selector: 'amplify-strike',
2931
+ changeDetection: ChangeDetectionStrategy.OnPush,
2932
+ template: '<ng-content></ng-content>'
2933
+ },] }
2934
+ ];
2935
+ AmplifyStrike.ctorParameters = () => [
2936
+ { type: ChangeDetectorRef },
2937
+ { type: ElementRef },
2938
+ { type: NgZone }
2939
+ ];
2940
+ let AmplifyToast = class AmplifyToast {
2941
+ constructor(c, r, z) {
2942
+ this.z = z;
2943
+ c.detach();
2944
+ this.el = r.nativeElement;
2945
+ }
2946
+ };
2947
+ AmplifyToast.decorators = [
2948
+ { type: Component, args: [{
2949
+ selector: 'amplify-toast',
2950
+ changeDetection: ChangeDetectionStrategy.OnPush,
2951
+ template: '<ng-content></ng-content>',
2952
+ inputs: ['handleClose', 'message']
2953
+ },] }
2954
+ ];
2955
+ AmplifyToast.ctorParameters = () => [
2956
+ { type: ChangeDetectorRef },
2957
+ { type: ElementRef },
2958
+ { type: NgZone }
2959
+ ];
2960
+ AmplifyToast = __decorate([
2961
+ ProxyCmp({ inputs: ['handleClose', 'message'] })
2962
+ ], AmplifyToast);
2963
+ let AmplifyTooltip = class AmplifyTooltip {
2964
+ constructor(c, r, z) {
2965
+ this.z = z;
2966
+ c.detach();
2967
+ this.el = r.nativeElement;
2968
+ }
2969
+ };
2970
+ AmplifyTooltip.decorators = [
2971
+ { type: Component, args: [{
2972
+ selector: 'amplify-tooltip',
2973
+ changeDetection: ChangeDetectionStrategy.OnPush,
2974
+ template: '<ng-content></ng-content>',
2975
+ inputs: ['shouldAutoShow', 'text']
2976
+ },] }
2977
+ ];
2978
+ AmplifyTooltip.ctorParameters = () => [
2979
+ { type: ChangeDetectorRef },
2980
+ { type: ElementRef },
2981
+ { type: NgZone }
2982
+ ];
2983
+ AmplifyTooltip = __decorate([
2984
+ ProxyCmp({ inputs: ['shouldAutoShow', 'text'] })
2985
+ ], AmplifyTooltip);
2986
+ let AmplifyTotpSetup = class AmplifyTotpSetup {
2987
+ constructor(c, r, z) {
2988
+ this.z = z;
2989
+ c.detach();
2990
+ this.el = r.nativeElement;
2991
+ }
2992
+ };
2993
+ AmplifyTotpSetup.decorators = [
2994
+ { type: Component, args: [{
2995
+ selector: 'amplify-totp-setup',
2996
+ changeDetection: ChangeDetectionStrategy.OnPush,
2997
+ template: '<ng-content></ng-content>',
2998
+ inputs: [
2999
+ 'handleAuthStateChange',
3000
+ 'handleComplete',
3001
+ 'headerText',
3002
+ 'issuer',
3003
+ 'standalone',
3004
+ 'user',
3005
+ ]
3006
+ },] }
3007
+ ];
3008
+ AmplifyTotpSetup.ctorParameters = () => [
3009
+ { type: ChangeDetectorRef },
3010
+ { type: ElementRef },
3011
+ { type: NgZone }
3012
+ ];
3013
+ AmplifyTotpSetup = __decorate([
3014
+ ProxyCmp({
3015
+ inputs: [
3016
+ 'handleAuthStateChange',
3017
+ 'handleComplete',
3018
+ 'headerText',
3019
+ 'issuer',
3020
+ 'standalone',
3021
+ 'user',
3022
+ ],
3023
+ })
3024
+ ], AmplifyTotpSetup);
3025
+ let AmplifyUsernameField = class AmplifyUsernameField {
3026
+ constructor(c, r, z) {
3027
+ this.z = z;
3028
+ c.detach();
3029
+ this.el = r.nativeElement;
3030
+ }
3031
+ };
3032
+ AmplifyUsernameField.decorators = [
3033
+ { type: Component, args: [{
3034
+ selector: 'amplify-username-field',
3035
+ changeDetection: ChangeDetectionStrategy.OnPush,
3036
+ template: '<ng-content></ng-content>',
3037
+ inputs: [
3038
+ 'disabled',
3039
+ 'fieldId',
3040
+ 'handleInputChange',
3041
+ 'hint',
3042
+ 'inputProps',
3043
+ 'label',
3044
+ 'placeholder',
3045
+ 'required',
3046
+ 'value',
3047
+ ]
3048
+ },] }
3049
+ ];
3050
+ AmplifyUsernameField.ctorParameters = () => [
3051
+ { type: ChangeDetectorRef },
3052
+ { type: ElementRef },
3053
+ { type: NgZone }
3054
+ ];
3055
+ AmplifyUsernameField = __decorate([
3056
+ ProxyCmp({
3057
+ inputs: [
3058
+ 'disabled',
3059
+ 'fieldId',
3060
+ 'handleInputChange',
3061
+ 'hint',
3062
+ 'inputProps',
3063
+ 'label',
3064
+ 'placeholder',
3065
+ 'required',
3066
+ 'value',
3067
+ ],
3068
+ })
3069
+ ], AmplifyUsernameField);
3070
+ let AmplifyVerifyContact = class AmplifyVerifyContact {
3071
+ constructor(c, r, z) {
3072
+ this.z = z;
3073
+ c.detach();
3074
+ this.el = r.nativeElement;
3075
+ }
3076
+ };
3077
+ AmplifyVerifyContact.decorators = [
3078
+ { type: Component, args: [{
3079
+ selector: 'amplify-verify-contact',
3080
+ changeDetection: ChangeDetectionStrategy.OnPush,
3081
+ template: '<ng-content></ng-content>',
3082
+ inputs: ['handleAuthStateChange', 'user']
3083
+ },] }
3084
+ ];
3085
+ AmplifyVerifyContact.ctorParameters = () => [
3086
+ { type: ChangeDetectorRef },
3087
+ { type: ElementRef },
3088
+ { type: NgZone }
3089
+ ];
3090
+ AmplifyVerifyContact = __decorate([
3091
+ ProxyCmp({ inputs: ['handleAuthStateChange', 'user'] })
3092
+ ], AmplifyVerifyContact);
3093
+
3094
+ class PhoneNumberFieldComponent {
3095
+ constructor() {
3096
+ this.autocomplete = 'new-password';
3097
+ this.disabled = false;
3098
+ this.initialValue = '';
3099
+ this.label = '';
3100
+ this.placeholder = '';
3101
+ this.required = true;
3102
+ this.countryDialCodes = countryDialCodes;
3103
+ }
3104
+ }
3105
+ PhoneNumberFieldComponent.decorators = [
3106
+ { type: Component, args: [{
3107
+ selector: 'amplify-phone-number-field',
3108
+ template: "<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\" amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <label class=\"sr-only amplify-label\" [for]=\"textFieldId\">\n {{ label }}\n </label>\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
3109
+ },] }
3110
+ ];
3111
+ PhoneNumberFieldComponent.propDecorators = {
3112
+ autocomplete: [{ type: Input }],
3113
+ disabled: [{ type: Input }],
3114
+ defaultCountryCode: [{ type: Input }],
3115
+ selectFieldId: [{ type: Input }],
3116
+ textFieldId: [{ type: Input }],
3117
+ initialValue: [{ type: Input }],
3118
+ label: [{ type: Input }],
3119
+ name: [{ type: Input }],
3120
+ placeholder: [{ type: Input }],
3121
+ required: [{ type: Input }],
3122
+ type: [{ type: Input }]
3123
+ };
3124
+
3125
+ customElements.define('amplify-button', AmplifyButton$1);
3126
+ customElements.define('amplify-input', AmplifyInput$1);
3127
+ customElements.define('amplify-toast', AmplifyToast$1);
3128
+ customElements.define('amplify-chatbot', AmplifyChatbot$1);
3129
+ customElements.define('amplify-s3-album', AmplifyS3Album$1);
3130
+ customElements.define('amplify-s3-image-picker', AmplifyS3ImagePicker$1);
3131
+ customElements.define('amplify-s3-text', AmplifyS3Text$1);
3132
+ customElements.define('amplify-s3-text-picker', AmplifyS3TextPicker$1);
3133
+ customElements.define('amplify-s3-image', AmplifyS3Image$1);
3134
+ customElements.define('amplify-picker', AmplifyPicker$1);
3135
+ customElements.define('amplify-photo-picker', AmplifyPhotoPicker$1);
3136
+ class UiAngularModule {
3137
+ }
3138
+ UiAngularModule.decorators = [
3139
+ { type: NgModule, args: [{
3140
+ declarations: [
3141
+ AmplifyChatbot,
3142
+ AmplifyToast,
3143
+ AmplifyInput,
3144
+ AmplifyButton,
3145
+ AmplifyS3Album,
3146
+ AmplifyS3ImagePicker,
3147
+ AmplifyS3Text,
3148
+ AmplifyS3TextPicker,
3149
+ AmplifyS3Image,
3150
+ AmplifyPicker,
3151
+ AmplifyPhotoPicker,
3152
+ AmplifyAuthenticatorComponent,
3153
+ AmplifySignInComponent,
3154
+ AmplifySignUpComponent,
3155
+ AmplifyFormFieldComponent,
3156
+ AmplifyErrorComponent,
3157
+ AmplifySlotDirective,
3158
+ AmplifyConfirmSignUpComponent,
3159
+ AmplifyUserNameAliasComponent,
3160
+ AmplifyConfirmSignInComponent,
3161
+ AmplifySetupTotpComponent,
3162
+ AmplifyForceNewPasswordComponent,
3163
+ AmplifyFederatedSignInComponent,
3164
+ AmplifyFederatedSignInButtonComponent,
3165
+ AmplifyResetPasswordComponent,
3166
+ AmplifyVerifyUserComponent,
3167
+ ConfirmResetPasswordComponent,
3168
+ ConfirmVerifyUserComponent,
3169
+ AmplifySelectComponent,
3170
+ AmplifyButtonComponent,
3171
+ AmplifyPasswordFieldComponent,
3172
+ AmplifyTextFieldComponent,
3173
+ TabsComponent,
3174
+ TabItemComponent,
3175
+ PhoneNumberFieldComponent,
3176
+ ],
3177
+ imports: [CommonModule],
3178
+ exports: [
3179
+ AmplifyChatbot,
3180
+ AmplifyToast,
3181
+ AmplifyInput,
3182
+ AmplifyButton,
3183
+ AmplifyS3Album,
3184
+ AmplifyS3ImagePicker,
3185
+ AmplifyS3Text,
3186
+ AmplifyS3TextPicker,
3187
+ AmplifyS3Image,
3188
+ AmplifyPicker,
3189
+ AmplifyPhotoPicker,
3190
+ AmplifyAuthenticatorComponent,
3191
+ AmplifySignInComponent,
3192
+ AmplifyFormFieldComponent,
3193
+ AmplifyErrorComponent,
3194
+ AmplifySlotDirective,
3195
+ ],
3196
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
3197
+ },] }
3198
+ ];
3199
+
3200
+ /*
3201
+ * Public API Surface of ui-angular
3202
+ */
3203
+
3204
+ /**
3205
+ * Generated bundle index. Do not edit.
3206
+ */
3207
+
3208
+ export { AmplifyAuthenticatorComponent, AmplifyButton, AmplifyChatbot, AmplifyConfirmSignInComponent, AmplifyConfirmSignUpComponent, AmplifyErrorComponent, AmplifyFederatedSignInButtonComponent, AmplifyFederatedSignInComponent, AmplifyForceNewPasswordComponent, AmplifyFormFieldComponent, AmplifyInput, AmplifyPhotoPicker, AmplifyPicker, AmplifyResetPasswordComponent, AmplifyS3Album, AmplifyS3Image, AmplifyS3ImagePicker, AmplifyS3Text, AmplifyS3TextPicker, AmplifySetupTotpComponent, AmplifySignInComponent, AmplifySignUpComponent, AmplifySlotDirective, AmplifyToast, AmplifyVerifyUserComponent, AuthPropService, ConfirmResetPasswordComponent, ConfirmVerifyUserComponent, StateMachineService, UiAngularModule, getAttributeMap, ProxyCmp as ɵa, AmplifyAuthenticatorComponent as ɵb, AmplifySignInComponent as ɵc, AmplifySignUpComponent as ɵd, AmplifyFormFieldComponent as ɵe, AmplifyErrorComponent as ɵf, AmplifyConfirmSignUpComponent as ɵg, AmplifyUserNameAliasComponent as ɵh, AmplifyConfirmSignInComponent as ɵi, AmplifySetupTotpComponent as ɵj, AmplifyForceNewPasswordComponent as ɵk, AmplifyFederatedSignInComponent as ɵl, AmplifyFederatedSignInButtonComponent as ɵm, AmplifyResetPasswordComponent as ɵn, AmplifyVerifyUserComponent as ɵo, ConfirmResetPasswordComponent as ɵp, ConfirmVerifyUserComponent as ɵq, AmplifySelectComponent as ɵr, AmplifyButtonComponent as ɵs, AmplifyPasswordFieldComponent as ɵt, AmplifyTextFieldComponent as ɵu, TabsComponent as ɵv, TabItemComponent as ɵw, PhoneNumberFieldComponent as ɵx };
3209
+ //# sourceMappingURL=aws-amplify-ui-angular.js.map