@erikey/react 0.5.0 → 0.5.1

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/dist/ui/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
3
3
 
4
4
  // ../../../node_modules/.pnpm/lucide-react@0.462.0_react@19.0.0/node_modules/lucide-react/dist/esm/shared/src/utils.js
5
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
5
+ var toKebabCase = (string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
6
6
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
7
7
  return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
8
8
  }).join(" ").trim();
@@ -736,32 +736,32 @@ function twJoin() {
736
736
  let index = 0;
737
737
  let argument;
738
738
  let resolvedValue;
739
- let string = "";
739
+ let string2 = "";
740
740
  while (index < arguments.length) {
741
741
  if (argument = arguments[index++]) {
742
742
  if (resolvedValue = toValue(argument)) {
743
- string && (string += " ");
744
- string += resolvedValue;
743
+ string2 && (string2 += " ");
744
+ string2 += resolvedValue;
745
745
  }
746
746
  }
747
747
  }
748
- return string;
748
+ return string2;
749
749
  }
750
750
  var toValue = (mix) => {
751
751
  if (typeof mix === "string") {
752
752
  return mix;
753
753
  }
754
754
  let resolvedValue;
755
- let string = "";
755
+ let string2 = "";
756
756
  for (let k = 0; k < mix.length; k++) {
757
757
  if (mix[k]) {
758
758
  if (resolvedValue = toValue(mix[k])) {
759
- string && (string += " ");
760
- string += resolvedValue;
759
+ string2 && (string2 += " ");
760
+ string2 += resolvedValue;
761
761
  }
762
762
  }
763
763
  }
764
- return string;
764
+ return string2;
765
765
  };
766
766
  function createTailwindMerge(createConfigFirst, ...createConfigRest) {
767
767
  let configUtils;
@@ -2954,10 +2954,10 @@ var util;
2954
2954
  return void 0;
2955
2955
  };
2956
2956
  util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
2957
- function joinValues(array, separator = " | ") {
2957
+ function joinValues2(array, separator = " | ") {
2958
2958
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
2959
2959
  }
2960
- util2.joinValues = joinValues;
2960
+ util2.joinValues = joinValues2;
2961
2961
  util2.jsonStringifyReplacer = (_, value) => {
2962
2962
  if (typeof value === "bigint") {
2963
2963
  return value.toString();
@@ -3081,31 +3081,31 @@ var ZodError = class _ZodError extends Error {
3081
3081
  this.issues = issues;
3082
3082
  }
3083
3083
  format(_mapper) {
3084
- const mapper = _mapper || function(issue) {
3085
- return issue.message;
3084
+ const mapper = _mapper || function(issue2) {
3085
+ return issue2.message;
3086
3086
  };
3087
3087
  const fieldErrors = { _errors: [] };
3088
3088
  const processError = (error) => {
3089
- for (const issue of error.issues) {
3090
- if (issue.code === "invalid_union") {
3091
- issue.unionErrors.map(processError);
3092
- } else if (issue.code === "invalid_return_type") {
3093
- processError(issue.returnTypeError);
3094
- } else if (issue.code === "invalid_arguments") {
3095
- processError(issue.argumentsError);
3096
- } else if (issue.path.length === 0) {
3097
- fieldErrors._errors.push(mapper(issue));
3089
+ for (const issue2 of error.issues) {
3090
+ if (issue2.code === "invalid_union") {
3091
+ issue2.unionErrors.map(processError);
3092
+ } else if (issue2.code === "invalid_return_type") {
3093
+ processError(issue2.returnTypeError);
3094
+ } else if (issue2.code === "invalid_arguments") {
3095
+ processError(issue2.argumentsError);
3096
+ } else if (issue2.path.length === 0) {
3097
+ fieldErrors._errors.push(mapper(issue2));
3098
3098
  } else {
3099
3099
  let curr = fieldErrors;
3100
3100
  let i3 = 0;
3101
- while (i3 < issue.path.length) {
3102
- const el = issue.path[i3];
3103
- const terminal = i3 === issue.path.length - 1;
3101
+ while (i3 < issue2.path.length) {
3102
+ const el = issue2.path[i3];
3103
+ const terminal = i3 === issue2.path.length - 1;
3104
3104
  if (!terminal) {
3105
3105
  curr[el] = curr[el] || { _errors: [] };
3106
3106
  } else {
3107
3107
  curr[el] = curr[el] || { _errors: [] };
3108
- curr[el]._errors.push(mapper(issue));
3108
+ curr[el]._errors.push(mapper(issue2));
3109
3109
  }
3110
3110
  curr = curr[el];
3111
3111
  i3++;
@@ -3130,7 +3130,7 @@ var ZodError = class _ZodError extends Error {
3130
3130
  get isEmpty() {
3131
3131
  return this.issues.length === 0;
3132
3132
  }
3133
- flatten(mapper = (issue) => issue.message) {
3133
+ flatten(mapper = (issue2) => issue2.message) {
3134
3134
  const fieldErrors = {};
3135
3135
  const formErrors = [];
3136
3136
  for (const sub of this.issues) {
@@ -3154,30 +3154,30 @@ ZodError.create = (issues) => {
3154
3154
  };
3155
3155
 
3156
3156
  // ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
3157
- var errorMap = (issue, _ctx) => {
3157
+ var errorMap = (issue2, _ctx) => {
3158
3158
  let message;
3159
- switch (issue.code) {
3159
+ switch (issue2.code) {
3160
3160
  case ZodIssueCode.invalid_type:
3161
- if (issue.received === ZodParsedType.undefined) {
3161
+ if (issue2.received === ZodParsedType.undefined) {
3162
3162
  message = "Required";
3163
3163
  } else {
3164
- message = `Expected ${issue.expected}, received ${issue.received}`;
3164
+ message = `Expected ${issue2.expected}, received ${issue2.received}`;
3165
3165
  }
3166
3166
  break;
3167
3167
  case ZodIssueCode.invalid_literal:
3168
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
3168
+ message = `Invalid literal value, expected ${JSON.stringify(issue2.expected, util.jsonStringifyReplacer)}`;
3169
3169
  break;
3170
3170
  case ZodIssueCode.unrecognized_keys:
3171
- message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
3171
+ message = `Unrecognized key(s) in object: ${util.joinValues(issue2.keys, ", ")}`;
3172
3172
  break;
3173
3173
  case ZodIssueCode.invalid_union:
3174
3174
  message = `Invalid input`;
3175
3175
  break;
3176
3176
  case ZodIssueCode.invalid_union_discriminator:
3177
- message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
3177
+ message = `Invalid discriminator value. Expected ${util.joinValues(issue2.options)}`;
3178
3178
  break;
3179
3179
  case ZodIssueCode.invalid_enum_value:
3180
- message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
3180
+ message = `Invalid enum value. Expected ${util.joinValues(issue2.options)}, received '${issue2.received}'`;
3181
3181
  break;
3182
3182
  case ZodIssueCode.invalid_arguments:
3183
3183
  message = `Invalid function arguments`;
@@ -3189,50 +3189,50 @@ var errorMap = (issue, _ctx) => {
3189
3189
  message = `Invalid date`;
3190
3190
  break;
3191
3191
  case ZodIssueCode.invalid_string:
3192
- if (typeof issue.validation === "object") {
3193
- if ("includes" in issue.validation) {
3194
- message = `Invalid input: must include "${issue.validation.includes}"`;
3195
- if (typeof issue.validation.position === "number") {
3196
- message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
3192
+ if (typeof issue2.validation === "object") {
3193
+ if ("includes" in issue2.validation) {
3194
+ message = `Invalid input: must include "${issue2.validation.includes}"`;
3195
+ if (typeof issue2.validation.position === "number") {
3196
+ message = `${message} at one or more positions greater than or equal to ${issue2.validation.position}`;
3197
3197
  }
3198
- } else if ("startsWith" in issue.validation) {
3199
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
3200
- } else if ("endsWith" in issue.validation) {
3201
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
3198
+ } else if ("startsWith" in issue2.validation) {
3199
+ message = `Invalid input: must start with "${issue2.validation.startsWith}"`;
3200
+ } else if ("endsWith" in issue2.validation) {
3201
+ message = `Invalid input: must end with "${issue2.validation.endsWith}"`;
3202
3202
  } else {
3203
- util.assertNever(issue.validation);
3203
+ util.assertNever(issue2.validation);
3204
3204
  }
3205
- } else if (issue.validation !== "regex") {
3206
- message = `Invalid ${issue.validation}`;
3205
+ } else if (issue2.validation !== "regex") {
3206
+ message = `Invalid ${issue2.validation}`;
3207
3207
  } else {
3208
3208
  message = "Invalid";
3209
3209
  }
3210
3210
  break;
3211
3211
  case ZodIssueCode.too_small:
3212
- if (issue.type === "array")
3213
- message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
3214
- else if (issue.type === "string")
3215
- message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
3216
- else if (issue.type === "number")
3217
- message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
3218
- else if (issue.type === "bigint")
3219
- message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
3220
- else if (issue.type === "date")
3221
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
3212
+ if (issue2.type === "array")
3213
+ message = `Array must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `more than`} ${issue2.minimum} element(s)`;
3214
+ else if (issue2.type === "string")
3215
+ message = `String must contain ${issue2.exact ? "exactly" : issue2.inclusive ? `at least` : `over`} ${issue2.minimum} character(s)`;
3216
+ else if (issue2.type === "number")
3217
+ message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`;
3218
+ else if (issue2.type === "bigint")
3219
+ message = `Number must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${issue2.minimum}`;
3220
+ else if (issue2.type === "date")
3221
+ message = `Date must be ${issue2.exact ? `exactly equal to ` : issue2.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue2.minimum))}`;
3222
3222
  else
3223
3223
  message = "Invalid input";
3224
3224
  break;
3225
3225
  case ZodIssueCode.too_big:
3226
- if (issue.type === "array")
3227
- message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
3228
- else if (issue.type === "string")
3229
- message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
3230
- else if (issue.type === "number")
3231
- message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
3232
- else if (issue.type === "bigint")
3233
- message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
3234
- else if (issue.type === "date")
3235
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
3226
+ if (issue2.type === "array")
3227
+ message = `Array must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `less than`} ${issue2.maximum} element(s)`;
3228
+ else if (issue2.type === "string")
3229
+ message = `String must contain ${issue2.exact ? `exactly` : issue2.inclusive ? `at most` : `under`} ${issue2.maximum} character(s)`;
3230
+ else if (issue2.type === "number")
3231
+ message = `Number must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`;
3232
+ else if (issue2.type === "bigint")
3233
+ message = `BigInt must be ${issue2.exact ? `exactly` : issue2.inclusive ? `less than or equal to` : `less than`} ${issue2.maximum}`;
3234
+ else if (issue2.type === "date")
3235
+ message = `Date must be ${issue2.exact ? `exactly` : issue2.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue2.maximum))}`;
3236
3236
  else
3237
3237
  message = "Invalid input";
3238
3238
  break;
@@ -3243,14 +3243,14 @@ var errorMap = (issue, _ctx) => {
3243
3243
  message = `Intersection results could not be merged`;
3244
3244
  break;
3245
3245
  case ZodIssueCode.not_multiple_of:
3246
- message = `Number must be a multiple of ${issue.multipleOf}`;
3246
+ message = `Number must be a multiple of ${issue2.multipleOf}`;
3247
3247
  break;
3248
3248
  case ZodIssueCode.not_finite:
3249
3249
  message = "Number must be finite";
3250
3250
  break;
3251
3251
  default:
3252
3252
  message = _ctx.defaultError;
3253
- util.assertNever(issue);
3253
+ util.assertNever(issue2);
3254
3254
  }
3255
3255
  return { message };
3256
3256
  };
@@ -3290,7 +3290,7 @@ var makeIssue = (params) => {
3290
3290
  };
3291
3291
  function addIssueToContext(ctx, issueData) {
3292
3292
  const overrideMap = getErrorMap();
3293
- const issue = makeIssue({
3293
+ const issue2 = makeIssue({
3294
3294
  issueData,
3295
3295
  data: ctx.data,
3296
3296
  path: ctx.path,
@@ -3305,7 +3305,7 @@ function addIssueToContext(ctx, issueData) {
3305
3305
  // then global default map
3306
3306
  ].filter((x) => !!x)
3307
3307
  });
3308
- ctx.common.issues.push(issue);
3308
+ ctx.common.issues.push(issue2);
3309
3309
  }
3310
3310
  var ParseStatus = class _ParseStatus {
3311
3311
  constructor() {
@@ -3763,11 +3763,11 @@ function datetimeRegex(args) {
3763
3763
  regex = `${regex}(${opts.join("|")})`;
3764
3764
  return new RegExp(`^${regex}$`);
3765
3765
  }
3766
- function isValidIP(ip, version) {
3767
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
3766
+ function isValidIP(ip, version2) {
3767
+ if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
3768
3768
  return true;
3769
3769
  }
3770
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
3770
+ if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
3771
3771
  return true;
3772
3772
  }
3773
3773
  return false;
@@ -3779,8 +3779,8 @@ function isValidJWT(jwt, alg) {
3779
3779
  const [header] = jwt.split(".");
3780
3780
  if (!header)
3781
3781
  return false;
3782
- const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
3783
- const decoded = JSON.parse(atob(base64));
3782
+ const base642 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
3783
+ const decoded = JSON.parse(atob(base642));
3784
3784
  if (typeof decoded !== "object" || decoded === null)
3785
3785
  return false;
3786
3786
  if ("typ" in decoded && decoded?.typ !== "JWT")
@@ -3794,11 +3794,11 @@ function isValidJWT(jwt, alg) {
3794
3794
  return false;
3795
3795
  }
3796
3796
  }
3797
- function isValidCidr(ip, version) {
3798
- if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
3797
+ function isValidCidr(ip, version2) {
3798
+ if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
3799
3799
  return true;
3800
3800
  }
3801
- if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
3801
+ if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
3802
3802
  return true;
3803
3803
  }
3804
3804
  return false;
@@ -5263,9 +5263,9 @@ var ZodObject = class _ZodObject extends ZodType {
5263
5263
  ...this._def,
5264
5264
  unknownKeys: "strict",
5265
5265
  ...message !== void 0 ? {
5266
- errorMap: (issue, ctx) => {
5267
- const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
5268
- if (issue.code === "unrecognized_keys")
5266
+ errorMap: (issue2, ctx) => {
5267
+ const defaultError = this._def.errorMap?.(issue2, ctx).message ?? ctx.defaultError;
5268
+ if (issue2.code === "unrecognized_keys")
5269
5269
  return {
5270
5270
  message: errorUtil.errToObj(message).message ?? defaultError
5271
5271
  };
@@ -6796,9 +6796,9 @@ var coerce = {
6796
6796
  function cn(...inputs) {
6797
6797
  return twMerge(clsx(inputs));
6798
6798
  }
6799
- function isValidEmail(email) {
6799
+ function isValidEmail(email2) {
6800
6800
  const emailRegex2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
6801
- return emailRegex2.test(email);
6801
+ return emailRegex2.test(email2);
6802
6802
  }
6803
6803
  function getLocalizedError({
6804
6804
  error,
@@ -9751,7 +9751,7 @@ var validateField = async (field, disabledFieldNames, formValues, validateAllFie
9751
9751
  }
9752
9752
  } else {
9753
9753
  const valueDate = ref.valueAsDate || new Date(inputValue);
9754
- const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
9754
+ const convertTimeToDate = (time2) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time2);
9755
9755
  const isTime = ref.type == "time";
9756
9756
  const isWeek = ref.type == "week";
9757
9757
  if (isString(maxOutput.value) && inputValue) {
@@ -10850,7 +10850,7 @@ function n(e) {
10850
10850
  return e.replace(/\]|\[/g, "");
10851
10851
  }
10852
10852
 
10853
- // ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
10853
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/core.js
10854
10854
  var NEVER = Object.freeze({
10855
10855
  status: "aborted"
10856
10856
  });
@@ -10910,7 +10910,7 @@ function config(newConfig) {
10910
10910
  return globalConfig;
10911
10911
  }
10912
10912
 
10913
- // ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js
10913
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/util.js
10914
10914
  function jsonStringifyReplacer(_, value) {
10915
10915
  if (typeof value === "bigint")
10916
10916
  return value.toString();
@@ -10929,7 +10929,8 @@ function cached(getter) {
10929
10929
  }
10930
10930
  };
10931
10931
  }
10932
- var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
10932
+ var EVALUATING = Symbol("evaluating");
10933
+ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
10933
10934
  };
10934
10935
  var allowsEval = cached(() => {
10935
10936
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
@@ -10967,7 +10968,7 @@ function finalizeIssue(iss, ctx, config2) {
10967
10968
  return full;
10968
10969
  }
10969
10970
 
10970
- // ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js
10971
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/errors.js
10971
10972
  var initializer = (inst, def) => {
10972
10973
  inst.name = "$ZodError";
10973
10974
  Object.defineProperty(inst, "_zod", {
@@ -10978,13 +10979,7 @@ var initializer = (inst, def) => {
10978
10979
  value: def,
10979
10980
  enumerable: false
10980
10981
  });
10981
- Object.defineProperty(inst, "message", {
10982
- get() {
10983
- return JSON.stringify(def, jsonStringifyReplacer, 2);
10984
- },
10985
- enumerable: true
10986
- // configurable: false,
10987
- });
10982
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
10988
10983
  Object.defineProperty(inst, "toString", {
10989
10984
  value: () => inst.message,
10990
10985
  enumerable: false
@@ -10993,7 +10988,7 @@ var initializer = (inst, def) => {
10993
10988
  var $ZodError = $constructor("$ZodError", initializer);
10994
10989
  var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
10995
10990
 
10996
- // ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js
10991
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/parse.js
10997
10992
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
10998
10993
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
10999
10994
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -11022,6 +11017,14 @@ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
11022
11017
  };
11023
11018
  var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
11024
11019
 
11020
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js
11021
+ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
11022
+ var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
11023
+
11024
+ // ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.js
11025
+ var $output = Symbol("ZodOutput");
11026
+ var $input = Symbol("ZodInput");
11027
+
11025
11028
  // ../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.66.1_react@19.0.0_/node_modules/@hookform/resolvers/zod/dist/zod.mjs
11026
11029
  function t(r3, e) {
11027
11030
  try {
@@ -11826,11 +11829,11 @@ function OTPInputGroup({
11826
11829
  // src/ui/components/auth/forms/email-otp-form.tsx
11827
11830
  import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
11828
11831
  function EmailOTPForm(props) {
11829
- const [email, setEmail] = useState7();
11830
- if (!email) {
11832
+ const [email2, setEmail] = useState7();
11833
+ if (!email2) {
11831
11834
  return /* @__PURE__ */ jsx16(EmailForm, { ...props, setEmail });
11832
11835
  }
11833
- return /* @__PURE__ */ jsx16(OTPForm, { ...props, email });
11836
+ return /* @__PURE__ */ jsx16(OTPForm, { ...props, email: email2 });
11834
11837
  }
11835
11838
  function EmailForm({
11836
11839
  className,
@@ -11864,14 +11867,14 @@ function EmailForm({
11864
11867
  useEffect10(() => {
11865
11868
  setIsSubmitting?.(form.formState.isSubmitting);
11866
11869
  }, [form.formState.isSubmitting, setIsSubmitting]);
11867
- async function sendEmailOTP({ email }) {
11870
+ async function sendEmailOTP({ email: email2 }) {
11868
11871
  const fetchOptions = {
11869
11872
  throw: true,
11870
11873
  headers: await getCaptchaHeaders("/email-otp/send-verification-otp")
11871
11874
  };
11872
11875
  try {
11873
11876
  await authClient.emailOtp.sendVerificationOtp({
11874
- email,
11877
+ email: email2,
11875
11878
  type: "sign-in",
11876
11879
  fetchOptions
11877
11880
  });
@@ -11879,7 +11882,7 @@ function EmailForm({
11879
11882
  variant: "success",
11880
11883
  message: localization.EMAIL_OTP_VERIFICATION_SENT
11881
11884
  });
11882
- setEmail(email);
11885
+ setEmail(email2);
11883
11886
  } catch (error) {
11884
11887
  toast({
11885
11888
  variant: "error",
@@ -11952,7 +11955,7 @@ function OTPForm({
11952
11955
  otpSeparators = 0,
11953
11956
  redirectTo,
11954
11957
  setIsSubmitting,
11955
- email
11958
+ email: email2
11956
11959
  }) {
11957
11960
  const {
11958
11961
  authClient,
@@ -11984,7 +11987,7 @@ function OTPForm({
11984
11987
  async function verifyCode({ code }) {
11985
11988
  try {
11986
11989
  await authClient.signIn.emailOtp({
11987
- email,
11990
+ email: email2,
11988
11991
  otp: code,
11989
11992
  fetchOptions: { throw: true }
11990
11993
  });
@@ -12092,7 +12095,7 @@ function EmailVerificationForm({
12092
12095
  localization = { ...contextLocalization, ...localization };
12093
12096
  const isOtpMethod = emailVerification?.otp ?? true;
12094
12097
  const emailFromUrl = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("email") || "" : "";
12095
- const email = emailProp || emailFromUrl;
12098
+ const email2 = emailProp || emailFromUrl;
12096
12099
  const { onSuccess, isPending: transitionPending } = useOnSuccessTransition({
12097
12100
  redirectTo
12098
12101
  });
@@ -12122,19 +12125,19 @@ function EmailVerificationForm({
12122
12125
  }
12123
12126
  }, [countdown]);
12124
12127
  useEffect11(() => {
12125
- if (email) {
12128
+ if (email2) {
12126
12129
  onAuthEvent?.({
12127
12130
  type: "VERIFICATION_START",
12128
- email,
12131
+ email: email2,
12129
12132
  method: isOtpMethod ? "otp" : "link"
12130
12133
  });
12131
12134
  }
12132
- }, [email, isOtpMethod, onAuthEvent]);
12135
+ }, [email2, isOtpMethod, onAuthEvent]);
12133
12136
  async function verifyCode({ code }) {
12134
- onAuthEvent?.({ type: "VERIFICATION_CODE_SUBMITTED", email });
12137
+ onAuthEvent?.({ type: "VERIFICATION_CODE_SUBMITTED", email: email2 });
12135
12138
  try {
12136
12139
  const data = await authClient.emailOtp.verifyEmail({
12137
- email,
12140
+ email: email2,
12138
12141
  otp: code,
12139
12142
  fetchOptions: { throw: true }
12140
12143
  });
@@ -12184,11 +12187,11 @@ function EmailVerificationForm({
12184
12187
  setCountdown(30);
12185
12188
  try {
12186
12189
  await authClient.emailOtp.sendVerificationOtp({
12187
- email,
12190
+ email: email2,
12188
12191
  type: "email-verification",
12189
12192
  fetchOptions: { throw: true }
12190
12193
  });
12191
- onAuthEvent?.({ type: "VERIFICATION_CODE_RESENT", email });
12194
+ onAuthEvent?.({ type: "VERIFICATION_CODE_RESENT", email: email2 });
12192
12195
  toast({
12193
12196
  variant: "success",
12194
12197
  message: localization.EMAIL_OTP_VERIFICATION_SENT
@@ -12212,10 +12215,10 @@ function EmailVerificationForm({
12212
12215
  setCountdown(30);
12213
12216
  try {
12214
12217
  await authClient.sendVerificationEmail({
12215
- email,
12218
+ email: email2,
12216
12219
  fetchOptions: { throw: true }
12217
12220
  });
12218
- onAuthEvent?.({ type: "VERIFICATION_CODE_RESENT", email });
12221
+ onAuthEvent?.({ type: "VERIFICATION_CODE_RESENT", email: email2 });
12219
12222
  toast({
12220
12223
  variant: "success",
12221
12224
  message: localization.VERIFICATION_EMAIL_SENT || "Verification email sent!"
@@ -12233,7 +12236,7 @@ function EmailVerificationForm({
12233
12236
  setCountdown(0);
12234
12237
  }
12235
12238
  }
12236
- if (!email) {
12239
+ if (!email2) {
12237
12240
  return /* @__PURE__ */ jsx17("div", { className: cn("grid w-full gap-6", className), children: /* @__PURE__ */ jsxs9("div", { className: "text-center", children: [
12238
12241
  /* @__PURE__ */ jsx17("h2", { className: "font-semibold text-destructive text-lg", children: "Invalid Request" }),
12239
12242
  /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground text-sm", children: localization.EMAIL_REQUIRED || "Email address is required" })
@@ -12247,7 +12250,7 @@ function EmailVerificationForm({
12247
12250
  /* @__PURE__ */ jsxs9("p", { className: "text-muted-foreground text-sm", children: [
12248
12251
  loc.VERIFICATION_LINK_SENT_TO || "We sent a verification link to",
12249
12252
  " ",
12250
- /* @__PURE__ */ jsx17("strong", { children: email })
12253
+ /* @__PURE__ */ jsx17("strong", { children: email2 })
12251
12254
  ] }),
12252
12255
  /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground text-xs", children: loc.CLICK_LINK_TO_VERIFY || "Click the link in your email to verify your account." })
12253
12256
  ] }),
@@ -12403,18 +12406,18 @@ function ForgotPasswordForm({
12403
12406
  useEffect12(() => {
12404
12407
  setIsSubmitting?.(form.formState.isSubmitting);
12405
12408
  }, [form.formState.isSubmitting, setIsSubmitting]);
12406
- async function forgotPassword({ email }) {
12409
+ async function forgotPassword({ email: email2 }) {
12407
12410
  try {
12408
12411
  const fetchOptions = {
12409
12412
  throw: true,
12410
12413
  headers: await getCaptchaHeaders("/forget-password")
12411
12414
  };
12412
12415
  await authClient.requestPasswordReset({
12413
- email,
12416
+ email: email2,
12414
12417
  redirectTo: `${baseURL}${basePath}/${viewPaths.RESET_PASSWORD}`,
12415
12418
  fetchOptions
12416
12419
  });
12417
- onAuthEvent?.({ type: "FORGOT_PASSWORD_EMAIL_SENT", email });
12420
+ onAuthEvent?.({ type: "FORGOT_PASSWORD_EMAIL_SENT", email: email2 });
12418
12421
  toast({
12419
12422
  variant: "success",
12420
12423
  message: localization.FORGOT_PASSWORD_EMAIL
@@ -12548,14 +12551,14 @@ function MagicLinkForm({
12548
12551
  useEffect13(() => {
12549
12552
  setIsSubmitting?.(form.formState.isSubmitting);
12550
12553
  }, [form.formState.isSubmitting, setIsSubmitting]);
12551
- async function sendMagicLink({ email }) {
12554
+ async function sendMagicLink({ email: email2 }) {
12552
12555
  try {
12553
12556
  const fetchOptions = {
12554
12557
  throw: true,
12555
12558
  headers: await getCaptchaHeaders("/sign-in/magic-link")
12556
12559
  };
12557
12560
  await authClient.signIn.magicLink({
12558
- email,
12561
+ email: email2,
12559
12562
  callbackURL: getCallbackURL(),
12560
12563
  fetchOptions
12561
12564
  });
@@ -13056,20 +13059,20 @@ function SignInForm({
13056
13059
  setIsSubmitting?.(form.formState.isSubmitting || transitionPending);
13057
13060
  }, [form.formState.isSubmitting, transitionPending, setIsSubmitting]);
13058
13061
  async function signIn({
13059
- email,
13062
+ email: email2,
13060
13063
  password,
13061
13064
  rememberMe
13062
13065
  }) {
13063
- onAuthEvent?.({ type: "SIGN_IN_START", email });
13066
+ onAuthEvent?.({ type: "SIGN_IN_START", email: email2 });
13064
13067
  try {
13065
13068
  let response = {};
13066
- if (usernameEnabled && !isValidEmail(email)) {
13069
+ if (usernameEnabled && !isValidEmail(email2)) {
13067
13070
  const fetchOptions = {
13068
13071
  throw: true,
13069
13072
  headers: await getCaptchaHeaders("/sign-in/username")
13070
13073
  };
13071
13074
  response = await authClient.signIn.username({
13072
- username: email,
13075
+ username: email2,
13073
13076
  password,
13074
13077
  rememberMe,
13075
13078
  fetchOptions
@@ -13080,14 +13083,14 @@ function SignInForm({
13080
13083
  headers: await getCaptchaHeaders("/sign-in/email")
13081
13084
  };
13082
13085
  response = await authClient.signIn.email({
13083
- email,
13086
+ email: email2,
13084
13087
  password,
13085
13088
  rememberMe,
13086
13089
  fetchOptions
13087
13090
  });
13088
13091
  }
13089
13092
  if (response.twoFactorRedirect) {
13090
- onAuthEvent?.({ type: "SIGN_IN_REQUIRES_2FA", email });
13093
+ onAuthEvent?.({ type: "SIGN_IN_REQUIRES_2FA", email: email2 });
13091
13094
  if (authFlowMode !== "internal") {
13092
13095
  navigate(
13093
13096
  `${basePath}/${viewPaths.TWO_FACTOR}${window.location.search}`
@@ -13122,10 +13125,10 @@ function SignInForm({
13122
13125
  message: errorMessage
13123
13126
  });
13124
13127
  if (errorCode === "EMAIL_NOT_VERIFIED") {
13125
- onAuthEvent?.({ type: "SIGN_IN_REQUIRES_VERIFICATION", email });
13128
+ onAuthEvent?.({ type: "SIGN_IN_REQUIRES_VERIFICATION", email: email2 });
13126
13129
  if (authFlowMode !== "internal") {
13127
13130
  navigate(
13128
- `${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email)}`
13131
+ `${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email2)}`
13129
13132
  );
13130
13133
  }
13131
13134
  }
@@ -13306,10 +13309,10 @@ var sha256 = () => new Uint8Array(32);
13306
13309
  var bytesToHex = (_bytes) => "";
13307
13310
 
13308
13311
  // src/ui/lib/gravatar-utils.ts
13309
- function getGravatarUrl(email, options) {
13310
- if (!email) return null;
13312
+ function getGravatarUrl(email2, options) {
13313
+ if (!email2) return null;
13311
13314
  try {
13312
- const normalizedEmail = email.trim().toLowerCase();
13315
+ const normalizedEmail = email2.trim().toLowerCase();
13313
13316
  const encoder = new TextEncoder();
13314
13317
  const emailBytes = encoder.encode(normalizedEmail);
13315
13318
  const hash = bytesToHex(sha256(emailBytes));
@@ -13636,7 +13639,7 @@ function SignUpForm({
13636
13639
  };
13637
13640
  const openFileDialog = () => fileInputRef.current?.click();
13638
13641
  async function signUp({
13639
- email,
13642
+ email: email2,
13640
13643
  password,
13641
13644
  name,
13642
13645
  username,
@@ -13646,7 +13649,7 @@ function SignUpForm({
13646
13649
  }) {
13647
13650
  onAuthEvent?.({
13648
13651
  type: "SIGN_UP_START",
13649
- email,
13652
+ email: email2,
13650
13653
  name
13651
13654
  });
13652
13655
  try {
@@ -13677,7 +13680,7 @@ function SignUpForm({
13677
13680
  additionalParams.image = image;
13678
13681
  }
13679
13682
  const data = await authClient.signUp.email({
13680
- email,
13683
+ email: email2,
13681
13684
  password,
13682
13685
  name: name || "",
13683
13686
  ...additionalParams,
@@ -13693,7 +13696,7 @@ function SignUpForm({
13693
13696
  if (response.twoFactorRedirect) {
13694
13697
  onAuthEvent?.({
13695
13698
  type: "SIGN_IN_REQUIRES_2FA",
13696
- email
13699
+ email: email2
13697
13700
  });
13698
13701
  if (authFlowMode !== "internal") {
13699
13702
  navigate(
@@ -13710,17 +13713,17 @@ function SignUpForm({
13710
13713
  } else if (user && user.emailVerified === false) {
13711
13714
  onAuthEvent?.({
13712
13715
  type: "SIGN_UP_REQUIRES_VERIFICATION",
13713
- email
13716
+ email: email2
13714
13717
  });
13715
13718
  if (authFlowMode !== "internal") {
13716
13719
  navigate(
13717
- `${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email)}`
13720
+ `${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email2)}`
13718
13721
  );
13719
13722
  }
13720
13723
  } else {
13721
13724
  onAuthEvent?.({
13722
13725
  type: "SIGN_UP_REQUIRES_VERIFICATION",
13723
- email
13726
+ email: email2
13724
13727
  });
13725
13728
  if (authFlowMode !== "internal") {
13726
13729
  navigate(
@@ -14419,7 +14422,7 @@ function AuthForm({
14419
14422
  className,
14420
14423
  classNames,
14421
14424
  callbackURL,
14422
- email,
14425
+ email: email2,
14423
14426
  isSubmitting,
14424
14427
  localization,
14425
14428
  pathname,
@@ -14584,7 +14587,7 @@ function AuthForm({
14584
14587
  className,
14585
14588
  classNames,
14586
14589
  callbackURL,
14587
- email,
14590
+ email: email2,
14588
14591
  localization,
14589
14592
  otpSeparators,
14590
14593
  redirectTo,
@@ -15140,7 +15143,7 @@ function AuthView({
15140
15143
  callbackURL,
15141
15144
  cardHeader,
15142
15145
  cardFooter,
15143
- email,
15146
+ email: email2,
15144
15147
  localization,
15145
15148
  path: pathProp,
15146
15149
  pathname,
@@ -15228,7 +15231,7 @@ function AuthView({
15228
15231
  {
15229
15232
  classNames: classNames?.form,
15230
15233
  callbackURL,
15231
- email,
15234
+ email: email2,
15232
15235
  isSubmitting,
15233
15236
  localization,
15234
15237
  otpSeparators,
@@ -15456,36 +15459,65 @@ var flowViewToPathKey = {
15456
15459
  function parsePathToView(path) {
15457
15460
  const url = new URL(path, "http://localhost");
15458
15461
  const pathname = url.pathname;
15459
- const email = url.searchParams.get("email") || void 0;
15462
+ const email2 = url.searchParams.get("email") || void 0;
15460
15463
  if (pathname.includes("email-verification")) {
15461
- return { view: "EMAIL_VERIFICATION", email };
15464
+ return { view: "EMAIL_VERIFICATION", email: email2 };
15462
15465
  }
15463
15466
  if (pathname.includes("two-factor")) {
15464
- return { view: "TWO_FACTOR", email };
15467
+ return { view: "TWO_FACTOR", email: email2 };
15465
15468
  }
15466
15469
  if (pathname.includes("forgot-password")) {
15467
- return { view: "FORGOT_PASSWORD", email };
15470
+ return { view: "FORGOT_PASSWORD", email: email2 };
15468
15471
  }
15469
15472
  if (pathname.includes("reset-password")) {
15470
- return { view: "RESET_PASSWORD", email };
15473
+ return { view: "RESET_PASSWORD", email: email2 };
15471
15474
  }
15472
15475
  if (pathname.includes("sign-up")) {
15473
- return { view: "SIGN_UP", email };
15476
+ return { view: "SIGN_UP", email: email2 };
15474
15477
  }
15475
15478
  if (pathname.includes("magic-link")) {
15476
- return { view: "MAGIC_LINK", email };
15479
+ return { view: "MAGIC_LINK", email: email2 };
15477
15480
  }
15478
15481
  if (pathname.includes("email-otp")) {
15479
- return { view: "SIGN_IN", email };
15482
+ return { view: "SIGN_IN", email: email2 };
15480
15483
  }
15481
15484
  if (pathname.includes("recover-account")) {
15482
- return { view: "TWO_FACTOR", email };
15485
+ return { view: "TWO_FACTOR", email: email2 };
15483
15486
  }
15484
- return { view: "SIGN_IN", email };
15487
+ return { view: "SIGN_IN", email: email2 };
15485
15488
  }
15486
15489
  function isAuthPath(href) {
15487
15490
  return href.includes("sign-in") || href.includes("sign-up") || href.includes("email-verification") || href.includes("two-factor") || href.includes("forgot-password") || href.includes("reset-password") || href.includes("magic-link") || href.includes("email-otp") || href.includes("recover-account");
15488
15491
  }
15492
+ var AUTH_FLOW_STATE_KEY = "erikey_auth_flow_state";
15493
+ function getPersistedState() {
15494
+ if (typeof window === "undefined") return null;
15495
+ try {
15496
+ const stored = sessionStorage.getItem(AUTH_FLOW_STATE_KEY);
15497
+ if (stored) {
15498
+ return JSON.parse(stored);
15499
+ }
15500
+ } catch {
15501
+ }
15502
+ return null;
15503
+ }
15504
+ function persistState(view, email2) {
15505
+ if (typeof window === "undefined") return;
15506
+ try {
15507
+ sessionStorage.setItem(
15508
+ AUTH_FLOW_STATE_KEY,
15509
+ JSON.stringify({ view, email: email2 })
15510
+ );
15511
+ } catch {
15512
+ }
15513
+ }
15514
+ function clearPersistedState() {
15515
+ if (typeof window === "undefined") return;
15516
+ try {
15517
+ sessionStorage.removeItem(AUTH_FLOW_STATE_KEY);
15518
+ } catch {
15519
+ }
15520
+ }
15489
15521
  function AuthFlow({
15490
15522
  mode = "internal",
15491
15523
  onEvent,
@@ -15504,8 +15536,22 @@ function AuthFlow({
15504
15536
  Link: ExternalLink,
15505
15537
  ...providerProps
15506
15538
  }) {
15507
- const [currentView, setCurrentView] = useState16(initialView);
15508
- const [verifyEmail, setVerifyEmail] = useState16();
15539
+ const [currentView, setCurrentView] = useState16(() => {
15540
+ if (mode === "internal") {
15541
+ const persisted = getPersistedState();
15542
+ if (persisted) {
15543
+ return persisted.view;
15544
+ }
15545
+ }
15546
+ return initialView;
15547
+ });
15548
+ const [verifyEmail, setVerifyEmail] = useState16(() => {
15549
+ if (mode === "internal") {
15550
+ const persisted = getPersistedState();
15551
+ return persisted?.email;
15552
+ }
15553
+ return void 0;
15554
+ });
15509
15555
  const handleNavigate = useCallback9(
15510
15556
  (href) => {
15511
15557
  if (mode === "route") {
@@ -15516,11 +15562,11 @@ function AuthFlow({
15516
15562
  }
15517
15563
  return;
15518
15564
  }
15519
- const { view, email } = parsePathToView(href);
15520
- onEvent?.({ type: "VIEW_CHANGE", view, email });
15565
+ const { view, email: email2 } = parsePathToView(href);
15566
+ onEvent?.({ type: "VIEW_CHANGE", view, email: email2 });
15521
15567
  setCurrentView(view);
15522
- if (email) {
15523
- setVerifyEmail(email);
15568
+ if (email2) {
15569
+ setVerifyEmail(email2);
15524
15570
  }
15525
15571
  },
15526
15572
  [mode, externalNavigate, onEvent]
@@ -15583,29 +15629,46 @@ function AuthFlow({
15583
15629
  case "SIGN_UP_REQUIRES_VERIFICATION":
15584
15630
  setCurrentView("EMAIL_VERIFICATION");
15585
15631
  setVerifyEmail(event.email);
15632
+ persistState("EMAIL_VERIFICATION", event.email);
15586
15633
  break;
15587
15634
  // Sign-in flow
15588
15635
  case "SIGN_IN_REQUIRES_2FA":
15589
15636
  setCurrentView("TWO_FACTOR");
15637
+ persistState("TWO_FACTOR");
15590
15638
  break;
15591
15639
  case "SIGN_IN_REQUIRES_VERIFICATION":
15592
15640
  setCurrentView("EMAIL_VERIFICATION");
15593
15641
  setVerifyEmail(event.email);
15642
+ persistState("EMAIL_VERIFICATION", event.email);
15594
15643
  break;
15595
15644
  // Verification success without token → sign in
15596
15645
  case "VERIFICATION_SUCCESS":
15597
15646
  if (!event.session?.token) {
15598
15647
  setCurrentView("SIGN_IN");
15648
+ clearPersistedState();
15649
+ }
15650
+ if (event.session?.token) {
15651
+ clearPersistedState();
15599
15652
  }
15600
15653
  break;
15601
15654
  // Password reset flow
15602
15655
  case "PASSWORD_RESET_SUCCESS":
15603
15656
  setCurrentView("SIGN_IN");
15657
+ clearPersistedState();
15604
15658
  break;
15605
15659
  // View toggles (footer links) - handled by InternalLink
15606
15660
  case "VIEW_CHANGE":
15607
15661
  setCurrentView(event.view);
15608
15662
  if (event.email) setVerifyEmail(event.email);
15663
+ if (event.view !== "SIGN_IN") {
15664
+ persistState(event.view, event.email);
15665
+ } else {
15666
+ clearPersistedState();
15667
+ }
15668
+ break;
15669
+ // AUTH_SUCCESS - clear persisted state, let React re-render via useSession
15670
+ case "AUTH_SUCCESS":
15671
+ clearPersistedState();
15609
15672
  break;
15610
15673
  }
15611
15674
  }