@tachui/responsive 0.8.1-alpha → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2881 @@
1
+ import { globalModifierRegistry as W } from "@tachui/registry";
2
+ import { BaseModifier as se } from "@tachui/modifiers";
3
+ import { createSignal as E, createEffect as V, isSignal as T, isComputed as j, getThemeSignal as me, createComputed as m, createMemo as ge } from "@tachui/core";
4
+ const g = {
5
+ Clean: 0,
6
+ Check: 1,
7
+ Dirty: 2,
8
+ Disposed: 3
9
+ };
10
+ let be = 0;
11
+ const ve = Math.random().toString(36).substr(2, 6);
12
+ let K = null, Z = null;
13
+ const ye = /* @__PURE__ */ new Set();
14
+ ye.add(ve);
15
+ const D = {
16
+ get currentComputation() {
17
+ return K;
18
+ },
19
+ set currentComputation(s) {
20
+ K = s;
21
+ },
22
+ get currentOwner() {
23
+ return Z;
24
+ },
25
+ set currentOwner(s) {
26
+ Z = s;
27
+ }
28
+ };
29
+ function ne() {
30
+ return D.currentComputation;
31
+ }
32
+ function xe() {
33
+ return D.currentOwner;
34
+ }
35
+ class we {
36
+ id;
37
+ owner;
38
+ fn;
39
+ sources = /* @__PURE__ */ new Set();
40
+ // Signals this computation depends on
41
+ observers = /* @__PURE__ */ new Set();
42
+ // Computations that depend on this
43
+ state = g.Dirty;
44
+ value = void 0;
45
+ constructor(e, t = null) {
46
+ this.id = ++be, this.fn = e, this.owner = t, t && !t.disposed && t.sources.add(this);
47
+ }
48
+ execute() {
49
+ if (this.state === g.Disposed)
50
+ return this.value;
51
+ for (const t of this.sources)
52
+ t && typeof t == "object" && "removeObserver" in t && t.removeObserver(this);
53
+ this.sources.clear();
54
+ const e = D.currentComputation;
55
+ D.currentComputation = this;
56
+ try {
57
+ return this.state = g.Clean, this.value = this.fn(), this.value;
58
+ } catch (t) {
59
+ throw this.state = g.Disposed, (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error in computation:", t), t;
60
+ } finally {
61
+ D.currentComputation = e;
62
+ }
63
+ }
64
+ dispose() {
65
+ if (this.state !== g.Disposed) {
66
+ this.state = g.Disposed;
67
+ for (const e of this.sources)
68
+ e && typeof e == "object" && "removeObserver" in e && e.removeObserver(this);
69
+ this.sources.clear();
70
+ for (const e of this.observers)
71
+ e.sources.delete(this);
72
+ this.observers.clear(), this.owner && !this.owner.disposed && this.owner.sources.delete(this);
73
+ }
74
+ }
75
+ }
76
+ typeof globalThis.__DEV__ > "u" && (globalThis.__DEV__ = process.env.NODE_ENV !== "production");
77
+ const Se = (s, e) => s === e;
78
+ var F = /* @__PURE__ */ ((s) => (s[s.Immediate = 0] = "Immediate", s[s.High = 1] = "High", s[s.Normal = 2] = "Normal", s[s.Low = 3] = "Low", s[s.Idle = 4] = "Idle", s))(F || {});
79
+ class Ce extends we {
80
+ type = "computed";
81
+ priority;
82
+ _hasValue = !1;
83
+ _error = null;
84
+ equalsFn;
85
+ options;
86
+ constructor(e, t = {}, i = xe()) {
87
+ super(e, i), this.priority = t.priority ?? F.Normal, this.equalsFn = t.equals ?? Se, this.options = t;
88
+ }
89
+ /**
90
+ * Get the computed value, tracking dependency and lazily computing
91
+ */
92
+ getValue() {
93
+ const e = ne();
94
+ return e && e.state !== g.Disposed && (this.observers.add(e), e.sources.add(this)), (this.state === g.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
95
+ }
96
+ /**
97
+ * Get the current value without tracking dependency
98
+ */
99
+ peek() {
100
+ return (this.state === g.Dirty || !this._hasValue) && (this.execute(), this._hasValue = !0), this.value;
101
+ }
102
+ /**
103
+ * Remove an observer (cleanup)
104
+ */
105
+ removeObserver(e) {
106
+ this.observers.delete(e), this.options.releaseOnNoObservers === !0 && this.observers.size === 0 && e.state === g.Disposed && this.releaseSources();
107
+ }
108
+ releaseSources() {
109
+ for (const e of this.sources)
110
+ "removeObserver" in e && e.removeObserver(this);
111
+ this.sources.clear(), this._hasValue = !1, this.state = g.Dirty;
112
+ }
113
+ /**
114
+ * Execute the computation and notify observers
115
+ */
116
+ execute() {
117
+ const e = this._hasValue ? this.value : void 0, t = super.execute();
118
+ if (!this._hasValue || !this.equalsFn(e, t))
119
+ for (const i of this.observers)
120
+ i.state !== g.Disposed && (i.state = g.Dirty, "execute" in i && typeof i.execute == "function" && queueMicrotask(() => {
121
+ i.state === g.Dirty && i.execute();
122
+ }));
123
+ return t;
124
+ }
125
+ /**
126
+ * Notify method for ReactiveNode compatibility
127
+ */
128
+ notify() {
129
+ this.execute();
130
+ }
131
+ /**
132
+ * Complete cleanup for memory management
133
+ */
134
+ cleanup() {
135
+ for (const e of this.sources)
136
+ "removeObserver" in e && e.removeObserver(this);
137
+ this.sources.clear();
138
+ for (const e of this.observers)
139
+ e.sources.delete(this);
140
+ this.observers.clear(), this._hasValue = !1, this._error = null, this.state = g.Disposed;
141
+ }
142
+ /**
143
+ * Dispose the computed value
144
+ */
145
+ dispose() {
146
+ this.cleanup(), super.dispose();
147
+ }
148
+ /**
149
+ * Debug information
150
+ */
151
+ [Symbol.for("tachui.debug")]() {
152
+ return {
153
+ id: this.id,
154
+ type: this.type,
155
+ value: this._hasValue ? this.value : void 0,
156
+ hasValue: this._hasValue,
157
+ error: this._error?.message,
158
+ state: this.state,
159
+ sourceCount: this.sources.size,
160
+ observerCount: this.observers.size,
161
+ priority: F[this.priority],
162
+ debugName: this.options.debugName,
163
+ equalsFn: this.equalsFn.name || "anonymous"
164
+ };
165
+ }
166
+ toString() {
167
+ return `Computed(${this.options.debugName || this.id}): ${this._hasValue ? this.value : "no value"}`;
168
+ }
169
+ }
170
+ function $e(s, e) {
171
+ const t = new Ce(s, e), i = t.getValue.bind(t);
172
+ return i.peek = t.peek.bind(t), Object.defineProperty(i, Symbol.for("tachui.computed"), {
173
+ value: t,
174
+ enumerable: !1
175
+ }), i;
176
+ }
177
+ let Be = 0;
178
+ class ke {
179
+ id;
180
+ observers = /* @__PURE__ */ new Set();
181
+ _value;
182
+ constructor(e) {
183
+ this.id = ++Be, this._value = e;
184
+ }
185
+ /**
186
+ * Get the current value and track dependency
187
+ */
188
+ getValue() {
189
+ const e = ne();
190
+ return e && e.state !== g.Disposed && (this.observers.add(e), e.sources.add(this)), this._value;
191
+ }
192
+ /**
193
+ * Get the current value without tracking dependency
194
+ */
195
+ peek() {
196
+ return this._value;
197
+ }
198
+ /**
199
+ * Set a new value and notify observers
200
+ */
201
+ set(e) {
202
+ const t = typeof e == "function" ? e(this._value) : e;
203
+ return t !== this._value && (this._value = t, this.notify()), t;
204
+ }
205
+ /**
206
+ * Notify all observers that this signal has changed
207
+ */
208
+ notify() {
209
+ for (const e of this.observers)
210
+ e.state !== g.Disposed && (e.state = g.Dirty, Re(e));
211
+ }
212
+ /**
213
+ * Remove an observer (cleanup)
214
+ */
215
+ removeObserver(e) {
216
+ this.observers.delete(e);
217
+ }
218
+ /**
219
+ * Get debug information about this signal
220
+ */
221
+ [Symbol.for("tachui.debug")]() {
222
+ return {
223
+ id: this.id,
224
+ value: this._value,
225
+ observerCount: this.observers.size,
226
+ type: "Signal"
227
+ };
228
+ }
229
+ }
230
+ const q = /* @__PURE__ */ new Set();
231
+ let L = !1;
232
+ function Re(s) {
233
+ q.add(s), L || queueMicrotask(Me);
234
+ }
235
+ function Me() {
236
+ if (!L) {
237
+ L = !0;
238
+ try {
239
+ for (; q.size > 0; ) {
240
+ const s = Array.from(q).sort((e, t) => e.id - t.id);
241
+ q.clear();
242
+ for (const e of s)
243
+ e.state === g.Dirty && e.execute();
244
+ }
245
+ } finally {
246
+ L = !1;
247
+ }
248
+ }
249
+ }
250
+ function Oe(s) {
251
+ const e = new ke(s), t = e.getValue.bind(e);
252
+ t.peek = e.peek.bind(e);
253
+ const i = e.set.bind(e);
254
+ return Object.defineProperty(t, Symbol.for("tachui.signal"), {
255
+ value: e,
256
+ enumerable: !1
257
+ }), [t, i];
258
+ }
259
+ const [Ve, st] = Oe("light");
260
+ $e(() => {
261
+ const s = Ve();
262
+ return s === "system" ? Ee() : s;
263
+ });
264
+ function Ee() {
265
+ return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
266
+ }
267
+ process.env.NODE_ENV, process.env.NODE_ENV;
268
+ process.env.NODE_ENV === "development" && console.log("📤 Created RegistryAdapter for globalModifierRegistry", {
269
+ registryId: W.instanceId,
270
+ currentSize: W.list().length
271
+ });
272
+ const Ie = "0.8.8", Te = Ie, Y = /* @__PURE__ */ new WeakSet(), X = /* @__PURE__ */ new WeakMap(), je = {
273
+ name: "@tachui/core",
274
+ version: Te,
275
+ author: "TachUI Team",
276
+ verified: !0
277
+ };
278
+ function De(s) {
279
+ Y.has(s) || (s.setFeatureFlags({
280
+ metadataRegistration: !0
281
+ }), Y.add(s));
282
+ }
283
+ function Pe(s, e) {
284
+ let t = X.get(s);
285
+ t || (t = /* @__PURE__ */ new Set(), X.set(s, t)), !t.has(e.name) && (s.registerPlugin(e), t.add(e.name));
286
+ }
287
+ function _e(s, e, t, i = W, r = je) {
288
+ De(i), Pe(i, r), i.has(s) || i.register(s, e), i.getMetadata(s) || i.registerMetadata({
289
+ ...t,
290
+ name: s,
291
+ plugin: r.name
292
+ });
293
+ }
294
+ const ze = "0.8.8", Ne = ze, oe = {
295
+ base: "0px",
296
+ // Mobile-first base
297
+ sm: "640px",
298
+ // Small tablets and large phones
299
+ md: "768px",
300
+ // Tablets
301
+ lg: "1024px",
302
+ // Laptops and small desktops
303
+ xl: "1280px",
304
+ // Large desktops
305
+ "2xl": "1536px"
306
+ // Extra large screens
307
+ };
308
+ function w(s) {
309
+ return typeof s == "object" && s !== null && !Array.isArray(s) && Object.keys(s).some(
310
+ (e) => ["base", "sm", "md", "lg", "xl", "2xl"].includes(e)
311
+ );
312
+ }
313
+ function J(s) {
314
+ return ["base", "sm", "md", "lg", "xl", "2xl"].includes(s);
315
+ }
316
+ let z = {
317
+ ...oe
318
+ };
319
+ const [ae, ee] = E("base"), [ce, qe] = E({
320
+ width: 0,
321
+ height: 0
322
+ });
323
+ function nt(s) {
324
+ Ae(s), z = {
325
+ ...oe,
326
+ ...s
327
+ }, _(), typeof window < "u" && window.addEventListener("resize", _);
328
+ }
329
+ function P() {
330
+ return { ...z };
331
+ }
332
+ function x() {
333
+ return ae;
334
+ }
335
+ function ot() {
336
+ return ce;
337
+ }
338
+ function at() {
339
+ typeof window > "u" || (H(), _(), window.addEventListener("resize", () => {
340
+ H(), _();
341
+ }), window.addEventListener("orientationchange", () => {
342
+ setTimeout(() => {
343
+ H(), _();
344
+ }, 100);
345
+ }));
346
+ }
347
+ function S() {
348
+ const s = ae(), e = ce();
349
+ return {
350
+ current: s,
351
+ width: e.width,
352
+ height: e.height,
353
+ isAbove: (t) => te(s, t),
354
+ isBelow: (t) => ie(s, t),
355
+ isBetween: (t, i) => te(s, t) && ie(s, i),
356
+ matches: (t) => window.matchMedia(t).matches
357
+ };
358
+ }
359
+ function G(s) {
360
+ const e = z[s];
361
+ return e.endsWith("px") ? parseInt(e, 10) : e.endsWith("em") || e.endsWith("rem") ? parseInt(e, 10) * 16 : parseInt(e, 10) || 0;
362
+ }
363
+ function y(s) {
364
+ return ["base", "sm", "md", "lg", "xl", "2xl"].indexOf(s);
365
+ }
366
+ function te(s, e) {
367
+ return y(s) > y(e);
368
+ }
369
+ function ie(s, e) {
370
+ return y(s) < y(e);
371
+ }
372
+ function Le(s) {
373
+ return s === "base" ? "" : `(min-width: ${z[s]})`;
374
+ }
375
+ function ct(s, e) {
376
+ const t = [];
377
+ if (s !== "base" && t.push(`(min-width: ${z[s]})`), e && e !== "2xl") {
378
+ const i = ["sm", "md", "lg", "xl", "2xl"], r = i.indexOf(e);
379
+ if (r >= 0 && r < i.length - 1) {
380
+ const o = i[r + 1], n = `${G(o) - 1}px`;
381
+ t.push(`(max-width: ${n})`);
382
+ }
383
+ }
384
+ return t.length > 0 ? t.join(" and ") : "";
385
+ }
386
+ function Q() {
387
+ return ["base", "sm", "md", "lg", "xl", "2xl"];
388
+ }
389
+ function dt(s) {
390
+ const e = Q(), t = e.indexOf(s);
391
+ return t >= 0 ? e.slice(t + 1) : [];
392
+ }
393
+ function ut(s) {
394
+ const e = Q(), t = e.indexOf(s);
395
+ return t > 0 ? e.slice(0, t) : [];
396
+ }
397
+ function _() {
398
+ if (typeof window > "u")
399
+ return;
400
+ const s = window.innerWidth, e = Q().reverse();
401
+ for (const t of e)
402
+ if (t === "base" || s >= G(t)) {
403
+ ee(t);
404
+ return;
405
+ }
406
+ ee("base");
407
+ }
408
+ function H() {
409
+ typeof window < "u" && qe({
410
+ width: window.innerWidth,
411
+ height: window.innerHeight
412
+ });
413
+ }
414
+ function Ae(s) {
415
+ for (const [t, i] of Object.entries(s)) {
416
+ if (!J(t))
417
+ throw new Error(
418
+ `Invalid breakpoint key: "${t}". Valid keys are: base, sm, md, lg, xl, 2xl`
419
+ );
420
+ if (typeof i != "string")
421
+ throw new Error(
422
+ `Breakpoint value for "${t}" must be a string (e.g., "768px")`
423
+ );
424
+ if (!i.match(/^\d+(\.\d+)?(px|em|rem|%)$/))
425
+ throw new Error(
426
+ `Invalid breakpoint value for "${t}": "${i}". Must be a valid CSS length (e.g., "768px", "48em")`
427
+ );
428
+ }
429
+ const e = Object.keys(s).filter(J).sort((t, i) => y(t) - y(i));
430
+ for (let t = 1; t < e.length; t++) {
431
+ const i = e[t - 1], r = e[t], o = s[i], n = s[r];
432
+ if (G(i) >= parseInt(n, 10))
433
+ throw new Error(
434
+ `Breakpoint "${r}" (${n}) must be larger than "${i}" (${o})`
435
+ );
436
+ }
437
+ }
438
+ const lt = {
439
+ // Tailwind CSS (default)
440
+ tailwind: {
441
+ sm: "640px",
442
+ md: "768px",
443
+ lg: "1024px",
444
+ xl: "1280px",
445
+ "2xl": "1536px"
446
+ },
447
+ // Bootstrap
448
+ bootstrap: {
449
+ sm: "576px",
450
+ md: "768px",
451
+ lg: "992px",
452
+ xl: "1200px",
453
+ "2xl": "1400px"
454
+ },
455
+ // Material Design
456
+ material: {
457
+ sm: "600px",
458
+ md: "960px",
459
+ lg: "1280px",
460
+ xl: "1920px",
461
+ "2xl": "2560px"
462
+ },
463
+ // Custom mobile-first
464
+ mobileFocus: {
465
+ sm: "480px",
466
+ md: "768px",
467
+ lg: "1024px",
468
+ xl: "1200px",
469
+ "2xl": "1440px"
470
+ }
471
+ };
472
+ class de {
473
+ options;
474
+ constructor(e) {
475
+ this.options = {
476
+ generateMinified: !1,
477
+ includeComments: !0,
478
+ optimizeOutput: !0,
479
+ mobileFirst: !0,
480
+ ...e
481
+ };
482
+ }
483
+ /**
484
+ * Generate complete responsive CSS from a style configuration
485
+ */
486
+ generateResponsiveCSS(e) {
487
+ const t = [], i = [], r = {};
488
+ let o = !1;
489
+ for (const [n, a] of Object.entries(e))
490
+ if (w(a)) {
491
+ o = !0;
492
+ const c = this.generatePropertyMediaQueries(n, a);
493
+ t.push(...c.mediaQueries), c.baseStyles && Object.assign(r, c.baseStyles);
494
+ } else
495
+ r[this.toCSSPropertyName(n)] = this.formatCSSValue(
496
+ n,
497
+ a
498
+ );
499
+ return i.push(...this.generateCSSRules(t, r)), {
500
+ cssRules: i,
501
+ mediaQueries: t,
502
+ fallbackStyles: r,
503
+ hasResponsiveStyles: o
504
+ };
505
+ }
506
+ /**
507
+ * Generate media queries for a single property
508
+ */
509
+ generatePropertyMediaQueries(e, t) {
510
+ const i = [], r = {}, o = Q();
511
+ for (const n of o) {
512
+ const a = t[n];
513
+ if (a === void 0) continue;
514
+ const c = this.toCSSPropertyName(e), d = this.formatCSSValue(e, a);
515
+ if (n === "base")
516
+ r[c] = d;
517
+ else {
518
+ const l = Le(n), p = { [c]: d };
519
+ i.push({
520
+ breakpoint: n,
521
+ query: l,
522
+ styles: p,
523
+ selector: this.options.selector
524
+ });
525
+ }
526
+ }
527
+ return {
528
+ mediaQueries: i,
529
+ baseStyles: Object.keys(r).length > 0 ? r : void 0
530
+ };
531
+ }
532
+ /**
533
+ * Generate CSS rules from media queries and base styles
534
+ */
535
+ generateCSSRules(e, t) {
536
+ const i = [];
537
+ if (Object.keys(t).length > 0) {
538
+ const o = this.generateCSSRule(this.options.selector, t);
539
+ i.push(o);
540
+ }
541
+ const r = this.groupQueriesByMediaQuery(e);
542
+ for (const [o, n] of Object.entries(r)) {
543
+ if (o === "") continue;
544
+ const a = {};
545
+ for (const d of n)
546
+ Object.assign(a, d.styles);
547
+ const c = this.generateMediaQueryRule(
548
+ o,
549
+ this.options.selector,
550
+ a
551
+ );
552
+ i.push(c);
553
+ }
554
+ return i;
555
+ }
556
+ /**
557
+ * Group media queries by their query string for optimization
558
+ */
559
+ groupQueriesByMediaQuery(e) {
560
+ const t = {};
561
+ for (const i of e)
562
+ t[i.query] || (t[i.query] = []), t[i.query].push(i);
563
+ return t;
564
+ }
565
+ /**
566
+ * Generate a single CSS rule
567
+ */
568
+ generateCSSRule(e, t) {
569
+ const { generateMinified: i, includeComments: r } = this.options, o = i ? "" : " ", n = i ? "" : `
570
+ `, a = i ? "" : " ";
571
+ let c = `${e}${a}{${n}`;
572
+ for (const [d, l] of Object.entries(t))
573
+ c += `${o}${d}:${a}${l};${n}`;
574
+ return c += `}${n}`, r && !i && (c = `/* Base styles (mobile-first) */${n}${c}`), c;
575
+ }
576
+ /**
577
+ * Generate a CSS media query rule
578
+ */
579
+ generateMediaQueryRule(e, t, i) {
580
+ const { generateMinified: r, includeComments: o } = this.options, n = r ? "" : " ", a = r ? "" : " ", c = r ? "" : `
581
+ `, d = r ? "" : " ";
582
+ let l = `@media ${e}${d}{${c}`;
583
+ l += `${n}${t}${d}{${c}`;
584
+ for (const [p, f] of Object.entries(i))
585
+ l += `${a}${p}:${d}${f};${c}`;
586
+ return l += `${n}}${c}`, l += `}${c}`, o && !r && (l = `/* ${this.getBreakpointFromQuery(e)} styles */${c}${l}`), l;
587
+ }
588
+ /**
589
+ * Convert camelCase property to CSS kebab-case
590
+ */
591
+ toCSSProperty(e) {
592
+ return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
593
+ }
594
+ /**
595
+ * Format CSS value with appropriate units and validation
596
+ */
597
+ formatCSSValue(e, t) {
598
+ if (t == null)
599
+ return "inherit";
600
+ if (typeof t == "number") {
601
+ const i = [
602
+ "opacity",
603
+ "z-index",
604
+ "font-weight",
605
+ "line-height",
606
+ "flex-grow",
607
+ "flex-shrink",
608
+ "order",
609
+ "grid-column-start",
610
+ "grid-column-end",
611
+ "grid-row-start",
612
+ "grid-row-end"
613
+ ], r = this.toCSSProperty(e);
614
+ if (i.includes(r))
615
+ return this.addImportantIfNeeded(e, t.toString());
616
+ if ([
617
+ "width",
618
+ "height",
619
+ "min-width",
620
+ "max-width",
621
+ "min-height",
622
+ "max-height",
623
+ "padding",
624
+ "margin",
625
+ "border-width",
626
+ "border-radius",
627
+ "top",
628
+ "right",
629
+ "bottom",
630
+ "left",
631
+ "font-size",
632
+ "letter-spacing",
633
+ "text-indent"
634
+ ].some((n) => r.includes(n)))
635
+ return this.addImportantIfNeeded(e, `${t}px`);
636
+ }
637
+ return this.addImportantIfNeeded(e, t.toString());
638
+ }
639
+ /**
640
+ * Add !important for properties that need to override base component styles
641
+ */
642
+ addImportantIfNeeded(e, t) {
643
+ const i = [
644
+ "flexDirection",
645
+ "flex-direction",
646
+ "justifyContent",
647
+ "justify-content",
648
+ "alignItems",
649
+ "align-items",
650
+ "display"
651
+ ], r = this.toCSSProperty(e);
652
+ return i.includes(e) || i.includes(r) ? `${t} !important` : t;
653
+ }
654
+ /**
655
+ * Convert property name to appropriate CSS property (including custom properties)
656
+ */
657
+ toCSSPropertyName(e) {
658
+ return this.toCSSProperty(e);
659
+ }
660
+ /**
661
+ * Extract breakpoint name from media query for comments
662
+ */
663
+ getBreakpointFromQuery(e) {
664
+ const t = P();
665
+ for (const [i, r] of Object.entries(t))
666
+ if (e.includes(r))
667
+ return i;
668
+ return "custom";
669
+ }
670
+ }
671
+ function pt(s, e, t, i) {
672
+ if (!w(t)) {
673
+ const a = e.replace(
674
+ /[A-Z]/g,
675
+ (d) => `-${d.toLowerCase()}`
676
+ ), c = typeof t == "number" ? `${t}px` : t.toString();
677
+ return [`${s} { ${a}: ${c}; }`];
678
+ }
679
+ const r = new de({ selector: s, ...i }), o = { [e]: t };
680
+ return r.generateResponsiveCSS(o).cssRules;
681
+ }
682
+ function ht(s, e, t) {
683
+ const { generateMinified: i = !1 } = t || {}, r = i ? "" : " ", o = i ? "" : `
684
+ `, n = i ? "" : " ";
685
+ let a = `@media ${e.query}${n}{${o}`;
686
+ a += `${r}${s}${n}{${o}`;
687
+ for (const [c, d] of Object.entries(e.styles)) {
688
+ const l = c.replace(
689
+ /[A-Z]/g,
690
+ (f) => `-${f.toLowerCase()}`
691
+ ), p = typeof d == "number" ? `${d}px` : d.toString();
692
+ a += `${r}${r}${l}:${n}${p};${o}`;
693
+ }
694
+ return a += `${r}}${o}`, a += `}${o}`, a;
695
+ }
696
+ class ue {
697
+ static styleSheet = null;
698
+ static injectedRules = /* @__PURE__ */ new Set();
699
+ /**
700
+ * Get or create the tachUI responsive stylesheet
701
+ */
702
+ static getStyleSheet() {
703
+ if (this.styleSheet)
704
+ return this.styleSheet;
705
+ const e = document.createElement("style");
706
+ return e.setAttribute("data-tachui-responsive", "true"), document.head.appendChild(e), this.styleSheet = e.sheet, this.styleSheet;
707
+ }
708
+ /**
709
+ * Inject CSS rules into the document
710
+ */
711
+ static injectCSS(e) {
712
+ if (typeof document > "u")
713
+ return;
714
+ const t = this.getStyleSheet();
715
+ for (const i of e)
716
+ if (!this.injectedRules.has(i))
717
+ try {
718
+ t.insertRule(i, t.cssRules.length), this.injectedRules.add(i);
719
+ } catch (r) {
720
+ console.warn("Failed to inject CSS rule:", i, r);
721
+ }
722
+ }
723
+ /**
724
+ * Clear all injected responsive CSS
725
+ */
726
+ static clearCSS() {
727
+ if (this.styleSheet) {
728
+ for (; this.styleSheet.cssRules.length > 0; )
729
+ this.styleSheet.deleteRule(0);
730
+ this.injectedRules.clear();
731
+ }
732
+ }
733
+ /**
734
+ * Check if a rule has been injected
735
+ */
736
+ static hasRule(e) {
737
+ return this.injectedRules.has(e);
738
+ }
739
+ }
740
+ class Qe {
741
+ cache = /* @__PURE__ */ new Map();
742
+ hitCount = 0;
743
+ missCount = 0;
744
+ get(e) {
745
+ const t = this.cache.get(e);
746
+ return t ? this.hitCount++ : this.missCount++, t;
747
+ }
748
+ set(e, t) {
749
+ this.cache.set(e, t);
750
+ }
751
+ clear() {
752
+ this.cache.clear(), this.hitCount = 0, this.missCount = 0;
753
+ }
754
+ getStats() {
755
+ return {
756
+ size: this.cache.size,
757
+ hitRate: this.hitCount / (this.hitCount + this.missCount) || 0,
758
+ hits: this.hitCount,
759
+ misses: this.missCount
760
+ };
761
+ }
762
+ }
763
+ const R = new Qe();
764
+ class ft {
765
+ static BATCH_SIZE = 50;
766
+ static ruleQueue = [];
767
+ static flushTimer = null;
768
+ /**
769
+ * Generate CSS with caching and batching
770
+ */
771
+ static generateOptimizedCSS(e, t, i = {}) {
772
+ const {
773
+ minify: r = process.env.NODE_ENV === "production",
774
+ batch: o = !0,
775
+ deduplicate: n = !0
776
+ } = i, a = this.createCacheKey(e, t, { minify: r });
777
+ if (n) {
778
+ const d = R.get(a);
779
+ if (d)
780
+ return d;
781
+ }
782
+ const c = this.generateCSS(e, t, { minify: r });
783
+ return n && R.set(a, c), o && c.trim() ? (this.addToBatch(c), "") : c;
784
+ }
785
+ /**
786
+ * Create cache key for CSS rule
787
+ */
788
+ static createCacheKey(e, t, i) {
789
+ return JSON.stringify({ selector: e, config: t, options: i });
790
+ }
791
+ /**
792
+ * Generate CSS without optimizations (for comparison)
793
+ */
794
+ static generateCSS(e, t, i) {
795
+ const { minify: r = !1 } = i, o = r ? "" : " ", n = r ? "" : `
796
+ `, a = r ? "" : " ";
797
+ let c = "";
798
+ const d = /* @__PURE__ */ new Set(), l = this.extractBaseStyles(t);
799
+ Object.keys(l).length > 0 && (c += `${e}${a}{${n}`, c += this.generateProperties(l, o, n, a), c += `}${n}`);
800
+ for (const [p, f] of Object.entries(t))
801
+ if (typeof f == "object" && f !== null)
802
+ for (const [v, C] of Object.entries(f)) {
803
+ if (v === "base") continue;
804
+ const k = this.getMediaQuery(v), I = `${k}:${p}`;
805
+ d.has(I) || (c += `@media ${k}${a}{${n}`, c += `${o}${e}${a}{${n}`, c += `${o}${o}${this.propertyToCSS(p)}:${a}${this.valueToCSS(C)};${n}`, c += `${o}}${n}`, c += `}${n}`, d.add(I));
806
+ }
807
+ return c;
808
+ }
809
+ /**
810
+ * Add CSS to batch queue
811
+ */
812
+ static addToBatch(e) {
813
+ this.ruleQueue.push(e), this.ruleQueue.length >= this.BATCH_SIZE ? this.flushBatch() : this.flushTimer || (this.flushTimer = window.setTimeout(() => this.flushBatch(), 16));
814
+ }
815
+ /**
816
+ * Flush batched CSS rules
817
+ */
818
+ static flushBatch() {
819
+ if (this.ruleQueue.length === 0) return;
820
+ const e = this.ruleQueue.join("");
821
+ this.ruleQueue = [], this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.injectCSS(e);
822
+ }
823
+ /**
824
+ * Inject CSS into document
825
+ */
826
+ static injectCSS(e) {
827
+ if (typeof document > "u") return;
828
+ let t = document.getElementById(
829
+ "tachui-responsive-styles"
830
+ );
831
+ t || (t = document.createElement("style"), t.id = "tachui-responsive-styles", t.type = "text/css", document.head.appendChild(t)), t.appendChild(document.createTextNode(e));
832
+ }
833
+ /**
834
+ * Extract base (non-responsive) styles
835
+ */
836
+ static extractBaseStyles(e) {
837
+ const t = {};
838
+ for (const [i, r] of Object.entries(e))
839
+ typeof r != "object" || r === null ? t[i] = r : "base" in r && (t[i] = r.base);
840
+ return t;
841
+ }
842
+ /**
843
+ * Generate CSS properties
844
+ */
845
+ static generateProperties(e, t, i, r) {
846
+ let o = "";
847
+ for (const [n, a] of Object.entries(e))
848
+ a !== void 0 && (o += `${t}${this.propertyToCSS(n)}:${r}${this.valueToCSS(a)};${i}`);
849
+ return o;
850
+ }
851
+ /**
852
+ * Convert property name to CSS
853
+ */
854
+ static propertyToCSS(e) {
855
+ return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
856
+ }
857
+ /**
858
+ * Convert value to CSS
859
+ */
860
+ static valueToCSS(e) {
861
+ return typeof e == "number" ? `${e}px` : e.toString();
862
+ }
863
+ /**
864
+ * Get media query for breakpoint
865
+ */
866
+ static getMediaQuery(e) {
867
+ return {
868
+ base: "",
869
+ sm: "(min-width: 640px)",
870
+ md: "(min-width: 768px)",
871
+ lg: "(min-width: 1024px)",
872
+ xl: "(min-width: 1280px)",
873
+ "2xl": "(min-width: 1536px)"
874
+ }[e] || e;
875
+ }
876
+ /**
877
+ * Force flush any pending batched CSS
878
+ */
879
+ static flush() {
880
+ this.flushBatch();
881
+ }
882
+ /**
883
+ * Get performance statistics
884
+ */
885
+ static getStats() {
886
+ return {
887
+ cache: R.getStats(),
888
+ batch: {
889
+ queueSize: this.ruleQueue.length,
890
+ batchSize: this.BATCH_SIZE
891
+ }
892
+ };
893
+ }
894
+ /**
895
+ * Clear all caches and reset performance counters
896
+ */
897
+ static reset() {
898
+ R.clear(), this.ruleQueue = [], this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null);
899
+ }
900
+ }
901
+ class A {
902
+ static measurements = /* @__PURE__ */ new Map();
903
+ /**
904
+ * Start performance measurement
905
+ */
906
+ static startMeasurement(e) {
907
+ const t = performance.now();
908
+ return () => {
909
+ const i = performance.now() - t;
910
+ return this.recordMeasurement(e, i), i;
911
+ };
912
+ }
913
+ /**
914
+ * Record measurement
915
+ */
916
+ static recordMeasurement(e, t) {
917
+ this.measurements.has(e) || this.measurements.set(e, []);
918
+ const i = this.measurements.get(e);
919
+ i.push(t), i.length > 100 && i.shift();
920
+ }
921
+ /**
922
+ * Get performance statistics
923
+ */
924
+ static getStats() {
925
+ const e = {};
926
+ for (const [t, i] of this.measurements) {
927
+ const r = [...i].sort((n, a) => n - a), o = i.reduce((n, a) => n + a, 0) / i.length;
928
+ e[t] = {
929
+ count: i.length,
930
+ average: o,
931
+ min: r[0],
932
+ max: r[r.length - 1],
933
+ p50: r[Math.floor(r.length * 0.5)],
934
+ p95: r[Math.floor(r.length * 0.95)],
935
+ p99: r[Math.floor(r.length * 0.99)]
936
+ };
937
+ }
938
+ return e;
939
+ }
940
+ /**
941
+ * Clear all performance data
942
+ */
943
+ static reset() {
944
+ this.measurements.clear();
945
+ }
946
+ }
947
+ const le = 250;
948
+ class U extends se {
949
+ type = "responsive";
950
+ priority = le;
951
+ generatedCSS = null;
952
+ elementSelector = "";
953
+ _config;
954
+ constructor(e) {
955
+ super(e), this._config = e;
956
+ }
957
+ get config() {
958
+ return this._config;
959
+ }
960
+ /**
961
+ * Apply responsive styles to the element
962
+ */
963
+ apply(e, t) {
964
+ const i = e.element;
965
+ !i || !(i instanceof HTMLElement) || (this.elementSelector = this.generateUniqueSelector(i), i.classList.add(this.getClassFromSelector(this.elementSelector)), this.generateAndInjectCSS(), this.setupReactiveUpdates());
966
+ }
967
+ /**
968
+ * Generate and inject responsive CSS
969
+ */
970
+ generateAndInjectCSS() {
971
+ const e = A.startMeasurement("css-generation");
972
+ try {
973
+ const t = new de({
974
+ selector: this.elementSelector,
975
+ generateMinified: process.env.NODE_ENV === "production",
976
+ includeComments: process.env.NODE_ENV !== "production",
977
+ optimizeOutput: !0
978
+ });
979
+ this.generatedCSS = t.generateResponsiveCSS(this.config), this.generatedCSS.cssRules.length > 0 && ue.injectCSS(this.generatedCSS.cssRules);
980
+ } finally {
981
+ e();
982
+ }
983
+ }
984
+ /**
985
+ * Set up reactive updates for dynamic responsive values
986
+ */
987
+ setupReactiveUpdates() {
988
+ this.hasReactiveValues(this.config) && V(() => {
989
+ this.trackReactiveDependencies(this.config);
990
+ const t = this.resolveReactiveConfig(this.config);
991
+ this.updateConfig(t);
992
+ });
993
+ }
994
+ /**
995
+ * Track reactive dependencies by accessing all reactive values
996
+ */
997
+ trackReactiveDependencies(e) {
998
+ let t = !1;
999
+ for (const [i, r] of Object.entries(e))
1000
+ if (this.isReactiveValue(r))
1001
+ T(r) || j(r) ? r() : this.isAsset(r) && (t = !0, r.resolve());
1002
+ else if (w(r))
1003
+ for (const [o, n] of Object.entries(r))
1004
+ this.isReactiveValue(n) && (T(n) || j(n) ? n() : this.isAsset(n) && (t = !0, n.resolve()));
1005
+ t && me()();
1006
+ }
1007
+ /**
1008
+ * Update configuration and regenerate CSS
1009
+ */
1010
+ updateConfig(e) {
1011
+ this._config = e, this.generateAndInjectCSS();
1012
+ }
1013
+ /**
1014
+ * Generate unique CSS selector for this element
1015
+ */
1016
+ generateUniqueSelector(e) {
1017
+ return `.${`tachui-responsive-${this.generateUniqueId()}`}`;
1018
+ }
1019
+ /**
1020
+ * Extract class name from CSS selector
1021
+ */
1022
+ getClassFromSelector(e) {
1023
+ return e.replace(/^\./, "");
1024
+ }
1025
+ /**
1026
+ * Generate unique ID for CSS class names
1027
+ */
1028
+ generateUniqueId() {
1029
+ return Math.random().toString(36).substr(2, 9);
1030
+ }
1031
+ /**
1032
+ * Check if configuration contains reactive values (signals)
1033
+ */
1034
+ hasReactiveValues(e) {
1035
+ for (const t of Object.values(e)) {
1036
+ if (this.isReactiveValue(t))
1037
+ return !0;
1038
+ if (w(t)) {
1039
+ for (const i of Object.values(t))
1040
+ if (this.isReactiveValue(i))
1041
+ return !0;
1042
+ }
1043
+ }
1044
+ return !1;
1045
+ }
1046
+ /**
1047
+ * Check if a value is a reactive signal, computed, or Asset
1048
+ */
1049
+ isReactiveValue(e) {
1050
+ return !!(T(e) || j(e) || this.isAsset(e));
1051
+ }
1052
+ /**
1053
+ * Check if a value is an Asset object
1054
+ */
1055
+ isAsset(e) {
1056
+ return e != null && typeof e == "object" && "resolve" in e && typeof e.resolve == "function";
1057
+ }
1058
+ /**
1059
+ * Resolve configuration with current signal values
1060
+ */
1061
+ resolveReactiveConfig(e) {
1062
+ const t = {};
1063
+ for (const [i, r] of Object.entries(e))
1064
+ if (this.isReactiveValue(r))
1065
+ T(r) || j(r) ? t[i] = r() : this.isAsset(r) && (t[i] = r.resolve());
1066
+ else if (w(r)) {
1067
+ const o = {};
1068
+ for (const [n, a] of Object.entries(r))
1069
+ this.isReactiveValue(a) ? T(a) || j(a) ? o[n] = a() : this.isAsset(a) && (o[n] = a.resolve()) : o[n] = a;
1070
+ t[i] = o;
1071
+ } else
1072
+ t[i] = r;
1073
+ return t;
1074
+ }
1075
+ /**
1076
+ * Get generated CSS information (for debugging)
1077
+ */
1078
+ getGeneratedCSS() {
1079
+ return this.generatedCSS;
1080
+ }
1081
+ /**
1082
+ * Get configuration (for debugging)
1083
+ */
1084
+ getConfig() {
1085
+ return this.config;
1086
+ }
1087
+ }
1088
+ function h(s) {
1089
+ return new U(s);
1090
+ }
1091
+ class He extends se {
1092
+ type = "media-query";
1093
+ priority = le + 1;
1094
+ // Slightly higher than responsive
1095
+ elementSelector = "";
1096
+ constructor(e, t) {
1097
+ super({ query: e, styles: t });
1098
+ }
1099
+ get query() {
1100
+ return this.properties.query;
1101
+ }
1102
+ get styles() {
1103
+ return this.properties.styles;
1104
+ }
1105
+ apply(e, t) {
1106
+ const i = e.element;
1107
+ !i || !(i instanceof HTMLElement) || (this.elementSelector = this.generateUniqueSelector(i), i.classList.add(this.getClassFromSelector(this.elementSelector)), this.generateMediaQueryCSS());
1108
+ }
1109
+ generateMediaQueryCSS() {
1110
+ const { generateMinified: e = process.env.NODE_ENV === "production" } = {}, t = e ? "" : " ", i = e ? "" : " ", r = e ? "" : `
1111
+ `, o = e ? "" : " ";
1112
+ let n = `@media ${this.query}${o}{${r}`;
1113
+ n += `${t}${this.elementSelector}${o}{${r}`;
1114
+ for (const [a, c] of Object.entries(this.styles)) {
1115
+ const d = a.replace(
1116
+ /[A-Z]/g,
1117
+ (p) => `-${p.toLowerCase()}`
1118
+ ), l = typeof c == "number" ? `${c}px` : c.toString();
1119
+ n += `${i}${d}:${o}${l};${r}`;
1120
+ }
1121
+ n += `${t}}${r}`, n += `}${r}`, ue.injectCSS([n]);
1122
+ }
1123
+ generateUniqueSelector(e) {
1124
+ return `.${`tachui-mq-${Math.random().toString(36).substr(2, 9)}`}`;
1125
+ }
1126
+ getClassFromSelector(e) {
1127
+ return e.replace(/^\./, "");
1128
+ }
1129
+ }
1130
+ function $(s, e) {
1131
+ return new He(s, e);
1132
+ }
1133
+ function u(s, e) {
1134
+ const t = { [s]: e };
1135
+ return new U(t);
1136
+ }
1137
+ function pe(s) {
1138
+ const e = {};
1139
+ return s.direction && (e.flexDirection = s.direction), s.wrap && (e.flexWrap = s.wrap), s.justify && (e.justifyContent = s.justify), s.align && (e.alignItems = s.align), s.gap && (e.gap = s.gap), new U(e);
1140
+ }
1141
+ class he {
1142
+ constructor(e) {
1143
+ return this.baseBuilder = e, new Proxy(this, {
1144
+ get(t, i) {
1145
+ if (i === "base" || i === "sm" || i === "md" || i === "lg" || i === "xl" || i === "2xl" || i in t)
1146
+ return t[i];
1147
+ const r = t.baseBuilder[i];
1148
+ return typeof r == "function" ? (...o) => {
1149
+ const n = r.apply(t.baseBuilder, o);
1150
+ return n === t.baseBuilder ? t : n;
1151
+ } : r;
1152
+ }
1153
+ });
1154
+ }
1155
+ // Delegate essential builder methods
1156
+ addModifier(e) {
1157
+ this.baseBuilder.addModifier(e);
1158
+ }
1159
+ build() {
1160
+ return this.baseBuilder.build();
1161
+ }
1162
+ // Core responsive methods
1163
+ responsive(e) {
1164
+ const t = h(e);
1165
+ return this.baseBuilder.addModifier(t), this;
1166
+ }
1167
+ mediaQuery(e, t) {
1168
+ const i = $(e, t);
1169
+ return this.baseBuilder.addModifier(i), this;
1170
+ }
1171
+ // Advanced media query methods
1172
+ orientation(e, t) {
1173
+ const i = `(orientation: ${e})`, r = $(i, t);
1174
+ return this.baseBuilder.addModifier(r), this;
1175
+ }
1176
+ colorScheme(e, t) {
1177
+ const i = `(prefers-color-scheme: ${e})`, r = $(i, t);
1178
+ return this.baseBuilder.addModifier(r), this;
1179
+ }
1180
+ reducedMotion(e) {
1181
+ const i = $("(prefers-reduced-motion: reduce)", e);
1182
+ return this.baseBuilder.addModifier(i), this;
1183
+ }
1184
+ highContrast(e) {
1185
+ const i = $("(prefers-contrast: high)", e);
1186
+ return this.baseBuilder.addModifier(i), this;
1187
+ }
1188
+ touchDevice(e) {
1189
+ const i = $("(pointer: coarse)", e);
1190
+ return this.baseBuilder.addModifier(i), this;
1191
+ }
1192
+ mouseDevice(e) {
1193
+ const i = $("(pointer: fine)", e);
1194
+ return this.baseBuilder.addModifier(i), this;
1195
+ }
1196
+ retina(e) {
1197
+ const i = $("(min-resolution: 2dppx)", e);
1198
+ return this.baseBuilder.addModifier(i), this;
1199
+ }
1200
+ print(e) {
1201
+ const i = $("print", e);
1202
+ return this.baseBuilder.addModifier(i), this;
1203
+ }
1204
+ // Responsive layout methods
1205
+ responsiveLayout(e) {
1206
+ const t = pe(e);
1207
+ return this.baseBuilder.addModifier(t), this;
1208
+ }
1209
+ // Responsive dimension methods
1210
+ responsiveWidth(e) {
1211
+ const t = u("width", e);
1212
+ return this.baseBuilder.addModifier(t), this;
1213
+ }
1214
+ responsiveHeight(e) {
1215
+ const t = u("height", e);
1216
+ return this.baseBuilder.addModifier(t), this;
1217
+ }
1218
+ responsiveSize(e) {
1219
+ const t = h(e);
1220
+ return this.baseBuilder.addModifier(t), this;
1221
+ }
1222
+ // Responsive spacing methods
1223
+ responsivePadding(e) {
1224
+ if (w(e) || typeof e == "string" || typeof e == "number") {
1225
+ const t = u(
1226
+ "padding",
1227
+ e
1228
+ );
1229
+ this.baseBuilder.addModifier(t);
1230
+ } else {
1231
+ const t = {}, i = e;
1232
+ i.all && (t.padding = i.all), i.horizontal && (t.paddingLeft = i.horizontal, t.paddingRight = i.horizontal), i.vertical && (t.paddingTop = i.vertical, t.paddingBottom = i.vertical), i.top && (t.paddingTop = i.top), i.right && (t.paddingRight = i.right), i.bottom && (t.paddingBottom = i.bottom), i.left && (t.paddingLeft = i.left);
1233
+ const r = h(t);
1234
+ this.baseBuilder.addModifier(r);
1235
+ }
1236
+ return this;
1237
+ }
1238
+ responsiveMargin(e) {
1239
+ if (w(e) || typeof e == "string" || typeof e == "number") {
1240
+ const t = u(
1241
+ "margin",
1242
+ e
1243
+ );
1244
+ this.baseBuilder.addModifier(t);
1245
+ } else {
1246
+ const t = {}, i = e;
1247
+ i.all && (t.margin = i.all), i.horizontal && (t.marginLeft = i.horizontal, t.marginRight = i.horizontal), i.vertical && (t.marginTop = i.vertical, t.marginBottom = i.vertical), i.top && (t.marginTop = i.top), i.right && (t.marginRight = i.right), i.bottom && (t.marginBottom = i.bottom), i.left && (t.marginLeft = i.left);
1248
+ const r = h(t);
1249
+ this.baseBuilder.addModifier(r);
1250
+ }
1251
+ return this;
1252
+ }
1253
+ // Responsive typography methods
1254
+ responsiveFont(e) {
1255
+ const t = h(e);
1256
+ return this.baseBuilder.addModifier(t), this;
1257
+ }
1258
+ responsiveFontSize(e) {
1259
+ const t = u("fontSize", e);
1260
+ return this.baseBuilder.addModifier(t), this;
1261
+ }
1262
+ responsiveTextAlign(e) {
1263
+ const t = u("textAlign", e);
1264
+ return this.baseBuilder.addModifier(t), this;
1265
+ }
1266
+ // Breakpoint shorthand methods
1267
+ get base() {
1268
+ return new O("base", this, this.baseBuilder);
1269
+ }
1270
+ get sm() {
1271
+ return new O("sm", this, this.baseBuilder);
1272
+ }
1273
+ get md() {
1274
+ return new O("md", this, this.baseBuilder);
1275
+ }
1276
+ get lg() {
1277
+ return new O("lg", this, this.baseBuilder);
1278
+ }
1279
+ get xl() {
1280
+ return new O("xl", this, this.baseBuilder);
1281
+ }
1282
+ get "2xl"() {
1283
+ return new O("2xl", this, this.baseBuilder);
1284
+ }
1285
+ }
1286
+ class O {
1287
+ constructor(e, t, i) {
1288
+ this.breakpoint = e, this.parentBuilder = t, this.baseBuilder = i;
1289
+ }
1290
+ // Layout properties
1291
+ width(e) {
1292
+ const t = { [this.breakpoint]: e }, i = u("width", t);
1293
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1294
+ }
1295
+ height(e) {
1296
+ const t = { [this.breakpoint]: e }, i = u("height", t);
1297
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1298
+ }
1299
+ minWidth(e) {
1300
+ const t = { [this.breakpoint]: e }, i = u(
1301
+ "minWidth",
1302
+ t
1303
+ );
1304
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1305
+ }
1306
+ maxWidth(e) {
1307
+ const t = { [this.breakpoint]: e }, i = u(
1308
+ "maxWidth",
1309
+ t
1310
+ );
1311
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1312
+ }
1313
+ minHeight(e) {
1314
+ const t = { [this.breakpoint]: e }, i = u(
1315
+ "minHeight",
1316
+ t
1317
+ );
1318
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1319
+ }
1320
+ maxHeight(e) {
1321
+ const t = { [this.breakpoint]: e }, i = u(
1322
+ "maxHeight",
1323
+ t
1324
+ );
1325
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1326
+ }
1327
+ padding(e) {
1328
+ const t = { [this.breakpoint]: e }, i = u(
1329
+ "padding",
1330
+ t
1331
+ );
1332
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1333
+ }
1334
+ paddingHorizontal(e) {
1335
+ const t = { [this.breakpoint]: e }, i = u(
1336
+ "paddingLeft",
1337
+ t
1338
+ ), r = u(
1339
+ "paddingRight",
1340
+ t
1341
+ );
1342
+ return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
1343
+ }
1344
+ paddingVertical(e) {
1345
+ const t = { [this.breakpoint]: e }, i = u(
1346
+ "paddingTop",
1347
+ t
1348
+ ), r = u(
1349
+ "paddingBottom",
1350
+ t
1351
+ );
1352
+ return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
1353
+ }
1354
+ paddingTop(e) {
1355
+ const t = { [this.breakpoint]: e }, i = u(
1356
+ "paddingTop",
1357
+ t
1358
+ );
1359
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1360
+ }
1361
+ paddingBottom(e) {
1362
+ const t = { [this.breakpoint]: e }, i = u(
1363
+ "paddingBottom",
1364
+ t
1365
+ );
1366
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1367
+ }
1368
+ paddingLeft(e) {
1369
+ const t = { [this.breakpoint]: e }, i = u(
1370
+ "paddingLeft",
1371
+ t
1372
+ );
1373
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1374
+ }
1375
+ paddingRight(e) {
1376
+ const t = { [this.breakpoint]: e }, i = u(
1377
+ "paddingRight",
1378
+ t
1379
+ );
1380
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1381
+ }
1382
+ margin(e) {
1383
+ const t = { [this.breakpoint]: e }, i = u("margin", t);
1384
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1385
+ }
1386
+ marginHorizontal(e) {
1387
+ const t = { [this.breakpoint]: e }, i = u(
1388
+ "marginLeft",
1389
+ t
1390
+ ), r = u(
1391
+ "marginRight",
1392
+ t
1393
+ );
1394
+ return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
1395
+ }
1396
+ marginVertical(e) {
1397
+ const t = { [this.breakpoint]: e }, i = u(
1398
+ "marginTop",
1399
+ t
1400
+ ), r = u(
1401
+ "marginBottom",
1402
+ t
1403
+ );
1404
+ return this.parentBuilder.addModifier(i), this.parentBuilder.addModifier(r), this.parentBuilder;
1405
+ }
1406
+ marginTop(e) {
1407
+ const t = { [this.breakpoint]: e }, i = u(
1408
+ "marginTop",
1409
+ t
1410
+ );
1411
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1412
+ }
1413
+ marginBottom(e) {
1414
+ const t = { [this.breakpoint]: e }, i = u(
1415
+ "marginBottom",
1416
+ t
1417
+ );
1418
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1419
+ }
1420
+ marginLeft(e) {
1421
+ const t = { [this.breakpoint]: e }, i = u(
1422
+ "marginLeft",
1423
+ t
1424
+ );
1425
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1426
+ }
1427
+ marginRight(e) {
1428
+ const t = { [this.breakpoint]: e }, i = u(
1429
+ "marginRight",
1430
+ t
1431
+ );
1432
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1433
+ }
1434
+ // Typography properties
1435
+ fontSize(e) {
1436
+ const t = { [this.breakpoint]: e }, i = u(
1437
+ "fontSize",
1438
+ t
1439
+ );
1440
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1441
+ }
1442
+ textAlign(e) {
1443
+ const t = { [this.breakpoint]: e }, i = u(
1444
+ "textAlign",
1445
+ t
1446
+ );
1447
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1448
+ }
1449
+ // Display properties
1450
+ display(e) {
1451
+ const t = { [this.breakpoint]: e }, i = u(
1452
+ "display",
1453
+ t
1454
+ );
1455
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1456
+ }
1457
+ // Flexbox properties
1458
+ flexDirection(e) {
1459
+ const t = { [this.breakpoint]: e }, i = u(
1460
+ "flexDirection",
1461
+ t
1462
+ );
1463
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1464
+ }
1465
+ justifyContent(e) {
1466
+ const t = { [this.breakpoint]: e }, i = u(
1467
+ "justifyContent",
1468
+ t
1469
+ );
1470
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1471
+ }
1472
+ alignItems(e) {
1473
+ const t = { [this.breakpoint]: e }, i = u(
1474
+ "alignItems",
1475
+ t
1476
+ );
1477
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1478
+ }
1479
+ // Visual properties
1480
+ backgroundColor(e) {
1481
+ const t = { [this.breakpoint]: e }, i = u(
1482
+ "backgroundColor",
1483
+ t
1484
+ );
1485
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1486
+ }
1487
+ color(e) {
1488
+ const t = { [this.breakpoint]: e }, i = u("color", t);
1489
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1490
+ }
1491
+ opacity(e) {
1492
+ const t = { [this.breakpoint]: e }, i = u(
1493
+ "opacity",
1494
+ t
1495
+ );
1496
+ return this.parentBuilder.addModifier(i), this.parentBuilder;
1497
+ }
1498
+ }
1499
+ function mt(s) {
1500
+ return new he(s);
1501
+ }
1502
+ function gt(s) {
1503
+ return new he(s);
1504
+ }
1505
+ function bt() {
1506
+ const s = x(), e = m(() => S());
1507
+ return {
1508
+ current: s,
1509
+ context: e,
1510
+ isAbove: (n) => m(
1511
+ () => y(s()) > y(n)
1512
+ ),
1513
+ isBelow: (n) => m(
1514
+ () => y(s()) < y(n)
1515
+ ),
1516
+ isBetween: (n, a) => m(() => {
1517
+ const c = y(s()), d = y(n), l = y(a);
1518
+ return c >= d && c <= l;
1519
+ }),
1520
+ matches: (n) => {
1521
+ const [a, c] = E(!1);
1522
+ if (typeof window < "u") {
1523
+ const d = window.matchMedia(n);
1524
+ c(d.matches);
1525
+ const l = (p) => c(p.matches);
1526
+ d.addEventListener("change", l);
1527
+ }
1528
+ return a;
1529
+ }
1530
+ };
1531
+ }
1532
+ function vt(s) {
1533
+ const [e, t] = E(!1);
1534
+ if (typeof window < "u") {
1535
+ const i = window.matchMedia(s);
1536
+ t(i.matches);
1537
+ const r = (o) => t(o.matches);
1538
+ i.addEventListener("change", r);
1539
+ }
1540
+ return e;
1541
+ }
1542
+ function yt(s) {
1543
+ const e = x();
1544
+ return m(() => {
1545
+ if (!w(s))
1546
+ return s;
1547
+ const t = e(), i = s, r = [
1548
+ "base",
1549
+ "sm",
1550
+ "md",
1551
+ "lg",
1552
+ "xl",
1553
+ "2xl"
1554
+ ], o = r.indexOf(t);
1555
+ for (let n = o; n >= 0; n--) {
1556
+ const a = r[n];
1557
+ if (i[a] !== void 0)
1558
+ return i[a];
1559
+ }
1560
+ for (const n of r)
1561
+ if (i[n] !== void 0)
1562
+ return i[n];
1563
+ throw new Error("No responsive value found for any breakpoint");
1564
+ });
1565
+ }
1566
+ function xt(s, e) {
1567
+ if (!w(s))
1568
+ return s;
1569
+ const t = s, i = e || x()(), r = [
1570
+ "base",
1571
+ "sm",
1572
+ "md",
1573
+ "lg",
1574
+ "xl",
1575
+ "2xl"
1576
+ ], o = r.indexOf(i);
1577
+ for (let n = o; n >= 0; n--) {
1578
+ const a = r[n];
1579
+ if (t[a] !== void 0)
1580
+ return t[a];
1581
+ }
1582
+ for (const n of r)
1583
+ if (t[n] !== void 0)
1584
+ return t[n];
1585
+ throw new Error("No responsive value found for any breakpoint");
1586
+ }
1587
+ function wt(s, e) {
1588
+ const t = {};
1589
+ for (const [i, r] of Object.entries(e))
1590
+ if (w(r)) {
1591
+ const o = r;
1592
+ for (const [n, a] of Object.entries(o))
1593
+ if (a !== void 0) {
1594
+ const c = n === "base" ? `--${s}-${i}` : `--${s}-${i}-${n}`;
1595
+ t[c] = a.toString();
1596
+ }
1597
+ } else
1598
+ t[`--${s}-${i}`] = r.toString();
1599
+ return t;
1600
+ }
1601
+ const b = {
1602
+ // Viewport size queries
1603
+ mobile: "(max-width: 767px)",
1604
+ tablet: "(min-width: 768px) and (max-width: 1023px)",
1605
+ desktop: "(min-width: 1024px)",
1606
+ // Device orientation
1607
+ landscape: "(orientation: landscape)",
1608
+ portrait: "(orientation: portrait)",
1609
+ // Device pixel density
1610
+ highDPI: "(min-resolution: 2dppx)",
1611
+ lowDPI: "(max-resolution: 1dppx)",
1612
+ retinaDisplay: "(min-resolution: 2dppx)",
1613
+ standardDisplay: "(max-resolution: 1.9dppx)",
1614
+ // Color scheme preference
1615
+ darkMode: "(prefers-color-scheme: dark)",
1616
+ lightMode: "(prefers-color-scheme: light)",
1617
+ noColorSchemePreference: "(prefers-color-scheme: no-preference)",
1618
+ // Reduced motion preference
1619
+ reducedMotion: "(prefers-reduced-motion: reduce)",
1620
+ allowMotion: "(prefers-reduced-motion: no-preference)",
1621
+ // Contrast preference (accessibility)
1622
+ highContrast: "(prefers-contrast: high)",
1623
+ lowContrast: "(prefers-contrast: low)",
1624
+ normalContrast: "(prefers-contrast: no-preference)",
1625
+ // Data usage preference
1626
+ reduceData: "(prefers-reduced-data: reduce)",
1627
+ allowData: "(prefers-reduced-data: no-preference)",
1628
+ // Transparency preference
1629
+ reduceTransparency: "(prefers-reduced-transparency: reduce)",
1630
+ allowTransparency: "(prefers-reduced-transparency: no-preference)",
1631
+ // Hover capability
1632
+ canHover: "(hover: hover)",
1633
+ noHover: "(hover: none)",
1634
+ // Pointer capability
1635
+ finePointer: "(pointer: fine)",
1636
+ // Mouse, trackpad
1637
+ coarsePointer: "(pointer: coarse)",
1638
+ // Touch
1639
+ // Any-hover (any input can hover)
1640
+ anyCanHover: "(any-hover: hover)",
1641
+ anyNoHover: "(any-hover: none)",
1642
+ // Any-pointer (any input type)
1643
+ anyFinePointer: "(any-pointer: fine)",
1644
+ anyCoarsePointer: "(any-pointer: coarse)",
1645
+ // Update preference
1646
+ slowUpdate: "(update: slow)",
1647
+ // E-ink displays
1648
+ fastUpdate: "(update: fast)",
1649
+ // Standard displays
1650
+ // Overflow-block capability
1651
+ blockScrolling: "(overflow-block: scroll)",
1652
+ blockPaged: "(overflow-block: paged)",
1653
+ // Overflow-inline capability
1654
+ inlineScrolling: "(overflow-inline: scroll)",
1655
+ // Forced colors (high contrast mode)
1656
+ forcedColors: "(forced-colors: active)",
1657
+ normalColors: "(forced-colors: none)",
1658
+ // Inverted colors
1659
+ invertedColors: "(inverted-colors: inverted)",
1660
+ normalInvertedColors: "(inverted-colors: none)",
1661
+ // Scripting capability
1662
+ scriptingEnabled: "(scripting: enabled)",
1663
+ scriptingDisabled: "(scripting: none)",
1664
+ scriptingInitialOnly: "(scripting: initial-only)",
1665
+ // Container queries (future)
1666
+ containerSmall: "(max-width: 400px)",
1667
+ containerMedium: "(min-width: 401px) and (max-width: 800px)",
1668
+ containerLarge: "(min-width: 801px)",
1669
+ // Custom breakpoint builders
1670
+ minWidth: (s) => `(min-width: ${s}${typeof s == "number" ? "px" : ""})`,
1671
+ maxWidth: (s) => `(max-width: ${s}${typeof s == "number" ? "px" : ""})`,
1672
+ between: (s, e) => `(min-width: ${s}${typeof s == "number" ? "px" : ""}) and (max-width: ${e}${typeof e == "number" ? "px" : ""})`,
1673
+ // Height-based queries
1674
+ minHeight: (s) => `(min-height: ${s}${typeof s == "number" ? "px" : ""})`,
1675
+ maxHeight: (s) => `(max-height: ${s}${typeof s == "number" ? "px" : ""})`,
1676
+ heightBetween: (s, e) => `(min-height: ${s}${typeof s == "number" ? "px" : ""}) and (max-height: ${e}${typeof e == "number" ? "px" : ""})`,
1677
+ // Aspect ratio queries
1678
+ square: "(aspect-ratio: 1/1)",
1679
+ landscape16_9: "(aspect-ratio: 16/9)",
1680
+ portrait9_16: "(aspect-ratio: 9/16)",
1681
+ widescreen: "(min-aspect-ratio: 16/9)",
1682
+ tallscreen: "(max-aspect-ratio: 9/16)",
1683
+ customAspectRatio: (s) => `(aspect-ratio: ${s})`,
1684
+ minAspectRatio: (s) => `(min-aspect-ratio: ${s})`,
1685
+ maxAspectRatio: (s) => `(max-aspect-ratio: ${s})`,
1686
+ // Resolution queries
1687
+ lowRes: "(max-resolution: 120dpi)",
1688
+ standardRes: "(min-resolution: 120dpi) and (max-resolution: 192dpi)",
1689
+ highRes: "(min-resolution: 192dpi)",
1690
+ customResolution: (s) => `(min-resolution: ${s}dpi)`,
1691
+ // Print media
1692
+ print: "print",
1693
+ screen: "screen",
1694
+ speech: "speech",
1695
+ // Device-specific queries (common patterns)
1696
+ iPhone: "(max-width: 428px)",
1697
+ iPad: "(min-width: 768px) and (max-width: 1024px)",
1698
+ desktopSmall: "(min-width: 1024px) and (max-width: 1440px)",
1699
+ desktopLarge: "(min-width: 1440px)",
1700
+ // Special conditions
1701
+ touchDevice: "(pointer: coarse)",
1702
+ mouseDevice: "(pointer: fine)",
1703
+ keyboardNavigation: "(hover: none) and (pointer: coarse)",
1704
+ // Modern display features
1705
+ wideColorGamut: "(color-gamut: p3)",
1706
+ standardColorGamut: "(color-gamut: srgb)",
1707
+ hdr: "(dynamic-range: high)",
1708
+ sdr: "(dynamic-range: standard)"
1709
+ };
1710
+ function St(...s) {
1711
+ return s.filter((e) => e).join(" and ");
1712
+ }
1713
+ function Ct(...s) {
1714
+ return s.filter((e) => e).join(", ");
1715
+ }
1716
+ function $t(s) {
1717
+ const e = x();
1718
+ return m(() => {
1719
+ const t = e();
1720
+ return !(s.hideOn && s.hideOn.includes(t) || s.showOn && !s.showOn.includes(t));
1721
+ });
1722
+ }
1723
+ function We() {
1724
+ if (typeof window > "u") return;
1725
+ const s = S();
1726
+ console.group("🔍 tachUI Responsive State"), console.log("Current breakpoint:", s.current), console.log("Viewport dimensions:", `${s.width}x${s.height}`), console.log("Available breakpoints:", ["base", "sm", "md", "lg", "xl", "2xl"]);
1727
+ const e = {
1728
+ Mobile: b.mobile,
1729
+ Tablet: b.tablet,
1730
+ Desktop: b.desktop,
1731
+ "Dark mode": b.darkMode,
1732
+ "Reduced motion": b.reducedMotion,
1733
+ "Can hover": b.canHover
1734
+ };
1735
+ console.log("Media query matches:");
1736
+ for (const [t, i] of Object.entries(e))
1737
+ console.log(` ${t}: ${window.matchMedia(i).matches}`);
1738
+ console.groupEnd();
1739
+ }
1740
+ function Bt(s = {}) {
1741
+ if (typeof window > "u" || process.env.NODE_ENV === "production")
1742
+ return;
1743
+ const {
1744
+ position: e = "top-right",
1745
+ showDimensions: t = !0,
1746
+ showBreakpoint: i = !0
1747
+ } = s, r = document.createElement("div");
1748
+ r.id = "tachui-responsive-debug", r.style.cssText = `
1749
+ position: fixed;
1750
+ ${e.includes("top") ? "top: 10px" : "bottom: 10px"};
1751
+ ${e.includes("right") ? "right: 10px" : "left: 10px"};
1752
+ background: rgba(0, 0, 0, 0.8);
1753
+ color: white;
1754
+ padding: 8px 12px;
1755
+ border-radius: 4px;
1756
+ font-family: monospace;
1757
+ font-size: 12px;
1758
+ z-index: 9999;
1759
+ pointer-events: none;
1760
+ white-space: pre-line;
1761
+ `, document.body.appendChild(r);
1762
+ function o() {
1763
+ const n = S();
1764
+ let a = "";
1765
+ i && (a += `Breakpoint: ${n.current}`), t && (a && (a += `
1766
+ `), a += `Size: ${n.width}×${n.height}`), r.textContent = a;
1767
+ }
1768
+ o(), window.addEventListener("resize", o), We();
1769
+ }
1770
+ class Fe {
1771
+ /**
1772
+ * Create a responsive grid with automatic column sizing
1773
+ */
1774
+ static autoFit(e) {
1775
+ const t = {};
1776
+ if (typeof e.minColumnWidth == "object") {
1777
+ t.gridTemplateColumns = {};
1778
+ for (const [i, r] of Object.entries(e.minColumnWidth)) {
1779
+ const o = typeof r == "number" ? `${r}px` : r, n = e.maxColumns && typeof e.maxColumns == "object" ? e.maxColumns[i] || "auto" : e.maxColumns || "auto";
1780
+ t.gridTemplateColumns[i] = n === "auto" ? `repeat(auto-fit, minmax(${o}, 1fr))` : `repeat(${n}, minmax(${o}, 1fr))`;
1781
+ }
1782
+ } else {
1783
+ const i = typeof e.minColumnWidth == "number" ? `${e.minColumnWidth}px` : e.minColumnWidth, r = e.maxColumns || "auto";
1784
+ t.gridTemplateColumns = r === "auto" ? `repeat(auto-fit, minmax(${i}, 1fr))` : `repeat(${r}, minmax(${i}, 1fr))`;
1785
+ }
1786
+ return e.gap && (t.gap = e.gap), t.display = "grid", h(t);
1787
+ }
1788
+ /**
1789
+ * Create a responsive grid with explicit column counts
1790
+ */
1791
+ static columns(e, t) {
1792
+ const i = {
1793
+ display: "grid",
1794
+ gridTemplateColumns: typeof e == "object" ? Object.fromEntries(
1795
+ Object.entries(e).map(([r, o]) => [
1796
+ r,
1797
+ `repeat(${o}, 1fr)`
1798
+ ])
1799
+ ) : `repeat(${e}, 1fr)`
1800
+ };
1801
+ return t?.gap && (i.gap = t.gap), t?.rowGap && (i.rowGap = t.rowGap), t?.autoRows && (i.gridAutoRows = t.autoRows), h(i);
1802
+ }
1803
+ /**
1804
+ * Create responsive masonry-style grid
1805
+ */
1806
+ static masonry(e) {
1807
+ const t = {
1808
+ display: "grid",
1809
+ gridTemplateColumns: typeof e.columns == "object" ? Object.fromEntries(
1810
+ Object.entries(e.columns).map(([i, r]) => [
1811
+ i,
1812
+ `repeat(${r}, 1fr)`
1813
+ ])
1814
+ ) : `repeat(${e.columns}, 1fr)`,
1815
+ gridAutoRows: "max-content"
1816
+ };
1817
+ return e.gap && (t.gap = e.gap), h(t);
1818
+ }
1819
+ }
1820
+ class kt {
1821
+ /**
1822
+ * Create a responsive flex container that stacks on mobile, flows horizontally on desktop
1823
+ */
1824
+ static stackToRow(e) {
1825
+ const i = {
1826
+ display: "flex",
1827
+ flexDirection: {
1828
+ base: "column",
1829
+ [e?.stackBreakpoint || "md"]: "row"
1830
+ }
1831
+ };
1832
+ return e?.gap && (i.gap = e.gap), e?.align && (i.alignItems = e.align), e?.justify && (i.justifyContent = e.justify), h(i);
1833
+ }
1834
+ /**
1835
+ * Create a responsive flex container with wrapping behavior
1836
+ */
1837
+ static wrap(e) {
1838
+ const t = {
1839
+ display: "flex",
1840
+ flexWrap: "wrap",
1841
+ ...e
1842
+ };
1843
+ return h(t);
1844
+ }
1845
+ /**
1846
+ * Create centered flex layout
1847
+ */
1848
+ static center(e = "row") {
1849
+ return h({
1850
+ display: "flex",
1851
+ flexDirection: e,
1852
+ justifyContent: "center",
1853
+ alignItems: "center"
1854
+ });
1855
+ }
1856
+ /**
1857
+ * Create space-between flex layout
1858
+ */
1859
+ static spaceBetween(e = "row") {
1860
+ return h({
1861
+ display: "flex",
1862
+ flexDirection: e,
1863
+ justifyContent: "space-between",
1864
+ alignItems: "center"
1865
+ });
1866
+ }
1867
+ }
1868
+ class Rt {
1869
+ /**
1870
+ * Create a responsive container with max-width constraints
1871
+ */
1872
+ static container(e) {
1873
+ const t = {
1874
+ width: "100%",
1875
+ marginLeft: "auto",
1876
+ marginRight: "auto"
1877
+ };
1878
+ return e?.maxWidth ? t.maxWidth = e.maxWidth : t.maxWidth = {
1879
+ sm: "640px",
1880
+ md: "768px",
1881
+ lg: "1024px",
1882
+ xl: "1280px",
1883
+ "2xl": "1536px"
1884
+ }, e?.padding && (t.paddingLeft = e.padding, t.paddingRight = e.padding), e?.margin && (t.marginTop = e.margin, t.marginBottom = e.margin), h(t);
1885
+ }
1886
+ /**
1887
+ * Create a full-width container that breaks out of constraints
1888
+ */
1889
+ static fullWidth() {
1890
+ return h({
1891
+ width: "100vw",
1892
+ marginLeft: "calc(-50vw + 50%)",
1893
+ marginRight: "calc(-50vw + 50%)"
1894
+ });
1895
+ }
1896
+ /**
1897
+ * Create a section container with responsive padding
1898
+ */
1899
+ static section(e) {
1900
+ const t = {};
1901
+ return e?.paddingY && (t.paddingTop = e.paddingY, t.paddingBottom = e.paddingY), e?.paddingX && (t.paddingLeft = e.paddingX, t.paddingRight = e.paddingX), e?.maxWidth && (t.maxWidth = e.maxWidth, t.marginLeft = "auto", t.marginRight = "auto"), h(t);
1902
+ }
1903
+ }
1904
+ class Mt {
1905
+ /**
1906
+ * Show element only on specific breakpoints
1907
+ */
1908
+ static showOn(e) {
1909
+ const t = {
1910
+ display: {}
1911
+ // Start with empty object
1912
+ };
1913
+ for (const i of e)
1914
+ t.display[i] = "block";
1915
+ return h(t);
1916
+ }
1917
+ /**
1918
+ * Hide element only on specific breakpoints
1919
+ */
1920
+ static hideOn(e) {
1921
+ const t = {
1922
+ display: {}
1923
+ // Start with empty object
1924
+ };
1925
+ for (const i of e)
1926
+ t.display[i] = "none";
1927
+ return h(t);
1928
+ }
1929
+ /**
1930
+ * Show on mobile, hide on desktop
1931
+ */
1932
+ static mobileOnly() {
1933
+ return h({
1934
+ display: {
1935
+ base: "block",
1936
+ md: "none"
1937
+ }
1938
+ });
1939
+ }
1940
+ /**
1941
+ * Hide on mobile, show on desktop
1942
+ */
1943
+ static desktopOnly() {
1944
+ return h({
1945
+ display: {
1946
+ base: "none",
1947
+ md: "block"
1948
+ }
1949
+ });
1950
+ }
1951
+ /**
1952
+ * Show only on tablet breakpoint
1953
+ */
1954
+ static tabletOnly() {
1955
+ return h({
1956
+ display: {
1957
+ base: "none",
1958
+ md: "block",
1959
+ lg: "none"
1960
+ }
1961
+ });
1962
+ }
1963
+ }
1964
+ class Ot {
1965
+ /**
1966
+ * Create responsive padding
1967
+ */
1968
+ static padding(e) {
1969
+ const t = {};
1970
+ return e.all && (t.padding = e.all), e.horizontal && (t.paddingLeft = e.horizontal, t.paddingRight = e.horizontal), e.vertical && (t.paddingTop = e.vertical, t.paddingBottom = e.vertical), e.top && (t.paddingTop = e.top), e.right && (t.paddingRight = e.right), e.bottom && (t.paddingBottom = e.bottom), e.left && (t.paddingLeft = e.left), h(t);
1971
+ }
1972
+ /**
1973
+ * Create responsive margin
1974
+ */
1975
+ static margin(e) {
1976
+ const t = {};
1977
+ return e.all && (t.margin = e.all), e.horizontal && (t.marginLeft = e.horizontal, t.marginRight = e.horizontal), e.vertical && (t.marginTop = e.vertical, t.marginBottom = e.vertical), e.top && (t.marginTop = e.top), e.right && (t.marginRight = e.right), e.bottom && (t.marginBottom = e.bottom), e.left && (t.marginLeft = e.left), h(t);
1978
+ }
1979
+ /**
1980
+ * Create responsive gap (for flexbox and grid)
1981
+ */
1982
+ static gap(e) {
1983
+ const t = {};
1984
+ return e.all && (t.gap = e.all), e.column && (t.columnGap = e.column), e.row && (t.rowGap = e.row), h(t);
1985
+ }
1986
+ }
1987
+ class Vt {
1988
+ /**
1989
+ * Create responsive font scale
1990
+ */
1991
+ static scale(e) {
1992
+ const t = {
1993
+ fontSize: e.base
1994
+ };
1995
+ if (e.scale && typeof e.scale == "object") {
1996
+ t.fontSize = {};
1997
+ for (const [i, r] of Object.entries(e.scale)) {
1998
+ const o = typeof e.base == "number" ? e.base : parseFloat(e.base);
1999
+ t.fontSize[i] = `${o * r}px`;
2000
+ }
2001
+ }
2002
+ return e.lineHeight && (t.lineHeight = e.lineHeight), h(t);
2003
+ }
2004
+ /**
2005
+ * Create fluid typography that scales smoothly
2006
+ */
2007
+ static fluid(e) {
2008
+ const t = e.minBreakpoint || "320px", i = e.maxBreakpoint || "1200px", r = typeof e.minSize == "number" ? `${e.minSize}px` : e.minSize, o = typeof e.maxSize == "number" ? `${e.maxSize}px` : e.maxSize;
2009
+ return h({
2010
+ fontSize: `clamp(${r}, calc(${r} + (${o} - ${r}) * ((100vw - ${t}) / (${i} - ${t}))), ${o})`
2011
+ });
2012
+ }
2013
+ }
2014
+ const Et = {
2015
+ /**
2016
+ * Sidebar layout that collapses on mobile
2017
+ */
2018
+ sidebar: (s) => {
2019
+ const e = s?.collapseBreakpoint || "md", t = s?.sidebarWidth || "250px";
2020
+ return h({
2021
+ display: "grid",
2022
+ gridTemplateColumns: {
2023
+ base: "1fr",
2024
+ [e]: `${t} 1fr`
2025
+ },
2026
+ gap: s?.gap || "1rem"
2027
+ });
2028
+ },
2029
+ /**
2030
+ * Holy grail layout (header, footer, sidebar, main content)
2031
+ */
2032
+ holyGrail: (s) => {
2033
+ const e = s?.collapseBreakpoint || "lg";
2034
+ return h({
2035
+ display: "grid",
2036
+ gridTemplateAreas: {
2037
+ base: '"header" "main" "footer"',
2038
+ [e]: '"header header" "sidebar main" "footer footer"'
2039
+ },
2040
+ gridTemplateRows: {
2041
+ base: `${s?.headerHeight || "auto"} 1fr ${s?.footerHeight || "auto"}`,
2042
+ [e]: `${s?.headerHeight || "auto"} 1fr ${s?.footerHeight || "auto"}`
2043
+ },
2044
+ gridTemplateColumns: {
2045
+ base: "1fr",
2046
+ [e]: `${s?.sidebarWidth || "250px"} 1fr`
2047
+ },
2048
+ minHeight: "100vh"
2049
+ });
2050
+ },
2051
+ /**
2052
+ * Card grid layout
2053
+ */
2054
+ cardGrid: (s) => Fe.autoFit({
2055
+ minColumnWidth: s?.minCardWidth || "300px",
2056
+ gap: s?.gap || "1rem",
2057
+ maxColumns: s?.maxColumns
2058
+ }),
2059
+ /**
2060
+ * Hero section layout
2061
+ */
2062
+ hero: (s) => h({
2063
+ display: "flex",
2064
+ flexDirection: "column",
2065
+ justifyContent: "center",
2066
+ alignItems: "center",
2067
+ textAlign: s?.textAlign || "center",
2068
+ minHeight: s?.minHeight || "50vh",
2069
+ padding: s?.padding || "2rem"
2070
+ })
2071
+ };
2072
+ class B {
2073
+ /**
2074
+ * Create a responsive value resolver with custom logic
2075
+ */
2076
+ static createResponsiveResolver(e, t = []) {
2077
+ const i = x();
2078
+ return m(() => {
2079
+ t.forEach((n) => n());
2080
+ const r = i(), o = S();
2081
+ return e(r, o);
2082
+ });
2083
+ }
2084
+ /**
2085
+ * Create responsive value that interpolates between breakpoints
2086
+ */
2087
+ static createInterpolatedValue(e, t = {}) {
2088
+ const { smoothing: i = "linear", clamp: r = !0 } = t;
2089
+ return m(() => {
2090
+ const n = S().width, a = P(), c = [];
2091
+ for (const [v, C] of Object.entries(e))
2092
+ if (C !== void 0) {
2093
+ const k = v === "base" ? 0 : parseInt(a[v] || "0");
2094
+ c.push({ width: k, value: C });
2095
+ }
2096
+ if (c.sort((v, C) => v.width - C.width), c.length === 0) return 0;
2097
+ if (c.length === 1) return c[0].value;
2098
+ let d = c[0], l = c[c.length - 1];
2099
+ for (let v = 0; v < c.length - 1; v++)
2100
+ if (n >= c[v].width && n <= c[v + 1].width) {
2101
+ d = c[v], l = c[v + 1];
2102
+ break;
2103
+ }
2104
+ if (r) {
2105
+ if (n <= d.width) return d.value;
2106
+ if (n >= l.width) return l.value;
2107
+ }
2108
+ const p = (n - d.width) / (l.width - d.width);
2109
+ let f = p;
2110
+ switch (i) {
2111
+ case "ease":
2112
+ f = 0.5 - 0.5 * Math.cos(p * Math.PI);
2113
+ break;
2114
+ case "ease-in":
2115
+ f = p * p;
2116
+ break;
2117
+ case "ease-out":
2118
+ f = 1 - (1 - p) * (1 - p);
2119
+ break;
2120
+ case "linear":
2121
+ default:
2122
+ f = p;
2123
+ break;
2124
+ }
2125
+ return d.value + (l.value - d.value) * f;
2126
+ });
2127
+ }
2128
+ /**
2129
+ * Create conditional responsive behavior
2130
+ */
2131
+ static createConditionalResponsive(e, t, i) {
2132
+ const r = x();
2133
+ return m(() => {
2134
+ const o = S(), a = e(o) ? t : i;
2135
+ return this.resolveResponsiveValue(a, r());
2136
+ });
2137
+ }
2138
+ /**
2139
+ * Resolve responsive value at specific breakpoint
2140
+ */
2141
+ static resolveResponsiveValue(e, t) {
2142
+ if (!w(e))
2143
+ return e;
2144
+ const i = e, r = [
2145
+ "base",
2146
+ "sm",
2147
+ "md",
2148
+ "lg",
2149
+ "xl",
2150
+ "2xl"
2151
+ ], o = r.indexOf(t);
2152
+ for (let n = o; n >= 0; n--) {
2153
+ const a = r[n];
2154
+ if (i[a] !== void 0)
2155
+ return i[a];
2156
+ }
2157
+ for (const n of r)
2158
+ if (i[n] !== void 0)
2159
+ return i[n];
2160
+ throw new Error("No responsive value found");
2161
+ }
2162
+ }
2163
+ class Ge {
2164
+ /**
2165
+ * Hook for responsive arrays (e.g., responsive grid columns data)
2166
+ */
2167
+ static useResponsiveArray(e) {
2168
+ const t = x();
2169
+ return m(() => {
2170
+ const i = t();
2171
+ return B.resolveResponsiveValue(e, i) || [];
2172
+ });
2173
+ }
2174
+ /**
2175
+ * Hook for responsive object selection
2176
+ */
2177
+ static useResponsiveObject(e) {
2178
+ const t = x();
2179
+ return m(() => {
2180
+ const i = t();
2181
+ try {
2182
+ return B.resolveResponsiveValue(
2183
+ e,
2184
+ i
2185
+ );
2186
+ } catch {
2187
+ return null;
2188
+ }
2189
+ });
2190
+ }
2191
+ /**
2192
+ * Hook for responsive function selection and execution
2193
+ */
2194
+ static useResponsiveFunction(e) {
2195
+ const t = x();
2196
+ return m(() => {
2197
+ const i = t();
2198
+ try {
2199
+ return B.resolveResponsiveValue(
2200
+ e,
2201
+ i
2202
+ );
2203
+ } catch {
2204
+ return null;
2205
+ }
2206
+ });
2207
+ }
2208
+ /**
2209
+ * Hook for responsive state management
2210
+ */
2211
+ static useResponsiveState(e) {
2212
+ const [t, i] = E(e), r = x();
2213
+ return [m(() => {
2214
+ const a = t(), c = r();
2215
+ try {
2216
+ return B.resolveResponsiveValue(
2217
+ a,
2218
+ c
2219
+ );
2220
+ } catch {
2221
+ return;
2222
+ }
2223
+ }), (a) => {
2224
+ w(a) ? i(a) : i({ [r()]: a });
2225
+ }];
2226
+ }
2227
+ /**
2228
+ * Hook for responsive computations with memoization
2229
+ */
2230
+ static useResponsiveComputation(e, t = []) {
2231
+ return ge(() => {
2232
+ t.forEach((r) => r());
2233
+ const i = S();
2234
+ return e(i);
2235
+ });
2236
+ }
2237
+ /**
2238
+ * Hook for responsive side effects
2239
+ */
2240
+ static useResponsiveEffect(e, t = []) {
2241
+ let i, r;
2242
+ V(() => {
2243
+ t.forEach((a) => a());
2244
+ const o = S();
2245
+ i && (i(), i = void 0);
2246
+ const n = e(o, r);
2247
+ typeof n == "function" && (i = n), r = o;
2248
+ });
2249
+ }
2250
+ }
2251
+ class Ue {
2252
+ /**
2253
+ * Execute callback only on specific breakpoints
2254
+ */
2255
+ static onBreakpoints(e, t) {
2256
+ let i;
2257
+ return V(() => {
2258
+ const r = S();
2259
+ if (e.includes(r.current)) {
2260
+ i && (i(), i = void 0);
2261
+ const o = t(r);
2262
+ typeof o == "function" && (i = o);
2263
+ }
2264
+ }), () => {
2265
+ i && i();
2266
+ };
2267
+ }
2268
+ /**
2269
+ * Execute callback when breakpoint changes
2270
+ */
2271
+ static onBreakpointChange(e) {
2272
+ let t;
2273
+ return V(() => {
2274
+ const i = S(), r = i.current;
2275
+ t && t !== r && e(r, t, i), t = r;
2276
+ }), () => {
2277
+ };
2278
+ }
2279
+ /**
2280
+ * Execute callback when entering/leaving specific breakpoint ranges
2281
+ */
2282
+ static onBreakpointRange(e, t, i) {
2283
+ let r = !1, o, n;
2284
+ return V(() => {
2285
+ const a = S(), c = y(a.current), d = y(e), l = y(t), p = c >= d && c <= l;
2286
+ if (p && !r) {
2287
+ if (i.onEnter) {
2288
+ const f = i.onEnter(a);
2289
+ typeof f == "function" && (n = f);
2290
+ }
2291
+ r = !0;
2292
+ } else !p && r && (n && (n(), n = void 0), o && (o(), o = void 0), i.onLeave && i.onLeave(a), r = !1);
2293
+ if (p && i.onWithin) {
2294
+ o && (o(), o = void 0);
2295
+ const f = i.onWithin(a);
2296
+ typeof f == "function" && (o = f);
2297
+ }
2298
+ }), () => {
2299
+ n && n(), o && o();
2300
+ };
2301
+ }
2302
+ }
2303
+ class Ke {
2304
+ /**
2305
+ * Create responsive pagination
2306
+ */
2307
+ static createResponsivePagination(e, t) {
2308
+ const [i, r] = E(1), o = x(), n = m(() => {
2309
+ const C = o();
2310
+ return B.resolveResponsiveValue(
2311
+ t,
2312
+ C
2313
+ );
2314
+ }), a = m(() => Math.ceil(e.length / n())), c = m(() => {
2315
+ const C = n(), I = (i() - 1) * C, fe = I + C;
2316
+ return e.slice(I, fe);
2317
+ }), d = m(
2318
+ () => i() < a()
2319
+ ), l = m(() => i() > 1), p = (C) => {
2320
+ const k = a();
2321
+ r(Math.max(1, Math.min(C, k)));
2322
+ }, f = () => {
2323
+ d() && r(i() + 1);
2324
+ }, v = () => {
2325
+ l() && r(i() - 1);
2326
+ };
2327
+ return V(() => {
2328
+ n(), r(1);
2329
+ }), {
2330
+ currentPage: i,
2331
+ totalPages: a,
2332
+ currentItems: c,
2333
+ setPage: p,
2334
+ nextPage: f,
2335
+ prevPage: v,
2336
+ hasNext: d,
2337
+ hasPrev: l
2338
+ };
2339
+ }
2340
+ /**
2341
+ * Create responsive filtering
2342
+ */
2343
+ static createResponsiveFilter(e, t) {
2344
+ const i = x();
2345
+ return m(() => {
2346
+ const r = i(), o = B.resolveResponsiveValue(
2347
+ t,
2348
+ r
2349
+ );
2350
+ return o ? e.filter(o) : e;
2351
+ });
2352
+ }
2353
+ /**
2354
+ * Create responsive sorting
2355
+ */
2356
+ static createResponsiveSort(e, t) {
2357
+ const i = x();
2358
+ return m(() => {
2359
+ const r = i(), o = B.resolveResponsiveValue(
2360
+ t,
2361
+ r
2362
+ );
2363
+ return o ? [...e].sort(o) : e;
2364
+ });
2365
+ }
2366
+ }
2367
+ const It = {
2368
+ Breakpoints: B,
2369
+ Hooks: Ge,
2370
+ Targeting: Ue,
2371
+ Data: Ke
2372
+ };
2373
+ class M {
2374
+ static isEnabled = !1;
2375
+ static debugOverlay = null;
2376
+ static logLevel = "info";
2377
+ /**
2378
+ * Enable responsive development tools
2379
+ */
2380
+ static enable(e = {}) {
2381
+ if (process.env.NODE_ENV === "production") {
2382
+ console.warn("ResponsiveDevTools: Not enabling in production mode");
2383
+ return;
2384
+ }
2385
+ this.isEnabled = !0, this.logLevel = e.logLevel || "info", this.log("info", "ResponsiveDevTools: Enabled"), e.showOverlay && this.createDebugOverlay(e), e.highlightResponsiveElements && this.enableElementHighlighting(), e.showPerformance && this.enablePerformanceMonitoring(), this.logResponsiveState();
2386
+ }
2387
+ /**
2388
+ * Disable responsive development tools
2389
+ */
2390
+ static disable() {
2391
+ this.isEnabled = !1, this.debugOverlay && (this.debugOverlay.remove(), this.debugOverlay = null), this.disableElementHighlighting(), this.log("info", "ResponsiveDevTools: Disabled");
2392
+ }
2393
+ /**
2394
+ * Check if development tools are enabled
2395
+ */
2396
+ static get enabled() {
2397
+ return this.isEnabled && process.env.NODE_ENV !== "production";
2398
+ }
2399
+ /**
2400
+ * Log responsive information
2401
+ */
2402
+ static log(e, ...t) {
2403
+ if (!this.enabled) return;
2404
+ const i = ["error", "warn", "info", "debug"], r = i.indexOf(this.logLevel);
2405
+ i.indexOf(e) <= r && console[e]("[ResponsiveDevTools]", ...t);
2406
+ }
2407
+ /**
2408
+ * Create visual debug overlay
2409
+ */
2410
+ static createDebugOverlay(e) {
2411
+ if (typeof document > "u") return;
2412
+ const t = e.position || "top-right";
2413
+ this.debugOverlay = document.createElement("div"), this.debugOverlay.id = "tachui-responsive-debug", this.debugOverlay.style.cssText = `
2414
+ position: fixed;
2415
+ ${t.includes("top") ? "top: 10px" : "bottom: 10px"};
2416
+ ${t.includes("right") ? "right: 10px" : "left: 10px"};
2417
+ background: rgba(0, 0, 0, 0.9);
2418
+ color: white;
2419
+ padding: 12px;
2420
+ border-radius: 8px;
2421
+ font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
2422
+ font-size: 12px;
2423
+ z-index: 10000;
2424
+ pointer-events: auto;
2425
+ cursor: pointer;
2426
+ max-width: 300px;
2427
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
2428
+ border: 1px solid rgba(255, 255, 255, 0.1);
2429
+ `;
2430
+ const i = document.createElement("div");
2431
+ i.textContent = "×", i.style.cssText = `
2432
+ position: absolute;
2433
+ top: 4px;
2434
+ right: 8px;
2435
+ cursor: pointer;
2436
+ font-size: 16px;
2437
+ color: #ff6b6b;
2438
+ `, i.onclick = () => this.disable(), this.debugOverlay.appendChild(i), document.body.appendChild(this.debugOverlay), this.updateDebugOverlay(e);
2439
+ let r;
2440
+ window.addEventListener("resize", () => {
2441
+ clearTimeout(r), r = window.setTimeout(() => {
2442
+ this.updateDebugOverlay(e);
2443
+ }, 100);
2444
+ });
2445
+ }
2446
+ /**
2447
+ * Update debug overlay content
2448
+ */
2449
+ static updateDebugOverlay(e) {
2450
+ if (!this.debugOverlay) return;
2451
+ const t = S(), i = P();
2452
+ let r = `
2453
+ <div style="margin-bottom: 8px; font-weight: bold; color: #4fc3f7;">
2454
+ 📱 Responsive Debug
2455
+ </div>
2456
+ `;
2457
+ if (r += `
2458
+ <div style="margin-bottom: 6px;">
2459
+ <strong>Current:</strong> <span style="color: #66bb6a;">${t.current}</span>
2460
+ </div>
2461
+ <div style="margin-bottom: 6px;">
2462
+ <strong>Size:</strong> ${t.width}×${t.height}
2463
+ </div>
2464
+ `, e.showBreakpoints) {
2465
+ r += '<div style="margin: 8px 0; font-weight: bold; color: #ffb74d;">Breakpoints:</div>';
2466
+ for (const [n, a] of Object.entries(i)) {
2467
+ const c = n === t.current;
2468
+ r += `
2469
+ <div style="color: ${c ? "#66bb6a" : "#999"}; margin-bottom: 2px;">
2470
+ ${c ? "▶" : "▷"} ${n}: ${a}
2471
+ </div>
2472
+ `;
2473
+ }
2474
+ }
2475
+ if (e.showPerformance) {
2476
+ const n = A.getStats(), a = R.getStats();
2477
+ if (r += '<div style="margin: 8px 0; font-weight: bold; color: #f06292;">Performance:</div>', r += `
2478
+ <div style="margin-bottom: 2px;">
2479
+ Cache: ${a.size} rules (${(a.hitRate * 100).toFixed(1)}% hit rate)
2480
+ </div>
2481
+ `, Object.keys(n).length > 0)
2482
+ for (const [c, d] of Object.entries(n))
2483
+ r += `
2484
+ <div style="margin-bottom: 2px;">
2485
+ ${c}: ${d.average.toFixed(2)}ms avg
2486
+ </div>
2487
+ `;
2488
+ }
2489
+ r += '<div style="margin: 8px 0; font-weight: bold; color: #ba68c8;">Media Queries:</div>';
2490
+ const o = {
2491
+ Touch: b.touchDevice,
2492
+ Dark: b.darkMode,
2493
+ "Reduced Motion": b.reducedMotion,
2494
+ "High Contrast": b.highContrast
2495
+ };
2496
+ for (const [n, a] of Object.entries(o)) {
2497
+ const c = window.matchMedia(a).matches;
2498
+ r += `
2499
+ <div style="color: ${c ? "#66bb6a" : "#666"}; margin-bottom: 2px;">
2500
+ ${c ? "✓" : "✗"} ${n}
2501
+ </div>
2502
+ `;
2503
+ }
2504
+ this.debugOverlay.innerHTML = r + this.debugOverlay.querySelector("div:last-child")?.outerHTML || "";
2505
+ }
2506
+ /**
2507
+ * Enable element highlighting for responsive elements
2508
+ */
2509
+ static enableElementHighlighting() {
2510
+ if (typeof document > "u") return;
2511
+ const e = document.createElement("style");
2512
+ e.id = "tachui-responsive-highlight", e.textContent = `
2513
+ .tachui-responsive-element {
2514
+ outline: 2px dashed #4fc3f7 !important;
2515
+ outline-offset: 2px !important;
2516
+ position: relative !important;
2517
+ }
2518
+
2519
+ .tachui-responsive-element::before {
2520
+ content: 'R';
2521
+ position: absolute !important;
2522
+ top: -8px !important;
2523
+ right: -8px !important;
2524
+ background: #4fc3f7 !important;
2525
+ color: white !important;
2526
+ width: 16px !important;
2527
+ height: 16px !important;
2528
+ border-radius: 50% !important;
2529
+ font-size: 10px !important;
2530
+ font-weight: bold !important;
2531
+ display: flex !important;
2532
+ align-items: center !important;
2533
+ justify-content: center !important;
2534
+ z-index: 10001 !important;
2535
+ font-family: monospace !important;
2536
+ }
2537
+ `, document.head.appendChild(e), new MutationObserver(() => {
2538
+ this.highlightResponsiveElements();
2539
+ }).observe(document.body, {
2540
+ childList: !0,
2541
+ subtree: !0,
2542
+ attributes: !0,
2543
+ attributeFilter: ["class"]
2544
+ }), this.highlightResponsiveElements();
2545
+ }
2546
+ /**
2547
+ * Disable element highlighting
2548
+ */
2549
+ static disableElementHighlighting() {
2550
+ if (typeof document > "u") return;
2551
+ const e = document.getElementById("tachui-responsive-highlight");
2552
+ e && e.remove(), document.querySelectorAll(".tachui-responsive-element").forEach((t) => {
2553
+ t.classList.remove("tachui-responsive-element");
2554
+ });
2555
+ }
2556
+ /**
2557
+ * Highlight elements with responsive classes
2558
+ */
2559
+ static highlightResponsiveElements() {
2560
+ if (typeof document > "u") return;
2561
+ [
2562
+ '[class*="tachui-responsive-"]',
2563
+ '[class*="tachui-mq-"]'
2564
+ ].forEach((t) => {
2565
+ document.querySelectorAll(t).forEach((i) => {
2566
+ i.classList.contains("tachui-responsive-element") || i.classList.add("tachui-responsive-element");
2567
+ });
2568
+ });
2569
+ }
2570
+ /**
2571
+ * Enable performance monitoring display
2572
+ */
2573
+ static enablePerformanceMonitoring() {
2574
+ setInterval(() => {
2575
+ if (!this.enabled) return;
2576
+ const e = A.getStats(), t = R.getStats();
2577
+ this.log("debug", "Performance Stats:", {
2578
+ cache: t,
2579
+ performance: e
2580
+ });
2581
+ }, 5e3);
2582
+ }
2583
+ /**
2584
+ * Log current responsive state
2585
+ */
2586
+ static logResponsiveState() {
2587
+ if (!this.enabled) return;
2588
+ const e = S(), t = P();
2589
+ if (console.group("🔍 TachUI Responsive State"), console.log("Current breakpoint:", e.current), console.log("Viewport:", `${e.width}×${e.height}`), console.log("Configuration:", t), typeof window < "u" && window.matchMedia) {
2590
+ const i = {
2591
+ Mobile: b.mobile,
2592
+ Tablet: b.tablet,
2593
+ Desktop: b.desktop,
2594
+ "Touch Device": b.touchDevice,
2595
+ "Dark Mode": b.darkMode,
2596
+ "Reduced Motion": b.reducedMotion
2597
+ };
2598
+ console.log("Media Query Results:");
2599
+ for (const [r, o] of Object.entries(i))
2600
+ try {
2601
+ console.log(` ${r}: ${window.matchMedia(o).matches}`);
2602
+ } catch {
2603
+ console.log(` ${r}: Error testing query`);
2604
+ }
2605
+ }
2606
+ console.groupEnd();
2607
+ }
2608
+ /**
2609
+ * Inspect a responsive value
2610
+ */
2611
+ static inspectResponsiveValue(e, t) {
2612
+ if (!this.enabled) return;
2613
+ const i = x();
2614
+ if (console.group(`🔍 Responsive Value${t ? ` - ${t}` : ""}`), w(e)) {
2615
+ const r = e;
2616
+ console.log("Responsive object:", r);
2617
+ const o = [
2618
+ "base",
2619
+ "sm",
2620
+ "md",
2621
+ "lg",
2622
+ "xl",
2623
+ "2xl"
2624
+ ], n = o.indexOf(i());
2625
+ let a;
2626
+ for (let c = n; c >= 0; c--) {
2627
+ const d = o[c];
2628
+ if (r[d] !== void 0) {
2629
+ a = r[d], console.log(`Resolved value (${d}):`, a);
2630
+ break;
2631
+ }
2632
+ }
2633
+ console.log("Defined breakpoints:");
2634
+ for (const [c, d] of Object.entries(r))
2635
+ if (d !== void 0) {
2636
+ const l = c === i();
2637
+ console.log(` ${l ? "→" : " "} ${c}:`, d);
2638
+ }
2639
+ } else
2640
+ console.log("Static value:", e);
2641
+ console.groupEnd();
2642
+ }
2643
+ /**
2644
+ * Test responsive behavior
2645
+ */
2646
+ static testResponsiveBehavior(e, t = ["base", "sm", "md", "lg", "xl", "2xl"]) {
2647
+ if (!this.enabled) return {};
2648
+ const i = {};
2649
+ return t.forEach((r) => {
2650
+ this.log("debug", `Testing breakpoint ${r}:`, e);
2651
+ }), i;
2652
+ }
2653
+ /**
2654
+ * Export responsive configuration for debugging
2655
+ */
2656
+ static exportConfiguration() {
2657
+ const e = S(), t = P(), i = A.getStats(), r = R.getStats(), o = {};
2658
+ if (typeof window < "u" && window.matchMedia) {
2659
+ for (const [n, a] of Object.entries(b))
2660
+ if (typeof a == "string")
2661
+ try {
2662
+ o[n] = window.matchMedia(a).matches;
2663
+ } catch {
2664
+ o[n] = !1;
2665
+ }
2666
+ }
2667
+ return {
2668
+ breakpoints: t,
2669
+ currentContext: e,
2670
+ performance: {
2671
+ cache: r,
2672
+ timings: i
2673
+ },
2674
+ mediaQueries: o
2675
+ };
2676
+ }
2677
+ }
2678
+ function Ze(s, e) {
2679
+ const t = x();
2680
+ return m(() => {
2681
+ const i = t(), r = w(s);
2682
+ let o, n = {};
2683
+ if (r) {
2684
+ const a = s;
2685
+ n = a;
2686
+ const c = [
2687
+ "base",
2688
+ "sm",
2689
+ "md",
2690
+ "lg",
2691
+ "xl",
2692
+ "2xl"
2693
+ ], d = c.indexOf(i);
2694
+ for (let l = d; l >= 0; l--) {
2695
+ const p = c[l];
2696
+ if (a[p] !== void 0) {
2697
+ o = a[p];
2698
+ break;
2699
+ }
2700
+ }
2701
+ } else
2702
+ o = s, n = { [i]: o };
2703
+ return M.enabled && e && M.inspectResponsiveValue(s, e), {
2704
+ resolvedValue: o,
2705
+ activeBreakpoint: i,
2706
+ allValues: n,
2707
+ isResponsive: r
2708
+ };
2709
+ });
2710
+ }
2711
+ class Ye {
2712
+ /**
2713
+ * Test CSS features support
2714
+ */
2715
+ static testCSSFeatures() {
2716
+ if (typeof window > "u" || typeof CSS > "u" || !CSS.supports)
2717
+ return {};
2718
+ const e = {};
2719
+ try {
2720
+ e.cssGrid = CSS.supports("display", "grid"), e.flexbox = CSS.supports("display", "flex"), e.customProperties = CSS.supports("--test", "value"), e.viewportUnits = CSS.supports("width", "100vw"), e.mediaQueries = typeof window.matchMedia == "function", e.containerQueries = CSS.supports("container-type", "inline-size"), e.logicalProperties = CSS.supports("margin-inline-start", "1rem");
2721
+ } catch {
2722
+ }
2723
+ return e;
2724
+ }
2725
+ /**
2726
+ * Test responsive behavior across different viewport sizes
2727
+ */
2728
+ static testViewportSizes(e) {
2729
+ if (typeof window > "u") return;
2730
+ const t = [
2731
+ { width: 320, height: 568, name: "iPhone SE" },
2732
+ { width: 375, height: 667, name: "iPhone 8" },
2733
+ { width: 768, height: 1024, name: "iPad Portrait" },
2734
+ { width: 1024, height: 768, name: "iPad Landscape" },
2735
+ { width: 1280, height: 720, name: "Desktop Small" },
2736
+ { width: 1920, height: 1080, name: "Desktop Large" }
2737
+ ];
2738
+ M.enabled && M.log("info", "Testing viewport sizes:", t), t.forEach((i) => {
2739
+ e(i.width, i.height);
2740
+ });
2741
+ }
2742
+ }
2743
+ typeof window < "u" && process.env.NODE_ENV !== "production" && (window.tachUIResponsive = {
2744
+ devTools: M,
2745
+ inspector: Ze,
2746
+ compatibility: Ye,
2747
+ logState: () => M.logResponsiveState(),
2748
+ export: () => M.exportConfiguration()
2749
+ });
2750
+ const Xe = {
2751
+ name: "@tachui/responsive",
2752
+ version: Ne,
2753
+ author: "TachUI Team",
2754
+ verified: !0
2755
+ }, N = 80, Je = [
2756
+ [
2757
+ "responsive",
2758
+ h,
2759
+ {
2760
+ category: "layout",
2761
+ priority: N,
2762
+ signature: "(config: ResponsiveStyleConfig) => Modifier",
2763
+ description: "Applies responsive style mappings across configured breakpoints."
2764
+ }
2765
+ ],
2766
+ [
2767
+ "mediaQuery",
2768
+ $,
2769
+ {
2770
+ category: "layout",
2771
+ priority: N,
2772
+ signature: "(query: string, styles: Record<string, any>) => Modifier",
2773
+ description: "Attaches custom CSS rules for a media query to a component."
2774
+ }
2775
+ ],
2776
+ [
2777
+ "responsiveProperty",
2778
+ u,
2779
+ {
2780
+ category: "layout",
2781
+ priority: N,
2782
+ signature: "(property: string, value: ResponsiveValue<any>) => Modifier",
2783
+ description: "Creates a responsive modifier from a single style property/value map."
2784
+ }
2785
+ ],
2786
+ [
2787
+ "responsiveLayout",
2788
+ pe,
2789
+ {
2790
+ category: "layout",
2791
+ priority: N,
2792
+ signature: "(config: ResponsiveLayoutConfig) => Modifier",
2793
+ description: "Configures responsive flexbox layout properties such as direction, wrap, and gap."
2794
+ }
2795
+ ]
2796
+ ];
2797
+ let re = !1;
2798
+ function et(s) {
2799
+ const e = s?.registry, t = s?.plugin ?? Xe, i = s?.force === !0, r = !!(e || s?.plugin);
2800
+ !r && re && !i || (Je.forEach(([o, n, a]) => {
2801
+ _e(
2802
+ o,
2803
+ n,
2804
+ a,
2805
+ e,
2806
+ t
2807
+ );
2808
+ }), r || (re = !0));
2809
+ }
2810
+ et();
2811
+ export {
2812
+ B as AdvancedBreakpointUtils,
2813
+ lt as BreakpointPresets,
2814
+ Ye as BrowserCompatibility,
2815
+ ue as CSSInjector,
2816
+ Rt as Container,
2817
+ oe as DEFAULT_BREAKPOINTS,
2818
+ kt as Flex,
2819
+ Et as LayoutPatterns,
2820
+ b as MediaQueries,
2821
+ He as MediaQueryModifier,
2822
+ ft as OptimizedCSSGenerator,
2823
+ le as RESPONSIVE_MODIFIER_PRIORITY,
2824
+ It as ResponsiveAdvanced,
2825
+ de as ResponsiveCSSGenerator,
2826
+ Rt as ResponsiveContainerPatterns,
2827
+ Ke as ResponsiveDataUtils,
2828
+ M as ResponsiveDevTools,
2829
+ kt as ResponsiveFlexPatterns,
2830
+ Fe as ResponsiveGrid,
2831
+ Fe as ResponsiveGridPatterns,
2832
+ Ge as ResponsiveHooks,
2833
+ U as ResponsiveModifier,
2834
+ he as ResponsiveModifierBuilderImpl,
2835
+ A as ResponsivePerformanceMonitor,
2836
+ Ot as ResponsiveSpacingPatterns,
2837
+ Ue as ResponsiveTargeting,
2838
+ Vt as ResponsiveTypography,
2839
+ Vt as ResponsiveTypographyPatterns,
2840
+ Mt as ResponsiveVisibilityPatterns,
2841
+ Ot as Spacing,
2842
+ Mt as Visibility,
2843
+ G as breakpointToPixels,
2844
+ St as combineMediaQueries,
2845
+ nt as configureBreakpoints,
2846
+ S as createBreakpointContext,
2847
+ $ as createMediaQueryModifier,
2848
+ gt as createResponsiveBuilder,
2849
+ wt as createResponsiveCSSVariables,
2850
+ pe as createResponsiveLayoutModifier,
2851
+ h as createResponsiveModifier,
2852
+ u as createResponsivePropertyModifier,
2853
+ $t as createResponsiveVisibility,
2854
+ R as cssRuleCache,
2855
+ Bt as enableResponsiveDebugOverlay,
2856
+ ht as generateCustomMediaQuery,
2857
+ Le as generateMediaQuery,
2858
+ ct as generateRangeMediaQuery,
2859
+ pt as generateResponsiveProperty,
2860
+ y as getBreakpointIndex,
2861
+ dt as getBreakpointsAbove,
2862
+ ut as getBreakpointsBelow,
2863
+ x as getCurrentBreakpoint,
2864
+ P as getCurrentBreakpointConfig,
2865
+ Q as getSortedBreakpoints,
2866
+ ot as getViewportDimensions,
2867
+ at as initializeResponsiveSystem,
2868
+ te as isBreakpointAbove,
2869
+ ie as isBreakpointBelow,
2870
+ w as isResponsiveValue,
2871
+ J as isValidBreakpointKey,
2872
+ We as logResponsiveState,
2873
+ Ct as orMediaQueries,
2874
+ et as registerResponsiveModifiers,
2875
+ xt as resolveResponsiveValue,
2876
+ bt as useBreakpoint,
2877
+ vt as useMediaQuery,
2878
+ Ze as useResponsiveInspector,
2879
+ yt as useResponsiveValue,
2880
+ mt as withResponsive
2881
+ };