@framework-m/ui 0.2.2

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.
Files changed (45) hide show
  1. package/LICENSE +202 -0
  2. package/dist/components/Button.d.ts +17 -0
  3. package/dist/components/Button.d.ts.map +1 -0
  4. package/dist/components/LocaleSwitcher.d.ts +29 -0
  5. package/dist/components/LocaleSwitcher.d.ts.map +1 -0
  6. package/dist/components/Skeleton.d.ts +22 -0
  7. package/dist/components/Skeleton.d.ts.map +1 -0
  8. package/dist/components/StateBadge.d.ts +13 -0
  9. package/dist/components/StateBadge.d.ts.map +1 -0
  10. package/dist/components/TamaguiPrimitives.d.ts +7 -0
  11. package/dist/components/TamaguiPrimitives.d.ts.map +1 -0
  12. package/dist/components/Toast.d.ts +34 -0
  13. package/dist/components/Toast.d.ts.map +1 -0
  14. package/dist/components/index.d.ts +13 -0
  15. package/dist/components/index.d.ts.map +1 -0
  16. package/dist/index.d.ts +31 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +4981 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/stories/Button.stories.d.ts +10 -0
  21. package/dist/stories/Button.stories.d.ts.map +1 -0
  22. package/dist/stories/Skeleton.stories.d.ts +9 -0
  23. package/dist/stories/Skeleton.stories.d.ts.map +1 -0
  24. package/dist/stories/StateBadge.stories.d.ts +9 -0
  25. package/dist/stories/StateBadge.stories.d.ts.map +1 -0
  26. package/dist/stories/Toast.stories.d.ts +8 -0
  27. package/dist/stories/Toast.stories.d.ts.map +1 -0
  28. package/dist/theme/TamaguiProvider.d.ts +6 -0
  29. package/dist/theme/TamaguiProvider.d.ts.map +1 -0
  30. package/dist/theme/ThemeContext.d.ts +13 -0
  31. package/dist/theme/ThemeContext.d.ts.map +1 -0
  32. package/dist/theme/ThemeToggle.d.ts +13 -0
  33. package/dist/theme/ThemeToggle.d.ts.map +1 -0
  34. package/dist/theme/index.d.ts +8 -0
  35. package/dist/theme/index.d.ts.map +1 -0
  36. package/dist/theme/tamaguiConfig.d.ts +41 -0
  37. package/dist/theme/tamaguiConfig.d.ts.map +1 -0
  38. package/dist/tokens/colors.json.d.ts +83 -0
  39. package/dist/tokens/index.d.ts +10 -0
  40. package/dist/tokens/index.d.ts.map +1 -0
  41. package/dist/tokens/spacing.json.d.ts +25 -0
  42. package/dist/tokens/tamagui.d.ts +31 -0
  43. package/dist/tokens/tamagui.d.ts.map +1 -0
  44. package/dist/tokens/typography.json.d.ts +30 -0
  45. package/package.json +68 -0
package/dist/index.js ADDED
@@ -0,0 +1,4981 @@
1
+ var Ni = Object.defineProperty;
2
+ var Ti = (e, t, n) => t in e ? Ni(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var vr = (e, t, n) => Ti(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { jsx as w, jsxs as Xe, Fragment as Cn } from "react/jsx-runtime";
5
+ import * as fo from "react";
6
+ import te, { createContext as Xt, useState as us, useEffect as Tt, useContext as An, useCallback as ds, useLayoutEffect as xi, useRef as jt, useSyncExternalStore as fs, useId as ms, Children as bn, isValidElement as Wo, cloneElement as yn, forwardRef as hs, memo as wi, useMemo as _i } from "react";
7
+ import { createPortal as $i } from "react-dom";
8
+ const ps = Xt(null), mo = "framework-m-theme";
9
+ function Ci() {
10
+ const e = localStorage.getItem(mo);
11
+ return e === "light" || e === "dark" ? e : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
12
+ }
13
+ function Er(e) {
14
+ const t = document.documentElement;
15
+ e === "dark" ? t.classList.add("dark") : t.classList.remove("dark");
16
+ }
17
+ function qc({ children: e }) {
18
+ const [t, n] = us(Ci);
19
+ Tt(() => {
20
+ Er(t);
21
+ }, [t]), Tt(() => {
22
+ const i = window.matchMedia("(prefers-color-scheme: dark)"), a = (l) => {
23
+ localStorage.getItem(mo) || n(l.matches ? "dark" : "light");
24
+ };
25
+ return i.addEventListener("change", a), () => i.removeEventListener("change", a);
26
+ }, []);
27
+ const o = (i) => {
28
+ n(i), localStorage.setItem(mo, i), Er(i);
29
+ }, s = { theme: t, setTheme: o, toggleTheme: () => {
30
+ o(t === "light" ? "dark" : "light");
31
+ } };
32
+ return /* @__PURE__ */ w(ps.Provider, { value: s, children: e });
33
+ }
34
+ function gs() {
35
+ const e = An(ps);
36
+ if (!e)
37
+ throw new Error("useTheme must be used within ThemeProvider");
38
+ return e;
39
+ }
40
+ function Ai() {
41
+ return /* @__PURE__ */ Xe(
42
+ "svg",
43
+ {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: "20",
46
+ height: "20",
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ stroke: "currentColor",
50
+ strokeWidth: "2",
51
+ strokeLinecap: "round",
52
+ strokeLinejoin: "round",
53
+ children: [
54
+ /* @__PURE__ */ w("circle", { cx: "12", cy: "12", r: "5" }),
55
+ /* @__PURE__ */ w("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
56
+ /* @__PURE__ */ w("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
57
+ /* @__PURE__ */ w("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
58
+ /* @__PURE__ */ w("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
59
+ /* @__PURE__ */ w("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
60
+ /* @__PURE__ */ w("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
61
+ /* @__PURE__ */ w("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
62
+ /* @__PURE__ */ w("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ function Oi() {
68
+ return /* @__PURE__ */ w(
69
+ "svg",
70
+ {
71
+ xmlns: "http://www.w3.org/2000/svg",
72
+ width: "20",
73
+ height: "20",
74
+ viewBox: "0 0 24 24",
75
+ fill: "none",
76
+ stroke: "currentColor",
77
+ strokeWidth: "2",
78
+ strokeLinecap: "round",
79
+ strokeLinejoin: "round",
80
+ children: /* @__PURE__ */ w("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
81
+ }
82
+ );
83
+ }
84
+ function Jc() {
85
+ const { theme: e, toggleTheme: t } = gs();
86
+ return /* @__PURE__ */ Xe(
87
+ "button",
88
+ {
89
+ onClick: t,
90
+ className: "theme-toggle",
91
+ "aria-label": `Switch to ${e === "light" ? "dark" : "light"} mode`,
92
+ title: `Current theme: ${e}`,
93
+ type: "button",
94
+ children: [
95
+ e === "light" ? /* @__PURE__ */ w(Oi, {}) : /* @__PURE__ */ w(Ai, {}),
96
+ /* @__PURE__ */ w("style", { children: `
97
+ .theme-toggle {
98
+ display: flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ width: 40px;
102
+ height: 40px;
103
+ border: none;
104
+ background: transparent;
105
+ cursor: pointer;
106
+ border-radius: 8px;
107
+ color: var(--text-color, #333);
108
+ transition: all 0.2s ease;
109
+ }
110
+
111
+ .theme-toggle:hover {
112
+ background: var(--hover-bg, rgba(0, 0, 0, 0.05));
113
+ }
114
+
115
+ .theme-toggle:active {
116
+ transform: scale(0.95);
117
+ }
118
+
119
+ .theme-toggle:focus-visible {
120
+ outline: 2px solid var(--primary-color, #3b82f6);
121
+ outline-offset: 2px;
122
+ }
123
+
124
+ .dark .theme-toggle {
125
+ color: var(--text-color-dark, #e5e7eb);
126
+ }
127
+
128
+ .dark .theme-toggle:hover {
129
+ background: var(--hover-bg-dark, rgba(255, 255, 255, 0.1));
130
+ }
131
+ ` })
132
+ ]
133
+ }
134
+ );
135
+ }
136
+ const nt = {
137
+ // order of keys here important! in priority order
138
+ hoverStyle: {
139
+ name: "hover",
140
+ priority: 2
141
+ },
142
+ pressStyle: {
143
+ name: "active",
144
+ stateKey: "press",
145
+ priority: 3
146
+ },
147
+ focusVisibleStyle: {
148
+ name: "focus-visible",
149
+ priority: 4,
150
+ stateKey: "focusVisible"
151
+ },
152
+ focusStyle: {
153
+ name: "focus",
154
+ priority: 4
155
+ },
156
+ focusWithinStyle: {
157
+ name: "focus-within",
158
+ priority: 4,
159
+ stateKey: "focusWithin"
160
+ },
161
+ disabledStyle: {
162
+ name: "disabled",
163
+ priority: 5,
164
+ stateKey: "disabled"
165
+ }
166
+ }, jo = {
167
+ hover: nt.hoverStyle.priority,
168
+ press: nt.pressStyle.priority,
169
+ focus: nt.focusStyle.priority,
170
+ focusVisible: nt.focusVisibleStyle.priority,
171
+ focusWithin: nt.focusWithinStyle.priority,
172
+ disabled: nt.disabledStyle.priority
173
+ }, Oe = {
174
+ ...nt,
175
+ enterStyle: {
176
+ name: "enter",
177
+ selector: ".t_unmounted",
178
+ priority: 4
179
+ },
180
+ exitStyle: {
181
+ name: "exit",
182
+ priority: 5
183
+ }
184
+ }, Ri = Object.keys(Oe).length, zo = (e, t) => {
185
+ const n = {};
186
+ for (const o in e) o in t || (n[o] = e[o]);
187
+ for (const o in t) bs(n, e, t, o);
188
+ return n;
189
+ }, Ii = (e, t, n) => {
190
+ let o = null;
191
+ if (!e && !t) return [n, o];
192
+ if (e && !t) return [zo(e, n), o];
193
+ const r = {};
194
+ for (const s in e) s in n || (r[s] = e[s]);
195
+ for (const s in t) {
196
+ if (s in n) continue;
197
+ const i = t[s];
198
+ i !== void 0 && (r[s] = i);
199
+ }
200
+ for (const s in n) bs(r, e, n, s), t && s in t && (o || (o = {}), o[s] = n[s]);
201
+ return [r, o];
202
+ };
203
+ function bs(e, t, n, o) {
204
+ let r = n[o];
205
+ if (t && o in t && (o in Oe || o[0] === "$") && r && typeof r == "object") {
206
+ const s = t[o];
207
+ s && typeof s == "object" && (r = zo(s, r));
208
+ }
209
+ e[o] = r;
210
+ }
211
+ function ho(e) {
212
+ let t = "";
213
+ for (const n in e) {
214
+ t += n;
215
+ const o = e[n];
216
+ let r = typeof o;
217
+ if (!o || r !== "object" && r !== "function") t += r + o;
218
+ else if (Kn.has(o)) t += Kn.get(o);
219
+ else {
220
+ let s = Math.random();
221
+ Kn.set(o, s), t += s;
222
+ }
223
+ }
224
+ return t;
225
+ }
226
+ const Kn = /* @__PURE__ */ new WeakMap(), Fi = (e, t = "") => {
227
+ "use no memo";
228
+ const n = te.createContext, o = te.useMemo, r = te.useContext, s = n(e), i = s.Provider, a = s, l = /* @__PURE__ */ new Map(), d = n(t);
229
+ function u(p) {
230
+ let g = l.get(p);
231
+ return g || (g = n(e), l.set(p, g)), g;
232
+ }
233
+ const c = (p) => t ? `${t}--${p}` : p, m = ({
234
+ children: p,
235
+ scope: g,
236
+ // performance: avoid creating objects
237
+ __disableMergeDefaultValues: b,
238
+ ...h
239
+ }) => {
240
+ const S = c(g), N = o(() => b ? h : zo(e, h), [ho(h)]);
241
+ let y = i;
242
+ return S && (y = u(S).Provider), /* @__PURE__ */ w(d.Provider, {
243
+ value: S,
244
+ children: /* @__PURE__ */ w(y, {
245
+ value: N,
246
+ children: p
247
+ })
248
+ });
249
+ }, f = (p = "") => {
250
+ const g = r(d), b = t ? p ? c(p) : g : p, h = b ? u(b) : s;
251
+ return r(h);
252
+ };
253
+ return a.Provider = m, a.props = e, a.context = s, a.useStyledContext = f, a;
254
+ }, un = Fi({
255
+ disableSSR: void 0,
256
+ inText: !1,
257
+ language: null,
258
+ animationDriver: null,
259
+ setParentFocusState: null,
260
+ insets: null
261
+ }), Nr = Xt(null);
262
+ function Vi(e, t) {
263
+ return ds((n) => {
264
+ e((o) => {
265
+ const r = typeof n == "function" ? n(o) : n, s = po(o, r);
266
+ return process.env.NODE_ENV === "development" && t && s !== o && (console.groupCollapsed("setStateShallow CHANGE", "=>", s), console.info("previously", o), console.trace(), console.groupEnd()), s;
267
+ });
268
+ }, [e, t]);
269
+ }
270
+ function po(e, t) {
271
+ return !e || !t || ys(e, t) ? e || t : {
272
+ ...e,
273
+ ...t
274
+ };
275
+ }
276
+ function ys(e, t) {
277
+ for (const n in t) if (e[n] !== t[n]) return !1;
278
+ return !0;
279
+ }
280
+ const Et = !0, Ss = typeof window < "u", On = !Ss, St = Ss, Ae = On ? Tt : xi;
281
+ process.env.TEST_NATIVE_PLATFORM;
282
+ const vs = "web", Es = "t_", zt = process.env.NODE_ENV === "development" ? `Can't find Tamagui configuration.
283
+
284
+ Most of the time this is due to having mis-matched versions of Tamagui dependencies, or bundlers somehow duplicating them.
285
+ First step is to ensure every "tamagui" and "@tamagui/*" dependency is on the same version, we have a CLI tool to help:
286
+
287
+ npx @tamagui/cli check
288
+ ` : "Missing theme.";
289
+ let Ns, Ts = !1;
290
+ const Mi = process.env.NODE_ENV === "development" ? `
291
+ Haven't called createTamagui yet. ${zt}
292
+ ` : "❌ Error 001", Uo = () => Ns || (globalThis.__tamaguiConfig ? (process.env.NODE_ENV === "development" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck && (globalThis.__tamaguiPendingCheck = !0, setTimeout(() => {
293
+ !Ts && !globalThis.__tamaguiHasWarnedGlobalFallback && (globalThis.__tamaguiHasWarnedGlobalFallback = !0, console.warn("Tamagui: Using global config fallback. This may indicate duplicate tamagui instances (e.g., from Vite SSR bundling). This is handled automatically, but may cause issues.")), globalThis.__tamaguiPendingCheck = !1;
294
+ }, 500)), globalThis.__tamaguiConfig) : null), we = (e) => {
295
+ const t = Uo();
296
+ if (process.env.NODE_ENV === "development" && !t) throw new Error(Mi);
297
+ return t.settings[e] ?? // @ts-expect-error
298
+ t[e];
299
+ }, Di = (e) => {
300
+ Ts = !0, Ns = e, globalThis.__tamaguiConfig = e;
301
+ }, De = () => {
302
+ const e = Uo();
303
+ if (!e) throw new Error(process.env.NODE_ENV !== "production" ? "Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.) not just in your package.json, but in your lockfile." : "Err0");
304
+ return e;
305
+ }, xs = () => Uo();
306
+ function Pi(e) {
307
+ return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`).toLowerCase();
308
+ }
309
+ const Hn = /* @__PURE__ */ new WeakMap();
310
+ function ws(e) {
311
+ if (typeof e == "string") return e;
312
+ if (Hn.has(e)) return Hn.get(e);
313
+ const t = Object.entries(e).map(([n, o]) => (n = Pi(n), typeof o == "string" ? `(${n}: ${o})` : (typeof o == "number" && /[height|width]$/.test(n) && (o = `${o}px`), `(${n}: ${o})`))).join(" and ");
314
+ return Hn.set(e, t), t;
315
+ }
316
+ let Rn = (
317
+ // development only safeguard
318
+ process.env.NODE_ENV === "development" ? new Proxy({}, {
319
+ get(e, t) {
320
+ if (typeof t == "string" && t[0] === "$" && // dont error on $$typeof
321
+ t[1] !== "$") throw new Error(`Access mediaState should not use "$": ${t}`);
322
+ return Reflect.get(e, t);
323
+ }
324
+ }) : {}
325
+ );
326
+ const ki = (e) => {
327
+ Rn = e;
328
+ }, Ut = {}, Ye = () => Rn, Go = /* @__PURE__ */ new Set();
329
+ function Li(e) {
330
+ return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
331
+ }
332
+ function Bi(e) {
333
+ return e ? Li(e) in jo : !1;
334
+ }
335
+ function _s(e) {
336
+ const t = Ye(), [n, o, r, s, i] = e.split("-"), a = r && s ? `${r}-${s}` : "", l = a && a in t && a || r && r in t && r || void 0;
337
+ let d = l ? l === a ? i : s ? `${s}${i ? `-${i}` : ""}` : void 0 : r ? `${r}${s ? `-${s}` : ""}${i ? `-${i}` : ""}` : void 0;
338
+ return d && !Bi(d) && (process.env.NODE_ENV === "development" && console.warn(`Unknown group prop part "${d}" in "${e}". If this is a media query, ensure it's defined in your tamagui config.`), d = void 0), {
339
+ name: o,
340
+ pseudo: d,
341
+ media: l
342
+ };
343
+ }
344
+ const Tr = "_";
345
+ let go = null, dn = null;
346
+ function Wi() {
347
+ go = null, dn = null;
348
+ }
349
+ const ji = {
350
+ press: "active",
351
+ focusVisible: "focus-visible",
352
+ focusWithin: "focus-within"
353
+ }, xr = new Array(12).fill(0).map((e, t) => new Array(t).fill(":root").join(""));
354
+ function zi(e, t, n, o, r = !1, s = "") {
355
+ const i = t.lastIndexOf(":root") + 5, a = t.lastIndexOf("{"), l = t.slice(i, a), d = we("addThemeClassName") !== !1 && r ? "" : " ", u = o.pseudo ? ji[o.pseudo] || o.pseudo : void 0, c = u ? `:${u}` : "", m = `:root${s}${d}`, f = `.t_${n ? "group_" : ""}${e}${c}`;
356
+ return [l, `${m}${f} ${l.replaceAll(":root", "")}`];
357
+ }
358
+ const Ui = (e, t, n, o, r, s) => {
359
+ const [i, , a, l, d] = e, u = o === "theme", c = o === "platform", m = o === "group", f = u || c || m, p = "", g = a.slice(0, a.indexOf("-") + 1), b = `${g}${Tr}${t.replace("-", "")}${p}${Tr}`;
360
+ let h = "", S = "", N, y, $ = a.replace(g, b), M = d.map((C) => C.replaceAll(a, $)).join(";"), K = !1;
361
+ if (f) {
362
+ let C = (s || 0) + (m || c ? 1 : 0);
363
+ if (u || m) {
364
+ const A = _s(u ? "theme-" + t : t), {
365
+ name: T,
366
+ media: P,
367
+ pseudo: B
368
+ } = A;
369
+ N = P, m && (y = T), (B === "press" || l === "active") && (C += 2), B === "hover" && (K = !0);
370
+ const [k, W] = zi(T, M, m, A, u, xr[C]);
371
+ h = M.replace(k, W);
372
+ } else h = `${xr[C]}${M}`;
373
+ }
374
+ if (!f || N) {
375
+ if (!dn) {
376
+ const k = Object.keys(n);
377
+ dn = Object.fromEntries(k.map((W) => [W, ws(n[W])])), go = Object.fromEntries(k.map((W, ae) => [W, new Array(ae + 1).fill(":root").join("")]));
378
+ }
379
+ const C = N || t, A = dn[C], T = `${A}`, P = N ? S : go[C], B = N ? `@container ${y}` : "@media";
380
+ N && (M = h), M.includes(B) ? h = M.replace("{", ` and ${T} {`).replace("and screen and", "and") : h = `${B} ${T}{${P}${M}}`, N && (h = `@supports (contain: ${we("webContainerType") || "inline-size"}) {${h}}`);
381
+ }
382
+ return K && (h = `@media (hover:hover){${h}}`), [i, void 0, $, void 0, [h]];
383
+ }, Gi = typeof window < "u" && window.matchMedia || Ki;
384
+ function Ki(e) {
385
+ return {
386
+ match: (t, n) => !1,
387
+ addListener() {
388
+ },
389
+ removeListener() {
390
+ },
391
+ matches: !1
392
+ };
393
+ }
394
+ const $s = /\$(platform|theme|group)-/, Hi = (e) => e[0] !== "$" ? !1 : !!(Go.has(e) || $s.test(e)), wr = (e) => {
395
+ if (e[0] !== "$") return !1;
396
+ if (Go.has(e)) return !0;
397
+ const t = e.match($s);
398
+ return t ? t[1] : !1;
399
+ };
400
+ let Cs, As;
401
+ const Xi = (e) => {
402
+ if (process.env.NODE_ENV === "development" && e[0] === "$") throw new Error("use short key");
403
+ return As.indexOf(e) + 100;
404
+ }, bo = /* @__PURE__ */ new Set();
405
+ let yo = 0;
406
+ const Yi = (e) => {
407
+ const {
408
+ media: t
409
+ } = e, n = we("mediaQueryDefaultActive");
410
+ if (t) {
411
+ yo++, Wi();
412
+ for (const o in t) Ye()[o] = (n == null ? void 0 : n[o]) || !1, Go.add(`$${o}`);
413
+ Object.assign(Ut, t), Cs = {
414
+ ...Ye()
415
+ }, As = Object.keys(t), qi();
416
+ }
417
+ };
418
+ function Zi() {
419
+ bo.forEach((e) => e()), bo.clear();
420
+ }
421
+ let _r = -1;
422
+ function qi() {
423
+ if (!On && !process.env.IS_STATIC && _r !== yo) {
424
+ _r = yo, Zi();
425
+ for (const e in Ut) {
426
+ let t = function() {
427
+ const s = !!o().matches;
428
+ s !== Ye()[e] && (ki({
429
+ ...Ye(),
430
+ [e]: s
431
+ }), Os());
432
+ };
433
+ const n = ws(Ut[e]), o = () => Gi(n), r = o();
434
+ if (!r) throw new Error("⚠️ No match");
435
+ r.addListener(t), bo.add(() => {
436
+ r.removeListener(t);
437
+ }), t();
438
+ }
439
+ }
440
+ }
441
+ const So = /* @__PURE__ */ new Set();
442
+ function Os() {
443
+ So.forEach((e) => e(Ye()));
444
+ }
445
+ const vo = /* @__PURE__ */ new WeakMap();
446
+ function Ji(e, t, n) {
447
+ const o = vo.get(e);
448
+ (!o || o.enabled !== t || n) && vo.set(e, {
449
+ ...o,
450
+ enabled: t,
451
+ keys: n
452
+ });
453
+ }
454
+ function Qi(e) {
455
+ return So.add(e), () => {
456
+ So.delete(e);
457
+ };
458
+ }
459
+ function ea(e, t) {
460
+ "use no memo";
461
+ const n = e ? vo.get(e) : null, o = jt(null);
462
+ o.current || (o.current = {
463
+ keys: /* @__PURE__ */ new Set(),
464
+ lastState: Ye()
465
+ }), o.current.pendingState && (o.current.lastState = o.current.pendingState, o.current.pendingState = void 0);
466
+ const {
467
+ keys: r
468
+ } = o.current;
469
+ r.size && r.clear();
470
+ const s = fs(Qi, () => {
471
+ const i = (n == null ? void 0 : n.keys) || r, {
472
+ lastState: a,
473
+ pendingState: l
474
+ } = o.current;
475
+ if (!i.size) return a;
476
+ const d = Ye();
477
+ for (const u of i) if (d[u] !== (l || a)[u]) return process.env.NODE_ENV === "development" && t && console.warn("useMedia() ✍️", u, a[u], "=>", d[u]), e != null && e.mediaEmit ? (e.mediaEmit(d), o.current.pendingState = d, a) : (o.current.lastState = d, d);
478
+ return a;
479
+ }, ta);
480
+ return new Proxy(s, {
481
+ get(i, a) {
482
+ return !Sn && typeof a == "string" && r.add(a), Reflect.get(s, a);
483
+ }
484
+ });
485
+ }
486
+ const ta = () => Cs;
487
+ let Sn = !1;
488
+ function $r(e) {
489
+ Sn = e;
490
+ }
491
+ function na(e, t) {
492
+ Sn = !0;
493
+ let n;
494
+ try {
495
+ n = Object.fromEntries([...e].map((o) => [o, Rs(o, t)]));
496
+ } finally {
497
+ Sn = !1;
498
+ }
499
+ return n;
500
+ }
501
+ const oa = (e, t, n, o) => {
502
+ const r = o ? Xi(e) : Ri, s = n.usedKeys;
503
+ return !s[t] || r > s[t] ? r : null;
504
+ };
505
+ function Rs(e, t) {
506
+ const n = Ut[e];
507
+ return Object.keys(n).every((o) => {
508
+ const r = +n[o], s = o.startsWith("max"), i = o.endsWith("Width"), a = t[i ? "width" : "height"];
509
+ return s ? a < r : a > r;
510
+ });
511
+ }
512
+ const rn = /* @__PURE__ */ new Map();
513
+ let Xn = 0;
514
+ const wt = (e, t = 10) => {
515
+ if (rn.has(e)) return rn.get(e);
516
+ let n = e;
517
+ n[0] === "v" && n.startsWith("var(") && (n = n.slice(6, n.length - 1));
518
+ let o = 0, r = "", s = 0;
519
+ const i = n.length;
520
+ for (let l = 0; l < i; l++) {
521
+ if (t !== "strict" && s <= t) {
522
+ const d = n.charCodeAt(l);
523
+ if (d === 46) {
524
+ r += "--";
525
+ continue;
526
+ }
527
+ if (sa(d)) {
528
+ s++, r += n[l];
529
+ continue;
530
+ }
531
+ }
532
+ o = ra(o, n[l]);
533
+ }
534
+ const a = r + (o ? Math.abs(o) : "");
535
+ return Xn > 1e4 && (rn.clear(), Xn = 0), rn.set(e, a), Xn++, a;
536
+ }, ra = (e, t) => Math.imul(31, e) + t.charCodeAt(0) | 0;
537
+ function sa(e) {
538
+ return (
539
+ // A-Z
540
+ e >= 65 && e <= 90 || // a-z
541
+ e >= 97 && e <= 122 || // _
542
+ e === 95 || // -
543
+ e === 45 || // 0-9
544
+ e >= 48 && e <= 57
545
+ );
546
+ }
547
+ function ia(e, [t, n]) {
548
+ return Math.min(n, Math.max(t, e));
549
+ }
550
+ function Ko(e, t, {
551
+ checkDefaultPrevented: n = !0
552
+ } = {}) {
553
+ return !e || !t ? t || e || void 0 : (o) => {
554
+ if (e == null || e(o), !o || !(n && typeof o == "object" && "defaultPrevented" in o) || // @ts-ignore
555
+ "defaultPrevented" in o && !o.defaultPrevented) return t == null ? void 0 : t(o);
556
+ };
557
+ }
558
+ const Dt = 0, aa = 1, it = 2, Is = 3, In = 4, Fs = ["web", "android", "ios"];
559
+ function la(e) {
560
+ if (!e) return null;
561
+ const t = ca(e);
562
+ for (const n of Fs) if (n === vs && t.has(n)) return n;
563
+ return null;
564
+ }
565
+ function ca(e) {
566
+ const t = e === !0 ? Fs : e === !1 ? [] : Array.isArray(e) ? e : [e], n = new Set(t);
567
+ return n.has("mobile") && (n.add("android"), n.add("ios"), n.delete("mobile")), n;
568
+ }
569
+ const Ho = {
570
+ backgroundAttachment: !0,
571
+ backgroundBlendMode: !0,
572
+ backgroundClip: !0,
573
+ backgroundOrigin: !0,
574
+ backgroundRepeat: !0,
575
+ borderBottomStyle: !0,
576
+ borderLeftStyle: !0,
577
+ borderRightStyle: !0,
578
+ borderTopStyle: !0,
579
+ contain: !0,
580
+ containerType: !0,
581
+ content: !0,
582
+ float: !0,
583
+ maskBorderMode: !0,
584
+ maskBorderRepeat: !0,
585
+ maskClip: !0,
586
+ maskComposite: !0,
587
+ maskMode: !0,
588
+ maskOrigin: !0,
589
+ maskRepeat: !0,
590
+ maskType: !0,
591
+ objectFit: !0,
592
+ overflowBlock: !0,
593
+ overflowInline: !0,
594
+ overflowX: !0,
595
+ overflowY: !0,
596
+ // NOTE: pointerEvents is NOT web-only - it's a core React Native View prop (not a style)
597
+ pointerEvents: !0,
598
+ scrollbarWidth: !0,
599
+ textWrap: !0,
600
+ touchAction: !0,
601
+ transformStyle: !0,
602
+ willChange: !0
603
+ }, Xo = {
604
+ whiteSpace: !0,
605
+ wordWrap: !0,
606
+ textOverflow: !0,
607
+ WebkitBoxOrient: !0
608
+ }, Vs = {
609
+ ...Ho,
610
+ transition: !0,
611
+ backdropFilter: !0,
612
+ WebkitBackdropFilter: !0,
613
+ background: !0,
614
+ borderTop: !0,
615
+ borderRight: !0,
616
+ borderBottom: !0,
617
+ borderLeft: !0,
618
+ backgroundPosition: !0,
619
+ backgroundSize: !0,
620
+ borderImage: !0,
621
+ caretColor: !0,
622
+ clipPath: !0,
623
+ mask: !0,
624
+ maskBorder: !0,
625
+ maskBorderOutset: !0,
626
+ maskBorderSlice: !0,
627
+ maskBorderSource: !0,
628
+ maskBorderWidth: !0,
629
+ maskImage: !0,
630
+ maskPosition: !0,
631
+ maskSize: !0,
632
+ objectPosition: !0,
633
+ textEmphasis: !0,
634
+ userSelect: !0
635
+ }, Ms = {
636
+ ...Xo,
637
+ textDecorationDistance: !0,
638
+ // cursor: now cross-platform - in stylePropsView
639
+ WebkitLineClamp: !0
640
+ }, Ds = {
641
+ // border longhands
642
+ borderWidth: !0,
643
+ borderStyle: !0,
644
+ borderColor: !0,
645
+ borderTopWidth: !0,
646
+ borderTopStyle: !0,
647
+ borderTopColor: !0,
648
+ borderRightWidth: !0,
649
+ borderRightStyle: !0,
650
+ borderRightColor: !0,
651
+ borderBottomWidth: !0,
652
+ borderBottomStyle: !0,
653
+ borderBottomColor: !0,
654
+ borderLeftWidth: !0,
655
+ borderLeftStyle: !0,
656
+ borderLeftColor: !0,
657
+ // outline longhands
658
+ outlineWidth: !0,
659
+ outlineStyle: !0,
660
+ outlineColor: !0,
661
+ outlineOffset: !0
662
+ }, Ps = {
663
+ color: !0,
664
+ textDecorationColor: !0,
665
+ textShadowColor: !0
666
+ }, at = {
667
+ radius: {
668
+ borderRadius: !0,
669
+ borderTopLeftRadius: !0,
670
+ borderTopRightRadius: !0,
671
+ borderBottomLeftRadius: !0,
672
+ borderBottomRightRadius: !0,
673
+ // logical
674
+ borderStartStartRadius: !0,
675
+ borderStartEndRadius: !0,
676
+ borderEndStartRadius: !0,
677
+ borderEndEndRadius: !0
678
+ },
679
+ size: {
680
+ width: !0,
681
+ height: !0,
682
+ minWidth: !0,
683
+ minHeight: !0,
684
+ maxWidth: !0,
685
+ maxHeight: !0,
686
+ blockSize: !0,
687
+ minBlockSize: !0,
688
+ maxBlockSize: !0,
689
+ inlineSize: !0,
690
+ minInlineSize: !0,
691
+ maxInlineSize: !0
692
+ },
693
+ zIndex: {
694
+ zIndex: !0
695
+ },
696
+ color: {
697
+ backgroundColor: !0,
698
+ borderColor: !0,
699
+ borderBlockStartColor: !0,
700
+ borderBlockEndColor: !0,
701
+ borderBlockColor: !0,
702
+ borderBottomColor: !0,
703
+ borderInlineColor: !0,
704
+ borderInlineStartColor: !0,
705
+ borderInlineEndColor: !0,
706
+ borderTopColor: !0,
707
+ borderLeftColor: !0,
708
+ borderRightColor: !0,
709
+ borderEndColor: !0,
710
+ borderStartColor: !0,
711
+ shadowColor: !0,
712
+ ...Ps,
713
+ // outlineColor is supported on RN 0.77+ (New Architecture)
714
+ outlineColor: !0,
715
+ caretColor: !0
716
+ }
717
+ }, ks = {
718
+ alignContent: !0,
719
+ alignItems: !0,
720
+ alignSelf: !0,
721
+ backfaceVisibility: !0,
722
+ borderCurve: !0,
723
+ borderStyle: !0,
724
+ borderBlockStyle: !0,
725
+ borderBlockEndStyle: !0,
726
+ borderBlockStartStyle: !0,
727
+ borderInlineStyle: !0,
728
+ borderInlineEndStyle: !0,
729
+ borderInlineStartStyle: !0,
730
+ boxSizing: !0,
731
+ cursor: !0,
732
+ direction: !0,
733
+ display: !0,
734
+ flexDirection: !0,
735
+ flexWrap: !0,
736
+ isolation: !0,
737
+ justifyContent: !0,
738
+ mixBlendMode: !0,
739
+ outlineStyle: !0,
740
+ overflow: !0,
741
+ position: !0
742
+ }, Ls = {
743
+ fontFamily: !0,
744
+ fontStyle: !0,
745
+ fontVariant: !0,
746
+ textTransform: !0
747
+ }, Bs = {
748
+ textAlign: !0,
749
+ textDecorationLine: !0,
750
+ textDecorationStyle: !0,
751
+ userSelect: !0
752
+ }, Ws = {
753
+ WebkitLineClamp: !0,
754
+ lineClamp: !0,
755
+ gridTemplateColumns: !0,
756
+ gridTemplateAreas: !0
757
+ }, js = {
758
+ ...ks,
759
+ ...Ls,
760
+ ...Bs,
761
+ ...Ws,
762
+ ...Ho,
763
+ ...Xo
764
+ }, Yo = {
765
+ ...Ws,
766
+ animationIterationCount: !0,
767
+ aspectRatio: !0,
768
+ borderImageOutset: !0,
769
+ borderImageSlice: !0,
770
+ borderImageWidth: !0,
771
+ columnCount: !0,
772
+ flex: !0,
773
+ flexGrow: !0,
774
+ flexOrder: !0,
775
+ flexPositive: !0,
776
+ flexShrink: !0,
777
+ flexNegative: !0,
778
+ fontWeight: !0,
779
+ gridRow: !0,
780
+ gridRowEnd: !0,
781
+ gridRowGap: !0,
782
+ gridRowStart: !0,
783
+ gridColumn: !0,
784
+ gridColumnEnd: !0,
785
+ gridColumnGap: !0,
786
+ gridColumnStart: !0,
787
+ opacity: !0,
788
+ order: !0,
789
+ orphans: !0,
790
+ tabSize: !0,
791
+ widows: !0,
792
+ zIndex: !0,
793
+ zoom: !0,
794
+ scale: !0,
795
+ scaleX: !0,
796
+ scaleY: !0,
797
+ scaleZ: !0,
798
+ shadowOpacity: !0
799
+ }, Yt = {
800
+ x: !0,
801
+ y: !0,
802
+ scale: !0,
803
+ perspective: !0,
804
+ scaleX: !0,
805
+ scaleY: !0,
806
+ skewX: !0,
807
+ skewY: !0,
808
+ matrix: !0,
809
+ rotate: !0,
810
+ rotateY: !0,
811
+ rotateX: !0,
812
+ rotateZ: !0
813
+ }, Zo = {
814
+ ...ks,
815
+ borderBottomEndRadius: !0,
816
+ borderBottomStartRadius: !0,
817
+ borderBottomWidth: !0,
818
+ borderLeftWidth: !0,
819
+ borderRightWidth: !0,
820
+ borderBlockWidth: !0,
821
+ borderBlockEndWidth: !0,
822
+ borderBlockStartWidth: !0,
823
+ borderInlineWidth: !0,
824
+ borderInlineEndWidth: !0,
825
+ borderInlineStartWidth: !0,
826
+ borderTopEndRadius: !0,
827
+ borderTopStartRadius: !0,
828
+ borderTopWidth: !0,
829
+ borderWidth: !0,
830
+ transform: !0,
831
+ transformOrigin: !0,
832
+ borderEndWidth: !0,
833
+ borderStartWidth: !0,
834
+ bottom: !0,
835
+ end: !0,
836
+ flexBasis: !0,
837
+ gap: !0,
838
+ columnGap: !0,
839
+ rowGap: !0,
840
+ left: !0,
841
+ margin: !0,
842
+ marginBlock: !0,
843
+ marginBlockEnd: !0,
844
+ marginBlockStart: !0,
845
+ marginInline: !0,
846
+ marginInlineStart: !0,
847
+ marginInlineEnd: !0,
848
+ marginBottom: !0,
849
+ marginEnd: !0,
850
+ marginHorizontal: !0,
851
+ marginLeft: !0,
852
+ marginRight: !0,
853
+ marginStart: !0,
854
+ marginTop: !0,
855
+ marginVertical: !0,
856
+ padding: !0,
857
+ paddingBottom: !0,
858
+ paddingInline: !0,
859
+ paddingBlock: !0,
860
+ paddingBlockStart: !0,
861
+ paddingInlineEnd: !0,
862
+ paddingInlineStart: !0,
863
+ paddingEnd: !0,
864
+ paddingHorizontal: !0,
865
+ paddingLeft: !0,
866
+ paddingRight: !0,
867
+ paddingStart: !0,
868
+ paddingTop: !0,
869
+ paddingVertical: !0,
870
+ right: !0,
871
+ start: !0,
872
+ top: !0,
873
+ inset: !0,
874
+ insetBlock: !0,
875
+ insetBlockEnd: !0,
876
+ insetBlockStart: !0,
877
+ insetInline: !0,
878
+ insetInlineEnd: !0,
879
+ insetInlineStart: !0,
880
+ shadowOffset: !0,
881
+ shadowRadius: !0,
882
+ ...at.color,
883
+ ...at.radius,
884
+ ...at.size,
885
+ ...Yt,
886
+ ...Yo,
887
+ boxShadow: !0,
888
+ border: !0,
889
+ filter: !0,
890
+ // RN 0.76+ supports linear-gradient via backgroundImage
891
+ backgroundImage: !0,
892
+ // the actual RN 0.76+ prop name (backgroundImage expands to this on native)
893
+ experimental_backgroundImage: !0,
894
+ // RN 0.76/0.77+ style props (New Architecture)
895
+ outline: !0,
896
+ outlineColor: !0,
897
+ outlineOffset: !0,
898
+ outlineWidth: !0,
899
+ // web-only for convenience - tree-shaken on native
900
+ ...Vs
901
+ }, ua = {
902
+ ...Ls,
903
+ fontSize: !0,
904
+ fontWeight: !0,
905
+ letterSpacing: !0,
906
+ lineHeight: !0
907
+ }, qo = {
908
+ ...ua,
909
+ ...Bs,
910
+ ...Ps,
911
+ textShadow: !0,
912
+ textShadowOffset: !0,
913
+ textShadowRadius: !0,
914
+ verticalAlign: !0,
915
+ // web-only text props - tree-shaken on native
916
+ ...Ms
917
+ }, Jo = {
918
+ ...Zo,
919
+ ...qo
920
+ }, zs = Jo, vn = {
921
+ enterStyle: !0,
922
+ exitStyle: !0,
923
+ hoverStyle: !0,
924
+ pressStyle: !0,
925
+ focusStyle: !0,
926
+ disabledStyle: !0,
927
+ focusWithinStyle: !0,
928
+ focusVisibleStyle: !0
929
+ }, Fn = Zo, da = /* @__PURE__ */ Symbol(), fa = (e, t) => (Object.assign(e, t), e[da] = !0, e), ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
930
+ __proto__: null,
931
+ StyleObjectIdentifier: it,
932
+ StyleObjectProperty: Dt,
933
+ StyleObjectPseudo: Is,
934
+ StyleObjectRules: In,
935
+ StyleObjectValue: aa,
936
+ clamp: ia,
937
+ composeEventHandlers: Ko,
938
+ cssShorthandLonghands: Ds,
939
+ nonAnimatableStyleProps: js,
940
+ nonAnimatableWebTextProps: Xo,
941
+ nonAnimatableWebViewProps: Ho,
942
+ shouldRenderNativePlatform: la,
943
+ simpleHash: wt,
944
+ stylePropsAll: zs,
945
+ stylePropsText: Jo,
946
+ stylePropsTextOnly: qo,
947
+ stylePropsTransform: Yt,
948
+ stylePropsUnitless: Yo,
949
+ stylePropsView: Zo,
950
+ tokenCategories: at,
951
+ validPseudoKeys: vn,
952
+ validStyles: Fn,
953
+ webOnlyStylePropsText: Ms,
954
+ webOnlyStylePropsView: Vs,
955
+ withStaticProperties: fa
956
+ }, Symbol.toStringTag, { value: "Module" }));
957
+ function Us(e) {
958
+ return `var(--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${e})`;
959
+ }
960
+ const Gt = (e, t = !1) => {
961
+ if (!t && Te(e)) return e;
962
+ const {
963
+ key: n,
964
+ name: o,
965
+ val: r
966
+ } = e;
967
+ return {
968
+ isVar: !0,
969
+ key: n,
970
+ name: t ? o : wt(o, 40),
971
+ val: r,
972
+ variable: t ? Us(o) : Ks(o)
973
+ };
974
+ };
975
+ function Nt(e, t = !1) {
976
+ return Te(e) ? !t && Et && e.variable ? e.variable : `${e.val}` : `${e || ""}`;
977
+ }
978
+ function Te(e) {
979
+ return e && typeof e == "object" && "isVar" in e;
980
+ }
981
+ function ha(e, t = "size") {
982
+ var o;
983
+ if (e != null && e.dynamic) return e;
984
+ if (Qo(!0), Te(e)) return Nt(e);
985
+ const n = De().tokensParsed;
986
+ return Nt(((o = n[t]) == null ? void 0 : o[e]) ?? e);
987
+ }
988
+ let Gs = !1;
989
+ const Qo = (e) => Gs = e, pa = () => Gs;
990
+ function En(e, t) {
991
+ return Te(e) ? (Qo(!0), e.val) : e;
992
+ }
993
+ function ga(e) {
994
+ return Te(e) ? e.variable : e;
995
+ }
996
+ const Ks = (e, t = !0) => {
997
+ if (process.env.NODE_ENV === "development" && (!e || typeof e != "string")) throw new Error(`createCSSVariable expected string, got: ${e}`);
998
+ const n = wt(e, 60);
999
+ return t ? Us(n) : n;
1000
+ }, Yn = /* @__PURE__ */ new Map();
1001
+ let Ot, Rt, Cr, It;
1002
+ const ba = {};
1003
+ function ya(e, t, n, o) {
1004
+ if (!(t != null && t.theme)) return ba;
1005
+ if (Ot = n, Rt = o, Cr = e, It = t, Yn.has(It.theme)) return Yn.get(It.theme);
1006
+ De();
1007
+ function r(i, a = !1) {
1008
+ Ot && (Ot.current || (Ot.current = /* @__PURE__ */ new Set()), Ot.current.add(i), a && Rt && (Rt.current || (Rt.current = /* @__PURE__ */ new Set()), Rt.current.add(i)), process.env.NODE_ENV === "development" && Cr.debug && console.info(` 🎨 useTheme() tracking key: ${i} schemeOptimized=${a}`));
1009
+ }
1010
+ const s = Object.fromEntries(Object.entries(t.theme).flatMap(([i, a]) => {
1011
+ const l = {
1012
+ ...a,
1013
+ get val() {
1014
+ return globalThis.tamaguiAvoidTracking || r(i, !1), a.val;
1015
+ },
1016
+ get(d) {
1017
+ if (!It) return;
1018
+ const u = ha(a), {
1019
+ name: c,
1020
+ scheme: m
1021
+ } = It;
1022
+ return u;
1023
+ }
1024
+ };
1025
+ return [[i, l], [`$${i}`, l]];
1026
+ }));
1027
+ return Yn.set(t.theme, s), s;
1028
+ }
1029
+ const Hs = Xt(""), Eo = /* @__PURE__ */ new Map(), Pt = {}, Zn = /* @__PURE__ */ new WeakMap(), qn = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map(), Jn = /* @__PURE__ */ new Map(), Xs = (e) => rt.get(e);
1030
+ let Ar = 0;
1031
+ const ht = /* @__PURE__ */ new Map();
1032
+ let Or = -1, Qn = null;
1033
+ const Sa = (e, t = !1, n, o) => {
1034
+ "use no memo";
1035
+ const {
1036
+ disable: r
1037
+ } = e, s = An(Hs);
1038
+ if (!s && !t) throw new Error(process.env.NODE_ENV === "development" ? `${zt}
1039
+
1040
+ Looked for theme${e.name ? ` "${e.name}"` : ""}${e.componentName ? ` (component: ${e.componentName})` : ""}, but no parent theme context was found (parentId: ${s}).` : zt);
1041
+ if (r) return rt.get(s) || {
1042
+ id: "",
1043
+ name: "light",
1044
+ theme: De().themes.light
1045
+ // inverses: 0,
1046
+ };
1047
+ const i = ms(), a = ds((c) => (Pt[s] = Pt[s] || /* @__PURE__ */ new Set(), Pt[s].add(i), Eo.set(i, () => {
1048
+ Ft.set(i, !0), c();
1049
+ }), () => {
1050
+ Eo.delete(i), Pt[s].delete(i), Jn.delete(i), rt.delete(i), Ft.delete(i);
1051
+ }), [i, s]), l = Na(e), d = () => {
1052
+ var y, $, M, K;
1053
+ let c = Jn.get(i);
1054
+ const m = rt.get(s);
1055
+ if (c && !Ft.has(i) && m && c._parentName === m.name && c._propsKey === l) return c;
1056
+ const f = !1, p = ((y = n == null ? void 0 : n.current) == null ? void 0 : y.size) ?? 0, g = ((($ = o == null ? void 0 : o.current) == null ? void 0 : $.size) ?? 0) === p && p > 0, b = f, h = e.passThrough ? !1 : t || e.name === "light" || e.name === "dark" || e.name === null ? !0 : Zn.get(n) ? (M = n == null ? void 0 : n.current) != null && M.size ? !0 : (K = e.needsUpdate) == null ? void 0 : K.call(e) : !0, [S, N] = va(c, e, l, t, i, s, h, Ft.get(i));
1057
+ return Ft.delete(i), (!c || S) && (c = {
1058
+ ...N
1059
+ }, Jn.set(i, c)), process.env.NODE_ENV === "development" && e.debug === "verbose" && (console.groupCollapsed(` ${i} getSnapshot ${S}`, c.name, ">", N.name), console.info({
1060
+ props: e,
1061
+ propsKey: l,
1062
+ isRoot: t,
1063
+ parentId: s,
1064
+ local: c,
1065
+ next: N,
1066
+ needsUpdate: h,
1067
+ isSchemeOnlyChange: f,
1068
+ allKeysSchemeOptimized: g,
1069
+ canSkipForSchemeChange: b
1070
+ }), console.groupEnd()), N !== c && (Object.assign(c, N), c.id = i), c._parentName = m == null ? void 0 : m.name, c._propsKey = l, rt.set(i, N), c;
1071
+ };
1072
+ process.env.NODE_ENV === "development" && globalThis.time && globalThis.time`theme-prep-uses`;
1073
+ const u = fs(a, d, d);
1074
+ return Ae(() => {
1075
+ var c;
1076
+ if (!Zn.get(n)) {
1077
+ Zn.set(n, !0);
1078
+ return;
1079
+ }
1080
+ if (!l) {
1081
+ qn.get(n) && Rr(i), qn.set(n, !1);
1082
+ return;
1083
+ }
1084
+ process.env.NODE_ENV === "development" && e.debug === "verbose" && console.warn(` · useTheme(${i}) scheduleUpdate`, l, (c = rt.get(i)) == null ? void 0 : c.name), Rr(i), qn.set(n, !0);
1085
+ }, [n, l]), u;
1086
+ }, va = (e, t, n, o = !1, r, s, i, a) => {
1087
+ const {
1088
+ debug: l
1089
+ } = t, d = rt.get(s);
1090
+ if (t.passThrough) return [!1, e || d || {
1091
+ name: ""
1092
+ }];
1093
+ Qn || (Qn = De().themes);
1094
+ const u = !n && (!e || !(e != null && e.isNew)) ? null : Ea(d == null ? void 0 : d.name, t, a === "force" ? !0 : !!i), c = d && (!u || u === d.name), m = !!(a === "force" || i && (a || (e == null ? void 0 : e.name) !== (d == null ? void 0 : d.name)));
1095
+ if (process.env.NODE_ENV === "development" && l === "verbose") {
1096
+ const h = ` · useTheme(${r}) getNextState => ${u} needsUpdate ${i} shouldRerender ${m}`;
1097
+ console.groupCollapsed(h), console.trace({
1098
+ name: u,
1099
+ lastState: e,
1100
+ parentState: d,
1101
+ props: t,
1102
+ propsKey: n,
1103
+ id: r,
1104
+ isSameAsParent: c
1105
+ }), console.groupEnd();
1106
+ }
1107
+ if (c) return !m && e ? [!1, e] : [m, {
1108
+ ...d,
1109
+ isNew: !1
1110
+ }];
1111
+ if (!u) {
1112
+ const h = e ?? d;
1113
+ if (!h) throw new Error(process.env.NODE_ENV === "development" ? `${zt}
1114
+
1115
+ Looked for theme${t.name ? ` "${t.name}"` : ""}${t.componentName ? ` (component: ${t.componentName})` : ""}, but no theme state was resolved (parentId: ${s}, id: ${r}).` : zt);
1116
+ return m ? [!0, {
1117
+ ...d || e
1118
+ }] : [!1, h];
1119
+ }
1120
+ const f = No(u), p = d && f !== d.scheme, g = {
1121
+ id: r,
1122
+ name: u,
1123
+ theme: Qn[u],
1124
+ scheme: f,
1125
+ parentId: s,
1126
+ parentName: d == null ? void 0 : d.name,
1127
+ // inverses,
1128
+ isInverse: p,
1129
+ isNew: !0
1130
+ };
1131
+ if (a !== "force" && e && e.name === u) return [!1, g];
1132
+ const b = a !== "force" && e && !i && g.name === e.name;
1133
+ return process.env.NODE_ENV === "development" && l === "verbose" && (console.groupCollapsed(` · useTheme(${r}) ⏭️ ${u} shouldAvoidRerender: ${b}`), console.info({
1134
+ lastState: e,
1135
+ needsUpdate: i,
1136
+ nextState: g,
1137
+ pendingUpdate: a
1138
+ }), console.groupEnd()), b ? [!1, g] : [!0, g];
1139
+ };
1140
+ function Rr(e) {
1141
+ const t = [e], n = /* @__PURE__ */ new Set();
1142
+ for (; t.length; ) {
1143
+ const o = t.shift(), r = Pt[o];
1144
+ if (r) for (const s of r) n.has(s) || (n.add(s), t.push(s));
1145
+ }
1146
+ n.forEach((o) => {
1147
+ var r;
1148
+ (r = Eo.get(o)) == null || r();
1149
+ });
1150
+ }
1151
+ const Ys = {
1152
+ light: "light",
1153
+ dark: "dark"
1154
+ };
1155
+ function No(e) {
1156
+ return Ys[e.split("_")[0]];
1157
+ }
1158
+ function Ea(e = "", t, n = !1) {
1159
+ const {
1160
+ name: o,
1161
+ reset: r
1162
+ } = t, s = t.unstyled ? void 0 : t.componentName;
1163
+ if (o && r) throw new Error(process.env.NODE_ENV === "production" ? "❌004" : "Cannot reset and set a new name at the same time.");
1164
+ const i = `${e}|${o || ""}|${s || ""}|${r ? 1 : 0}|${n ? 1 : 0}`;
1165
+ if (Or !== Ar) ht.clear(), Or = Ar;
1166
+ else {
1167
+ const m = ht.get(i);
1168
+ if (m !== void 0) return m;
1169
+ }
1170
+ const {
1171
+ themes: a
1172
+ } = De();
1173
+ if (r) {
1174
+ if (e === "light" || e === "dark") {
1175
+ const b = e === "light" ? "dark" : "light";
1176
+ return ht.set(i, b), b;
1177
+ }
1178
+ const m = e.lastIndexOf("_"), f = m <= 0 ? e : e.slice(m), p = e.slice(0, m), g = a[f] ? f : p;
1179
+ return ht.set(i, g), g;
1180
+ }
1181
+ const l = e.split("_"), d = l[l.length - 1];
1182
+ d && d[0].toLowerCase() !== d[0] && l.pop();
1183
+ const u = [o && s ? `${o}_${s}` : void 0, o, s].filter(Boolean);
1184
+ let c = null;
1185
+ if (o) {
1186
+ const m = No(o);
1187
+ if (m) {
1188
+ for (const f of u) if (f in a) {
1189
+ c = f;
1190
+ break;
1191
+ }
1192
+ }
1193
+ if (!c && !m && No(e)) {
1194
+ const f = [];
1195
+ for (let p = l.length; p >= 1; p--) f.push(l.slice(0, p).join("_"));
1196
+ e: for (const p of f) {
1197
+ const g = [s ? `${p}_${o}_${s}` : void 0, `${p}_${o}`].filter(Boolean);
1198
+ for (const b of g) if (b in a) {
1199
+ c = b;
1200
+ break e;
1201
+ }
1202
+ }
1203
+ }
1204
+ }
1205
+ if (!c) if (!o && s) {
1206
+ const m = `${l.join("_")}_${s}`;
1207
+ m in a && (c = m);
1208
+ } else {
1209
+ const m = l.length;
1210
+ for (let f = 0; f <= m; f++) {
1211
+ const p = (f === 0 ? l : l.slice(0, -f)).join("_");
1212
+ for (const g of u) {
1213
+ const b = p ? `${p}_${g}` : g;
1214
+ if (b in a) {
1215
+ c = b;
1216
+ break;
1217
+ }
1218
+ }
1219
+ if (c) break;
1220
+ }
1221
+ }
1222
+ return !n && c === e && // if its a scheme only sub-theme, we always consider it "new" because it likely inverses
1223
+ // and we want to avoid reparenting
1224
+ !Ys[c] ? (ht.set(i, null), null) : (ht.set(i, c), c);
1225
+ }
1226
+ const Na = ({
1227
+ name: e,
1228
+ reset: t,
1229
+ forceClassName: n,
1230
+ componentName: o
1231
+ }) => `${e || ""}${t || ""}${n || ""}${o || ""}`, Ta = (e) => "name" in e || "reset" in e || "forceClassName" in e, Zs = (e, t = !1) => {
1232
+ "use no memo";
1233
+ const n = jt(null), o = jt(null), r = Sa(e, t, n, o);
1234
+ return process.env.NODE_ENV === "development" && !e.passThrough && !(r != null && r.theme) && process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(e)}).
1235
+
1236
+ If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`), [e.passThrough ? {} : ya(e, r, n, o), r];
1237
+ };
1238
+ function xa(e, t) {
1239
+ typeof e == "function" ? e(t) : e && (e.current = t);
1240
+ }
1241
+ function er(...e) {
1242
+ return (t) => e.forEach((n) => xa(n, t));
1243
+ }
1244
+ const To = (() => {
1245
+ if (process.env.NODE_ENV === "development") try {
1246
+ return new Function("try {return this===window;}catch(e){ return false;}")();
1247
+ } catch {
1248
+ }
1249
+ return !1;
1250
+ })(), tr = {
1251
+ hover: !1,
1252
+ press: !1,
1253
+ pressIn: !1,
1254
+ focus: !1,
1255
+ focusVisible: !1,
1256
+ focusWithin: !1,
1257
+ unmounted: !0,
1258
+ disabled: !1
1259
+ }, xo = {
1260
+ ...tr,
1261
+ unmounted: !1
1262
+ }, wa = {
1263
+ ...tr,
1264
+ unmounted: "should-enter"
1265
+ };
1266
+ function eo(e, t = !0) {
1267
+ return {
1268
+ onMouseEnter: e.onMouseEnter,
1269
+ onMouseLeave: e.onMouseLeave,
1270
+ [t ? "onClick" : "onPress"]: e.onPress,
1271
+ onMouseDown: e.onPressIn,
1272
+ onMouseUp: e.onPressOut,
1273
+ onTouchStart: e.onPressIn,
1274
+ onTouchEnd: e.onPressOut,
1275
+ onFocus: e.onFocus,
1276
+ onBlur: e.onBlur
1277
+ };
1278
+ }
1279
+ const nr = (e, t) => {
1280
+ var i;
1281
+ let n = e == null ? void 0 : e.defaultProps;
1282
+ const o = De(), r = t || (e == null ? void 0 : e.componentName) || // important: this is how we end up getting the defaultProps we set in createTamagui
1283
+ (e.isText ? "Text" : "View"), s = (i = o == null ? void 0 : o.defaultProps) == null ? void 0 : i[r];
1284
+ return s && (n = n ? {
1285
+ ...s,
1286
+ ...n
1287
+ } : s), n;
1288
+ };
1289
+ function Nn(e) {
1290
+ var t;
1291
+ return e ? typeof e.useAnimations == "function" ? e : "default" in e && typeof ((t = e.default) == null ? void 0 : t.useAnimations) == "function" ? e.default : null : null;
1292
+ }
1293
+ const wo = {
1294
+ height: 0,
1295
+ width: 0
1296
+ };
1297
+ function _a({
1298
+ shadowColor: e,
1299
+ shadowOffset: t,
1300
+ shadowOpacity: n,
1301
+ shadowRadius: o
1302
+ }) {
1303
+ const {
1304
+ height: r,
1305
+ width: s
1306
+ } = t || wo;
1307
+ return {
1308
+ shadowOffset: {
1309
+ width: s || 0,
1310
+ height: r || 0
1311
+ },
1312
+ shadowRadius: o || 0,
1313
+ // pass color through as-is, opacity applied via color-mix in getCSSStylesAtomic
1314
+ shadowColor: e,
1315
+ // default to 1 if not specified (color-mix will handle the opacity)
1316
+ shadowOpacity: n ?? 1
1317
+ };
1318
+ }
1319
+ function Vn(e) {
1320
+ var t;
1321
+ (e.shadowRadius != null || e.shadowColor || e.shadowOpacity != null || e.shadowOffset) && Object.assign(e, _a(e));
1322
+ for (const n in Ir) n in e && (e[t = Ir[n]] || (e[t] = "solid"));
1323
+ }
1324
+ const Ir = {
1325
+ borderWidth: "borderStyle",
1326
+ borderBottomWidth: "borderBottomStyle",
1327
+ borderTopWidth: "borderTopStyle",
1328
+ borderLeftWidth: "borderLeftStyle",
1329
+ borderRightWidth: "borderRightStyle"
1330
+ // TODO: need to add borderBlock and borderInline here, but they are alot and might impact performance
1331
+ }, $a = (e, t) => {
1332
+ if (e) return typeof e != "string" ? e : e === "transparent" ? "rgba(0, 0, 0, 0)" : typeof t == "number" && t < 1 ? `color-mix(in srgb, ${e} ${Math.round(t * 100)}%, transparent)` : e;
1333
+ }, Ca = {
1334
+ ...zs,
1335
+ translateX: !0,
1336
+ translateY: !0
1337
+ };
1338
+ function xe(e, t = "") {
1339
+ if (Yo[t] || t && !Ca[t] || typeof e == "boolean") return e;
1340
+ if (e && typeof e == "object") if (typeof e.__getValue == "function") e = e.__getValue();
1341
+ else return e;
1342
+ let n = e;
1343
+ return typeof e == "number" ? n = `${e}px` : t && (n = `${n}`), n;
1344
+ }
1345
+ function or(e) {
1346
+ return e.map(
1347
+ // { scale: 2 } => 'scale(2)'
1348
+ // { translateX: 20 } => 'translateX(20px)'
1349
+ // { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'
1350
+ // { perspective: 1000 } => perspective(1000px)
1351
+ (t) => {
1352
+ const n = Object.keys(t)[0], o = t[n];
1353
+ return n === "matrix" || n === "matrix3d" ? `${n}(${o.join(",")})` : `${n}(${xe(o, n)})`;
1354
+ }
1355
+ ).join(" ");
1356
+ }
1357
+ function to(e) {
1358
+ rr(e);
1359
+ const t = [];
1360
+ for (const n in e) {
1361
+ if (n === "$$css") continue;
1362
+ const o = e[n];
1363
+ if (n in Oe) o && t.push(...qs(o, Oe[n]));
1364
+ else if (Hi(n)) for (const r in o) {
1365
+ const s = _o(o, r);
1366
+ s && (s[0] = n, t.push(s));
1367
+ }
1368
+ else {
1369
+ const r = _o(e, n);
1370
+ r && t.push(r);
1371
+ }
1372
+ }
1373
+ return t;
1374
+ }
1375
+ const qs = (e, t) => {
1376
+ rr(e);
1377
+ const n = [];
1378
+ for (const o in e) {
1379
+ const r = _o(e, o, t);
1380
+ r && n.push(r);
1381
+ }
1382
+ return n;
1383
+ };
1384
+ let sn = null;
1385
+ const _o = (e, t, n) => {
1386
+ let o = e[t];
1387
+ if (o == null) return;
1388
+ t === "transform" && Array.isArray(e.transform) && (o = or(o));
1389
+ const r = xe(o, t), s = wt(typeof r == "string" ? r : `${r}`), i = n ? `0${n.name}-` : "";
1390
+ sn || (sn = xs());
1391
+ let a = `_${(sn == null ? void 0 : sn.inverseShorthands[t]) || t}-${i}${s}`;
1392
+ t === "pointerEvents" && !n && (r === "box-none" ? a = "_pe-boxnone" : r === "box-only" && (a = "_pe-boxonly"));
1393
+ const l = Ia(a, t, r, n);
1394
+ return [
1395
+ // array for performance
1396
+ t,
1397
+ r,
1398
+ a,
1399
+ n == null ? void 0 : n.name,
1400
+ l
1401
+ ];
1402
+ };
1403
+ function rr(e) {
1404
+ const {
1405
+ shadowOffset: t,
1406
+ shadowRadius: n,
1407
+ shadowColor: o,
1408
+ shadowOpacity: r
1409
+ } = e;
1410
+ if (n != null || o || t != null || r != null) {
1411
+ const l = t || wo, d = xe(l.width), u = xe(l.height), c = xe(n), m = $a(o, r);
1412
+ if (m) {
1413
+ const f = `${d} ${u} ${c} ${m}`;
1414
+ e.boxShadow = e.boxShadow ? `${e.boxShadow}, ${f}` : f;
1415
+ }
1416
+ delete e.shadowOffset, delete e.shadowRadius, delete e.shadowColor, delete e.shadowOpacity;
1417
+ }
1418
+ const {
1419
+ textShadowColor: s,
1420
+ textShadowOffset: i,
1421
+ textShadowRadius: a
1422
+ } = e;
1423
+ if (s || i || a) {
1424
+ const {
1425
+ height: l,
1426
+ width: d
1427
+ } = i || wo, u = a || 0, c = xe(s, "textShadowColor");
1428
+ if (c && (l !== 0 || d !== 0 || u !== 0)) {
1429
+ const m = xe(u), f = xe(d), p = xe(l);
1430
+ e.textShadow = `${f} ${p} ${m} ${c}`;
1431
+ }
1432
+ delete e.textShadowColor, delete e.textShadowOffset, delete e.textShadowRadius;
1433
+ }
1434
+ }
1435
+ function an(e, t = !1) {
1436
+ let n = "";
1437
+ for (const [o, r] of e) n += `${Oa(o)}:${r}${t ? " !important" : ""};`;
1438
+ return `{${n}}`;
1439
+ }
1440
+ const no = {}, Aa = (e) => `-${e.toLowerCase()}`, Oa = (e) => {
1441
+ if (e in no) return no[e];
1442
+ const t = e.replace(/[A-Z]/g, Aa);
1443
+ return no[e] = t, t;
1444
+ }, Ra = (() => {
1445
+ const e = {};
1446
+ for (const t in Oe) {
1447
+ const n = Oe[t];
1448
+ e[n.name] = `${[...Array(n.priority)].map(() => ":root").join("")} `;
1449
+ }
1450
+ return e;
1451
+ })();
1452
+ function Ia(e, t, n, o) {
1453
+ const r = o ? o.name === "disabled" ? "[aria-disabled]" : `:${o.name}` : "", s = o == null ? void 0 : o.selector, i = t in Ds ? `.${e}.${e}` : `.${e}`;
1454
+ let a = o ? s ? `${s} ${i}` : `${Ra[o.name]} ${i}${r}` : `:root ${i}`;
1455
+ s === Oe.enterStyle.selector && (a = `${a}, .${e}${s}`);
1456
+ const l = !!o;
1457
+ let d = [];
1458
+ switch (t) {
1459
+ // Equivalent to using '::placeholder'
1460
+ case "placeholderTextColor": {
1461
+ const u = an([["color", n], ["opacity", 1]], l);
1462
+ d.push(`${a}::placeholder${u}`);
1463
+ break;
1464
+ }
1465
+ // all webkit prefixed rules
1466
+ case "backgroundClip":
1467
+ case "userSelect": {
1468
+ const u = `Webkit${`${t[0].toUpperCase()}${t.slice(1)}`}`, c = an([[t, n], [u, n]], l);
1469
+ d.push(`${a}${c}`);
1470
+ break;
1471
+ }
1472
+ // Polyfill for additional 'pointer-events' values
1473
+ case "pointerEvents": {
1474
+ let u = n;
1475
+ n === "auto" || n === "box-only" ? u = "auto" : (n === "none" || n === "box-none") && (u = "none");
1476
+ const c = an([["pointerEvents", u]], !0);
1477
+ d.push(`${a}${c}`);
1478
+ break;
1479
+ }
1480
+ default: {
1481
+ const u = an([[t, n]], l);
1482
+ d.push(`${a}${u}`);
1483
+ break;
1484
+ }
1485
+ }
1486
+ return (o == null ? void 0 : o.name) === "hover" && (d = d.map((u) => `@media (hover) {${u}}`)), d;
1487
+ }
1488
+ const Fr = /* @__PURE__ */ new WeakMap(), $o = /* @__PURE__ */ new Map(), Js = {}, Co = {}, Fa = () => Js, Ao = () => process.env.TAMAGUI_DID_OUTPUT_CSS ? [] : Object.keys(Co).sort().map((e) => Co[e]);
1489
+ let Vr = null;
1490
+ function Va(e = !1, t) {
1491
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
1492
+ if (process.env.NODE_ENV === "test") return;
1493
+ let n;
1494
+ const o = document.styleSheets || [], r = Vr, s = new Set(o);
1495
+ for (const i of s) if (i) {
1496
+ const a = Dr(i, !1, e, t);
1497
+ a && (n = a);
1498
+ }
1499
+ if (Vr = s, r) for (const i of r) i && !s.has(i) && Dr(i, !0);
1500
+ return n;
1501
+ }
1502
+ }
1503
+ function Ma(e) {
1504
+ const t = ($o.get(e) || 0) + 1;
1505
+ return $o.set(e, t), t;
1506
+ }
1507
+ const Mr = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES, Da = Mr ? +Mr : 8e3;
1508
+ function Dr(e, t = !1, n = !1, o) {
1509
+ var f, p;
1510
+ let r;
1511
+ try {
1512
+ if (r = e.cssRules, !r) return;
1513
+ } catch {
1514
+ return;
1515
+ }
1516
+ const s = (f = fn(r[0], n)) == null ? void 0 : f[0], i = (p = fn(r[r.length - 1], n)) == null ? void 0 : p[0], a = `${r.length}${s}${i}`, l = Fr.get(e);
1517
+ if (!t && l === a) return;
1518
+ const d = r.length;
1519
+ let u = 0, c;
1520
+ const m = {};
1521
+ for (let g = 0; g < d; g++) {
1522
+ const b = r[g];
1523
+ if (!(b instanceof CSSStyleRule)) continue;
1524
+ const h = fn(b, n);
1525
+ if (h) u = 0;
1526
+ else {
1527
+ if (u++, u > Da) return;
1528
+ continue;
1529
+ }
1530
+ const [S, N, y] = h;
1531
+ if (y) {
1532
+ const $ = Pa(N, o);
1533
+ if ($) {
1534
+ for (const M of $.names) m[M] ? (Object.apply(m[M], $.theme), $.names = $.names.filter((K) => K !== M)) : m[M] = $.theme;
1535
+ c || (c = []), c.push($);
1536
+ }
1537
+ continue;
1538
+ }
1539
+ }
1540
+ return Fr.set(e, a), c;
1541
+ }
1542
+ let pt, Pr = null;
1543
+ function Pa(e, t) {
1544
+ const n = e.selectorText.split(",");
1545
+ if (!n.length) return;
1546
+ if (t != null && t.color && !pt) {
1547
+ pt = {};
1548
+ for (const i in t.color) {
1549
+ const a = t.color[i];
1550
+ a && (pt[a.name] = a.val);
1551
+ }
1552
+ }
1553
+ const o = (e.cssText || "").slice(e.selectorText.length + 2, -1).split(";"), r = {};
1554
+ for (const i of o) {
1555
+ const a = i.indexOf(":");
1556
+ if (a === -1) continue;
1557
+ const l = i.indexOf("--");
1558
+ let d = i.slice(l === -1 ? 0 : l + 2, a);
1559
+ process.env.TAMAGUI_CSS_VARIABLE_PREFIX && (d = d.replace(process.env.TAMAGUI_CSS_VARIABLE_PREFIX, ""));
1560
+ const u = i.slice(a + 2);
1561
+ let c;
1562
+ if (u[0] === "v" && u.startsWith("var(")) {
1563
+ const m = u.slice(6, -1), f = pt == null ? void 0 : pt[m];
1564
+ f ? c = f : (Pr || (Pr = getComputedStyle(document.body)), c = Pr.getPropertyValue("--" + m));
1565
+ } else c = u;
1566
+ r[d] = Gt({
1567
+ key: d,
1568
+ name: d,
1569
+ val: c
1570
+ }, !0);
1571
+ }
1572
+ const s = /* @__PURE__ */ new Set();
1573
+ for (const i of n) {
1574
+ if (i === " .tm_xxt") continue;
1575
+ const a = i.lastIndexOf(".t_"), l = i.slice(a).slice(3), [d] = i[a - 5], u = d === "d" ? "dark" : d === "i" ? "light" : "", c = u && u !== l ? `${u}_${l}` : l;
1576
+ !c || c === "light_dark" || c === "dark_light" || s.add(c);
1577
+ }
1578
+ return {
1579
+ names: [...s],
1580
+ theme: r
1581
+ };
1582
+ }
1583
+ const kr = /\.tm_xxt/;
1584
+ function fn(e, t = !1) {
1585
+ if (e instanceof CSSStyleRule) {
1586
+ const n = e.selectorText;
1587
+ if (n[0] === ":" && n[1] === "r" && kr.test(n)) {
1588
+ const o = ka(
1589
+ // next.js minifies it so its in front
1590
+ n.replace(kr, "")
1591
+ );
1592
+ return t ? [o, e, !0] : [o, e];
1593
+ }
1594
+ } else if (e instanceof CSSMediaRule) return e.cssRules.length > 1 ? void 0 : fn(e.cssRules[0]);
1595
+ }
1596
+ const ka = (e) => {
1597
+ const t = e.indexOf(":");
1598
+ return t > -1 ? e.slice(7, t) : e.slice(7);
1599
+ };
1600
+ let Vt = null, Qs = !0;
1601
+ function La() {
1602
+ Qs = !1;
1603
+ }
1604
+ function ei(e, t) {
1605
+ return Qs && (Co[e] = t.join(" ")), !0;
1606
+ }
1607
+ function Ba(e) {
1608
+ if (!Vt && document.head) {
1609
+ const t = document.createElement("style");
1610
+ t.id = "_tamagui-styles", Vt = document.head.appendChild(t).sheet;
1611
+ }
1612
+ if (Vt) for (const t in e) {
1613
+ const n = e[t], o = n[it];
1614
+ if (!ti(o)) continue;
1615
+ const r = n[In];
1616
+ Js[o] = r.join(`
1617
+ `), Ma(o), ei(o, r);
1618
+ try {
1619
+ for (const s of r) Vt.insertRule(s, Vt.cssRules.length);
1620
+ } catch {
1621
+ process.env.NODE_ENV === "production" && console.error("Error inserting style rule", r);
1622
+ }
1623
+ }
1624
+ }
1625
+ const Wa = process.env.TAMAGUI_INSERT_SELECTOR_TRIES ? +process.env.TAMAGUI_INSERT_SELECTOR_TRIES : 1;
1626
+ function ti(e) {
1627
+ if (process.env.IS_STATIC === "is_static") return !0;
1628
+ const t = $o.get(e) || 0;
1629
+ return process.env.NODE_ENV === "development" && t > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 10) && console.warn('Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'), t < Wa;
1630
+ }
1631
+ function oo(e) {
1632
+ if (!e.startsWith("$platform")) return !0;
1633
+ const t = e.slice(10);
1634
+ return (
1635
+ // web, ios, android
1636
+ t === vs || // web, native
1637
+ t === "web"
1638
+ );
1639
+ }
1640
+ function ja(e, t) {
1641
+ if (e.startsWith("$theme-")) return e.slice(7).startsWith(t);
1642
+ }
1643
+ function G(...e) {
1644
+ if (process.env.NODE_ENV !== "production") {
1645
+ $r(!0);
1646
+ try {
1647
+ return console.info(...e);
1648
+ } catch (t) {
1649
+ console.error(t);
1650
+ } finally {
1651
+ $r(!1);
1652
+ }
1653
+ }
1654
+ }
1655
+ const za = [["flexGrow", 0], ["flexShrink", 1], ["flexBasis", "auto"]];
1656
+ function ni(e, t) {
1657
+ if (e === "flex") return t === -1 ? za : [["flexGrow", t], ["flexShrink", 1], ["flexBasis", we("styleCompat") === "legacy" ? "auto" : 0]];
1658
+ switch (e) {
1659
+ case "writingDirection":
1660
+ return [["direction", t]];
1661
+ // some safari-based browsers seem not to support without -webkit prefix
1662
+ case "backdropFilter":
1663
+ return [["backdropFilter", t], ["WebkitBackdropFilter", t]];
1664
+ }
1665
+ if (e in Lt) return Lt[e].map((n) => [n, t]);
1666
+ }
1667
+ const Lr = ["Top", "Right", "Bottom", "Left"], Br = ["Right", "Left"], Wr = ["Top", "Bottom"], jr = ["X", "Y"], Lt = {
1668
+ borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
1669
+ borderRadius: ["TopLeftRadius", "TopRightRadius", "BottomRightRadius", "BottomLeftRadius"],
1670
+ borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
1671
+ margin: Lr,
1672
+ marginHorizontal: Br,
1673
+ marginVertical: Wr,
1674
+ padding: Lr,
1675
+ paddingHorizontal: Br,
1676
+ paddingVertical: Wr,
1677
+ // react-native only supports borderStyle
1678
+ borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
1679
+ // react-native doesn't support X / Y
1680
+ overflow: jr,
1681
+ overscrollBehavior: jr
1682
+ };
1683
+ var cs;
1684
+ for (const e in Lt) {
1685
+ const t = e.slice(0, ((cs = /[A-Z]/.exec(e)) == null ? void 0 : cs.index) ?? e.length);
1686
+ Lt[e] = Lt[e].map((n) => `${t}${n}`);
1687
+ }
1688
+ const ro = /* @__PURE__ */ new WeakMap(), Ua = (e) => {
1689
+ if (ro.has(e)) return ro.get(e);
1690
+ const {
1691
+ props: t,
1692
+ conf: n,
1693
+ context: o,
1694
+ theme: r,
1695
+ styleProps: s
1696
+ } = e, i = s.styledContext;
1697
+ let a = n.fontsParsed;
1698
+ o != null && o.language && (a = Oo(n.fontsParsed, o.language));
1699
+ const l = {
1700
+ fonts: a,
1701
+ tokens: n.tokensParsed,
1702
+ theme: r,
1703
+ context: i,
1704
+ get fontFamily() {
1705
+ return En(e.fontFamily || e.props.fontFamily) || t.fontFamily || En(we("defaultFont"));
1706
+ },
1707
+ get font() {
1708
+ return a[this.fontFamily] || (!t.fontFamily || t.fontFamily[0] === "$" ? a[we("defaultFont") || ""] : void 0);
1709
+ },
1710
+ props: t
1711
+ };
1712
+ return ro.set(e, l), l;
1713
+ }, so = /* @__PURE__ */ new WeakMap();
1714
+ function Oo(e, t) {
1715
+ if (so.has(t)) return so.get(t);
1716
+ const n = {
1717
+ ...e,
1718
+ ...Object.fromEntries(Object.entries(t).flatMap(([o, r]) => {
1719
+ if (r === "default") return [];
1720
+ const s = `$${o}_${r}`;
1721
+ return [[`$${o}`, e[s]]];
1722
+ }))
1723
+ };
1724
+ return so.set(t, n), n;
1725
+ }
1726
+ const Ga = {
1727
+ fontSize: "size",
1728
+ fontWeight: "weight"
1729
+ };
1730
+ let zr = !1, oi = null;
1731
+ function Ka() {
1732
+ return oi;
1733
+ }
1734
+ function sr(e) {
1735
+ oi = e;
1736
+ }
1737
+ const Kt = (e, t, n, o) => {
1738
+ var g, b, h, S, N, y;
1739
+ let r = n.resolveValues || "none";
1740
+ if (r === "none") return t;
1741
+ const {
1742
+ theme: s,
1743
+ conf: i = De(),
1744
+ context: a,
1745
+ fontFamily: l,
1746
+ staticConfig: d
1747
+ } = o, u = s ? s[t] || s[t.slice(1)] : void 0, c = i.tokensParsed;
1748
+ let m, f = !1;
1749
+ const p = (g = d == null ? void 0 : d.accept) == null ? void 0 : g[e];
1750
+ if (p) {
1751
+ const $ = u ?? ((b = c[p]) == null ? void 0 : b[t]);
1752
+ $ != null && (r = "value", m = $, f = !0);
1753
+ }
1754
+ if (u) {
1755
+ if (r === "except-theme") return t;
1756
+ m = u, process.env.NODE_ENV === "development" && o.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info(` - resolving ${e} to theme value ${t} resolveAs ${r}`, m), globalThis.tamaguiAvoidTracking = !1), f = !0;
1757
+ } else {
1758
+ if (t in i.specificTokens) f = !0, m = i.specificTokens[t];
1759
+ else {
1760
+ switch (e) {
1761
+ case "fontFamily": {
1762
+ m = ((h = (a != null && a.language ? Oo(i.fontsParsed, a.language) : i.fontsParsed)[t]) == null ? void 0 : h.family) || t, sr(t), f = !0;
1763
+ break;
1764
+ }
1765
+ case "fontSize":
1766
+ case "lineHeight":
1767
+ case "letterSpacing":
1768
+ case "fontWeight": {
1769
+ const $ = l || i.defaultFontToken;
1770
+ if ($) {
1771
+ const M = a != null && a.language ? Oo(i.fontsParsed, a.language) : i.fontsParsed;
1772
+ m = ((N = (S = M[$] || M[i.defaultFontToken]) == null ? void 0 : S[Ga[e] || e]) == null ? void 0 : N[t]) || t, f = !0;
1773
+ }
1774
+ break;
1775
+ }
1776
+ }
1777
+ for (const $ in at) if (e in at[$]) {
1778
+ const M = (y = c[$]) == null ? void 0 : y[t];
1779
+ M != null ? (m = M, f = !0) : process.env.NODE_ENV === "development" && process.env.TAMAGUI_DISABLE_MISSING_TOKEN_LOG !== "1" && (zr || (zr = !0, console.groupCollapsed(`[tamagui] Warning: missing token ${e} in category ${$} - ${t} (open for details)`), console.info(`Note: this could just be due to you not setting all the theme tokens Tamagui expects, which is harmless, but
1780
+ it also often can be because you have a duplicated Tamagui in your bundle, which can cause tricky bugs.`), console.info(`To see if you have duplicated dependencies, in Chrome DevTools hit CMD+P and type TamaguiProvider.
1781
+ If you see both a .cjs and a .mjs entry, it's duplicated.`), console.info("You can debug that issue by opening the .mjs and .cjs files and setting a breakpoint at the top of each."), console.info("We only log this warning one time as it's sometimes harmless, to disable this log entirely set process.env.TAMAGUI_DISABLE_MISSING_TOKEN_LOG=1."), console.groupEnd()));
1782
+ }
1783
+ }
1784
+ if (!f) {
1785
+ const $ = c.space[t];
1786
+ $ != null && (m = $, f = !0);
1787
+ }
1788
+ }
1789
+ if (f) {
1790
+ const $ = ir(e, m, r);
1791
+ return process.env.NODE_ENV === "development" && o.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info("resolved", r, m, $), globalThis.tamaguiAvoidTracking = !1), $;
1792
+ }
1793
+ process.env.NODE_ENV === "development" && o.debug === "verbose" && console.warn(`Warning: no token found for ${e}, omitting`);
1794
+ };
1795
+ function ir(e, t, n) {
1796
+ if (n === "none") return t;
1797
+ if (Te(t)) {
1798
+ if (n === "value") return t.val;
1799
+ const o = t == null ? void 0 : t.get;
1800
+ return typeof o == "function" ? o(n === "web" ? "web" : void 0) : t.variable;
1801
+ }
1802
+ return t;
1803
+ }
1804
+ const Mn = (e) => e && !Array.isArray(e) && typeof e == "object";
1805
+ function ri(e, t = !1) {
1806
+ const n = {};
1807
+ for (let o in e) {
1808
+ const r = e[o];
1809
+ if (r == null) continue;
1810
+ if (o in Oe || // this should capture all parent-based styles like media, group, etc
1811
+ o[0] === "$" && Mn(r)) {
1812
+ n[o] = ri(r, t);
1813
+ continue;
1814
+ }
1815
+ const s = t ? r : xe(r, o), i = ni(o, s);
1816
+ i ? Object.assign(n, Object.fromEntries(i)) : n[o] = s;
1817
+ }
1818
+ return Vn(n), n;
1819
+ }
1820
+ const Ha = /(\$[\w.-]+)/g;
1821
+ function Xa(e, t, n, o) {
1822
+ return t.replace(Ha, (r) => {
1823
+ let s = Kt("size", r, n, o);
1824
+ return s == null && (s = Kt("color", r, n, o)), s != null ? String(s) : r;
1825
+ });
1826
+ }
1827
+ const Ya = {
1828
+ boxShadow: !0,
1829
+ textShadow: !0,
1830
+ filter: !0,
1831
+ backgroundImage: !0,
1832
+ border: !0,
1833
+ outline: !0
1834
+ };
1835
+ function si(e, t, n, o) {
1836
+ return !t.includes("$") || !Ya[e] ? t : Xa(e, t, n, o);
1837
+ }
1838
+ function Ro(e) {
1839
+ return typeof e == "string" && e.includes("rem");
1840
+ }
1841
+ const Za = {
1842
+ accessibilityElementsHidden: 1,
1843
+ accessibilityIgnoresInvertColors: 1,
1844
+ accessibilityLanguage: 1,
1845
+ adjustsFontSizeToFit: 1,
1846
+ allowFontScaling: 1,
1847
+ android_hyphenationFrequency: 1,
1848
+ dataDetectorType: 1,
1849
+ dynamicTypeRamp: 1,
1850
+ elevationAndroid: 1,
1851
+ ellipsizeMode: 1,
1852
+ hapticFeedback: 1,
1853
+ hapticStyle: 1,
1854
+ hitSlop: 1,
1855
+ importantForAccessibility: 1,
1856
+ lineBreakStrategyIOS: 1,
1857
+ maxFontSizeMultiplier: 1,
1858
+ minimumFontScale: 1,
1859
+ needsOffscreenAlphaCompositing: 1,
1860
+ nextFocusDown: 1,
1861
+ nextFocusForward: 1,
1862
+ nextFocusLeft: 1,
1863
+ nextFocusRight: 1,
1864
+ nextFocusUp: 1,
1865
+ onAccessibilityAction: 1,
1866
+ onAccessibilityEscape: 1,
1867
+ onAccessibilityTap: 1,
1868
+ onMagicTap: 1,
1869
+ onTextLayout: 1,
1870
+ pressRetentionOffset: 1,
1871
+ selectionColor: 1,
1872
+ shouldRasterizeIOS: 1,
1873
+ suppressHighlighting: 1,
1874
+ textBreakStrategy: 1
1875
+ }, lt = {
1876
+ untilMeasured: 1,
1877
+ transition: 1,
1878
+ space: 1,
1879
+ animateOnly: 1,
1880
+ animatedBy: 1,
1881
+ disableClassName: 1,
1882
+ debug: 1,
1883
+ componentName: 1,
1884
+ disableOptimization: 1,
1885
+ render: 1,
1886
+ style: 1,
1887
+ // handled after loop so pseudos set usedKeys and override it if necessary
1888
+ group: 1,
1889
+ animatePresence: 1
1890
+ };
1891
+ process.env.NODE_ENV === "test" && (lt["data-test-renders"] = 1);
1892
+ Object.assign(lt, Za);
1893
+ const ii = (e, t, n, o, r) => {
1894
+ if (o) return r(e, t);
1895
+ if (sr(null), e === "elevationAndroid") return;
1896
+ const {
1897
+ conf: s,
1898
+ styleProps: i,
1899
+ staticConfig: a
1900
+ } = n, {
1901
+ variants: l
1902
+ } = a;
1903
+ if (!i.noExpand && l && e in l) {
1904
+ const u = ai(e, t, i, n, "");
1905
+ if (u) {
1906
+ u.forEach(([c, m]) => r(c, m));
1907
+ return;
1908
+ }
1909
+ }
1910
+ i.disableExpandShorthands || e in s.shorthands && (e = s.shorthands[e]);
1911
+ const d = t;
1912
+ if (t != null) if (typeof t == "string")
1913
+ if (t[0] === "$") t = Kt(e, t, i, n);
1914
+ else {
1915
+ const u = si(e, t, i, n);
1916
+ t = u !== t ? u : Ro(t) ? t : t;
1917
+ }
1918
+ else Te(t) ? t = ir(e, t, i.resolveValues) : Ro(t) && (t = t);
1919
+ if (t != null) {
1920
+ const u = Ka();
1921
+ e === "fontFamily" && u && (n.fontFamily = u);
1922
+ const c = i.noExpand ? null : ni(e, t);
1923
+ if (c) {
1924
+ const m = c.length;
1925
+ for (let f = 0; f < m; f++) {
1926
+ const [p, g] = c[f];
1927
+ r(p, g, d);
1928
+ }
1929
+ } else r(e, t, d);
1930
+ }
1931
+ }, ai = (e, t, n, o, r) => {
1932
+ const {
1933
+ staticConfig: s,
1934
+ conf: i,
1935
+ debug: a
1936
+ } = o, {
1937
+ variants: l
1938
+ } = s;
1939
+ if (!l) return;
1940
+ let d = Qa(l[e], t, i, o);
1941
+ if (process.env.NODE_ENV === "development" && a === "verbose" && (console.groupCollapsed(`♦️♦️♦️ resolve variant ${e}`), console.info({
1942
+ key: e,
1943
+ value: t,
1944
+ variantValue: d,
1945
+ variants: l
1946
+ }), console.groupEnd()), !d) {
1947
+ if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof t != "boolean") {
1948
+ const c = s.componentName || "[UnnamedComponent]";
1949
+ console.warn(`No variant found: ${c} has variant "${e}", but no matching value "${t}"`);
1950
+ }
1951
+ return;
1952
+ }
1953
+ if (typeof d == "function") {
1954
+ const c = d, m = Ua(o);
1955
+ d = c(t, m), process.env.NODE_ENV === "development" && a === "verbose" && (console.groupCollapsed(" expanded functional variant", e), console.info({
1956
+ fn: c,
1957
+ variantValue: d,
1958
+ extras: m
1959
+ }), console.groupEnd());
1960
+ }
1961
+ let u;
1962
+ if (Mn(d)) {
1963
+ const c = d.fontFamily || d[i.inverseShorthands.fontFamily];
1964
+ c && (u = qa(c, i), o.fontFamily = u, process.env.NODE_ENV === "development" && a === "verbose" && console.info(" updating font family", u)), d = li(e, d, n, o, r);
1965
+ }
1966
+ if (d) {
1967
+ const c = ri(d, !!n.noNormalize);
1968
+ process.env.NODE_ENV === "development" && a === "verbose" && console.info(" expanding styles from ", d, "to", c);
1969
+ const m = Object.entries(c);
1970
+ return u && u[0] === "$" && sr(En(u)), m;
1971
+ }
1972
+ };
1973
+ function qa(e, t) {
1974
+ if (Te(e)) {
1975
+ const n = Ur.get(e);
1976
+ if (n) return n;
1977
+ for (const o in t.fontsParsed) {
1978
+ const r = t.fontsParsed[o].family;
1979
+ if (Te(r) && (Ur.set(r, o), r === e)) return o;
1980
+ }
1981
+ } else if (typeof e == "string" && e[0] === "$") return e;
1982
+ }
1983
+ const Ur = /* @__PURE__ */ new WeakMap(), li = (e, t, n, o, r) => {
1984
+ var c, m, f, p;
1985
+ const {
1986
+ conf: s,
1987
+ staticConfig: i,
1988
+ debug: a,
1989
+ theme: l
1990
+ } = o, {
1991
+ variants: d
1992
+ } = i, u = {};
1993
+ process.env.NODE_ENV === "development" && a === "verbose" && console.info(" - resolveTokensAndVariants", e, t);
1994
+ for (const g in t) {
1995
+ const b = s.shorthands[g] || g, h = t[g];
1996
+ if (!(!n.noSkip && b in lt)) {
1997
+ if (i) {
1998
+ const S = ((c = i.context) == null ? void 0 : c.props) || ((f = (m = i.parentStaticConfig) == null ? void 0 : m.context) == null ? void 0 : f.props);
1999
+ S && b in S && (o.overriddenContextProps || (o.overriddenContextProps = {}), o.overriddenContextProps[b] = h, o.originalContextPropValues || (o.originalContextPropValues = {}), o.originalContextPropValues[b] = h);
2000
+ }
2001
+ if (n.noExpand) u[b] = h;
2002
+ else if (d && b in d) {
2003
+ if (r && r === e) u[b] = h[0] === "$" ? Kt(b, h, n, o) : h;
2004
+ else {
2005
+ const S = ai(b, h, n, o, e);
2006
+ if (S) for (const [N, y] of S) y != null && (N in Oe ? (u[N] ?? (u[N] = {}), Object.assign(u[N], y)) : u[N] = y);
2007
+ }
2008
+ continue;
2009
+ }
2010
+ if (Te(h)) {
2011
+ u[b] = ir(b, h, n.resolveValues), process.env.NODE_ENV === "development" && a === "verbose" && console.info("variable", b, u[b]);
2012
+ continue;
2013
+ }
2014
+ if (typeof h == "string") {
2015
+ const S = h[0] === "$" ? Kt(b, h, n, o) : si(b, h, n, o);
2016
+ u[b] = S === h && Ro(h) ? h : S;
2017
+ continue;
2018
+ }
2019
+ if (Mn(h)) {
2020
+ const S = li(b, h, n, o, e);
2021
+ process.env.NODE_ENV === "development" && a === "verbose" && console.info("object", b, S), u[b] ?? (u[b] = {}), Object.assign(u[b], S);
2022
+ } else u[b] = h;
2023
+ process.env.NODE_ENV === "development" && a && ((p = u[b]) == null ? void 0 : p[0]) === "$" && console.warn(`⚠️ Missing token in theme ${l.name}:`, b, u[b], l);
2024
+ }
2025
+ }
2026
+ return u;
2027
+ }, Ja = ["size", "color", "radius", "space", "zIndex"].map((e) => ({
2028
+ name: e,
2029
+ spreadName: `...${e}`
2030
+ }));
2031
+ function Qa(e, t, n, {
2032
+ theme: o
2033
+ }) {
2034
+ if (!e) return;
2035
+ if (typeof e == "function") return e;
2036
+ const r = e[t];
2037
+ if (r) return r;
2038
+ if (t != null) {
2039
+ const {
2040
+ tokensParsed: s
2041
+ } = n;
2042
+ for (const {
2043
+ name: a,
2044
+ spreadName: l
2045
+ } of Ja) if (l in e && (a in s && t in s[a] || a === "color" && o && typeof t == "string" && t[0] === "$" && t.slice(1) in o)) return e[l];
2046
+ const i = e["...fontSize"];
2047
+ if (i && n.fontSizeTokens.has(t)) return i;
2048
+ }
2049
+ return e[`:${typeof t}`] || e["..."];
2050
+ }
2051
+ const ci = (e, t) => e < t ? -1 : e > t ? 1 : 0;
2052
+ let tt;
2053
+ const Bt = /* @__PURE__ */ new WeakMap(), Gr = "-";
2054
+ function Kr(e, t) {
2055
+ const n = e.split("-"), o = n.length;
2056
+ if (
2057
+ // check if its actually a simple group selector to avoid breaking selectors
2058
+ o === 2 || o === 3 && jo[n[n.length - 1]]
2059
+ ) {
2060
+ const r = n[1];
2061
+ if (r !== "true" && t && !t[r]) return e.replace("$group-", "$group-true-");
2062
+ }
2063
+ return e;
2064
+ }
2065
+ function Hr(e, t, n) {
2066
+ return e in t ? !0 : n && e in n;
2067
+ }
2068
+ const ui = (e, t, n, o, r, s, i, a, l, d, u, c, m) => {
2069
+ var qe, ut, _t;
2070
+ tt = tt || De();
2071
+ const f = m || (a == null ? void 0 : a.animationDriver) || tt.animations;
2072
+ if (e.passThrough) return null;
2073
+ s.isAnimated && (f != null && f.isReactNative) && !s.noNormalize && (s.noNormalize = "values");
2074
+ const {
2075
+ shorthands: p
2076
+ } = tt, {
2077
+ isHOC: g,
2078
+ isText: b,
2079
+ isInput: h,
2080
+ variants: S,
2081
+ isReactNative: N,
2082
+ inlineProps: y,
2083
+ inlineWhenUnflattened: $,
2084
+ parentStaticConfig: M,
2085
+ acceptsClassName: K
2086
+ } = t, C = {}, A = s.mediaState || Rn, T = K && Et && !s.noClass, P = {}, B = {};
2087
+ e.space;
2088
+ let k = null, W = !1, ae, de, Y, he = e.className || "", Re = 0;
2089
+ const ke = t.validStyles || (t.isText || t.isInput ? Jo : Fn);
2090
+ process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`split-styles-setup`;
2091
+ const E = {
2092
+ classNames: B,
2093
+ conf: tt,
2094
+ props: e,
2095
+ styleProps: s,
2096
+ componentState: r,
2097
+ staticConfig: t,
2098
+ style: null,
2099
+ theme: n,
2100
+ usedKeys: {},
2101
+ viewProps: C,
2102
+ context: a,
2103
+ debug: c,
2104
+ // resolved animation driver (respects animatedBy prop)
2105
+ animationDriver: f
2106
+ };
2107
+ if (process.env.IS_STATIC === "is_static") {
2108
+ const {
2109
+ fallbackProps: F
2110
+ } = s;
2111
+ F && (E.props = new Proxy(e, {
2112
+ get(x, V, ne) {
2113
+ return Reflect.has(e, V) ? Reflect.get(e, V) : Reflect.get(F, V);
2114
+ }
2115
+ }));
2116
+ }
2117
+ process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`style-state`, process.env.NODE_ENV === "development" && c === "verbose" && St && To && (console.groupCollapsed("🔹 getSplitStyles 👇"), G({
2118
+ props: e,
2119
+ staticConfig: t,
2120
+ shouldDoClasses: T,
2121
+ styleProps: s,
2122
+ rulesToInsert: P,
2123
+ componentState: r,
2124
+ styleState: E,
2125
+ theme: {
2126
+ ...n
2127
+ }
2128
+ }));
2129
+ const {
2130
+ asChild: Le
2131
+ } = e, {
2132
+ accept: ve
2133
+ } = t, {
2134
+ noSkip: H,
2135
+ disableExpandShorthands: O,
2136
+ noExpand: Ue,
2137
+ styledContext: Dn
2138
+ } = s, {
2139
+ webContainerType: ct
2140
+ } = tt.settings, Ze = M == null ? void 0 : M.variants;
2141
+ for (const F in e) {
2142
+ let x = F, V = e[x];
2143
+ if (x === "children") {
2144
+ C[x] = V;
2145
+ continue;
2146
+ }
2147
+ if (process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`before-prop-${x}`, process.env.NODE_ENV === "test" && x === "jestAnimatedStyle") continue;
2148
+ if (ve) {
2149
+ const R = ve[x];
2150
+ if ((R === "style" || R === "textStyle") && V && typeof V == "object") {
2151
+ C[x] = kt(E, x, V, s.noClass);
2152
+ continue;
2153
+ }
2154
+ }
2155
+ if (O || x in p && (x = p[x]), x === "className") continue;
2156
+ if (Le) {
2157
+ const R = nr(t);
2158
+ if (R) {
2159
+ const Q = R[F] ?? R[x];
2160
+ if (Q !== void 0 && V === Q) continue;
2161
+ }
2162
+ }
2163
+ if (x in lt && !H && !g) {
2164
+ if (x === "group") {
2165
+ const R = `t_group_${V}`, Q = ["continer", void 0, R, void 0, [`.${R} { container-name: ${V}; container-type: ${ct || "inline-size"}; }`]];
2166
+ Mt(P, Q);
2167
+ }
2168
+ continue;
2169
+ }
2170
+ let ne = Hr(x, ke, ve);
2171
+ if (t.isReactNative && x.startsWith("data-")) {
2172
+ x = x.replace("data-", ""), C.dataSet || (C.dataSet = {}), C.dataSet[x] = V;
2173
+ continue;
2174
+ }
2175
+ if (!Ue) {
2176
+ if (x === "disabled" && V === !0 && (C["aria-disabled"] = !0, (d === "button" || d === "form" || d === "input" || d === "select" || d === "textarea") && (C.disabled = !0), !(S != null && S.disabled))) continue;
2177
+ if (x === "testID") {
2178
+ N ? C.testID = V : (C["data-testid"] = V, s.isAnimated && (f != null && f.isReactNative) && (C.testID = V));
2179
+ continue;
2180
+ }
2181
+ if (x === "id") {
2182
+ C.id = V;
2183
+ continue;
2184
+ }
2185
+ }
2186
+ let oe = !ne && S && x in S;
2187
+ const Be = ne || oe;
2188
+ let ie = x in vn, se = !Be && !ie ? wr(x) : !1, le = !!(se || ie);
2189
+ le && se === "group" && (x = Kr(x, l));
2190
+ const Fe = ne || le || oe && !Ue;
2191
+ if (Fe && (Le === "except-style" || Le === "except-style-web")) continue;
2192
+ const D = !Fe && g || // is in parent variants
2193
+ g && Ze && x in Ze || (y == null ? void 0 : y.has(x)), Je = Ze == null ? void 0 : Ze[x], dt = !!(g && (ne || le || Je || x in lt)), Ee = D || dt;
2194
+ if (process.env.NODE_ENV === "development" && c === "verbose" && (console.groupCollapsed(` 🔑 ${F}${x !== F ? ` (shorthand for ${x})` : ""} ${Ee ? "(pass)" : ""}`), G({
2195
+ isVariant: oe,
2196
+ valInit: V,
2197
+ shouldPassProp: D
2198
+ }), St && G({
2199
+ variants: S,
2200
+ variant: S == null ? void 0 : S[x],
2201
+ isVariant: oe,
2202
+ isHOCShouldPassThrough: dt,
2203
+ usedKeys: {
2204
+ ...E.usedKeys
2205
+ },
2206
+ parentStaticConfig: M
2207
+ })), Ee && (Xr(C, x, V, le), process.env.NODE_ENV === "development" && c === "verbose" && console.groupEnd(), !oe)) continue;
2208
+ if (!H && x in lt) {
2209
+ process.env.NODE_ENV === "development" && c === "verbose" && console.groupEnd();
2210
+ continue;
2211
+ }
2212
+ (b || h) && V && (x === "fontFamily" || x === p.fontFamily) && V in tt.fontsParsed && (E.fontFamily = V);
2213
+ const qt = le || !Be;
2214
+ if (ii(x, V, E, qt, (R, Q, $t) => {
2215
+ var re, Ge, Qt, Qe;
2216
+ const Jt = Dn && R in Dn;
2217
+ if (!g && qt && !Jt && !le) {
2218
+ C[R] = Q;
2219
+ return;
2220
+ }
2221
+ if (process.env.NODE_ENV === "development" && c === "verbose" && (console.groupCollapsed(" 💠 expanded", x, "=>", R), G(Q), console.groupEnd()), Q != null) {
2222
+ if (!g && Hr(R, ke, ve)) {
2223
+ Ht(E, R, Q, 1, !1, $t);
2224
+ return;
2225
+ }
2226
+ if (ie = R in vn, se = ie ? !1 : wr(R), le = !!(se || ie), oe = S && R in S, se === "group" && (R = Kr(R, l)), (y != null && y.has(R) || process.env.IS_STATIC === "is_static" && ($ != null && $.has(R))) && (C[R] = e[R] ?? Q), s.noExpand && ie || g && (le || ((re = M == null ? void 0 : M.variants) == null ? void 0 : re[x]))) {
2227
+ Xr(C, R, Q, le), process.env.NODE_ENV === "development" && c === "verbose" && (console.groupCollapsed(` - passing down prop ${R}`), G({
2228
+ val: Q,
2229
+ after: {
2230
+ ...C[R]
2231
+ }
2232
+ }), console.groupEnd());
2233
+ return;
2234
+ }
2235
+ if (ie) {
2236
+ if (!Q) return;
2237
+ const ee = kt(E, R, Q, s.noClass && process.env.IS_STATIC !== "is_static");
2238
+ if ((!T || process.env.IS_STATIC === "is_static") && (k || (k = {}), k[R] || (k[R] = {}), process.env.IS_STATIC === "is_static")) {
2239
+ Object.assign(k[R], ee);
2240
+ return;
2241
+ }
2242
+ const Ve = Oe[R], Ne = R === "enterStyle", $e = R === "exitStyle";
2243
+ if (!Ve) return;
2244
+ if (T && !$e) {
2245
+ const ye = qs(ee, Ve);
2246
+ process.env.NODE_ENV === "development" && c === "verbose" && console.info("pseudo:", R, ee, ye);
2247
+ for (const Z of ye) {
2248
+ const ce = `${Z[Dt]}${Gr}${Ve.name}`;
2249
+ Mt(P, Z), B[ce] = Z[it];
2250
+ }
2251
+ }
2252
+ if (!T || $e || Ne) {
2253
+ const ye = Ve.stateKey || Ve.name;
2254
+ let Z = r[ye] === !1;
2255
+ $e && (Z = !s.isExiting), Ne && r.unmounted === !1 && (Z = !0), process.env.NODE_ENV === "development" && c === "verbose" && (console.groupCollapsed("pseudo", R, {
2256
+ isDisabled: Z
2257
+ }), G({
2258
+ pseudoStyleObject: ee,
2259
+ isDisabled: Z,
2260
+ descriptor: Ve,
2261
+ componentState: r
2262
+ }), console.groupEnd());
2263
+ const ce = Ve.priority, pe = Bt.get(ee);
2264
+ for (const z in ee) {
2265
+ const q = ee[z];
2266
+ if (Z) io(z, E);
2267
+ else {
2268
+ const ge = E.usedKeys[z] || 0, Pe = ce >= ge;
2269
+ Pe && (process.env.IS_STATIC === "is_static" && (k || (k = {}), k[R] || (k[R] = {}), k[R][z] = q), Ht(E, z, q, ce, !1, pe == null ? void 0 : pe[z])), process.env.NODE_ENV === "development" && c === "verbose" && G(" subKey", z, Pe, {
2270
+ importance: ce,
2271
+ curImportance: ge,
2272
+ pkey: z,
2273
+ val: q
2274
+ });
2275
+ }
2276
+ }
2277
+ if (!Z) for (const z in Q) {
2278
+ const q = p[z] || z;
2279
+ E.usedKeys[q] = Math.max(ce, E.usedKeys[q] || 0);
2280
+ }
2281
+ }
2282
+ return;
2283
+ }
2284
+ if (se) {
2285
+ if (!Q) return;
2286
+ const ee = R.slice(se == "theme" ? 7 : 1);
2287
+ if (W || (W = !0), (Q.space || !T || s.willBeAnimated) && ((!W || typeof W == "boolean") && (W = /* @__PURE__ */ new Set()), W.add(ee)), se === "platform" && !oo(R)) return;
2288
+ process.env.NODE_ENV === "development" && c === "verbose" && G(` 📺 ${R}`, {
2289
+ key: R,
2290
+ val: Q,
2291
+ props: e,
2292
+ shouldDoClasses: T,
2293
+ acceptsClassName: K,
2294
+ componentState: r,
2295
+ mediaState: A
2296
+ });
2297
+ const Ve = Re;
2298
+ if (Re += 1, T) {
2299
+ const Ne = kt(E, R, Q, !1), $e = to(Ne);
2300
+ for (const ye of $e) {
2301
+ const Z = ye[Dt], ce = Z[0] === "$";
2302
+ if (ce && !oo(Z)) continue;
2303
+ const pe = Ui(ye, ee, Ut, se, !1, Ve);
2304
+ process.env.NODE_ENV === "development" && c === "verbose" && G("📺 media style:", pe);
2305
+ const z = ce ? ye[2] : "", q = `${ye[Dt]}${z}${Gr}${ee}${ye[Is] || ""}`;
2306
+ Mt(P, pe), B[q] = pe[it];
2307
+ }
2308
+ } else {
2309
+ let Ne = function(z, q, ge) {
2310
+ E.style || (E.style = {}), sl(E, ee, z, q, A[ee], ce, c, ge) && z === "fontFamily" && (E.fontFamily = Z.fontFamily);
2311
+ };
2312
+ const $e = se === "theme", ye = se === "group";
2313
+ if (!$e && se !== "platform" && !ye) {
2314
+ if (!A[ee]) {
2315
+ process.env.NODE_ENV === "development" && c === "verbose" && G(` 📺 ❌ DISABLED ${ee}`);
2316
+ return;
2317
+ }
2318
+ process.env.NODE_ENV === "development" && c === "verbose" && G(` 📺 ✅ ENABLED ${ee}`);
2319
+ }
2320
+ const Z = kt(E, R, Q, !0);
2321
+ let ce = 0;
2322
+ if ($e) {
2323
+ if (ae = !0, !(o === ee || o.startsWith(ee))) return;
2324
+ } else if (ye) {
2325
+ const z = _s(ee), q = z.name, ge = (Ge = l == null ? void 0 : l[q]) == null ? void 0 : Ge.state, Pe = z.pseudo, Me = z.media;
2326
+ if (!ge) {
2327
+ process.env.NODE_ENV === "development" && c && G(`No parent with group prop, skipping styles: ${q}`), de || (de = /* @__PURE__ */ new Set());
2328
+ return;
2329
+ }
2330
+ const We = (Qt = r.group) == null ? void 0 : Qt[q];
2331
+ if (Me) {
2332
+ Y || (Y = /* @__PURE__ */ new Set()), Y.add(Me);
2333
+ const be = We == null ? void 0 : We.media;
2334
+ let Ce = be == null ? void 0 : be[Me];
2335
+ if (!be && ge.layout && (Ce = Rs(Me, ge.layout)), process.env.NODE_ENV === "development" && c === "verbose" && G(` 🏘️ GROUP media ${Me} active? ${Ce}`, {
2336
+ ...be,
2337
+ usedKeys: {
2338
+ ...E.usedKeys
2339
+ }
2340
+ }), !Ce) {
2341
+ for (const je in Z) io(je, E);
2342
+ return;
2343
+ }
2344
+ ce = 2;
2345
+ }
2346
+ if (Pe) {
2347
+ de || (de = /* @__PURE__ */ new Set()), de.add(q);
2348
+ const be = (Qe = We || // fallback to context initially
2349
+ (l == null ? void 0 : l[q].state)) == null ? void 0 : Qe.pseudo, Ce = be == null ? void 0 : be[Pe], je = jo[Pe];
2350
+ if (process.env.NODE_ENV === "development" && c === "verbose" && G(` 🏘️ GROUP pseudo ${Me} active? ${Ce}, priority ${je}`, {
2351
+ componentGroupPseudoState: {
2352
+ ...be
2353
+ },
2354
+ usedKeys: {
2355
+ ...E.usedKeys
2356
+ }
2357
+ }), !Ce) {
2358
+ for (const ft in Z) io(ft, E);
2359
+ return;
2360
+ }
2361
+ ce = je;
2362
+ }
2363
+ }
2364
+ const pe = Bt.get(Z);
2365
+ ye && Z.transition && (E.pseudoTransitions || (E.pseudoTransitions = {}), E.pseudoTransitions[`$${ee}`] = Z.transition);
2366
+ for (const z in Z) if (z !== "space") if (z[0] === "$") {
2367
+ if (!oo(z) || !ja(z, o)) continue;
2368
+ const q = Bt.get(Z[z]);
2369
+ for (const ge in Z[z]) Ne(ge, Z[z][ge], q == null ? void 0 : q[ge]);
2370
+ } else Ne(z, Z[z], pe == null ? void 0 : pe[z]);
2371
+ }
2372
+ return;
2373
+ }
2374
+ if (!oe) {
2375
+ if (Jt) return;
2376
+ C[R] = Q;
2377
+ }
2378
+ }
2379
+ }), process.env.NODE_ENV === "development" && c === "verbose") {
2380
+ try {
2381
+ G(" ✔️ expand complete", x), G("style", {
2382
+ ...E.style
2383
+ }), G("viewProps", {
2384
+ ...C
2385
+ }), G("transforms", {
2386
+ ...E.flatTransforms
2387
+ });
2388
+ } catch {
2389
+ }
2390
+ console.groupEnd();
2391
+ }
2392
+ }
2393
+ if (process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`split-styles-propsend`, s.noNormalize !== !1 && (E.style && (Vn(E.style), !s.noExpand && !s.noMergeStyle && Et && (!N || (f == null ? void 0 : f.inputStyle) !== "css") && rr(E.style)), E.flatTransforms && (E.style || (E.style = {}), di(E.style, E.flatTransforms))), !s.noNormalize && !t.isReactNative && !t.isHOC && (!s.isAnimated || (f == null ? void 0 : f.inputStyle) === "css") && Array.isArray((qe = E.style) == null ? void 0 : qe.transform) && (E.style.transform = or(E.style.transform)), !s.noMergeStyle && E.style && T) {
2394
+ let F, x = !1;
2395
+ if (!E.style.$$css) {
2396
+ const V = to(E.style);
2397
+ for (const ne of V) {
2398
+ const [oe, Be, ie] = ne, se = s.isAnimated && s.noClass && ((ut = e.animateOnly) == null ? void 0 : ut.includes(oe)), le = !se && !s.isAnimated && St && (f == null ? void 0 : f.outputStyle) === "css" && ((_t = e.animateOnly) == null ? void 0 : _t.includes(oe));
2399
+ se ? (F || (F = {}), F[oe] = E.style[oe]) : le ? (F || (F = {}), F[oe] = Be, x = !0) : (Mt(P, ne), B[oe] = ie);
2400
+ }
2401
+ process.env.NODE_ENV === "development" && e.debug === "verbose" && (console.groupCollapsed("🔹 getSplitStyles final style object"), console.info(E.style), console.info("retainedStyles", F), console.groupEnd()), (x || process.env.IS_STATIC !== "is_static") && (E.style = F || {});
2402
+ }
2403
+ }
2404
+ if (!s.noMergeStyle && E.style && !T && s.isAnimated && !(f != null && f.isReactNative) && !E.style.$$css) {
2405
+ const F = {};
2406
+ let x = !1;
2407
+ e.animateOnly;
2408
+ for (const V in E.style) V in js && (F[V] = E.style[V], delete E.style[V], x = !0);
2409
+ if (x) {
2410
+ const V = to(F);
2411
+ for (const ne of V) Mt(P, ne), B[ne[Dt]] = ne[it];
2412
+ }
2413
+ }
2414
+ const Ie = e.style;
2415
+ if (!s.noMergeStyle && Ie) if (g) C.style = Yr(Ie);
2416
+ else {
2417
+ const F = Array.isArray(Ie), x = F ? Ie.length : 1;
2418
+ for (let V = 0; V < x; V++) {
2419
+ const ne = F ? Ie[V] : Ie;
2420
+ ne && (ne.$$css ? Object.assign(E.classNames, ne) : (E.style || (E.style = {}), Object.assign(E.style, Yr(ne))));
2421
+ }
2422
+ }
2423
+ process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`split-styles-pre-result`;
2424
+ const _e = {
2425
+ hasMedia: W,
2426
+ fontFamily: E.fontFamily,
2427
+ viewProps: C,
2428
+ style: E.style,
2429
+ pseudos: k,
2430
+ classNames: B,
2431
+ rulesToInsert: P,
2432
+ dynamicThemeAccess: ae,
2433
+ pseudoGroups: de,
2434
+ mediaGroups: Y,
2435
+ overriddenContextProps: E.overriddenContextProps,
2436
+ pseudoTransitions: E.pseudoTransitions
2437
+ }, me = Le === "except-style" || Le === "except-style-web";
2438
+ if (!s.noMergeStyle && !me) {
2439
+ const F = E.style;
2440
+ {
2441
+ let x = b || h ? E.fontFamily : null;
2442
+ x && x[0] === "$" && (x = x.slice(1));
2443
+ const V = x ? `font_${x}` : "", ne = e.group ? `t_group_${e.group}` : "", oe = e.componentName || t.componentName, Be = e.asChild || !oe || oe === "Text" ? "" : `is_${oe}`;
2444
+ let ie = [];
2445
+ Be && ie.push(Be), b ? ie.push("is_Text") : ie.push("is_View"), V && ie.push(V), B && ie.push(Object.values(B).join(" ")), ne && ie.push(ne), e.className && ie.push(e.className);
2446
+ const se = ie.join(" "), le = N || s.isAnimated && (f == null ? void 0 : f.isReactNative);
2447
+ if (s.isAnimated && (f == null ? void 0 : f.inputStyle) === "css") C.className = se, F && (C.style = F);
2448
+ else if (le) {
2449
+ let Fe;
2450
+ for (const D of se.split(" ")) Fe || (Fe = {
2451
+ $$css: !0
2452
+ }), Fe[D] = D;
2453
+ C.style = Fe ? [...Array.isArray(F) ? F : [F], Fe] : [F];
2454
+ } else se && (C.className = se), F && (C.style = F);
2455
+ }
2456
+ }
2457
+ if (process.env.NODE_ENV === "development" && c === "verbose" && St && To) {
2458
+ console.groupEnd(), console.groupCollapsed("🔹 getSplitStyles ===>");
2459
+ try {
2460
+ const F = {
2461
+ ..._e,
2462
+ className: he,
2463
+ componentState: r,
2464
+ viewProps: C,
2465
+ rulesToInsert: P,
2466
+ parentSplitStyles: i
2467
+ };
2468
+ for (const x in F) G(x, F[x]);
2469
+ } catch {
2470
+ }
2471
+ console.groupEnd();
2472
+ }
2473
+ return process.env.NODE_ENV === "development" && (c === "profile" || globalThis.time) && time`split-styles-done`, _e;
2474
+ };
2475
+ function di(e, t) {
2476
+ Object.entries(t).sort(([n], [o]) => ci(n, o)).forEach(([n, o]) => {
2477
+ Tn(e, n, o, !0);
2478
+ });
2479
+ }
2480
+ function Ht(e, t, n, o, r = !1, s) {
2481
+ var c, m, f, p;
2482
+ const {
2483
+ viewProps: i,
2484
+ styleProps: a,
2485
+ staticConfig: l,
2486
+ usedKeys: d
2487
+ } = e;
2488
+ if ((d[t] || 0) > o) return;
2489
+ const u = ((c = l.context) == null ? void 0 : c.props) || ((f = (m = l.parentStaticConfig) == null ? void 0 : m.context) == null ? void 0 : f.props);
2490
+ if (u && t in u) {
2491
+ e.overriddenContextProps || (e.overriddenContextProps = {});
2492
+ const g = (p = e.originalContextPropValues) == null ? void 0 : p[t];
2493
+ e.overriddenContextProps[t] = s ?? g ?? n;
2494
+ }
2495
+ if (t in Yt) e.flatTransforms || (e.flatTransforms = {}), d[t] = o, e.flatTransforms[t] = n;
2496
+ else {
2497
+ const g = !r && !a.noNormalize ? xe(n, t) : n;
2498
+ l.accept && t in l.accept ? i[t] = g : (e.style || (e.style = {}), d[t] = o, e.style[t] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
2499
+ // if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
2500
+ t === "transform" && Array.isArray(g) ? [...g] : g);
2501
+ }
2502
+ }
2503
+ const kt = (e, t, n, o) => {
2504
+ var d, u;
2505
+ const {
2506
+ staticConfig: r,
2507
+ conf: s,
2508
+ styleProps: i
2509
+ } = e, a = {};
2510
+ let l;
2511
+ for (let c in n) {
2512
+ const m = n[c];
2513
+ if (c = s.shorthands[c] || c, c === "transition") {
2514
+ e.pseudoTransitions || (e.pseudoTransitions = {}), e.pseudoTransitions[t] = m;
2515
+ const f = e.animationDriver;
2516
+ if ((f == null ? void 0 : f.outputStyle) === "css") {
2517
+ const p = (d = f.animations) == null ? void 0 : d[m];
2518
+ if (p) {
2519
+ const g = t[0] === "$" ? " !important" : "";
2520
+ a.transition = `all ${p}${g}`;
2521
+ }
2522
+ }
2523
+ continue;
2524
+ }
2525
+ !r.isHOC && c in lt && !i.noSkip || ii(c, m, e, !1, (f, p, g) => {
2526
+ g !== void 0 && (l || (l = {}), l[f] = g), f in vn && (p = kt(e, f, p, o)), !o && f in Yt ? Tn(a, f, p) : a[f] = i.noNormalize ? p : xe(p, c);
2527
+ });
2528
+ }
2529
+ if (!o) {
2530
+ const c = (u = e.style) == null ? void 0 : u.transform, m = e.flatTransforms, f = a.transform;
2531
+ if (Array.isArray(f) && f.length) {
2532
+ const p = f.length;
2533
+ if (Array.isArray(c)) {
2534
+ const g = [];
2535
+ e: for (let b = 0; b < c.length; b++) {
2536
+ const h = c[b];
2537
+ for (const S in h) {
2538
+ for (let N = 0; N < p; N++) for (const y in f[N]) {
2539
+ if (S === y) continue e;
2540
+ break;
2541
+ }
2542
+ g.push(h);
2543
+ break;
2544
+ }
2545
+ }
2546
+ for (let b = 0; b < p; b++) g.push(f[b]);
2547
+ a.transform = g;
2548
+ }
2549
+ if (m) e: for (const g in m) {
2550
+ const b = g === "x" ? "translateX" : g === "y" ? "translateY" : g;
2551
+ for (let h = 0; h < p; h++) for (const S in f[h]) {
2552
+ if (b === S) continue e;
2553
+ break;
2554
+ }
2555
+ Tn(a, g, m[g]);
2556
+ }
2557
+ } else m && di(a, m);
2558
+ }
2559
+ return i.noNormalize || Vn(a), l && Bt.set(a, l), a;
2560
+ }, el = te.useInsertionEffect || Ae, tl = (e, t, n, o, r, s, i, a, l, d, u, c, m) => {
2561
+ "use no memo";
2562
+ const f = ui(e, t, n, o, r, s, i, a, l, d, u, c, m);
2563
+ return el(() => {
2564
+ f && Ba(f.rulesToInsert);
2565
+ }, [f == null ? void 0 : f.rulesToInsert]), f;
2566
+ };
2567
+ function Mt(e, t) {
2568
+ {
2569
+ const n = t[it];
2570
+ ti(n) && (ei(n, t[In]), e[n] = t);
2571
+ }
2572
+ }
2573
+ const nl = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)", ol = {
2574
+ ...Object.fromEntries(Object.entries(at.color).map(([e, t]) => [e, nl])),
2575
+ opacity: 1,
2576
+ scale: 1,
2577
+ scaleX: 1,
2578
+ scaleY: 1,
2579
+ rotate: "0deg",
2580
+ rotateX: "0deg",
2581
+ rotateY: "0deg",
2582
+ rotateZ: "0deg",
2583
+ skewX: "0deg",
2584
+ skewY: "0deg",
2585
+ x: 0,
2586
+ y: 0,
2587
+ borderRadius: 0
2588
+ }, Tn = (e, t, n, o = !1) => {
2589
+ typeof e.transform != "string" && (e.transform || (e.transform = []), e.transform[o ? "unshift" : "push"]({
2590
+ [rl[t] || t]: n
2591
+ }));
2592
+ }, rl = {
2593
+ x: "translateX",
2594
+ y: "translateY"
2595
+ };
2596
+ function Xr(e, t, n, o = !1) {
2597
+ if (o) {
2598
+ const r = {
2599
+ ...e[t],
2600
+ ...n
2601
+ };
2602
+ delete e[t], e[t] = r;
2603
+ } else e[t] = n;
2604
+ }
2605
+ function sl(e, t, n, o, r, s, i, a) {
2606
+ const l = e.usedKeys;
2607
+ let d = oa(t, n, e, r);
2608
+ if (s && (d = (d || 0) + s), process.env.NODE_ENV === "development" && i === "verbose" && G(`mergeMediaByImportance ${n} importance usedKey ${l[n]} next ${d}`), d === null) return !1;
2609
+ if (n in Oe) {
2610
+ const u = Oe[n], c = u.stateKey || u.name;
2611
+ if (e.componentState[c] === !1) return !1;
2612
+ const m = Bt.get(o);
2613
+ for (const f in o) Ht(e, f, o[f], d, !1, m == null ? void 0 : m[f]);
2614
+ } else Ht(e, n, o, d, !1, a);
2615
+ return !0;
2616
+ }
2617
+ function Yr(e) {
2618
+ const t = {};
2619
+ for (const n in e) {
2620
+ const o = e[n];
2621
+ n in Yt ? Tn(t, n, o) : t[n] = xe(o, n);
2622
+ }
2623
+ return Array.isArray(t.transform) && (t.transform = or(t.transform)), Vn(t), t;
2624
+ }
2625
+ function io(e, t) {
2626
+ const n = ol[e];
2627
+ n != null && !(e in t.usedKeys) && (!t.style || !(e in t.style)) && Ht(t, e, n, 1);
2628
+ }
2629
+ const il = /^on[A-Z]/;
2630
+ function fi(e, t) {
2631
+ for (const n in t) {
2632
+ const o = e[n], r = t[n];
2633
+ r !== void 0 && (n === "style" ? e.style = o && r ? {
2634
+ ...o,
2635
+ ...r
2636
+ } : r || o : n === "className" ? e.className = o && r ? `${o} ${r}` : r || o : n === "ref" ? e.ref = o && r ? er(o, r) : r || o : il.test(n) && typeof o == "function" && typeof r == "function" ? e[n] = Ko(o, r) : e[n] = r);
2637
+ }
2638
+ return e;
2639
+ }
2640
+ function al(e, t, n) {
2641
+ const o = fi({
2642
+ ...e
2643
+ }, t);
2644
+ return o.children = n, o;
2645
+ }
2646
+ function Zr(e, t, n, o) {
2647
+ var s, i, a;
2648
+ if (!n) return o;
2649
+ const r = e || {
2650
+ hover: !1,
2651
+ press: !1,
2652
+ focus: !1,
2653
+ groups: {}
2654
+ };
2655
+ if (t.press && !r.press && n.pressStyle) return n.pressStyle;
2656
+ if (t.hover && !r.hover && n.hoverStyle) return n.hoverStyle;
2657
+ if (t.focus && !r.focus && n.focusStyle) return n.focusStyle;
2658
+ for (const l in n) if (l.startsWith("$group-")) {
2659
+ const d = l.match(/^\$group-(.+)-(hover|press|focus)$/);
2660
+ if (!d) continue;
2661
+ const u = d[1], c = d[2], m = (i = (s = t.group) == null ? void 0 : s[u]) == null ? void 0 : i.pseudo, f = (a = r.groups) == null ? void 0 : a[u];
2662
+ if (m != null && m[c] && !(f != null && f[c])) return n[l];
2663
+ }
2664
+ return o;
2665
+ }
2666
+ function qr(e) {
2667
+ var n;
2668
+ const t = {};
2669
+ if (e.group) for (const o in e.group) {
2670
+ const r = (n = e.group[o]) == null ? void 0 : n.pseudo;
2671
+ r && (t[o] = {
2672
+ hover: r.hover,
2673
+ press: r.press,
2674
+ focus: r.focus
2675
+ });
2676
+ }
2677
+ return {
2678
+ hover: e.hover,
2679
+ press: e.press,
2680
+ focus: e.focus,
2681
+ groups: t
2682
+ };
2683
+ }
2684
+ const ze = {};
2685
+ function ll(e) {
2686
+ Object.assign(ze, e);
2687
+ }
2688
+ const cl = (e) => {
2689
+ var t;
2690
+ (t = ze.setElementProps) == null || t.call(ze, e);
2691
+ }, ul = (e) => {
2692
+ const {
2693
+ pseudoGroups: t,
2694
+ mediaGroups: n,
2695
+ groupContext: o
2696
+ } = e;
2697
+ if (t || n) {
2698
+ process.env.NODE_ENV === "development" && !o && console.debug("No context group found");
2699
+ const r = /* @__PURE__ */ new Set();
2700
+ if (t) for (const s of t) r.add(Jr(s, e));
2701
+ if (n) for (const s of n) r.add(Jr(s, e));
2702
+ return () => {
2703
+ r.forEach((s) => s());
2704
+ };
2705
+ }
2706
+ }, Jr = (e, {
2707
+ setStateShallow: t,
2708
+ pseudoGroups: n,
2709
+ mediaGroups: o,
2710
+ groupContext: r
2711
+ }) => {
2712
+ const s = r == null ? void 0 : r[e];
2713
+ if (!s) return () => {
2714
+ };
2715
+ const i = s.subscribe(({
2716
+ layout: a,
2717
+ pseudo: l
2718
+ }) => {
2719
+ t((d) => {
2720
+ var m;
2721
+ let u = !1;
2722
+ const c = ((m = d.group) == null ? void 0 : m[e]) || {
2723
+ pseudo: {},
2724
+ media: {}
2725
+ };
2726
+ if (l && (n != null && n.has(e))) c.pseudo || (c.pseudo = {}), po(c.pseudo, l) !== c.pseudo && (Object.assign(c.pseudo, l), u = !0);
2727
+ else if (a && o) {
2728
+ c.media || (c.media = {});
2729
+ const f = na(o, a), p = po(c.media, f);
2730
+ p !== c.media && (Object.assign(c.media, p), u = !0);
2731
+ }
2732
+ return u ? {
2733
+ group: {
2734
+ ...d.group,
2735
+ [e]: c
2736
+ }
2737
+ } : d;
2738
+ });
2739
+ });
2740
+ return () => {
2741
+ i(), t({
2742
+ group: {}
2743
+ });
2744
+ };
2745
+ }, xn = Xt(!1), dl = ({
2746
+ children: e,
2747
+ enabled: t
2748
+ }) => {
2749
+ const n = An(xn);
2750
+ return /* @__PURE__ */ w(xn.Provider, {
2751
+ value: t ?? n,
2752
+ children: e
2753
+ });
2754
+ }, fl = () => fo.useContext(xn);
2755
+ function mi() {
2756
+ return fo.useContext(xn) ? !0 : fo.useSyncExternalStore(ml, () => !0, () => !1);
2757
+ }
2758
+ const ml = () => () => {
2759
+ };
2760
+ let Se;
2761
+ function hi({
2762
+ themeState: e,
2763
+ themeProps: t,
2764
+ children: n
2765
+ }) {
2766
+ if (process.env.NODE_ENV === "development") {
2767
+ const o = mi();
2768
+ if (process.env.NODE_ENV === "development" && typeof document < "u" && (Se || (Se = document.createElement("div"), Se.style.height = "200px", Se.style.overflowY = "scroll", Se.style.position = "fixed", Se.style.zIndex = 1e7, Se.style.bottom = "30px", Se.style.left = "30px", Se.style.right = "30px", Se.style.display = "flex", Se.style.border = "1px solid #888", Se.style.flexDirection = "row", Se.style.background = "var(--background)")), Tt(() => {
2769
+ document.body.appendChild(Se);
2770
+ }, []), t["disable-child-theme"] || !o) return n;
2771
+ const r = e.parentId ? Xs(e.parentId) : null;
2772
+ return /* @__PURE__ */ Xe(Cn, {
2773
+ children: [$i(/* @__PURE__ */ Xe("code", {
2774
+ style: {
2775
+ whiteSpace: "pre",
2776
+ maxWidth: 250,
2777
+ overflow: "auto",
2778
+ padding: 5
2779
+ },
2780
+ children: ["<Theme ", e.id, " /> ", JSON.stringify({
2781
+ name: e.name,
2782
+ color1: e.theme.color1.val,
2783
+ parentId: e.parentId,
2784
+ // inverses: themeState.inverses,
2785
+ isNew: e.isNew,
2786
+ themeProps: {
2787
+ name: t.name,
2788
+ componentName: t.componentName,
2789
+ reset: t.reset
2790
+ },
2791
+ parentState: {
2792
+ name: r == null ? void 0 : r.name,
2793
+ isNew: r == null ? void 0 : r.isNew
2794
+ }
2795
+ }, null, 2)]
2796
+ }), Se), /* @__PURE__ */ w("div", {
2797
+ style: {
2798
+ color: "red"
2799
+ },
2800
+ children: e.id
2801
+ }), n]
2802
+ });
2803
+ }
2804
+ return n;
2805
+ }
2806
+ hi.displayName = "ThemeDebug";
2807
+ const Zt = hs(function(e, t) {
2808
+ "use no memo";
2809
+ if (e.disable) return e.children;
2810
+ const {
2811
+ passThrough: n
2812
+ } = e, o = !!e._isRoot, [r, s] = Zs(e, o);
2813
+ let i = e["disable-child-theme"] ? bn.map(e.children, (l) => n || !Wo(l) ? l : yn(l, {
2814
+ "data-disable-theme": !0
2815
+ })) : e.children;
2816
+ if (t) try {
2817
+ te.Children.only(i), i = yn(i, {
2818
+ ref: t
2819
+ });
2820
+ } catch {
2821
+ }
2822
+ const a = jt({
2823
+ hasEverThemed: !1
2824
+ });
2825
+ return pi(s, i, e, o, a, n);
2826
+ });
2827
+ Zt.avoidForwardRef = !0;
2828
+ function pi(e, t, n, o = !1, r, s = !1) {
2829
+ const {
2830
+ shallow: i,
2831
+ forceClassName: a
2832
+ } = n, l = r.current;
2833
+ let d = l.hasEverThemed || e.isNew || o || Ta(n);
2834
+ if (process.env.NODE_ENV === "development" && n.debug === "visualize" && (t = /* @__PURE__ */ w(hi, {
2835
+ themeState: e,
2836
+ themeProps: n,
2837
+ children: t
2838
+ })), !d) return t;
2839
+ t = /* @__PURE__ */ w(Hs.Provider, {
2840
+ value: e.id,
2841
+ children: t
2842
+ });
2843
+ const {
2844
+ isInverse: u,
2845
+ name: c
2846
+ } = e, m = u || a;
2847
+ if (l.hasEverThemed || (l.hasEverThemed = !0), (m || // if the theme is exactly dark or light, its likely to change between dark/light
2848
+ // and that would require wrapping which would re-parent, so to avoid re-parenting do this
2849
+ e.name === "dark" || e.name === "light") && (l.hasEverThemed = "wrapped"), i && e.parentId) {
2850
+ const f = Xs(e.isNew ? e.id : e.parentId);
2851
+ if (!f) throw new Error("‼️010");
2852
+ t = bn.toArray(t).map((p) => Wo(p) ? s ? p : yn(p, void 0, /* @__PURE__ */ w(Zt, {
2853
+ name: f.name,
2854
+ children: p.props.children
2855
+ })) : p);
2856
+ }
2857
+ if (process.env.NODE_ENV === "development" && !s && n.debug && console.warn(" getThemedChildren", {
2858
+ requiresExtraWrapper: m,
2859
+ forceClassName: a,
2860
+ themeState: e,
2861
+ state: l,
2862
+ themeSpanProps: Qr(e, n, o)
2863
+ }), a === !1) return t;
2864
+ {
2865
+ const f = n.contain ? pl : hl, {
2866
+ className: p = "",
2867
+ color: g
2868
+ } = s ? {} : Qr(e, n, o);
2869
+ if (t = /* @__PURE__ */ w("span", {
2870
+ className: `${p} is_Theme`,
2871
+ style: s ? f : {
2872
+ color: g,
2873
+ ...f
2874
+ },
2875
+ children: t
2876
+ }), l.hasEverThemed === "wrapped") {
2877
+ const b = m ? `${c.startsWith("light") ? "t_light" : c.startsWith("dark") ? "t_dark" : ""} _dsp_contents` : "_dsp_contents";
2878
+ t = /* @__PURE__ */ w("span", {
2879
+ className: b,
2880
+ children: t
2881
+ });
2882
+ }
2883
+ return t;
2884
+ }
2885
+ }
2886
+ const hl = {
2887
+ display: "contents"
2888
+ }, pl = {
2889
+ display: "contents",
2890
+ contain: "strict"
2891
+ }, gl = {
2892
+ className: "",
2893
+ color: void 0
2894
+ };
2895
+ function Qr(e, t, n = !1) {
2896
+ if (!e.isNew && !t.forceClassName) return gl;
2897
+ const o = e != null && e.theme && e.isNew ? Nt(e.theme.color) : "", r = e.name.replace(bl, ""), s = r.split("_");
2898
+ let i = `t_${r}`;
2899
+ if (s.length > 1) {
2900
+ const l = [];
2901
+ for (let d = 1; d <= s.length; d++) l.push(`t_${s.slice(0, d).join("_")}`);
2902
+ i = l.join(" ");
2903
+ }
2904
+ const a = `${n ? "" : "t_sub_theme"} ${i}`;
2905
+ return {
2906
+ color: o,
2907
+ className: a
2908
+ };
2909
+ }
2910
+ const bl = /^(dark|light)_/;
2911
+ function yl(e, t, n = !1) {
2912
+ const o = te.forwardRef(function(r, s) {
2913
+ "use no memo";
2914
+ const i = nr(t, r.componentName), a = i == null ? void 0 : i.theme, l = i == null ? void 0 : i.themeReset, {
2915
+ theme: d,
2916
+ componentName: u,
2917
+ themeReset: c,
2918
+ ...m
2919
+ } = r;
2920
+ let f;
2921
+ const p = t == null ? void 0 : t.context;
2922
+ if (p) for (const N in p.props) {
2923
+ const y = r[N];
2924
+ y !== void 0 && (f = f || {}, f[N] = y);
2925
+ }
2926
+ const g = (
2927
+ // @ts-expect-error its ok
2928
+ /* @__PURE__ */ w(e, {
2929
+ ref: s,
2930
+ ...m,
2931
+ "data-disable-theme": !0
2932
+ })
2933
+ );
2934
+ let b = null;
2935
+ const h = u || (t == null ? void 0 : t.componentName);
2936
+ if (h && (b = b || {}, b.componentName = h), "debug" in r && (b = b || {}, b.debug = r.debug), ("theme" in r || a) && (b = b || {}, b.name = "theme" in r ? r.theme : a), ("themeReset" in r || l) && (b = b || {}, b.reset = "themeReset" in r ? c : l), n && !b) return g;
2937
+ let S = /* @__PURE__ */ w(Zt, {
2938
+ "disable-child-theme": !0,
2939
+ ...b,
2940
+ children: g
2941
+ });
2942
+ if (p) {
2943
+ const N = p.Provider, y = te.useContext(p);
2944
+ S = /* @__PURE__ */ w(N, {
2945
+ ...y,
2946
+ ...f,
2947
+ children: S
2948
+ });
2949
+ }
2950
+ return S;
2951
+ });
2952
+ return o.displayName = `Themed(${(e == null ? void 0 : e.displayName) || (e == null ? void 0 : e.name) || "Anonymous"})`, o;
2953
+ }
2954
+ function Sl(e) {
2955
+ if (e.length) return /* @__PURE__ */ w(Cn, {
2956
+ children: e.map((t) => {
2957
+ const n = t[it];
2958
+ return /* @__PURE__ */ w("style", {
2959
+ href: `t_${n}`,
2960
+ precedence: "default",
2961
+ suppressHydrationWarning: !0,
2962
+ children: t[In].join(`
2963
+ `)
2964
+ }, n);
2965
+ })
2966
+ });
2967
+ }
2968
+ const vl = (e, t, n, o) => {
2969
+ "use no memo";
2970
+ var ae;
2971
+ const r = mi(), s = !fl(), i = t != null && t.isStub || t == null ? void 0 : t.useAnimations, {
2972
+ isHOC: a
2973
+ } = n, l = jt(
2974
+ // performance: avoid creating object every render
2975
+ void 0
2976
+ );
2977
+ l.current || (l.current = {
2978
+ startedUnhydrated: s && !r
2979
+ });
2980
+ const d = !!(!a && "transition" in e || e.style && El(e.style)), u = (t == null ? void 0 : t.inputStyle) ?? "css", c = (t == null ? void 0 : t.outputStyle) ?? "css", m = l.current;
2981
+ !s && d && (m.hasAnimated = !0);
2982
+ const f = !!(d && !a && i || m.hasAnimated), p = !On && f;
2983
+ p && !m.hasAnimated && (m.hasAnimated = !0);
2984
+ const {
2985
+ disableClassName: g
2986
+ } = e, b = !a && p && e.animatePresence !== !1 && ((ae = t == null ? void 0 : t.usePresence) == null ? void 0 : ae.call(t)) || null, h = b == null ? void 0 : b[2], S = (h == null ? void 0 : h.isPresent) === !1, N = (h == null ? void 0 : h.isPresent) === !0 && h.initial !== !1, y = !!e.enterStyle, $ = d && !r && ((t == null ? void 0 : t.isReactNative) || u !== "css"), M = !a && (y || N || $ || // disableClassName doesnt work server side, only client, so needs hydrate
2987
+ // this is just for a better ux, supports css variables for light/dark, media queries, etc
2988
+ g) ? (
2989
+ // on the very first render we switch all spring animation drivers to css rendering
2990
+ // this is because we need to use css variables, which they don't support to do proper SSR
2991
+ // without flickers of the wrong colors.
2992
+ // but once we do that initial hydration and we are in client side rendering mode,
2993
+ // we can avoid the extra re-render on mount
2994
+ y || N ? wa : tr
2995
+ ) : xo, K = Nl(e);
2996
+ K != null && (M.disabled = K);
2997
+ const C = us(M), A = e.forceStyle ? {
2998
+ ...C[0],
2999
+ [e.forceStyle]: !0
3000
+ } : C[0], T = C[1];
3001
+ let P = p;
3002
+ $ && !n.isHOC && !r && (P = !1, m.willHydrate = !0), K !== A.disabled && (K && Object.assign(A, xo), A.disabled = K, T((de) => ({
3003
+ ...A
3004
+ })));
3005
+ const B = e.group, k = Vi(T, e.debug);
3006
+ if (h && P && r && n.variants) {
3007
+ process.env.NODE_ENV === "development" && e.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(h)}`);
3008
+ const {
3009
+ enterVariant: de,
3010
+ exitVariant: Y,
3011
+ enterExitVariant: he,
3012
+ custom: Re
3013
+ } = h;
3014
+ Mn(Re) && Object.assign(e, Re);
3015
+ const ke = Y ?? he, E = de ?? he;
3016
+ A.unmounted && E && n.variants[E] ? (process.env.NODE_ENV === "development" && e.debug === "verbose" && console.warn(`Animating presence ENTER "${E}"`), e[E] = !0) : S && ke && (process.env.NODE_ENV === "development" && e.debug === "verbose" && console.warn(`Animating presence EXIT "${ke}"`), e[ke] = Y !== he);
3017
+ }
3018
+ let W = !!e.forceStyle;
3019
+ if (!r) W = !1;
3020
+ else if (r) {
3021
+ const de = P && r, Y = !n.acceptsClassName && (we("disableSSR") || !A.unmounted), he = g && !A.unmounted;
3022
+ (de && c !== "css" || he || Y) && (W = !0, process.env.NODE_ENV === "development" && e.debug === "verbose" && G("avoiding className", {
3023
+ isAnimatedAndHydrated: de,
3024
+ isDisabledManually: he,
3025
+ isClassNameDisabled: Y
3026
+ }));
3027
+ }
3028
+ return {
3029
+ startedUnhydrated: m.startedUnhydrated,
3030
+ curStateRef: m,
3031
+ disabled: K,
3032
+ groupName: B,
3033
+ hasAnimationProp: d,
3034
+ hasEnterStyle: y,
3035
+ isAnimated: P,
3036
+ isExiting: S,
3037
+ isHydrated: r,
3038
+ presence: b,
3039
+ presenceState: h,
3040
+ setState: T,
3041
+ setStateShallow: k,
3042
+ noClass: W,
3043
+ state: A,
3044
+ stateRef: l,
3045
+ inputStyle: u,
3046
+ outputStyle: c,
3047
+ willBeAnimated: p,
3048
+ willBeAnimatedClient: f
3049
+ };
3050
+ };
3051
+ function El(e) {
3052
+ return Object.keys(e).some((t) => {
3053
+ const n = e[t];
3054
+ return n && typeof n == "object" && "_animation" in n;
3055
+ });
3056
+ }
3057
+ const Nl = (e) => {
3058
+ var t;
3059
+ return e.disabled || e.passThrough || ((t = e.accessibilityState) == null ? void 0 : t.disabled) || e["aria-disabled"] || e.accessibilityDisabled || !1;
3060
+ }, Tl = wi(hs(function(e, t) {
3061
+ const {
3062
+ children: n,
3063
+ ...o
3064
+ } = e;
3065
+ if (Wo(n)) {
3066
+ const r = xl(n, o);
3067
+ return yn(n, n.type.avoidForwardRef ? r : {
3068
+ ...r,
3069
+ ref: er(t, n.props.ref)
3070
+ });
3071
+ }
3072
+ return bn.count(n) > 1 ? bn.only(null) : null;
3073
+ })), ln = {
3074
+ onPress: "onClick",
3075
+ onPressOut: "onMouseUp",
3076
+ onPressIn: "onMouseDown"
3077
+ };
3078
+ function xl(e, t) {
3079
+ const n = e.props, o = typeof e.type == "string";
3080
+ if (o) for (const s in ln) s in t && (t[ln[s]] = t[s], delete t[s]);
3081
+ const r = fi(t, n);
3082
+ if (o) for (const s in ln) s in r && (r[ln[s]] = r[s], delete r[s]);
3083
+ return r;
3084
+ }
3085
+ let I, gt, mn;
3086
+ const vt = /* @__PURE__ */ new Set(), wl = /* @__PURE__ */ new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
3087
+ if (typeof window < "u") {
3088
+ const e = () => {
3089
+ vt.forEach((n) => n((o) => o.press || o.pressIn ? {
3090
+ ...o,
3091
+ press: !1,
3092
+ pressIn: !1
3093
+ } : o)), vt.clear();
3094
+ }, t = () => {
3095
+ vt.forEach((n) => n((o) => o.press || o.pressIn || o.hover ? {
3096
+ ...o,
3097
+ press: !1,
3098
+ pressIn: !1,
3099
+ hover: !1
3100
+ } : o)), vt.clear();
3101
+ };
3102
+ addEventListener("mouseup", e), addEventListener("touchend", t), addEventListener("touchcancel", t), process.env.NODE_ENV === "development" && (mn = () => {
3103
+ });
3104
+ }
3105
+ const ot = {
3106
+ value: !1
3107
+ }, Io = {
3108
+ value: !1
3109
+ };
3110
+ typeof document < "u" && (document.addEventListener("keydown", () => {
3111
+ ot.value || (ot.value = !0);
3112
+ }), document.addEventListener("mousedown", () => {
3113
+ ot.value && (ot.value = !1);
3114
+ }), document.addEventListener("mousemove", () => {
3115
+ ot.value && (ot.value = !1), Io.value = !1;
3116
+ }), document.addEventListener("touchstart", () => {
3117
+ Io.value = !0;
3118
+ }));
3119
+ function gi(e) {
3120
+ let t = null;
3121
+ const {
3122
+ Component: n,
3123
+ isText: o,
3124
+ isHOC: r
3125
+ } = e, s = te.forwardRef((u, c) => {
3126
+ "use no memo";
3127
+ var pr, gr, br, yr;
3128
+ t = t || De();
3129
+ const m = process.env.NODE_ENV === "development" ? te.useId() : "";
3130
+ process.env.NODE_ENV === "development" && mn && (mn(), mn = void 0), process.env.NODE_ENV === "test" && u["data-test-renders"] && (u["data-test-renders"].current = u["data-test-renders"].current ?? 0, u["data-test-renders"].current += 1);
3131
+ const {
3132
+ context: f,
3133
+ isReactNative: p
3134
+ } = e, g = u.debug, b = f ? te.useContext(f) : void 0;
3135
+ let h = null;
3136
+ const S = te.useContext(un), N = !!(o && S.inText);
3137
+ !process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && g === "profile" && !I && (I = require("@tamagui/timer").timer().start(), globalThis.time = I), process.env.NODE_ENV === "development" && !I && globalThis.time && (I = globalThis.time), process.env.NODE_ENV === "development" && I && I`non-tamagui time (ignore)`;
3138
+ let y = u;
3139
+ const $ = y.componentName || e.componentName, M = nr(e, y.componentName), [K, C] = Ii(M, b, u);
3140
+ y = K, h = C, process.env.NODE_ENV === "development" && St && te.useEffect(() => {
3141
+ let v, _ = null;
3142
+ const L = () => {
3143
+ var U;
3144
+ if (_) try {
3145
+ (U = _.parentNode) == null || U.removeChild(_), _ = null;
3146
+ } catch {
3147
+ }
3148
+ }, j = (U = !1) => {
3149
+ if (v = O.current.host, !!v) if (U) {
3150
+ _ || (_ = document.createElement("span"), _.style.inset = "0px", _.style.zIndex = "1000000", _.style.position = "absolute", _.style.borderColor = "red", _.style.borderWidth = "1px", _.style.borderStyle = "dotted");
3151
+ const J = v.getAttribute("data-at") || "", et = v.getAttribute("data-in") || "", ue = document.createElement("span");
3152
+ ue.style.position = "absolute", ue.style.top = "0px", ue.style.left = "0px", ue.style.padding = "3px", ue.style.background = "rgba(0,0,0,0.75)", ue.style.color = "rgba(255,255,255,1)", ue.style.fontSize = "12px", ue.style.lineHeight = "12px", ue.style.fontFamily = "monospace", ue.innerText = `${$ || ""} ${J} ${et}`.trim(), _.appendChild(ue), v.appendChild(_);
3153
+ } else L();
3154
+ };
3155
+ return gt = gt || /* @__PURE__ */ new Set(), gt.add(j), () => {
3156
+ L(), gt == null || gt.delete(j);
3157
+ };
3158
+ }, [$]);
3159
+ const A = te.useContext(Nr), T = y.animatedBy && t ? t.animationDrivers ? t.animationDrivers[y.animatedBy] ?? t.animations : y.animatedBy === "default" ? t.animations : null : Nn(S.animationDriver) ?? Nn(t == null ? void 0 : t.animations) ?? null, P = T == null ? void 0 : T.useAnimations, B = vl(y, T != null && T.isStub ? null : T, e), {
3160
+ disabled: k,
3161
+ groupName: W,
3162
+ hasAnimationProp: ae,
3163
+ hasEnterStyle: de,
3164
+ isAnimated: Y,
3165
+ isExiting: he,
3166
+ isHydrated: Re,
3167
+ presence: ke,
3168
+ presenceState: E,
3169
+ setState: Le,
3170
+ noClass: ve,
3171
+ state: H,
3172
+ stateRef: O,
3173
+ inputStyle: Ue,
3174
+ outputStyle: Dn,
3175
+ willBeAnimated: ct,
3176
+ willBeAnimatedClient: Ze,
3177
+ startedUnhydrated: Ie
3178
+ } = B;
3179
+ ae && (T != null && T.avoidReRenders) && Ae(() => {
3180
+ const v = O.current.nextState;
3181
+ v && (O.current.nextState = void 0, B.setStateShallow(v));
3182
+ });
3183
+ const _e = _i(() => {
3184
+ var _, L;
3185
+ if (!W || y.passThrough) return A;
3186
+ const v = /* @__PURE__ */ new Set();
3187
+ return (L = (_ = O.current.group) == null ? void 0 : _.listeners) == null || L.clear(), O.current.group = {
3188
+ listeners: v,
3189
+ emit(j) {
3190
+ v.forEach((U) => U(j));
3191
+ },
3192
+ subscribe(j) {
3193
+ return v.add(j), v.size === 1 && me({
3194
+ hasDynGroupChildren: !0
3195
+ }), () => {
3196
+ v.delete(j), v.size === 0 && me({
3197
+ hasDynGroupChildren: !1
3198
+ });
3199
+ };
3200
+ }
3201
+ }, {
3202
+ ...A,
3203
+ [W]: {
3204
+ state: {
3205
+ pseudo: xo
3206
+ },
3207
+ subscribe: (j) => {
3208
+ var J;
3209
+ const U = (J = O.current.group) == null ? void 0 : J.subscribe(j);
3210
+ return () => {
3211
+ U == null || U();
3212
+ };
3213
+ }
3214
+ }
3215
+ };
3216
+ }, [O, W, A]);
3217
+ let me = B.setStateShallow;
3218
+ process.env.NODE_ENV === "development" && I && I`use-state`;
3219
+ const qe = y.render, ut = (!n || typeof n == "string") && qe || n, _t = o ? ut || "span" : ut || (N ? "span" : "div");
3220
+ let F = _t;
3221
+ T && Y && T.needsCustomComponent && (F = T[o ? "Text" : "View"] || F);
3222
+ const x = y["data-disable-theme"] || r;
3223
+ process.env.NODE_ENV === "development" && I && I`theme-props`;
3224
+ const V = {
3225
+ componentName: $,
3226
+ disable: x,
3227
+ shallow: y.themeShallow,
3228
+ debug: g,
3229
+ unstyled: y.unstyled
3230
+ };
3231
+ if ("theme" in y && (V.name = y.theme), V.needsUpdate = () => !!O.current.isListeningToTheme, process.env.NODE_ENV === "development" && g && g !== "profile") {
3232
+ const v = `${$ || (n == null ? void 0 : n.displayName) || (n == null ? void 0 : n.name) || "[Unnamed Component]"}`, _ = (de ? "(hasEnter)" : " ") + (Y ? "(animated)" : " ") + (p ? "(rnw)" : " ") + (ve ? "(noClass)" : " ") + (H.press || H.pressIn ? "(PRESSED)" : " ") + (H.hover ? "(HOVERED)" : " ") + (H.focus ? "(FOCUSED)" : " ") + (H.focusWithin ? "(WITHIN FOCUSED)" : " ") + ((E == null ? void 0 : E.isPresent) === !1 ? "(EXIT)" : ""), L = u["data-is"] || "", j = `<${v} /> ${m} ${L ? ` ${L}` : ""} ${_.trim()} (hydrated: ${Re}) (unmounted: ${H.unmounted})`, U = u.children;
3233
+ let J = typeof U == "string" ? U.length > 4 ? U.slice(0, 4) + "..." : U : "";
3234
+ J.length && (J = `(children: ${J})`), console.info(`%c ${j}`, "background: green; color: white;"), On ? G({
3235
+ noClass: ve,
3236
+ isAnimated: Y,
3237
+ isWeb: Et,
3238
+ inputStyle: Ue
3239
+ }) : (console.groupEnd(), console.groupCollapsed(`${J} [inspect props, state, context 👇]`), G("props in:", u), G("final props:", y, Object.keys(y)), G({
3240
+ state: H,
3241
+ staticConfig: e,
3242
+ elementType: F,
3243
+ themeStateProps: V
3244
+ }), G({
3245
+ context: f,
3246
+ overriddenContextProps: h,
3247
+ componentContext: S
3248
+ }), G({
3249
+ presence: ke,
3250
+ isAnimated: Y,
3251
+ isHOC: r,
3252
+ hasAnimationProp: ae,
3253
+ useAnimations: P
3254
+ }), console.groupEnd());
3255
+ }
3256
+ process.env.NODE_ENV === "development" && I && I`pre-theme-media`;
3257
+ const [ne, oe] = Zs(V);
3258
+ process.env.NODE_ENV === "development" && I && I`theme`, F = ut || F;
3259
+ const Be = typeof F == "string", ie = ea(S, g);
3260
+ Qo(!1), process.env.NODE_ENV === "development" && I && I`media`;
3261
+ const se = (
3262
+ // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
3263
+ Y && Ue !== "css" || r && H.unmounted == !1 && ae ? "value" : "auto"
3264
+ ), le = {
3265
+ mediaState: ie,
3266
+ noClass: ve,
3267
+ resolveValues: se,
3268
+ isExiting: he,
3269
+ isAnimated: Y,
3270
+ willBeAnimated: ct,
3271
+ styledContext: b
3272
+ }, Fe = (oe == null ? void 0 : oe.name) || "";
3273
+ process.env.NODE_ENV === "development" && I && I`split-styles-prepare`;
3274
+ const D = tl(y, e, ne, Fe, H, le, null, S, _e, F, Ie, g, T), Je = !D;
3275
+ let dt = e.context;
3276
+ if (D != null && D.overriddenContextProps) {
3277
+ const v = e.context || ((pr = e.parentStaticConfig) == null ? void 0 : pr.context);
3278
+ if (v) {
3279
+ for (const _ in D.overriddenContextProps) h = h || {}, h[_] = D.overriddenContextProps[_];
3280
+ e.context || (dt = v);
3281
+ }
3282
+ }
3283
+ const Ee = W && (_e == null ? void 0 : _e[W]) || null;
3284
+ if (!Je && Ee && // avoids onLayout if we don't need it
3285
+ y.containerType !== "normal") {
3286
+ const v = Ee == null ? void 0 : Ee.state;
3287
+ v && v.layout === void 0 && ((gr = D.style) != null && gr.width || (br = D.style) != null && br.height) && (v.layout = {
3288
+ width: es(D.style.width),
3289
+ height: es(D.style.height)
3290
+ });
3291
+ }
3292
+ const qt = y.transition && typeof y.transition == "object" && !Array.isArray(y.transition) && ("enter" in y.transition || "exit" in y.transition);
3293
+ if (!Je && (ae || W) && (T != null && T.avoidReRenders) && !qt) {
3294
+ let v = function() {
3295
+ const L = O.current.nextState;
3296
+ if (Ee) {
3297
+ const {
3298
+ group: j,
3299
+ hasDynGroupChildren: U,
3300
+ unmounted: J,
3301
+ transition: et,
3302
+ ...ue
3303
+ } = L;
3304
+ i(Ee, O.current.group || null, ue);
3305
+ }
3306
+ };
3307
+ const _ = me;
3308
+ if (O.current.updateStyleListener = () => {
3309
+ const L = O.current.useStyleListener;
3310
+ if (!L) {
3311
+ const ue = O.current.nextState;
3312
+ ue && (O.current.nextState = void 0, _(ue));
3313
+ return;
3314
+ }
3315
+ const j = O.current.nextState || H, U = O.current.nextMedia, J = ui(y, e, ne, Fe, j, U ? {
3316
+ ...le,
3317
+ mediaState: U
3318
+ } : le, null, S, _e, F, Ie, g, T), et = Zr(O.current.prevPseudoState, j, J == null ? void 0 : J.pseudoTransitions, y.transition);
3319
+ O.current.prevPseudoState = qr(j), L((J == null ? void 0 : J.style) || {}, et);
3320
+ }, S.mediaEmitListeners = S.mediaEmitListeners || /* @__PURE__ */ new Set(), !O.current.mediaEmitCleanup) {
3321
+ const L = (j) => {
3322
+ var U, J;
3323
+ O.current.nextMedia = j, (J = (U = O.current).updateStyleListener) == null || J.call(U);
3324
+ };
3325
+ S.mediaEmitListeners.add(L), O.current.mediaEmitCleanup = () => {
3326
+ var j;
3327
+ (j = S.mediaEmitListeners) == null || j.delete(L);
3328
+ };
3329
+ }
3330
+ S.mediaEmit = S.mediaEmit || ((L) => {
3331
+ for (const j of S.mediaEmitListeners) j(L);
3332
+ }), O.current.setStateShallow = (L) => {
3333
+ var ue, Sr;
3334
+ const j = O.current.nextState || H, U = typeof L == "function" ? L(j) : L;
3335
+ if (U === j || ys(j, U)) return;
3336
+ const J = Object.keys(U).every((Ei) => wl.has(Ei)), et = {
3337
+ ...j,
3338
+ ...U
3339
+ };
3340
+ O.current.nextState = et, J ? (process.env.NODE_ENV === "development" && g && g !== "profile" && (console.groupCollapsed("[⚡️] avoid setState", $, U, {
3341
+ updatedState: et,
3342
+ props: y
3343
+ }), console.info(O.current.host), console.groupEnd()), v(), (Sr = (ue = O.current).updateStyleListener) == null || Sr.call(ue)) : (process.env.NODE_ENV === "development" && g && g !== "profile" && console.info("[🐌] re-render", {
3344
+ canAvoidReRender: J,
3345
+ next: U
3346
+ }), _(U));
3347
+ }, me = (L) => {
3348
+ var j, U;
3349
+ (U = (j = O.current).setStateShallow) == null || U.call(j, L);
3350
+ };
3351
+ }
3352
+ process.env.NODE_ENV === "development" && I && I`split-styles`, D && (y.group && y.untilMeasured === "hide" && !O.current.hasMeasured && (D.style = D.style || {}, D.style.opacity = 0), D.dynamicThemeAccess != null && (O.current.isListeningToTheme = D.dynamicThemeAccess));
3353
+ const R = (D == null ? void 0 : D.hasMedia) && D.hasMedia !== !0, Q = pa() || R || ve && (D == null ? void 0 : D.hasMedia) === !0, $t = R ? D.hasMedia : null;
3354
+ process.env.NODE_ENV === "development" && g === "verbose" && console.info("useMedia() createComponent", Q, $t), Ji(S, Q, $t);
3355
+ const {
3356
+ viewProps: Jt,
3357
+ pseudos: re,
3358
+ style: Ge,
3359
+ classNames: Qt,
3360
+ pseudoGroups: Qe,
3361
+ mediaGroups: ee
3362
+ } = D || {}, Ve = y, {
3363
+ asChild: Ne,
3364
+ children: $e,
3365
+ themeShallow: ye,
3366
+ spaceDirection: Z,
3367
+ onPress: ce,
3368
+ onLongPress: pe,
3369
+ onPressIn: z,
3370
+ onPressOut: q,
3371
+ onHoverIn: ge,
3372
+ onHoverOut: Pe,
3373
+ onMouseUp: Me,
3374
+ onMouseDown: We,
3375
+ onMouseEnter: be,
3376
+ onMouseLeave: Ce,
3377
+ onFocus: je,
3378
+ onBlur: ft,
3379
+ separator: Gc,
3380
+ // ignore from here on out
3381
+ passThrough: cr,
3382
+ forceStyle: Kc,
3383
+ // @ts-ignore for next/link compat etc
3384
+ onClick: en,
3385
+ theme: ur,
3386
+ ...Ct
3387
+ } = Jt || {};
3388
+ let fe = Ct;
3389
+ y.forceStyle && (fe.forceStyle = y.forceStyle), r && (typeof ur < "u" && (fe.theme = ur), typeof cr < "u" && (fe.passThrough = cr));
3390
+ let Pn;
3391
+ const vi = (
3392
+ // if it supports css vars we run it on server too to get matching initial style
3393
+ (Ue === "css" ? Ze : ct) && P && !r
3394
+ );
3395
+ let dr;
3396
+ if (vi) {
3397
+ const v = T != null && T.avoidReRenders ? (j) => {
3398
+ O.current.useStyleListener = j;
3399
+ } : void 0, _ = Zr(O.current.prevPseudoState, H, D == null ? void 0 : D.pseudoTransitions, y.transition);
3400
+ D && (D.effectiveTransition = _), O.current.prevPseudoState = qr(H);
3401
+ const L = P({
3402
+ props: Ve,
3403
+ // clone style to prevent animation driver mutations from leaking to viewProps
3404
+ // during SSR/pre-hydration (CSS driver mutates style.transition in place)
3405
+ style: Re ? Ge || {} : {
3406
+ ...Ge
3407
+ },
3408
+ // @ts-ignore
3409
+ styleState: D,
3410
+ useStyleEmitter: v,
3411
+ presence: ke,
3412
+ componentState: H,
3413
+ styleProps: le,
3414
+ theme: ne,
3415
+ themeName: Fe,
3416
+ pseudos: re || null,
3417
+ staticConfig: e,
3418
+ stateRef: O
3419
+ });
3420
+ L && (L.ref && (dr = L.ref), Re && L && (Pn = L.style, fe.style = Pn, L.className && (fe.className = `${H.unmounted === "should-enter" ? "t_unmounted " : ""}${fe.className || ""} ${L.className}`))), process.env.NODE_ENV === "development" && I && I`animations`;
3421
+ }
3422
+ process.env.NODE_ENV === "development" && y.untilMeasured && !y.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
3423
+
3424
+ If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && I && I`destructure`, !Je && Ee && // avoids onLayout if we don't need it
3425
+ y.containerType !== "normal" && (Ct.onLayout = Ko(Ct.onLayout, (v) => {
3426
+ var L;
3427
+ const _ = v.nativeEvent.layout;
3428
+ Ee.state.layout = _, (L = O.current.group) == null || L.emit({
3429
+ layout: _
3430
+ }), !O.current.hasMeasured && y.untilMeasured === "hide" && Le((j) => ({
3431
+ ...j
3432
+ })), O.current.hasMeasured = !0;
3433
+ })), fe = ((yr = ze.usePropsTransform) == null ? void 0 : yr.call(ze, F, Ct, O, O.current.willHydrate)) || Ct, O.current.composedRef || (O.current.composedRef = er((v) => O.current.host = v, c, cl, dr)), fe.ref = O.current.composedRef, process.env.NODE_ENV === "development" && !p && !o && Et && !r && te.Children.toArray(y.children).forEach((v) => {
3434
+ typeof v == "string" && v !== `
3435
+ ` && console.error(`Unexpected text node: ${v}. A text node cannot be a child of a <${e.componentName || u.tag || "View"}>.`, y);
3436
+ }), process.env.NODE_ENV === "development" && I && I`events-hooks`;
3437
+ const fr = () => {
3438
+ me({
3439
+ press: !1,
3440
+ pressIn: !1
3441
+ });
3442
+ };
3443
+ process.env.NODE_ENV === "development" && Et && Ae(() => {
3444
+ if (g === "verbose") {
3445
+ let v = function(L) {
3446
+ const j = {};
3447
+ for (let U = 0; U < L.length; U++) {
3448
+ let J = L[U];
3449
+ j[J] = L.getPropertyValue(J);
3450
+ }
3451
+ return j;
3452
+ };
3453
+ const _ = O.current.host ? v(getComputedStyle(O.current.host)) : {};
3454
+ console.groupCollapsed(`Rendered > (opacity: ${_.opacity})`), console.warn(O.current.host), console.warn(_), console.groupEnd();
3455
+ }
3456
+ }), Ae(() => {
3457
+ if (H.unmounted === !0 && de) {
3458
+ me({
3459
+ unmounted: "should-enter"
3460
+ });
3461
+ return;
3462
+ }
3463
+ if (H.unmounted) {
3464
+ if (Ue === "css") {
3465
+ let v = !1;
3466
+ return requestAnimationFrame(() => {
3467
+ v || requestAnimationFrame(() => {
3468
+ v || me({
3469
+ unmounted: !1
3470
+ });
3471
+ });
3472
+ }), () => {
3473
+ v = !0;
3474
+ };
3475
+ }
3476
+ me({
3477
+ unmounted: !1
3478
+ });
3479
+ }
3480
+ return () => {
3481
+ var v, _;
3482
+ vt.delete(Le), (_ = (v = O.current).mediaEmitCleanup) == null || _.call(v);
3483
+ };
3484
+ }, [H.unmounted, Ue]), Ae(() => {
3485
+ if (!k && !(!Qe && !ee) && _e) return ul({
3486
+ groupContext: _e,
3487
+ setStateShallow: me,
3488
+ mediaGroups: ee,
3489
+ pseudoGroups: Qe
3490
+ });
3491
+ }, [_e, k, Qe ? ho(Qe) : 0, ee ? ho(ee) : 0]);
3492
+ const kn = O.current.group;
3493
+ Ae(() => {
3494
+ !Ee || !kn || i(Ee, kn, H);
3495
+ }, [Ee, kn, H]);
3496
+ const At = !k && ve && (re == null ? void 0 : re.pressStyle), Ln = !k && ve && (re == null ? void 0 : re.focusStyle), mr = !k && ve && (re == null ? void 0 : re.focusVisibleStyle), Bn = !!(At || Ln || mr || je || ft || S.setParentFocusState), tn = !!(W && H.hasDynGroupChildren), Ke = !!(tn || At || ce || q || z || We || Me || pe || en || re != null && re.focusVisibleStyle), Wn = !k && ve && (re == null ? void 0 : re.hoverStyle), nn = !!(tn || Wn), on = !!(tn || nn || be || Ce), jn = !k && !y.asChild && !!(Bn || Ke || on || At || Wn || Ln), zn = !!(tn || At);
3497
+ process.env.NODE_ENV === "development" && I && I`events-setup`, process.env.NODE_ENV === "development" && g === "verbose" && G("🪩 events()", {
3498
+ runtimeFocusStyle: Ln,
3499
+ runtimePressStyle: At,
3500
+ runtimeHoverStyle: Wn,
3501
+ runtimeFocusVisibleStyle: mr,
3502
+ attachPress: Ke,
3503
+ attachFocus: Bn,
3504
+ attachHover: on,
3505
+ shouldAttach: jn,
3506
+ needsHoverState: nn,
3507
+ pseudos: re
3508
+ });
3509
+ const mt = jn ? {
3510
+ onPressOut: Ke ? (v) => {
3511
+ fr(), q == null || q(v), Me == null || Me(v);
3512
+ } : void 0,
3513
+ ...(on || Ke) && {
3514
+ onMouseEnter: (v) => {
3515
+ const _ = {};
3516
+ nn && !Io.value && (_.hover = !0), zn && H.pressIn && (_.press = !0), me(_), ge == null || ge(v), be == null || be(v);
3517
+ },
3518
+ onMouseLeave: (v) => {
3519
+ const _ = {};
3520
+ nn && (_.hover = !1), zn && (_.press = !1, _.pressIn = !1), me(_), Pe == null || Pe(v), Ce == null || Ce(v);
3521
+ }
3522
+ },
3523
+ onPressIn: Ke ? (v) => {
3524
+ zn && me({
3525
+ press: !0,
3526
+ pressIn: !0
3527
+ }), z == null || z(v), We == null || We(v), vt.add(Le);
3528
+ } : void 0,
3529
+ onPress: Ke ? (v) => {
3530
+ fr(), en == null || en(v), ce == null || ce(v), pe == null || pe(v);
3531
+ } : void 0,
3532
+ ...Bn && {
3533
+ onFocus: (v) => {
3534
+ const _ = {};
3535
+ S.setParentFocusState && (_.focusWithin = !0), re != null && re.focusVisibleStyle && ot.value ? _.focusVisible = !0 : _.focus = !0, me(_), je == null || je(v);
3536
+ },
3537
+ onBlur: (v) => {
3538
+ S.setParentFocusState && S.setParentFocusState({
3539
+ focusWithin: !1
3540
+ }), me({
3541
+ focus: !1,
3542
+ focusVisible: !1,
3543
+ focusWithin: !1
3544
+ }), ft == null || ft(v);
3545
+ }
3546
+ }
3547
+ } : null;
3548
+ if (mt && !p && Object.assign(fe, eo(mt)), process.env.NODE_ENV === "development" && I && I`events`, process.env.NODE_ENV === "development" && g === "verbose" && G("events", {
3549
+ events: mt,
3550
+ attachHover: on,
3551
+ attachPress: Ke
3552
+ }), process.env.NODE_ENV === "development" && I && I`hooks`, Ne) {
3553
+ F = Tl;
3554
+ {
3555
+ const v = eo({
3556
+ onPress: ce,
3557
+ onPressIn: z,
3558
+ onPressOut: q,
3559
+ onMouseEnter: be,
3560
+ onMouseLeave: Ce
3561
+ }, Ne === "web" || Ne === "except-style-web");
3562
+ Object.assign(fe, v);
3563
+ }
3564
+ }
3565
+ process.env.NODE_ENV === "development" && I && I`spaced-as-child`;
3566
+ let X;
3567
+ if (Je) X = te.createElement(_t, {
3568
+ style: {
3569
+ display: "contents"
3570
+ }
3571
+ }, u.children);
3572
+ else {
3573
+ ze.useChildren && (X = ze.useChildren(F, X || $e, fe));
3574
+ const v = typeof qe == "string";
3575
+ if (qe && !v) {
3576
+ const _ = _l(qe, X || $e, fe, B);
3577
+ _ && (fe = _.viewProps, F = _.elementType);
3578
+ }
3579
+ X || (v && fe.render, X = te.createElement(F, fe, X || $e)), process.env.NODE_ENV === "development" && I && I`use-children`;
3580
+ }
3581
+ const Un = T == null ? void 0 : T.ResetPresence, Gn = !!// not when passing down to child
3582
+ (!Ne && // not when passThrough
3583
+ D && // not when HOC
3584
+ !r && Un && ct && (de || E)), hr = O.current.hasEverResetPresence;
3585
+ if (Gn && !hr && (O.current.hasEverResetPresence = !0), (Gn || hr) && Un && (X = /* @__PURE__ */ w(Un, {
3586
+ disabled: !Gn,
3587
+ children: X
3588
+ })), process.env.NODE_ENV === "development" && I && I`create-element`, "focusWithinStyle" in u && (X = /* @__PURE__ */ w(un.Provider, {
3589
+ ...S,
3590
+ setParentFocusState: me,
3591
+ children: X
3592
+ })), "group" in y && (X = /* @__PURE__ */ w(Nr.Provider, {
3593
+ value: _e,
3594
+ children: X
3595
+ })), !Ne && o && !N && (X = /* @__PURE__ */ w(un.Provider, {
3596
+ ...S,
3597
+ inText: !0,
3598
+ children: X
3599
+ })), process.env.NODE_ENV === "development" && I && I`group-context`, X = x || !D ? X : pi(oe, X, V, !1, O), process.env.NODE_ENV === "development" && I && I`themed-children`, p && !Ne && (X = /* @__PURE__ */ w("span", {
3600
+ className: "_dsp_contents",
3601
+ ...!Je && Re && mt && eo(mt),
3602
+ children: X
3603
+ })), h && dt) {
3604
+ const v = dt.Provider;
3605
+ for (const _ in b) _ in h || (h[_] = b[_]);
3606
+ X = /* @__PURE__ */ w(v, {
3607
+ __disableMergeDefaultValues: !0,
3608
+ ...h,
3609
+ children: X
3610
+ });
3611
+ }
3612
+ if (process.env.NODE_ENV === "development" && I && I`context-override`, Ie && D && (X = /* @__PURE__ */ Xe(Cn, {
3613
+ children: [X, Re ? null : Sl(Object.values(D.rulesToInsert))]
3614
+ })), process.env.NODE_ENV === "development" && I && I`style-tags`, process.env.NODE_ENV === "development" && g && g !== "profile") {
3615
+ const v = `render <${typeof F == "string" ? F : "Component"} /> (${m}) with props`;
3616
+ if (St) {
3617
+ console.groupCollapsed(v);
3618
+ try {
3619
+ G("viewProps", fe), G("children", X), typeof window < "u" && G({
3620
+ propsIn: u,
3621
+ props: y,
3622
+ attachPress: Ke,
3623
+ animationStyles: Pn,
3624
+ classNames: Qt,
3625
+ content: X,
3626
+ elementType: F,
3627
+ events: mt,
3628
+ isAnimated: Y,
3629
+ hasRuntimeMediaKeys: R,
3630
+ isStringElement: Be,
3631
+ mediaListeningKeys: $t,
3632
+ pseudos: re,
3633
+ shouldAttach: jn,
3634
+ noClass: ve,
3635
+ shouldListenForMedia: Q,
3636
+ splitStyles: D,
3637
+ splitStylesStyle: Ge,
3638
+ state: H,
3639
+ stateRef: O,
3640
+ staticConfig: e,
3641
+ styleProps: le,
3642
+ themeState: oe,
3643
+ viewProps: fe,
3644
+ willBeAnimated: ct,
3645
+ startedUnhydrated: Ie
3646
+ });
3647
+ } catch {
3648
+ } finally {
3649
+ console.groupEnd();
3650
+ }
3651
+ } else {
3652
+ G(v), G("state: ", H), To && G("viewProps", fe), G("final styles:");
3653
+ for (const _ in Ge) G(_, Ge[_]);
3654
+ }
3655
+ }
3656
+ return process.env.NODE_ENV === "development" && I && (I`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
3657
+ delete globalThis.willPrint, I.print(), I = null;
3658
+ }, 50))), X;
3659
+ });
3660
+ function i(u, c, m) {
3661
+ if (!u || !c) return;
3662
+ const f = {
3663
+ ...u.state,
3664
+ pseudo: m
3665
+ };
3666
+ c.emit(f), u.state = f;
3667
+ }
3668
+ e.componentName && (s.displayName = e.componentName);
3669
+ let a = s;
3670
+ a = te.memo(a), a.staticConfig = e;
3671
+ function l(u) {
3672
+ return {
3673
+ ...e,
3674
+ ...u,
3675
+ neverFlatten: !0,
3676
+ isHOC: !0,
3677
+ isStyledHOC: !1
3678
+ };
3679
+ }
3680
+ function d(u, c) {
3681
+ let m = typeof u == "function" && u.length === 1 ? u : te.forwardRef(u);
3682
+ const f = l(c == null ? void 0 : c.staticConfig);
3683
+ return m = c != null && c.disableTheme ? m : yl(m, f, !0), (f.memo || process.env.TAMAGUI_MEMOIZE_STYLEABLE) && (m = te.memo(m)), m.staticConfig = f, m.styleable = d, m;
3684
+ }
3685
+ return a.styleable = d, a;
3686
+ }
3687
+ const es = (e) => typeof e == "number" ? e : typeof e == "string" ? +e.replace("px", "") : 0, _l = (e, t, n, o) => {
3688
+ if (typeof e == "function" && (e = e(n, o)), e && typeof e == "object" && te.isValidElement(e) && e) {
3689
+ const r = e.props, s = r ? al(r, n, t) : n;
3690
+ return {
3691
+ elementType: e.type,
3692
+ viewProps: s
3693
+ };
3694
+ }
3695
+ }, Fo = (e) => {
3696
+ process.env.TAMAGUI_DID_OUTPUT_CSS || hn.set(En(e), e);
3697
+ }, Vo = (e, t = !1) => process.env.TAMAGUI_DID_OUTPUT_CSS ? "" : `--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${Ks(e.name, !1)}:${!t && typeof e.val == "number" ? `${e.val}px` : e.val}`, hn = /* @__PURE__ */ new Map();
3698
+ let $l = 0;
3699
+ const Mo = [], Cl = (e) => {
3700
+ if (hn.has(e)) return hn.get(e);
3701
+ const t = `t${$l++}`, n = `var(--${t})`, o = {
3702
+ val: e,
3703
+ name: t,
3704
+ variable: n
3705
+ };
3706
+ return hn.set(e, o), Mo.push(o), o;
3707
+ };
3708
+ let Al = 1e4;
3709
+ const ao = /* @__PURE__ */ new Map(), Ol = (e) => {
3710
+ if (ao.has(e)) return ao.get(e);
3711
+ const t = `t${Al++}`, n = `var(--${t})`, o = {
3712
+ val: e,
3713
+ name: t,
3714
+ variable: n
3715
+ };
3716
+ return ao.set(e, o), o;
3717
+ }, Rl = ["dark", "light"], Il = ["light", "dark"];
3718
+ function Fl(e) {
3719
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS && (!process.env.TAMAGUI_DOES_SSR_CSS || process.env.TAMAGUI_DOES_SSR_CSS === "mutates-themes" || process.env.TAMAGUI_DOES_SSR_CSS === "false")) {
3720
+ const t = [], {
3721
+ config: n,
3722
+ themeName: o,
3723
+ theme: r,
3724
+ names: s
3725
+ } = e, i = e.hasDarkLight ?? (n.themes && ("light" in n.themes || "dark" in n.themes)), a = `.${Es}`;
3726
+ let l = "";
3727
+ const d = e.useMutatedVariables ? Ol : Cl;
3728
+ for (const h in r) {
3729
+ const S = r[h], N = d(S.val).variable;
3730
+ l += `--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${wt(h, 40)}:${N};`;
3731
+ }
3732
+ const u = o === "dark", c = o === "light", m = s.map((h) => `${a}${h}`), f = new Set(u || c ? m : []);
3733
+ if (i) for (const h of s) {
3734
+ const S = u || h.startsWith("dark_"), N = !S && (c || h.startsWith("light_"));
3735
+ if (!(S || N)) {
3736
+ f.add(`${a}${h}`);
3737
+ continue;
3738
+ }
3739
+ const y = `${a}${h.replace(/^(dark|light)_/, "")}`, $ = S ? Rl : Il, [M, K] = $, C = Math.round(2 * 1.5);
3740
+ for (let A = 0; A < C; A++) {
3741
+ const T = A % 2 === 1;
3742
+ if (T && A < 3) continue;
3743
+ const P = new Array(A + 1).fill(0).map((de, Y) => `${a}${Y % 2 === 0 ? M : K}`);
3744
+ let B = P.length > 1 ? P.slice(1) : P;
3745
+ if (T) {
3746
+ const [de, Y, ...he] = B;
3747
+ B = [Y, ...he, Y];
3748
+ }
3749
+ const k = B[B.length - 1], W = y === k ? "" : y, ae = B.join(" ");
3750
+ f.add(`${ae} ${W}`);
3751
+ }
3752
+ }
3753
+ const p = [...f].sort(ci), g = `${p.map((h) => {
3754
+ const S = we("addThemeClassName");
3755
+ return Vl(h) && (S === "html" || S === "body") ? `${S === "body" ? "body" : ":root"}${h}` : `:root ${h}`;
3756
+ }).join(", ") + ", .tm_xxt"} {${l}}`;
3757
+ if (t.push(g), we("shouldAddPrefersColorThemes")) {
3758
+ const h = o.startsWith("dark"), S = h ? "dark" : "light", N = p.map((C) => {
3759
+ if (C == Do || C === Po) return ":root";
3760
+ if (!(h && C.startsWith(Po) || !h && C.startsWith(Do))) return C.replace(/^\.t_(dark|light) /, "").trim();
3761
+ }).filter(Boolean).join(", "), y = !o.includes("_");
3762
+ let $ = "";
3763
+ if (y) {
3764
+ const C = r.background ? `background:${Nt(r.background)};` : "", A = r.color ? `color:${Nt(r.color)}` : "";
3765
+ $ = C || A ? `body{${C}${A}}
3766
+ ` : "";
3767
+ }
3768
+ const M = `${N} {${l}}`, K = `@media(prefers-color-scheme:${S}){
3769
+ ${$}${M}
3770
+ }`;
3771
+ t.push(K);
3772
+ }
3773
+ const b = we("selectionStyles");
3774
+ if (b) {
3775
+ const h = b(r);
3776
+ if (h) {
3777
+ const S = m.map((y) => `${y} ::selection`).join(", "), N = Object.entries(h).flatMap(([y, $]) => $ ? `${y === "backgroundColor" ? "background" : y}:${Nt($)}` : []).join(";");
3778
+ if (N) {
3779
+ const y = `${S}{${N}}`;
3780
+ t.push(y);
3781
+ }
3782
+ }
3783
+ }
3784
+ return t;
3785
+ }
3786
+ return [];
3787
+ }
3788
+ const Do = ".t_dark", Po = ".t_light", Vl = (e) => e === Do || e === Po || e.startsWith(".t_dark ") || e.startsWith(".t_light "), bi = {};
3789
+ function Ml(e) {
3790
+ for (const {
3791
+ names: n,
3792
+ theme: o
3793
+ } of e) for (const r of n) bi[r] = o;
3794
+ const t = {};
3795
+ for (const {
3796
+ names: n,
3797
+ theme: o
3798
+ } of e) for (const r of n) {
3799
+ const s = Dl(r, o);
3800
+ t[r] = s;
3801
+ }
3802
+ return t;
3803
+ }
3804
+ function Dl(e, t) {
3805
+ const n = {}, o = [], r = e.split("_").slice(0, -1).map((s) => (o.push(s), o.join("_")));
3806
+ for (const s of r) Object.assign(n, bi[s]);
3807
+ return Object.assign(n, t), n;
3808
+ }
3809
+ function Pl(e, t) {
3810
+ const n = e[t];
3811
+ Te(n) ? n.name !== t && (e[t] = Gt({
3812
+ key: n.name,
3813
+ name: t,
3814
+ val: n.val
3815
+ })) : e[t] = Gt({
3816
+ key: t,
3817
+ name: t,
3818
+ val: n
3819
+ });
3820
+ }
3821
+ const ts = /* @__PURE__ */ new WeakMap(), wn = (e, t = "", n = !1) => {
3822
+ if (ts.has(e)) return e;
3823
+ const o = {};
3824
+ for (let r in e) {
3825
+ const s = e[r], i = r[0] === "$", a = i ? r : `$${r}`, l = i ? a.slice(1) : r;
3826
+ if (Te(s)) {
3827
+ o[l] = s;
3828
+ continue;
3829
+ }
3830
+ const d = wt(l, 1e3), u = t && t !== "t-color" ? `${t}-${d}` : `c-${d}`;
3831
+ if (s && typeof s == "object" && "needsPx" in s && "val" in s) {
3832
+ const m = Gt({
3833
+ val: s.val,
3834
+ name: u,
3835
+ key: a
3836
+ });
3837
+ m.needsPx = s.needsPx, o[l] = m;
3838
+ continue;
3839
+ }
3840
+ if (s && typeof s == "object") {
3841
+ o[l] = wn(
3842
+ e[l],
3843
+ u,
3844
+ !1
3845
+ /* note: don't pass isFont down, we want to avoid it past the first level */
3846
+ );
3847
+ continue;
3848
+ }
3849
+ const c = Te(s) ? s : Gt({
3850
+ val: s,
3851
+ name: u,
3852
+ key: a
3853
+ });
3854
+ o[l] = c;
3855
+ }
3856
+ return ts.set(o, !0), o;
3857
+ }, bt = (e) => {
3858
+ console.warn(`No animation driver configured. To use ${e}, you must pass \`animations\` to createTamagui. See: https://tamagui.dev/docs/core/animations`);
3859
+ }, kl = () => ({
3860
+ isReactNative: !1,
3861
+ inputStyle: "css",
3862
+ outputStyle: "css",
3863
+ isStub: !0,
3864
+ animations: {},
3865
+ useAnimations: () => bt("animations"),
3866
+ usePresence: () => bt("usePresence"),
3867
+ ResetPresence: () => bt("ResetPresence"),
3868
+ useAnimatedNumber: () => bt("useAnimatedNumber"),
3869
+ useAnimatedNumberStyle: () => bt("useAnimatedNumberStyle"),
3870
+ useAnimatedNumberReaction: () => bt("useAnimatedNumberReaction")
3871
+ }), Ll = kl();
3872
+ function Bl(e, t = "$true") {
3873
+ const n = ["font-family: var(--f-family)"], o = (l) => {
3874
+ const d = l == null ? void 0 : l[t];
3875
+ if (Te(d)) return ga(d);
3876
+ }, r = o(e.letterSpacing);
3877
+ r && n.push(`letter-spacing: ${r}`);
3878
+ const s = o(e.lineHeight);
3879
+ s && n.push(`line-height: ${s}`);
3880
+ const i = o(e.style);
3881
+ i && n.push(`font-style: ${i}`);
3882
+ const a = o(e.weight);
3883
+ return a && n.push(`font-weight: ${a}`), n;
3884
+ }
3885
+ function Wl(e, t) {
3886
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
3887
+ const n = [], o = Object.keys(e).sort();
3888
+ for (const r of o) {
3889
+ const s = Object.keys(e[r]).sort();
3890
+ for (const i of s) {
3891
+ const a = e[r][i];
3892
+ {
3893
+ Fo(a);
3894
+ const l = a.needsPx === !0, d = t(r), u = !(l || d);
3895
+ n.push(Vo(a, u));
3896
+ }
3897
+ }
3898
+ }
3899
+ return n;
3900
+ }
3901
+ return [];
3902
+ }
3903
+ function jl(e, t) {
3904
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
3905
+ const n = {};
3906
+ if (!e) return n;
3907
+ const o = Object.keys(e).sort();
3908
+ for (const r of o) {
3909
+ const s = e[r], [i, a] = r.includes("_") ? r.split("_") : [r], l = t(s);
3910
+ n[r] = {
3911
+ name: i.slice(1),
3912
+ declarations: l,
3913
+ language: a,
3914
+ fontParsed: s
3915
+ };
3916
+ }
3917
+ return n;
3918
+ }
3919
+ return {};
3920
+ }
3921
+ function zl(e, t, n = "$true") {
3922
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
3923
+ let o = function(a, l = "") {
3924
+ return `:root${l} { ${[...a].join("; ")}
3925
+ }`;
3926
+ };
3927
+ const r = [];
3928
+ e.length && r.push(o(e));
3929
+ const s = [], i = Object.keys(t).sort();
3930
+ for (const a of i) {
3931
+ const {
3932
+ name: l,
3933
+ declarations: d,
3934
+ language: u = "default"
3935
+ } = t[a], c = `.font_${l}`;
3936
+ s.push(c);
3937
+ const m = `:root .t_lang-${l}-${u} ${c}`, f = u === "default" ? ` ${c}, ${m}` : m, p = o(d, f);
3938
+ r.push(p);
3939
+ }
3940
+ if (s.length) {
3941
+ const a = t[i[0]];
3942
+ if (a != null && a.fontParsed) {
3943
+ const l = Bl(a.fontParsed, n), d = [...s, ".is_View"].join(", ");
3944
+ r.push(`${d} {${l.join("; ")}}`);
3945
+ }
3946
+ }
3947
+ return r;
3948
+ }
3949
+ return [];
3950
+ }
3951
+ function Ul(e, t) {
3952
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
3953
+ let n = [];
3954
+ for (const {
3955
+ names: o,
3956
+ theme: r
3957
+ } of e) {
3958
+ const s = Fl({
3959
+ config: t,
3960
+ themeName: o[0],
3961
+ names: o,
3962
+ theme: r
3963
+ });
3964
+ n = [...n, ...s];
3965
+ }
3966
+ return n;
3967
+ }
3968
+ return [];
3969
+ }
3970
+ function Gl(e, t = {}, n) {
3971
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
3972
+ const {
3973
+ separator: o = `
3974
+ `,
3975
+ sinceLastCall: r,
3976
+ exclude: s
3977
+ } = t;
3978
+ if (r && n.value >= 0) {
3979
+ const l = Ao(), d = l.slice(n.value);
3980
+ return n.value = l.length, d.join(o);
3981
+ }
3982
+ n.value = 0;
3983
+ const i = Ao().join(o);
3984
+ if (s === "design-system") return i;
3985
+ const a = s ? "" : e.getThemeRulesSets().join(o);
3986
+ return `${`._ovs-contain {overscroll-behavior:contain;}
3987
+ .is_View { display: flex; align-items: stretch; flex-direction: column; flex-basis: auto; box-sizing: border-box; min-height: 0; min-width: 0; flex-shrink: 0; }
3988
+ .is_Text { display: inline; box-sizing: border-box; word-wrap: break-word; white-space: pre-wrap; margin: 0; }
3989
+ @scope (.is_Text) to (.is_View) { .is_Text { white-space: inherit; word-wrap: inherit; } }
3990
+ ._dsp_contents {display:contents;}
3991
+ ._no_backdrop::backdrop {display: none;}
3992
+ .is_Input::selection, .is_TextArea::selection {background-color: var(--selectionColor);}
3993
+ .is_Input::placeholder, .is_TextArea::placeholder {color: var(--placeholderColor);}
3994
+ :root ._pe-boxonly>* {pointer-events:none;}
3995
+ :root ._pe-boxnone>* {pointer-events:auto;}
3996
+ ._hsb-x::-webkit-scrollbar:horizontal { display: none !important; }
3997
+ ._hsb-y::-webkit-scrollbar:vertical { display: none !important; }
3998
+ ._hsb-x { scrollbar-width: none !important; }
3999
+ ._hsb-y { scrollbar-width: none !important; }
4000
+ ${Mo.length ? `:root{${Mo.map((l) => `--${l.name}:${l.val}`).join(";")}}` : ""}
4001
+ ${e.cssRuleSets.join(o)}`}
4002
+ ${a}
4003
+ ${i}`;
4004
+ }
4005
+ return "";
4006
+ }
4007
+ function Kl(e) {
4008
+ var n;
4009
+ const t = {};
4010
+ for (const o in e) {
4011
+ const r = e[o];
4012
+ if (o === "family" || o === "face") t[o] = r;
4013
+ else {
4014
+ t[o] = {};
4015
+ for (const s in r) {
4016
+ let i = r[s];
4017
+ ((n = i.val) == null ? void 0 : n[0]) === "$" && (i = i.val), t[o][`$${s}`] = i;
4018
+ }
4019
+ }
4020
+ }
4021
+ return t;
4022
+ }
4023
+ function Hl(e) {
4024
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
4025
+ const t = [];
4026
+ for (const n in e) if (n !== "face") {
4027
+ if (n === "family") {
4028
+ const o = e[n];
4029
+ Fo(o), t.push(Vo(o));
4030
+ } else for (const o in e[n]) if (typeof e[n][o] != "string") {
4031
+ const r = e[n][o];
4032
+ Fo(r), t.push(Vo(r));
4033
+ }
4034
+ }
4035
+ return t;
4036
+ }
4037
+ return [];
4038
+ }
4039
+ const Xl = (() => {
4040
+ if (process.env.NODE_ENV === "development") {
4041
+ class e {
4042
+ constructor() {
4043
+ vr(this, "Helpers", ma);
4044
+ }
4045
+ get mediaState() {
4046
+ return {
4047
+ ...Rn
4048
+ };
4049
+ }
4050
+ get config() {
4051
+ return De();
4052
+ }
4053
+ get insertedRules() {
4054
+ return Ao();
4055
+ }
4056
+ get allSelectors() {
4057
+ return Fa();
4058
+ }
4059
+ get identifierToValue() {
4060
+ return Yl;
4061
+ }
4062
+ }
4063
+ return new e();
4064
+ }
4065
+ })(), Yl = /* @__PURE__ */ new Map();
4066
+ function Zl(e) {
4067
+ return (/* @__PURE__ */ new Set(["size", "space", "radius"])).has(e);
4068
+ }
4069
+ function ql(e) {
4070
+ var M, K, C;
4071
+ const t = xs();
4072
+ t && (e = {
4073
+ ...t,
4074
+ ...e
4075
+ });
4076
+ const n = {}, o = wn(e.tokens || {});
4077
+ if (e.tokens) {
4078
+ const A = {};
4079
+ for (const T in o) {
4080
+ n[T] = {}, A[T] = {};
4081
+ const P = o[T];
4082
+ for (const B in P) {
4083
+ const k = P[B], W = `$${B}`;
4084
+ n[T][W] = k, A[T][W] = k, A[T][B] = k;
4085
+ }
4086
+ }
4087
+ }
4088
+ let r;
4089
+ if (e.themes) {
4090
+ const A = Object.keys(e.themes).length === 0;
4091
+ A && !process.env.TAMAGUI_DID_OUTPUT_CSS && (r = Va(A, n));
4092
+ }
4093
+ let s = null, i;
4094
+ if (e.fonts) {
4095
+ const A = Object.fromEntries(Object.entries(e.fonts).map(([T, P]) => [T, wn(P, "f", !0)]));
4096
+ i = (() => {
4097
+ const T = {};
4098
+ for (const P in A) {
4099
+ const B = A[P], k = Kl(B);
4100
+ T[`$${P}`] = k, !s && k.size && (s = new Set(Object.keys(k.size)));
4101
+ }
4102
+ return T;
4103
+ })();
4104
+ }
4105
+ const a = {}, l = (() => {
4106
+ const A = Object.keys(o).sort();
4107
+ for (const ae of A) {
4108
+ const de = Object.keys(o[ae]).sort();
4109
+ for (const Y of de) {
4110
+ const he = o[ae][Y];
4111
+ if (a[`$${ae}.${Y}`] = he, process.env.NODE_ENV === "development" && typeof he > "u") throw new Error(`No value for tokens.${ae}.${Y}:
4112
+ ${JSON.stringify(he, null, 2)}`);
4113
+ }
4114
+ }
4115
+ const T = Wl(o, Zl), P = jl(i, Hl), B = zl(T, P), k = e.themes, W = r ?? Jl(k, o.color);
4116
+ return {
4117
+ themes: Ml(W),
4118
+ cssRuleSets: B,
4119
+ getThemeRulesSets() {
4120
+ return Ul(W, e);
4121
+ }
4122
+ };
4123
+ })(), d = e.shorthands || {}, u = {
4124
+ ...Ql,
4125
+ ...d
4126
+ }, c = {
4127
+ value: -1
4128
+ }, m = (A = {}) => Gl(l, A, c), f = (A) => m({
4129
+ ...A,
4130
+ sinceLastCall: !0
4131
+ }), p = (M = e.settings) == null ? void 0 : M.defaultFont, g = (() => {
4132
+ let A = p;
4133
+ return (A == null ? void 0 : A[0]) === "$" && (A = A.slice(1)), A;
4134
+ })(), b = ((K = e.settings) == null ? void 0 : K.defaultPosition) || "static", h = e.defaultProps || {};
4135
+ b !== "static" && (h.View = {
4136
+ ...h.View,
4137
+ position: b
4138
+ });
4139
+ const S = g ? `$${g}` : "", N = e.animations, y = Nn(N), $ = {
4140
+ fonts: {},
4141
+ onlyAllowShorthands: !1,
4142
+ fontLanguages: [],
4143
+ media: {},
4144
+ ...e,
4145
+ // normalized animations (resolved from multi-driver format if needed)
4146
+ animations: y ?? N ?? Ll,
4147
+ animationDrivers: y !== null && y !== N ? N : void 0,
4148
+ defaultProps: h,
4149
+ settings: {
4150
+ webContainerType: "inline-size",
4151
+ ...e.settings
4152
+ },
4153
+ tokens: o,
4154
+ // vite made this into a function if it wasn't set
4155
+ shorthands: u,
4156
+ userShorthands: d,
4157
+ inverseShorthands: u ? Object.fromEntries(Object.entries(u).map(([A, T]) => [T, A])) : {},
4158
+ themes: l.themes,
4159
+ fontsParsed: i || {},
4160
+ themeConfig: l,
4161
+ tokensParsed: n,
4162
+ parsed: !0,
4163
+ getNewCSS: f,
4164
+ getCSS: m,
4165
+ defaultFont: g,
4166
+ fontSizeTokens: s || /* @__PURE__ */ new Set(),
4167
+ specificTokens: a,
4168
+ defaultFontToken: S
4169
+ // const tokens = [...getToken(tokens.size[0])]
4170
+ // .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
4171
+ };
4172
+ return Di($), Yi($), process.env.NODE_ENV === "development" && ((C = process.env.DEBUG) != null && C.startsWith("tamagui") && console.info("Tamagui config:", $), globalThis.Tamagui || (globalThis.Tamagui = Xl)), $;
4173
+ }
4174
+ function Jl(e, t) {
4175
+ const n = [], o = /* @__PURE__ */ new Map(), r = Object.keys(e).sort();
4176
+ for (const s of r) {
4177
+ const i = s.startsWith("dark") ? "dark" : s.startsWith("light") ? "light" : "", a = e[s], l = i + JSON.stringify(a);
4178
+ if (o.has(l)) {
4179
+ o.get(l).names.push(s);
4180
+ continue;
4181
+ }
4182
+ const d = {
4183
+ ...t,
4184
+ ...a
4185
+ };
4186
+ for (const c in d) Pl(d, c);
4187
+ const u = {
4188
+ names: [s],
4189
+ theme: d
4190
+ };
4191
+ n.push(u), o.set(l, u);
4192
+ }
4193
+ return n;
4194
+ }
4195
+ const Ql = {
4196
+ bblr: "borderBottomLeftRadius",
4197
+ bbrr: "borderBottomRightRadius",
4198
+ bbs: "borderBottomStyle",
4199
+ bls: "borderLeftStyle",
4200
+ brc: "borderRightColor",
4201
+ brs: "borderRightStyle",
4202
+ brw: "borderRightWidth",
4203
+ bs: "borderStyle",
4204
+ btc: "borderTopColor",
4205
+ btlr: "borderTopLeftRadius",
4206
+ btrr: "borderTopRightRadius",
4207
+ bts: "borderTopStyle",
4208
+ btw: "borderTopWidth",
4209
+ bw: "borderWidth",
4210
+ bxs: "boxSizing",
4211
+ bxsh: "boxShadow",
4212
+ col: "color",
4213
+ cur: "cursor",
4214
+ dsp: "display",
4215
+ fb: "flexBasis",
4216
+ fd: "flexDirection",
4217
+ ff: "fontFamily",
4218
+ fs: "fontSize",
4219
+ fst: "fontStyle",
4220
+ fw: "fontWeight",
4221
+ fwr: "flexWrap",
4222
+ // height: 'h',
4223
+ lh: "lineHeight",
4224
+ ls: "letterSpacing",
4225
+ o: "opacity",
4226
+ ov: "overflow",
4227
+ ox: "overflowX",
4228
+ oy: "overflowY",
4229
+ pe: "pointerEvents",
4230
+ pos: "position",
4231
+ td: "textDecorationLine",
4232
+ tr: "transform",
4233
+ tt: "textTransform",
4234
+ va: "verticalAlign",
4235
+ wb: "wordBreak",
4236
+ // width: 'w',
4237
+ ws: "whiteSpace",
4238
+ ww: "wordWrap"
4239
+ };
4240
+ function ec(e) {
4241
+ return wn(e, process.env.TAMAGUI_TOKEN_PREFIX ?? "t");
4242
+ }
4243
+ const tc = gi({
4244
+ acceptsClassName: !0,
4245
+ validStyles: Fn
4246
+ });
4247
+ let lo = "";
4248
+ function nc({
4249
+ children: e,
4250
+ theme: t,
4251
+ isRootRoot: n,
4252
+ passThrough: o,
4253
+ style: r
4254
+ }) {
4255
+ const [s, i] = te.useState(!n);
4256
+ if (te.useEffect(() => {
4257
+ s || i(!0);
4258
+ }, []), !lo) {
4259
+ const l = De().defaultFont;
4260
+ l && (lo = `font_${l}`);
4261
+ }
4262
+ const a = /* @__PURE__ */ w("span", {
4263
+ style: r,
4264
+ className: `_dsp_contents ${s ? "" : "t_unmounted"} ${lo}`,
4265
+ children: e
4266
+ });
4267
+ return n ? a : /* @__PURE__ */ w(Zt, {
4268
+ passThrough: o,
4269
+ contain: !0,
4270
+ forceClassName: !0,
4271
+ name: t,
4272
+ children: a
4273
+ });
4274
+ }
4275
+ const oc = (e) => {
4276
+ "use no memo";
4277
+ const t = we("addThemeClassName");
4278
+ Ae(() => {
4279
+ if (t === !1) return;
4280
+ const o = `${Es}${e.defaultTheme}`, r = we("addThemeClassName") === "html" ? document.documentElement : document.body;
4281
+ return r.classList.add(o), () => {
4282
+ r.classList.remove(o);
4283
+ };
4284
+ }, [e.defaultTheme, t]);
4285
+ const n = t === void 0;
4286
+ return /* @__PURE__ */ w(Zt, {
4287
+ className: e.className,
4288
+ name: e.defaultTheme,
4289
+ forceClassName: n,
4290
+ _isRoot: ms,
4291
+ children: e.children
4292
+ });
4293
+ };
4294
+ function rc({
4295
+ children: e,
4296
+ disableInjectCSS: t,
4297
+ config: n,
4298
+ className: o,
4299
+ defaultTheme: r,
4300
+ reset: s,
4301
+ insets: i
4302
+ }) {
4303
+ Ae(() => {
4304
+ La(), Os();
4305
+ }, []);
4306
+ const a = te.useMemo(() => i, [i == null ? void 0 : i.top, i == null ? void 0 : i.right, i == null ? void 0 : i.bottom, i == null ? void 0 : i.left]), l = te.useMemo(() => Nn(n == null ? void 0 : n.animations), [n == null ? void 0 : n.animations]);
4307
+ Tt(() => {
4308
+ var u;
4309
+ (u = l == null ? void 0 : l.onMount) == null || u.call(l);
4310
+ }, []);
4311
+ let d = /* @__PURE__ */ w(un.Provider, {
4312
+ animationDriver: l,
4313
+ insets: a,
4314
+ children: /* @__PURE__ */ w(oc, {
4315
+ defaultTheme: r,
4316
+ reset: s,
4317
+ className: o,
4318
+ children: /* @__PURE__ */ w(nc, {
4319
+ theme: r,
4320
+ isRootRoot: !0,
4321
+ children: e
4322
+ })
4323
+ })
4324
+ });
4325
+ return we("disableSSR") && (d = /* @__PURE__ */ w(dl, {
4326
+ enabled: !0,
4327
+ children: d
4328
+ })), /* @__PURE__ */ Xe(Cn, {
4329
+ children: [d, n && !t && /* @__PURE__ */ w("style", {
4330
+ precedence: "default",
4331
+ href: "tamagui-css",
4332
+ children: n.getCSS()
4333
+ }, "tamagui-css")]
4334
+ });
4335
+ }
4336
+ const ns = {
4337
+ maxWidth: "100%",
4338
+ overflow: "hidden",
4339
+ textOverflow: "ellipsis",
4340
+ whiteSpace: "nowrap"
4341
+ }, sc = gi({
4342
+ componentName: "Text",
4343
+ acceptsClassName: !0,
4344
+ isText: !0,
4345
+ defaultProps: void 0,
4346
+ inlineWhenUnflattened: /* @__PURE__ */ new Set(["fontFamily"]),
4347
+ variants: {
4348
+ numberOfLines: {
4349
+ 1: ns,
4350
+ ":number": (e) => e >= 1 ? {
4351
+ WebkitLineClamp: e,
4352
+ WebkitBoxOrient: "vertical",
4353
+ display: "-webkit-box",
4354
+ overflow: "hidden"
4355
+ } : null
4356
+ },
4357
+ ellipsis: {
4358
+ true: ns
4359
+ }
4360
+ },
4361
+ validStyles: {
4362
+ ...Fn,
4363
+ ...qo
4364
+ }
4365
+ }), _n = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new Set(), xt = /* @__PURE__ */ new WeakMap(), ic = () => globalThis.__TAMAGUI_ONLAYOUT_PRETRANSFORM === !0 || process.env.TAMAGUI_ONLAYOUT_PRETRANSFORM === "1";
4366
+ let co;
4367
+ function ko() {
4368
+ return co === void 0 && (co = typeof window < "u" && new URLSearchParams(window.location.search).has("__tamaDebugLayout")), co;
4369
+ }
4370
+ const ac = {}, lc = Xt(""), yi = typeof IntersectionObserver < "u";
4371
+ let He = null, cc = "async";
4372
+ const st = /* @__PURE__ */ new WeakMap();
4373
+ let Lo = !0;
4374
+ const pn = /* @__PURE__ */ new Map();
4375
+ function uc() {
4376
+ Lo && (Lo = !1, pn && (pn.forEach((e) => e()), pn.clear()));
4377
+ }
4378
+ function os() {
4379
+ !yi || He || (He = new IntersectionObserver((e) => {
4380
+ for (let t = 0; t < e.length; t++) {
4381
+ const n = e[t], o = n.target;
4382
+ xt.get(o) !== n.isIntersecting && xt.set(o, n.isIntersecting);
4383
+ }
4384
+ }, {
4385
+ threshold: 0
4386
+ }));
4387
+ }
4388
+ function rs(e, t) {
4389
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
4390
+ }
4391
+ if (yi) {
4392
+ let e = function() {
4393
+ return n || (n = new IntersectionObserver((p) => {
4394
+ s = Math.round(performance.now() - r);
4395
+ for (let g = 0; g < p.length; g++) t.set(p[g].target, p[g].boundingClientRect);
4396
+ process.env.NODE_ENV === "development" && ko() && s > 50 && console.warn("[onLayout-io-delay]", s + "ms", p.length, "entries"), o && (o(!0), o = null);
4397
+ }, {
4398
+ threshold: 0
4399
+ }), n);
4400
+ };
4401
+ const t = /* @__PURE__ */ new WeakMap();
4402
+ let n = null, o = null, r = 0, s = 0;
4403
+ async function i(p) {
4404
+ const g = _n.get(p);
4405
+ if (typeof g != "function") return;
4406
+ const b = p.parentElement;
4407
+ if (!b) return;
4408
+ let h, S;
4409
+ if (h = t.get(p), S = t.get(b), !h || !S) return;
4410
+ const N = st.get(p), y = st.get(b), $ = !N || !rs(N, h), M = !y || !rs(y, S);
4411
+ if ($ || M) {
4412
+ st.set(p, h), st.set(b, S);
4413
+ const K = Bo(h, S, p);
4414
+ process.env.NODE_ENV === "development" && ko() && console.log("[useElementLayout] change", {
4415
+ tag: p.tagName,
4416
+ id: p.id || void 0,
4417
+ className: (p.className || "").slice(0, 60) || void 0,
4418
+ layout: K.nativeEvent.layout,
4419
+ first: !N
4420
+ }), Lo ? pn.set(p, () => g(K)) : g(K);
4421
+ }
4422
+ }
4423
+ const a = typeof requestAnimationFrame < "u" ? requestAnimationFrame : void 0, l = process.env.TAMAGUI_LAYOUT_FRAME_SKIP, d = l ? +l : 10, u = 20;
4424
+ let c = d, m = 0;
4425
+ async function f() {
4426
+ if (m++ % c !== 0) {
4427
+ a ? a(f) : setTimeout(f, 16);
4428
+ return;
4429
+ }
4430
+ if (m >= Number.MAX_SAFE_INTEGER && (m = 0), cc !== "off") {
4431
+ const p = [], g = /* @__PURE__ */ new Set();
4432
+ for (const b of Wt) {
4433
+ const h = b.parentElement;
4434
+ if (!(h instanceof HTMLElement)) {
4435
+ gn(b);
4436
+ continue;
4437
+ }
4438
+ const S = ar.get(b);
4439
+ S && ac[S] === !0 || xt.get(b) !== !1 && (p.push(b), g.add(h));
4440
+ }
4441
+ if (p.length > 0) {
4442
+ const b = e();
4443
+ r = performance.now();
4444
+ for (let h = 0; h < p.length; h++) b.observe(p[h]);
4445
+ for (const h of g) b.observe(h);
4446
+ await new Promise((h) => {
4447
+ o = h;
4448
+ });
4449
+ for (let h = 0; h < p.length; h++) b.unobserve(p[h]);
4450
+ for (const h of g) b.unobserve(h);
4451
+ s > 50 ? c = Math.min(c + 2, u) : s < 20 && (c = Math.max(c - 1, d));
4452
+ for (let h = 0; h < p.length; h++) i(p[h]);
4453
+ }
4454
+ }
4455
+ a ? a(f) : setTimeout(f, 16);
4456
+ }
4457
+ f();
4458
+ }
4459
+ const Bo = (e, t, n) => ({
4460
+ nativeEvent: {
4461
+ layout: Si(e, t, n),
4462
+ target: e
4463
+ },
4464
+ timeStamp: Date.now()
4465
+ }), dc = (e) => ({
4466
+ width: e.offsetWidth,
4467
+ height: e.offsetHeight
4468
+ }), Si = (e, t, n) => {
4469
+ const {
4470
+ left: o,
4471
+ top: r
4472
+ } = e, s = o - t.left, i = r - t.top, {
4473
+ width: a,
4474
+ height: l
4475
+ } = ic() && n ? dc(n) : {
4476
+ width: e.width,
4477
+ height: e.height
4478
+ };
4479
+ return {
4480
+ x: s,
4481
+ y: i,
4482
+ width: a,
4483
+ height: l,
4484
+ pageX: e.left,
4485
+ pageY: e.top
4486
+ };
4487
+ };
4488
+ function gn(e) {
4489
+ Wt.delete(e), _n.delete(e), ar.delete(e), st.delete(e), xt.delete(e), He && He.unobserve(e);
4490
+ }
4491
+ const cn = /* @__PURE__ */ new WeakMap();
4492
+ function fc(e, t) {
4493
+ var r;
4494
+ const n = An(lc), o = ss((r = e.current) == null ? void 0 : r.host);
4495
+ o && t && (_n.set(o, t), ar.set(o, n)), Ae(() => {
4496
+ var c;
4497
+ if (!t) return;
4498
+ const s = ss((c = e.current) == null ? void 0 : c.host), i = cn.get(e);
4499
+ if (s === i || (i && gn(i), cn.set(e, s), !s)) return;
4500
+ Wt.add(s), os(), He && (He.observe(s), xt.set(s, !0));
4501
+ const a = _n.get(s);
4502
+ if (typeof a != "function") return;
4503
+ const l = s.parentElement;
4504
+ if (!l) return;
4505
+ const d = s.getBoundingClientRect(), u = l.getBoundingClientRect();
4506
+ st.set(s, d), st.set(l, u), a(Bo(d, u, s));
4507
+ }), Ae(() => {
4508
+ var a;
4509
+ if (!t) return;
4510
+ const s = (a = e.current) == null ? void 0 : a.host;
4511
+ if (!s) return;
4512
+ Wt.add(s), os(), He && (He.observe(s), xt.set(s, !0)), process.env.NODE_ENV === "development" && ko() && console.log("[useElementLayout] register", {
4513
+ tag: s.tagName,
4514
+ id: s.id || void 0,
4515
+ className: (s.className || "").slice(0, 60) || void 0,
4516
+ totalNodes: Wt.size
4517
+ });
4518
+ const i = s.parentNode;
4519
+ return i && t(Bo(s.getBoundingClientRect(), i.getBoundingClientRect(), s)), () => {
4520
+ gn(s);
4521
+ const l = cn.get(e);
4522
+ l && l !== s && gn(l), cn.delete(e);
4523
+ };
4524
+ }, [e, !!t]);
4525
+ }
4526
+ function ss(e) {
4527
+ if (!(typeof HTMLElement > "u")) return e instanceof HTMLElement ? e : void 0;
4528
+ }
4529
+ const is = (e) => new Promise((t) => {
4530
+ if (!e || e.nodeType !== 1) return t(!1);
4531
+ const n = new IntersectionObserver((o) => (n.disconnect(), t(o[0].boundingClientRect)), {
4532
+ threshold: 0
4533
+ });
4534
+ n.observe(e);
4535
+ }), lr = async (e, t) => {
4536
+ const n = t || (e == null ? void 0 : e.parentElement);
4537
+ if (n instanceof HTMLElement) {
4538
+ const [o, r] = await Promise.all([is(e), is(n)]);
4539
+ if (r && o) return Si(o, r, e);
4540
+ }
4541
+ return null;
4542
+ }, mc = async (e, t) => {
4543
+ const n = await lr(e, e.parentNode instanceof HTMLElement ? e.parentNode : null);
4544
+ return n && (t == null || t(n.x, n.y, n.width, n.height, n.pageX, n.pageY)), n;
4545
+ };
4546
+ function hc(e) {
4547
+ return (t) => mc(e, t);
4548
+ }
4549
+ const pc = async (e, t) => {
4550
+ const n = await lr(e, null);
4551
+ return n && (t == null || t(n.pageX, n.pageY, n.width, n.height)), n;
4552
+ }, gc = (e) => (t) => pc(e, t), bc = async (e, t, n) => {
4553
+ const o = await lr(e, t);
4554
+ return o && (n == null || n(o.x, o.y, o.width, o.height, o.pageX, o.pageY)), o;
4555
+ };
4556
+ function yc(e) {
4557
+ return (t, n) => bc(e, t, n);
4558
+ }
4559
+ function Sc() {
4560
+ return null;
4561
+ }
4562
+ const vc = (e) => (Ae(() => {
4563
+ uc();
4564
+ }, []), /* @__PURE__ */ w(rc, {
4565
+ ...e
4566
+ })), Ec = (e) => ql(e);
4567
+ ll({
4568
+ getBaseViews: Sc,
4569
+ setElementProps: (e) => {
4570
+ e && !e.measure && (e.measure || (e.measure = hc(e)), e.measureInWindow || (e.measureInWindow = gc(e)), e.measureLayout || (e.measureLayout = yc(e)));
4571
+ },
4572
+ usePropsTransform(e, t, n, o) {
4573
+ {
4574
+ const r = typeof e == "string", {
4575
+ // remove event props handles by useResponderEvents
4576
+ onMoveShouldSetResponder: s,
4577
+ onMoveShouldSetResponderCapture: i,
4578
+ onResponderEnd: a,
4579
+ onResponderGrant: l,
4580
+ onResponderMove: d,
4581
+ onResponderReject: u,
4582
+ onResponderRelease: c,
4583
+ onResponderStart: m,
4584
+ onResponderTerminate: f,
4585
+ onResponderTerminationRequest: p,
4586
+ onScrollShouldSetResponder: g,
4587
+ onScrollShouldSetResponderCapture: b,
4588
+ onSelectionChangeShouldSetResponder: h,
4589
+ onSelectionChangeShouldSetResponderCapture: S,
4590
+ onStartShouldSetResponder: N,
4591
+ onStartShouldSetResponderCapture: y,
4592
+ // android
4593
+ collapsable: $,
4594
+ focusable: M,
4595
+ // deprecated,
4596
+ accessible: K,
4597
+ accessibilityDisabled: C,
4598
+ onLayout: A,
4599
+ hrefAttrs: T,
4600
+ ...P
4601
+ } = t;
4602
+ if ((o || r) && fc(n, r ? A : void 0), r) {
4603
+ if (P.href && T) {
4604
+ const {
4605
+ download: B,
4606
+ rel: k,
4607
+ target: W
4608
+ } = T;
4609
+ B != null && (P.download = B), k && (P.rel = k), typeof W == "string" && (P.target = W.charAt(0) !== "_" ? `_${W}` : W);
4610
+ }
4611
+ return P;
4612
+ }
4613
+ }
4614
+ }
4615
+ });
4616
+ const Nc = tc, Tc = sc, xc = { violet: { 50: "#F5F3FF", 100: "#EDE9FE", 200: "#DDD6FE", 300: "#C4B5FD", 400: "#A78BFA", 500: "#8B5CF6", 600: "#7C3AED", 700: "#6D28D9", 800: "#5B21B6", 900: "#4C1D95", 950: "#2E1065" }, navy: { 50: "#E8EDF4", 100: "#C5D0E0", 200: "#9EAFCA", 300: "#778EB4", 400: "#5975A3", 500: "#3B5C93", 600: "#2F4A78", 700: "#1E3358", 800: "#0F1F3A", 900: "#021526", 950: "#01101E" } }, wc = { light: { primary: "#8B5CF6", primaryHover: "#7C3AED", primaryActive: "#6D28D9", bg: "#FFFFFF", bgSecondary: "#F8FAFC", bgTertiary: "#F1F5F9", border: "#E2E8F0", text: "#0F172A", textSecondary: "#64748B", textMuted: "#94A3B8", sidebarBg: "#021526", sidebarText: "#E2E8F0", sidebarTextMuted: "rgba(255, 255, 255, 0.65)", sidebarHover: "rgba(139, 92, 246, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.1)", sidebarItemActiveBg: "rgba(139, 92, 246, 0.3)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "#FFF2F0", errorBorder: "#FFCCC7", focusRing: "rgba(139, 92, 246, 0.25)" }, dark: { primary: "#A78BFA", primaryHover: "#8B5CF6", primaryActive: "#7C3AED", bg: "#021526", bgSecondary: "#0F1F3A", bgTertiary: "#1E3358", border: "#1E3358", text: "#F1F5F9", textSecondary: "#CBD5E1", textMuted: "#94A3B8", sidebarBg: "#01101E", sidebarText: "#E2E8F0", sidebarTextMuted: "#94A3B8", sidebarHover: "rgba(167, 139, 250, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.05)", sidebarItemActiveBg: "rgba(167, 139, 250, 0.2)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "rgba(239, 68, 68, 0.1)", errorBorder: "rgba(239, 68, 68, 0.3)", focusRing: "rgba(167, 139, 250, 0.3)" } }, $n = {
4617
+ brand: xc,
4618
+ semantic: wc
4619
+ }, _c = { sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", mono: "'JetBrains Mono', 'Fira Code', monospace" }, $c = { xs: "0.75rem", sm: "0.875rem", base: "0.875rem", md: "1rem", lg: "1.125rem", xl: "1.375rem", "2xl": "1.75rem", "3xl": "2rem" }, Cc = { normal: 400, medium: 500, semibold: 600, bold: 700 }, Ac = { tight: 1.3, normal: 1.5, relaxed: 1.6 }, Oc = {
4620
+ fontFamily: _c,
4621
+ fontSize: $c,
4622
+ fontWeight: Cc,
4623
+ lineHeight: Ac
4624
+ }, Rc = { xs: "0.25rem", sm: "0.5rem", md: "1rem", lg: "1.5rem", xl: "2rem", "2xl": "3rem" }, Ic = { sm: "4px", md: "6px", lg: "8px", xl: "12px", full: "9999px" }, Fc = { sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", md: "0 4px 6px -1px rgb(0 0 0 / 0.1)", lg: "0 10px 15px -3px rgb(0 0 0 / 0.1)" }, as = {
4625
+ spacing: Rc,
4626
+ borderRadius: Ic,
4627
+ shadow: Fc
4628
+ };
4629
+ function Vc() {
4630
+ const e = $n.brand.violet, t = $n.brand.navy;
4631
+ return {
4632
+ violet50: e[50],
4633
+ violet100: e[100],
4634
+ violet200: e[200],
4635
+ violet300: e[300],
4636
+ violet400: e[400],
4637
+ violet500: e[500],
4638
+ violet600: e[600],
4639
+ violet700: e[700],
4640
+ violet800: e[800],
4641
+ violet900: e[900],
4642
+ navy50: t[50],
4643
+ navy100: t[100],
4644
+ navy200: t[200],
4645
+ navy300: t[300],
4646
+ navy400: t[400],
4647
+ navy500: t[500],
4648
+ navy600: t[600],
4649
+ navy700: t[700],
4650
+ navy800: t[800],
4651
+ navy900: t[900],
4652
+ white: "#ffffff",
4653
+ black: "#000000"
4654
+ };
4655
+ }
4656
+ function Mc() {
4657
+ const e = Oc.fontSize;
4658
+ return {
4659
+ xs: e.xs,
4660
+ sm: e.sm,
4661
+ md: e.md,
4662
+ lg: e.lg,
4663
+ xl: e.xl,
4664
+ xxl: e["2xl"]
4665
+ };
4666
+ }
4667
+ function ls(e) {
4668
+ const t = $n.semantic[e];
4669
+ return {
4670
+ background: t.bg,
4671
+ color: t.text,
4672
+ borderColor: t.border,
4673
+ placeholderColor: t.textMuted,
4674
+ primary: t.primary,
4675
+ secondary: $n.brand.navy[900],
4676
+ success: t.success,
4677
+ warning: t.warning,
4678
+ error: t.error
4679
+ };
4680
+ }
4681
+ function Dc() {
4682
+ return {
4683
+ tokens: {
4684
+ color: Vc(),
4685
+ space: as.spacing,
4686
+ size: Mc(),
4687
+ radius: as.borderRadius,
4688
+ zIndex: {
4689
+ base: 0,
4690
+ dropdown: 100,
4691
+ modal: 1200,
4692
+ toast: 1400
4693
+ }
4694
+ },
4695
+ themes: {
4696
+ light: ls("light"),
4697
+ dark: ls("dark")
4698
+ }
4699
+ };
4700
+ }
4701
+ const yt = Dc(), Pc = ec({
4702
+ color: yt.tokens.color,
4703
+ space: yt.tokens.space,
4704
+ size: yt.tokens.size,
4705
+ radius: yt.tokens.radius,
4706
+ zIndex: yt.tokens.zIndex
4707
+ }), kc = Ec({
4708
+ tokens: Pc,
4709
+ themes: yt.themes,
4710
+ defaultTheme: "light"
4711
+ });
4712
+ function Qc({ children: e }) {
4713
+ const { theme: t } = gs();
4714
+ return /* @__PURE__ */ w(
4715
+ vc,
4716
+ {
4717
+ config: kc,
4718
+ defaultTheme: t,
4719
+ disableInjectCSS: !0,
4720
+ children: e
4721
+ }
4722
+ );
4723
+ }
4724
+ const uo = {
4725
+ draft: { bg: "#e0e0e0", text: "#333" },
4726
+ pending: { bg: "#fff3cd", text: "#856404" },
4727
+ submitted: { bg: "#cce5ff", text: "#004085" },
4728
+ approved: { bg: "#d4edda", text: "#155724" },
4729
+ rejected: { bg: "#f8d7da", text: "#721c24" },
4730
+ cancelled: { bg: "#f5f5f5", text: "#666" },
4731
+ completed: { bg: "#d4edda", text: "#155724" },
4732
+ on_hold: { bg: "#fff3cd", text: "#856404" },
4733
+ default: { bg: "#e9ecef", text: "#495057" }
4734
+ };
4735
+ function Lc(e) {
4736
+ if (!e) return uo.default;
4737
+ const t = e.toLowerCase().replace(/\s+/g, "_");
4738
+ return uo[t] ?? uo.default;
4739
+ }
4740
+ function eu({
4741
+ state: e,
4742
+ docstatus: t,
4743
+ className: n,
4744
+ style: o
4745
+ }) {
4746
+ const r = e ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
4747
+ if (!r) return null;
4748
+ const s = Lc(r);
4749
+ return /* @__PURE__ */ w(
4750
+ "span",
4751
+ {
4752
+ className: n,
4753
+ style: {
4754
+ display: "inline-block",
4755
+ padding: "0.25rem 0.75rem",
4756
+ borderRadius: "9999px",
4757
+ fontSize: "0.75rem",
4758
+ fontWeight: 500,
4759
+ textTransform: "capitalize",
4760
+ backgroundColor: s.bg,
4761
+ color: s.text,
4762
+ ...o
4763
+ },
4764
+ children: r
4765
+ }
4766
+ );
4767
+ }
4768
+ const Bc = [
4769
+ { code: "en", label: "English" },
4770
+ { code: "hi", label: "हिन्दी" },
4771
+ { code: "ta", label: "தமிழ்" },
4772
+ { code: "es", label: "Español" },
4773
+ { code: "fr", label: "Français" }
4774
+ ];
4775
+ function tu({
4776
+ language: e,
4777
+ onChangeLanguage: t,
4778
+ locales: n = Bc
4779
+ }) {
4780
+ return /* @__PURE__ */ Xe("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
4781
+ /* @__PURE__ */ w(
4782
+ "label",
4783
+ {
4784
+ htmlFor: "locale-select",
4785
+ style: { fontSize: "14px", color: "var(--color-text)" },
4786
+ children: "🌐"
4787
+ }
4788
+ ),
4789
+ /* @__PURE__ */ w(
4790
+ "select",
4791
+ {
4792
+ id: "locale-select",
4793
+ value: e,
4794
+ onChange: async (r) => {
4795
+ await t(r.target.value);
4796
+ },
4797
+ style: {
4798
+ padding: "4px 8px",
4799
+ borderRadius: "4px",
4800
+ border: "1px solid var(--color-border)",
4801
+ backgroundColor: "var(--color-bg)",
4802
+ color: "var(--color-text)",
4803
+ cursor: "pointer",
4804
+ fontSize: "14px"
4805
+ },
4806
+ children: n.map((r) => /* @__PURE__ */ w("option", { value: r.code, children: r.label }, r.code))
4807
+ }
4808
+ )
4809
+ ] });
4810
+ }
4811
+ function nu({
4812
+ variant: e = "text",
4813
+ width: t,
4814
+ height: n,
4815
+ className: o = "",
4816
+ count: r = 1
4817
+ }) {
4818
+ const s = `skeleton-${e}`, i = {};
4819
+ return t && (i.width = typeof t == "number" ? `${t}px` : t), n && (i.height = typeof n == "number" ? `${n}px` : n), r > 1 ? /* @__PURE__ */ w("div", { "aria-busy": "true", "aria-label": "Loading content", children: Array.from({ length: r }, (a, l) => /* @__PURE__ */ w(
4820
+ "div",
4821
+ {
4822
+ className: `skeleton ${s} ${o}`,
4823
+ style: l === r - 1 ? { ...i, width: "60%" } : i
4824
+ },
4825
+ l
4826
+ )) }) : /* @__PURE__ */ w(
4827
+ "div",
4828
+ {
4829
+ className: `skeleton ${s} ${o}`,
4830
+ style: i,
4831
+ "aria-busy": "true",
4832
+ "aria-label": "Loading"
4833
+ }
4834
+ );
4835
+ }
4836
+ const Wc = {
4837
+ sm: "btn-sm",
4838
+ md: "",
4839
+ lg: "btn-lg"
4840
+ }, ou = te.forwardRef(
4841
+ function({
4842
+ variant: t = "default",
4843
+ loading: n = !1,
4844
+ size: o = "md",
4845
+ disabled: r,
4846
+ className: s = "",
4847
+ children: i,
4848
+ ...a
4849
+ }, l) {
4850
+ const d = [
4851
+ "btn",
4852
+ t !== "default" ? `btn-${t}` : "",
4853
+ n ? "btn-loading" : "",
4854
+ Wc[o] || "",
4855
+ s
4856
+ ].filter(Boolean).join(" ");
4857
+ return /* @__PURE__ */ w(
4858
+ "button",
4859
+ {
4860
+ ref: l,
4861
+ className: d,
4862
+ disabled: r || n,
4863
+ "aria-disabled": r || n || void 0,
4864
+ "aria-busy": n || void 0,
4865
+ ...a,
4866
+ children: i
4867
+ }
4868
+ );
4869
+ }
4870
+ ), jc = {
4871
+ success: { borderLeft: "3px solid var(--color-success)" },
4872
+ error: { borderLeft: "3px solid var(--color-error)" },
4873
+ warning: { borderLeft: "3px solid var(--color-warning)" },
4874
+ info: { borderLeft: "3px solid var(--color-primary)" }
4875
+ }, zc = {
4876
+ success: "✓",
4877
+ error: "✕",
4878
+ warning: "⚠",
4879
+ info: "ℹ"
4880
+ };
4881
+ function Uc({
4882
+ message: e,
4883
+ variant: t = "info",
4884
+ duration: n = 4e3,
4885
+ onDismiss: o
4886
+ }) {
4887
+ return Tt(() => {
4888
+ if (n > 0 && o) {
4889
+ const r = setTimeout(o, n);
4890
+ return () => clearTimeout(r);
4891
+ }
4892
+ }, [n, o]), /* @__PURE__ */ w(
4893
+ "div",
4894
+ {
4895
+ className: `toast toast-${t}`,
4896
+ role: "alert",
4897
+ "aria-live": "assertive",
4898
+ "aria-atomic": "true",
4899
+ style: jc[t],
4900
+ children: /* @__PURE__ */ Xe(
4901
+ "div",
4902
+ {
4903
+ style: {
4904
+ display: "flex",
4905
+ alignItems: "center",
4906
+ gap: "var(--spacing-sm)"
4907
+ },
4908
+ children: [
4909
+ /* @__PURE__ */ w("span", { "aria-hidden": "true", style: { fontWeight: 600 }, children: zc[t] }),
4910
+ /* @__PURE__ */ w("span", { children: e }),
4911
+ o && /* @__PURE__ */ w(
4912
+ "button",
4913
+ {
4914
+ onClick: o,
4915
+ "aria-label": "Dismiss notification",
4916
+ style: {
4917
+ marginLeft: "auto",
4918
+ background: "none",
4919
+ border: "none",
4920
+ cursor: "pointer",
4921
+ color: "var(--color-text-muted)",
4922
+ fontSize: "1rem",
4923
+ padding: "0 var(--spacing-xs)"
4924
+ },
4925
+ children: "✕"
4926
+ }
4927
+ )
4928
+ ]
4929
+ }
4930
+ )
4931
+ }
4932
+ );
4933
+ }
4934
+ function ru({
4935
+ toasts: e,
4936
+ onDismiss: t
4937
+ }) {
4938
+ return /* @__PURE__ */ w(
4939
+ "div",
4940
+ {
4941
+ "aria-label": "Notifications",
4942
+ style: {
4943
+ position: "fixed",
4944
+ bottom: "var(--spacing-lg)",
4945
+ right: "var(--spacing-lg)",
4946
+ zIndex: 60,
4947
+ display: "flex",
4948
+ flexDirection: "column",
4949
+ gap: "var(--spacing-sm)",
4950
+ pointerEvents: "none"
4951
+ },
4952
+ children: e.map((n) => /* @__PURE__ */ w("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ w(Uc, { ...n, onDismiss: () => t(n.id) }) }, n.id))
4953
+ }
4954
+ );
4955
+ }
4956
+ function su(e) {
4957
+ return /* @__PURE__ */ w(Nc, { ...e });
4958
+ }
4959
+ function iu(e) {
4960
+ return /* @__PURE__ */ w(Tc, { ...e });
4961
+ }
4962
+ export {
4963
+ ou as Button,
4964
+ tu as LocaleSwitcher,
4965
+ nu as Skeleton,
4966
+ eu as StateBadge,
4967
+ Qc as TamaguiProvider,
4968
+ su as TamaguiStack,
4969
+ iu as TamaguiText,
4970
+ qc as ThemeProvider,
4971
+ Jc as ThemeToggle,
4972
+ Uc as Toast,
4973
+ ru as ToastContainer,
4974
+ $n as colors,
4975
+ Dc as generateTamaguiTokensAndThemes,
4976
+ as as spacing,
4977
+ kc as tamaguiConfig,
4978
+ Oc as typography,
4979
+ gs as useTheme
4980
+ };
4981
+ //# sourceMappingURL=index.js.map