@forgerock/login-widget 1.0.0-beta.11 → 1.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -702,6 +702,10 @@ function closeComponent(args, shouldCloseDialog) {
702
702
  };
703
703
  });
704
704
  }
705
+ /**
706
+ * @function componentApi - this is a widget external API
707
+ * @returns {object} - the public component API
708
+ */
705
709
  const componentApi = () => {
706
710
  const { update } = componentStore;
707
711
  // Create derived store to minimize what's exposed to the dev
@@ -715,9 +719,19 @@ const componentApi = () => {
715
719
  });
716
720
  });
717
721
  return {
722
+ /**
723
+ * Close a modal
724
+ * @param {object} args - object containing the reason for closing component
725
+ * @returns {void}
726
+ */
718
727
  close: (args) => {
719
728
  closeComponent(args, true);
720
729
  },
730
+ /**
731
+ * Open a modal
732
+ * @param: void
733
+ * @returns: void
734
+ */
721
735
  open: () => {
722
736
  update((state) => {
723
737
  if (state.type === 'inline') {
@@ -739,6 +753,10 @@ const componentApi = () => {
739
753
  };
740
754
  });
741
755
  },
756
+ /**
757
+ * Subscribe to modal events
758
+ * returns the latest value from the event
759
+ */
742
760
  subscribe,
743
761
  };
744
762
  };
@@ -10873,6 +10891,11 @@ var HttpClient = /** @class */ (function (_super) {
10873
10891
  }(event_1.default));
10874
10892
  var _default$2 = httpClient.default = HttpClient;
10875
10893
 
10894
+ /**
10895
+ * @function logErrorAndThrow - Logs an error message and throws an error.
10896
+ * @param {string} type - The type of error. This will be used to determine what error message to log.
10897
+ * @throws {Error} - An error with a message that depends on the value of `type`.
10898
+ */
10876
10899
  function logErrorAndThrow(type) {
10877
10900
  if (type === 'missingStores') {
10878
10901
  const errorMessage = 'Error: missing configuration.';
@@ -14921,6 +14944,11 @@ const configSchema = z
14921
14944
  })
14922
14945
  .strict();
14923
14946
  configSchema.partial();
14947
+ /**
14948
+ * @function - Sets the configuration for the SDK
14949
+ * @param {object} config - The configuration object
14950
+ * @returns {void}
14951
+ */
14924
14952
  function configure (config) {
14925
14953
  configSchema.parse(config);
14926
14954
  Config.set(config);
@@ -14968,6 +14996,12 @@ const fallbackJourneyConfig = Object.keys(defaultJourneys).map((key) => ({
14968
14996
  key,
14969
14997
  }));
14970
14998
  const configuredJourneysStore = writable(fallbackJourneyConfig);
14999
+ /**
15000
+ * @function initialize - Initialize the configured journeys store
15001
+ * @param {object} customJourneys - An object of custom journeys to merge with the default
15002
+ * @returns {object} - The configured journeys store
15003
+ * @example initialize({ login: { journey: 'Login', match: ['?journey=Login'] } })
15004
+ */
14971
15005
  function initialize$6(customJourneys) {
14972
15006
  if (customJourneys) {
14973
15007
  // Provide developer feedback if customized
@@ -16726,6 +16760,8 @@ var backToDefault = "Back to Sign In";
16726
16760
  var backToLogin = "Back to Sign In";
16727
16761
  var dontHaveAnAccount = "No account? <a href='?journey=Registration'>Register here!</a>";
16728
16762
  var closeModal = "Close";
16763
+ var charactersCannotRepeatMoreThan = "Character cannot repeat more than {max} times";
16764
+ var charactersCannotRepeatMoreThanCaseInsensitive = "Character cannot repeat more than {max} times (case insensitive)";
16729
16765
  var chooseDifferentUsername = "Please choose a different username.";
16730
16766
  var confirmPassword = "Confirm password";
16731
16767
  var constraintViolationForPassword = "Password does not meet the requirements.";
@@ -16758,6 +16794,9 @@ var nextButton = "Next";
16758
16794
  var notToExceedMaximumCharacterLength = "No more than {max} characters";
16759
16795
  var noLessThanMinimumCharacterLength = "At least {min} character(s)";
16760
16796
  var passwordCallback = "Password";
16797
+ var passwordCannotContainCommonPasswords = "Password cannot contain common passwords";
16798
+ var passwordCannotContainCommonPasswordsOrBeReversible = "Password cannot contain common passwords or reversible text";
16799
+ var passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan = "Password cannot contain common passwords or reversible text less than {min} characters";
16761
16800
  var passwordRequirements = "Password requirements:";
16762
16801
  var pleaseCheckValue = "Please check this value";
16763
16802
  var pleaseConfirm = "Please confirm";
@@ -16772,6 +16811,10 @@ var requiredField = "Value is required";
16772
16811
  var securityAnswer = "Security answer";
16773
16812
  var securityQuestions = "Security question(s)";
16774
16813
  var securityQuestionsPrompt = "Provide security question(s) and answer(s):";
16814
+ var shouldContainANumber = "Should contain a number";
16815
+ var shouldContainAnUppercase = "Should contain an uppercase letter";
16816
+ var shouldContainALowercase = "Should contain a lowercase letter";
16817
+ var shouldContainASymbol = "Should contain a symbol";
16775
16818
  var showPassword = "Show password";
16776
16819
  var sn = "Last name";
16777
16820
  var submitButton = "Submit";
@@ -16795,6 +16838,8 @@ var fallback = {
16795
16838
  backToLogin: backToLogin,
16796
16839
  dontHaveAnAccount: dontHaveAnAccount,
16797
16840
  closeModal: closeModal,
16841
+ charactersCannotRepeatMoreThan: charactersCannotRepeatMoreThan,
16842
+ charactersCannotRepeatMoreThanCaseInsensitive: charactersCannotRepeatMoreThanCaseInsensitive,
16798
16843
  chooseDifferentUsername: chooseDifferentUsername,
16799
16844
  confirmPassword: confirmPassword,
16800
16845
  constraintViolationForPassword: constraintViolationForPassword,
@@ -16827,6 +16872,9 @@ var fallback = {
16827
16872
  notToExceedMaximumCharacterLength: notToExceedMaximumCharacterLength,
16828
16873
  noLessThanMinimumCharacterLength: noLessThanMinimumCharacterLength,
16829
16874
  passwordCallback: passwordCallback,
16875
+ passwordCannotContainCommonPasswords: passwordCannotContainCommonPasswords,
16876
+ passwordCannotContainCommonPasswordsOrBeReversible: passwordCannotContainCommonPasswordsOrBeReversible,
16877
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan,
16830
16878
  passwordRequirements: passwordRequirements,
16831
16879
  pleaseCheckValue: pleaseCheckValue,
16832
16880
  pleaseConfirm: pleaseConfirm,
@@ -16841,6 +16889,10 @@ var fallback = {
16841
16889
  securityAnswer: securityAnswer,
16842
16890
  securityQuestions: securityQuestions,
16843
16891
  securityQuestionsPrompt: securityQuestionsPrompt,
16892
+ shouldContainANumber: shouldContainANumber,
16893
+ shouldContainAnUppercase: shouldContainAnUppercase,
16894
+ shouldContainALowercase: shouldContainALowercase,
16895
+ shouldContainASymbol: shouldContainASymbol,
16844
16896
  showPassword: showPassword,
16845
16897
  sn: sn,
16846
16898
  submitButton: submitButton,
@@ -16867,6 +16919,8 @@ const stringsSchema = z
16867
16919
  backToLogin: z.string(),
16868
16920
  dontHaveAnAccount: z.string(),
16869
16921
  closeModal: z.string(),
16922
+ charactersCannotRepeatMoreThan: z.string(),
16923
+ charactersCannotRepeatMoreThanCaseInsensitive: z.string(),
16870
16924
  chooseDifferentUsername: z.string(),
16871
16925
  confirmPassword: z.string(),
16872
16926
  constraintViolationForPassword: z.string(),
@@ -16899,6 +16953,9 @@ const stringsSchema = z
16899
16953
  notToExceedMaximumCharacterLength: z.string(),
16900
16954
  noLessThanMinimumCharacterLength: z.string(),
16901
16955
  passwordCallback: z.string(),
16956
+ passwordCannotContainCommonPasswords: z.string(),
16957
+ passwordCannotContainCommonPasswordsOrBeReversible: z.string(),
16958
+ passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: z.string(),
16902
16959
  passwordRequirements: z.string(),
16903
16960
  pleaseCheckValue: z.string(),
16904
16961
  pleaseConfirm: z.string(),
@@ -16913,6 +16970,10 @@ const stringsSchema = z
16913
16970
  securityAnswer: z.string(),
16914
16971
  securityQuestions: z.string(),
16915
16972
  securityQuestionsPrompt: z.string(),
16973
+ shouldContainANumber: z.string(),
16974
+ shouldContainAnUppercase: z.string(),
16975
+ shouldContainALowercase: z.string(),
16976
+ shouldContainASymbol: z.string(),
16916
16977
  showPassword: z.string(),
16917
16978
  sn: z.string(),
16918
16979
  submitButton: z.string(),
@@ -16936,6 +16997,11 @@ stringsSchema.partial();
16936
16997
  // Ensure fallback follows schema
16937
16998
  stringsSchema.parse(fallback);
16938
16999
  const stringsStore = writable(null);
17000
+ /**
17001
+ * initialize locale information for Login Widget
17002
+ * @param: userLocale - optional locale object to override default locale
17003
+ * @returns: a schema which represents the user locale schema
17004
+ */
16939
17005
  function initialize$5(userLocale) {
16940
17006
  if (userLocale) {
16941
17007
  /**
@@ -16955,6 +17021,14 @@ function initialize$5(userLocale) {
16955
17021
  * Demo: https://regex101.com/r/Mw9vTB/1
16956
17022
  */
16957
17023
  const valueSchema = z.record(z.string().regex(/^[^<>]*$/)).optional();
17024
+ /**
17025
+ * @function interpolate - Get a translation string
17026
+ * Interpolate a string that contains variables
17027
+ *
17028
+ * @param {string} key - The key to lookup in the translation strings
17029
+ * @param {object} values - An object of values to interpolate into the string
17030
+ * @param {string} externalText - A string to use if no translation is found
17031
+ */
16958
17032
  function interpolate(key, values, externalText) {
16959
17033
  // Let's throw some errors if we're trying to use keys/locales that don't exist.
16960
17034
  // We could improve this by using Typescript and/or fallback values.
@@ -17026,6 +17100,31 @@ function interpolate(key, values, externalText) {
17026
17100
  });
17027
17101
  return messageClean;
17028
17102
  }
17103
+ /**
17104
+ * @function textToKey - Takes a human readable string and returns a key from it.
17105
+ * This key is used to look up the string in the translation files.
17106
+ *
17107
+ * If the item is a number, it will be converted to a string and then
17108
+ * processed as if it were a string.
17109
+ *
17110
+ * If the item is a string that contains word characters (`\w`) mixed with
17111
+ * non-word characters (`\W`), the non-word characters will be removed and
17112
+ * the resulting string will be converted to camelCase.
17113
+ *
17114
+ * @param {string} text - The text that will be converted to a key.
17115
+ * @returns {string} A key that is unique to the given text.
17116
+ *
17117
+ * Examples:
17118
+ * textToKey('hello world') => 'helloWorld'
17119
+ * textToKey('HELLO WORLD') => 'helloWorld'
17120
+ * textToKey('HELLO WORLD!!!') => 'helloWorld'
17121
+ * textToKey('HELLO WORLD!!!') => 'helloWorld'
17122
+ * textToKey('helloWorld') => 'helloWorld'
17123
+ * textToKey('helloWorld123') => 'helloWorld123'
17124
+ * textToKey('hello_world') => 'helloWorld'
17125
+ * textToKey('hello-world') => 'helloWorld'
17126
+ * textToKey('hello.world') => 'helloWorld'
17127
+ */
17029
17128
  function textToKey(text) {
17030
17129
  if (typeof text !== 'string' && typeof text !== 'number') {
17031
17130
  throw new Error('Parameter for textToKey function needs to be of type string or number');
@@ -17167,7 +17266,9 @@ const userInputCallbacks = [
17167
17266
  CallbackType$1.ValidatedCreatePasswordCallback,
17168
17267
  CallbackType$1.ValidatedCreateUsernameCallback,
17169
17268
  ];
17170
- // This eventually will be overridable by user of framework
17269
+ /**
17270
+ * @function forceUserInputOptionalityCallbacks - Determines if a callback should be forced to be optional
17271
+ */
17171
17272
  const forceUserInputOptionalityCallbacks = {
17172
17273
  SelectIdPCallback: (callback) => {
17173
17274
  const selectIdpCb = callback;
@@ -17176,6 +17277,11 @@ const forceUserInputOptionalityCallbacks = {
17176
17277
  .find((provider) => provider.provider === 'localAuthentication');
17177
17278
  },
17178
17279
  };
17280
+ /**
17281
+ * @function isCbReadyByDefault - Determines if a callback is ready to be submitted by default
17282
+ * @param {object} callback - Generic FRCallback from JavaScript SDK
17283
+ * @returns {boolean}
17284
+ */
17179
17285
  function isCbReadyByDefault(callback) {
17180
17286
  if (callback.getType() === CallbackType$1.ConfirmationCallback) {
17181
17287
  const cb = callback;
@@ -17185,6 +17291,11 @@ function isCbReadyByDefault(callback) {
17185
17291
  }
17186
17292
  return false;
17187
17293
  }
17294
+ /**
17295
+ * @function canForceUserInputOptionality
17296
+ * @param {object} callback - generic FRCallback from JavaScript SDK
17297
+ * @returns
17298
+ */
17188
17299
  function canForceUserInputOptionality(callback) {
17189
17300
  // See if a callback function exists within this collection
17190
17301
  const fn = forceUserInputOptionalityCallbacks[callback.getType()];
@@ -17212,9 +17323,9 @@ function isStepSelfSubmittable(callbacks, userInputOptional) {
17212
17323
  return !unsubmittableCallbacks.length;
17213
17324
  }
17214
17325
  /**
17215
- *
17326
+ * @function requiresUserInput - Determines if a callback requires user input
17216
17327
  * @param {object} callback - Generic callback provided by JavaScript SDK
17217
- * @returns
17328
+ * @returns {boolean}
17218
17329
  */
17219
17330
  function requiresUserInput(callback) {
17220
17331
  if (callback.getType() === CallbackType$1.SelectIdPCallback) {
@@ -17230,6 +17341,22 @@ function requiresUserInput(callback) {
17230
17341
  }
17231
17342
  // Notice this function can take a user provided argument function to
17232
17343
  // override behavior (this doesn't have to be well defined)
17344
+ /**
17345
+ * @function isUserInputOptional - Determines if user input is optional
17346
+ * Notice this function can take a user provided argument function to
17347
+ * override behavior (this doesn't have to be well defined)
17348
+ * @param {array} callbackMetadataArray - array of callback metadata
17349
+ * @param {number} numOfUserInputCbs - number of user input requiring callbacks
17350
+ * @param {function} fn - optional function to override default behavior
17351
+ * @returns {boolean} - true if user input is optional
17352
+ * @example isUserInputOptional(callbackMetadataArray, numOfUserInputCbs, (prev, curr) => {
17353
+ * if (curr.derived.canForceUserInputOptionality && numOfUserInputCbs > 0) {
17354
+ * prev = true;
17355
+ * }
17356
+ * return prev;
17357
+ * })
17358
+ * @example isUserInputOptional(callbackMetadataArray, numOfUserInputCbs);
17359
+ */
17233
17360
  function isUserInputOptional(callbackMetadataArray, numOfUserInputCbs, fn) {
17234
17361
  // default reducer function to check if both overriding callback exists
17235
17362
  // along with user input required callbacks
@@ -17246,7 +17373,7 @@ function isUserInputOptional(callbackMetadataArray, numOfUserInputCbs, fn) {
17246
17373
  /**
17247
17374
  * @function buildCallbackMetadata - Constructs an array of callback metadata that matches to original callback array
17248
17375
  * @param {object} step - The modified Widget step object
17249
- * @param checkValidation - function that checks if current callback is the first invalid callback
17376
+ * @param {function} checkValidation - function that checks if current callback is the first invalid callback
17250
17377
  * @returns {array}
17251
17378
  */
17252
17379
  function buildCallbackMetadata(step, checkValidation, stageJson) {
@@ -17694,6 +17821,12 @@ const linksSchema = z
17694
17821
  .strict();
17695
17822
  linksSchema.partial();
17696
17823
  const linksStore = writable();
17824
+ /**
17825
+ * @function initialize - Initialize the links store
17826
+ * @param {object} customLinks - An object of custom links to merge with the default
17827
+ * @returns {object} - The links store
17828
+ * @example initialize({ termsAndConditions: 'https://example.com/terms' });
17829
+ */
17697
17830
  function initialize$3(customLinks) {
17698
17831
  // If customLinks is provided, provide feedback for object
17699
17832
  if (customLinks) {
@@ -17716,7 +17849,19 @@ const oauthStore = writable({
17716
17849
  successful: false,
17717
17850
  response: null,
17718
17851
  });
17852
+ /**
17853
+ * @function initialize - Initializes the OAuth store with a get function and a reset function
17854
+ * @param {object} initOptions - The options to pass to the TokenManager.getTokens function
17855
+ * @returns {object} - The OAuth store
17856
+ * @example initialize({ query: { prompt: 'none' } });
17857
+ */
17719
17858
  function initialize$2(initOptions) {
17859
+ /**
17860
+ * Get tokens from the server
17861
+ * new tokens are available in the subscribe method
17862
+ * @params: getOptions?: GetTokensOptions
17863
+ * @returns: Promise<void>
17864
+ */
17720
17865
  async function get(getOptions) {
17721
17866
  /**
17722
17867
  * Create an options object with getOptions overriding anything from initOptions
@@ -17784,7 +17929,18 @@ const userStore = writable({
17784
17929
  successful: false,
17785
17930
  response: null,
17786
17931
  });
17932
+ /**
17933
+ * @function initialize - Initializes the user store with a get function and a reset function
17934
+ * @param {object} initOptions - The options to pass to the UserManager.getCurrentUser function
17935
+ * @returns {object} - The user store
17936
+ */
17787
17937
  function initialize$1(initOptions) {
17938
+ /**
17939
+ * Get user info from the server
17940
+ * New state is returned in your `userEvents.subscribe` callback function
17941
+ * @params: getOptions?: ConfigOptions
17942
+ * @returns: Promise<void>
17943
+ */
17788
17944
  async function get(getOptions) {
17789
17945
  /**
17790
17946
  * Create an options object with getOptions overriding anything from initOptions
@@ -17876,6 +18032,12 @@ const fallbackStyles = {
17876
18032
  stage: undefined,
17877
18033
  };
17878
18034
  const styleStore = writable(fallbackStyles);
18035
+ /**
18036
+ * @function initialize - Initialize the style store
18037
+ * @param {object} customStyle - An object of custom styles to merge with the default
18038
+ * @returns {object} - The style store
18039
+ * @example initialize({ checksAndRadios: 'standard' });
18040
+ */
17879
18041
  function initialize(customStyle) {
17880
18042
  if (customStyle) {
17881
18043
  styleSchema.parse(customStyle);
@@ -17887,6 +18049,17 @@ function initialize(customStyle) {
17887
18049
  return styleStore;
17888
18050
  }
17889
18051
 
18052
+ /**
18053
+ * @function widgetApiFactory - Creates the widget API
18054
+ * @param {object} componentApi - The component API
18055
+ * @returns {object} - The widget API
18056
+ * @property {object} componentApi - The component API for either inline or modal
18057
+ * @property {object} configuration - Sets the configuration for the widget
18058
+ * @property {function} getStores - Returns the stores: journeyStore, oauthStore, userStore
18059
+ * @property {object} journey - the journey API
18060
+ * @property {function} request - The HttpClient.request function from the SDK
18061
+ * @property {object} user - the user API
18062
+ */
17890
18063
  function widgetApiFactory(componentApi) {
17891
18064
  let journeyStore;
17892
18065
  let oauthStore;
@@ -17935,6 +18108,10 @@ function widgetApiFactory(componentApi) {
17935
18108
  initialize$3(options?.links);
17936
18109
  initialize(options?.style);
17937
18110
  return {
18111
+ /** Set the Login Widget's Configuration
18112
+ * @param {WidgetConfigOptions} options - The configuration options for the Login Widget
18113
+ * @returns {void}
18114
+ **/
17938
18115
  set(setOptions) {
17939
18116
  if (setOptions?.forgerock) {
17940
18117
  configure({
@@ -18056,6 +18233,11 @@ function widgetApiFactory(componentApi) {
18056
18233
  return { change, start, subscribe };
18057
18234
  };
18058
18235
  const user = {
18236
+ /**
18237
+ * User Info
18238
+ * @param: void
18239
+ * @returns: UserStore
18240
+ */
18059
18241
  info() {
18060
18242
  if (!journeyStore || !oauthStore || !userStore) {
18061
18243
  logErrorAndThrow('missingStores');
@@ -18078,6 +18260,12 @@ function widgetApiFactory(componentApi) {
18078
18260
  }
18079
18261
  return { get: wrappedGet, subscribe };
18080
18262
  },
18263
+ /**
18264
+ * Logout a user from an AM Session
18265
+ * @async
18266
+ * @param: void
18267
+ * @returns: Promise<void>
18268
+ **/
18081
18269
  async logout() {
18082
18270
  if (!journeyStore || !oauthStore || !userStore) {
18083
18271
  logErrorAndThrow('missingStores');
@@ -18106,6 +18294,11 @@ function widgetApiFactory(componentApi) {
18106
18294
  // Return undefined as there's no response information to share
18107
18295
  return;
18108
18296
  },
18297
+ /**
18298
+ * Returns the widget's Tokens object
18299
+ * @param void;
18300
+ * @returns OAuthStore
18301
+ */
18109
18302
  tokens() {
18110
18303
  if (!journeyStore || !oauthStore || !userStore) {
18111
18304
  logErrorAndThrow('missingStores');
@@ -20588,6 +20781,11 @@ function matchJourneyAndDecideAction(href, journeys, stack) {
20588
20781
  /** *********************************************
20589
20782
  * NEW "NORMALIZED" METHODS
20590
20783
  */
20784
+ /**
20785
+ * @function getInputTypeFromPolicies - Determines the type of input to use based on the policies object
20786
+ * @param {object} policies - The policies object from the callback
20787
+ * @returns {string} - The type of input to use
20788
+ */
20591
20789
  function getInputTypeFromPolicies(policies) {
20592
20790
  const value = policies?.value;
20593
20791
  if (typeof value !== 'object') {
@@ -20605,13 +20803,47 @@ function getInputTypeFromPolicies(policies) {
20605
20803
  }
20606
20804
  return 'text';
20607
20805
  }
20806
+ /**
20807
+ * @function getValidationFailureParams - Gets the validation failure params from the failed policy object
20808
+ * @param {object} failedPolicy - The failed policy object from the callback
20809
+ * @returns {array} - An array of objects containing the length, message, and rule
20810
+ */
20608
20811
  function getValidationFailureParams(failedPolicy) {
20609
- if (failedPolicy?.policyRequirement === 'CHARACTER_SET') {
20610
- const params = failedPolicy?.params;
20812
+ if (failedPolicy?.policyRequirement === 'DICTIONARY') {
20813
+ const params = failedPolicy.params;
20814
+ const min = params?.['min-substring-length'] || 0;
20815
+ const arr = [];
20816
+ if (params?.['check-substrings'] && params?.['test-reversed-password']) {
20817
+ arr.push({
20818
+ length: min,
20819
+ message: interpolate('passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan', {
20820
+ min: String(min),
20821
+ }),
20822
+ rule: 'reversibleSubstrings',
20823
+ });
20824
+ }
20825
+ else if (params?.['test-reversed-password']) {
20826
+ arr.push({
20827
+ length: null,
20828
+ message: interpolate('passwordCannotContainCommonPasswordsOrBeReversible'),
20829
+ rule: 'reversibleSubstrings',
20830
+ });
20831
+ }
20832
+ else {
20833
+ arr.push({
20834
+ length: null,
20835
+ message: interpolate('passwordCannotContainCommonPasswords'),
20836
+ rule: 'reversibleSubstrings',
20837
+ });
20838
+ }
20839
+ return arr;
20840
+ }
20841
+ else if (failedPolicy?.policyRequirement === 'CHARACTER_SET') {
20842
+ const params = failedPolicy.params;
20611
20843
  return params?.['character-sets'].map(convertCharacterSetToRuleObj);
20612
20844
  }
20613
20845
  else if (failedPolicy?.policyRequirement === 'LENGTH_BASED') {
20614
- const params = failedPolicy?.params;
20846
+ const params = failedPolicy.params;
20615
20847
  const min = params?.['min-password-length'] || 0;
20616
20848
  const max = params?.['max-password-length'] || null;
20617
20849
  const arr = [];
@@ -20631,6 +20863,26 @@ function getValidationFailureParams(failedPolicy) {
20631
20863
  }
20632
20864
  return arr;
20633
20865
  }
20866
+ else if (failedPolicy?.policyRequirement === 'REPEATED_CHARACTERS') {
20867
+ const params = failedPolicy.params;
20868
+ const max = params['max-consecutive-length'] || 0;
20869
+ const arr = [];
20870
+ if (!params['case-sensitive-validation']) {
20871
+ arr.push({
20872
+ length: max,
20873
+ message: interpolate('charactersCannotRepeatMoreThanCaseInsensitive', { max: String(max) }),
20874
+ rule: 'repeatedCharactersCaseInsensitive',
20875
+ });
20876
+ }
20877
+ else {
20878
+ arr.push({
20879
+ length: max,
20880
+ message: interpolate('charactersCannotRepeatMoreThan', { max: String(max) }),
20881
+ rule: 'repeatedCharacters',
20882
+ });
20883
+ }
20884
+ return arr;
20885
+ }
20634
20886
  else if (failedPolicy?.policyRequirement === 'VALID_USERNAME') {
20635
20887
  return [
20636
20888
  {
@@ -20659,6 +20911,11 @@ function getValidationFailureParams(failedPolicy) {
20659
20911
  ];
20660
20912
  }
20661
20913
  }
20914
+ /**
20915
+ * @function getValidationMessageString - Gets the validation message string from the policy object
20916
+ * @param {object} policy - The policy object from the callback
20917
+ * @returns {string} - The validation message string
20918
+ */
20662
20919
  function getValidationMessageString(policy) {
20663
20920
  switch (policy?.policyId) {
20664
20921
  case 'at-least-X-capitals': {
@@ -20742,6 +20999,12 @@ function getValidationMessageString(policy) {
20742
20999
  return '';
20743
21000
  }
20744
21001
  }
21002
+ /**
21003
+ * @function getValidationFailures - Gets the validation failures from the callback object
21004
+ * @param {object} callback - The callback object from the server
21005
+ * @param {string} label - The label of the field
21006
+ * @returns {array} - An array of failed policies
21007
+ */
20745
21008
  function getValidationFailures(callback, label) {
20746
21009
  const failedPolicies = callback.getFailedPolicies && callback.getFailedPolicies();
20747
21010
  const parsedPolicies = parseFailedPolicies(failedPolicies, label);
@@ -20753,6 +21016,11 @@ function getValidationFailures(callback, label) {
20753
21016
  };
20754
21017
  });
20755
21018
  }
21019
+ /**
21020
+ * @function getValidationPolicies - Gets the validation policies from the callback object
21021
+ * @param {object} policies - The policies object from the callback
21022
+ * @returns {array} - An array of policies
21023
+ */
20756
21024
  function getValidationPolicies(policies) {
20757
21025
  if (typeof policies !== 'object' && !policies) {
20758
21026
  return [];
@@ -20771,6 +21039,11 @@ function getValidationPolicies(policies) {
20771
21039
  })
20772
21040
  .filter((policy) => !!policy.message);
20773
21041
  }
21042
+ /**
21043
+ * @function isInputRequired - Checks if the input is required
21044
+ * @param {object} callback - The callback object from the server
21045
+ * @returns {boolean} - Whether the input is required
21046
+ */
20774
21047
  function isInputRequired(callback) {
20775
21048
  const policies = callback.getPolicies && callback.getPolicies();
20776
21049
  let isRequired = false;
@@ -20782,46 +21055,93 @@ function isInputRequired(callback) {
20782
21055
  }
20783
21056
  return isRequired;
20784
21057
  }
21058
+ /**
21059
+ * @function convertCharacterSetToRuleObj - Converts a character set to a rule object
21060
+ * @param {string} set - The character set to convert
21061
+ * @returns {object} - The rule object
21062
+ */
20785
21063
  function convertCharacterSetToRuleObj(set) {
20786
21064
  const arr = set.split(':');
20787
21065
  const num = arr[0];
20788
21066
  const type = arr[1];
20789
21067
  if (type === '0123456789') {
20790
- return {
20791
- length: Number(num),
20792
- message: interpolate('minimumNumberOfNumbers', { num: String(num) }),
20793
- rule: 'numbers',
20794
- };
21068
+ if (num === '0') {
21069
+ return {
21070
+ length: null,
21071
+ message: interpolate('shouldContainANumber'),
21072
+ rule: 'numbers',
21073
+ };
21074
+ }
21075
+ else {
21076
+ return {
21077
+ length: Number(num),
21078
+ message: interpolate('minimumNumberOfNumbers', { num: String(num) }),
21079
+ rule: 'numbers',
21080
+ };
21081
+ }
20795
21082
  }
20796
21083
  else if (type === 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') {
20797
- return {
20798
- length: Number(num),
20799
- message: interpolate('minimumNumberOfUppercase', { num: String(num) }),
20800
- rule: 'uppercase',
20801
- };
21084
+ if (num === '0') {
21085
+ return {
21086
+ length: null,
21087
+ message: interpolate('shouldContainAnUppercase'),
21088
+ rule: 'uppercase',
21089
+ };
21090
+ }
21091
+ else {
21092
+ return {
21093
+ length: Number(num),
21094
+ message: interpolate('minimumNumberOfUppercase', { num: String(num) }),
21095
+ rule: 'uppercase',
21096
+ };
21097
+ }
20802
21098
  }
20803
21099
  else if (type === 'abcdefghijklmnopqrstuvwxyz') {
20804
- return {
20805
- length: Number(num),
20806
- message: interpolate('minimumNumberOfLowercase', { num: String(num) }),
20807
- rule: 'lowercase',
20808
- };
21100
+ if (num === '0') {
21101
+ return {
21102
+ length: null,
21103
+ message: interpolate('shouldContainALowercase'),
21104
+ rule: 'lowercase',
21105
+ };
21106
+ }
21107
+ else {
21108
+ return {
21109
+ length: Number(num),
21110
+ message: interpolate('minimumNumberOfLowercase', { num: String(num) }),
21111
+ rule: 'lowercase',
21112
+ };
21113
+ }
20809
21114
  }
20810
21115
  else if (type.includes('@') || type.includes('!') || type.includes('*') || type.includes('#')) {
20811
- return {
20812
- length: Number(num),
20813
- message: interpolate('minimumNumberOfSymbols', { num: String(num) }),
20814
- rule: 'symbols',
20815
- };
21116
+ if (num === '0') {
21117
+ return {
21118
+ length: null,
21119
+ message: interpolate('shouldContainASymbol'),
21120
+ rule: 'symbols',
21121
+ };
21122
+ }
21123
+ else {
21124
+ return {
21125
+ length: Number(num),
21126
+ message: interpolate('minimumNumberOfSymbols', { num: String(num) }),
21127
+ rule: 'symbols',
21128
+ };
21129
+ }
20816
21130
  }
20817
21131
  else {
20818
21132
  return {
20819
- length: Number(num),
21133
+ length: null,
20820
21134
  message: interpolate('pleaseCheckValue'),
20821
21135
  rule: 'unknown',
20822
21136
  };
20823
21137
  }
20824
21138
  }
21139
+ /**
21140
+ * @function parseFailedPolicies - Parses the failed policies from the callback object
21141
+ * @param {array} policies - The policies array from the callback
21142
+ * @param {string} label - The label of the field
21143
+ * @returns {array} - An array of failed policies
21144
+ */
20825
21145
  function parseFailedPolicies(policies, label) {
20826
21146
  return policies.map((policy) => {
20827
21147
  if (typeof policy === 'string') {
@@ -20837,8 +21157,10 @@ function parseFailedPolicies(policies, label) {
20837
21157
  }
20838
21158
  });
20839
21159
  }
20840
- /** *********************************************
20841
- * OLD METHODS
21160
+ /**
21161
+ * @function getAttributeValidationFailureText - Gets the validation failure text from the callback object
21162
+ * @param {object} callback - The callback object from the server
21163
+ * @returns {string} - The validation failure text
20842
21164
  */
20843
21165
  function getAttributeValidationFailureText(callback) {
20844
21166
  // TODO: Mature this utility for better parsing and display
@@ -21837,13 +22159,6 @@ function instance$I($$self, $$props, $$invalidate) {
21837
22159
  let validationFailure;
21838
22160
 
21839
22161
  function setValue(event) {
21840
- /** ***********************************************************************
21841
- * SDK INTEGRATION POINT
21842
- * Summary: SDK callback methods for setting values
21843
- * ------------------------------------------------------------------------
21844
- * Details: Each callback is wrapped by the SDK to provide helper methods
21845
- * for writing values to the callbacks received from AM
21846
- *********************************************************************** */
21847
22162
  callback.setInputValue(event.target.checked);
21848
22163
  }
21849
22164
 
@@ -23612,7 +23927,7 @@ function create_else_block$6(ctx) {
23612
23927
  };
23613
23928
  }
23614
23929
 
23615
- // (66:0) {#if callbackMetadata?.platform?.displayType === 'radio'}
23930
+ // (52:0) {#if callbackMetadata?.platform?.displayType === 'radio'}
23616
23931
  function create_if_block$f(ctx) {
23617
23932
  let radio;
23618
23933
  let current;
@@ -23767,13 +24082,6 @@ function instance$B($$self, $$props, $$invalidate) {
23767
24082
  * @param {Object} event
23768
24083
  */
23769
24084
  function setValue(event) {
23770
- /** ***********************************************************************
23771
- * SDK INTEGRATION POINT
23772
- * Summary: SDK callback methods for setting values
23773
- * ------------------------------------------------------------------------
23774
- * Details: Each callback is wrapped by the SDK to provide helper methods
23775
- * for writing values to the callbacks received from AM
23776
- *********************************************************************** */
23777
24085
  callback.setChoiceIndex(Number(event.target.value));
23778
24086
  }
23779
24087
 
@@ -23786,13 +24094,6 @@ function instance$B($$self, $$props, $$invalidate) {
23786
24094
  $$self.$$.update = () => {
23787
24095
  if ($$self.$$.dirty & /*callback, callbackMetadata, prompt*/ 2051) {
23788
24096
  {
23789
- /** *************************************************************************
23790
- * SDK INTEGRATION POINT
23791
- * Summary: SDK callback methods for getting values
23792
- * --------------------------------------------------------------------------
23793
- * Details: Each callback is wrapped by the SDK to provide helper methods
23794
- * for accessing values from the callbacks received from AM
23795
- ************************************************************************* */
23796
24097
  $$invalidate(2, choiceOptions = callback.getChoices()?.map((text, idx) => ({
23797
24098
  /**
23798
24099
  * Since locale content keys for the choice component are built off of the
@@ -23957,7 +24258,7 @@ function get_each_context$6(ctx, list, i) {
23957
24258
  return child_ctx;
23958
24259
  }
23959
24260
 
23960
- // (95:0) {#if stepMetadata?.platform?.stageName !== 'OneTimePassword'}
24261
+ // (81:0) {#if stepMetadata?.platform?.stageName !== 'OneTimePassword'}
23961
24262
  function create_if_block$e(ctx) {
23962
24263
  let current_block_type_index;
23963
24264
  let if_block;
@@ -24027,7 +24328,7 @@ function create_if_block$e(ctx) {
24027
24328
  };
24028
24329
  }
24029
24330
 
24030
- // (117:2) {:else}
24331
+ // (103:2) {:else}
24031
24332
  function create_else_block_1(ctx) {
24032
24333
  let grid;
24033
24334
  let current;
@@ -24073,7 +24374,7 @@ function create_else_block_1(ctx) {
24073
24374
  };
24074
24375
  }
24075
24376
 
24076
- // (96:2) {#if !stepMetadata?.derived.isStepSelfSubmittable}
24377
+ // (82:2) {#if !stepMetadata?.derived.isStepSelfSubmittable}
24077
24378
  function create_if_block_1$9(ctx) {
24078
24379
  let current_block_type_index;
24079
24380
  let if_block;
@@ -24143,7 +24444,7 @@ function create_if_block_1$9(ctx) {
24143
24444
  };
24144
24445
  }
24145
24446
 
24146
- // (120:8) <Button style={options.length > 1 && defaultChoice === Number(opt.value) ? 'primary' : buttonStyle} type="button" width="auto" onClick={() => setBtnValue(Number(opt.value))} >
24447
+ // (106:8) <Button style={options.length > 1 && defaultChoice === Number(opt.value) ? 'primary' : buttonStyle} type="button" width="auto" onClick={() => setBtnValue(Number(opt.value))} >
24147
24448
  function create_default_slot_2$5(ctx) {
24148
24449
  let t0_value = /*opt*/ ctx[15].text + "";
24149
24450
  let t0;
@@ -24168,7 +24469,7 @@ function create_default_slot_2$5(ctx) {
24168
24469
  };
24169
24470
  }
24170
24471
 
24171
- // (119:6) {#each options as opt}
24472
+ // (105:6) {#each options as opt}
24172
24473
  function create_each_block$6(ctx) {
24173
24474
  let button;
24174
24475
  let current;
@@ -24229,7 +24530,7 @@ function create_each_block$6(ctx) {
24229
24530
  };
24230
24531
  }
24231
24532
 
24232
- // (118:4) <Grid num={options.length}>
24533
+ // (104:4) <Grid num={options.length}>
24233
24534
  function create_default_slot_1$a(ctx) {
24234
24535
  let each_1_anchor;
24235
24536
  let current;
@@ -24313,7 +24614,7 @@ function create_default_slot_1$a(ctx) {
24313
24614
  };
24314
24615
  }
24315
24616
 
24316
- // (106:4) {:else}
24617
+ // (92:4) {:else}
24317
24618
  function create_else_block$5(ctx) {
24318
24619
  let checkbox;
24319
24620
  let current;
@@ -24364,7 +24665,7 @@ function create_else_block$5(ctx) {
24364
24665
  };
24365
24666
  }
24366
24667
 
24367
- // (97:4) {#if options.length > 1}
24668
+ // (83:4) {#if options.length > 1}
24368
24669
  function create_if_block_2$8(ctx) {
24369
24670
  let select;
24370
24671
  let current;
@@ -24411,7 +24712,7 @@ function create_if_block_2$8(ctx) {
24411
24712
  };
24412
24713
  }
24413
24714
 
24414
- // (107:6) <Checkbox isFirstInvalidInput={callbackMetadata?.derived.isFirstInvalidInput || false} isInvalid={false} key={inputName} onChange={setCheckboxValue} value={false} >
24715
+ // (93:6) <Checkbox isFirstInvalidInput={callbackMetadata?.derived.isFirstInvalidInput || false} isInvalid={false} key={inputName} onChange={setCheckboxValue} value={false} >
24415
24716
  function create_default_slot$h(ctx) {
24416
24717
  let t_value = /*options*/ ctx[3][0].text + "";
24417
24718
  let t;
@@ -24523,13 +24824,6 @@ function instance$z($$self, $$props, $$invalidate) {
24523
24824
  * @param {Object} event
24524
24825
  */
24525
24826
  function setOptionValue(event) {
24526
- /** ***********************************************************************
24527
- * SDK INTEGRATION POINT
24528
- * Summary: SDK callback methods for setting values
24529
- * ------------------------------------------------------------------------
24530
- * Details: Each callback is wrapped by the SDK to provide helper methods
24531
- * for writing values to the callbacks received from AM
24532
- *********************************************************************** */
24533
24827
  callback.setOptionIndex(Number(event.target.value));
24534
24828
  }
24535
24829
 
@@ -24538,13 +24832,6 @@ function instance$z($$self, $$props, $$invalidate) {
24538
24832
  * @param {Object} event
24539
24833
  */
24540
24834
  function setCheckboxValue(event) {
24541
- /** ***********************************************************************
24542
- * SDK INTEGRATION POINT
24543
- * Summary: SDK callback methods for setting values
24544
- * ------------------------------------------------------------------------
24545
- * Details: Each callback is wrapped by the SDK to provide helper methods
24546
- * for writing values to the callbacks received from AM
24547
- *********************************************************************** */
24548
24835
  const value = event.target.checked;
24549
24836
 
24550
24837
  if (value) {
@@ -26556,15 +26843,7 @@ function instance$t($$self, $$props, $$invalidate) {
26556
26843
  ? Stacked_label$1
26557
26844
  : Floating_label$1;
26558
26845
 
26559
- /** *************************************************************************
26560
- * SDK INTEGRATION POINT
26561
- * Summary: SDK callback methods for getting values
26562
- * --------------------------------------------------------------------------
26563
- * Details: Each callback is wrapped by the SDK to provide helper methods
26564
- * for accessing values from the callbacks received from AM
26565
- ************************************************************************* */
26566
26846
  let customQuestionIndex = null;
26567
-
26568
26847
  let displayCustomQuestionInput = false;
26569
26848
  let inputArr;
26570
26849
  let inputName;
@@ -26592,13 +26871,6 @@ function instance$t($$self, $$props, $$invalidate) {
26592
26871
  * @param {Object} event
26593
26872
  */
26594
26873
  function setAnswer(event) {
26595
- /** ***********************************************************************
26596
- * SDK INTEGRATION POINT
26597
- * Summary: SDK callback methods for setting values
26598
- * ------------------------------------------------------------------------
26599
- * Details: Each callback is wrapped by the SDK to provide helper methods
26600
- * for writing values to the callbacks received from AM
26601
- *********************************************************************** */
26602
26874
  callback.setAnswer(event.target.value);
26603
26875
  }
26604
26876
 
@@ -26615,14 +26887,6 @@ function instance$t($$self, $$props, $$invalidate) {
26615
26887
  callback.setAnswer('');
26616
26888
  } else {
26617
26889
  $$invalidate(3, displayCustomQuestionInput = false);
26618
-
26619
- /** ***********************************************************************
26620
- * SDK INTEGRATION POINT
26621
- * Summary: SDK callback methods for setting values
26622
- * ------------------------------------------------------------------------
26623
- * Details: Each callback is wrapped by the SDK to provide helper methods
26624
- * for writing values to the callbacks received from AM
26625
- *********************************************************************** */
26626
26890
  callback.setQuestion(selectValue);
26627
26891
  }
26628
26892
  }
@@ -26633,14 +26897,6 @@ function instance$t($$self, $$props, $$invalidate) {
26633
26897
  */
26634
26898
  function setQuestion(event) {
26635
26899
  const inputValue = event.target.value;
26636
-
26637
- /** ***********************************************************************
26638
- * SDK INTEGRATION POINT
26639
- * Summary: SDK callback methods for setting values
26640
- * ------------------------------------------------------------------------
26641
- * Details: Each callback is wrapped by the SDK to provide helper methods
26642
- * for writing values to the callbacks received from AM
26643
- *********************************************************************** */
26644
26900
  callback.setQuestion(inputValue);
26645
26901
  }
26646
26902
 
@@ -27131,8 +27387,8 @@ class Eye_icon extends SvelteComponent {
27131
27387
 
27132
27388
  function create_default_slot_1$8(ctx) {
27133
27389
  let current;
27134
- const default_slot_template = /*#slots*/ ctx[12].default;
27135
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[13], null);
27390
+ const default_slot_template = /*#slots*/ ctx[14].default;
27391
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[15], null);
27136
27392
 
27137
27393
  return {
27138
27394
  c() {
@@ -27147,15 +27403,15 @@ function create_default_slot_1$8(ctx) {
27147
27403
  },
27148
27404
  p(ctx, dirty) {
27149
27405
  if (default_slot) {
27150
- if (default_slot.p && (!current || dirty & /*$$scope*/ 8192)) {
27406
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 32768)) {
27151
27407
  update_slot_base(
27152
27408
  default_slot,
27153
27409
  default_slot_template,
27154
27410
  ctx,
27155
- /*$$scope*/ ctx[13],
27411
+ /*$$scope*/ ctx[15],
27156
27412
  !current
27157
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[13])
27158
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[13], dirty, null),
27413
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[15])
27414
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[15], dirty, null),
27159
27415
  null
27160
27416
  );
27161
27417
  }
@@ -27176,7 +27432,7 @@ function create_default_slot_1$8(ctx) {
27176
27432
  };
27177
27433
  }
27178
27434
 
27179
- // (47:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible} >
27435
+ // (59:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27180
27436
  function create_default_slot$f(ctx) {
27181
27437
  let t;
27182
27438
  let current;
@@ -27206,7 +27462,7 @@ function create_default_slot$f(ctx) {
27206
27462
  };
27207
27463
  }
27208
27464
 
27209
- // (41:2)
27465
+ // (53:2)
27210
27466
  function create_input_button_slot$1(ctx) {
27211
27467
  let button;
27212
27468
  let eyeicon;
@@ -27245,7 +27501,7 @@ function create_input_button_slot$1(ctx) {
27245
27501
  const eyeicon_changes = {};
27246
27502
  if (dirty & /*isVisible*/ 64) eyeicon_changes.visible = /*isVisible*/ ctx[6];
27247
27503
 
27248
- if (dirty & /*$$scope*/ 8192) {
27504
+ if (dirty & /*$$scope*/ 32768) {
27249
27505
  eyeicon_changes.$$scope = { dirty, ctx };
27250
27506
  }
27251
27507
 
@@ -27278,18 +27534,18 @@ function create_fragment$q(ctx) {
27278
27534
  forceValidityFailure: /*forceValidityFailure*/ ctx[0],
27279
27535
  isFirstInvalidInput: false,
27280
27536
  hasRightIcon: true,
27281
- key: `${/*key*/ ctx[1]}-confirm`,
27537
+ key: `${/*key*/ ctx[3]}-confirm`,
27282
27538
  label: interpolate('confirmPassword', null, 'Confirm Password'),
27283
- message: /*isInvalid*/ ctx[3]
27539
+ message: /*isInvalid*/ ctx[1]
27284
27540
  ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27285
27541
  : undefined,
27286
- onChange: /*onChange*/ ctx[2],
27287
- isInvalid: /*isInvalid*/ ctx[3],
27288
- isRequired: /*isRequired*/ ctx[4],
27289
- showMessage: /*showMessage*/ ctx[5],
27542
+ onChange: /*onChangeWrapper*/ ctx[9],
27543
+ isInvalid: /*isInvalid*/ ctx[1],
27544
+ isRequired: /*isRequired*/ ctx[2],
27545
+ showMessage: /*showMessage*/ ctx[4],
27290
27546
  type: /*type*/ ctx[7],
27291
- value: typeof /*value*/ ctx[9] === 'string'
27292
- ? /*value*/ ctx[9]
27547
+ value: typeof /*value*/ ctx[5] === 'string'
27548
+ ? /*value*/ ctx[5]
27293
27549
  : '',
27294
27550
  $$slots: {
27295
27551
  "input-button": [create_input_button_slot$1],
@@ -27310,19 +27566,22 @@ function create_fragment$q(ctx) {
27310
27566
  p(ctx, [dirty]) {
27311
27567
  const input_changes = {};
27312
27568
  if (dirty & /*forceValidityFailure*/ 1) input_changes.forceValidityFailure = /*forceValidityFailure*/ ctx[0];
27313
- if (dirty & /*key*/ 2) input_changes.key = `${/*key*/ ctx[1]}-confirm`;
27569
+ if (dirty & /*key*/ 8) input_changes.key = `${/*key*/ ctx[3]}-confirm`;
27314
27570
 
27315
- if (dirty & /*isInvalid*/ 8) input_changes.message = /*isInvalid*/ ctx[3]
27571
+ if (dirty & /*isInvalid*/ 2) input_changes.message = /*isInvalid*/ ctx[1]
27316
27572
  ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27317
27573
  : undefined;
27318
27574
 
27319
- if (dirty & /*onChange*/ 4) input_changes.onChange = /*onChange*/ ctx[2];
27320
- if (dirty & /*isInvalid*/ 8) input_changes.isInvalid = /*isInvalid*/ ctx[3];
27321
- if (dirty & /*isRequired*/ 16) input_changes.isRequired = /*isRequired*/ ctx[4];
27322
- if (dirty & /*showMessage*/ 32) input_changes.showMessage = /*showMessage*/ ctx[5];
27575
+ if (dirty & /*isInvalid*/ 2) input_changes.isInvalid = /*isInvalid*/ ctx[1];
27576
+ if (dirty & /*isRequired*/ 4) input_changes.isRequired = /*isRequired*/ ctx[2];
27577
+ if (dirty & /*showMessage*/ 16) input_changes.showMessage = /*showMessage*/ ctx[4];
27323
27578
  if (dirty & /*type*/ 128) input_changes.type = /*type*/ ctx[7];
27324
27579
 
27325
- if (dirty & /*$$scope, isVisible*/ 8256) {
27580
+ if (dirty & /*value*/ 32) input_changes.value = typeof /*value*/ ctx[5] === 'string'
27581
+ ? /*value*/ ctx[5]
27582
+ : '';
27583
+
27584
+ if (dirty & /*$$scope, isVisible*/ 32832) {
27326
27585
  input_changes.$$scope = { dirty, ctx };
27327
27586
  }
27328
27587
 
@@ -27346,10 +27605,11 @@ function create_fragment$q(ctx) {
27346
27605
  function instance$q($$self, $$props, $$invalidate) {
27347
27606
  let { $$slots: slots = {}, $$scope } = $$props;
27348
27607
  let { forceValidityFailure = false } = $$props;
27349
- let { key } = $$props;
27350
- let { onChange } = $$props;
27351
27608
  let { isInvalid = false } = $$props;
27352
27609
  let { isRequired = true } = $$props;
27610
+ let { key } = $$props;
27611
+ let { onChange } = $$props;
27612
+ let { resetValue } = $$props;
27353
27613
  let { style = {} } = $$props;
27354
27614
  const Input = style.labels === 'stacked' ? Stacked_label : Floating_label;
27355
27615
  let { showMessage = undefined } = $$props;
@@ -27357,6 +27617,13 @@ function instance$q($$self, $$props, $$invalidate) {
27357
27617
  let type = 'password';
27358
27618
  let value;
27359
27619
 
27620
+ function onChangeWrapper(event) {
27621
+ $$invalidate(5, value = event.target?.value);
27622
+
27623
+ // TODO: revisit this logic to avoid unnecessary ternary
27624
+ onChange(typeof value === 'string' ? value : undefined);
27625
+ }
27626
+
27360
27627
  /**
27361
27628
  * @function toggleVisibility - toggles the password from masked to plaintext
27362
27629
  */
@@ -27367,27 +27634,41 @@ function instance$q($$self, $$props, $$invalidate) {
27367
27634
 
27368
27635
  $$self.$$set = $$props => {
27369
27636
  if ('forceValidityFailure' in $$props) $$invalidate(0, forceValidityFailure = $$props.forceValidityFailure);
27370
- if ('key' in $$props) $$invalidate(1, key = $$props.key);
27371
- if ('onChange' in $$props) $$invalidate(2, onChange = $$props.onChange);
27372
- if ('isInvalid' in $$props) $$invalidate(3, isInvalid = $$props.isInvalid);
27373
- if ('isRequired' in $$props) $$invalidate(4, isRequired = $$props.isRequired);
27374
- if ('style' in $$props) $$invalidate(11, style = $$props.style);
27375
- if ('showMessage' in $$props) $$invalidate(5, showMessage = $$props.showMessage);
27376
- if ('$$scope' in $$props) $$invalidate(13, $$scope = $$props.$$scope);
27637
+ if ('isInvalid' in $$props) $$invalidate(1, isInvalid = $$props.isInvalid);
27638
+ if ('isRequired' in $$props) $$invalidate(2, isRequired = $$props.isRequired);
27639
+ if ('key' in $$props) $$invalidate(3, key = $$props.key);
27640
+ if ('onChange' in $$props) $$invalidate(11, onChange = $$props.onChange);
27641
+ if ('resetValue' in $$props) $$invalidate(12, resetValue = $$props.resetValue);
27642
+ if ('style' in $$props) $$invalidate(13, style = $$props.style);
27643
+ if ('showMessage' in $$props) $$invalidate(4, showMessage = $$props.showMessage);
27644
+ if ('$$scope' in $$props) $$invalidate(15, $$scope = $$props.$$scope);
27645
+ };
27646
+
27647
+ $$self.$$.update = () => {
27648
+ if ($$self.$$.dirty & /*resetValue, onChange, value*/ 6176) {
27649
+ {
27650
+ if (resetValue) {
27651
+ $$invalidate(5, value = undefined);
27652
+ onChange(value);
27653
+ }
27654
+ }
27655
+ }
27377
27656
  };
27378
27657
 
27379
27658
  return [
27380
27659
  forceValidityFailure,
27381
- key,
27382
- onChange,
27383
27660
  isInvalid,
27384
27661
  isRequired,
27662
+ key,
27385
27663
  showMessage,
27664
+ value,
27386
27665
  isVisible,
27387
27666
  type,
27388
27667
  Input,
27389
- value,
27668
+ onChangeWrapper,
27390
27669
  toggleVisibility,
27670
+ onChange,
27671
+ resetValue,
27391
27672
  style,
27392
27673
  slots,
27393
27674
  $$scope
@@ -27400,12 +27681,13 @@ class Confirm_input extends SvelteComponent {
27400
27681
 
27401
27682
  init(this, options, instance$q, create_fragment$q, safe_not_equal, {
27402
27683
  forceValidityFailure: 0,
27403
- key: 1,
27404
- onChange: 2,
27405
- isInvalid: 3,
27406
- isRequired: 4,
27407
- style: 11,
27408
- showMessage: 5
27684
+ isInvalid: 1,
27685
+ isRequired: 2,
27686
+ key: 3,
27687
+ onChange: 11,
27688
+ resetValue: 12,
27689
+ style: 13,
27690
+ showMessage: 4
27409
27691
  });
27410
27692
  }
27411
27693
  }
@@ -27414,8 +27696,8 @@ class Confirm_input extends SvelteComponent {
27414
27696
 
27415
27697
  function create_default_slot_1$7(ctx) {
27416
27698
  let current;
27417
- const default_slot_template = /*#slots*/ ctx[19].default;
27418
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[20], null);
27699
+ const default_slot_template = /*#slots*/ ctx[21].default;
27700
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[22], null);
27419
27701
 
27420
27702
  return {
27421
27703
  c() {
@@ -27430,15 +27712,15 @@ function create_default_slot_1$7(ctx) {
27430
27712
  },
27431
27713
  p(ctx, dirty) {
27432
27714
  if (default_slot) {
27433
- if (default_slot.p && (!current || dirty & /*$$scope*/ 1048576)) {
27715
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 4194304)) {
27434
27716
  update_slot_base(
27435
27717
  default_slot,
27436
27718
  default_slot_template,
27437
27719
  ctx,
27438
- /*$$scope*/ ctx[20],
27720
+ /*$$scope*/ ctx[22],
27439
27721
  !current
27440
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[20])
27441
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[20], dirty, null),
27722
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[22])
27723
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[22], dirty, null),
27442
27724
  null
27443
27725
  );
27444
27726
  }
@@ -27459,7 +27741,7 @@ function create_default_slot_1$7(ctx) {
27459
27741
  };
27460
27742
  }
27461
27743
 
27462
- // (82:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible} >
27744
+ // (94:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27463
27745
  function create_default_slot$e(ctx) {
27464
27746
  let t;
27465
27747
  let current;
@@ -27489,7 +27771,7 @@ function create_default_slot$e(ctx) {
27489
27771
  };
27490
27772
  }
27491
27773
 
27492
- // (76:2)
27774
+ // (88:2)
27493
27775
  function create_input_button_slot(ctx) {
27494
27776
  let button;
27495
27777
  let eyeicon;
@@ -27520,7 +27802,7 @@ function create_input_button_slot(ctx) {
27520
27802
  current = true;
27521
27803
 
27522
27804
  if (!mounted) {
27523
- dispose = listen(button, "click", /*toggleVisibility*/ ctx[16]);
27805
+ dispose = listen(button, "click", /*toggleVisibility*/ ctx[17]);
27524
27806
  mounted = true;
27525
27807
  }
27526
27808
  },
@@ -27528,7 +27810,7 @@ function create_input_button_slot(ctx) {
27528
27810
  const eyeicon_changes = {};
27529
27811
  if (dirty & /*isVisible*/ 1024) eyeicon_changes.visible = /*isVisible*/ ctx[10];
27530
27812
 
27531
- if (dirty & /*$$scope*/ 1048576) {
27813
+ if (dirty & /*$$scope*/ 4194304) {
27532
27814
  eyeicon_changes.$$scope = { dirty, ctx };
27533
27815
  }
27534
27816
 
@@ -27552,7 +27834,7 @@ function create_input_button_slot(ctx) {
27552
27834
  };
27553
27835
  }
27554
27836
 
27555
- // (89:0) {#if callbackMetadata?.platform?.confirmPassword}
27837
+ // (101:0) {#if callbackMetadata?.platform?.confirmPassword}
27556
27838
  function create_if_block$a(ctx) {
27557
27839
  let confirminput;
27558
27840
  let current;
@@ -27562,7 +27844,8 @@ function create_if_block$a(ctx) {
27562
27844
  forceValidityFailure: /*doPasswordsMatch*/ ctx[9] === false,
27563
27845
  isInvalid: /*doPasswordsMatch*/ ctx[9] === false,
27564
27846
  key: /*key*/ ctx[0],
27565
- onChange: /*confirmInput*/ ctx[14],
27847
+ onChange: /*confirmInput*/ ctx[15],
27848
+ resetValue: /*resetValue*/ ctx[11],
27566
27849
  showMessage: /*doPasswordsMatch*/ ctx[9] === false,
27567
27850
  style: /*style*/ ctx[4]
27568
27851
  }
@@ -27581,6 +27864,7 @@ function create_if_block$a(ctx) {
27581
27864
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.forceValidityFailure = /*doPasswordsMatch*/ ctx[9] === false;
27582
27865
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.isInvalid = /*doPasswordsMatch*/ ctx[9] === false;
27583
27866
  if (dirty & /*key*/ 1) confirminput_changes.key = /*key*/ ctx[0];
27867
+ if (dirty & /*resetValue*/ 2048) confirminput_changes.resetValue = /*resetValue*/ ctx[11];
27584
27868
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.showMessage = /*doPasswordsMatch*/ ctx[9] === false;
27585
27869
  if (dirty & /*style*/ 16) confirminput_changes.style = /*style*/ ctx[4];
27586
27870
  confirminput.$set(confirminput_changes);
@@ -27606,20 +27890,20 @@ function create_fragment$p(ctx) {
27606
27890
  let if_block_anchor;
27607
27891
  let current;
27608
27892
 
27609
- input = new /*Input*/ ctx[13]({
27893
+ input = new /*Input*/ ctx[14]({
27610
27894
  props: {
27611
27895
  isFirstInvalidInput: /*callbackMetadata*/ ctx[1]?.derived.isFirstInvalidInput || false,
27612
27896
  hasRightIcon: true,
27613
27897
  key: /*key*/ ctx[0],
27614
- label: interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[11]),
27898
+ label: interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[12]),
27615
27899
  message: /*validationFailure*/ ctx[6] || (/*isRequired*/ ctx[3]
27616
27900
  ? interpolate('inputRequiredError')
27617
27901
  : undefined),
27618
- onChange: /*setValue*/ ctx[15],
27902
+ onChange: /*setValue*/ ctx[16],
27619
27903
  isInvalid: /*isInvalid*/ ctx[2],
27620
27904
  isRequired: /*isRequired*/ ctx[3],
27621
27905
  showMessage: /*showMessage*/ ctx[5],
27622
- type: /*type*/ ctx[12],
27906
+ type: /*type*/ ctx[13],
27623
27907
  value: typeof /*value*/ ctx[7] === 'string'
27624
27908
  ? /*value*/ ctx[7]
27625
27909
  : '',
@@ -27651,7 +27935,7 @@ function create_fragment$p(ctx) {
27651
27935
  const input_changes = {};
27652
27936
  if (dirty & /*callbackMetadata*/ 2) input_changes.isFirstInvalidInput = /*callbackMetadata*/ ctx[1]?.derived.isFirstInvalidInput || false;
27653
27937
  if (dirty & /*key*/ 1) input_changes.key = /*key*/ ctx[0];
27654
- if (dirty & /*callbackType, textInputLabel*/ 2304) input_changes.label = interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[11]);
27938
+ if (dirty & /*callbackType, textInputLabel*/ 4352) input_changes.label = interpolate(textToKey(/*callbackType*/ ctx[8]), null, /*textInputLabel*/ ctx[12]);
27655
27939
 
27656
27940
  if (dirty & /*validationFailure, isRequired*/ 72) input_changes.message = /*validationFailure*/ ctx[6] || (/*isRequired*/ ctx[3]
27657
27941
  ? interpolate('inputRequiredError')
@@ -27660,13 +27944,13 @@ function create_fragment$p(ctx) {
27660
27944
  if (dirty & /*isInvalid*/ 4) input_changes.isInvalid = /*isInvalid*/ ctx[2];
27661
27945
  if (dirty & /*isRequired*/ 8) input_changes.isRequired = /*isRequired*/ ctx[3];
27662
27946
  if (dirty & /*showMessage*/ 32) input_changes.showMessage = /*showMessage*/ ctx[5];
27663
- if (dirty & /*type*/ 4096) input_changes.type = /*type*/ ctx[12];
27947
+ if (dirty & /*type*/ 8192) input_changes.type = /*type*/ ctx[13];
27664
27948
 
27665
27949
  if (dirty & /*value*/ 128) input_changes.value = typeof /*value*/ ctx[7] === 'string'
27666
27950
  ? /*value*/ ctx[7]
27667
27951
  : '';
27668
27952
 
27669
- if (dirty & /*$$scope, isVisible*/ 1049600) {
27953
+ if (dirty & /*$$scope, isVisible*/ 4195328) {
27670
27954
  input_changes.$$scope = { dirty, ctx };
27671
27955
  }
27672
27956
 
@@ -27730,6 +28014,8 @@ function instance$p($$self, $$props, $$invalidate) {
27730
28014
  let callbackType;
27731
28015
  let doPasswordsMatch;
27732
28016
  let isVisible = false;
28017
+ let resetValue = false;
28018
+ let savedValue = '';
27733
28019
  let textInputLabel;
27734
28020
  let type = 'password';
27735
28021
  let value;
@@ -27738,8 +28024,8 @@ function instance$p($$self, $$props, $$invalidate) {
27738
28024
  * @function confirmInput - ensures the second password input matches the first
27739
28025
  * @param event
27740
28026
  */
27741
- function confirmInput(event) {
27742
- $$invalidate(18, confirmValue = event.target?.value);
28027
+ function confirmInput(val) {
28028
+ $$invalidate(19, confirmValue = val);
27743
28029
  }
27744
28030
 
27745
28031
  /**
@@ -27757,6 +28043,8 @@ function instance$p($$self, $$props, $$invalidate) {
27757
28043
  * for writing values to the callbacks received from AM
27758
28044
  *********************************************************************** */
27759
28045
  callback.setInputValue(value);
28046
+
28047
+ $$invalidate(20, savedValue = String(value));
27760
28048
  }
27761
28049
 
27762
28050
  /**
@@ -27764,11 +28052,11 @@ function instance$p($$self, $$props, $$invalidate) {
27764
28052
  */
27765
28053
  function toggleVisibility() {
27766
28054
  $$invalidate(10, isVisible = !isVisible);
27767
- $$invalidate(12, type = isVisible ? 'text' : 'password');
28055
+ $$invalidate(13, type = isVisible ? 'text' : 'password');
27768
28056
  }
27769
28057
 
27770
28058
  $$self.$$set = $$props => {
27771
- if ('callback' in $$props) $$invalidate(17, callback = $$props.callback);
28059
+ if ('callback' in $$props) $$invalidate(18, callback = $$props.callback);
27772
28060
  if ('callbackMetadata' in $$props) $$invalidate(1, callbackMetadata = $$props.callbackMetadata);
27773
28061
  if ('key' in $$props) $$invalidate(0, key = $$props.key);
27774
28062
  if ('isInvalid' in $$props) $$invalidate(2, isInvalid = $$props.isInvalid);
@@ -27776,18 +28064,28 @@ function instance$p($$self, $$props, $$invalidate) {
27776
28064
  if ('style' in $$props) $$invalidate(4, style = $$props.style);
27777
28065
  if ('showMessage' in $$props) $$invalidate(5, showMessage = $$props.showMessage);
27778
28066
  if ('validationFailure' in $$props) $$invalidate(6, validationFailure = $$props.validationFailure);
27779
- if ('$$scope' in $$props) $$invalidate(20, $$scope = $$props.$$scope);
28067
+ if ('$$scope' in $$props) $$invalidate(22, $$scope = $$props.$$scope);
27780
28068
  };
27781
28069
 
27782
28070
  $$self.$$.update = () => {
27783
- if ($$self.$$.dirty & /*callback, callbackMetadata, confirmValue, value*/ 393346) {
28071
+ if ($$self.$$.dirty & /*callback, callbackMetadata, savedValue, value, confirmValue*/ 1835138) {
27784
28072
  {
27785
28073
  $$invalidate(8, callbackType = callback.getType());
27786
28074
  $$invalidate(0, key = callback?.payload?.input?.[0].name || `password-${callbackMetadata?.idx}`);
27787
- $$invalidate(11, textInputLabel = callback.getPrompt());
28075
+ $$invalidate(12, textInputLabel = callback.getPrompt());
27788
28076
  $$invalidate(7, value = callback?.getInputValue());
27789
28077
 
27790
- // Only assign a boolean if the confirm input has an actual value
28078
+ /**
28079
+ * `savedValue` represents what the user set after blur (local component state)
28080
+ * `value` represents what's in the callback (empties from AM response)
28081
+ *
28082
+ * This unique combination is what produces the most reliable reset flag
28083
+ */
28084
+ $$invalidate(11, resetValue = !!savedValue && value === '');
28085
+
28086
+ /**
28087
+ * Only assign a boolean if the confirm input has an actual value.
28088
+ */
27791
28089
  $$invalidate(9, doPasswordsMatch = confirmValue !== undefined
27792
28090
  ? confirmValue === value
27793
28091
  : undefined);
@@ -27807,6 +28105,7 @@ function instance$p($$self, $$props, $$invalidate) {
27807
28105
  callbackType,
27808
28106
  doPasswordsMatch,
27809
28107
  isVisible,
28108
+ resetValue,
27810
28109
  textInputLabel,
27811
28110
  type,
27812
28111
  Input,
@@ -27815,6 +28114,7 @@ function instance$p($$self, $$props, $$invalidate) {
27815
28114
  toggleVisibility,
27816
28115
  callback,
27817
28116
  confirmValue,
28117
+ savedValue,
27818
28118
  slots,
27819
28119
  $$scope
27820
28120
  ];
@@ -27825,7 +28125,7 @@ class Base extends SvelteComponent {
27825
28125
  super();
27826
28126
 
27827
28127
  init(this, options, instance$p, create_fragment$p, safe_not_equal, {
27828
- callback: 17,
28128
+ callback: 18,
27829
28129
  callbackMetadata: 1,
27830
28130
  key: 0,
27831
28131
  isInvalid: 2,
@@ -29793,13 +30093,6 @@ function instance$f($$self, $$props, $$invalidate) {
29793
30093
  * @param {Object} event
29794
30094
  */
29795
30095
  function setValue(event) {
29796
- /** ***********************************************************************
29797
- * SDK INTEGRATION POINT
29798
- * Summary: SDK callback methods for setting values
29799
- * ------------------------------------------------------------------------
29800
- * Details: Each callback is wrapped by the SDK to provide helper methods
29801
- * for writing values to the callbacks received from AM
29802
- *********************************************************************** */
29803
30096
  callback.setInputValue(event.target.value);
29804
30097
  }
29805
30098
 
@@ -29988,7 +30281,7 @@ function create_else_block$3(ctx) {
29988
30281
  };
29989
30282
  }
29990
30283
 
29991
- // (41:0) {#if $linksStore?.termsAndConditions}
30284
+ // (27:0) {#if $linksStore?.termsAndConditions}
29992
30285
  function create_if_block$7(ctx) {
29993
30286
  let link;
29994
30287
  let t;
@@ -30066,7 +30359,7 @@ function create_if_block$7(ctx) {
30066
30359
  };
30067
30360
  }
30068
30361
 
30069
- // (42:2) <Link classes="tw_block tw_mb-4" href={$linksStore?.termsAndConditions} target="_blank">
30362
+ // (28:2) <Link classes="tw_block tw_mb-4" href={$linksStore?.termsAndConditions} target="_blank">
30070
30363
  function create_default_slot_1$5(ctx) {
30071
30364
  let t_value = interpolate('termsAndConditionsLinkText') + "";
30072
30365
  let t;
@@ -30085,7 +30378,7 @@ function create_default_slot_1$5(ctx) {
30085
30378
  };
30086
30379
  }
30087
30380
 
30088
- // (45:2) <Checkbox isFirstInvalidInput={callbackMetadata?.derived.isFirstInvalidInput || false} key={inputName} onChange={setValue} value={false} >
30381
+ // (31:2) <Checkbox isFirstInvalidInput={callbackMetadata?.derived.isFirstInvalidInput || false} key={inputName} onChange={setValue} value={false} >
30089
30382
  function create_default_slot$9(ctx) {
30090
30383
  let t;
30091
30384
  let current;
@@ -30193,13 +30486,6 @@ function instance$d($$self, $$props, $$invalidate) {
30193
30486
  let { callback } = $$props;
30194
30487
  let { callbackMetadata } = $$props;
30195
30488
 
30196
- /** *************************************************************************
30197
- * SDK INTEGRATION POINT
30198
- * Summary: SDK callback methods for getting values
30199
- * --------------------------------------------------------------------------
30200
- * Details: Each callback is wrapped by the SDK to provide helper methods
30201
- * for accessing values from the callbacks received from AM
30202
- ************************************************************************* */
30203
30489
  const Checkbox = style.checksAndRadios === 'standard'
30204
30490
  ? Standard$1
30205
30491
  : Animated$1;
@@ -30211,13 +30497,6 @@ function instance$d($$self, $$props, $$invalidate) {
30211
30497
  * @param {Object} event
30212
30498
  */
30213
30499
  function setValue(event) {
30214
- /** ***********************************************************************
30215
- * SDK INTEGRATION POINT
30216
- * Summary: SDK callback methods for setting values
30217
- * ------------------------------------------------------------------------
30218
- * Details: Each callback is wrapped by the SDK to provide helper methods
30219
- * for writing values to the callbacks received from AM
30220
- *********************************************************************** */
30221
30500
  callback.setAccepted(event.target.checked);
30222
30501
  }
30223
30502
 
@@ -30776,13 +31055,6 @@ function instance$9($$self, $$props, $$invalidate) {
30776
31055
  * @param {Object} event
30777
31056
  */
30778
31057
  function setValue(event) {
30779
- /** ***********************************************************************
30780
- * SDK INTEGRATION POINT
30781
- * Summary: SDK callback methods for setting values
30782
- * ------------------------------------------------------------------------
30783
- * Details: Each callback is wrapped by the SDK to provide helper methods
30784
- * for writing values to the callbacks received from AM
30785
- *********************************************************************** */
30786
31058
  callback.setInputValue(event.target.value);
30787
31059
  }
30788
31060
 
@@ -35039,14 +35311,12 @@ class Login extends SvelteComponent {
35039
35311
  }
35040
35312
  }
35041
35313
 
35314
+ /**
35315
+ * @function mapStepToStage - Maps the current step to the proper stage component.
35316
+ * @param {object} currentStep - The current step to check
35317
+ * @returns {object} - The stage Svelte component
35318
+ */
35042
35319
  function mapStepToStage(currentStep) {
35043
- /** *********************************************************************
35044
- * SDK INTEGRATION POINT
35045
- * Summary:SDK step method for getting the stage value
35046
- * ----------------------------------------------------------------------
35047
- * Details: This method is helpful in quickly identifying the stage
35048
- * when you want to provide special layout or handling of the form
35049
- ********************************************************************* */
35050
35320
  if (!currentStep || currentStep.type !== 'Step') {
35051
35321
  return Generic;
35052
35322
  }