@tachui/core 0.8.23 → 0.8.25

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 (56) hide show
  1. package/dist/assets/index.js +41 -40
  2. package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
  3. package/dist/build-tools/typegen-runner.d.ts +4 -0
  4. package/dist/build-tools/typegen-runner.d.ts.map +1 -1
  5. package/dist/cleanup-BR8UpYPX.js +61 -0
  6. package/dist/common.js +272 -277
  7. package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
  8. package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
  9. package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/computed-CA4Cgtoe.js +407 -0
  12. package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
  13. package/dist/css-classes/index.js +2 -2
  14. package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
  15. package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
  16. package/dist/essential.js +276 -281
  17. package/dist/factories-Bz6LZlk6.js +653 -0
  18. package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
  19. package/dist/full.d.ts +12 -0
  20. package/dist/full.d.ts.map +1 -0
  21. package/dist/full.js +436 -0
  22. package/dist/gradients/index.js +53 -53
  23. package/dist/hooks-w_FYPLjI.js +158 -0
  24. package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +295 -300
  28. package/dist/minimal-prod.js +106 -108
  29. package/dist/minimal.js +97 -98
  30. package/dist/modifiers/base.d.ts.map +1 -1
  31. package/dist/modifiers/base.js +188 -181
  32. package/dist/modifiers/builder.js +1 -1
  33. package/dist/modifiers/factories.d.ts.map +1 -1
  34. package/dist/modifiers/index.js +22 -23
  35. package/dist/modifiers/registry.js +1 -1
  36. package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
  37. package/dist/optimization-D9t53vNJ.js +308 -0
  38. package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
  39. package/dist/reactive/index.js +87 -85
  40. package/dist/runtime/dom-bridge.js +15 -17
  41. package/dist/runtime/index.js +71 -71
  42. package/dist/runtime/renderer.js +10 -11
  43. package/dist/signal-BRoiFOO7.js +262 -0
  44. package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
  45. package/dist/state/index.js +43 -44
  46. package/dist/theme-D5-09a8N.js +26 -0
  47. package/dist/validation/index.js +24 -26
  48. package/dist/version.js +1 -1
  49. package/package.json +16 -3
  50. package/dist/factories-B3-rmvkB.js +0 -268
  51. package/dist/hooks-WGmpzYgD.js +0 -446
  52. package/dist/optimization-CbKNA9w4.js +0 -21
  53. package/dist/presets-B9x94uRn.js +0 -381
  54. package/dist/scheduler-DppMK9mR.js +0 -169
  55. package/dist/theme-CRLPHryV.js +0 -687
  56. package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
@@ -1,118 +1,105 @@
1
1
  import { infinity as c } from "./constants/layout.js";
2
- import { LayoutModifier as m } from "./modifiers/base.js";
3
- import { y as h, t as z, h as M } from "./concatenated-component-2Gzy5e2c.js";
4
- import { g as O, a as N } from "./proxy-Cp0QUXME.js";
2
+ import { LayoutModifier as l } from "./modifiers/base.js";
3
+ import { C as h, t as z, h as M } from "./concatenated-component-CA54ng_j.js";
4
+ import { g as O, c as N } from "./proxy-B7ZIqGd0.js";
5
5
  import "./assets/index.js";
6
- import "./scheduler-DppMK9mR.js";
7
- import "./theme-CRLPHryV.js";
8
- import "@tachui/types/reactive";
9
6
  import "@tachui/types/modifiers";
10
- import "typescript";
11
7
  import "@tachui/registry";
12
- import "./presets-B9x94uRn.js";
13
- import "./component-D-O9yq0P.js";
14
- import "./hooks-WGmpzYgD.js";
15
8
  import "./runtime/dom-bridge.js";
16
- import "./component-base-C41K3NTe.js";
17
- import "@tachui/types/gradients";
18
- import "./index-JQ1sW1SK.js";
19
- import "./plugins/index.js";
20
- import "./state/index.js";
21
- import "./validation/index.js";
22
- function st() {
23
- return new m({
9
+ function X() {
10
+ return new l({
24
11
  frame: {
25
12
  maxWidth: c
26
13
  }
27
14
  });
28
15
  }
29
- function ct() {
30
- return new m({
16
+ function J() {
17
+ return new l({
31
18
  frame: {
32
19
  maxHeight: c
33
20
  }
34
21
  });
35
22
  }
36
- function mt() {
37
- return new m({
23
+ function K() {
24
+ return new l({
38
25
  frame: {
39
26
  maxWidth: c,
40
27
  maxHeight: c
41
28
  }
42
29
  });
43
30
  }
44
- function lt() {
45
- return new m({
31
+ function Y() {
32
+ return new l({
46
33
  frame: {
47
34
  width: c,
48
35
  height: c
49
36
  }
50
37
  });
51
38
  }
52
- function ut(r) {
53
- return new m({
39
+ function Z(r) {
40
+ return new l({
54
41
  frame: {
55
42
  width: r,
56
43
  maxHeight: c
57
44
  }
58
45
  });
59
46
  }
60
- function dt(r) {
61
- return new m({
47
+ function Q(r) {
48
+ return new l({
62
49
  frame: {
63
50
  height: r,
64
51
  maxWidth: c
65
52
  }
66
53
  });
67
54
  }
68
- function pt(r, t) {
69
- return new m({
55
+ function ee(r, e) {
56
+ return new l({
70
57
  frame: {
71
58
  width: c,
72
59
  height: c,
73
60
  maxWidth: r,
74
- maxHeight: t
61
+ maxHeight: e
75
62
  }
76
63
  });
77
64
  }
78
- function ft(r, t, e, n) {
79
- return new m({
65
+ function te(r, e, t, n) {
66
+ return new l({
80
67
  frame: {
81
68
  width: c,
82
69
  height: c,
83
70
  minWidth: r,
84
- maxWidth: t,
85
- minHeight: e,
71
+ maxWidth: e,
72
+ minHeight: t,
86
73
  maxHeight: n
87
74
  }
88
75
  });
89
76
  }
90
- function ht() {
91
- return new m({
77
+ function ne() {
78
+ return new l({
92
79
  frame: {
93
80
  maxWidth: c,
94
81
  maxHeight: c
95
82
  }
96
83
  });
97
84
  }
98
- function gt() {
99
- return new m({
85
+ function re() {
86
+ return new l({
100
87
  frame: {
101
88
  width: "100vw",
102
89
  height: "100vh"
103
90
  }
104
91
  });
105
92
  }
106
- function yt() {
107
- return new m({
93
+ function ie() {
94
+ return new l({
108
95
  frame: {
109
96
  width: c,
110
97
  height: c
111
98
  }
112
99
  });
113
100
  }
114
- function xt() {
115
- return new m({
101
+ function oe() {
102
+ return new l({
116
103
  frame: {
117
104
  width: c
118
105
  }
@@ -181,32 +168,32 @@ function L(r) {
181
168
  return r.replace(/<\?[\s\S]*?\?>/g, "").replace(/<!DOCTYPE[\s\S]*?>/gi, "").replace(/<!ENTITY[\s\S]*?>/gi, "");
182
169
  }
183
170
  function _(r) {
184
- const t = r.toLowerCase().replace(/[\u0000-\u0020]+/g, "");
185
- return t.includes("javascript:") || t.includes("data:");
171
+ const e = r.toLowerCase().replace(/[\u0000-\u0020]+/g, "");
172
+ return e.includes("javascript:") || e.includes("data:");
186
173
  }
187
174
  function R(r) {
188
- const t = r.trim();
189
- return /^#[A-Za-z_][\w:.-]*$/.test(t);
175
+ const e = r.trim();
176
+ return /^#[A-Za-z_][\w:.-]*$/.test(e);
190
177
  }
191
178
  function P(r) {
192
179
  return !!r.trim().match(/^url\((["']?)(#[A-Za-z_][\w:.-]*)\1\)$/);
193
180
  }
194
- function D(r, t) {
195
- const e = r.toLowerCase();
196
- if (A.has(e) && !e.startsWith("on") && !_(t))
197
- return e === "href" || e === "xlink:href" ? R(t) ? t.trim() : void 0 : t.includes("url(") ? P(t) ? t.trim() : void 0 : t;
181
+ function D(r, e) {
182
+ const t = r.toLowerCase();
183
+ if (A.has(t) && !t.startsWith("on") && !_(e))
184
+ return t === "href" || t === "xlink:href" ? R(e) ? e.trim() : void 0 : e.includes("url(") ? P(e) ? e.trim() : void 0 : e;
198
185
  }
199
- function E(r, t) {
200
- const e = r.tagName.toLowerCase();
201
- if (v.has(e))
186
+ function E(r, e) {
187
+ const t = r.tagName.toLowerCase();
188
+ if (v.has(t))
202
189
  return [];
203
- if (!k.has(e)) {
190
+ if (!k.has(t)) {
204
191
  const i = [];
205
192
  for (const o of r.childNodes)
206
- i.push(...C(o, t));
193
+ i.push(...C(o, e));
207
194
  return i;
208
195
  }
209
- const n = t.createElementNS(w, r.tagName);
196
+ const n = e.createElementNS(w, r.tagName);
210
197
  for (const i of r.getAttributeNames()) {
211
198
  const o = r.getAttribute(i);
212
199
  if (o === null) continue;
@@ -214,16 +201,16 @@ function E(r, t) {
214
201
  a !== void 0 && n.setAttribute(i, a);
215
202
  }
216
203
  for (const i of r.childNodes) {
217
- const o = C(i, t);
204
+ const o = C(i, e);
218
205
  for (const a of o)
219
206
  n.appendChild(a);
220
207
  }
221
208
  return [n];
222
209
  }
223
- function C(r, t) {
224
- return r.nodeType === Node.ELEMENT_NODE ? E(r, t) : r.nodeType === Node.TEXT_NODE ? [t.createTextNode(r.textContent ?? "")] : [];
210
+ function C(r, e) {
211
+ return r.nodeType === Node.ELEMENT_NODE ? E(r, e) : r.nodeType === Node.TEXT_NODE ? [e.createTextNode(r.textContent ?? "")] : [];
225
212
  }
226
- function St(r) {
213
+ function ae(r) {
227
214
  if (typeof r != "string" || r.trim() === "") return "";
228
215
  const n = new DOMParser().parseFromString(L(r), "image/svg+xml").documentElement;
229
216
  if (!n || n.tagName.toLowerCase() !== "svg") return "";
@@ -232,25 +219,25 @@ function St(r) {
232
219
  );
233
220
  return !a || a.tagName.toLowerCase() !== "svg" ? "" : (i.replaceChild(a, i.documentElement), new XMLSerializer().serializeToString(i.documentElement));
234
221
  }
235
- const Ct = Symbol.for("tachui.concat");
236
- function bt(r) {
222
+ const se = Symbol.for("tachui.concat");
223
+ function ce(r) {
237
224
  return r && typeof r == "object" && typeof r.isConcatenatable == "function" && r.isConcatenatable();
238
225
  }
239
- function Tt(r) {
226
+ function le(r) {
240
227
  return r && typeof r == "object" && r.constructor.name === "ConcatenatedComponent";
241
228
  }
242
- const wt = Symbol.for("tachui.concat");
243
- class Et {
229
+ const ue = Symbol.for("tachui.concat");
230
+ class me {
244
231
  /**
245
232
  * Concatenate this component with another concatenatable component
246
233
  */
247
- concat(t) {
248
- const e = this.toSegment(), n = t.toSegment();
249
- return t instanceof h ? new h(
250
- [e, ...t.segments],
251
- this.mergeMetadata(t.metadata, t.segments.length + 1)
234
+ concat(e) {
235
+ const t = this.toSegment(), n = e.toSegment();
236
+ return e instanceof h ? new h(
237
+ [t, ...e.segments],
238
+ this.mergeMetadata(e.metadata, e.segments.length + 1)
252
239
  ) : new h(
253
- [e, n],
240
+ [t, n],
254
241
  this.createMetadata(2)
255
242
  );
256
243
  }
@@ -263,9 +250,9 @@ class Et {
263
250
  /**
264
251
  * Create metadata for a new concatenated component
265
252
  */
266
- createMetadata(t) {
253
+ createMetadata(e) {
267
254
  return {
268
- totalSegments: t,
255
+ totalSegments: e,
269
256
  accessibilityRole: this.determineAccessibilityRole(),
270
257
  semanticStructure: this.determineSemanticStructure()
271
258
  };
@@ -273,45 +260,45 @@ class Et {
273
260
  /**
274
261
  * Merge metadata when concatenating with existing concatenated component
275
262
  */
276
- mergeMetadata(t, e) {
263
+ mergeMetadata(e, t) {
277
264
  return {
278
- totalSegments: e,
279
- accessibilityRole: this.mergeAccessibilityRoles(t.accessibilityRole),
280
- semanticStructure: this.mergeSemanticStructures(t.semanticStructure)
265
+ totalSegments: t,
266
+ accessibilityRole: this.mergeAccessibilityRoles(e.accessibilityRole),
267
+ semanticStructure: this.mergeSemanticStructures(e.semanticStructure)
281
268
  };
282
269
  }
283
270
  /**
284
271
  * Determine the accessibility role for this component
285
272
  */
286
273
  determineAccessibilityRole() {
287
- const t = this.constructor.name;
288
- return t === "EnhancedText" ? "text" : t === "EnhancedImage" || t === "EnhancedButton" || t === "EnhancedLink" ? "group" : "composite";
274
+ const e = this.constructor.name;
275
+ return e === "EnhancedText" ? "text" : e === "EnhancedImage" || e === "EnhancedButton" || e === "EnhancedLink" ? "group" : "composite";
289
276
  }
290
277
  /**
291
278
  * Determine the semantic structure for this component
292
279
  */
293
280
  determineSemanticStructure() {
294
- const t = this.constructor.name;
295
- return t === "EnhancedText" || t === "EnhancedImage" ? "inline" : "mixed";
281
+ const e = this.constructor.name;
282
+ return e === "EnhancedText" || e === "EnhancedImage" ? "inline" : "mixed";
296
283
  }
297
284
  /**
298
285
  * Merge accessibility roles when combining components
299
286
  */
300
- mergeAccessibilityRoles(t) {
301
- const e = this.determineAccessibilityRole();
302
- return e === "text" && t === "text" ? "text" : e === "composite" || t === "composite" ? "composite" : "group";
287
+ mergeAccessibilityRoles(e) {
288
+ const t = this.determineAccessibilityRole();
289
+ return t === "text" && e === "text" ? "text" : t === "composite" || e === "composite" ? "composite" : "group";
303
290
  }
304
291
  /**
305
292
  * Merge semantic structures when combining components
306
293
  */
307
- mergeSemanticStructures(t) {
308
- const e = this.determineSemanticStructure();
309
- return e === "inline" && t === "inline" ? "inline" : e === "block" && t === "block" ? "block" : "mixed";
294
+ mergeSemanticStructures(e) {
295
+ const t = this.determineSemanticStructure();
296
+ return t === "inline" && e === "inline" ? "inline" : t === "block" && e === "block" ? "block" : "mixed";
310
297
  }
311
298
  }
312
- function zt(r) {
313
- const t = r;
314
- return t.concat = function(e) {
299
+ function de(r) {
300
+ const e = r;
301
+ return e.concat = function(t) {
315
302
  const n = {
316
303
  id: this.id,
317
304
  component: this,
@@ -320,11 +307,11 @@ function zt(r) {
320
307
  const o = this.render();
321
308
  return Array.isArray(o) ? o[0] : o;
322
309
  }
323
- }, i = e.toSegment();
324
- return e instanceof h ? new h(
325
- [n, ...e.segments],
310
+ }, i = t.toSegment();
311
+ return t instanceof h ? new h(
312
+ [n, ...t.segments],
326
313
  {
327
- totalSegments: e.segments.length + 1,
314
+ totalSegments: t.segments.length + 1,
328
315
  accessibilityRole: "group",
329
316
  semanticStructure: "mixed"
330
317
  }
@@ -336,54 +323,54 @@ function zt(r) {
336
323
  semanticStructure: "mixed"
337
324
  }
338
325
  );
339
- }, t.toSegment = function() {
326
+ }, e.toSegment = function() {
340
327
  return {
341
328
  id: this.id,
342
329
  component: this,
343
330
  modifiers: this.modifiers || [],
344
331
  render: () => {
345
- const e = this.render();
346
- return Array.isArray(e) ? e[0] : e;
332
+ const t = this.render();
333
+ return Array.isArray(t) ? t[0] : t;
347
334
  }
348
335
  };
349
- }, t.isConcatenatable = function() {
336
+ }, e.isConcatenatable = function() {
350
337
  return !0;
351
- }, t;
338
+ }, e;
352
339
  }
353
- const u = /* @__PURE__ */ new Map(), H = 300 * 1e3, b = 100;
354
- class Mt {
340
+ const m = /* @__PURE__ */ new Map(), H = 300 * 1e3, b = 100;
341
+ class fe {
355
342
  /**
356
343
  * Optimize an array of segments by merging compatible adjacent text segments
357
344
  * Enhanced with caching and performance monitoring
358
345
  */
359
- static optimize(t) {
360
- const e = performance.now();
361
- if (t.length < 2) return t;
362
- const n = this.generateCacheKey(t), i = this.getCachedOptimization(n);
346
+ static optimize(e) {
347
+ const t = performance.now();
348
+ if (e.length < 2) return e;
349
+ const n = this.generateCacheKey(e), i = this.getCachedOptimization(n);
363
350
  if (i)
364
351
  return i.optimizedSegments;
365
- const o = this.performOptimization(t), a = performance.now() - e, s = {
366
- ...this.getOptimizationStats(t, o),
352
+ const o = this.performOptimization(e), a = performance.now() - t, s = {
353
+ ...this.getOptimizationStats(e, o),
367
354
  processingTimeMs: a
368
355
  };
369
- return this.cacheOptimization(n, o, s), process.env.NODE_ENV === "development" && a > 5 && console.log(`TachUI Concatenation: Optimization took ${a.toFixed(2)}ms for ${t.length} segments`), o;
356
+ return this.cacheOptimization(n, o, s), process.env.NODE_ENV === "development" && a > 5 && console.log(`TachUI Concatenation: Optimization took ${a.toFixed(2)}ms for ${e.length} segments`), o;
370
357
  }
371
358
  /**
372
359
  * Core optimization algorithm separated for clarity
373
360
  */
374
- static performOptimization(t) {
375
- const e = [];
376
- for (const n of t) {
377
- const i = e[e.length - 1];
378
- i && this.canMergeTextSegments(i, n) ? e[e.length - 1] = this.mergeTextSegments(i, n) : e.push(n);
361
+ static performOptimization(e) {
362
+ const t = [];
363
+ for (const n of e) {
364
+ const i = t[t.length - 1];
365
+ i && this.canMergeTextSegments(i, n) ? t[t.length - 1] = this.mergeTextSegments(i, n) : t.push(n);
379
366
  }
380
- return e;
367
+ return t;
381
368
  }
382
369
  /**
383
370
  * Generate a cache key from segments
384
371
  */
385
- static generateCacheKey(t) {
386
- return t.map((n) => {
372
+ static generateCacheKey(e) {
373
+ return e.map((n) => {
387
374
  const i = n.component, o = this.extractTextContent(i), a = this.hashModifiers(n.modifiers);
388
375
  return `${i.constructor.name}:${o}:${a}`;
389
376
  }).join("|");
@@ -391,13 +378,13 @@ class Mt {
391
378
  /**
392
379
  * Hash modifiers for cache key generation
393
380
  */
394
- static hashModifiers(t) {
395
- if (t.length === 0) return "none";
381
+ static hashModifiers(e) {
382
+ if (e.length === 0) return "none";
396
383
  try {
397
- const e = t.map((i) => ({
384
+ const t = e.map((i) => ({
398
385
  type: i.type,
399
386
  props: i.properties
400
- })), n = JSON.stringify(e);
387
+ })), n = JSON.stringify(t);
401
388
  return typeof btoa == "function" ? btoa(n).substring(0, 8) : this.simpleHash(n).toString(16).substring(0, 8);
402
389
  } catch {
403
390
  return "hash-error";
@@ -406,31 +393,31 @@ class Mt {
406
393
  /**
407
394
  * Simple hash function fallback for environments without btoa
408
395
  */
409
- static simpleHash(t) {
410
- let e = 0;
411
- for (let n = 0; n < t.length; n++) {
412
- const i = t.charCodeAt(n);
413
- e = (e << 5) - e + i, e = e & e;
396
+ static simpleHash(e) {
397
+ let t = 0;
398
+ for (let n = 0; n < e.length; n++) {
399
+ const i = e.charCodeAt(n);
400
+ t = (t << 5) - t + i, t = t & t;
414
401
  }
415
- return Math.abs(e);
402
+ return Math.abs(t);
416
403
  }
417
404
  /**
418
405
  * Get cached optimization result
419
406
  */
420
- static getCachedOptimization(t) {
421
- const e = u.get(t);
422
- return e ? Date.now() - e.timestamp > H ? (u.delete(t), null) : e : null;
407
+ static getCachedOptimization(e) {
408
+ const t = m.get(e);
409
+ return t ? Date.now() - t.timestamp > H ? (m.delete(e), null) : t : null;
423
410
  }
424
411
  /**
425
412
  * Cache optimization result
426
413
  */
427
- static cacheOptimization(t, e, n) {
428
- if (u.size >= b) {
429
- const i = u.keys().next().value;
430
- i && u.delete(i);
414
+ static cacheOptimization(e, t, n) {
415
+ if (m.size >= b) {
416
+ const i = m.keys().next().value;
417
+ i && m.delete(i);
431
418
  }
432
- u.set(t, {
433
- optimizedSegments: e,
419
+ m.set(e, {
420
+ optimizedSegments: t,
434
421
  stats: n,
435
422
  timestamp: Date.now()
436
423
  });
@@ -439,14 +426,14 @@ class Mt {
439
426
  * Clear optimization cache (useful for testing)
440
427
  */
441
428
  static clearCache() {
442
- u.clear();
429
+ m.clear();
443
430
  }
444
431
  /**
445
432
  * Get cache statistics
446
433
  */
447
434
  static getCacheStats() {
448
435
  return {
449
- size: u.size,
436
+ size: m.size,
450
437
  maxSize: b,
451
438
  hitRate: 0
452
439
  // Would need to track hits/misses to calculate this
@@ -455,26 +442,26 @@ class Mt {
455
442
  /**
456
443
  * Check if two segments can be merged
457
444
  */
458
- static canMergeTextSegments(t, e) {
459
- return t.component.constructor.name !== "EnhancedText" || e.component.constructor.name !== "EnhancedText" ? !1 : this.modifiersCompatible(t.modifiers, e.modifiers);
445
+ static canMergeTextSegments(e, t) {
446
+ return e.component.constructor.name !== "EnhancedText" || t.component.constructor.name !== "EnhancedText" ? !1 : this.modifiersCompatible(e.modifiers, t.modifiers);
460
447
  }
461
448
  /**
462
449
  * Check if two modifier arrays are compatible for merging
463
450
  */
464
- static modifiersCompatible(t, e) {
465
- if (t.length !== e.length) return !1;
466
- for (let n = 0; n < t.length; n++)
467
- if (!this.modifierEqual(t[n], e[n]))
451
+ static modifiersCompatible(e, t) {
452
+ if (e.length !== t.length) return !1;
453
+ for (let n = 0; n < e.length; n++)
454
+ if (!this.modifierEqual(e[n], t[n]))
468
455
  return !1;
469
456
  return !0;
470
457
  }
471
458
  /**
472
459
  * Check if two modifiers are equal (simplified comparison)
473
460
  */
474
- static modifierEqual(t, e) {
475
- if (t.type !== e.type) return !1;
461
+ static modifierEqual(e, t) {
462
+ if (e.type !== t.type) return !1;
476
463
  try {
477
- return JSON.stringify(t.properties) === JSON.stringify(e.properties);
464
+ return JSON.stringify(e.properties) === JSON.stringify(t.properties);
478
465
  } catch {
479
466
  return !1;
480
467
  }
@@ -482,30 +469,30 @@ class Mt {
482
469
  /**
483
470
  * Merge two text segments into a single segment
484
471
  */
485
- static mergeTextSegments(t, e) {
486
- const n = t.component, i = e.component, o = this.extractTextContent(n), a = this.extractTextContent(i), s = o + a;
472
+ static mergeTextSegments(e, t) {
473
+ const n = e.component, i = t.component, o = this.extractTextContent(n), a = this.extractTextContent(i), s = o + a;
487
474
  return {
488
- id: `merged-${t.id}-${e.id}`,
489
- component: this.createMergedTextComponent(s, n.props, t.modifiers),
490
- modifiers: t.modifiers,
475
+ id: `merged-${e.id}-${t.id}`,
476
+ component: this.createMergedTextComponent(s, n.props, e.modifiers),
477
+ modifiers: e.modifiers,
491
478
  // Use modifiers from first segment (they're identical)
492
- render: () => this.createMergedTextComponent(s, n.props, t.modifiers).render()[0]
479
+ render: () => this.createMergedTextComponent(s, n.props, e.modifiers).render()[0]
493
480
  };
494
481
  }
495
482
  /**
496
483
  * Extract text content from a text component
497
484
  */
498
- static extractTextContent(t) {
499
- const e = t.props?.content;
500
- return typeof e == "string" ? e : typeof e == "function" ? e() : e && typeof e == "object" && "peek" in e && e.peek() || "";
485
+ static extractTextContent(e) {
486
+ const t = e.props?.content;
487
+ return typeof t == "string" ? t : typeof t == "function" ? t() : t && typeof t == "object" && "peek" in t && t.peek() || "";
501
488
  }
502
489
  /**
503
490
  * Create a new merged text component
504
491
  */
505
- static createMergedTextComponent(t, e, n) {
492
+ static createMergedTextComponent(e, t, n) {
506
493
  const i = {
507
- ...e,
508
- content: t
494
+ ...t,
495
+ content: e
509
496
  };
510
497
  return {
511
498
  type: "Text",
@@ -515,7 +502,7 @@ class Mt {
515
502
  cleanup: [],
516
503
  modifiers: n,
517
504
  render() {
518
- const o = z(t);
505
+ const o = z(e);
519
506
  return [M("span", {}, o)];
520
507
  }
521
508
  };
@@ -523,23 +510,23 @@ class Mt {
523
510
  /**
524
511
  * Analyze segments and determine if optimization would be beneficial
525
512
  */
526
- static shouldOptimize(t) {
527
- if (t.length < 2) return !1;
528
- let e = 0;
529
- for (let n = 0; n < t.length - 1; n++) {
530
- const i = t[n], o = t[n + 1];
531
- i.component.constructor.name === "EnhancedText" && o.component.constructor.name === "EnhancedText" && e++;
513
+ static shouldOptimize(e) {
514
+ if (e.length < 2) return !1;
515
+ let t = 0;
516
+ for (let n = 0; n < e.length - 1; n++) {
517
+ const i = e[n], o = e[n + 1];
518
+ i.component.constructor.name === "EnhancedText" && o.component.constructor.name === "EnhancedText" && t++;
532
519
  }
533
- return e > 0;
520
+ return t > 0;
534
521
  }
535
522
  /**
536
523
  * Get optimization statistics (enhanced for Phase 4.1)
537
524
  */
538
- static getOptimizationStats(t, e) {
539
- const n = t.length - e.length, i = t.length > 0 ? Math.round(n / t.length * 100) : 0;
525
+ static getOptimizationStats(e, t) {
526
+ const n = e.length - t.length, i = e.length > 0 ? Math.round(n / e.length * 100) : 0;
540
527
  return {
541
- originalCount: t.length,
542
- optimizedCount: e.length,
528
+ originalCount: e.length,
529
+ optimizedCount: t.length,
543
530
  reductionPercent: i,
544
531
  textSegmentsMerged: n
545
532
  };
@@ -547,15 +534,15 @@ class Mt {
547
534
  /**
548
535
  * Advanced optimization analysis for performance monitoring
549
536
  */
550
- static analyzeOptimizationOpportunities(t) {
551
- let e = 0, n = 0, i = 0, o = 0;
552
- for (let s = 0; s < t.length; s++) {
553
- const l = t[s];
554
- switch (l.component.constructor.name) {
537
+ static analyzeOptimizationOpportunities(e) {
538
+ let t = 0, n = 0, i = 0, o = 0;
539
+ for (let s = 0; s < e.length; s++) {
540
+ const u = e[s];
541
+ switch (u.component.constructor.name) {
555
542
  case "EnhancedText":
556
- if (e++, s < t.length - 1) {
557
- const f = t[s + 1];
558
- this.canMergeTextSegments(l, f) && o++;
543
+ if (t++, s < e.length - 1) {
544
+ const p = e[s + 1];
545
+ this.canMergeTextSegments(u, p) && o++;
559
546
  }
560
547
  break;
561
548
  case "EnhancedImage":
@@ -567,10 +554,10 @@ class Mt {
567
554
  break;
568
555
  }
569
556
  }
570
- const a = t.length > 0 ? Math.round(o / t.length * 100) : 0;
557
+ const a = e.length > 0 ? Math.round(o / e.length * 100) : 0;
571
558
  return {
572
- totalSegments: t.length,
573
- textSegments: e,
559
+ totalSegments: e.length,
560
+ textSegments: t,
574
561
  imageSegments: n,
575
562
  interactiveSegments: i,
576
563
  optimizableTextPairs: o,
@@ -578,11 +565,11 @@ class Mt {
578
565
  };
579
566
  }
580
567
  }
581
- function S(r, t = {}) {
582
- const { fallback: e, errorFallback: n, timeout: i = 1e4, preload: o = "never" } = t;
583
- let a = !1, s = null, l = !1, p = null, f = null;
568
+ function S(r, e = {}) {
569
+ const { fallback: t, errorFallback: n, timeout: i = 1e4, preload: o = "never" } = e;
570
+ let a = !1, s = null, u = !1, f = null, p = null;
584
571
  const y = async () => {
585
- a || l || s || f || (a = !0, l = !0, p = null, f = (async () => {
572
+ a || u || s || p || (a = !0, u = !0, f = null, p = (async () => {
586
573
  try {
587
574
  const d = await Promise.race([
588
575
  r(),
@@ -593,11 +580,11 @@ function S(r, t = {}) {
593
580
  s = "default" in d ? d.default : d;
594
581
  } catch (d) {
595
582
  const g = d;
596
- (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Failed to load lazy component:", g), p = g;
583
+ (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Failed to load lazy component:", g), f = g;
597
584
  } finally {
598
- l = !1, f = null;
585
+ u = !1, p = null;
599
586
  }
600
- })(), await f);
587
+ })(), await p);
601
588
  };
602
589
  return o === "idle" && typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
603
590
  y().catch(() => {
@@ -607,11 +594,11 @@ function S(r, t = {}) {
607
594
  });
608
595
  }, 100) : o === "immediate" && y().catch(() => {
609
596
  }), (d) => {
610
- if (!a && !l && !s && y().catch(() => {
611
- }), p)
612
- return n ? n(p) : T(p);
613
- if (l || !s)
614
- return e || j();
597
+ if (!a && !u && !s && y().catch(() => {
598
+ }), f)
599
+ return n ? n(f) : T(f);
600
+ if (u || !s)
601
+ return t || j();
615
602
  try {
616
603
  return typeof s == "function" ? s(d) : s;
617
604
  } catch (g) {
@@ -620,7 +607,7 @@ function S(r, t = {}) {
620
607
  }
621
608
  };
622
609
  }
623
- function Ot(r) {
610
+ function pe(r) {
624
611
  return {
625
612
  type: "component",
626
613
  render: () => ({
@@ -638,21 +625,21 @@ function Ot(r) {
638
625
  };
639
626
  }
640
627
  function $(r) {
641
- return r().then((t) => t && typeof t == "object" && "default" in t ? t.default : t);
628
+ return r().then((e) => e && typeof e == "object" && "default" in e ? e.default : e);
642
629
  }
643
- function Nt(r, t = {}) {
644
- const e = {};
630
+ function he(r, e = {}) {
631
+ const t = {};
645
632
  for (const [n, i] of Object.entries(r))
646
- e[n] = S(i, t);
647
- return e;
633
+ t[n] = S(i, e);
634
+ return t;
648
635
  }
649
- function kt(r) {
650
- const t = Object.entries(r).map(
651
- async ([e, n]) => [e, await $(n)]
636
+ function ge(r) {
637
+ const e = Object.entries(r).map(
638
+ async ([t, n]) => [t, await $(n)]
652
639
  );
653
- return Promise.all(t).then((e) => {
640
+ return Promise.all(e).then((t) => {
654
641
  const n = {};
655
- for (const [i, o] of e)
642
+ for (const [i, o] of t)
656
643
  n[i] = o;
657
644
  return n;
658
645
  });
@@ -689,8 +676,8 @@ function T(r) {
689
676
  ]
690
677
  };
691
678
  }
692
- function vt(r, t = {}) {
693
- const { rootMargin: e = "50px", threshold: n = 0.1, ...i } = t;
679
+ function ye(r, e = {}) {
680
+ const { rootMargin: t = "50px", threshold: n = 0.1, ...i } = e;
694
681
  return i.preload === "visible" && typeof IntersectionObserver < "u" ? (o) => {
695
682
  const a = S(r, { ...i, preload: "never" });
696
683
  return setTimeout(() => {
@@ -698,36 +685,36 @@ function vt(r, t = {}) {
698
685
  }, 100), a(o);
699
686
  } : S(r, i);
700
687
  }
701
- const At = Object.freeze({
688
+ const xe = Object.freeze({
702
689
  configure: N,
703
690
  getFeatureFlags: O
704
691
  });
705
692
  export {
706
- Ct as C,
707
- Ot as S,
708
- Mt as T,
709
- Tt as a,
710
- Et as b,
711
- wt as c,
712
- ct as d,
713
- mt as e,
714
- st as f,
715
- lt as g,
716
- ut as h,
717
- bt as i,
718
- dt as j,
719
- pt as k,
720
- ht as l,
721
- zt as m,
722
- gt as n,
723
- yt as o,
724
- xt as p,
725
- Nt as q,
726
- ft as r,
727
- St as s,
728
- At as t,
729
- vt as u,
693
+ se as C,
694
+ pe as S,
695
+ fe as T,
696
+ le as a,
697
+ me as b,
698
+ ue as c,
699
+ J as d,
700
+ K as e,
701
+ X as f,
702
+ Y as g,
703
+ Z as h,
704
+ ce as i,
705
+ Q as j,
706
+ ee as k,
707
+ ne as l,
708
+ de as m,
709
+ re as n,
710
+ ie as o,
711
+ oe as p,
712
+ he as q,
713
+ te as r,
714
+ ae as s,
715
+ xe as t,
716
+ ye as u,
730
717
  S as v,
731
718
  $ as w,
732
- kt as x
719
+ ge as x
733
720
  };