{"version":3,"sources":["webpack:///./node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-confirm-sign-in_7.entry.js"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","__spreadArrays","s","i","il","arguments","r","Array","k","a","j","jl","AmplifyConfirmSignIn","class_1","hostRef","_this","handleSubmit","event","confirm","headerText","CONFIRM_SMS_CODE","submitButtonText","CONFIRM","handleAuthStateChange","defaultFormFields","type","required","handleInputChange","handleCodeChange","formFields","mfaOption","SMS","loading","prototype","componentWillLoad","console","warn","setup","userHandler","user","SoftwareTokenMFA","TOTP","CONFIRM_TOTP_CODE","constructedFormFieldOptions","constructFormFieldOptions","code","target","mfaType","error_1","_a","preventDefault","confirmSignIn","Error","content","undefined","forEach","formField","Object","assign","render","get","secondaryFooterContent","variant","onClick","SignIn","BACK_TO_SIGN_IN","defineProperty","enumerable","configurable","AmplifyConfirmSignUp","class_2","confirmSignUp","CONFIRM_SIGN_UP_HEADER_TEXT","CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT","usernameAlias","newFormFields","phoneNumber","countryDialCodeValue","phoneNumberValue","formFieldsHandler","buildFormFields","userInput","username","_signUpAttrs","signUpAttrs","buildDefaultFormFields","handleFormFieldInputChange","disabled","inputProps","autocomplete","CONFIRM_SIGN_UP_CODE_LABEL","placeholder","CONFIRM_SIGN_UP_CODE_PLACEHOLDER","hint","CONFIRM_SIGN_UP_LOST_CODE","resendConfirmCode","CONFIRM_SIGN_UP_RESEND_CODE","newFields_1","field","newField","handleFormFieldInputWithCallback","fieldType","setFieldValue","dialCode","fnToCall","cb","callback","bind","getUsername","error_2","resendSignUp","EMPTY_USERNAME","trim","confirmSignUpResult","error_3","CONFIRM_SIGN_UP_FAILED","password","logger","AmplifyForgotPassword","class_3","RESET_YOUR_PASSWORD","sendButtonText","SEND_CODE","SUBMIT","handleSend","send","submit","delivery","forgotPasswordAttrs","newFields_2","formAttributes","data","error_4","forgotPassword","error","debug","NEW_PASSWORD_LABEL","NEW_PASSWORD_PLACEHOLDER","CodeDeliveryDetails","error_5","_b","forgotPasswordSubmit","submitFn","testDataPrefix","logger$1","AmplifyRequireNewPassword","class_4","CHANGE_PASSWORD","CHANGE_PASSWORD_ACTION","completeNewPassword","Password","handlePasswordChange","requiredAttributes","setCurrentUser","handleRequiredAttributeInputChange","attribute","formatPhoneNumber","error_6","userRequiredAttributes","requiredAttributesMap_1","currentAuthenticatedUser","currentUser","challengeParam","name","composedInput","err","error_7","challengeName","SMSMFA","MFASetup","ConfirmSignIn","TOTPSetup","amplifySignInCss","AmplifySignIn","class_5","signIn","SIGN_IN_HEADER_TEXT","SIGN_IN_ACTION","hideSignUp","signInAttributes","formFieldInputs","FORGOT_PASSWORD_TEXT","ForgotPassword","RESET_PASSWORD_TEXT","newFields_3","slot","federated","class","NO_ACCOUNT_TEXT","SignUp","CREATE_ACCOUNT_TEXT","style","amplifySignUpCss","AmplifySignUp","class_6","signUp","handleSignUp","params","authSignUp","SIGN_UP_HEADER_TEXT","SIGN_UP_SUBMIT_BUTTON_TEXT","haveAccountText","SIGN_UP_HAVE_ACCOUNT_TEXT","signInText","SIGN_IN_TEXT","signUpAttributes","attributes","email","SIGN_UP_FAILED","assignPhoneNumberToSignUpAttributes","phone_number","assignUserNameAliasToSignUpAttributes","assignFormInputToSignUpAttributes","validateSignUpAttributes","EMPTY_EMAIL","EMPTY_PHONE","indexOf","USERNAME_REMOVE_WHITESPACE","PASSWORD_REMOVE_WHITESPACE","error_8","userConfirmed","ConfirmSignUp","SIGN_UP_EMAIL_PLACEHOLDER","SIGN_UP_PASSWORD_PLACEHOLDER","SIGN_UP_USERNAME_PLACEHOLDER","newFields_4","logger$2","AmplifyVerifyContact","class_7","verifyAttr","verify","contact","attr","error_9","verifyCurrentUserAttributeSubmit","SignedIn","error_10","verifyCurrentUserAttribute","inputName","renderSubmit","CODE_PLACEHOLDER","renderVerify","unverified","VERIFY_CONTACT_EMAIL_LABEL","key","VERIFY_CONTACT_PHONE_LABEL","VERIFY_CONTACT_HEADER_TEXT","SKIP","VERIFY_CONTACT_SUBMIT_LABEL","VERIFY_CONTACT_VERIFY_LABEL"],"mappings":"gHAAA,+fAAIA,EAAwC,SAAUC,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,YAGlEO,EAA4C,SAAUlB,EAASmB,GAC/D,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEZ,KAAMkB,EAAK,GAAI,MAASA,EAAK,GAAI,OAAUA,EAAK,IAAwB,oBAAXC,SAA0BP,EAAEO,OAAOC,UAAY,WAAa,OAAOC,OAAUT,EACvJ,SAASM,EAAKI,GAAK,OAAO,SAAUC,GAAK,OAAOxB,EAAK,CAACuB,EAAGC,KACzD,SAASxB,EAAKyB,GACV,GAAIf,EAAG,MAAM,IAAIgB,UAAU,mCAC3B,MAAOZ,EAAG,IACN,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xD,OAAQ,cAAD,CAAG,MAAO,KAAMH,GAAU,cAAD,CAAG,uBAAwB,CAAE9N,MAAO,OAAK2E,IAAI,OAAauL,4BAA6BC,IAAK,QAASjF,KAAM,UAAWtM,MAAO,QAAS8D,kBAAmB,SAAUV,GAAS,OAAOF,EAAMY,kBAAkBV,IAAWuE,WAAY,CAC1P,YAAa,gCACV0H,GAAiB,cAAD,CAAG,uBAAwB,CAAEjO,MAAO,OAAK2E,IAAI,OAAayL,4BAA6BD,IAAK,eAAgBjF,KAAM,UAAWtM,MAAO,eAAgB8D,kBAAmB,SAAUV,GAAS,OAAOF,EAAMY,kBAAkBV,IAAWuE,WAAY,CACnQ,YAAa,yCAGzB4I,EAAQnM,UAAU0B,OAAS,WACvB,IAAI5C,EAAQvB,KACZ,OAAQ,cAAD,CAAG,OAAM,KAAM,eAAE,uBAAwB,CAAEwB,aAAc,SAAUC,GAAS,OAAOF,EAAMC,aAAaC,IAAWE,WAAY,OAAKyC,IAAI,OAAa0L,4BAA6BtN,QAASxC,KAAKwC,QAAS6B,uBAAwB,eAAE,OAAQ,KAAM,eAAE,iBAAkB,CAAEC,QAAS,SAAUC,QAAS,WAAc,OAAOhD,EAAMQ,sBAAsB,OAAUoN,SAAU5N,EAAMwB,OAAU,YAAa,4BAA8B,OAAKqB,IAAI,OAAa2L,QAASlO,iBAAkB7B,KAAK6O,WACpd,OAAKzK,IAAI,OAAa4L,6BACtB,OAAK5L,IAAI,OAAa6L,8BAAgCjQ,KAAK6O,WAAa7O,KAAKuP,eAAiBvP,KAAKyP,kBAE1Gb,EA7H8B","file":"js/chunk-2d226365.3afe3b37.js","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nimport { r as registerInstance, h, H as Host } from './index-83f2275b.js';\nimport { I18n, Logger, ConsoleLogger, isEmpty } from '@aws-amplify/core';\nimport { M as MfaOption, C as ChallengeName, A as AuthState, a as AuthFormField, U as UsernameAlias } from './auth-types-78df304e.js';\nimport { Auth } from '@aws-amplify/auth';\nimport { T as Translations } from './Translations-108d469f.js';\nimport { N as NO_AUTH_MODULE_FOUND, g as COUNTRY_DIAL_CODE_DEFAULT, b as PHONE_SUFFIX } from './constants-c8ecaa24.js';\nimport { d as dispatchAuthStateChangeEvent, a as dispatchToastHubEvent, c as checkUsernameAlias, i as isHintValid, h as handlePhoneNumberChange, b as composePhoneNumberInput, g as getRequiredAttributesMap } from './helpers-14fcb50c.js';\nimport { c as checkContact, h as handleSignIn } from './auth-helpers-557b83fc.js';\nvar AmplifyConfirmSignIn = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when confirm sign in form is submitted */\n this.handleSubmit = function (event) { return _this.confirm(event); };\n /** Used for header text in confirm sign in component */\n this.headerText = Translations.CONFIRM_SMS_CODE;\n /** Used for the submit button text in confirm sign in component */\n this.submitButtonText = Translations.CONFIRM;\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Default form field */\n this.defaultFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: function (event) { return _this.handleCodeChange(event); },\n },\n ];\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = this.defaultFormFields;\n /** The MFA option to confirm with */\n this.mfaOption = MfaOption.SMS;\n /* Whether or not the confirm-sign-in component is loading */\n this.loading = false;\n }\n class_1.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n this.setup();\n };\n class_1.prototype.userHandler = function () {\n this.setup();\n };\n class_1.prototype.setup = function () {\n if (this.user &&\n this.user['challengeName'] === ChallengeName.SoftwareTokenMFA) {\n this.mfaOption = MfaOption.TOTP;\n // If header text is using default use TOTP string\n if (this.headerText === Translations.CONFIRM_SMS_CODE) {\n this.headerText = Translations.CONFIRM_TOTP_CODE;\n }\n }\n this.constructedFormFieldOptions = this.constructFormFieldOptions(this.formFields);\n };\n class_1.prototype.handleCodeChange = function (event) {\n this.code = event.target.value;\n };\n class_1.prototype.confirm = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var mfaType, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n mfaType = this.user['challengeName'] === ChallengeName.SoftwareTokenMFA\n ? ChallengeName.SoftwareTokenMFA\n : null;\n if (!Auth || typeof Auth.confirmSignIn !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, Auth.confirmSignIn(this.user, this.code, mfaType)];\n case 2:\n _a.sent();\n return [4 /*yield*/, checkContact(this.user, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 6];\n case 4:\n error_1 = _a.sent();\n dispatchToastHubEvent(error_1);\n return [3 /*break*/, 6];\n case 5:\n this.loading = false;\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.constructFormFieldOptions = function (formFields) {\n var _this = this;\n var content = [];\n if (formFields === undefined)\n return undefined;\n if (formFields.length <= 0)\n return this.defaultFormFields;\n formFields.forEach(function (formField) {\n if (typeof formField === 'string' || formField.type !== 'code') {\n // This is either a `string`, and/or a custom field that isn't `code`. Pass this directly.\n content.push(formField);\n }\n else {\n // This is a code input field. Attach input handler.\n content.push(Object.assign({ handleInputChange: function (event) { return _this.handleCodeChange(event); } }, formField));\n }\n });\n return content;\n };\n class_1.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, submitButtonText: I18n.get(this.submitButtonText), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN))) }, h(\"amplify-auth-fields\", { formFields: this.constructedFormFieldOptions }))));\n };\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_1;\n}());\nvar AmplifyConfirmSignUp = /** @class */ (function () {\n function class_2(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.confirmSignUp(event); };\n /** Used for header text in confirm sign up component */\n this.headerText = Translations.CONFIRM_SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in confirm sign up component */\n this.submitButtonText = Translations.CONFIRM_SIGN_UP_SUBMIT_BUTTON_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this components\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.loading = false;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n }\n class_2.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n this.setup();\n };\n class_2.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_2.prototype.userHandler = function () {\n this.setup();\n };\n class_2.prototype.setup = function () {\n // TODO: Use optional chaining instead\n this.userInput = this.user && this.user.username;\n this._signUpAttrs = this.user && this.user.signUpAttrs;\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_2.prototype.buildDefaultFormFields = function () {\n var _this = this;\n this.newFormFields = [\n {\n type: \"\" + this.usernameAlias,\n required: true,\n handleInputChange: this.handleFormFieldInputChange(\"\" + this.usernameAlias),\n value: this.userInput,\n disabled: this.userInput ? true : false,\n inputProps: { autocomplete: 'username' },\n },\n {\n type: 'code',\n label: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_LABEL),\n placeholder: I18n.get(Translations.CONFIRM_SIGN_UP_CODE_PLACEHOLDER),\n required: true,\n hint: (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))),\n handleInputChange: this.handleFormFieldInputChange('code'),\n },\n ];\n };\n class_2.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_1 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n if (newField.type === 'code') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.CONFIRM_SIGN_UP_LOST_CODE), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.resendConfirmCode(); } }, I18n.get(Translations.CONFIRM_SIGN_UP_RESEND_CODE)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_1.push(newField);\n });\n this.newFormFields = newFields_1;\n }\n };\n class_2.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'code':\n return function (event) { return (_this.code = event.target.value); };\n default:\n return;\n }\n };\n class_2.prototype.setFieldValue = function (field) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n this.userInput = '';\n }\n else {\n this.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n }\n };\n class_2.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n /**\n * Returns the username of the user to confirm. If a valid `user.username` has been passed as a prop, we return that.\n * Otherwise, we return the `userInput` on the form.\n */\n class_2.prototype.getUsername = function () {\n if (this.user && this.user.username)\n return this.user.username;\n switch (this.usernameAlias) {\n case 'username':\n case 'email':\n return this.userInput;\n case 'phone_number':\n return composePhoneNumberInput(this.phoneNumber);\n }\n };\n class_2.prototype.resendConfirmCode = function () {\n return __awaiter(this, void 0, void 0, function () {\n var username, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.resendSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n return [4 /*yield*/, Auth.resendSignUp(username.trim())];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_2 = _a.sent();\n dispatchToastHubEvent(error_2);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n // TODO: Add validation\n // TODO: Prefix\n class_2.prototype.confirmSignUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username, confirmSignUpResult, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.confirmSignUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n username = this.getUsername();\n if (!username)\n throw new Error(Translations.EMPTY_USERNAME);\n username = username.trim();\n return [4 /*yield*/, Auth.confirmSignUp(username, this.code)];\n case 2:\n confirmSignUpResult = _a.sent();\n if (!confirmSignUpResult) {\n throw new Error(I18n.get(Translations.CONFIRM_SIGN_UP_FAILED));\n }\n if (!(this._signUpAttrs &&\n this._signUpAttrs.password &&\n this._signUpAttrs.password !== '')) return [3 /*break*/, 4];\n // Auto sign in user if password is available from previous workflow\n return [4 /*yield*/, handleSignIn(username, this._signUpAttrs.password, this.handleAuthStateChange)];\n case 3:\n // Auto sign in user if password is available from previous workflow\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n this.handleAuthStateChange(AuthState.SignIn);\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_3 = _a.sent();\n dispatchToastHubEvent(error_3);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_2.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), submitButtonText: I18n.get(this.submitButtonText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"div\", null, h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)))) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_2, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"],\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_2;\n}());\nvar logger = new Logger('ForgotPassword');\nvar AmplifyForgotPassword = /** @class */ (function () {\n function class_3(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.RESET_YOUR_PASSWORD;\n /** The text displayed inside of the send code button for the form */\n this.sendButtonText = Translations.SEND_CODE;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.SUBMIT;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [];\n /** The function called when making a request to reset password */\n this.handleSend = function (event) { return _this.send(event); };\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.submit(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n this.delivery = null;\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.newFormFields = [];\n this.forgotPasswordAttrs = {\n userInput: '',\n password: '',\n code: '',\n };\n }\n class_3.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_3.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_3.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_2 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n newFields_2.push(newField);\n });\n this.newFormFields = newFields_2;\n }\n };\n class_3.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'forgot-password-email-input',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'forgot-password-phone-number-input',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'forgot-password-username-input',\n },\n },\n ];\n break;\n }\n };\n class_3.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.forgotPasswordAttrs.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n case 'code':\n return function (event) { return (_this.forgotPasswordAttrs[fieldType] = event.target.value); };\n default:\n return;\n }\n };\n class_3.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n case 'code':\n if (field.value === undefined) {\n formAttributes[field.type] = '';\n }\n else {\n formAttributes[field.type] = field.value;\n }\n break;\n }\n };\n class_3.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_3.prototype.send = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.forgotPasswordAttrs.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n break;\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.forgotPassword(this.forgotPasswordAttrs.userInput.trim())];\n case 2:\n data = _a.sent();\n logger.debug(data);\n this.newFormFields = [\n {\n type: 'code',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('code'),\n inputProps: {\n 'data-test': 'forgot-password-code-input',\n },\n },\n {\n type: 'password',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n },\n ];\n this.delivery = data.CodeDeliveryDetails;\n return [3 /*break*/, 5];\n case 3:\n error_4 = _a.sent();\n dispatchToastHubEvent(error_4);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.submit = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, userInput, code, password, data, error_5;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.forgotPasswordSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3, 4, 5]);\n _a = this.forgotPasswordAttrs, userInput = _a.userInput, code = _a.code, password = _a.password;\n return [4 /*yield*/, Auth.forgotPasswordSubmit(userInput.trim(), code, password)];\n case 2:\n data = _b.sent();\n logger.debug(data);\n this.handleAuthStateChange(AuthState.SignIn);\n this.delivery = null;\n return [3 /*break*/, 5];\n case 3:\n error_5 = _b.sent();\n dispatchToastHubEvent(error_5);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_3.prototype.render = function () {\n var _this = this;\n var submitFn = this.delivery\n ? function (event) { return _this.handleSubmit(event); }\n : function (event) { return _this.handleSend(event); };\n var submitButtonText = this.delivery\n ? this.submitButtonText\n : this.sendButtonText;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: submitFn, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"forgot-password-back-to-sign-in-link\" }, I18n.get(Translations.BACK_TO_SIGN_IN)), testDataPrefix: 'forgot-password', submitButtonText: I18n.get(submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_3, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_3;\n}());\nvar logger$1 = new ConsoleLogger('amplify-require-new-password');\nvar AmplifyRequireNewPassword = /** @class */ (function () {\n function class_4(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** The header text of the forgot password section */\n this.headerText = Translations.CHANGE_PASSWORD;\n /** The text displayed inside of the submit button for the form */\n this.submitButtonText = Translations.CHANGE_PASSWORD_ACTION;\n /** The function called when submitting a new password */\n this.handleSubmit = function (event) { return _this.completeNewPassword(event); };\n /** Auth state change handler for this component */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** The form fields displayed inside of the forgot password form */\n this.formFields = [\n {\n type: AuthFormField.Password,\n required: true,\n handleInputChange: function (event) { return _this.handlePasswordChange(event); },\n label: I18n.get(Translations.NEW_PASSWORD_LABEL),\n placeholder: I18n.get(Translations.NEW_PASSWORD_PLACEHOLDER),\n inputProps: {\n 'data-test': 'require-new-password-password-input',\n },\n },\n ];\n this.loading = false;\n this.requiredAttributes = {};\n this.newFormFields = this.formFields;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: ' ',\n };\n }\n class_4.prototype.userHandler = function () {\n this.setCurrentUser();\n };\n class_4.prototype.handleRequiredAttributeInputChange = function (attribute, event) {\n if (attribute === 'phone_number') {\n this.formatPhoneNumber(event);\n }\n else {\n this.requiredAttributes[attribute] = event.target.value;\n }\n };\n class_4.prototype.setCurrentUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n var user, error_6, userRequiredAttributes, requiredAttributesMap_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.user) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, Auth.currentAuthenticatedUser()];\n case 2:\n user = _a.sent();\n if (user)\n this.currentUser = user;\n return [3 /*break*/, 4];\n case 3:\n error_6 = _a.sent();\n dispatchToastHubEvent(error_6);\n return [3 /*break*/, 4];\n case 4: return [3 /*break*/, 6];\n case 5:\n this.currentUser = this.user;\n _a.label = 6;\n case 6:\n if (this.currentUser &&\n this.currentUser.challengeParam &&\n this.currentUser.challengeParam.requiredAttributes) {\n userRequiredAttributes = this.currentUser.challengeParam\n .requiredAttributes;\n requiredAttributesMap_1 = getRequiredAttributesMap();\n userRequiredAttributes.forEach(function (attribute) {\n var formField = {\n type: attribute,\n required: true,\n label: requiredAttributesMap_1[attribute].label,\n placeholder: requiredAttributesMap_1[attribute].placeholder,\n handleInputChange: function (event) { return _this.handleRequiredAttributeInputChange(attribute, event); },\n inputProps: {\n 'data-test': \"require-new-password-\" + attribute + \"-input\",\n },\n };\n _this.newFormFields = __spreadArrays(_this.newFormFields, [formField]);\n });\n }\n return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n return this.setCurrentUser();\n };\n class_4.prototype.handlePasswordChange = function (event) {\n this.password = event.target.value;\n };\n class_4.prototype.formatPhoneNumber = function (event) {\n handlePhoneNumberChange(event, this.phoneNumber);\n /**\n * composePhoneNumberInput will throw an error if the phoneNumberValue it receives\n * is empty. Adding a check here to try and make sure that doesn't happen...but will\n * wrap it in a try/catch block just in case as well\n */\n try {\n if (event.target.name === PHONE_SUFFIX &&\n this.phoneNumber.phoneNumberValue) {\n var composedInput = composePhoneNumberInput(this.phoneNumber);\n this.requiredAttributes['phone_number'] = composedInput;\n }\n }\n catch (err) {\n logger$1.error(\"error in phone number field - \" + err);\n }\n };\n class_4.prototype.completeNewPassword = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var user, _a, error_7;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.completeNewPassword !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 8, 9, 10]);\n return [4 /*yield*/, Auth.completeNewPassword(this.currentUser, this.password, this.requiredAttributes)];\n case 2:\n user = _b.sent();\n logger$1.debug('complete new password', user);\n _a = user.challengeName;\n switch (_a) {\n case ChallengeName.SMSMFA: return [3 /*break*/, 3];\n case ChallengeName.MFASetup: return [3 /*break*/, 4];\n }\n return [3 /*break*/, 5];\n case 3:\n this.handleAuthStateChange(AuthState.ConfirmSignIn, user);\n return [3 /*break*/, 7];\n case 4:\n logger$1.debug('TOTP setup', user.challengeParam);\n this.handleAuthStateChange(AuthState.TOTPSetup, user);\n return [3 /*break*/, 7];\n case 5: return [4 /*yield*/, checkContact(user, this.handleAuthStateChange)];\n case 6:\n _b.sent();\n _b.label = 7;\n case 7: return [3 /*break*/, 10];\n case 8:\n error_7 = _b.sent();\n dispatchToastHubEvent(error_7);\n return [3 /*break*/, 10];\n case 9:\n this.loading = false;\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n });\n };\n class_4.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, loading: this.loading, secondaryFooterContent: h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); } }, I18n.get(Translations.BACK_TO_SIGN_IN)), submitButtonText: I18n.get(this.submitButtonText) }, h(\"amplify-auth-fields\", { formFields: this.newFormFields }))));\n };\n Object.defineProperty(class_4, \"watchers\", {\n get: function () {\n return {\n \"user\": [\"userHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_4;\n}());\nvar amplifySignInCss = \":host{--footer-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--footer-font-family:var(--amplify-font-family);--font-weight:var(--amplify-font-weight)}.sign-in-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-in-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-in-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-in-form-footer amplify-button{margin-bottom:0}}.sign-in-form-footer *+*{margin-bottom:15px}.full-width-footer-content{width:100%}\";\nvar AmplifySignIn = /** @class */ (function () {\n function class_5(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign in form is submitted */\n this.handleSubmit = function (event) { return _this.signIn(event); };\n /** Used for header text in sign in component */\n this.headerText = Translations.SIGN_IN_HEADER_TEXT;\n /** Used for the submit button text in sign in component */\n this.submitButtonText = Translations.SIGN_IN_ACTION;\n /** Auth state change handler for this component */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Hides the sign up link */\n this.hideSignUp = false;\n this.newFormFields = [];\n /* Whether or not the sign-in component is loading */\n this.loading = false;\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.signInAttributes = {\n userInput: '',\n password: '',\n };\n }\n class_5.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_5.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_5.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n case 'email':\n return function (event) { return (_this.signInAttributes.userInput = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n case 'password':\n return function (event) { return (_this.signInAttributes.password = event.target.value); };\n default:\n return function () { };\n }\n };\n class_5.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_5.prototype.signIn = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var username;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // avoid submitting the form\n if (event) {\n event.preventDefault();\n }\n this.loading = true;\n switch (this.usernameAlias) {\n case 'phone_number':\n try {\n this.signInAttributes.userInput = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n username = this.signInAttributes.userInput.trim();\n return [4 /*yield*/, handleSignIn(username, this.signInAttributes.password, this.handleAuthStateChange, this.usernameAlias)];\n case 1:\n _a.sent();\n this.loading = false;\n return [2 /*return*/];\n }\n });\n });\n };\n class_5.prototype.buildDefaultFormFields = function () {\n var _this = this;\n var formFieldInputs = [];\n switch (this.usernameAlias) {\n case 'email':\n formFieldInputs.push({\n type: 'email',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-in-email-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'phone_number':\n formFieldInputs.push({\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-in-phone-number-input',\n autocomplete: 'username',\n },\n });\n break;\n case 'username':\n default:\n formFieldInputs.push({\n type: 'username',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-in-username-input',\n autocomplete: 'username',\n },\n });\n break;\n }\n formFieldInputs.push({\n type: 'password',\n hint: (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-in-password-input',\n },\n });\n this.newFormFields = __spreadArrays(formFieldInputs);\n };\n class_5.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_3 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n // TODO: handle hint better\n if (newField.type === 'password') {\n newField['hint'] = isHintValid(newField) ? (h(\"div\", null, I18n.get(Translations.FORGOT_PASSWORD_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.ForgotPassword); }, \"data-test\": \"sign-in-forgot-password-link\" }, I18n.get(Translations.RESET_PASSWORD_TEXT)))) : (newField['hint']);\n }\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(newField, _this.signInAttributes);\n newFields_3.push(newField);\n });\n this.newFormFields = newFields_3;\n }\n };\n class_5.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n case 'email':\n if (field.value === undefined) {\n formAttributes.userInput = '';\n }\n else {\n formAttributes.userInput = field.value;\n }\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n }\n };\n class_5.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-in' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"slot\", { name: \"federated-buttons\" }, h(\"amplify-federated-buttons\", { handleAuthStateChange: this.handleAuthStateChange, federated: this.federated })), !isEmpty(this.federated) && h(\"amplify-strike\", null, \"or\"), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { slot: \"amplify-form-section-footer\", class: \"sign-in-form-footer\" }, h(\"slot\", { name: \"footer\" }, !this.hideSignUp && (h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(Translations.NO_ACCOUNT_TEXT), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignUp); }, \"data-test\": \"sign-in-create-account-link\" }, I18n.get(Translations.CREATE_ACCOUNT_TEXT))))), h(\"div\", { class: this.hideSignUp ? 'full-width-footer-content' : '' }, h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", disabled: this.loading, \"data-test\": \"sign-in-sign-in-button\" }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText)))))))))));\n };\n Object.defineProperty(class_5, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_5;\n}());\nAmplifySignIn.style = amplifySignInCss;\nvar amplifySignUpCss = \"amplify-sign-up{--footer-font-family:var(--amplify-font-family);--footer-font-size:var(--amplify-text-sm);--footer-color:var(--amplify-grey);--font-weight:var(--amplify-font-weight)}.sign-up-form-footer{font-family:var(--footer-font-family);font-size:var(--footer-font-size);color:var(--footer-color);font-weight:--font-weight;display:-ms-flexbox;display:flex;-ms-flex-direction:column-reverse;flex-direction:column-reverse;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sign-up-form-footer amplify-button{margin-bottom:0.625rem}@media (min-width: 672px){.sign-up-form-footer{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline}.sign-up-form-footer amplify-button{margin-bottom:0}}.sign-up-form-footer *+*{margin-bottom:15px}\";\nvar AmplifySignUp = /** @class */ (function () {\n function class_6(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n /** Fires when sign up form is submitted */\n this.handleSubmit = function (event) { return _this.signUp(event); };\n /** Override for handling the Auth.SignUp API call */\n this.handleSignUp = function (params) { return _this.authSignUp(params); };\n /** Used for header text in sign up component */\n this.headerText = Translations.SIGN_UP_HEADER_TEXT;\n /** Used for the submit button text in sign up component */\n this.submitButtonText = Translations.SIGN_UP_SUBMIT_BUTTON_TEXT;\n /** Used for the submit button text in sign up component */\n this.haveAccountText = Translations.SIGN_UP_HAVE_ACCOUNT_TEXT;\n /** Text used for the sign in hyperlink */\n this.signInText = Translations.SIGN_IN_TEXT;\n /**\n * Form fields allows you to utilize our pre-built components such as username field, code field, password field, email field, etc.\n * by passing an array of strings that you would like the order of the form to be in. If you need more customization, such as changing\n * text for a label or adjust a placeholder, you can follow the structure below in order to do just that.\n * ```\n * [\n * {\n * type: string,\n * label: string,\n * placeholder: string,\n * hint: string | Functional Component | null,\n * required: boolean\n * }\n * ]\n * ```\n */\n this.formFields = [];\n /** Auth state change handler for this component\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n // prettier-ignore\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n /** Username Alias is used to setup authentication with `username`, `email` or `phone_number` */\n this.usernameAlias = 'username';\n // private userInput: string | PhoneNumberInterface;\n this.newFormFields = [];\n this.phoneNumber = {\n countryDialCodeValue: COUNTRY_DIAL_CODE_DEFAULT,\n phoneNumberValue: null,\n };\n this.loading = false;\n this.signUpAttributes = {\n username: '',\n password: '',\n attributes: {},\n };\n }\n class_6.prototype.handleFormFieldInputChange = function (fieldType) {\n var _this = this;\n switch (fieldType) {\n case 'username':\n return function (event) { return (_this.signUpAttributes.username = event.target.value); };\n case 'password':\n return function (event) { return (_this.signUpAttributes.password = event.target.value); };\n case 'email':\n return function (event) { return (_this.signUpAttributes.attributes.email = event.target.value); };\n case 'phone_number':\n return function (event) { return handlePhoneNumberChange(event, _this.phoneNumber); };\n default:\n return function (event) { return (_this.signUpAttributes.attributes[fieldType] = event.target.value); };\n }\n };\n class_6.prototype.handleFormFieldInputWithCallback = function (event, field) {\n var fnToCall = field['handleInputChange']\n ? field['handleInputChange']\n : function (event, cb) {\n cb(event);\n };\n var callback = this.handleFormFieldInputChange(field.type);\n fnToCall(event, callback.bind(this));\n };\n class_6.prototype.authSignUp = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Auth.signUp(params)];\n case 1:\n data = _a.sent();\n if (!data) {\n throw new Error(Translations.SIGN_UP_FAILED);\n }\n return [2 /*return*/, data];\n }\n });\n });\n };\n class_6.prototype.assignPhoneNumberToSignUpAttributes = function () {\n if (this.phoneNumber.phoneNumberValue) {\n try {\n this.signUpAttributes.attributes.phone_number = composePhoneNumberInput(this.phoneNumber);\n }\n catch (error) {\n dispatchToastHubEvent(error);\n }\n }\n };\n class_6.prototype.assignUserNameAliasToSignUpAttributes = function () {\n switch (this.usernameAlias) {\n case 'email':\n case 'phone_number':\n this.signUpAttributes.username = this.signUpAttributes.attributes[this.usernameAlias];\n break;\n }\n };\n class_6.prototype.assignFormInputToSignUpAttributes = function () {\n this.assignPhoneNumberToSignUpAttributes();\n this.assignUserNameAliasToSignUpAttributes();\n };\n class_6.prototype.validateSignUpAttributes = function () {\n if (!this.signUpAttributes.username) {\n if (this.usernameAlias === UsernameAlias.email) {\n throw new Error(Translations.EMPTY_EMAIL);\n }\n else if (this.usernameAlias === UsernameAlias.phone_number) {\n throw new Error(Translations.EMPTY_PHONE);\n }\n else {\n throw new Error(Translations.EMPTY_USERNAME);\n }\n }\n if (this.signUpAttributes.username.indexOf(' ') >= 0) {\n throw new Error(Translations.USERNAME_REMOVE_WHITESPACE);\n }\n if (this.signUpAttributes.password !== this.signUpAttributes.password.trim()) {\n throw new Error(Translations.PASSWORD_REMOVE_WHITESPACE);\n }\n };\n // TODO: Add validation\n // TODO: Prefix\n class_6.prototype.signUp = function (event) {\n return __awaiter(this, void 0, void 0, function () {\n var data, signUpAttrs, error_8;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (event) {\n event.preventDefault();\n }\n if (!Auth || typeof Auth.signUp !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n this.assignFormInputToSignUpAttributes();\n _a.label = 1;\n case 1:\n _a.trys.push([1, 6, 7, 8]);\n this.validateSignUpAttributes();\n return [4 /*yield*/, this.handleSignUp(this.signUpAttributes)];\n case 2:\n data = _a.sent();\n if (!data.userConfirmed) return [3 /*break*/, 4];\n return [4 /*yield*/, handleSignIn(this.signUpAttributes.username, this.signUpAttributes.password, this.handleAuthStateChange)];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n signUpAttrs = Object.assign({}, this.signUpAttributes);\n this.handleAuthStateChange(AuthState.ConfirmSignUp, Object.assign(Object.assign({}, data.user), { signUpAttrs: signUpAttrs }));\n _a.label = 5;\n case 5: return [3 /*break*/, 8];\n case 6:\n error_8 = _a.sent();\n dispatchToastHubEvent(error_8);\n return [3 /*break*/, 8];\n case 7:\n this.loading = false;\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n class_6.prototype.buildDefaultFormFields = function () {\n switch (this.usernameAlias) {\n case 'email':\n this.newFormFields = [\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'tel-national',\n },\n },\n ];\n break;\n case 'phone_number':\n this.newFormFields = [\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n autocomplete: 'email',\n },\n },\n ];\n break;\n case 'username':\n default:\n this.newFormFields = [\n {\n type: 'username',\n placeholder: I18n.get(Translations.SIGN_UP_USERNAME_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('username'),\n inputProps: {\n 'data-test': 'sign-up-username-input',\n autocomplete: 'username',\n },\n },\n {\n type: 'password',\n placeholder: I18n.get(Translations.SIGN_UP_PASSWORD_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('password'),\n inputProps: {\n 'data-test': 'sign-up-password-input',\n autocomplete: 'new-password',\n },\n },\n {\n type: 'email',\n placeholder: I18n.get(Translations.SIGN_UP_EMAIL_PLACEHOLDER),\n required: true,\n handleInputChange: this.handleFormFieldInputChange('email'),\n inputProps: {\n 'data-test': 'sign-up-email-input',\n },\n },\n {\n type: 'phone_number',\n required: true,\n handleInputChange: this.handleFormFieldInputChange('phone_number'),\n inputProps: {\n 'data-test': 'sign-up-phone-number-input',\n },\n },\n ];\n break;\n }\n };\n class_6.prototype.buildFormFields = function () {\n var _this = this;\n if (this.formFields.length === 0) {\n this.buildDefaultFormFields();\n }\n else {\n var newFields_4 = [];\n this.formFields.forEach(function (field) {\n var newField = Object.assign({}, field);\n newField['handleInputChange'] = function (event) { return _this.handleFormFieldInputWithCallback(event, field); };\n _this.setFieldValue(field, _this.signUpAttributes);\n newFields_4.push(newField);\n });\n this.newFormFields = newFields_4;\n }\n };\n class_6.prototype.setFieldValue = function (field, formAttributes) {\n switch (field.type) {\n case 'username':\n if (field.value === undefined) {\n formAttributes.username = '';\n }\n else {\n formAttributes.username = field.value;\n }\n break;\n case 'password':\n if (field.value === undefined) {\n formAttributes.password = '';\n }\n else {\n formAttributes.password = field.value;\n }\n break;\n case 'email':\n formAttributes.attributes.email = field.value;\n break;\n case 'phone_number':\n if (field.dialCode) {\n this.phoneNumber.countryDialCodeValue = field.dialCode;\n }\n this.phoneNumber.phoneNumberValue = field.value;\n break;\n default:\n formAttributes.attributes[field.type] = field.value;\n break;\n }\n };\n class_6.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n checkUsernameAlias(this.usernameAlias);\n this.buildFormFields();\n };\n class_6.prototype.formFieldsHandler = function () {\n this.buildFormFields();\n };\n class_6.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { headerText: I18n.get(this.headerText), handleSubmit: this.handleSubmit, testDataPrefix: 'sign-up' }, h(\"div\", { slot: \"subtitle\" }, h(\"slot\", { name: \"header-subtitle\" })), h(\"amplify-auth-fields\", { formFields: this.newFormFields }), h(\"div\", { class: \"sign-up-form-footer\", slot: \"amplify-form-section-footer\" }, h(\"slot\", { name: \"footer\" }, h(\"slot\", { name: \"secondary-footer-content\" }, h(\"span\", null, I18n.get(this.haveAccountText), ' ', h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignIn); }, \"data-test\": \"sign-up-sign-in-link\" }, I18n.get(this.signInText)))), h(\"slot\", { name: \"primary-footer-content\" }, h(\"amplify-button\", { type: \"submit\", \"data-test\": \"sign-up-create-account-button\", disabled: this.loading }, this.loading ? (h(\"amplify-loading-spinner\", null)) : (h(\"span\", null, I18n.get(this.submitButtonText))))))))));\n };\n Object.defineProperty(class_6, \"watchers\", {\n get: function () {\n return {\n \"formFields\": [\"formFieldsHandler\"]\n };\n },\n enumerable: false,\n configurable: true\n });\n return class_6;\n}());\nAmplifySignUp.style = amplifySignUpCss;\nvar logger$2 = new Logger('AmplifyVerifyContact');\nvar AmplifyVerifyContact = /** @class */ (function () {\n function class_7(hostRef) {\n registerInstance(this, hostRef);\n /** Authentication state handler */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n this.loading = false;\n }\n class_7.prototype.componentWillLoad = function () {\n console.warn('Version `1.x` of Amplify UI has been deprecated and will be removed in a future major version of `aws-amplify`. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.');\n };\n class_7.prototype.handleSubmit = function (event) {\n event.preventDefault();\n this.verifyAttr ? this.submit(this.code) : this.verify(this.contact);\n };\n class_7.prototype.submit = function (code) {\n return __awaiter(this, void 0, void 0, function () {\n var attr, data, error_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attr = this.verifyAttr;\n if (!Auth || typeof Auth.verifyCurrentUserAttributeSubmit !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttributeSubmit(attr, code)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.handleAuthStateChange(AuthState.SignedIn, this.user);\n this.verifyAttr = null;\n return [3 /*break*/, 5];\n case 3:\n error_9 = _a.sent();\n dispatchToastHubEvent(error_9);\n logger$2.error(error_9);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.verify = function (contact) {\n return __awaiter(this, void 0, void 0, function () {\n var data, error_10;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!contact) {\n logger$2.error('Neither Email nor Phone Number selected');\n return [2 /*return*/];\n }\n if (!Auth || typeof Auth.verifyCurrentUserAttribute !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n this.loading = true;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, 4, 5]);\n return [4 /*yield*/, Auth.verifyCurrentUserAttribute(contact)];\n case 2:\n data = _a.sent();\n logger$2.debug(data);\n this.verifyAttr = contact;\n return [3 /*break*/, 5];\n case 3:\n error_10 = _a.sent();\n dispatchToastHubEvent(error_10);\n logger$2.error(error_10);\n return [3 /*break*/, 5];\n case 4:\n this.loading = false;\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n class_7.prototype.handleInputChange = function (event) {\n var inputName = event.target.name;\n if (inputName === 'code') {\n this.code = event.target.value;\n }\n else if (inputName === 'contact') {\n this.contact = event.target.value;\n }\n };\n class_7.prototype.renderSubmit = function () {\n var _this = this;\n return (h(\"div\", null, h(\"amplify-input\", { inputProps: {\n autocomplete: 'off',\n 'data-test': 'verify-contact-code-input',\n }, name: \"code\", placeholder: I18n.get(Translations.CODE_PLACEHOLDER), handleInputChange: function (event) { return _this.handleInputChange(event); } })));\n };\n class_7.prototype.renderVerify = function () {\n var _this = this;\n var user = this.user;\n if (!user) {\n logger$2.debug('No user to verify');\n return null;\n }\n var unverified = user.unverified;\n if (!unverified) {\n logger$2.debug('Unverified variable does not exist on user');\n return null;\n }\n var email = unverified.email, phone_number = unverified.phone_number;\n return (h(\"div\", null, email && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_EMAIL_LABEL), key: \"email\", name: \"contact\", value: \"email\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-email-radio',\n } })), phone_number && (h(\"amplify-radio-button\", { label: I18n.get(Translations.VERIFY_CONTACT_PHONE_LABEL), key: \"phone_number\", name: \"contact\", value: \"phone_number\", handleInputChange: function (event) { return _this.handleInputChange(event); }, inputProps: {\n 'data-test': 'verify-contact-phone-number-radio',\n } }))));\n };\n class_7.prototype.render = function () {\n var _this = this;\n return (h(Host, null, h(\"amplify-form-section\", { handleSubmit: function (event) { return _this.handleSubmit(event); }, headerText: I18n.get(Translations.VERIFY_CONTACT_HEADER_TEXT), loading: this.loading, secondaryFooterContent: h(\"span\", null, h(\"amplify-button\", { variant: \"anchor\", onClick: function () { return _this.handleAuthStateChange(AuthState.SignedIn, _this.user); }, \"data-test\": \"verify-contact-skip-link\" }, I18n.get(Translations.SKIP))), submitButtonText: this.verifyAttr\n ? I18n.get(Translations.VERIFY_CONTACT_SUBMIT_LABEL)\n : I18n.get(Translations.VERIFY_CONTACT_VERIFY_LABEL) }, this.verifyAttr ? this.renderSubmit() : this.renderVerify())));\n };\n return class_7;\n}());\nexport { AmplifyConfirmSignIn as amplify_confirm_sign_in, AmplifyConfirmSignUp as amplify_confirm_sign_up, AmplifyForgotPassword as amplify_forgot_password, AmplifyRequireNewPassword as amplify_require_new_password, AmplifySignIn as amplify_sign_in, AmplifySignUp as amplify_sign_up, AmplifyVerifyContact as amplify_verify_contact };\n"],"sourceRoot":""}