@eztrak/shared 0.16.6 → 0.17.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.
@@ -352,7 +352,144 @@ function handleApiError(error, { showAlert = false, fallbackMessage } = {}) {
352
352
  toast.error(message);
353
353
  }
354
354
  var BRAND_ORANGE = "#FF7335";
355
- var CANCEL_RED = "#ff0000";
355
+ var DANGER_RED = "#DC2626";
356
+ var DANGER_ICON_BG = "#FEE2E2";
357
+ var CANCEL_BG = "#ffffff";
358
+ var CANCEL_TEXT = "#374151";
359
+ var CONFIRM_STYLE_ID = "eztrak-confirm-alert-styles";
360
+ function cssSize(value, fallback) {
361
+ if (value === void 0) return fallback;
362
+ return typeof value === "number" ? `${value}px` : value;
363
+ }
364
+ var DEFAULT_CONFIRM_ICONS = {
365
+ warning: `
366
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
367
+ <path d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" />
368
+ </svg>
369
+ `.trim()
370
+ };
371
+ var VARIANT_DEFAULTS = {
372
+ brand: {
373
+ confirmButtonText: "Yes",
374
+ confirmButtonColor: BRAND_ORANGE,
375
+ confirmButtonTextColor: "#ffffff",
376
+ cancelButtonColor: CANCEL_BG,
377
+ cancelButtonTextColor: CANCEL_TEXT,
378
+ iconColor: BRAND_ORANGE,
379
+ iconBgColor: "#FFEDD5",
380
+ iconHtml: DEFAULT_CONFIRM_ICONS.warning,
381
+ icon: "warning"
382
+ },
383
+ danger: {
384
+ title: "Delete this item",
385
+ confirmButtonText: "Yes, delete it!",
386
+ confirmButtonColor: DANGER_RED,
387
+ confirmButtonTextColor: "#ffffff",
388
+ cancelButtonColor: CANCEL_BG,
389
+ cancelButtonTextColor: CANCEL_TEXT,
390
+ iconColor: DANGER_RED,
391
+ iconBgColor: DANGER_ICON_BG,
392
+ iconHtml: DEFAULT_CONFIRM_ICONS.warning,
393
+ icon: "warning",
394
+ showLoaderOnConfirm: true
395
+ }
396
+ };
397
+ function ensureConfirmAlertStyles() {
398
+ if (typeof document === "undefined") return;
399
+ if (document.getElementById(CONFIRM_STYLE_ID)) return;
400
+ const style = document.createElement("style");
401
+ style.id = CONFIRM_STYLE_ID;
402
+ style.textContent = `
403
+ .ez-confirm-popup {
404
+ border-radius: var(--ez-confirm-radius, 1rem) !important;
405
+ padding: 1.5rem !important;
406
+ max-width: 24rem !important;
407
+ width: var(--ez-confirm-width, 100%) !important;
408
+ box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;
409
+ }
410
+ .ez-confirm-title {
411
+ font-size: 1.125rem !important;
412
+ font-weight: 600 !important;
413
+ color: #111827 !important;
414
+ margin: 0 0 0.25rem !important;
415
+ padding: 0 !important;
416
+ }
417
+ .ez-confirm-html {
418
+ font-size: 0.875rem !important;
419
+ color: #6b7280 !important;
420
+ margin: 0 0 1.5rem !important;
421
+ }
422
+ .ez-confirm-icon {
423
+ border: none !important;
424
+ background: var(--ez-confirm-icon-bg, #fee2e2) !important;
425
+ color: var(--ez-confirm-icon-color, #dc2626) !important;
426
+ width: 3rem !important;
427
+ height: 3rem !important;
428
+ margin: 0 auto 1rem !important;
429
+ border-radius: 9999px !important;
430
+ }
431
+ .ez-confirm-icon .swal2-icon-content {
432
+ font-size: inherit !important;
433
+ display: flex !important;
434
+ align-items: center !important;
435
+ justify-content: center !important;
436
+ color: inherit !important;
437
+ }
438
+ .ez-confirm-actions {
439
+ width: 100% !important;
440
+ margin: 0 !important;
441
+ gap: 0.75rem !important;
442
+ }
443
+ .ez-confirm-confirm,
444
+ .ez-confirm-cancel {
445
+ flex: 1 1 0 !important;
446
+ margin: 0 !important;
447
+ border-radius: var(--ez-confirm-btn-radius, 0.5rem) !important;
448
+ font-size: 0.875rem !important;
449
+ font-weight: 500 !important;
450
+ padding: 0.625rem 1rem !important;
451
+ box-shadow: none !important;
452
+ }
453
+ .ez-confirm-confirm {
454
+ background: var(--ez-confirm-confirm-bg, #ff7335) !important;
455
+ color: var(--ez-confirm-confirm-fg, #fff) !important;
456
+ border: none !important;
457
+ }
458
+ .ez-confirm-confirm:hover {
459
+ filter: brightness(0.95);
460
+ }
461
+ .ez-confirm-cancel {
462
+ background: var(--ez-confirm-cancel-bg, #fff) !important;
463
+ color: var(--ez-confirm-cancel-fg, #374151) !important;
464
+ border: 1px solid #d1d5db !important;
465
+ }
466
+ .ez-confirm-cancel:hover {
467
+ background: #f9fafb !important;
468
+ }
469
+ .ez-confirm-popup .swal2-input {
470
+ margin-top: var(--ez-confirm-input-mt, 0) !important;
471
+ margin-right: var(--ez-confirm-input-mr, 0) !important;
472
+ margin-bottom: var(--ez-confirm-input-mb, 1.25rem) !important;
473
+ margin-left: var(--ez-confirm-input-ml, 0) !important;
474
+ }
475
+ `;
476
+ document.head.appendChild(style);
477
+ }
478
+ function pick(explicit, fromVariant, fallback) {
479
+ if (explicit !== void 0) return explicit;
480
+ if (fromVariant !== void 0) return fromVariant;
481
+ return fallback;
482
+ }
483
+ function mergeCustomClass(base, extra) {
484
+ if (!extra || typeof extra !== "object") return base;
485
+ const merged = { ...base };
486
+ for (const [key, value] of Object.entries(extra)) {
487
+ if (typeof value === "string" && value) {
488
+ merged[key] = merged[key] ? `${merged[key]} ${value}` : value;
489
+ }
490
+ }
491
+ return merged;
492
+ }
356
493
  function getConfirmErrorMessage(error) {
357
494
  if (error && typeof error === "object") {
358
495
  const err = error;
@@ -361,23 +498,63 @@ function getConfirmErrorMessage(error) {
361
498
  return "Something went wrong. Please try again.";
362
499
  }
363
500
  function confirmationAlert(onConfirm, options = {}) {
364
- const {
365
- title = options.inputExpectedValue ? "Confirmation Required" : "Are you sure?",
366
- text,
367
- html,
368
- icon = "warning",
369
- confirmButtonText = "Yes",
370
- cancelButtonText = "Cancel",
371
- confirmButtonColor = BRAND_ORANGE,
372
- cancelButtonColor = CANCEL_RED,
373
- showLoaderOnConfirm = false,
374
- inputExpectedValue,
375
- inputPlaceholder = "Type confirmation text to proceed",
376
- reverseButtons,
377
- focusCancel,
378
- zIndex
379
- } = options;
501
+ ensureConfirmAlertStyles();
502
+ const variant = options.variant ?? "brand";
503
+ const vd = VARIANT_DEFAULTS[variant];
504
+ const inputExpectedValue = options.inputExpectedValue;
380
505
  const hasInput = Boolean(inputExpectedValue);
506
+ const title = pick(
507
+ options.title,
508
+ vd.title,
509
+ hasInput ? "Confirmation Required" : "Delete this item"
510
+ );
511
+ const text = options.text;
512
+ const html = options.html ?? options.children;
513
+ const icon = pick(options.icon, vd.icon, "warning");
514
+ const iconHtml = pick(options.iconHtml, vd.iconHtml, void 0);
515
+ const iconColor = pick(options.iconColor, vd.iconColor, BRAND_ORANGE);
516
+ const iconBgColor = pick(options.iconBgColor, vd.iconBgColor, "#FFEDD5");
517
+ const showIcon = options.showIcon !== false;
518
+ const confirmButtonText = pick(options.confirmButtonText, vd.confirmButtonText, "Yes");
519
+ const cancelButtonText = options.cancelButtonText ?? "Cancel";
520
+ const confirmButtonColor = pick(
521
+ options.confirmButtonColor,
522
+ vd.confirmButtonColor,
523
+ BRAND_ORANGE
524
+ );
525
+ const cancelButtonColor = pick(
526
+ options.cancelButtonColor,
527
+ vd.cancelButtonColor,
528
+ CANCEL_BG
529
+ );
530
+ const confirmButtonTextColor = pick(
531
+ options.confirmButtonTextColor,
532
+ vd.confirmButtonTextColor,
533
+ "#ffffff"
534
+ );
535
+ const cancelButtonTextColor = pick(
536
+ options.cancelButtonTextColor,
537
+ vd.cancelButtonTextColor,
538
+ CANCEL_TEXT
539
+ );
540
+ const showCancelButton = options.showCancelButton !== false;
541
+ const showLoaderOnConfirm = pick(
542
+ options.showLoaderOnConfirm,
543
+ vd.showLoaderOnConfirm,
544
+ false
545
+ );
546
+ const inputPlaceholder = options.inputPlaceholder ?? "Type confirmation text to proceed";
547
+ const reverseButtons = options.reverseButtons ?? false;
548
+ const focusCancel = options.focusCancel;
549
+ const zIndex = options.zIndex;
550
+ const width = options.width;
551
+ const borderRadius = cssSize(options.borderRadius, "1rem");
552
+ const buttonBorderRadius = cssSize(options.buttonBorderRadius, "0.5rem");
553
+ const inputMarginTop = cssSize(options.inputMarginTop, "0");
554
+ const inputMarginRight = cssSize(options.inputMarginRight, "0");
555
+ const inputMarginBottom = cssSize(options.inputMarginBottom, "1.25rem");
556
+ const inputMarginLeft = cssSize(options.inputMarginLeft, "0");
557
+ const onCancel = options.onCancel;
381
558
  const useLoader = showLoaderOnConfirm || hasInput;
382
559
  const inputHtml = html ?? (hasInput ? `
383
560
  ${text ? `<p style="margin-bottom: 15px;">${text}</p>` : ""}
@@ -385,24 +562,60 @@ function confirmationAlert(onConfirm, options = {}) {
385
562
  Please type "<span style="color: ${BRAND_ORANGE}; font-weight: bold;">${inputExpectedValue}</span>" to confirm:
386
563
  </p>
387
564
  ` : void 0);
565
+ const baseCustomClass = {
566
+ popup: "ez-confirm-popup",
567
+ title: "ez-confirm-title",
568
+ htmlContainer: "ez-confirm-html",
569
+ actions: "ez-confirm-actions",
570
+ confirmButton: "ez-confirm-confirm",
571
+ cancelButton: "ez-confirm-cancel",
572
+ icon: "ez-confirm-icon"
573
+ };
388
574
  const swalOptions = {
389
575
  title,
390
- icon,
391
- showCancelButton: true,
576
+ showCancelButton,
392
577
  confirmButtonText,
393
578
  cancelButtonText,
394
579
  confirmButtonColor,
395
580
  cancelButtonColor,
396
581
  reverseButtons,
397
582
  focusCancel,
583
+ customClass: mergeCustomClass(baseCustomClass, options.customClass),
398
584
  allowOutsideClick: () => !Swal.isLoading(),
399
585
  allowEscapeKey: () => !Swal.isLoading(),
400
586
  didOpen: () => {
587
+ const popup = Swal.getPopup();
588
+ if (popup) {
589
+ popup.style.setProperty("--ez-confirm-confirm-bg", confirmButtonColor);
590
+ popup.style.setProperty("--ez-confirm-confirm-fg", confirmButtonTextColor);
591
+ popup.style.setProperty("--ez-confirm-cancel-bg", cancelButtonColor);
592
+ popup.style.setProperty("--ez-confirm-cancel-fg", cancelButtonTextColor);
593
+ popup.style.setProperty("--ez-confirm-icon-color", iconColor);
594
+ popup.style.setProperty("--ez-confirm-icon-bg", iconBgColor);
595
+ popup.style.setProperty("--ez-confirm-radius", borderRadius);
596
+ popup.style.setProperty("--ez-confirm-btn-radius", buttonBorderRadius);
597
+ popup.style.setProperty("--ez-confirm-input-mt", inputMarginTop);
598
+ popup.style.setProperty("--ez-confirm-input-mr", inputMarginRight);
599
+ popup.style.setProperty("--ez-confirm-input-mb", inputMarginBottom);
600
+ popup.style.setProperty("--ez-confirm-input-ml", inputMarginLeft);
601
+ if (width != null) {
602
+ popup.style.setProperty(
603
+ "--ez-confirm-width",
604
+ typeof width === "number" ? `${width}px` : String(width)
605
+ );
606
+ }
607
+ }
401
608
  if (zIndex == null) return;
402
609
  const container = Swal.getContainer();
403
610
  if (container) container.style.zIndex = String(zIndex);
404
611
  }
405
612
  };
613
+ if (showIcon) {
614
+ swalOptions.icon = icon;
615
+ if (iconHtml) {
616
+ swalOptions.iconHtml = iconHtml;
617
+ }
618
+ }
406
619
  if (hasInput) {
407
620
  swalOptions.html = inputHtml;
408
621
  swalOptions.input = "text";
@@ -437,6 +650,10 @@ function confirmationAlert(onConfirm, options = {}) {
437
650
  void Swal.fire(swalOptions).then((result) => {
438
651
  if (result.isConfirmed && !useLoader) {
439
652
  void Promise.resolve(onConfirm());
653
+ return;
654
+ }
655
+ if (result.isDismissed) {
656
+ onCancel?.();
440
657
  }
441
658
  });
442
659
  }
@@ -481,6 +698,7 @@ export {
481
698
  classifyError,
482
699
  formatValidationErrorsHtml,
483
700
  handleApiError,
701
+ DEFAULT_CONFIRM_ICONS,
484
702
  confirmationAlert
485
703
  };
486
- //# sourceMappingURL=chunk-EIX5CUQF.mjs.map
704
+ //# sourceMappingURL=chunk-QOYMQFOB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/cn.ts","../src/utils/resetPageParam.ts","../src/utils/helpers.ts","../src/utils/localStorage.ts","../src/utils/handleApiError.ts"],"sourcesContent":["import clsx from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: Parameters<typeof clsx>) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","/**\n * Sends pagination back to the first page after a filter changes the result set.\n *\n * Only touches `pageKey` when it is already present, so filter-only screens that\n * never paginate keep their URL clean. Mutates and returns `params` so it can be\n * chained inside a `setSearchParams((prev) => ...)` updater.\n */\nexport function resetPageParam(\n params: URLSearchParams,\n pageKey = \"page\",\n defaultPage = \"1\",\n) {\n if (params.has(pageKey)) {\n params.set(pageKey, defaultPage);\n }\n return params;\n}\n","export const truncateText = (\r\n text: string | number | null | undefined,\r\n maxLength = 20\r\n): string => {\r\n if (text === null || text === undefined) return \"\";\r\n const value = String(text);\r\n if (value.length <= maxLength) {\r\n return value;\r\n }\r\n return value.slice(0, maxLength - 3) + \"...\";\r\n};\r\n\r\nexport const truncateFileName = (\r\n fileName: string | null | undefined,\r\n maxLength = 20\r\n): string => {\r\n if (!fileName) return \"\";\r\n if (fileName.length <= maxLength) {\r\n return fileName;\r\n }\r\n const extension = fileName.slice(fileName.lastIndexOf(\".\"));\r\n const truncatedName =\r\n fileName.slice(0, maxLength - extension.length - 3) + \"...\";\r\n return truncatedName + extension;\r\n};\r\n\r\nexport function getApiError(apiError: unknown): string {\r\n if (!apiError) return \"An unknown error occurred\";\r\n\r\n if (typeof apiError === \"string\") {\r\n return apiError;\r\n }\r\n\r\n const error = apiError as {\r\n response?: { data?: Record<string, unknown> };\r\n message?: string;\r\n };\r\n\r\n if (error.response?.data) {\r\n const responseData = error.response.data;\r\n\r\n if (typeof responseData === \"string\") {\r\n return responseData;\r\n }\r\n\r\n const errors = responseData.errors;\r\n if (errors && typeof errors === \"object\") {\r\n for (const key in errors) {\r\n const messages = (errors as Record<string, unknown>)[key];\r\n if (Array.isArray(messages) && messages.length > 0) {\r\n return String(messages[0]);\r\n }\r\n }\r\n }\r\n\r\n if (responseData.message) {\r\n return String(responseData.message);\r\n }\r\n\r\n if (responseData.title) {\r\n return String(responseData.title);\r\n }\r\n }\r\n\r\n if (error.message) {\r\n return error.message;\r\n }\r\n\r\n return \"An unknown error occurred\";\r\n}\r\n\r\nexport const normalizeApiListItems = (responseData: unknown): unknown[] => {\r\n if (responseData == null) return [];\r\n if (Array.isArray(responseData)) return responseData;\r\n\r\n const record = responseData as Record<string, unknown>;\r\n const data = record.data;\r\n\r\n if (\r\n data &&\r\n typeof data === \"object\" &&\r\n !Array.isArray(data) &&\r\n Array.isArray((data as { items?: unknown[] }).items)\r\n ) {\r\n return (data as { items: unknown[] }).items;\r\n }\r\n\r\n const returnModel = record.returnModel as { items?: unknown[] } | undefined;\r\n if (Array.isArray(returnModel?.items)) return returnModel.items;\r\n if (Array.isArray(data)) return data;\r\n if (typeof data === \"object\" && data !== null) {\r\n return [data];\r\n }\r\n return [];\r\n};\r\n\r\nexport function capitalizeText(name: string | null | undefined): string {\r\n if (!name) return \"\";\r\n return name\r\n .split(\" \")\r\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\r\n .join(\" \");\r\n}\r\n\r\nexport function toLowerCaseText(text: string | null | undefined): string {\r\n if (!text) return \"\";\r\n return text.toLowerCase();\r\n}\r\n\r\nexport const formatDate = (dateString: string | null | undefined): string => {\r\n if (dateString === null || dateString === undefined) return \"-\";\r\n const date = new Date(dateString);\r\n\r\n if (isNaN(date.getTime())) {\r\n return dateString;\r\n }\r\n\r\n const month = (date.getMonth() + 1).toString().padStart(2, \"0\");\r\n const day = date.getDate().toString().padStart(2, \"0\");\r\n const year = date.getFullYear().toString().slice(-2);\r\n return `${month}/${day}/${year}`;\r\n};\r\n\r\nexport const isEmpty = (obj: object): boolean => {\r\n return Object.keys(obj).length === 0;\r\n};\r\n\r\nexport const toDateInputValue = (date: string | Date | null | undefined): string => {\r\n if (!date) return \"\";\r\n\r\n let d: Date;\r\n\r\n if (typeof date === \"string\") {\r\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(date)) {\r\n return date;\r\n }\r\n d = new Date(date);\r\n } else {\r\n d = new Date(date);\r\n }\r\n\r\n if (isNaN(d.getTime())) return \"\";\r\n\r\n const localDate = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\r\n const year = localDate.getFullYear();\r\n const month = (localDate.getMonth() + 1).toString().padStart(2, \"0\");\r\n const day = localDate.getDate().toString().padStart(2, \"0\");\r\n\r\n return `${year}-${month}-${day}`;\r\n};\r\n\r\nexport function convertCommaDataToArray(data: string | null | undefined): string[] {\r\n if (!data || data.trim() === \"\") {\r\n return [];\r\n }\r\n return data.split(\",\").map((item) => item.trim());\r\n}\r\n\r\nexport function checkIfExistsInArray<T>(array: T[], searchValue: T): boolean {\r\n return array.includes(searchValue);\r\n}\r\n\r\nexport const currencyFormatter = (value: number | null | undefined): string => {\r\n return value?.toLocaleString(\"en-US\", {\r\n style: \"currency\",\r\n currency: \"USD\",\r\n }) ?? \"\";\r\n};\r\nexport const formatNumber = (number: number | string | null | undefined): string => {\r\n if (isNaN(Number(number)) || number === null || number === undefined) {\r\n return \"0\";\r\n }\r\n\r\n const formattedNumber = Number(number)\r\n .toString()\r\n .replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n\r\n return formattedNumber;\r\n};\r\n\r\nexport const parseCurrencyValueToNumber = (value: unknown): number => {\r\n if (value == null || value === \"\") return 0;\r\n\r\n const raw =\r\n typeof value === \"object\" && value !== null && \"value\" in value\r\n ? (value as { value: unknown }).value\r\n : value;\r\n\r\n const stringValue = raw == null || raw === \"\" ? \"\" : String(raw);\r\n const numericValue = stringValue.replace(/[$,]/g, \"\");\r\n return parseFloat(numericValue) || 0;\r\n};\r\n\r\nexport function flattenTableData<T extends Record<string, unknown>>(\r\n data: T[] | null | undefined,\r\n columns: { field?: string }[] | null | undefined\r\n): T[] {\r\n if (!Array.isArray(data)) return [];\r\n return data.map((row) => {\r\n const flatRow = { ...row };\r\n (columns ?? []).forEach((col) => {\r\n const key = col.field;\r\n if (!key) return;\r\n if (key.includes(\".\")) {\r\n const value = key.split(\".\").reduce<unknown>(\r\n (acc, part) => (acc as Record<string, unknown> | undefined)?.[part],\r\n row\r\n );\r\n (flatRow as Record<string, unknown>)[key] = value ?? \"\";\r\n }\r\n });\r\n return flatRow;\r\n });\r\n}\r\n\r\nexport const getErrorMessages = (error: {\r\n data?: {\r\n errors?: Record<string, string[]>;\r\n title?: string;\r\n error?: { name?: string[] };\r\n };\r\n} | null | undefined): string => {\r\n if (error?.data?.errors) {\r\n return Object.values(error.data.errors).flat().join(\"\\n\");\r\n }\r\n return (\r\n error?.data?.title ??\r\n error?.data?.error?.name?.[0] ??\r\n \"Failed to save\"\r\n );\r\n};\r\n\r\nexport const getFieldsByCategory = <T extends { category?: string }>(\r\n fields: T[] = [],\r\n key: string\r\n): T[] => {\r\n return fields?.filter(({ category = \"\" }) => category === key);\r\n};\r\n\r\nexport const getFieldsByName = <T extends { name?: string }>(\r\n fields: T[] = [],\r\n key: string\r\n): T[] => {\r\n return fields.filter(({ name = \"\" }) => name === key);\r\n};\r\n\r\nexport const deserializeJson = <T = unknown>(jsonString: string): T | null => {\r\n try {\r\n return JSON.parse(jsonString) as T;\r\n } catch (error) {\r\n console.error(\"Error parsing JSON:\", error);\r\n return null;\r\n }\r\n};\r\n\r\nexport const formatDateTime = (dateString: string | null | undefined): string => {\r\n if (!dateString) return \"Invalid Date\";\r\n const date = new Date(dateString);\r\n if (isNaN(date.getTime())) return \"Invalid Date\";\r\n const options: Intl.DateTimeFormatOptions = {\r\n year: \"numeric\",\r\n month: \"numeric\",\r\n day: \"numeric\",\r\n hour: \"numeric\",\r\n minute: \"numeric\",\r\n hour12: true,\r\n };\r\n return date.toLocaleString(\"en-US\", options);\r\n};\r\n\r\nexport const removeByPropertyValues = <T extends Record<string, unknown>>(\r\n items: T[] = [],\r\n property: keyof T & string,\r\n values: unknown[] = [],\r\n { caseInsensitive = false }: { caseInsensitive?: boolean } = {}\r\n): T[] => {\r\n if (!Array.isArray(items) || !property) return Array.isArray(items) ? items : [];\r\n const normalize = (v: unknown) =>\r\n caseInsensitive && typeof v === \"string\" ? v.toLowerCase() : v;\r\n const valuesArr = Array.isArray(values) ? values : [values];\r\n const toRemove = new Set(valuesArr.map(normalize));\r\n return items.filter((item) => !toRemove.has(normalize(item?.[property])));\r\n};\r\n\r\nexport const getFieldsByInputType = <T extends { inputType?: string }>(\r\n fields: T[] = [],\r\n key: string\r\n): T[] => {\r\n return fields.filter(({ inputType = \"\" }) => inputType === key);\r\n};\r\n","export const USER_STATE_STORAGE_KEY = \"authState\";\r\n\r\nfunction getStorage(): Storage | null {\r\n if (typeof window === \"undefined\") return null;\r\n return window.localStorage;\r\n}\r\n\r\nexport function getItem<T>(key: string, fallback: T | null = null): T | null {\r\n try {\r\n const raw = getStorage()?.getItem(key);\r\n if (raw === null || raw === undefined) {\r\n return fallback;\r\n }\r\n return JSON.parse(raw) as T;\r\n } catch {\r\n return fallback;\r\n }\r\n}\r\n\r\nexport function setItem<T>(key: string, value: T): void {\r\n try {\r\n getStorage()?.setItem(key, JSON.stringify(value));\r\n } catch {\r\n // Ignore write errors (quota exceeded, private mode, etc.)\r\n }\r\n}\r\n\r\nexport function removeItem(key: string): void {\r\n try {\r\n getStorage()?.removeItem(key);\r\n } catch {\r\n // Ignore remove errors\r\n }\r\n}\r\n\r\nexport function loadUserState<T = unknown>(\r\n key: string = USER_STATE_STORAGE_KEY\r\n): T | undefined {\r\n const value = getItem<T | undefined>(key, undefined);\r\n return value === null ? undefined : value;\r\n}\r\n\r\nexport function saveUserState<T = unknown>(\r\n state: T,\r\n key: string = USER_STATE_STORAGE_KEY\r\n): void {\r\n setItem(key, state);\r\n}\r\n\r\n/** Task-aligned aliases */\r\nexport const get = getItem;\r\nexport const set = setItem;\r\n\r\n/** Backward-compatible aliases used in federation apps */\r\nexport const getItemFromLocalStorage = getItem;\r\nexport const storeItemInLocalStorage = setItem;\r\nexport const saveItemLocalStorage = setItem;\r\n","import toast from \"react-hot-toast\";\r\nimport Swal, { type SweetAlertOptions, type SweetAlertResult } from \"sweetalert2\";\r\n\r\nexport type RtkQueryError = {\r\n status?: number | string;\r\n originalStatus?: number;\r\n data?: {\r\n errors?: Record<string, string[]>;\r\n message?: string;\r\n title?: string;\r\n };\r\n message?: string;\r\n error?: string;\r\n};\r\n\r\nexport interface HandleApiErrorOptions {\r\n showAlert?: boolean;\r\n fallbackMessage?: string;\r\n}\r\n\r\nexport type ErrorSuggestedAction =\r\n | \"retry\"\r\n | \"refresh\"\r\n | \"contact-support\"\r\n | \"none\";\r\n\r\nexport type ErrorClassification = {\r\n isRetryable: boolean;\r\n userMessage: string;\r\n technicalMessage: string;\r\n suggestedAction: ErrorSuggestedAction;\r\n};\r\n\r\n/** Returns true for transient network/server errors that warrant automatic retry. */\r\nexport function isRetryableError(\r\n error: RtkQueryError | null | undefined\r\n): boolean {\r\n if (!error) return false;\r\n\r\n const status = error.status ?? error.originalStatus;\r\n\r\n if (\r\n status === \"FETCH_ERROR\" ||\r\n status === \"TIMEOUT_ERROR\" ||\r\n status === \"PARSING_ERROR\"\r\n ) {\r\n return true;\r\n }\r\n\r\n if (typeof status === \"number\") {\r\n if (status === 502 || status === 503 || status === 504) return true;\r\n if (status >= 500 && status < 600) return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/** Classifies RTK Query errors for user messaging and retry guidance. */\r\nexport function classifyError(\r\n error: RtkQueryError | null | undefined\r\n): ErrorClassification {\r\n if (!error) {\r\n return {\r\n isRetryable: false,\r\n userMessage: \"An error occurred.\",\r\n technicalMessage: \"Unknown error\",\r\n suggestedAction: \"none\",\r\n };\r\n }\r\n\r\n const status = error.status ?? error.originalStatus;\r\n const data = error.data;\r\n\r\n if (\r\n status === \"FETCH_ERROR\" ||\r\n status === \"TIMEOUT_ERROR\" ||\r\n status === \"PARSING_ERROR\"\r\n ) {\r\n return {\r\n isRetryable: true,\r\n userMessage: \"Network error. Please check your connection.\",\r\n technicalMessage: \"Network request failed\",\r\n suggestedAction: \"retry\",\r\n };\r\n }\r\n\r\n if (typeof status === \"number\" && status >= 500 && status < 600) {\r\n return {\r\n isRetryable: true,\r\n userMessage: \"Server is temporarily unavailable. Please try again.\",\r\n technicalMessage: `Server error: ${status}`,\r\n suggestedAction: \"retry\",\r\n };\r\n }\r\n\r\n return {\r\n isRetryable: false,\r\n userMessage:\r\n data?.message ||\r\n data?.title ||\r\n error.error ||\r\n \"An error occurred. Please try again.\",\r\n technicalMessage:\r\n typeof status === \"number\" || typeof status === \"string\"\r\n ? `Client error: ${status}`\r\n : \"Request failed\",\r\n suggestedAction: \"none\",\r\n };\r\n}\r\n\r\nexport function formatValidationErrorsHtml(\r\n errors: Record<string, string[]>\r\n): string {\r\n const items = Object.keys(errors).flatMap((field) =>\r\n (errors[field] || []).map((msg) => `<li>${msg}</li>`)\r\n );\r\n return `\r\n <div style=\"text-align:left\">\r\n <p>Please review and correct the following:</p>\r\n <ul style=\"margin:8px 0 0 16px; list-style:disc;\">\r\n ${items.join(\"\")}\r\n </ul>\r\n </div>\r\n `;\r\n}\r\n\r\nfunction showValidationAlert(html: string): void {\r\n void Swal.fire({\r\n title: \"Validation errors\",\r\n html,\r\n icon: \"error\",\r\n confirmButtonText: \"OK\",\r\n showCancelButton: false,\r\n confirmButtonColor: \"#FF7335\",\r\n });\r\n}\r\n\r\n/** Handles RTK Query errors with built-in toast.error or SweetAlert (when showAlert is true). */\r\nexport function handleApiError(\r\n error: RtkQueryError | null | undefined,\r\n { showAlert = false, fallbackMessage }: HandleApiErrorOptions = {}\r\n): void {\r\n if (!error) return;\r\n\r\n const status = error.status ?? error.originalStatus;\r\n const data = error.data;\r\n\r\n if (status === 200) {\r\n return;\r\n }\r\n\r\n if (data?.errors && typeof data.errors === \"object\") {\r\n const errors = data.errors;\r\n\r\n if (showAlert) {\r\n showValidationAlert(formatValidationErrorsHtml(errors));\r\n } else {\r\n Object.keys(errors).forEach((field) => {\r\n (errors[field] || []).forEach((errorMessage) => {\r\n toast.error(errorMessage);\r\n });\r\n });\r\n }\r\n return;\r\n }\r\n\r\n if (status === 404) {\r\n return;\r\n }\r\n\r\n const message =\r\n fallbackMessage ||\r\n data?.message ||\r\n data?.title ||\r\n error.error ||\r\n error.message ||\r\n \"An error occurred. Please try again.\";\r\n\r\n toast.error(message);\r\n}\r\n\r\nconst BRAND_ORANGE = \"#FF7335\";\r\nconst DANGER_RED = \"#DC2626\";\r\nconst DANGER_ICON_BG = \"#FEE2E2\";\r\nconst CANCEL_BG = \"#ffffff\";\r\nconst CANCEL_TEXT = \"#374151\";\r\nconst CONFIRM_STYLE_ID = \"eztrak-confirm-alert-styles\";\r\n\r\nexport type ConfirmationAlertVariant = \"brand\" | \"danger\";\r\n\r\nexport interface ConfirmationAlertOptions {\r\n title?: string;\r\n text?: string;\r\n html?: string;\r\n /** Body HTML when `html` is not set. String only (not React nodes). */\r\n children?: string;\r\n icon?: \"warning\" | \"info\" | \"question\" | \"error\" | \"success\";\r\n /** Custom icon markup. When set, replaces SweetAlert's default icon content. */\r\n iconHtml?: string;\r\n iconColor?: string;\r\n iconBgColor?: string;\r\n showIcon?: boolean;\r\n confirmButtonText?: string;\r\n cancelButtonText?: string;\r\n confirmButtonColor?: string;\r\n cancelButtonColor?: string;\r\n confirmButtonTextColor?: string;\r\n cancelButtonTextColor?: string;\r\n showCancelButton?: boolean;\r\n showLoaderOnConfirm?: boolean;\r\n /** Type exactly — trimmed, case-sensitive. */\r\n inputExpectedValue?: string;\r\n inputPlaceholder?: string;\r\n reverseButtons?: boolean;\r\n focusCancel?: boolean;\r\n zIndex?: number;\r\n width?: string | number;\r\n /** Card corner radius. Default `1rem`. Number = px. */\r\n borderRadius?: string | number;\r\n /** Confirm/cancel button corner radius. Default `0.5rem`. Number = px. */\r\n buttonBorderRadius?: string | number;\r\n /** Typed-input margin. Number = px. Bottom default `1.25rem`; other sides default `0`. */\r\n inputMarginTop?: string | number;\r\n inputMarginRight?: string | number;\r\n inputMarginBottom?: string | number;\r\n inputMarginLeft?: string | number;\r\n /** `danger` = delete look; `brand` = orange confirm. Explicit options win. */\r\n variant?: ConfirmationAlertVariant;\r\n customClass?: SweetAlertOptions[\"customClass\"];\r\n onCancel?: () => void;\r\n}\r\n\r\nfunction cssSize(value: string | number | undefined, fallback: string): string {\r\n if (value === undefined) return fallback;\r\n return typeof value === \"number\" ? `${value}px` : value;\r\n}\r\n\r\n/** Reusable icon markup — override via `iconHtml`. */\r\nexport const DEFAULT_CONFIRM_ICONS = {\r\n warning: `\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\r\n <path d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z\" />\r\n </svg>\r\n `.trim(),\r\n} as const;\r\n\r\ntype VariantDefaults = Partial<\r\n Pick<\r\n ConfirmationAlertOptions,\r\n | \"title\"\r\n | \"confirmButtonText\"\r\n | \"confirmButtonColor\"\r\n | \"confirmButtonTextColor\"\r\n | \"cancelButtonColor\"\r\n | \"cancelButtonTextColor\"\r\n | \"iconColor\"\r\n | \"iconBgColor\"\r\n | \"iconHtml\"\r\n | \"showLoaderOnConfirm\"\r\n | \"icon\"\r\n >\r\n>;\r\n\r\nconst VARIANT_DEFAULTS: Record<ConfirmationAlertVariant, VariantDefaults> = {\r\n brand: {\r\n confirmButtonText: \"Yes\",\r\n confirmButtonColor: BRAND_ORANGE,\r\n confirmButtonTextColor: \"#ffffff\",\r\n cancelButtonColor: CANCEL_BG,\r\n cancelButtonTextColor: CANCEL_TEXT,\r\n iconColor: BRAND_ORANGE,\r\n iconBgColor: \"#FFEDD5\",\r\n iconHtml: DEFAULT_CONFIRM_ICONS.warning,\r\n icon: \"warning\",\r\n },\r\n danger: {\r\n title: \"Delete this item\",\r\n confirmButtonText: \"Yes, delete it!\",\r\n confirmButtonColor: DANGER_RED,\r\n confirmButtonTextColor: \"#ffffff\",\r\n cancelButtonColor: CANCEL_BG,\r\n cancelButtonTextColor: CANCEL_TEXT,\r\n iconColor: DANGER_RED,\r\n iconBgColor: DANGER_ICON_BG,\r\n iconHtml: DEFAULT_CONFIRM_ICONS.warning,\r\n icon: \"warning\",\r\n showLoaderOnConfirm: true,\r\n },\r\n};\r\n\r\nfunction ensureConfirmAlertStyles(): void {\r\n if (typeof document === \"undefined\") return;\r\n if (document.getElementById(CONFIRM_STYLE_ID)) return;\r\n\r\n const style = document.createElement(\"style\");\r\n style.id = CONFIRM_STYLE_ID;\r\n style.textContent = `\r\n .ez-confirm-popup {\r\n border-radius: var(--ez-confirm-radius, 1rem) !important;\r\n padding: 1.5rem !important;\r\n max-width: 24rem !important;\r\n width: var(--ez-confirm-width, 100%) !important;\r\n box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;\r\n }\r\n .ez-confirm-title {\r\n font-size: 1.125rem !important;\r\n font-weight: 600 !important;\r\n color: #111827 !important;\r\n margin: 0 0 0.25rem !important;\r\n padding: 0 !important;\r\n }\r\n .ez-confirm-html {\r\n font-size: 0.875rem !important;\r\n color: #6b7280 !important;\r\n margin: 0 0 1.5rem !important;\r\n }\r\n .ez-confirm-icon {\r\n border: none !important;\r\n background: var(--ez-confirm-icon-bg, #fee2e2) !important;\r\n color: var(--ez-confirm-icon-color, #dc2626) !important;\r\n width: 3rem !important;\r\n height: 3rem !important;\r\n margin: 0 auto 1rem !important;\r\n border-radius: 9999px !important;\r\n }\r\n .ez-confirm-icon .swal2-icon-content {\r\n font-size: inherit !important;\r\n display: flex !important;\r\n align-items: center !important;\r\n justify-content: center !important;\r\n color: inherit !important;\r\n }\r\n .ez-confirm-actions {\r\n width: 100% !important;\r\n margin: 0 !important;\r\n gap: 0.75rem !important;\r\n }\r\n .ez-confirm-confirm,\r\n .ez-confirm-cancel {\r\n flex: 1 1 0 !important;\r\n margin: 0 !important;\r\n border-radius: var(--ez-confirm-btn-radius, 0.5rem) !important;\r\n font-size: 0.875rem !important;\r\n font-weight: 500 !important;\r\n padding: 0.625rem 1rem !important;\r\n box-shadow: none !important;\r\n }\r\n .ez-confirm-confirm {\r\n background: var(--ez-confirm-confirm-bg, #ff7335) !important;\r\n color: var(--ez-confirm-confirm-fg, #fff) !important;\r\n border: none !important;\r\n }\r\n .ez-confirm-confirm:hover {\r\n filter: brightness(0.95);\r\n }\r\n .ez-confirm-cancel {\r\n background: var(--ez-confirm-cancel-bg, #fff) !important;\r\n color: var(--ez-confirm-cancel-fg, #374151) !important;\r\n border: 1px solid #d1d5db !important;\r\n }\r\n .ez-confirm-cancel:hover {\r\n background: #f9fafb !important;\r\n }\r\n .ez-confirm-popup .swal2-input {\r\n margin-top: var(--ez-confirm-input-mt, 0) !important;\r\n margin-right: var(--ez-confirm-input-mr, 0) !important;\r\n margin-bottom: var(--ez-confirm-input-mb, 1.25rem) !important;\r\n margin-left: var(--ez-confirm-input-ml, 0) !important;\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n}\r\n\r\nfunction pick<T>(\r\n explicit: T | undefined,\r\n fromVariant: T | undefined,\r\n fallback: T\r\n): T {\r\n if (explicit !== undefined) return explicit;\r\n if (fromVariant !== undefined) return fromVariant;\r\n return fallback;\r\n}\r\n\r\nfunction mergeCustomClass(\r\n base: NonNullable<SweetAlertOptions[\"customClass\"]>,\r\n extra?: SweetAlertOptions[\"customClass\"]\r\n): SweetAlertOptions[\"customClass\"] {\r\n if (!extra || typeof extra !== \"object\") return base;\r\n const merged: Record<string, string> = { ...(base as Record<string, string>) };\r\n for (const [key, value] of Object.entries(extra)) {\r\n if (typeof value === \"string\" && value) {\r\n merged[key] = merged[key] ? `${merged[key]} ${value}` : value;\r\n }\r\n }\r\n return merged;\r\n}\r\n\r\nfunction getConfirmErrorMessage(error: unknown): string {\r\n if (error && typeof error === \"object\") {\r\n const err = error as {\r\n message?: string;\r\n data?: { message?: string; title?: string };\r\n };\r\n return (\r\n err.data?.message ||\r\n err.data?.title ||\r\n err.message ||\r\n \"Something went wrong. Please try again.\"\r\n );\r\n }\r\n return \"Something went wrong. Please try again.\";\r\n}\r\n\r\nexport function confirmationAlert(\r\n onConfirm: () => void | Promise<void>,\r\n options: ConfirmationAlertOptions = {}\r\n): void {\r\n ensureConfirmAlertStyles();\r\n\r\n const variant = options.variant ?? \"brand\";\r\n const vd = VARIANT_DEFAULTS[variant];\r\n\r\n const inputExpectedValue = options.inputExpectedValue;\r\n const hasInput = Boolean(inputExpectedValue);\r\n\r\n const title = pick(\r\n options.title,\r\n vd.title,\r\n hasInput ? \"Confirmation Required\" : \"Delete this item\"\r\n );\r\n const text = options.text;\r\n const html = options.html ?? options.children;\r\n const icon = pick(options.icon, vd.icon, \"warning\" as const);\r\n const iconHtml = pick(options.iconHtml, vd.iconHtml, undefined);\r\n const iconColor = pick(options.iconColor, vd.iconColor, BRAND_ORANGE);\r\n const iconBgColor = pick(options.iconBgColor, vd.iconBgColor, \"#FFEDD5\");\r\n const showIcon = options.showIcon !== false;\r\n const confirmButtonText = pick(options.confirmButtonText, vd.confirmButtonText, \"Yes\");\r\n const cancelButtonText = options.cancelButtonText ?? \"Cancel\";\r\n const confirmButtonColor = pick(\r\n options.confirmButtonColor,\r\n vd.confirmButtonColor,\r\n BRAND_ORANGE\r\n );\r\n const cancelButtonColor = pick(\r\n options.cancelButtonColor,\r\n vd.cancelButtonColor,\r\n CANCEL_BG\r\n );\r\n const confirmButtonTextColor = pick(\r\n options.confirmButtonTextColor,\r\n vd.confirmButtonTextColor,\r\n \"#ffffff\"\r\n );\r\n const cancelButtonTextColor = pick(\r\n options.cancelButtonTextColor,\r\n vd.cancelButtonTextColor,\r\n CANCEL_TEXT\r\n );\r\n const showCancelButton = options.showCancelButton !== false;\r\n const showLoaderOnConfirm = pick(\r\n options.showLoaderOnConfirm,\r\n vd.showLoaderOnConfirm,\r\n false\r\n );\r\n const inputPlaceholder =\r\n options.inputPlaceholder ?? \"Type confirmation text to proceed\";\r\n // Cancel left, Confirm right (matches gallery delete card)\r\n const reverseButtons = options.reverseButtons ?? false;\r\n const focusCancel = options.focusCancel;\r\n const zIndex = options.zIndex;\r\n const width = options.width;\r\n const borderRadius = cssSize(options.borderRadius, \"1rem\");\r\n const buttonBorderRadius = cssSize(options.buttonBorderRadius, \"0.5rem\");\r\n const inputMarginTop = cssSize(options.inputMarginTop, \"0\");\r\n const inputMarginRight = cssSize(options.inputMarginRight, \"0\");\r\n const inputMarginBottom = cssSize(options.inputMarginBottom, \"1.25rem\");\r\n const inputMarginLeft = cssSize(options.inputMarginLeft, \"0\");\r\n const onCancel = options.onCancel;\r\n\r\n const useLoader = showLoaderOnConfirm || hasInput;\r\n\r\n const inputHtml =\r\n html ??\r\n (hasInput\r\n ? `\r\n ${text ? `<p style=\"margin-bottom: 15px;\">${text}</p>` : \"\"}\r\n <p style=\"margin-bottom: 10px; font-weight: bold; color: #666;\">\r\n Please type \"<span style=\"color: ${BRAND_ORANGE}; font-weight: bold;\">${inputExpectedValue}</span>\" to confirm:\r\n </p>\r\n `\r\n : undefined);\r\n\r\n const baseCustomClass = {\r\n popup: \"ez-confirm-popup\",\r\n title: \"ez-confirm-title\",\r\n htmlContainer: \"ez-confirm-html\",\r\n actions: \"ez-confirm-actions\",\r\n confirmButton: \"ez-confirm-confirm\",\r\n cancelButton: \"ez-confirm-cancel\",\r\n icon: \"ez-confirm-icon\",\r\n };\r\n\r\n const swalOptions: SweetAlertOptions = {\r\n title,\r\n showCancelButton,\r\n confirmButtonText,\r\n cancelButtonText,\r\n confirmButtonColor,\r\n cancelButtonColor,\r\n reverseButtons,\r\n focusCancel,\r\n customClass: mergeCustomClass(baseCustomClass, options.customClass),\r\n allowOutsideClick: () => !Swal.isLoading(),\r\n allowEscapeKey: () => !Swal.isLoading(),\r\n didOpen: () => {\r\n const popup = Swal.getPopup();\r\n if (popup) {\r\n popup.style.setProperty(\"--ez-confirm-confirm-bg\", confirmButtonColor);\r\n popup.style.setProperty(\"--ez-confirm-confirm-fg\", confirmButtonTextColor);\r\n popup.style.setProperty(\"--ez-confirm-cancel-bg\", cancelButtonColor);\r\n popup.style.setProperty(\"--ez-confirm-cancel-fg\", cancelButtonTextColor);\r\n popup.style.setProperty(\"--ez-confirm-icon-color\", iconColor);\r\n popup.style.setProperty(\"--ez-confirm-icon-bg\", iconBgColor);\r\n popup.style.setProperty(\"--ez-confirm-radius\", borderRadius);\r\n popup.style.setProperty(\"--ez-confirm-btn-radius\", buttonBorderRadius);\r\n popup.style.setProperty(\"--ez-confirm-input-mt\", inputMarginTop);\r\n popup.style.setProperty(\"--ez-confirm-input-mr\", inputMarginRight);\r\n popup.style.setProperty(\"--ez-confirm-input-mb\", inputMarginBottom);\r\n popup.style.setProperty(\"--ez-confirm-input-ml\", inputMarginLeft);\r\n if (width != null) {\r\n popup.style.setProperty(\r\n \"--ez-confirm-width\",\r\n typeof width === \"number\" ? `${width}px` : String(width)\r\n );\r\n }\r\n }\r\n if (zIndex == null) return;\r\n const container = Swal.getContainer();\r\n if (container) container.style.zIndex = String(zIndex);\r\n },\r\n };\r\n\r\n if (showIcon) {\r\n swalOptions.icon = icon;\r\n if (iconHtml) {\r\n swalOptions.iconHtml = iconHtml;\r\n }\r\n }\r\n\r\n if (hasInput) {\r\n swalOptions.html = inputHtml;\r\n swalOptions.input = \"text\";\r\n swalOptions.inputPlaceholder = inputPlaceholder;\r\n swalOptions.inputValidator = (value: string) => {\r\n if (!value?.trim()) return \"You need to enter the confirmation text!\";\r\n if (value.trim() !== inputExpectedValue!.trim()) {\r\n return `Please type \"${inputExpectedValue}\" exactly as shown!`;\r\n }\r\n return null;\r\n };\r\n } else if (html) {\r\n swalOptions.html = html;\r\n } else {\r\n swalOptions.text = text;\r\n }\r\n\r\n if (useLoader) {\r\n swalOptions.showLoaderOnConfirm = true;\r\n swalOptions.preConfirm = (inputValue: string) => {\r\n if (hasInput && inputValue?.trim() !== inputExpectedValue!.trim()) {\r\n Swal.showValidationMessage(\r\n `Please type \"${inputExpectedValue}\" exactly as shown!`\r\n );\r\n return false;\r\n }\r\n return Promise.resolve()\r\n .then(() => onConfirm())\r\n .catch((error) => {\r\n Swal.showValidationMessage(getConfirmErrorMessage(error));\r\n throw error;\r\n });\r\n };\r\n }\r\n\r\n void Swal.fire(swalOptions).then((result: SweetAlertResult) => {\r\n if (result.isConfirmed && !useLoader) {\r\n void Promise.resolve(onConfirm());\r\n return;\r\n }\r\n if (result.isDismissed) {\r\n onCancel?.();\r\n }\r\n });\r\n}\r\n"],"mappings":";AAAA,OAAO,UAAU;AACjB,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAiC;AACrD,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACEO,SAAS,eACd,QACA,UAAU,QACV,cAAc,KACd;AACA,MAAI,OAAO,IAAI,OAAO,GAAG;AACvB,WAAO,IAAI,SAAS,WAAW;AAAA,EACjC;AACA,SAAO;AACT;;;AChBO,IAAM,eAAe,CAC1B,MACA,YAAY,OACD;AACX,MAAI,SAAS,QAAQ,SAAS,OAAW,QAAO;AAChD,QAAM,QAAQ,OAAO,IAAI;AACzB,MAAI,MAAM,UAAU,WAAW;AAC7B,WAAO;AAAA,EACT;AACA,SAAO,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI;AACzC;AAEO,IAAM,mBAAmB,CAC9B,UACA,YAAY,OACD;AACX,MAAI,CAAC,SAAU,QAAO;AACtB,MAAI,SAAS,UAAU,WAAW;AAChC,WAAO;AAAA,EACT;AACA,QAAM,YAAY,SAAS,MAAM,SAAS,YAAY,GAAG,CAAC;AAC1D,QAAM,gBACJ,SAAS,MAAM,GAAG,YAAY,UAAU,SAAS,CAAC,IAAI;AACxD,SAAO,gBAAgB;AACzB;AAEO,SAAS,YAAY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react-tooltip';
5
5
  import { IconType } from 'react-icons';
6
6
  import { TippyProps } from '@tippyjs/react';
7
- import { C as ConfirmationAlertOptions, R as RtkQueryError } from '../handleApiError-CwVIJOqO.mjs';
7
+ import { C as ConfirmationAlertOptions, R as RtkQueryError } from '../handleApiError-BIAaN76q.mjs';
8
+ import 'sweetalert2';
8
9
 
9
10
  type EztrakTab = {
10
11
  id: string;
@@ -4,7 +4,8 @@ import { Props, StylesConfig } from 'react-select';
4
4
  import { PlacesType } from 'react-tooltip';
5
5
  import { IconType } from 'react-icons';
6
6
  import { TippyProps } from '@tippyjs/react';
7
- import { C as ConfirmationAlertOptions, R as RtkQueryError } from '../handleApiError-CwVIJOqO.js';
7
+ import { C as ConfirmationAlertOptions, R as RtkQueryError } from '../handleApiError-BIAaN76q.js';
8
+ import 'sweetalert2';
8
9
 
9
10
  type EztrakTab = {
10
11
  id: string;