@yenio-pld/blocks 1.2.0-rc.14 → 1.2.0-rc.16

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/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var React5 = require('react');
4
+ var React6 = require('react');
5
5
  var skeleton_js = require('./ui/skeleton.js');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var lucideReact = require('lucide-react');
@@ -48,11 +48,11 @@ function _interopNamespace(e) {
48
48
  return Object.freeze(n);
49
49
  }
50
50
 
51
- var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
51
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
52
52
 
53
- var LanguageContext = React5.createContext(null);
53
+ var LanguageContext = React6.createContext(null);
54
54
  function useLanguageContext() {
55
- return React5.useContext(LanguageContext);
55
+ return React6.useContext(LanguageContext);
56
56
  }
57
57
  function PageTitle({
58
58
  title,
@@ -296,8 +296,8 @@ function renderShellLink({
296
296
  }
297
297
  function DismissMobileSidebar({ pathname }) {
298
298
  const { setOpenMobile } = sidebar_js.useSidebar();
299
- const previous = React5.useRef(pathname);
300
- React5.useEffect(() => {
299
+ const previous = React6.useRef(pathname);
300
+ React6.useEffect(() => {
301
301
  if (previous.current === pathname) return;
302
302
  previous.current = pathname;
303
303
  setOpenMobile(false);
@@ -486,7 +486,7 @@ function NavTabs({
486
486
  "aria-current": active ? "page" : void 0,
487
487
  children: label2
488
488
  });
489
- return React5.cloneElement(link, { key: tab.href });
489
+ return React6.cloneElement(link, { key: tab.href });
490
490
  })
491
491
  }
492
492
  );
@@ -686,14 +686,14 @@ function LoadMoreControls({
686
686
  pending,
687
687
  onLoadMore
688
688
  }) {
689
- const sentinelRef = React5.useRef(null);
690
- const pendingRef = React5.useRef(pending);
691
- const onLoadMoreRef = React5.useRef(onLoadMore);
692
- const armedRef = React5.useRef(true);
693
- const wasPendingRef = React5.useRef(false);
689
+ const sentinelRef = React6.useRef(null);
690
+ const pendingRef = React6.useRef(pending);
691
+ const onLoadMoreRef = React6.useRef(onLoadMore);
692
+ const armedRef = React6.useRef(true);
693
+ const wasPendingRef = React6.useRef(false);
694
694
  pendingRef.current = pending;
695
695
  onLoadMoreRef.current = onLoadMore;
696
- React5.useEffect(() => {
696
+ React6.useEffect(() => {
697
697
  const node = sentinelRef.current;
698
698
  if (!node || typeof IntersectionObserver === "undefined") return;
699
699
  function maybeLoad() {
@@ -711,7 +711,7 @@ function LoadMoreControls({
711
711
  observer.observe(node);
712
712
  return () => observer.disconnect();
713
713
  }, []);
714
- React5.useEffect(() => {
714
+ React6.useEffect(() => {
715
715
  if (pending) {
716
716
  wasPendingRef.current = true;
717
717
  return;
@@ -851,15 +851,15 @@ function NavigationProgress({
851
851
  ariaLabel = "Loading",
852
852
  forceVisible = false
853
853
  }) {
854
- const [visible, setVisible] = React5.useState(forceVisible);
855
- const [runId, setRunId] = React5.useState(0);
856
- const startedAt = React5.useRef(0);
857
- const startedRoute = React5.useRef(null);
858
- const committedRoute = React5.useRef(null);
859
- React5.useEffect(() => {
854
+ const [visible, setVisible] = React6.useState(forceVisible);
855
+ const [runId, setRunId] = React6.useState(0);
856
+ const startedAt = React6.useRef(0);
857
+ const startedRoute = React6.useRef(null);
858
+ const committedRoute = React6.useRef(null);
859
+ React6.useEffect(() => {
860
860
  committedRoute.current = routeKey(pathname, search);
861
861
  }, [pathname, search]);
862
- React5.useEffect(() => {
862
+ React6.useEffect(() => {
863
863
  if (forceVisible) return;
864
864
  function begin(route) {
865
865
  if (navigationSuppressed) return;
@@ -896,12 +896,12 @@ function NavigationProgress({
896
896
  window.removeEventListener("popstate", onPopState);
897
897
  };
898
898
  }, [forceVisible, pathname, search]);
899
- React5.useEffect(() => {
899
+ React6.useEffect(() => {
900
900
  if (forceVisible || !visible) return;
901
901
  const safety = window.setTimeout(() => setVisible(false), SAFETY_MS);
902
902
  return () => window.clearTimeout(safety);
903
903
  }, [forceVisible, runId, visible]);
904
- React5.useEffect(() => {
904
+ React6.useEffect(() => {
905
905
  if (forceVisible || !visible) return;
906
906
  const started = startedRoute.current;
907
907
  if (!started) return;
@@ -1384,20 +1384,20 @@ function useEditableSection({
1384
1384
  ...DEFAULT_EDITABLE_SECTION_LABELS,
1385
1385
  ...labels
1386
1386
  };
1387
- const [mode, setMode] = React5.useState("reading");
1388
- const [status, setStatus] = React5.useState(null);
1389
- const [confirmOpen, setConfirmOpen] = React5.useState(false);
1390
- const [minHeightPx, setMinHeightPx] = React5.useState(void 0);
1391
- const contentRef = React5.useRef(null);
1392
- const editButtonRef = React5.useRef(null);
1393
- const measuredHeightRef = React5.useRef(0);
1394
- const shouldFocusEditRef = React5.useRef(false);
1395
- const shouldFocusFirstFieldRef = React5.useRef(false);
1396
- const editButtonId = React5.useId();
1397
- const contentFormId = React5.useId();
1387
+ const [mode, setMode] = React6.useState("reading");
1388
+ const [status, setStatus] = React6.useState(null);
1389
+ const [confirmOpen, setConfirmOpen] = React6.useState(false);
1390
+ const [minHeightPx, setMinHeightPx] = React6.useState(void 0);
1391
+ const contentRef = React6.useRef(null);
1392
+ const editButtonRef = React6.useRef(null);
1393
+ const measuredHeightRef = React6.useRef(0);
1394
+ const shouldFocusEditRef = React6.useRef(false);
1395
+ const shouldFocusFirstFieldRef = React6.useRef(false);
1396
+ const editButtonId = React6.useId();
1397
+ const contentFormId = React6.useId();
1398
1398
  const isEditing = mode === "editing" || mode === "saving";
1399
1399
  const isSaving = mode === "saving";
1400
- React5.useEffect(() => {
1400
+ React6.useEffect(() => {
1401
1401
  if (mode === "reading" && shouldFocusEditRef.current) {
1402
1402
  shouldFocusEditRef.current = false;
1403
1403
  editButtonRef.current?.focus();
@@ -1415,18 +1415,18 @@ function useEditableSection({
1415
1415
  focusFirstField(contentRef.current);
1416
1416
  }
1417
1417
  }, [mode]);
1418
- const exitToReading = React5.useCallback(() => {
1418
+ const exitToReading = React6.useCallback(() => {
1419
1419
  setConfirmOpen(false);
1420
1420
  shouldFocusEditRef.current = true;
1421
1421
  setMode("reading");
1422
1422
  onDiscard?.();
1423
1423
  }, [onDiscard]);
1424
- const startEdit = React5.useCallback(() => {
1424
+ const startEdit = React6.useCallback(() => {
1425
1425
  setStatus(null);
1426
1426
  shouldFocusFirstFieldRef.current = true;
1427
1427
  setMode("editing");
1428
1428
  }, []);
1429
- const requestCancel = React5.useCallback(() => {
1429
+ const requestCancel = React6.useCallback(() => {
1430
1430
  if (isSaving) return;
1431
1431
  if (isDirty) {
1432
1432
  setConfirmOpen(true);
@@ -1434,7 +1434,7 @@ function useEditableSection({
1434
1434
  }
1435
1435
  exitToReading();
1436
1436
  }, [exitToReading, isDirty, isSaving]);
1437
- const handleSubmit = React5.useCallback(
1437
+ const handleSubmit = React6.useCallback(
1438
1438
  (event) => {
1439
1439
  event.preventDefault();
1440
1440
  if (isSaving) return;
@@ -1454,7 +1454,7 @@ function useEditableSection({
1454
1454
  },
1455
1455
  [isSaving, onSave, resolvedLabels.saved]
1456
1456
  );
1457
- const handleFormKeyDown = React5.useCallback(
1457
+ const handleFormKeyDown = React6.useCallback(
1458
1458
  (event) => {
1459
1459
  if (event.key !== "Escape") return;
1460
1460
  event.preventDefault();
@@ -1462,7 +1462,7 @@ function useEditableSection({
1462
1462
  },
1463
1463
  [requestCancel]
1464
1464
  );
1465
- React5.useEffect(() => {
1465
+ React6.useEffect(() => {
1466
1466
  if (!stableHeight || !isEditing) return;
1467
1467
  const el = contentRef.current;
1468
1468
  if (!el) return;
@@ -1708,16 +1708,16 @@ function SafeImage({
1708
1708
  className,
1709
1709
  ...imgProps
1710
1710
  }) {
1711
- const [failed, setFailed] = React5.useState(false);
1712
- const [loaded, setLoaded] = React5.useState(false);
1713
- const imgRef = React5.useRef(null);
1711
+ const [failed, setFailed] = React6.useState(false);
1712
+ const [loaded, setLoaded] = React6.useState(false);
1713
+ const imgRef = React6.useRef(null);
1714
1714
  const resolvedSrc = typeof src === "string" && src.length > 0 ? src : null;
1715
1715
  const resolvedBlur = resolveBlurDataUrl(blurDataUrl);
1716
- React5.useLayoutEffect(() => {
1716
+ React6.useLayoutEffect(() => {
1717
1717
  setFailed(false);
1718
1718
  setLoaded(false);
1719
1719
  }, [resolvedSrc]);
1720
- React5.useLayoutEffect(() => {
1720
+ React6.useLayoutEffect(() => {
1721
1721
  const img = imgRef.current;
1722
1722
  if (!img) return;
1723
1723
  if (isBrokenImage(img)) {
@@ -1827,17 +1827,17 @@ function ThemeSwitcher({
1827
1827
  labels: userLabels
1828
1828
  }) {
1829
1829
  const { theme, setTheme } = nextThemes.useTheme();
1830
- const [mounted, setMounted] = React5.useState(false);
1830
+ const [mounted, setMounted] = React6.useState(false);
1831
1831
  const sizes = sizeClasses[size];
1832
1832
  const shapeClass = shapeClasses[shape];
1833
1833
  const labels = { ...defaultLabels, ...userLabels };
1834
- const handleThemeClick = React5.useCallback(
1834
+ const handleThemeClick = React6.useCallback(
1835
1835
  (themeKey) => {
1836
1836
  setTheme(themeKey);
1837
1837
  },
1838
1838
  [setTheme]
1839
1839
  );
1840
- React5.useEffect(() => {
1840
+ React6.useEffect(() => {
1841
1841
  setMounted(true);
1842
1842
  }, []);
1843
1843
  if (!mounted) {
@@ -3086,8 +3086,8 @@ function CountryPicker({
3086
3086
  "aria-invalid": ariaInvalid
3087
3087
  }) {
3088
3088
  const labels = { ...defaultLabels2(purpose, locale), ...labelsProp };
3089
- const items = React5__namespace.useMemo(() => countryPickerItems(locale), [locale]);
3090
- const selected = React5__namespace.useMemo(() => findItem(items, value), [items, value]);
3089
+ const items = React6__namespace.useMemo(() => countryPickerItems(locale), [locale]);
3090
+ const selected = React6__namespace.useMemo(() => findItem(items, value), [items, value]);
3091
3091
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3092
3092
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3093
3093
  name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim().toUpperCase() }) : null,
@@ -3154,7 +3154,7 @@ function CountryPicker({
3154
3154
  "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95"
3155
3155
  ),
3156
3156
  children: [
3157
- /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "px-3 py-2 text-sm text-muted-foreground", children: labels.noResults }),
3157
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block px-2 py-2", children: labels.noResults }) }),
3158
3158
  /* @__PURE__ */ jsxRuntime.jsx(
3159
3159
  combobox_js.Combobox.List,
3160
3160
  {
@@ -3165,12 +3165,12 @@ function CountryPicker({
3165
3165
  {
3166
3166
  value: item,
3167
3167
  className: cn(
3168
- "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-none select-none",
3168
+ "relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none",
3169
3169
  "data-highlighted:bg-accent data-highlighted:text-accent-foreground"
3170
3170
  ),
3171
3171
  children: [
3172
- /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) }),
3173
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
3172
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
3173
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) })
3174
3174
  ]
3175
3175
  },
3176
3176
  item.value
@@ -3188,8 +3188,8 @@ function CountryPicker({
3188
3188
  ] });
3189
3189
  }
3190
3190
  function useMediaQuery(query) {
3191
- const [matches, setMatches] = React5.useState(false);
3192
- React5.useEffect(() => {
3191
+ const [matches, setMatches] = React6.useState(false);
3192
+ React6.useEffect(() => {
3193
3193
  if (typeof window === "undefined" || !window.matchMedia) return;
3194
3194
  const mql = window.matchMedia(query);
3195
3195
  const onChange = () => setMatches(mql.matches);
@@ -3199,9 +3199,436 @@ function useMediaQuery(query) {
3199
3199
  }, [query]);
3200
3200
  return matches;
3201
3201
  }
3202
+
3203
+ // src/data/sat-tax-regimes.json
3204
+ var sat_tax_regimes_default = {
3205
+ items: [
3206
+ {
3207
+ code: "601",
3208
+ labelEs: "General de Ley Personas Morales",
3209
+ labelEn: "General regime \u2014 legal entities"
3210
+ },
3211
+ {
3212
+ code: "603",
3213
+ labelEs: "Personas Morales con Fines no Lucrativos",
3214
+ labelEn: "Non-profit legal entities"
3215
+ },
3216
+ {
3217
+ code: "605",
3218
+ labelEs: "Sueldos y Salarios e Ingresos Asimilados a Salarios",
3219
+ labelEn: "Wages and salary-assimilated income"
3220
+ },
3221
+ {
3222
+ code: "606",
3223
+ labelEs: "Arrendamiento",
3224
+ labelEn: "Leasing"
3225
+ },
3226
+ {
3227
+ code: "607",
3228
+ labelEs: "R\xE9gimen de Enajenaci\xF3n o Adquisici\xF3n de Bienes",
3229
+ labelEn: "Transfer or acquisition of goods"
3230
+ },
3231
+ {
3232
+ code: "608",
3233
+ labelEs: "Dem\xE1s ingresos",
3234
+ labelEn: "Other income"
3235
+ },
3236
+ {
3237
+ code: "610",
3238
+ labelEs: "Residentes en el Extranjero sin Establecimiento Permanente en M\xE9xico",
3239
+ labelEn: "Foreign residents without permanent establishment in Mexico"
3240
+ },
3241
+ {
3242
+ code: "611",
3243
+ labelEs: "Ingresos por Dividendos (socios y accionistas)",
3244
+ labelEn: "Dividend income (partners and shareholders)"
3245
+ },
3246
+ {
3247
+ code: "612",
3248
+ labelEs: "Personas F\xEDsicas con Actividades Empresariales y Profesionales",
3249
+ labelEn: "Individuals with business and professional activities"
3250
+ },
3251
+ {
3252
+ code: "614",
3253
+ labelEs: "Ingresos por intereses",
3254
+ labelEn: "Interest income"
3255
+ },
3256
+ {
3257
+ code: "615",
3258
+ labelEs: "R\xE9gimen de los ingresos por obtenci\xF3n de premios",
3259
+ labelEn: "Prize income"
3260
+ },
3261
+ {
3262
+ code: "616",
3263
+ labelEs: "Sin obligaciones fiscales",
3264
+ labelEn: "No tax obligations"
3265
+ },
3266
+ {
3267
+ code: "620",
3268
+ labelEs: "Sociedades Cooperativas de Producci\xF3n que optan por diferir sus ingresos",
3269
+ labelEn: "Production cooperatives deferring income"
3270
+ },
3271
+ {
3272
+ code: "621",
3273
+ labelEs: "Incorporaci\xF3n Fiscal",
3274
+ labelEn: "Tax incorporation"
3275
+ },
3276
+ {
3277
+ code: "622",
3278
+ labelEs: "Actividades Agr\xEDcolas, Ganaderas, Silv\xEDcolas y Pesqueras",
3279
+ labelEn: "Agriculture, livestock, forestry, and fishing"
3280
+ },
3281
+ {
3282
+ code: "623",
3283
+ labelEs: "Opcional para Grupos de Sociedades",
3284
+ labelEn: "Optional regime for corporate groups"
3285
+ },
3286
+ {
3287
+ code: "624",
3288
+ labelEs: "Coordinados",
3289
+ labelEn: "Coordinated entities"
3290
+ },
3291
+ {
3292
+ code: "625",
3293
+ labelEs: "R\xE9gimen de las Actividades Empresariales con ingresos a trav\xE9s de Plataformas Tecnol\xF3gicas",
3294
+ labelEn: "Business income through digital platforms"
3295
+ },
3296
+ {
3297
+ code: "626",
3298
+ labelEs: "R\xE9gimen Simplificado de Confianza",
3299
+ labelEn: "Simplified trust regime (RESICO)"
3300
+ }
3301
+ ]
3302
+ };
3303
+
3304
+ // src/lib/tax-regimes.ts
3305
+ var ITEMS2 = sat_tax_regimes_default.items;
3306
+ var SAT_TAX_REGIME_CODES = Object.freeze(
3307
+ ITEMS2.map((item) => item.code)
3308
+ );
3309
+ var TAX_REGIME_OPTIONS = Object.freeze(
3310
+ [...ITEMS2].sort(
3311
+ (left, right) => left.labelEs.localeCompare(right.labelEs, "es")
3312
+ )
3313
+ );
3314
+ var CODE_SET2 = new Set(ITEMS2.map((item) => item.code));
3315
+ var BY_CODE2 = new Map(ITEMS2.map((item) => [item.code, item]));
3316
+ function titleCaseEs2(labelEs) {
3317
+ return labelEs.toLocaleLowerCase("es-MX").split(/\s+/).filter(Boolean).map((word) => word.charAt(0).toLocaleUpperCase("es-MX") + word.slice(1)).join(" ");
3318
+ }
3319
+ function normalizeCode(code) {
3320
+ return code.trim();
3321
+ }
3322
+ function isKnownTaxRegimeCode(code) {
3323
+ return CODE_SET2.has(normalizeCode(code));
3324
+ }
3325
+ function taxRegimeLabel(code, locale) {
3326
+ const normalized = normalizeCode(code);
3327
+ const record = BY_CODE2.get(normalized);
3328
+ if (!record) return normalized;
3329
+ if (locale === "es-MX") {
3330
+ return titleCaseEs2(record.labelEs);
3331
+ }
3332
+ return record.labelEn;
3333
+ }
3334
+ function formatTaxRegimeOptionLabel(code, locale) {
3335
+ const normalized = normalizeCode(code);
3336
+ return `${normalized} \u2014 ${taxRegimeLabel(normalized, locale)}`;
3337
+ }
3338
+ function taxRegimePickerItems(locale) {
3339
+ return TAX_REGIME_OPTIONS.map((item) => ({
3340
+ value: item.code,
3341
+ label: formatTaxRegimeOptionLabel(item.code, locale)
3342
+ }));
3343
+ }
3344
+ function foldForSearch2(text) {
3345
+ return text.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
3346
+ }
3347
+ function filterTaxRegimes(query, locale) {
3348
+ const items = taxRegimePickerItems(locale);
3349
+ const trimmed = query.trim();
3350
+ if (!trimmed) return items;
3351
+ const needle = foldForSearch2(trimmed);
3352
+ return items.filter((item) => {
3353
+ const code = foldForSearch2(item.value);
3354
+ const label = foldForSearch2(item.label);
3355
+ return code.includes(needle) || label.includes(needle);
3356
+ });
3357
+ }
3358
+ var MD_UP = "(min-width: 768px)";
3359
+ var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3202
3360
  var TRIGGER_CLASS = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-left text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3361
+ function defaultLabels3(locale) {
3362
+ const es = locale === "es-MX";
3363
+ return {
3364
+ placeholder: es ? "Buscar r\xE9gimen fiscal\u2026" : "Search tax regime\u2026",
3365
+ search: es ? "Buscar r\xE9gimen fiscal" : "Search tax regime",
3366
+ noResults: es ? "Sin resultados" : "No results",
3367
+ clear: es ? "Limpiar" : "Clear",
3368
+ open: es ? "Abrir lista" : "Open list",
3369
+ title: es ? "R\xE9gimen fiscal" : "Tax regime"
3370
+ };
3371
+ }
3372
+ function findItem2(items, code) {
3373
+ const normalized = code.trim();
3374
+ if (!normalized) return null;
3375
+ return items.find((item) => item.value === normalized) ?? null;
3376
+ }
3377
+ function TaxRegimePicker({
3378
+ value,
3379
+ onValueChange,
3380
+ locale = "es-MX",
3381
+ id,
3382
+ name,
3383
+ disabled,
3384
+ required,
3385
+ allowEmpty = true,
3386
+ className,
3387
+ labels: labelsProp,
3388
+ "aria-invalid": ariaInvalid
3389
+ }) {
3390
+ const labels = { ...defaultLabels3(locale), ...labelsProp };
3391
+ const items = React6__namespace.useMemo(() => taxRegimePickerItems(locale), [locale]);
3392
+ const selected = React6__namespace.useMemo(() => findItem2(items, value), [items, value]);
3393
+ const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3394
+ const isMdUp = useMediaQuery(MD_UP);
3395
+ const [open, setOpen] = React6__namespace.useState(false);
3396
+ const [query, setQuery] = React6__namespace.useState("");
3397
+ const searchRef = React6__namespace.useRef(null);
3398
+ const filtered = React6__namespace.useMemo(
3399
+ () => filterTaxRegimes(query, locale),
3400
+ [locale, query]
3401
+ );
3402
+ function setOpenState(next) {
3403
+ setOpen(next);
3404
+ if (!next) setQuery("");
3405
+ }
3406
+ function selectItem(item) {
3407
+ onValueChange(item.value);
3408
+ setOpenState(false);
3409
+ }
3410
+ function clearSelection() {
3411
+ onValueChange("");
3412
+ setQuery("");
3413
+ }
3414
+ React6__namespace.useEffect(() => {
3415
+ if (!open || isMdUp) return;
3416
+ const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
3417
+ return () => window.clearTimeout(handle);
3418
+ }, [isMdUp, open]);
3419
+ const sheetTitle = labels.title || labels.placeholder;
3420
+ const display = selected?.label ?? "";
3421
+ const hidden = name ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name, value: value.trim() }) : null;
3422
+ if (isMdUp) {
3423
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3424
+ hidden,
3425
+ /* @__PURE__ */ jsxRuntime.jsxs(
3426
+ combobox_js.Combobox.Root,
3427
+ {
3428
+ items,
3429
+ value: selected,
3430
+ onValueChange: (item) => {
3431
+ onValueChange(item?.value ?? "");
3432
+ },
3433
+ disabled,
3434
+ itemToStringLabel: (item) => item.label,
3435
+ itemToStringValue: (item) => item.value,
3436
+ isItemEqualToValue: (item, current) => item.value === current.value,
3437
+ children: [
3438
+ /* @__PURE__ */ jsxRuntime.jsxs(
3439
+ combobox_js.Combobox.InputGroup,
3440
+ {
3441
+ className: cn("relative flex w-full items-center", className),
3442
+ children: [
3443
+ /* @__PURE__ */ jsxRuntime.jsx(
3444
+ combobox_js.Combobox.Input,
3445
+ {
3446
+ id,
3447
+ required,
3448
+ "aria-invalid": ariaInvalid,
3449
+ ...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
3450
+ placeholder: labels.placeholder,
3451
+ className: cn(INPUT_CLASS2, "pr-16")
3452
+ }
3453
+ ),
3454
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
3455
+ allowEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
3456
+ combobox_js.Combobox.Clear,
3457
+ {
3458
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
3459
+ "aria-label": labels.clear,
3460
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
3461
+ }
3462
+ ) : null,
3463
+ /* @__PURE__ */ jsxRuntime.jsx(
3464
+ combobox_js.Combobox.Trigger,
3465
+ {
3466
+ className: "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",
3467
+ "aria-label": labels.open,
3468
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4", "aria-hidden": true })
3469
+ }
3470
+ )
3471
+ ] })
3472
+ ]
3473
+ }
3474
+ ),
3475
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Portal, { container: dialogPortalContainer ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
3476
+ combobox_js.Combobox.Positioner,
3477
+ {
3478
+ className: "pointer-events-auto isolate z-[60] outline-none",
3479
+ sideOffset: 4,
3480
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3481
+ combobox_js.Combobox.Popup,
3482
+ {
3483
+ className: cn(
3484
+ "pointer-events-auto z-[60] max-h-60 w-(--anchor-width) min-w-[16rem] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",
3485
+ "motion-safe:data-open:animate-in motion-safe:data-open:fade-in-0 motion-safe:data-open:zoom-in-95"
3486
+ ),
3487
+ children: [
3488
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.Empty, { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block px-2 py-2", children: labels.noResults }) }),
3489
+ /* @__PURE__ */ jsxRuntime.jsx(
3490
+ combobox_js.Combobox.List,
3491
+ {
3492
+ className: "max-h-60 overflow-y-auto p-1 outline-none",
3493
+ onWheel: (event) => event.stopPropagation(),
3494
+ children: (item) => /* @__PURE__ */ jsxRuntime.jsxs(
3495
+ combobox_js.Combobox.Item,
3496
+ {
3497
+ value: item,
3498
+ className: cn(
3499
+ "relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none select-none",
3500
+ "data-highlighted:bg-accent data-highlighted:text-accent-foreground"
3501
+ ),
3502
+ children: [
3503
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
3504
+ /* @__PURE__ */ jsxRuntime.jsx(combobox_js.Combobox.ItemIndicator, { className: "flex size-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-4", "aria-hidden": true }) })
3505
+ ]
3506
+ },
3507
+ item.value
3508
+ )
3509
+ }
3510
+ )
3511
+ ]
3512
+ }
3513
+ )
3514
+ }
3515
+ ) })
3516
+ ]
3517
+ }
3518
+ )
3519
+ ] });
3520
+ }
3521
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative w-full", className), children: [
3522
+ hidden,
3523
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-1", children: [
3524
+ /* @__PURE__ */ jsxRuntime.jsxs(
3525
+ "button",
3526
+ {
3527
+ "aria-expanded": open,
3528
+ "aria-haspopup": "dialog",
3529
+ "aria-invalid": ariaInvalid,
3530
+ "aria-label": labels.ariaLabel || labels.open,
3531
+ "aria-required": required || void 0,
3532
+ className: TRIGGER_CLASS,
3533
+ disabled,
3534
+ id,
3535
+ type: "button",
3536
+ onClick: () => setOpenState(true),
3537
+ children: [
3538
+ /* @__PURE__ */ jsxRuntime.jsx(
3539
+ "span",
3540
+ {
3541
+ className: cn(
3542
+ "min-w-0 flex-1 truncate",
3543
+ display ? "text-foreground" : "text-muted-foreground"
3544
+ ),
3545
+ children: display || labels.placeholder
3546
+ }
3547
+ ),
3548
+ /* @__PURE__ */ jsxRuntime.jsx(
3549
+ lucideReact.ChevronDownIcon,
3550
+ {
3551
+ "aria-hidden": true,
3552
+ className: "size-4 shrink-0 text-muted-foreground"
3553
+ }
3554
+ )
3555
+ ]
3556
+ }
3557
+ ),
3558
+ allowEmpty && value ? /* @__PURE__ */ jsxRuntime.jsx(
3559
+ button_js.Button,
3560
+ {
3561
+ "aria-label": labels.clear,
3562
+ disabled,
3563
+ size: "icon",
3564
+ type: "button",
3565
+ variant: "ghost",
3566
+ onClick: clearSelection,
3567
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4", "aria-hidden": true })
3568
+ }
3569
+ ) : null
3570
+ ] }),
3571
+ /* @__PURE__ */ jsxRuntime.jsx(drawer_js.Drawer, { open, onOpenChange: setOpenState, children: /* @__PURE__ */ jsxRuntime.jsxs(drawer_js.DrawerContent, { className: "max-h-[85vh]", children: [
3572
+ /* @__PURE__ */ jsxRuntime.jsxs(drawer_js.DrawerHeader, { className: "flex flex-row items-center justify-between gap-2 text-left md:text-left", children: [
3573
+ /* @__PURE__ */ jsxRuntime.jsx(drawer_js.DrawerTitle, { children: sheetTitle }),
3574
+ allowEmpty && value ? /* @__PURE__ */ jsxRuntime.jsx(
3575
+ button_js.Button,
3576
+ {
3577
+ size: "sm",
3578
+ type: "button",
3579
+ variant: "ghost",
3580
+ onClick: () => {
3581
+ clearSelection();
3582
+ setOpenState(false);
3583
+ },
3584
+ children: labels.clear
3585
+ }
3586
+ ) : null
3587
+ ] }),
3588
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-background px-4 pb-3", children: /* @__PURE__ */ jsxRuntime.jsx(
3589
+ input_js.Input,
3590
+ {
3591
+ ref: searchRef,
3592
+ "aria-label": labels.search,
3593
+ disabled,
3594
+ placeholder: labels.search,
3595
+ value: query,
3596
+ onChange: (event) => setQuery(event.target.value)
3597
+ }
3598
+ ) }),
3599
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto px-2 pb-4", children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-3 text-sm text-muted-foreground", children: labels.noResults }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1 p-1", role: "listbox", children: filtered.map((item) => {
3600
+ const isSelected = item.value === value.trim();
3601
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
3602
+ "button",
3603
+ {
3604
+ "aria-selected": isSelected,
3605
+ className: cn(
3606
+ "flex w-full items-center gap-2 rounded-lg px-3 py-3 text-left text-sm outline-none transition-colors",
3607
+ "hover:bg-muted/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
3608
+ isSelected ? "bg-accent" : null
3609
+ ),
3610
+ role: "option",
3611
+ type: "button",
3612
+ onClick: () => selectItem(item),
3613
+ children: [
3614
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1", children: item.label }),
3615
+ isSelected ? /* @__PURE__ */ jsxRuntime.jsx(
3616
+ lucideReact.CheckIcon,
3617
+ {
3618
+ "aria-hidden": true,
3619
+ className: "size-4 shrink-0 text-foreground"
3620
+ }
3621
+ ) : null
3622
+ ]
3623
+ }
3624
+ ) }, item.value);
3625
+ }) }) })
3626
+ ] }) })
3627
+ ] });
3628
+ }
3629
+ var TRIGGER_CLASS2 = "flex h-8 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 py-1 text-left text-base transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3203
3630
  var SEARCH_CLASS = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:text-sm dark:bg-input/30";
3204
- var MD_UP = "(min-width: 768px)";
3631
+ var MD_UP2 = "(min-width: 768px)";
3205
3632
  function LoadingRows() {
3206
3633
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 p-2", role: "status", children: [
3207
3634
  /* @__PURE__ */ jsxRuntime.jsx(skeleton_js.Skeleton, { className: "h-8 w-full motion-reduce:animate-none" }),
@@ -3241,23 +3668,23 @@ function SearchablePicker({
3241
3668
  onCreate,
3242
3669
  createLabel
3243
3670
  }) {
3244
- const isMdUp = useMediaQuery(MD_UP);
3671
+ const isMdUp = useMediaQuery(MD_UP2);
3245
3672
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3246
- const [open, setOpen] = React5__namespace.useState(false);
3247
- const searchRef = React5__namespace.useRef(null);
3673
+ const [open, setOpen] = React6__namespace.useState(false);
3674
+ const searchRef = React6__namespace.useRef(null);
3248
3675
  function setOpenState(next) {
3249
3676
  setOpen(next);
3250
3677
  onOpenChange?.(next);
3251
3678
  if (!next) onQueryChange("");
3252
3679
  }
3253
- const selected = React5__namespace.useMemo(() => {
3680
+ const selected = React6__namespace.useMemo(() => {
3254
3681
  if (!value) return null;
3255
3682
  return options.find((option) => option.id === value) ?? {
3256
3683
  id: value,
3257
3684
  label: selectedLabel || value
3258
3685
  };
3259
3686
  }, [options, selectedLabel, value]);
3260
- React5__namespace.useEffect(() => {
3687
+ React6__namespace.useEffect(() => {
3261
3688
  if (!open || isMdUp) return;
3262
3689
  const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
3263
3690
  return () => window.clearTimeout(handle);
@@ -3337,7 +3764,7 @@ function SearchablePicker({
3337
3764
  id,
3338
3765
  "aria-invalid": ariaInvalid,
3339
3766
  "aria-label": openLabel,
3340
- className: cn(TRIGGER_CLASS, allowClear && value ? "pr-1" : null),
3767
+ className: cn(TRIGGER_CLASS2, allowClear && value ? "pr-1" : null),
3341
3768
  disabled,
3342
3769
  children: [
3343
3770
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3438,7 +3865,7 @@ function SearchablePicker({
3438
3865
  "aria-haspopup": "dialog",
3439
3866
  "aria-invalid": ariaInvalid,
3440
3867
  "aria-label": openLabel,
3441
- className: TRIGGER_CLASS,
3868
+ className: TRIGGER_CLASS2,
3442
3869
  disabled,
3443
3870
  id,
3444
3871
  type: "button",
@@ -3540,7 +3967,7 @@ function SearchablePicker({
3540
3967
  ] }) })
3541
3968
  ] });
3542
3969
  }
3543
- var INPUT_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3970
+ var INPUT_CLASS3 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3544
3971
  var DEFAULT_LABELS = {
3545
3972
  placeholder: "Search\u2026",
3546
3973
  noResults: "No results",
@@ -3578,18 +4005,18 @@ function PaginatedCombobox({
3578
4005
  }) {
3579
4006
  const labels = { ...DEFAULT_LABELS, ...labelsProp };
3580
4007
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3581
- const selected = React5__namespace.useMemo(
4008
+ const selected = React6__namespace.useMemo(
3582
4009
  () => resolveSelected(value, items, selectedItem),
3583
4010
  [value, items, selectedItem]
3584
4011
  );
3585
- const listItems = React5__namespace.useMemo(() => {
4012
+ const listItems = React6__namespace.useMemo(() => {
3586
4013
  if (!selected) return items;
3587
4014
  if (items.some((item) => item.value === selected.value)) return items;
3588
4015
  return [selected, ...items];
3589
4016
  }, [items, selected]);
3590
- const queryRef = React5__namespace.useRef("");
3591
- const debounceRef = React5__namespace.useRef(null);
3592
- React5__namespace.useEffect(() => {
4017
+ const queryRef = React6__namespace.useRef("");
4018
+ const debounceRef = React6__namespace.useRef(null);
4019
+ React6__namespace.useEffect(() => {
3593
4020
  return () => {
3594
4021
  if (debounceRef.current) clearTimeout(debounceRef.current);
3595
4022
  };
@@ -3646,7 +4073,7 @@ function PaginatedCombobox({
3646
4073
  "aria-invalid": ariaInvalid,
3647
4074
  ...labels.ariaLabel ? { "aria-label": labels.ariaLabel } : {},
3648
4075
  placeholder: labels.placeholder,
3649
- className: cn(INPUT_CLASS2, "pr-16")
4076
+ className: cn(INPUT_CLASS3, "pr-16")
3650
4077
  }
3651
4078
  ),
3652
4079
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-1.5", children: [
@@ -3862,7 +4289,7 @@ function PasswordInput({
3862
4289
  hideLabel = "Hide password",
3863
4290
  ...props
3864
4291
  }) {
3865
- const [visible, setVisible] = React5__namespace.useState(false);
4292
+ const [visible, setVisible] = React6__namespace.useState(false);
3866
4293
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
3867
4294
  /* @__PURE__ */ jsxRuntime.jsx(
3868
4295
  input_js.Input,
@@ -3889,7 +4316,7 @@ function PasswordInput({
3889
4316
  )
3890
4317
  ] });
3891
4318
  }
3892
- var MD_UP2 = "(min-width: 768px)";
4319
+ var MD_UP3 = "(min-width: 768px)";
3893
4320
  var ROW_CLASS = "flex h-8 w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40";
3894
4321
  var SEARCH_CLASS2 = "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:text-sm dark:bg-input/30";
3895
4322
  function isCountryCode(value) {
@@ -3985,32 +4412,32 @@ function PhoneInput({
3985
4412
  ...props
3986
4413
  }) {
3987
4414
  const resolvedDefault = resolveCountry(defaultCountry, "MX");
3988
- const [country, setCountry] = React5__namespace.useState(
4415
+ const [country, setCountry] = React6__namespace.useState(
3989
4416
  () => parseIncoming(value, resolvedDefault).country
3990
4417
  );
3991
- const [national, setNational] = React5__namespace.useState(
4418
+ const [national, setNational] = React6__namespace.useState(
3992
4419
  () => parseIncoming(value, resolvedDefault).national
3993
4420
  );
3994
- const [open, setOpen] = React5__namespace.useState(false);
3995
- const [query, setQuery] = React5__namespace.useState("");
3996
- const lastEmittedRef = React5__namespace.useRef(value);
3997
- const isMdUp = useMediaQuery(MD_UP2);
4421
+ const [open, setOpen] = React6__namespace.useState(false);
4422
+ const [query, setQuery] = React6__namespace.useState("");
4423
+ const lastEmittedRef = React6__namespace.useRef(value);
4424
+ const isMdUp = useMediaQuery(MD_UP3);
3998
4425
  const dialogPortalContainer = dialog_js.useDialogPortalContainer();
3999
- const searchRef = React5__namespace.useRef(null);
4000
- React5__namespace.useEffect(() => {
4426
+ const searchRef = React6__namespace.useRef(null);
4427
+ React6__namespace.useEffect(() => {
4001
4428
  if (value === lastEmittedRef.current) return;
4002
4429
  lastEmittedRef.current = value;
4003
4430
  const next = parseIncoming(value, resolvedDefault);
4004
4431
  setCountry(next.country);
4005
4432
  setNational(next.national);
4006
4433
  }, [value, resolvedDefault]);
4007
- React5__namespace.useEffect(() => {
4434
+ React6__namespace.useEffect(() => {
4008
4435
  if (!open || isMdUp) return;
4009
4436
  const handle = window.setTimeout(() => searchRef.current?.focus(), 0);
4010
4437
  return () => window.clearTimeout(handle);
4011
4438
  }, [isMdUp, open]);
4012
4439
  const selected = COUNTRY_OPTIONS2.find((option) => option.id === country) ?? COUNTRY_OPTIONS2.find((option) => option.id === resolvedDefault);
4013
- const filtered = React5__namespace.useMemo(
4440
+ const filtered = React6__namespace.useMemo(
4014
4441
  () => filterCountries2(COUNTRY_OPTIONS2, query),
4015
4442
  [query]
4016
4443
  );
@@ -4256,18 +4683,18 @@ function AvatarEditor({
4256
4683
  labels
4257
4684
  }) {
4258
4685
  const t = { ...DEFAULT_LABELS2, ...labels };
4259
- const canvasRef = React5.useRef(null);
4260
- const fileInputRef = React5.useRef(null);
4261
- const containerRef = React5.useRef(null);
4262
- const [image, setImage] = React5.useState(null);
4263
- const [imageLoaded, setImageLoaded] = React5.useState(false);
4264
- const [zoom, setZoom] = React5.useState(1);
4265
- const [rotation, setRotation] = React5.useState(0);
4266
- const [position, setPosition] = React5.useState({ x: 0, y: 0 });
4267
- const [isDragging, setIsDragging] = React5.useState(false);
4268
- const [dragStart, setDragStart] = React5.useState({ x: 0, y: 0 });
4269
- const [showGrid, setShowGrid] = React5.useState(initialShowGrid);
4270
- const generateOutput = React5.useCallback(() => {
4686
+ const canvasRef = React6.useRef(null);
4687
+ const fileInputRef = React6.useRef(null);
4688
+ const containerRef = React6.useRef(null);
4689
+ const [image, setImage] = React6.useState(null);
4690
+ const [imageLoaded, setImageLoaded] = React6.useState(false);
4691
+ const [zoom, setZoom] = React6.useState(1);
4692
+ const [rotation, setRotation] = React6.useState(0);
4693
+ const [position, setPosition] = React6.useState({ x: 0, y: 0 });
4694
+ const [isDragging, setIsDragging] = React6.useState(false);
4695
+ const [dragStart, setDragStart] = React6.useState({ x: 0, y: 0 });
4696
+ const [showGrid, setShowGrid] = React6.useState(initialShowGrid);
4697
+ const generateOutput = React6.useCallback(() => {
4271
4698
  if (!canvasRef.current || !image) return null;
4272
4699
  const outputCanvas = document.createElement("canvas");
4273
4700
  outputCanvas.width = outputSize;
@@ -4278,7 +4705,7 @@ function AvatarEditor({
4278
4705
  const mimeType = `image/${outputFormat}`;
4279
4706
  return outputCanvas.toDataURL(mimeType, outputQuality);
4280
4707
  }, [image, outputSize, outputFormat, outputQuality]);
4281
- React5.useEffect(() => {
4708
+ React6.useEffect(() => {
4282
4709
  if (!canvasRef.current || !image || !imageLoaded) return;
4283
4710
  const canvas = canvasRef.current;
4284
4711
  const ctx = canvas.getContext("2d");
@@ -4322,12 +4749,12 @@ function AvatarEditor({
4322
4749
  generateOutput,
4323
4750
  onChange
4324
4751
  ]);
4325
- const resetTransforms = React5.useCallback(() => {
4752
+ const resetTransforms = React6.useCallback(() => {
4326
4753
  setZoom(1);
4327
4754
  setRotation(0);
4328
4755
  setPosition({ x: 0, y: 0 });
4329
4756
  }, []);
4330
- const handleFileSelect = React5.useCallback(
4757
+ const handleFileSelect = React6.useCallback(
4331
4758
  (e) => {
4332
4759
  const file = e.target.files?.[0];
4333
4760
  if (!file) return;
@@ -4346,7 +4773,7 @@ function AvatarEditor({
4346
4773
  },
4347
4774
  [resetTransforms]
4348
4775
  );
4349
- const handleMouseDown = React5.useCallback(
4776
+ const handleMouseDown = React6.useCallback(
4350
4777
  (e) => {
4351
4778
  if (!imageLoaded) return;
4352
4779
  setIsDragging(true);
@@ -4354,7 +4781,7 @@ function AvatarEditor({
4354
4781
  },
4355
4782
  [imageLoaded, position]
4356
4783
  );
4357
- const handleMouseMove = React5.useCallback(
4784
+ const handleMouseMove = React6.useCallback(
4358
4785
  (e) => {
4359
4786
  if (!isDragging) return;
4360
4787
  setPosition({
@@ -4364,10 +4791,10 @@ function AvatarEditor({
4364
4791
  },
4365
4792
  [isDragging, dragStart]
4366
4793
  );
4367
- const handleMouseUp = React5.useCallback(() => {
4794
+ const handleMouseUp = React6.useCallback(() => {
4368
4795
  setIsDragging(false);
4369
4796
  }, []);
4370
- const handleTouchStart = React5.useCallback(
4797
+ const handleTouchStart = React6.useCallback(
4371
4798
  (e) => {
4372
4799
  if (!imageLoaded) return;
4373
4800
  const touch = e.touches[0];
@@ -4379,7 +4806,7 @@ function AvatarEditor({
4379
4806
  },
4380
4807
  [imageLoaded, position]
4381
4808
  );
4382
- const handleTouchMove = React5.useCallback(
4809
+ const handleTouchMove = React6.useCallback(
4383
4810
  (e) => {
4384
4811
  if (!isDragging) return;
4385
4812
  const touch = e.touches[0];
@@ -4390,7 +4817,7 @@ function AvatarEditor({
4390
4817
  },
4391
4818
  [isDragging, dragStart]
4392
4819
  );
4393
- const handleDiscard = React5.useCallback(() => {
4820
+ const handleDiscard = React6.useCallback(() => {
4394
4821
  setImage(null);
4395
4822
  setImageLoaded(false);
4396
4823
  resetTransforms();
@@ -4761,8 +5188,8 @@ function AvatarEditor({
4761
5188
  );
4762
5189
  }
4763
5190
  function useMediaQuery2(query) {
4764
- const [matches, setMatches] = React5.useState(false);
4765
- React5.useEffect(() => {
5191
+ const [matches, setMatches] = React6.useState(false);
5192
+ React6.useEffect(() => {
4766
5193
  const media = window.matchMedia(query);
4767
5194
  if (media.matches !== matches) {
4768
5195
  setMatches(media.matches);
@@ -4792,17 +5219,17 @@ function AvatarEditorDialog({
4792
5219
  className,
4793
5220
  editorLabels
4794
5221
  }) {
4795
- const [isOpen, setIsOpen] = React5.useState(false);
4796
- const [editedValue, setEditedValue] = React5.useState(value ?? null);
4797
- const [displaySrc, setDisplaySrc] = React5.useState(value ?? null);
4798
- const [isSaving, setIsSaving] = React5.useState(false);
4799
- const [feedback, setFeedback] = React5.useState(null);
4800
- React5.useEffect(() => {
5222
+ const [isOpen, setIsOpen] = React6.useState(false);
5223
+ const [editedValue, setEditedValue] = React6.useState(value ?? null);
5224
+ const [displaySrc, setDisplaySrc] = React6.useState(value ?? null);
5225
+ const [isSaving, setIsSaving] = React6.useState(false);
5226
+ const [feedback, setFeedback] = React6.useState(null);
5227
+ React6.useEffect(() => {
4801
5228
  setDisplaySrc(value ?? null);
4802
5229
  }, [value]);
4803
5230
  const isMobile = useMediaQuery2("(max-width: 640px)");
4804
5231
  const caption = (placeholder ?? "").trim();
4805
- const handleOpenChange = React5.useCallback(
5232
+ const handleOpenChange = React6.useCallback(
4806
5233
  (open) => {
4807
5234
  if (open) {
4808
5235
  setEditedValue(value ?? null);
@@ -4812,7 +5239,7 @@ function AvatarEditorDialog({
4812
5239
  },
4813
5240
  [value]
4814
5241
  );
4815
- const handleAccept = React5.useCallback(async () => {
5242
+ const handleAccept = React6.useCallback(async () => {
4816
5243
  if (!editedValue) return;
4817
5244
  setIsSaving(true);
4818
5245
  setFeedback(null);
@@ -5079,10 +5506,10 @@ function FileDropzone({
5079
5506
  className
5080
5507
  }) {
5081
5508
  const labels = { ...DEFAULT_FILE_DROPZONE_LABELS, ...labelOverrides };
5082
- const inputId = React5.useId();
5083
- const inputRef = React5.useRef(null);
5084
- const [dragging, setDragging] = React5.useState(false);
5085
- const [message, setMessage] = React5.useState(null);
5509
+ const inputId = React6.useId();
5510
+ const inputRef = React6.useRef(null);
5511
+ const [dragging, setDragging] = React6.useState(false);
5512
+ const [message, setMessage] = React6.useState(null);
5086
5513
  function takeFile(file) {
5087
5514
  if (!file || disabled) return;
5088
5515
  if (!fileMatchesAccept(file, accept)) {
@@ -5336,7 +5763,7 @@ function FileUploadMenu({
5336
5763
  }) {
5337
5764
  const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
5338
5765
  const visible = jobs.filter((job) => job.status !== "cancelled");
5339
- const [uncontrolledOpen, setUncontrolledOpen] = React5.useState(false);
5766
+ const [uncontrolledOpen, setUncontrolledOpen] = React6.useState(false);
5340
5767
  const isControlled = open !== void 0;
5341
5768
  const resolvedOpen = isControlled ? open : uncontrolledOpen;
5342
5769
  function setResolvedOpen(next) {
@@ -5947,10 +6374,10 @@ function CookieConsentBanner({
5947
6374
  className
5948
6375
  }) {
5949
6376
  const copy = { ...DEFAULT_COOKIE_CONSENT_BANNER_LABELS, ...labels };
5950
- const [consent, setConsent] = React5.useState(
6377
+ const [consent, setConsent] = React6.useState(
5951
6378
  "pending"
5952
6379
  );
5953
- React5.useEffect(() => {
6380
+ React6.useEffect(() => {
5954
6381
  if (variant === "embed" || isEmbeddedWindow()) {
5955
6382
  setConsent("necessary");
5956
6383
  return;
@@ -6427,7 +6854,7 @@ function FormSection({
6427
6854
  );
6428
6855
  }
6429
6856
  function useDirtyGuard(dirty) {
6430
- React5.useEffect(() => {
6857
+ React6.useEffect(() => {
6431
6858
  if (!dirty) return;
6432
6859
  function onBeforeUnload(event) {
6433
6860
  event.preventDefault();
@@ -6579,7 +7006,7 @@ function useQueueKeys({
6579
7006
  selectedId,
6580
7007
  onSelect
6581
7008
  }) {
6582
- const move = React5.useCallback(
7009
+ const move = React6.useCallback(
6583
7010
  (delta) => {
6584
7011
  if (ids.length === 0) return;
6585
7012
  const currentIndex = selectedId ? ids.indexOf(selectedId) : -1;
@@ -6594,7 +7021,7 @@ function useQueueKeys({
6594
7021
  },
6595
7022
  [ids, onSelect, selectedId]
6596
7023
  );
6597
- React5.useEffect(() => {
7024
+ React6.useEffect(() => {
6598
7025
  if (!enabled) return;
6599
7026
  function onKeyDown(event) {
6600
7027
  if (isTypingTarget(event.target)) return;
@@ -6698,8 +7125,8 @@ function prefersReducedMotion() {
6698
7125
  return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
6699
7126
  }
6700
7127
  function useSectionNav(sections) {
6701
- const [active, setActive] = React5.useState(sections[0]?.id ?? "");
6702
- React5.useEffect(() => {
7128
+ const [active, setActive] = React6.useState(sections[0]?.id ?? "");
7129
+ React6.useEffect(() => {
6703
7130
  const elements = sections.map((section) => document.getElementById(section.id)).filter((node) => node !== null);
6704
7131
  if (elements.length === 0) return;
6705
7132
  const observer = new IntersectionObserver(
@@ -7178,8 +7605,8 @@ function MatchReview({
7178
7605
  className
7179
7606
  }) {
7180
7607
  const copy = { ...DEFAULT_MATCH_REVIEW_LABELS, ...labels };
7181
- const reasonId = React5.useId();
7182
- const [reason, setReason] = React5.useState("");
7608
+ const reasonId = React6.useId();
7609
+ const [reason, setReason] = React6.useState("");
7183
7610
  const trimmed = reason.trim();
7184
7611
  if (!hit) {
7185
7612
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -7362,6 +7789,7 @@ exports.QueueLayout = QueueLayout;
7362
7789
  exports.RfcInput = RfcInput;
7363
7790
  exports.RiskBadge = RiskBadge;
7364
7791
  exports.RouteLoading = RouteLoading;
7792
+ exports.SAT_TAX_REGIME_CODES = SAT_TAX_REGIME_CODES;
7365
7793
  exports.SafeImage = SafeImage;
7366
7794
  exports.SearchablePicker = SearchablePicker;
7367
7795
  exports.SectionCard = SectionCard;
@@ -7374,11 +7802,13 @@ exports.StatHighlightCard = StatHighlightCard;
7374
7802
  exports.StatusBadge = StatusBadge;
7375
7803
  exports.StepProgress = StepProgress;
7376
7804
  exports.StickyActionBar = StickyActionBar;
7805
+ exports.TAX_REGIME_OPTIONS = TAX_REGIME_OPTIONS;
7377
7806
  exports.THEME_INIT_SCRIPT = THEME_INIT_SCRIPT;
7378
7807
  exports.THEME_INIT_SCRIPT_ID = THEME_INIT_SCRIPT_ID;
7379
7808
  exports.THEME_STORAGE_KEY = THEME_STORAGE_KEY;
7380
7809
  exports.TIME_RANGE_OPTIONS = TIME_RANGE_OPTIONS;
7381
7810
  exports.TableSkeleton = TableSkeleton;
7811
+ exports.TaxRegimePicker = TaxRegimePicker;
7382
7812
  exports.ThemeSwitcher = ThemeSwitcher;
7383
7813
  exports.TimeRangePicker = TimeRangePicker;
7384
7814
  exports.WizardLayout = WizardLayout;
@@ -7394,12 +7824,15 @@ exports.dataTableBodyMinClass = dataTableBodyMinClass;
7394
7824
  exports.defaultLanguages = defaultLanguages;
7395
7825
  exports.fileMatchesAccept = fileMatchesAccept;
7396
7826
  exports.filterCountries = filterCountries;
7827
+ exports.filterTaxRegimes = filterTaxRegimes;
7397
7828
  exports.formatCountryOptionLabel = formatCountryOptionLabel;
7829
+ exports.formatTaxRegimeOptionLabel = formatTaxRegimeOptionLabel;
7398
7830
  exports.getAvatarColors = getAvatarColors;
7399
7831
  exports.getInitials = getInitials;
7400
7832
  exports.isCookieConsentValue = isCookieConsentValue;
7401
7833
  exports.isEmbeddedWindow = isEmbeddedWindow;
7402
7834
  exports.isKnownCountryCode = isKnownCountryCode;
7835
+ exports.isKnownTaxRegimeCode = isKnownTaxRegimeCode;
7403
7836
  exports.matchClaimIsUnverified = matchClaimIsUnverified;
7404
7837
  exports.normalizeCurpInput = normalizeCurpInput;
7405
7838
  exports.normalizeRfc = normalizeRfc;
@@ -7414,6 +7847,8 @@ exports.serializeCookieConsent = serializeCookieConsent;
7414
7847
  exports.signalNavigationStart = signalNavigationStart;
7415
7848
  exports.sourceUrlIsHttps = sourceUrlIsHttps;
7416
7849
  exports.suppressNavigationProgress = suppressNavigationProgress;
7850
+ exports.taxRegimeLabel = taxRegimeLabel;
7851
+ exports.taxRegimePickerItems = taxRegimePickerItems;
7417
7852
  exports.useDirtyGuard = useDirtyGuard;
7418
7853
  exports.useEditableSection = useEditableSection;
7419
7854
  exports.useLanguageContext = useLanguageContext;