uxml-preview 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/index.js +611 -611
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -266,7 +266,7 @@ function te(e) {
266
266
  const n = (t, i) => !Number.isInteger(t) || t < 0 || t > 1114111 || t >= 55296 && t <= 57343 ? i : String.fromCodePoint(t);
267
267
  return e.replace(/&#x([0-9a-f]+);/gi, (t, i) => n(parseInt(i, 16), t)).replace(/&#(\d+);/g, (t, i) => n(Number(i), t)).replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
268
268
  }
269
- function oe(e) {
269
+ function re(e) {
270
270
  const n = e == null ? void 0 : e.toLowerCase();
271
271
  return n === "true" ? !0 : n === "false" ? !1 : void 0;
272
272
  }
@@ -274,14 +274,14 @@ function ht(e) {
274
274
  return (e == null ? void 0 : e.toLowerCase()) === "vertical";
275
275
  }
276
276
  function be(e) {
277
- const n = (p) => {
277
+ const n = (h) => {
278
278
  var d;
279
- return (d = e.attributes.find((b) => b.name === p)) == null ? void 0 : d.value;
280
- }, t = (p, d) => {
281
- const b = Number(n(p) ?? d);
279
+ return (d = e.attributes.find((b) => b.name === h)) == null ? void 0 : d.value;
280
+ }, t = (h, d) => {
281
+ const b = Number(n(h) ?? d);
282
282
  return Number.isFinite(b) ? b : d;
283
- }, i = t("low-value", 0), o = t("high-value", e.name.local === "ProgressBar" ? 100 : 10), r = e.name.local === "ProgressBar" ? 0 : i, u = n("value"), c = Number(u ?? r), g = Number.isNaN(c) || e.name.local === "SliderInt" && Number.isFinite(c) && !Number.isInteger(c), m = Math.min(Math.max(i, o), Math.max(Math.min(i, o), g ? r : c));
284
- return { low: i, high: o, value: m, invalid: g };
283
+ }, i = t("low-value", 0), r = t("high-value", e.name.local === "ProgressBar" ? 100 : 10), o = e.name.local === "ProgressBar" ? 0 : i, u = n("value"), c = Number(u ?? o), g = Number.isNaN(c) || e.name.local === "SliderInt" && Number.isFinite(c) && !Number.isInteger(c), m = Math.min(Math.max(i, r), Math.max(Math.min(i, r), g ? o : c));
284
+ return { low: i, high: r, value: m, invalid: g };
285
285
  }
286
286
  const mt = {
287
287
  // VisualElement is the base class and carries no class of its own.
@@ -365,35 +365,35 @@ const mt = {
365
365
  { name: "unity-content-container", style: { "flex-shrink": "0" } }
366
366
  ]
367
367
  }
368
- }, Oe = { hasText: !1, classes: [], parts: [] }, nn = "UXML", on = /* @__PURE__ */ new Set(["Style", "Template", "AttributeOverrides", "Bindings", "Columns"]);
368
+ }, Oe = { hasText: !1, classes: [], parts: [] }, nn = "UXML", rn = /* @__PURE__ */ new Set(["Style", "Template", "AttributeOverrides", "Bindings", "Columns"]);
369
369
  function we(e) {
370
- return on.has(e.name.local);
370
+ return rn.has(e.name.local);
371
371
  }
372
372
  function Z(e) {
373
373
  var t;
374
374
  if (((t = e.derived) == null ? void 0 : t.kind) === "template-container") return { spec: Oe, fallback: !1 };
375
375
  const n = mt[e.name.local];
376
- return n !== void 0 ? { spec: e.name.local === "TextField" ? un(e, n) : e.name.local === "Toggle" || e.name.local === "RadioButton" ? dn(e) : e.name.local === "Slider" || e.name.local === "SliderInt" ? cn(e) : e.name.local === "ScrollView" ? ln(e, n) : n, fallback: !1 } : rn(e) ? { spec: Oe, fallback: !1 } : { spec: Oe, fallback: !0 };
376
+ return n !== void 0 ? { spec: e.name.local === "TextField" ? un(e, n) : e.name.local === "Toggle" || e.name.local === "RadioButton" ? dn(e) : e.name.local === "Slider" || e.name.local === "SliderInt" ? cn(e) : e.name.local === "ScrollView" ? ln(e, n) : n, fallback: !1 } : on(e) ? { spec: Oe, fallback: !1 } : { spec: Oe, fallback: !0 };
377
377
  }
378
- function rn(e) {
378
+ function on(e) {
379
379
  return e.name.local === nn;
380
380
  }
381
381
  function sn(e) {
382
382
  const n = Z(e).spec.classes;
383
- return e.attributes.some((t) => t.name === "enabled" && oe(t.value) === !1) ? [...n, "unity-disabled"] : n;
383
+ return e.attributes.some((t) => t.name === "enabled" && re(t.value) === !1) ? [...n, "unity-disabled"] : n;
384
384
  }
385
385
  function an() {
386
386
  return Object.keys(mt);
387
387
  }
388
388
  function ln(e, n) {
389
- var o;
390
- const t = (o = e.attributes.find((r) => r.name === "mode")) == null ? void 0 : o.value, i = t === "Horizontal" ? "horizontal" : t === "VerticalAndHorizontal" ? "vertical-horizontal" : "vertical";
389
+ var r;
390
+ const t = (r = e.attributes.find((o) => o.name === "mode")) == null ? void 0 : r.value, i = t === "Horizontal" ? "horizontal" : t === "VerticalAndHorizontal" ? "vertical-horizontal" : "vertical";
391
391
  return {
392
392
  ...n,
393
393
  classes: [...n.classes, "unity-scroll-view--scroll", `unity-scroll-view--${i}`],
394
- parts: n.parts.map((r) => {
395
- const u = r.name.replace("unity-", "unity-scroll-view__");
396
- return { ...r, classes: r.name === "unity-content-and-vertical-scroll-container" ? [u] : [u, `${u}--${i}`] };
394
+ parts: n.parts.map((o) => {
395
+ const u = o.name.replace("unity-", "unity-scroll-view__");
396
+ return { ...o, classes: o.name === "unity-content-and-vertical-scroll-container" ? [u] : [u, `${u}--${i}`] };
397
397
  })
398
398
  };
399
399
  }
@@ -402,7 +402,7 @@ function un(e, n) {
402
402
  const t = (c) => {
403
403
  var g;
404
404
  return ((g = e.attributes.find((m) => m.name === c)) == null ? void 0 : g.value) ?? "";
405
- }, i = t("label") !== "", o = oe(t("multiline")) === !0, r = (((u = e.attributes.find((c) => c.name === "value")) == null ? void 0 : u.value) ?? t("text")) === "" && t("placeholder-text") !== "";
405
+ }, i = t("label") !== "", r = re(t("multiline")) === !0, o = (((u = e.attributes.find((c) => c.name === "value")) == null ? void 0 : u.value) ?? t("text")) === "" && t("placeholder-text") !== "";
406
406
  return {
407
407
  ...n,
408
408
  classes: i ? n.classes : [...n.classes, "unity-base-field--no-label"],
@@ -429,12 +429,12 @@ function un(e, n) {
429
429
  "unity-base-text-field__input",
430
430
  "unity-base-field__input",
431
431
  "unity-text-field__input",
432
- o ? "unity-base-text-field__input--multiline" : "unity-base-text-field__input--single-line",
433
- ...r ? ["unity-base-text-field__input--placeholder"] : []
432
+ r ? "unity-base-text-field__input--multiline" : "unity-base-text-field__input--single-line",
433
+ ...o ? ["unity-base-text-field__input--placeholder"] : []
434
434
  ],
435
435
  style: {}
436
436
  },
437
- ...o ? [{
437
+ ...r ? [{
438
438
  name: "unity-base-text-field__multiline-container",
439
439
  unnamed: !0,
440
440
  classes: ["unity-base-text-field__multiline-container"],
@@ -457,17 +457,17 @@ function un(e, n) {
457
457
  };
458
458
  }
459
459
  function gt(e, n) {
460
- var r, u, c, g;
460
+ var o, u, c, g;
461
461
  if (n.textValue !== void 0) return n.textValue;
462
462
  if (n.kind === void 0) return;
463
463
  const t = (m) => {
464
- var p;
465
- return te(((p = e.attributes.find((d) => d.name === m)) == null ? void 0 : p.value) ?? "");
466
- }, i = n.textAttribute === "value" ? te(((r = e.attributes.find((m) => m.name === "value")) == null ? void 0 : r.value) ?? ((u = e.attributes.find((m) => m.name === "text")) == null ? void 0 : u.value) ?? "") : t(n.textAttribute ?? "text");
464
+ var h;
465
+ return te(((h = e.attributes.find((d) => d.name === m)) == null ? void 0 : h.value) ?? "");
466
+ }, i = n.textAttribute === "value" ? te(((o = e.attributes.find((m) => m.name === "value")) == null ? void 0 : o.value) ?? ((u = e.attributes.find((m) => m.name === "text")) == null ? void 0 : u.value) ?? "") : t(n.textAttribute ?? "text");
467
467
  if (n.textAttribute !== "value") return i;
468
468
  if (i === "") return t("placeholder-text");
469
- const o = te(((c = e.attributes.find((m) => m.name === "mask-character")) == null ? void 0 : c.value) ?? ((g = e.attributes.find((m) => m.name === "maskCharacter")) == null ? void 0 : g.value) ?? "") || "*";
470
- return oe(t("password")) === !0 ? o.charAt(0).repeat(i.length) : i;
469
+ const r = te(((c = e.attributes.find((m) => m.name === "mask-character")) == null ? void 0 : c.value) ?? ((g = e.attributes.find((m) => m.name === "maskCharacter")) == null ? void 0 : g.value) ?? "") || "*";
470
+ return re(t("password")) === !0 ? r.charAt(0).repeat(i.length) : i;
471
471
  }
472
472
  function We(e, n) {
473
473
  const t = e[n];
@@ -480,8 +480,8 @@ function cn(e) {
480
480
  const n = (c) => {
481
481
  var g;
482
482
  return te(((g = e.attributes.find((m) => m.name === c)) == null ? void 0 : g.value) ?? "");
483
- }, t = e.name.local === "SliderInt" ? "unity-slider-int" : "unity-slider", i = n("label") !== "", o = [];
484
- i && o.push({
483
+ }, t = e.name.local === "SliderInt" ? "unity-slider-int" : "unity-slider", i = n("label") !== "", r = [];
484
+ i && r.push({
485
485
  name: `${t}__label`,
486
486
  parent: null,
487
487
  kind: "leading-text",
@@ -498,33 +498,33 @@ function cn(e) {
498
498
  ],
499
499
  style: {}
500
500
  });
501
- const r = o.length;
502
- o.push({
501
+ const o = r.length;
502
+ r.push({
503
503
  name: `${t}__input`,
504
504
  parent: null,
505
505
  unnamed: !0,
506
506
  classes: ["unity-base-field__input", "unity-base-slider__input", `${t}__input`],
507
507
  style: {}
508
508
  });
509
- const u = o.length;
510
- o.push({ name: "unity-drag-container", parent: r, classes: ["unity-base-slider__drag-container"], style: {} });
511
- for (const c of ["tracker", "dragger-border", "dragger"]) o.push({
509
+ const u = r.length;
510
+ r.push({ name: "unity-drag-container", parent: o, classes: ["unity-base-slider__drag-container"], style: {} });
511
+ for (const c of ["tracker", "dragger-border", "dragger"]) r.push({
512
512
  name: `unity-${c}`,
513
513
  parent: u,
514
514
  classes: [`unity-base-slider__${c}`],
515
515
  style: {}
516
516
  });
517
- if (oe(n("show-input-field")) === !0) {
518
- const c = o.length;
519
- o.push({
517
+ if (re(n("show-input-field")) === !0) {
518
+ const c = r.length;
519
+ r.push({
520
520
  name: "unity-text-field",
521
- parent: r,
521
+ parent: o,
522
522
  typeName: "TextField",
523
523
  classes: ["unity-base-field", "unity-base-field--no-label", "unity-base-text-field", "unity-text-field", "unity-base-slider__text-field"],
524
524
  style: {}
525
525
  });
526
- const g = o.length;
527
- o.push({
526
+ const g = r.length;
527
+ r.push({
528
528
  name: "unity-text-input",
529
529
  parent: c,
530
530
  typeName: "TextInput",
@@ -532,7 +532,7 @@ function cn(e) {
532
532
  style: {}
533
533
  });
534
534
  const { value: m } = be(e);
535
- o.push({
535
+ r.push({
536
536
  name: "unity-text-element--inner-input-field-component",
537
537
  parent: g,
538
538
  kind: "text",
@@ -549,14 +549,14 @@ function cn(e) {
549
549
  "unity-base-slider",
550
550
  t,
551
551
  ht(n("direction")) ? "unity-base-slider--vertical" : "unity-base-slider--horizontal"
552
- ], parts: o };
552
+ ], parts: r };
553
553
  }
554
554
  function dn(e) {
555
555
  const n = (c) => {
556
556
  var g;
557
557
  return te(((g = e.attributes.find((m) => m.name === c)) == null ? void 0 : g.value) ?? "");
558
- }, t = e.name.local === "Toggle" ? "unity-toggle" : "unity-radio-button", i = n("label") !== "", o = [];
559
- i && o.push({
558
+ }, t = e.name.local === "Toggle" ? "unity-toggle" : "unity-radio-button", i = n("label") !== "", r = [];
559
+ i && r.push({
560
560
  name: `${t}__label`,
561
561
  parent: null,
562
562
  kind: "leading-text",
@@ -566,31 +566,31 @@ function dn(e) {
566
566
  classes: ["unity-text-element", "unity-label", "unity-base-field__label", `${t}__label`],
567
567
  style: {}
568
568
  });
569
- const r = o.length;
570
- o.push({
569
+ const o = r.length;
570
+ r.push({
571
571
  name: `${t}__input`,
572
572
  parent: null,
573
573
  unnamed: !0,
574
574
  classes: ["unity-base-field__input", `${t}__input`],
575
575
  style: {}
576
576
  });
577
- let u = r;
578
- return e.name.local === "RadioButton" && (u = o.length, o.push({
577
+ let u = o;
578
+ return e.name.local === "RadioButton" && (u = r.length, r.push({
579
579
  name: `${t}__checkmark-background`,
580
- parent: r,
580
+ parent: o,
581
581
  unnamed: !0,
582
582
  classes: [`${t}__checkmark-background`],
583
583
  style: {}
584
- })), o.push({ name: "unity-checkmark", parent: u, classes: [`${t}__checkmark`], style: {} }), n("text") !== "" && o.push({
584
+ })), r.push({ name: "unity-checkmark", parent: u, classes: [`${t}__checkmark`], style: {} }), n("text") !== "" && r.push({
585
585
  name: `${t}__text`,
586
- parent: r,
586
+ parent: o,
587
587
  kind: "text",
588
588
  textAttribute: "text",
589
589
  typeName: "Label",
590
590
  unnamed: !0,
591
591
  classes: ["unity-text-element", "unity-label", `${t}__text`],
592
592
  style: {}
593
- }), { hasText: !1, classes: ["unity-base-field", ...i ? [] : ["unity-base-field--no-label"], t], parts: o };
593
+ }), { hasText: !1, classes: ["unity-base-field", ...i ? [] : ["unity-base-field--no-label"], t], parts: r };
594
594
  }
595
595
  function Ze(e) {
596
596
  return e !== void 0 && /[A-Za-z0-9_.:-]/.test(e);
@@ -605,8 +605,8 @@ function fn(e) {
605
605
  function bt(e) {
606
606
  const n = [];
607
607
  let t = 0, i = 0;
608
- const o = () => i++;
609
- function r(d, b, y) {
608
+ const r = () => i++;
609
+ function o(d, b, y) {
610
610
  n.push({
611
611
  kind: "malformed",
612
612
  message: d,
@@ -658,16 +658,16 @@ function bt(e) {
658
658
  if (t === d) return null;
659
659
  const b = e.slice(d, t), y = t;
660
660
  if (u(), e[t] !== "=")
661
- return t = y, r(`attribute "${b}" has no value`, d, y), { name: b, value: "", span: { start: d, end: y } };
661
+ return t = y, o(`attribute "${b}" has no value`, d, y), { name: b, value: "", span: { start: d, end: y } };
662
662
  t++, u();
663
663
  const x = e[t];
664
664
  if (x !== '"' && x !== "'")
665
- return r(`attribute "${b}" has an unquoted value`, d, t), { name: b, value: "", span: { start: d, end: t } };
665
+ return o(`attribute "${b}" has an unquoted value`, d, t), { name: b, value: "", span: { start: d, end: t } };
666
666
  t++;
667
667
  const k = t, S = e.indexOf(x, t);
668
- return S < 0 ? (r(`attribute "${b}" has an unterminated value`, d, e.length), t = e.length, { name: b, value: e.slice(k), span: { start: d, end: t } }) : (t = S + 1, { name: b, value: e.slice(k, S), span: { start: d, end: t } });
668
+ return S < 0 ? (o(`attribute "${b}" has an unterminated value`, d, e.length), t = e.length, { name: b, value: e.slice(k), span: { start: d, end: t } }) : (t = S + 1, { name: b, value: e.slice(k, S), span: { start: d, end: t } });
669
669
  }
670
- function p() {
670
+ function h() {
671
671
  const d = t;
672
672
  t++;
673
673
  const b = g(), y = [];
@@ -676,7 +676,7 @@ function bt(e) {
676
676
  u();
677
677
  const f = e[t];
678
678
  if (f === void 0) {
679
- r("unterminated open tag", d, e.length);
679
+ o("unterminated open tag", d, e.length);
680
680
  break;
681
681
  }
682
682
  if (f === ">") {
@@ -687,17 +687,17 @@ function bt(e) {
687
687
  t += 2, x = !0;
688
688
  break;
689
689
  }
690
- const h = m();
691
- if (h === null) {
690
+ const p = m();
691
+ if (p === null) {
692
692
  t++;
693
693
  continue;
694
694
  }
695
- y.push(h);
695
+ y.push(p);
696
696
  }
697
697
  const k = { start: d, end: t };
698
698
  if (x)
699
699
  return {
700
- id: o(),
700
+ id: r(),
701
701
  name: b,
702
702
  attributes: y,
703
703
  children: [],
@@ -708,7 +708,7 @@ function bt(e) {
708
708
  const S = t, s = [];
709
709
  for (; ; ) {
710
710
  if (c(), t >= e.length) {
711
- r(`unterminated element <${yt(b)}>`, d, e.length);
711
+ o(`unterminated element <${yt(b)}>`, d, e.length);
712
712
  break;
713
713
  }
714
714
  const f = e[t + 1];
@@ -717,16 +717,16 @@ function bt(e) {
717
717
  t++;
718
718
  continue;
719
719
  }
720
- s.push(p());
720
+ s.push(h());
721
721
  }
722
722
  const l = t;
723
723
  let a = null;
724
724
  if (e.startsWith("</", t)) {
725
- const f = e.indexOf(">", t), h = f < 0 ? e.length : f + 1;
726
- f < 0 && r("unterminated end tag", t, h), a = { start: t, end: h }, t = h;
725
+ const f = e.indexOf(">", t), p = f < 0 ? e.length : f + 1;
726
+ f < 0 && o("unterminated end tag", t, p), a = { start: t, end: p }, t = p;
727
727
  }
728
728
  return {
729
- id: o(),
729
+ id: r(),
730
730
  name: b,
731
731
  attributes: y,
732
732
  children: s,
@@ -735,9 +735,9 @@ function bt(e) {
735
735
  childrenDirty: !1
736
736
  };
737
737
  }
738
- return c(), t < e.length && Qe(e[t + 1]) ? { root: p(), warnings: n } : (r("no root element", 0, 0), {
738
+ return c(), t < e.length && Qe(e[t + 1]) ? { root: h(), warnings: n } : (o("no root element", 0, 0), {
739
739
  root: {
740
- id: o(),
740
+ id: r(),
741
741
  name: { prefix: null, local: "" },
742
742
  attributes: [],
743
743
  children: [],
@@ -778,8 +778,8 @@ function kt(e) {
778
778
  const n = /* @__PURE__ */ new Map();
779
779
  for (const t of e.root.children) {
780
780
  if (t.name.local !== "Template") continue;
781
- const i = J(t, "name"), o = J(t, "src");
782
- i === void 0 || i.length === 0 || o === void 0 || o.length === 0 || n.set(i, { name: i, src: o, node: t });
781
+ const i = J(t, "name"), r = J(t, "src");
782
+ i === void 0 || i.length === 0 || r === void 0 || r.length === 0 || n.set(i, { name: i, src: r, node: t });
783
783
  }
784
784
  return n;
785
785
  }
@@ -789,13 +789,13 @@ function _t(e, n) {
789
789
  function mn(e) {
790
790
  return /(?:^|\/)Packages\//i.test(e) || /PackageCache/i.test(e);
791
791
  }
792
- function ie(e, n, t, i, o, r = {}) {
792
+ function ie(e, n, t, i, r, o = {}) {
793
793
  e.push({
794
794
  kind: n,
795
795
  message: t,
796
796
  ...i === void 0 ? {} : { node: i.id },
797
- ...o === void 0 ? {} : { sourceDocument: o },
798
- ...r
797
+ ...r === void 0 ? {} : { sourceDocument: r },
798
+ ...o
799
799
  });
800
800
  }
801
801
  function Te(e, n = 0, t = void 0) {
@@ -817,7 +817,7 @@ function tt() {
817
817
  function Re(e, n) {
818
818
  return { start: e.start + n, end: e.end + n };
819
819
  }
820
- function gn(e, n, t, i, o) {
820
+ function gn(e, n, t, i, r) {
821
821
  return {
822
822
  id: e,
823
823
  name: n,
@@ -826,33 +826,33 @@ function gn(e, n, t, i, o) {
826
826
  spans: { openTag: tt(), inner: tt(), closeTag: null },
827
827
  tagDirty: !1,
828
828
  childrenDirty: !1,
829
- ...o === void 0 ? {} : { derived: { kind: "template-container", instance: o } }
829
+ ...r === void 0 ? {} : { derived: { kind: "template-container", instance: r } }
830
830
  };
831
831
  }
832
832
  function bn(e, n, t) {
833
- const i = e.items.map((o) => o.kind !== "import" || o.resolvedSheet === void 0 ? o.kind === "rule" ? {
834
- ...o,
833
+ const i = e.items.map((r) => r.kind !== "import" || r.resolvedSheet === void 0 ? r.kind === "rule" ? {
834
+ ...r,
835
835
  rule: {
836
- ...o.rule,
837
- selectors: o.rule.selectors.map((r) => ({
838
- ...r,
839
- parts: r.parts.map((u) => ({ ...u, simple: [...u.simple] }))
836
+ ...r.rule,
837
+ selectors: r.rule.selectors.map((o) => ({
838
+ ...o,
839
+ parts: o.parts.map((u) => ({ ...u, simple: [...u.simple] }))
840
840
  })),
841
- declarations: o.rule.declarations.map((r) => ({ ...r }))
841
+ declarations: r.rule.declarations.map((o) => ({ ...o }))
842
842
  }
843
- } : { ...o } : { ...o, resolvedSheet: o.resolvedSheet + n });
843
+ } : { ...r } : { ...r, resolvedSheet: r.resolvedSheet + n });
844
844
  return { ...e, items: i, sourceDocumentFrom: t };
845
845
  }
846
846
  function yn(e, n) {
847
847
  const t = n.sheetOffsets.get(e.document);
848
848
  if (t !== void 0) return t;
849
- const i = n.sheets.length, o = e.document.sheets.map((u, c) => i + c), r = e.document.sheets.map(() => e.url);
849
+ const i = n.sheets.length, r = e.document.sheets.map((u, c) => i + c), o = e.document.sheets.map(() => e.url);
850
850
  return e.document.sheets.forEach((u, c) => {
851
851
  for (const g of u.items)
852
- g.kind === "import" && g.resolvedSheet !== void 0 && (r[g.resolvedSheet] = u.origin ?? e.url);
853
- }), n.sheetOffsets.set(e.document, o), e.document.sheets.forEach(
854
- (u, c) => n.sheets.push(bn(u, i, r[c]))
855
- ), o;
852
+ g.kind === "import" && g.resolvedSheet !== void 0 && (o[g.resolvedSheet] = u.origin ?? e.url);
853
+ }), n.sheetOffsets.set(e.document, r), e.document.sheets.forEach(
854
+ (u, c) => n.sheets.push(bn(u, i, o[c]))
855
+ ), r;
856
856
  }
857
857
  function $t(e, n) {
858
858
  const t = n.sourceOffsets.get(e);
@@ -861,12 +861,12 @@ function $t(e, n) {
861
861
  return n.sourceOffsets.set(e, i), n.sources.push(`
862
862
  ${e.source}`), n.sourceLength += e.source.length + 1, i;
863
863
  }
864
- function xn(e, n, t, i, o) {
865
- for (const r of e.document.styleRoots ?? []) {
866
- const u = n[r.sheet];
864
+ function xn(e, n, t, i, r) {
865
+ for (const o of e.document.styleRoots ?? []) {
866
+ const u = n[o.sheet];
867
867
  if (u === void 0) continue;
868
- const c = t.nodes.get(r.scope) ?? i.id;
869
- o.styleRoots.push({ sheet: u, scope: c });
868
+ const c = t.nodes.get(o.scope) ?? i.id;
869
+ r.styleRoots.push({ sheet: u, scope: c });
870
870
  }
871
871
  }
872
872
  function wn(e) {
@@ -880,12 +880,12 @@ function Tt(e, n) {
880
880
  t !== void 0 && t.length > 0 && n.add(t);
881
881
  for (const i of e.children) Tt(i, n);
882
882
  }
883
- function me(e, n, t, i, o) {
884
- const r = /* @__PURE__ */ new Set();
885
- t !== null && Tt(t.document.root, r), !(r.size === 0 && n.length === 0) && ie(
886
- o.warnings,
883
+ function me(e, n, t, i, r) {
884
+ const o = /* @__PURE__ */ new Set();
885
+ t !== null && Tt(t.document.root, o), !(o.size === 0 && n.length === 0) && ie(
886
+ r.warnings,
887
887
  "template-slot-unsupported",
888
- `Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" : r.size === 0 ? "(none)" : [...r].join(", ")}; children not placed: ${n.length === 0 ? "(none)" : wn(n).join(", ")}`,
888
+ `Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" : o.size === 0 ? "(none)" : [...o].join(", ")}; children not placed: ${n.length === 0 ? "(none)" : wn(n).join(", ")}`,
889
889
  e,
890
890
  i,
891
891
  { reason: "not-rendered" }
@@ -902,14 +902,14 @@ function Et(e, n, t) {
902
902
  J(e, "name") === n && t.push(e);
903
903
  for (const i of e.children) Et(i, n, t);
904
904
  }
905
- function vn(e, n, t, i, o) {
905
+ function vn(e, n, t, i, r) {
906
906
  if (n.length === 0) return;
907
- const r = /* @__PURE__ */ new Map();
908
- Ve(e, r);
907
+ const o = /* @__PURE__ */ new Map();
908
+ Ve(e, o);
909
909
  for (const u of n) {
910
910
  const c = J(u, "element-name"), g = J(u, "style");
911
911
  if (g !== void 0 && ie(
912
- o.warnings,
912
+ r.warnings,
913
913
  "override-style-ignored",
914
914
  `AttributeOverrides style for element-name "${c ?? "(missing)"}" was ignored with value "${g}"`,
915
915
  u,
@@ -921,22 +921,22 @@ function vn(e, n, t, i, o) {
921
921
  ), c === void 0 || c.length === 0) continue;
922
922
  const m = [];
923
923
  if (Et(e, c, m), m.length === 0) {
924
- const p = [...r.keys()];
924
+ const h = [...o.keys()];
925
925
  ie(
926
- o.warnings,
926
+ r.warnings,
927
927
  "override-target-missing",
928
- `AttributeOverrides target "${c}" matched no element; available names: ${p.length === 0 ? "(none)" : p.join(", ")}`,
928
+ `AttributeOverrides target "${c}" matched no element; available names: ${h.length === 0 ? "(none)" : h.join(", ")}`,
929
929
  u,
930
930
  i ?? void 0,
931
931
  { reason: "invalid-value", subject: { kind: "name", name: c } }
932
932
  );
933
933
  continue;
934
934
  }
935
- for (const p of m)
935
+ for (const h of m)
936
936
  for (const d of u.attributes) {
937
937
  if (d.name === "element-name" || d.name === "style") continue;
938
- const b = p.attributes.find((y) => y.name === d.name);
939
- b === void 0 ? p.attributes.push(Te(d, t, i)) : (b.value = d.value, b.sourceDocument = i);
938
+ const b = h.attributes.find((y) => y.name === d.name);
939
+ b === void 0 ? h.attributes.push(Te(d, t, i)) : (b.value = d.value, b.sourceDocument = i);
940
940
  }
941
941
  }
942
942
  }
@@ -945,9 +945,9 @@ function Mt(e) {
945
945
  }
946
946
  function kn(e, n) {
947
947
  let t = 0;
948
- const i = (o) => {
949
- t = Math.max(t, Number(o.id) + 1);
950
- for (const r of o.children) i(r);
948
+ const i = (r) => {
949
+ t = Math.max(t, Number(r.id) + 1);
950
+ for (const o of r.children) i(o);
951
951
  };
952
952
  return i(e.root), {
953
953
  resolver: n,
@@ -968,8 +968,8 @@ function _n(e, n, t) {
968
968
  var g;
969
969
  const i = _t(e.src, n);
970
970
  if (t.cache.has(i)) return t.cache.get(i) ?? null;
971
- const o = ((g = t.resolver) == null ? void 0 : g.call(t, e.src, n)) ?? null;
972
- if (o === null)
971
+ const r = ((g = t.resolver) == null ? void 0 : g.call(t, e.src, n)) ?? null;
972
+ if (r === null)
973
973
  return t.cache.set(i, null), ie(
974
974
  t.warnings,
975
975
  "template-src-unresolved",
@@ -985,12 +985,12 @@ function _n(e, n, t) {
985
985
  n ?? void 0,
986
986
  { reason: "not-rendered", subject: { kind: "import", url: e.src, from: n } }
987
987
  ), null;
988
- const r = xt;
989
- if (r === void 0)
988
+ const o = xt;
989
+ if (o === void 0)
990
990
  throw new Error("template parser is not registered; import parse from src/index before expansion");
991
- const u = r(
992
- o,
993
- t.resolver === void 0 ? void 0 : (m, p) => t.resolver(m, p ?? e.src)
991
+ const u = o(
992
+ r,
993
+ t.resolver === void 0 ? void 0 : (m, h) => t.resolver(m, h ?? e.src)
994
994
  ), c = {
995
995
  url: e.src,
996
996
  from: n,
@@ -1000,7 +1000,7 @@ function _n(e, n, t) {
1000
1000
  return t.cache.set(i, c), c;
1001
1001
  }
1002
1002
  function Sn(e, n, t) {
1003
- var i, o, r, u;
1003
+ var i, r, o, u;
1004
1004
  if (!t.reportedWarnings.has(e.document)) {
1005
1005
  t.reportedWarnings.add(e.document);
1006
1006
  for (const c of e.document.warnings)
@@ -1009,18 +1009,18 @@ function Sn(e, n, t) {
1009
1009
  at: {
1010
1010
  ...c.at,
1011
1011
  sheet: n[c.at.sheet] ?? c.at.sheet,
1012
- url: ((o = e.document.sheets[c.at.sheet]) == null ? void 0 : o.origin) ?? null,
1013
- from: ((r = t.sheets[n[c.at.sheet] ?? c.at.sheet]) == null ? void 0 : r.sourceDocumentFrom) ?? null
1012
+ url: ((r = e.document.sheets[c.at.sheet]) == null ? void 0 : r.origin) ?? null,
1013
+ from: ((o = t.sheets[n[c.at.sheet] ?? c.at.sheet]) == null ? void 0 : o.sourceDocumentFrom) ?? null
1014
1014
  },
1015
1015
  sourceDocument: ((u = e.document.sheets[c.at.sheet]) == null ? void 0 : u.origin) ?? e.url
1016
1016
  }) : t.warnings.push({ ...c, sourceDocument: e.url });
1017
1017
  }
1018
1018
  }
1019
- function Ee(e, n, t, i, o, r) {
1020
- const u = o ? e.id : n.nextId(), c = i === null ? 0 : n.sourceOffsets.get(i.document) ?? 0, g = c === 0 || i === null ? void 0 : i.url, m = {
1019
+ function Ee(e, n, t, i, r, o) {
1020
+ const u = r ? e.id : n.nextId(), c = i === null ? 0 : n.sourceOffsets.get(i.document) ?? 0, g = c === 0 || i === null ? void 0 : i.url, m = {
1021
1021
  id: u,
1022
1022
  name: St(e.name),
1023
- attributes: e.attributes.map((p) => Te(p, c, g)),
1023
+ attributes: e.attributes.map((h) => Te(h, c, g)),
1024
1024
  children: [],
1025
1025
  spans: {
1026
1026
  openTag: Re(e.spans.openTag, c),
@@ -1036,31 +1036,31 @@ function Ee(e, n, t, i, o, r) {
1036
1036
  }
1037
1037
  };
1038
1038
  t.nodes.set(e.id, m.id);
1039
- for (const p of e.children)
1040
- if (!(p.name.local === "Template" || p.name.local === "Style")) {
1041
- if (p.name.local === "Instance") {
1042
- m.children.push(Ge(p, n, i, t, r + 1));
1039
+ for (const h of e.children)
1040
+ if (!(h.name.local === "Template" || h.name.local === "Style")) {
1041
+ if (h.name.local === "Instance") {
1042
+ m.children.push(Ge(h, n, i, t, o + 1));
1043
1043
  continue;
1044
1044
  }
1045
- p.name.local !== "AttributeOverrides" && J(p, "slot") === void 0 && m.children.push(Ee(p, n, t, i, o, r));
1045
+ h.name.local !== "AttributeOverrides" && J(h, "slot") === void 0 && m.children.push(Ee(h, n, t, i, r, o));
1046
1046
  }
1047
1047
  return m;
1048
1048
  }
1049
1049
  function $n(e, n, t, i) {
1050
1050
  $t(e.document, t);
1051
- const o = { nodes: /* @__PURE__ */ new Map([[e.document.root.id, n.id]]) };
1052
- for (const r of e.document.root.children)
1053
- if (!(r.name.local === "Template" || r.name.local === "Style")) {
1054
- if (r.name.local === "Instance") {
1055
- n.children.push(Ge(r, t, e, o, i + 1));
1051
+ const r = { nodes: /* @__PURE__ */ new Map([[e.document.root.id, n.id]]) };
1052
+ for (const o of e.document.root.children)
1053
+ if (!(o.name.local === "Template" || o.name.local === "Style")) {
1054
+ if (o.name.local === "Instance") {
1055
+ n.children.push(Ge(o, t, e, r, i + 1));
1056
1056
  continue;
1057
1057
  }
1058
- r.name.local !== "AttributeOverrides" && J(r, "slot") === void 0 && n.children.push(Ee(r, t, o, e, !1, i));
1058
+ o.name.local !== "AttributeOverrides" && J(o, "slot") === void 0 && n.children.push(Ee(o, t, r, e, !1, i));
1059
1059
  }
1060
- return o;
1060
+ return r;
1061
1061
  }
1062
- function Ge(e, n, t, i, o) {
1063
- const r = gn(
1062
+ function Ge(e, n, t, i, r) {
1063
+ const o = gn(
1064
1064
  n.nextId(),
1065
1065
  { prefix: e.name.prefix, local: "TemplateContainer" },
1066
1066
  e.attributes.filter((s) => s.name !== "template").map(
@@ -1073,7 +1073,7 @@ function Ge(e, n, t, i, o) {
1073
1073
  [],
1074
1074
  e.id
1075
1075
  );
1076
- t !== null && (r.sourceDocument = t.url.length > 0 ? t.url : null, r.sourceDocumentFrom = t.from), i.nodes.set(e.id, r.id);
1076
+ t !== null && (o.sourceDocument = t.url.length > 0 ? t.url : null, o.sourceDocumentFrom = t.from), i.nodes.set(e.id, o.id);
1077
1077
  const u = J(e, "template"), c = e.children.filter((s) => J(s, "slot") !== void 0), g = t === null || t.url.length === 0 ? void 0 : t.url, m = t == null ? void 0 : t.declarations.get(u ?? "");
1078
1078
  if (m === void 0)
1079
1079
  return me(e, c, null, g, n), ie(
@@ -1086,13 +1086,13 @@ function Ge(e, n, t, i, o) {
1086
1086
  reason: "invalid-value",
1087
1087
  ...u === void 0 ? {} : { subject: { kind: "name", name: u } }
1088
1088
  }
1089
- ), r;
1090
- const p = t === null || t.url.length === 0 ? null : t.url, d = {
1091
- key: JSON.stringify([m.name, m.src, p]),
1089
+ ), o;
1090
+ const h = t === null || t.url.length === 0 ? null : t.url, d = {
1091
+ key: JSON.stringify([m.name, m.src, h]),
1092
1092
  label: `${m.name}@${m.src}`
1093
1093
  }, b = n.stack.findIndex((s) => s.key === d.key);
1094
1094
  if (b >= 0) {
1095
- const s = n.cache.get(_t(m.src, p)) ?? null;
1095
+ const s = n.cache.get(_t(m.src, h)) ?? null;
1096
1096
  me(e, c, s, g, n);
1097
1097
  const l = [...n.stack.slice(b), d].map((a) => a.label).join(" -> ");
1098
1098
  return ie(
@@ -1102,9 +1102,9 @@ function Ge(e, n, t, i, o) {
1102
1102
  e,
1103
1103
  g,
1104
1104
  { reason: "invalid-value" }
1105
- ), r;
1105
+ ), o;
1106
1106
  }
1107
- if (o >= et)
1107
+ if (r >= et)
1108
1108
  return me(e, c, null, g, n), ie(
1109
1109
  n.warnings,
1110
1110
  "template-depth-exceeded",
@@ -1115,26 +1115,26 @@ function Ge(e, n, t, i, o) {
1115
1115
  e,
1116
1116
  g,
1117
1117
  { reason: "not-rendered" }
1118
- ), r;
1119
- const y = _n(m, p, n);
1118
+ ), o;
1119
+ const y = _n(m, h, n);
1120
1120
  if (y === null)
1121
- return me(e, c, null, g, n), r;
1121
+ return me(e, c, null, g, n), o;
1122
1122
  $t(y.document, n), n.stack.push(d);
1123
- const x = $n(y, r, n, o);
1123
+ const x = $n(y, o, n, r);
1124
1124
  n.stack.pop();
1125
1125
  const k = yn(y, n);
1126
- Sn(y, k, n), xn(y, k, x, r, n);
1126
+ Sn(y, k, n), xn(y, k, x, o, n);
1127
1127
  const S = e.children.filter((s) => s.name.local === "AttributeOverrides");
1128
1128
  me(e, c, y, g, n), vn(
1129
- r,
1129
+ o,
1130
1130
  S,
1131
1131
  t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
1132
1132
  t === null || t.url.length === 0 ? null : t.url,
1133
1133
  n
1134
1134
  );
1135
1135
  for (const s of e.children)
1136
- s.name.local === "AttributeOverrides" || s.name.local === "Style" || J(s, "slot") !== void 0 || r.children.push(Ee(s, n, i, t, !1, o));
1137
- return r;
1136
+ s.name.local === "AttributeOverrides" || s.name.local === "Style" || J(s, "slot") !== void 0 || o.children.push(Ee(s, n, i, t, !1, r));
1137
+ return o;
1138
1138
  }
1139
1139
  function Tn(e) {
1140
1140
  if (!Mt(e.root)) return { document: e, warnings: [] };
@@ -1143,7 +1143,7 @@ function Tn(e) {
1143
1143
  from: null,
1144
1144
  document: e,
1145
1145
  declarations: kt(e)
1146
- }, o = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, r = {
1146
+ }, r = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, o = {
1147
1147
  id: e.root.id,
1148
1148
  name: St(e.root.name),
1149
1149
  attributes: e.root.attributes.map((c) => Te(c)),
@@ -1159,17 +1159,17 @@ function Tn(e) {
1159
1159
  for (const c of e.root.children)
1160
1160
  if (!(c.name.local === "Template" || c.name.local === "Style")) {
1161
1161
  if (c.name.local === "Instance") {
1162
- r.children.push(Ge(c, n, i, o, 0));
1162
+ o.children.push(Ge(c, n, i, r, 0));
1163
1163
  continue;
1164
1164
  }
1165
- c.name.local !== "AttributeOverrides" && J(c, "slot") === void 0 && r.children.push(Ee(c, n, o, i, !0, 0));
1165
+ c.name.local !== "AttributeOverrides" && J(c, "slot") === void 0 && o.children.push(Ee(c, n, r, i, !0, 0));
1166
1166
  }
1167
1167
  for (let c = 0; c < t; c++) {
1168
- const g = n.styleRoots[c], m = o.nodes.get(g.scope);
1168
+ const g = n.styleRoots[c], m = r.nodes.get(g.scope);
1169
1169
  m !== void 0 && (n.styleRoots[c] = { ...g, scope: m });
1170
1170
  }
1171
1171
  const u = /* @__PURE__ */ new Map();
1172
- Ve(r, u);
1172
+ Ve(o, u);
1173
1173
  for (const [c, g] of u)
1174
1174
  g > 1 && ie(
1175
1175
  n.warnings,
@@ -1182,7 +1182,7 @@ function Tn(e) {
1182
1182
  return {
1183
1183
  document: {
1184
1184
  ...e,
1185
- root: r,
1185
+ root: o,
1186
1186
  source: n.sources.join(""),
1187
1187
  sheets: n.sheets,
1188
1188
  styleRoots: n.styleRoots
@@ -1239,8 +1239,8 @@ function ee(e) {
1239
1239
  const t = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(n);
1240
1240
  if (t === null)
1241
1241
  return { length: null, problem: `cannot read "${n}" as a length`, reason: "invalid-value" };
1242
- const i = Number(t[1]), o = t[2].toLowerCase();
1243
- return o === "" || o === "px" ? { length: { kind: "px", value: i } } : o === "%" ? { length: { kind: "percent", value: i } } : En.includes(o) ? { length: null, problem: `unit "${o}" not recognised`, code: "unsupported-unit", reason: "not-uss" } : { length: null, problem: `unknown unit "${o}"`, reason: "invalid-value" };
1242
+ const i = Number(t[1]), r = t[2].toLowerCase();
1243
+ return r === "" || r === "px" ? { length: { kind: "px", value: i } } : r === "%" ? { length: { kind: "percent", value: i } } : En.includes(r) ? { length: null, problem: `unit "${r}" not recognised`, code: "unsupported-unit", reason: "not-uss" } : { length: null, problem: `unknown unit "${r}"`, reason: "invalid-value" };
1244
1244
  }
1245
1245
  function Ae(e) {
1246
1246
  const n = e.trim();
@@ -1252,12 +1252,12 @@ const ue = {
1252
1252
  descentLine: -21.73295,
1253
1253
  lineHeight: 108.9205
1254
1254
  };
1255
- function It(e, n, t, i = 0, o = 0, r = "advanced") {
1256
- if (r === "standard") {
1255
+ function It(e, n, t, i = 0, r = 0, o = "advanced") {
1256
+ if (o === "standard") {
1257
1257
  const u = t.ascentLine - t.descentLine;
1258
- return Math.floor(n * u / t.pointSize + (e - 1) * n * (t.lineHeight ?? u) / t.pointSize + i * o * n / 100) + 1;
1258
+ return Math.floor(n * u / t.pointSize + (e - 1) * n * (t.lineHeight ?? u) / t.pointSize + i * r * n / 100) + 1;
1259
1259
  }
1260
- return Math.ceil(e * n * (t.ascentLine - t.descentLine) / t.pointSize + i * o * n / 100);
1260
+ return Math.ceil(e * n * (t.ascentLine - t.descentLine) / t.pointSize + i * r * n / 100);
1261
1261
  }
1262
1262
  function Se(e) {
1263
1263
  return e === void 0 ? "sans-serif" : `${JSON.stringify(e)}, sans-serif`;
@@ -1265,11 +1265,11 @@ function Se(e) {
1265
1265
  function ze(e, n, t = "normal", i) {
1266
1266
  var g, m;
1267
1267
  if (e === void 0) return ue;
1268
- const o = i ?? ((m = (g = e.createElement("canvas")).getContext) == null ? void 0 : m.call(g, "2d"));
1269
- if (o == null) return ue;
1270
- const r = t.includes("bold") ? "bold" : "normal", u = t.includes("italic") ? "italic" : "normal";
1271
- o.font = `${u} ${r} 90px ${Se(n)}`;
1272
- const c = o.measureText("Mg");
1268
+ const r = i ?? ((m = (g = e.createElement("canvas")).getContext) == null ? void 0 : m.call(g, "2d"));
1269
+ if (r == null) return ue;
1270
+ const o = t.includes("bold") ? "bold" : "normal", u = t.includes("italic") ? "italic" : "normal";
1271
+ r.font = `${u} ${o} 90px ${Se(n)}`;
1272
+ const c = r.measureText("Mg");
1273
1273
  return !Number.isFinite(c.fontBoundingBoxAscent) || !Number.isFinite(c.fontBoundingBoxDescent) ? ue : { pointSize: 90, ascentLine: c.fontBoundingBoxAscent, descentLine: -c.fontBoundingBoxDescent };
1274
1274
  }
1275
1275
  const fe = /((?![\uFFA0-\uFFDC])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\u3000-\u303F\u30FC\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u{20000}-\u{3FFFF}])/u;
@@ -1280,28 +1280,28 @@ function Mn(e) {
1280
1280
  const i = e.createElement("canvas");
1281
1281
  n = ((t = i.getContext) == null ? void 0 : t.call(i, "2d")) ?? null;
1282
1282
  }
1283
- return (i, o, r) => {
1284
- n !== null && (n.fontKerning = o.textGenerator === "standard" ? "none" : "normal");
1285
- const u = o.fontStyle.includes("bold") ? "bold" : "normal", c = o.fontStyle.includes("italic") ? "italic" : "normal", g = (s) => {
1286
- n !== null && (n.font = `${c} ${u} ${s}px ${Se(o.fontFamily)}`);
1283
+ return (i, r, o) => {
1284
+ n !== null && (n.fontKerning = r.textGenerator === "standard" ? "none" : "normal");
1285
+ const u = r.fontStyle.includes("bold") ? "bold" : "normal", c = r.fontStyle.includes("italic") ? "italic" : "normal", g = (s) => {
1286
+ n !== null && (n.font = `${c} ${u} ${s}px ${Se(r.fontFamily)}`);
1287
1287
  };
1288
- let m = o.faceInfo;
1289
- m === void 0 && o.fontFamily !== void 0 && n !== null && (m = ze(e, o.fontFamily, o.fontStyle, n)), g(o.fontSize);
1290
- const p = (s) => {
1291
- const l = [...s].length, a = [...s].filter((w) => w === " ").length, f = Math.max(0, l - 1 - (o.textGenerator === "standard" ? 0 : a));
1292
- return (n === null ? l * o.fontSize * 0.5 : n.measureText(s).width) + (f * (o.letterSpacing ?? 0) + a * (o.wordSpacing ?? 0)) * o.fontSize / 100;
1288
+ let m = r.faceInfo;
1289
+ m === void 0 && r.fontFamily !== void 0 && n !== null && (m = ze(e, r.fontFamily, r.fontStyle, n)), g(r.fontSize);
1290
+ const h = (s) => {
1291
+ const l = [...s].length, a = [...s].filter((w) => w === " ").length, f = Math.max(0, l - 1 - (r.textGenerator === "standard" ? 0 : a));
1292
+ return (n === null ? l * r.fontSize * 0.5 : n.measureText(s).width) + (f * (r.letterSpacing ?? 0) + a * (r.wordSpacing ?? 0)) * r.fontSize / 100;
1293
1293
  }, d = i.split(`
1294
- `).map((s) => o.whiteSpace === "pre" || o.whiteSpace === "pre-wrap" ? s : s.replace(/ +/g, " ").trim()), b = o.whiteSpace !== "nowrap" && o.whiteSpace !== "pre" && r > 0;
1294
+ `).map((s) => r.whiteSpace === "pre" || r.whiteSpace === "pre-wrap" ? s : s.replace(/ +/g, " ").trim()), b = r.whiteSpace !== "nowrap" && r.whiteSpace !== "pre" && o > 0;
1295
1295
  let y = 0, x = 0, k = !1;
1296
1296
  const S = (s, l) => {
1297
1297
  k = !0;
1298
- let a = p(s);
1299
- if (o.textGenerator === "standard") {
1298
+ let a = h(s);
1299
+ if (r.textGenerator === "standard") {
1300
1300
  let f = s;
1301
- for (const h of l) {
1302
- f += h;
1303
- const w = p(f);
1304
- if (w > r) break;
1301
+ for (const p of l) {
1302
+ f += p;
1303
+ const w = h(f);
1304
+ if (w > o) break;
1305
1305
  a = w;
1306
1306
  }
1307
1307
  }
@@ -1310,34 +1310,34 @@ function Mn(e) {
1310
1310
  for (const s of d) {
1311
1311
  let l = "";
1312
1312
  if (y++, !b) {
1313
- x = Math.max(x, p(s));
1313
+ x = Math.max(x, h(s));
1314
1314
  continue;
1315
1315
  }
1316
- const a = o.whiteSpace === "pre-wrap", f = a ? (s.match(/ +|[^ ]+/g) ?? []).flatMap((_) => _[0] === " " ? [_] : _.split(fe).filter(Boolean)).map((_) => ({ value: _, separator: "" })) : s.split(/\s+/).filter(Boolean).flatMap((_) => _.split(fe).filter(Boolean).map((N, z) => ({ value: N, separator: z === 0 ? " " : "" })));
1317
- let h = 0;
1316
+ const a = r.whiteSpace === "pre-wrap", f = a ? (s.match(/ +|[^ ]+/g) ?? []).flatMap((_) => _[0] === " " ? [_] : _.split(fe).filter(Boolean)).map((_) => ({ value: _, separator: "" })) : s.split(/\s+/).filter(Boolean).flatMap((_) => _.split(fe).filter(Boolean).map((N, z) => ({ value: N, separator: z === 0 ? " " : "" })));
1317
+ let p = 0;
1318
1318
  const w = a ? s : f.map(({ value: _, separator: N }, z) => (z === 0 ? "" : N) + _).join("");
1319
1319
  for (const [_, { value: N, separator: z }] of f.entries()) {
1320
- const H = _ === 0 ? "" : z, V = h + H.length, Y = l === "" ? N : l + H + N;
1321
- if ((!a || N[0] !== " ") && l !== "" && p(Y) > r) {
1320
+ const H = _ === 0 ? "" : z, V = p + H.length, Y = l === "" ? N : l + H + N;
1321
+ if ((!a || N[0] !== " ") && l !== "" && h(Y) > o) {
1322
1322
  const G = a ? l.trimEnd() : l;
1323
1323
  S(G, (a ? l.slice(G.length) : H) + w.slice(V)), l = "";
1324
1324
  }
1325
- if (N[0] !== " " && p(N) > r) {
1325
+ if (N[0] !== " " && h(N) > o) {
1326
1326
  let G = V;
1327
1327
  for (const K of N)
1328
- l !== "" && p(l + K) > r && (S(l, w.slice(G)), l = ""), l += K, G += K.length;
1328
+ l !== "" && h(l + K) > o && (S(l, w.slice(G)), l = ""), l += K, G += K.length;
1329
1329
  } else l = l === "" ? N : l + H + N;
1330
- h = V + N.length;
1330
+ p = V + N.length;
1331
1331
  }
1332
- x = Math.max(x, p(l));
1332
+ x = Math.max(x, h(l));
1333
1333
  }
1334
- return k && o.textGenerator === "standard" && (x = Math.min(r, Math.floor(x) + 1)), { width: x, height: It(
1334
+ return k && r.textGenerator === "standard" && (x = Math.min(o, Math.floor(x) + 1)), { width: x, height: It(
1335
1335
  y,
1336
- o.fontSize,
1336
+ r.fontSize,
1337
1337
  m ?? ue,
1338
1338
  d.length - 1,
1339
- o.paragraphSpacing ?? 0,
1340
- o.textGenerator
1339
+ r.paragraphSpacing ?? 0,
1340
+ r.textGenerator
1341
1341
  ) };
1342
1342
  };
1343
1343
  }
@@ -1386,10 +1386,10 @@ const Fe = {
1386
1386
  ];
1387
1387
  function Rn(e, n, t, i) {
1388
1388
  var K, B;
1389
- const o = i.theme ?? $e, r = Ke;
1390
- if (r === null)
1389
+ const r = i.theme ?? $e, o = Ke;
1390
+ if (o === null)
1391
1391
  throw new Error("loadLayoutEngine() must be awaited before rendering");
1392
- const u = [], c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), m = [], p = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), b = [], y = /* @__PURE__ */ new Map();
1392
+ const u = [], c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), m = [], h = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), b = [], y = /* @__PURE__ */ new Map();
1393
1393
  let x = 0, k = !1;
1394
1394
  const S = (v, $) => {
1395
1395
  var T;
@@ -1441,7 +1441,7 @@ function Rn(e, n, t, i) {
1441
1441
  return;
1442
1442
  }
1443
1443
  }
1444
- function h(v) {
1444
+ function p(v) {
1445
1445
  if (v !== null) {
1446
1446
  if (v.kind === "px") return v.value;
1447
1447
  if (v.kind === "percent") return `${v.value}%`;
@@ -1471,11 +1471,11 @@ function Rn(e, n, t, i) {
1471
1471
  const A = Ae(R);
1472
1472
  A !== null && Number.isFinite(A) ? v.setAspectRatio(A) : l($, "aspect-ratio", T, `cannot read "${R}" as a number`, "invalid-value", !0);
1473
1473
  }
1474
- v.setMinWidth(h(a($, "min-width", T))), v.setMinHeight(h(a($, "min-height", T))), v.setMaxWidth(h(a($, "max-width", T))), v.setMaxHeight(h(a($, "max-height", T)));
1474
+ v.setMinWidth(p(a($, "min-width", T))), v.setMinHeight(p(a($, "min-height", T))), v.setMaxWidth(p(a($, "max-width", T))), v.setMaxHeight(p(a($, "max-height", T)));
1475
1475
  for (const [A, F] of On) {
1476
- v.setMargin(F, h(a($, `margin-${A}`, T))), v.setPadding(F, h(a($, `padding-${A}`, T)));
1477
- const I = h(a($, `border-${A}-width`, T));
1478
- v.setBorder(F, typeof I == "number" ? I : void 0), v.setPosition(F, h(a($, A, T)));
1476
+ v.setMargin(F, p(a($, `margin-${A}`, T))), v.setPadding(F, p(a($, `padding-${A}`, T)));
1477
+ const I = p(a($, `border-${A}-width`, T));
1478
+ v.setBorder(F, typeof I == "number" ? I : void 0), v.setPosition(F, p(a($, A, T)));
1479
1479
  }
1480
1480
  }
1481
1481
  function _(v) {
@@ -1502,7 +1502,7 @@ function Rn(e, n, t, i) {
1502
1502
  }
1503
1503
  function Y(v, $, T, E, C) {
1504
1504
  var P, D;
1505
- const O = S(T, "-unity-text-generator"), R = O === "standard" || O === "advanced" ? O : o === "runtime" ? "standard" : "advanced";
1505
+ const O = S(T, "-unity-text-generator"), R = O === "standard" || O === "advanced" ? O : r === "runtime" ? "standard" : "advanced";
1506
1506
  T.has("-unity-text-generator") && O !== "standard" && O !== "advanced" && V(
1507
1507
  E,
1508
1508
  T,
@@ -1511,7 +1511,7 @@ function Rn(e, n, t, i) {
1511
1511
  `-unity-text-generator: ${O} is invalid; measured as ${R}`
1512
1512
  );
1513
1513
  const A = $.length > 0 && $.trim() === "" && ["Label", "Button", "GroupBox"].includes(E.name.local);
1514
- if (A && (o === "runtime" || R === "standard")) {
1514
+ if (A && (r === "runtime" || R === "standard")) {
1515
1515
  v.setMeasureFunc(() => ({ width: 0, height: 0 }));
1516
1516
  return;
1517
1517
  }
@@ -1571,7 +1571,7 @@ function Rn(e, n, t, i) {
1571
1571
  let L = (D = T.get("-unity-text-generator")) == null ? void 0 : D.origin;
1572
1572
  for (; (L == null ? void 0 : L.kind) === "inherited"; ) L = L.origin;
1573
1573
  const W = (L == null ? void 0 : L.kind) === "rule" || (L == null ? void 0 : L.kind) === "inline";
1574
- if (o === "editor" && !W && ((I.letterSpacing ?? 0) !== 0 || (I.wordSpacing ?? 0) !== 0) && u.push({
1574
+ if (r === "editor" && !W && ((I.letterSpacing ?? 0) !== 0 || (I.wordSpacing ?? 0) !== 0) && u.push({
1575
1575
  kind: "version-dependent",
1576
1576
  reason: "version-dependent",
1577
1577
  node: E.id,
@@ -1590,12 +1590,12 @@ function Rn(e, n, t, i) {
1590
1590
  $,
1591
1591
  I,
1592
1592
  S(T, "position") !== "absolute" && Number.isFinite(M) ? M : 0
1593
- ), se = j === Ce.AtMost && Number.isFinite(M) && S(T, "position") !== "absolute" && C !== "unity-text-element--inner-input-field-component", he = ce === Ce.AtMost && Number.isFinite(q) && S(T, "position") !== "absolute" && !(C === "unity-text-element--inner-input-field-component" && oe((ne = E.attributes.find((ve) => ve.name === "multiline")) == null ? void 0 : ne.value) === !0);
1593
+ ), se = j === Ce.AtMost && Number.isFinite(M) && S(T, "position") !== "absolute" && C !== "unity-text-element--inner-input-field-component", he = ce === Ce.AtMost && Number.isFinite(q) && S(T, "position") !== "absolute" && !(C === "unity-text-element--inner-input-field-component" && re((ne = E.attributes.find((ve) => ve.name === "multiline")) == null ? void 0 : ne.value) === !0);
1594
1594
  return {
1595
1595
  width: se ? Math.min(X.width, M) : X.width,
1596
1596
  height: he ? Math.min(X.height, q) : X.height
1597
1597
  };
1598
- }), A && o === "editor" && u.push({
1598
+ }), A && r === "editor" && u.push({
1599
1599
  kind: "version-dependent",
1600
1600
  reason: "version-dependent",
1601
1601
  node: E.id,
@@ -1625,10 +1625,10 @@ function Rn(e, n, t, i) {
1625
1625
  }));
1626
1626
  return;
1627
1627
  }
1628
- const T = n.get(v.id) ?? /* @__PURE__ */ new Map(), E = r.Node.create();
1629
- b.push(E), x++, ye++, p.set(v, E), m.push(v), w(E, T, v), $ !== null && $.insertChild(E, $.getChildCount());
1628
+ const T = n.get(v.id) ?? /* @__PURE__ */ new Map(), E = o.Node.create();
1629
+ b.push(E), x++, ye++, h.set(v, E), m.push(v), w(E, T, v), $ !== null && $.insertChild(E, $.getChildCount());
1630
1630
  const { spec: C, fallback: O } = Z(v), R = _(v), A = C.hasText && R !== void 0 && R.length > 0;
1631
- if (o === "editor" && v.name.local === "Button" && !A && u.push({
1631
+ if (r === "editor" && v.name.local === "Button" && !A && u.push({
1632
1632
  kind: "version-dependent",
1633
1633
  reason: "version-dependent",
1634
1634
  node: v.id,
@@ -1659,7 +1659,7 @@ function Rn(e, n, t, i) {
1659
1659
  kind: "unsupported-property",
1660
1660
  reason: "font-fallback",
1661
1661
  node: v.id,
1662
- message: `The editor default font (Inter-Regular SDF) has no glyphs for ${q}; Unity draws it with a fallback font whose height can differ (measured 1–4px taller).` + (j === "hangul" ? "" : " Unity's box width was measured 6–87px narrower than this preview's (10–32px font sizes); this preview's width depends on the device's fallback font."),
1662
+ message: `The ${r === "runtime" ? "runtime default font (NotInter-Regular)" : "editor default font (Inter-Regular SDF)"} has no glyphs for ${q}; Unity draws it with a fallback font whose height can differ (measured 1–4px taller).` + (j === "hangul" ? "" : " Unity's box width was measured 6–87px narrower than this preview's (10–32px font sizes); this preview's width depends on the device's fallback font." + (r === "runtime" ? " These figures were measured in the editor panel; the runtime panel has not been measured for them." : "")),
1663
1663
  subject: { kind: "property", property: "-unity-font-definition", value: "", affectsLayout: !0, missingGlyphs: j }
1664
1664
  });
1665
1665
  }
@@ -1679,7 +1679,7 @@ function Rn(e, n, t, i) {
1679
1679
  for (const [ce, X] of C.parts.entries()) {
1680
1680
  const se = gt(v, X);
1681
1681
  if (X.kind === "leading-text" && !se) continue;
1682
- const he = (j == null ? void 0 : j.get(X.name)) ?? /* @__PURE__ */ new Map(), ne = r.Node.create();
1682
+ const he = (j == null ? void 0 : j.get(X.name)) ?? /* @__PURE__ */ new Map(), ne = o.Node.create();
1683
1683
  b.push(ne), x++, ye++, w(ne, he, v);
1684
1684
  const ve = We(C.parts, ce), Me = ve === null ? null : q.get(ve) ?? null, Je = Me === null ? E : M[Me];
1685
1685
  Je.insertChild(ne, Je.getChildCount()), q.set(ce, M.length), se !== void 0 ? Y(ne, se, he, v, X.name) : C.fileChildrenHost !== "owner" && (L = ne), M.push(ne), D.push({
@@ -1697,7 +1697,7 @@ function Rn(e, n, t, i) {
1697
1697
  }
1698
1698
  try {
1699
1699
  let v = function(E, C, O) {
1700
- const R = p.get(E);
1700
+ const R = h.get(E);
1701
1701
  if (R === void 0) return;
1702
1702
  const A = R.getComputedLayout();
1703
1703
  let F = C + A.left, I = O + A.top;
@@ -1715,7 +1715,7 @@ function Rn(e, n, t, i) {
1715
1715
  for (const P of E.children) v(P, F, I);
1716
1716
  };
1717
1717
  G(e, null);
1718
- const $ = p.get(e);
1718
+ const $ = h.get(e);
1719
1719
  $.setWidth(i.size.width), $.setHeight(i.size.height), $.setPositionType(Ie.Relative), $.calculateLayout(i.size.width, i.size.height, Ne.LTR);
1720
1720
  const T = /* @__PURE__ */ new Map();
1721
1721
  for (let E = 0; E < 3; E++) {
@@ -1725,16 +1725,16 @@ function Rn(e, n, t, i) {
1725
1725
  if (A === void 0) continue;
1726
1726
  const F = R.findIndex((D) => D.name === "unity-content-viewport"), I = R.findIndex((D) => D.name === "unity-content-container");
1727
1727
  if (F === -1 || I === -1) continue;
1728
- const U = A[F].getComputedLayout(), W = A[I].getComputedLayout().height > U.height + 0.01, P = tn(W, o);
1728
+ const U = A[F].getComputedLayout(), W = A[I].getComputedLayout().height > U.height + 0.01, P = tn(W, r);
1729
1729
  (T.get(O) ?? 0) !== P && (T.set(O, P), A[F].setMargin(de.Right, P), C = !0);
1730
1730
  }
1731
1731
  if (!C) break;
1732
1732
  $.calculateLayout(i.size.width, i.size.height, Ne.LTR);
1733
1733
  }
1734
- for (const [E] of p) {
1734
+ for (const [E] of h) {
1735
1735
  if (E.name.local !== "ProgressBar") continue;
1736
1736
  const C = g.get(E.id), O = d.get(E.id), R = O[C.findIndex((P) => P.name === "unity-progress-bar__background")], A = O[C.findIndex((P) => P.name === "unity-progress-bar__progress")], { high: F, value: I } = be(E), U = Math.floor(R.getComputedLayout().width - 2), L = F === 0 ? 0 : U * I / F, W = Number.isFinite(L) && L > 0 ? L : 0;
1737
- A.setPosition(de.Right, U - W), o === "editor" && W === 0 && u.push({
1737
+ A.setPosition(de.Right, U - W), r === "editor" && W === 0 && u.push({
1738
1738
  kind: "version-dependent",
1739
1739
  reason: "version-dependent",
1740
1740
  node: E.id,
@@ -1742,13 +1742,13 @@ function Rn(e, n, t, i) {
1742
1742
  message: "<ProgressBar> at or below low-value is 1px wide on Unity 6000.0.40f1 and 0px on 6000.3.25f1 (editor theme); drawn as 6000.3.25f1"
1743
1743
  });
1744
1744
  }
1745
- [...p.keys()].some((E) => E.name.local === "ProgressBar") && $.calculateLayout(i.size.width, i.size.height, Ne.LTR), v(e, 0, 0);
1745
+ [...h.keys()].some((E) => E.name.local === "ProgressBar") && $.calculateLayout(i.size.width, i.size.height, Ne.LTR), v(e, 0, 0);
1746
1746
  for (const [E, C] of g) {
1747
1747
  const O = C.find((M) => M.name === "unity-drag-container"), R = C.find((M) => M.name === "unity-dragger");
1748
1748
  if (O === void 0 || R === void 0) continue;
1749
- const A = [...p.keys()].find((M) => M.id === E), { low: F, high: I, value: U } = be(A), L = I === F ? 0 : (U - F) / (I - F);
1749
+ const A = [...h.keys()].find((M) => M.id === E), { low: F, high: I, value: U } = be(A), L = I === F ? 0 : (U - F) / (I - F);
1750
1750
  let W = Number.isFinite(L) ? Math.min(1, Math.max(0, L)) : 0;
1751
- oe((K = A.attributes.find((M) => M.name === "inverted")) == null ? void 0 : K.value) === !0 && (W = 1 - W);
1751
+ re((K = A.attributes.find((M) => M.name === "inverted")) == null ? void 0 : K.value) === !0 && (W = 1 - W);
1752
1752
  const D = ht((B = A.attributes.find((M) => M.name === "direction")) == null ? void 0 : B.value) ? `0px ${(1 - W) * (O.box.height - R.box.height)}px` : `${W * (O.box.width - R.box.width)}px 0px`;
1753
1753
  for (const M of C.filter((j) => j.name === "unity-dragger" || j.name === "unity-dragger-border")) {
1754
1754
  const j = new Map(M.style);
@@ -1766,7 +1766,7 @@ function Rn(e, n, t, i) {
1766
1766
  painted: m,
1767
1767
  warnings: u,
1768
1768
  dispose() {
1769
- k || (k = !0, $.freeRecursive(), ye -= x, p.clear(), d.clear());
1769
+ k || (k = !0, $.freeRecursive(), ye -= x, h.clear(), d.clear());
1770
1770
  }
1771
1771
  };
1772
1772
  } catch (v) {
@@ -1799,20 +1799,20 @@ function Nt(e) {
1799
1799
  }
1800
1800
  function it(e, n, t = {}) {
1801
1801
  var l;
1802
- const i = {}, o = [], r = (a) => {
1802
+ const i = {}, r = [], o = (a) => {
1803
1803
  var f;
1804
1804
  return (f = e.get(a)) == null ? void 0 : f.value;
1805
- }, u = (a, f, h = {}) => {
1805
+ }, u = (a, f, p = {}) => {
1806
1806
  var N, z, H;
1807
- const w = ((N = h.subject) == null ? void 0 : N.kind) === "property" ? h.subject.property : ((z = h.subject) == null ? void 0 : z.kind) === "asset" ? "background-image" : void 0, _ = w === void 0 ? void 0 : e.get(w);
1808
- (_ == null ? void 0 : _.origin.kind) !== "inherited" && o.push({
1807
+ const w = ((N = p.subject) == null ? void 0 : N.kind) === "property" ? p.subject.property : ((z = p.subject) == null ? void 0 : z.kind) === "asset" ? "background-image" : void 0, _ = w === void 0 ? void 0 : e.get(w);
1808
+ (_ == null ? void 0 : _.origin.kind) !== "inherited" && r.push({
1809
1809
  kind: a,
1810
1810
  message: f,
1811
1811
  node: n,
1812
- ...h,
1812
+ ...p,
1813
1813
  ..._ === void 0 ? {} : ((H = t.locate) == null ? void 0 : H.call(t, _.origin)) ?? {}
1814
1814
  });
1815
- }, c = (a, f = r(a)) => ({
1815
+ }, c = (a, f = o(a)) => ({
1816
1816
  subject: { kind: "property", property: a, ...f === void 0 ? {} : { value: f } }
1817
1817
  });
1818
1818
  i["box-sizing"] = "border-box";
@@ -1828,18 +1828,18 @@ function it(e, n, t = {}) {
1828
1828
  "transform-origin"
1829
1829
  ];
1830
1830
  for (const a of g) {
1831
- const f = r(a);
1831
+ const f = o(a);
1832
1832
  f !== void 0 && (i[a] = f);
1833
1833
  }
1834
- const m = ee(r("font-size") ?? "12px").length, p = (m == null ? void 0 : m.kind) === "px" || (m == null ? void 0 : m.kind) === "percent" ? m.value : 12;
1835
- (m == null ? void 0 : m.kind) === "percent" && (i["font-size"] = `${p}px`);
1834
+ const m = ee(o("font-size") ?? "12px").length, h = (m == null ? void 0 : m.kind) === "px" || (m == null ? void 0 : m.kind) === "percent" ? m.value : 12;
1835
+ (m == null ? void 0 : m.kind) === "percent" && (i["font-size"] = `${h}px`);
1836
1836
  for (const a of ["letter-spacing", "word-spacing"]) {
1837
- const f = ee(r(a) ?? "").length;
1838
- (f == null ? void 0 : f.kind) === "px" && (i[a] = `${f.value * p / 100}px`);
1837
+ const f = ee(o(a) ?? "").length;
1838
+ (f == null ? void 0 : f.kind) === "px" && (i[a] = `${f.value * h / 100}px`);
1839
1839
  }
1840
- r("display") === "none" && (i.display = "none"), r("overflow") === "hidden" && (i.overflow = "hidden");
1840
+ o("display") === "none" && (i.display = "none"), o("overflow") === "hidden" && (i.overflow = "hidden");
1841
1841
  for (const a of An) {
1842
- const f = r(`border-${a}-width`);
1842
+ const f = o(`border-${a}-width`);
1843
1843
  if (f !== void 0 && f !== "0") {
1844
1844
  const { length: _, problem: N } = ee(f);
1845
1845
  _ === null || _.kind !== "px" ? N === void 0 && u(
@@ -1848,9 +1848,9 @@ function it(e, n, t = {}) {
1848
1848
  { reason: "invalid-value", ...c(`border-${a}-width`) }
1849
1849
  ) : (i[`border-${a}-width`] = `${_.value}px`, i[`border-${a}-style`] = "solid");
1850
1850
  }
1851
- const h = r(`border-${a}-color`);
1852
- h !== void 0 && (i[`border-${a}-color`] = h);
1853
- const w = r(`padding-${a}`);
1851
+ const p = o(`border-${a}-color`);
1852
+ p !== void 0 && (i[`border-${a}-color`] = p);
1853
+ const w = o(`padding-${a}`);
1854
1854
  w !== void 0 && w !== "0" && (i[`padding-${a}`] = w);
1855
1855
  }
1856
1856
  for (const a of [
@@ -1859,10 +1859,10 @@ function it(e, n, t = {}) {
1859
1859
  "bottom-right",
1860
1860
  "bottom-left"
1861
1861
  ]) {
1862
- const f = r(`border-${a}-radius`);
1862
+ const f = o(`border-${a}-radius`);
1863
1863
  f !== void 0 && (i[`border-${a}-radius`] = f);
1864
1864
  }
1865
- const d = r("-unity-font-style");
1865
+ const d = o("-unity-font-style");
1866
1866
  if (d !== void 0) {
1867
1867
  const a = Fn[d];
1868
1868
  a === void 0 ? u("unsupported-property", `-unity-font-style: "${d}" ignored`, {
@@ -1870,21 +1870,21 @@ function it(e, n, t = {}) {
1870
1870
  ...c("-unity-font-style")
1871
1871
  }) : (i["font-weight"] = a.weight, i["font-style"] = a.style);
1872
1872
  }
1873
- const b = r("-unity-text-align");
1873
+ const b = o("-unity-text-align");
1874
1874
  if (b !== void 0) {
1875
- const [a, f] = b.split("-"), h = Ln[a ?? ""], w = Dn[f ?? ""];
1876
- h === void 0 || w === void 0 ? u("unsupported-property", `-unity-text-align: "${b}" ignored`, {
1875
+ const [a, f] = b.split("-"), p = Ln[a ?? ""], w = Dn[f ?? ""];
1876
+ p === void 0 || w === void 0 ? u("unsupported-property", `-unity-text-align: "${b}" ignored`, {
1877
1877
  reason: "invalid-value",
1878
1878
  ...c("-unity-text-align")
1879
- }) : (i["align-items"] = h, i["justify-content"] = w);
1879
+ }) : (i["align-items"] = p, i["justify-content"] = w);
1880
1880
  }
1881
- const y = [], x = r("translate");
1881
+ const y = [], x = o("translate");
1882
1882
  x !== void 0 && y.push(`translate(${x.replace(/\s+/, ", ")})`);
1883
- const k = r("rotate");
1883
+ const k = o("rotate");
1884
1884
  k !== void 0 && y.push(`rotate(${k})`);
1885
- const S = r("scale");
1885
+ const S = o("scale");
1886
1886
  S !== void 0 && y.push(`scale(${S.replace(/\s+/, ", ")})`), y.length > 0 && (i.transform = y.join(" "));
1887
- const s = r("background-image");
1887
+ const s = o("background-image");
1888
1888
  if (s !== void 0 && s !== "none") {
1889
1889
  const a = Nt(s);
1890
1890
  if (a === null)
@@ -1893,14 +1893,14 @@ function it(e, n, t = {}) {
1893
1893
  ...c("background-image")
1894
1894
  });
1895
1895
  else {
1896
- const { form: f, path: h } = a, w = ((l = t.resolveAsset) == null ? void 0 : l.call(t, h, f)) ?? null;
1896
+ const { form: f, path: p } = a, w = ((l = t.resolveAsset) == null ? void 0 : l.call(t, p, f)) ?? null;
1897
1897
  if (w === null)
1898
- i["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)", u("asset-unresolved", `background-image: "${h}" was not resolved`, {
1899
- subject: { kind: "asset", path: h, form: f }
1898
+ i["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)", u("asset-unresolved", `background-image: "${p}" was not resolved`, {
1899
+ subject: { kind: "asset", path: p, form: f }
1900
1900
  });
1901
1901
  else {
1902
- i["background-image"] = `url("${w}")`, i["background-repeat"] = r("background-repeat") ?? "no-repeat", i["background-position"] = r("background-position") ?? "center";
1903
- const _ = r("background-size"), N = r("-unity-background-scale-mode") ?? nt, z = Le[N];
1902
+ i["background-image"] = `url("${w}")`, i["background-repeat"] = o("background-repeat") ?? "no-repeat", i["background-position"] = o("background-position") ?? "center";
1903
+ const _ = o("background-size"), N = o("-unity-background-scale-mode") ?? nt, z = Le[N];
1904
1904
  z === void 0 && u(
1905
1905
  "unsupported-property",
1906
1906
  `-unity-background-scale-mode: "${N}" ignored; expected one of ${Object.keys(Le).join(", ")}`,
@@ -1909,15 +1909,15 @@ function it(e, n, t = {}) {
1909
1909
  }
1910
1910
  }
1911
1911
  }
1912
- return { declarations: i, warnings: o };
1912
+ return { declarations: i, warnings: r };
1913
1913
  }
1914
1914
  const jn = "data-uxml-node", zn = "data-uxml-part", Un = "data-uxml-part-owner";
1915
- function Bn(e, n, t, i, o, r) {
1915
+ function Bn(e, n, t, i, r, o) {
1916
1916
  const u = [], c = /* @__PURE__ */ new Map();
1917
1917
  function g(s) {
1918
1918
  const l = i.get(s.id), a = (f) => {
1919
1919
  var _;
1920
- const h = ((_ = l == null ? void 0 : l.get(f)) == null ? void 0 : _.value) ?? je[f] ?? "0", { length: w } = ee(h);
1920
+ const p = ((_ = l == null ? void 0 : l.get(f)) == null ? void 0 : _.value) ?? je[f] ?? "0", { length: w } = ee(p);
1921
1921
  return w !== null && w.kind === "px" ? w.value : 0;
1922
1922
  };
1923
1923
  return { left: a("border-left-width"), top: a("border-top-width") };
@@ -1925,40 +1925,40 @@ function Bn(e, n, t, i, o, r) {
1925
1925
  function m(s) {
1926
1926
  const l = (a) => {
1927
1927
  var w;
1928
- const f = ((w = s.style.get(a)) == null ? void 0 : w.value) ?? je[a] ?? "0", { length: h } = ee(f);
1929
- return h !== null && h.kind === "px" ? h.value : 0;
1928
+ const f = ((w = s.style.get(a)) == null ? void 0 : w.value) ?? je[a] ?? "0", { length: p } = ee(f);
1929
+ return p !== null && p.kind === "px" ? p.value : 0;
1930
1930
  };
1931
1931
  return { left: l("border-left-width"), top: l("border-top-width") };
1932
1932
  }
1933
- function p(s, l, a) {
1933
+ function h(s, l, a) {
1934
1934
  var N;
1935
1935
  const f = ee(((N = a.get("letter-spacing")) == null ? void 0 : N.value) ?? "").length;
1936
1936
  if ((f == null ? void 0 : f.kind) !== "px" || f.value === 0) {
1937
1937
  s.textContent = l;
1938
1938
  return;
1939
1939
  }
1940
- const h = x(a), w = [...l], _ = w.pop();
1940
+ const p = x(a), w = [...l], _ = w.pop();
1941
1941
  for (const z of w.join("").match(/ +|[^ ]+/g) ?? []) {
1942
- const H = r.document.createElement("span");
1943
- H.textContent = z, !h && z[0] === " " && (H.style.letterSpacing = "0px"), s.appendChild(H);
1942
+ const H = o.document.createElement("span");
1943
+ H.textContent = z, !p && z[0] === " " && (H.style.letterSpacing = "0px"), s.appendChild(H);
1944
1944
  }
1945
1945
  if (_ !== void 0) {
1946
- const z = r.document.createElement("span");
1946
+ const z = o.document.createElement("span");
1947
1947
  z.textContent = _, z.style.letterSpacing = "0px", s.appendChild(z);
1948
1948
  }
1949
1949
  }
1950
1950
  function d(s, l, a) {
1951
1951
  var z, H, V;
1952
1952
  s.style.fontKerning = x(a) ? "none" : "normal";
1953
- const f = (z = r.fonts) == null ? void 0 : z.get(a), h = (f == null ? void 0 : f.faceInfo) ?? (f === void 0 ? ue : ze(r.document, f.family, (H = a.get("-unity-font-style")) == null ? void 0 : H.value)), w = ee(((V = a.get("font-size")) == null ? void 0 : V.value) ?? "12px").length, _ = x(a) ? ((w == null ? void 0 : w.kind) === "px" || (w == null ? void 0 : w.kind) === "percent" ? w.value : 12) * ((h.lineHeight ?? h.ascentLine - h.descentLine) - (h.ascentLine - h.descentLine)) / h.pointSize : 0;
1953
+ const f = (z = o.fonts) == null ? void 0 : z.get(a), p = (f == null ? void 0 : f.faceInfo) ?? (f === void 0 ? ue : ze(o.document, f.family, (H = a.get("-unity-font-style")) == null ? void 0 : H.value)), w = ee(((V = a.get("font-size")) == null ? void 0 : V.value) ?? "12px").length, _ = x(a) ? ((w == null ? void 0 : w.kind) === "px" || (w == null ? void 0 : w.kind) === "percent" ? w.value : 12) * ((p.lineHeight ?? p.ascentLine - p.descentLine) - (p.ascentLine - p.descentLine)) / p.pointSize : 0;
1954
1954
  if (Math.abs(_) >= 1e-5) {
1955
1955
  const Y = [...l];
1956
1956
  for (const [G, K] of Y.entries()) {
1957
- const B = r.document.createElement("span");
1957
+ const B = o.document.createElement("span");
1958
1958
  B.textContent = K, B.style.position = "relative", B.style.top = `${-_ / 2}px`, G === Y.length - 1 && (B.style.letterSpacing = "0px"), s.appendChild(B);
1959
1959
  }
1960
- } else p(s, l, a);
1961
- if (r.theme !== "runtime" || !fe.test(l)) return;
1960
+ } else h(s, l, a);
1961
+ if (o.theme !== "runtime" || !fe.test(l)) return;
1962
1962
  s.style.wordBreak = "keep-all";
1963
1963
  const N = (Y) => {
1964
1964
  for (const G of Array.from(Y.childNodes)) {
@@ -1968,9 +1968,9 @@ function Bn(e, n, t, i, o, r) {
1968
1968
  }
1969
1969
  const K = (G.textContent ?? "").split(fe);
1970
1970
  if (K.length === 1) continue;
1971
- const B = r.document.createDocumentFragment();
1971
+ const B = o.document.createDocumentFragment();
1972
1972
  K.forEach((v, $) => {
1973
- $ > 0 && B.appendChild(r.document.createElement("wbr")), B.appendChild(r.document.createTextNode(v));
1973
+ $ > 0 && B.appendChild(o.document.createElement("wbr")), B.appendChild(o.document.createTextNode(v));
1974
1974
  }), Y.replaceChild(B, G);
1975
1975
  }
1976
1976
  };
@@ -1979,32 +1979,32 @@ function Bn(e, n, t, i, o, r) {
1979
1979
  function b(s, l, a, f) {
1980
1980
  var $, T, E, C, O, R, A, F;
1981
1981
  s.style.setProperty("display", f.declarations.display ?? "flex"), f.declarations["align-items"] === void 0 && s.style.setProperty("align-items", "flex-start"), f.declarations["justify-content"] === void 0 && s.style.setProperty("justify-content", "flex-start");
1982
- const h = ($ = r.fonts) == null ? void 0 : $.get(a);
1983
- h !== void 0 && (s.style.fontFamily = Se(h.family));
1984
- const w = (h == null ? void 0 : h.faceInfo) ?? (h === void 0 ? ue : ze(r.document, h.family, (T = a.get("-unity-font-style")) == null ? void 0 : T.value)), _ = ee(((E = a.get("font-size")) == null ? void 0 : E.value) ?? "12px").length, N = (_ == null ? void 0 : _.kind) === "px" || (_ == null ? void 0 : _.kind) === "percent" ? _.value : 12, z = N * (w.ascentLine - w.descentLine) / w.pointSize, H = x(a) ? N * (w.lineHeight ?? w.ascentLine - w.descentLine) / w.pointSize : z;
1982
+ const p = ($ = o.fonts) == null ? void 0 : $.get(a);
1983
+ s.style.fontFamily = Se(p == null ? void 0 : p.family);
1984
+ const w = (p == null ? void 0 : p.faceInfo) ?? (p === void 0 ? ue : ze(o.document, p.family, (T = a.get("-unity-font-style")) == null ? void 0 : T.value)), _ = ee(((E = a.get("font-size")) == null ? void 0 : E.value) ?? "12px").length, N = (_ == null ? void 0 : _.kind) === "px" || (_ == null ? void 0 : _.kind) === "percent" ? _.value : 12, z = N * (w.ascentLine - w.descentLine) / w.pointSize, H = x(a) ? N * (w.lineHeight ?? w.ascentLine - w.descentLine) / w.pointSize : z;
1985
1985
  s.style.lineHeight = `${H}px`, s.style.fontKerning = x(a) ? "none" : "normal";
1986
1986
  const V = ((C = a.get("white-space")) == null ? void 0 : C.value) || "normal";
1987
1987
  (V === "normal" || V === "pre-wrap") && (s.style.overflowWrap = "anywhere");
1988
1988
  const Y = H - z, G = ((O = a.get("overflow")) == null ? void 0 : O.value) === "hidden" && ((R = a.get("text-overflow")) == null ? void 0 : R.value) === "ellipsis", K = ee(((A = a.get("letter-spacing")) == null ? void 0 : A.value) ?? "").length;
1989
1989
  if (!l.includes(`
1990
- `) && Math.abs(Y) < 1e-5 && !G && !((K == null ? void 0 : K.kind) === "px" && K.value !== 0) && !(r.theme === "runtime" && fe.test(l))) {
1990
+ `) && Math.abs(Y) < 1e-5 && !G && !((K == null ? void 0 : K.kind) === "px" && K.value !== 0) && !(o.theme === "runtime" && fe.test(l))) {
1991
1991
  d(s, l, a);
1992
1992
  return;
1993
1993
  }
1994
- const B = r.document.createElement("div");
1995
- B.style.minWidth = "0", Math.abs(Y) >= 1e-5 && (B.style.marginBottom = `${-Y}px`), G && (B.style.width = "100%", B.style.overflow = "hidden", B.style.textOverflow = "ellipsis", B.style.whiteSpace = "nowrap"), r.theme === "runtime" && fe.test(l) && (B.style.wordBreak = "keep-all");
1994
+ const B = o.document.createElement("div");
1995
+ B.style.minWidth = "0", Math.abs(Y) >= 1e-5 && (B.style.marginBottom = `${-Y}px`), G && (B.style.width = "100%", B.style.overflow = "hidden", B.style.textOverflow = "ellipsis", B.style.whiteSpace = "nowrap"), o.theme === "runtime" && fe.test(l) && (B.style.wordBreak = "keep-all");
1996
1996
  const v = ee(((F = a.get("-unity-paragraph-spacing")) == null ? void 0 : F.value) ?? "").length;
1997
1997
  l.includes(`
1998
1998
  `) ? (B.style.width = "100%", l.split(`
1999
1999
  `).forEach((I, U, L) => {
2000
- const W = r.document.createElement("span");
2001
- if (d(W, I, a), B.append(...Array.from(W.childNodes)), I === "" && U === L.length - 1 && B.appendChild(r.document.createElement("br")), U < L.length - 1) {
2002
- const P = r.document.createElement("br");
2000
+ const W = o.document.createElement("span");
2001
+ if (d(W, I, a), B.append(...Array.from(W.childNodes)), I === "" && U === L.length - 1 && B.appendChild(o.document.createElement("br")), U < L.length - 1) {
2002
+ const P = o.document.createElement("br");
2003
2003
  B.appendChild(P);
2004
- const D = r.document.createElement("span");
2004
+ const D = o.document.createElement("span");
2005
2005
  if (D.textContent = `
2006
2006
  `, D.style.display = "none", B.appendChild(D), (v == null ? void 0 : v.kind) === "px" && v.value !== 0) {
2007
- const M = r.document.createElement("div");
2007
+ const M = o.document.createElement("div");
2008
2008
  M.style.height = `${v.value * N / 100}px`, B.appendChild(M);
2009
2009
  }
2010
2010
  }
@@ -2018,15 +2018,15 @@ function Bn(e, n, t, i, o, r) {
2018
2018
  function x(s) {
2019
2019
  var a;
2020
2020
  const l = (a = s.get("-unity-text-generator")) == null ? void 0 : a.value;
2021
- return l === "standard" || l !== "advanced" && r.theme !== "editor";
2021
+ return l === "standard" || l !== "advanced" && o.theme !== "editor";
2022
2022
  }
2023
2023
  function k(s, l, a) {
2024
2024
  var B, v, $, T, E;
2025
2025
  const f = n.get(s.id);
2026
2026
  if (f === void 0) return null;
2027
- const h = r.document.createElement("div");
2028
- h.setAttribute(jn, String(s.id));
2029
- const w = i.get(s.id) ?? /* @__PURE__ */ new Map(), _ = it(w, s.id, r);
2027
+ const p = o.document.createElement("div");
2028
+ p.setAttribute(jn, String(s.id));
2029
+ const w = i.get(s.id) ?? /* @__PURE__ */ new Map(), _ = it(w, s.id, o);
2030
2030
  u.push(..._.warnings);
2031
2031
  const N = l === null ? 0 : f.left - l.left - a.left, z = l === null ? 0 : f.top - l.top - a.top, H = {
2032
2032
  position: "absolute",
@@ -2038,17 +2038,17 @@ function Bn(e, n, t, i, o, r) {
2038
2038
  ..._.declarations
2039
2039
  };
2040
2040
  for (const [C, O] of Object.entries(H))
2041
- h.style.setProperty(C, O);
2041
+ p.style.setProperty(C, O);
2042
2042
  const { spec: V } = Z(s), Y = (B = s.attributes.find((C) => C.name === "text")) == null ? void 0 : B.value, G = ["TextElement", "RepeatButton"].includes(s.name.local) && s.children.some((C) => !we(C)), K = V.hasText && Y !== void 0 && Y.length > 0;
2043
- if (K && b(h, te(Y), w, _), !K || G) {
2044
- let C = h, O = f, R = g(s), A = { el: C, box: O, border: R };
2043
+ if (K && b(p, te(Y), w, _), !K || G) {
2044
+ let C = p, O = f, R = g(s), A = { el: C, box: O, border: R };
2045
2045
  const F = [];
2046
2046
  for (const I of t.get(s.id) ?? []) {
2047
2047
  const U = I.parent === null || I.parent === void 0 ? void 0 : F[I.parent];
2048
- C = (U == null ? void 0 : U.el) ?? h, O = (U == null ? void 0 : U.box) ?? f, R = (U == null ? void 0 : U.border) ?? g(s);
2049
- const L = r.document.createElement("div");
2048
+ C = (U == null ? void 0 : U.el) ?? p, O = (U == null ? void 0 : U.box) ?? f, R = (U == null ? void 0 : U.border) ?? g(s);
2049
+ const L = o.document.createElement("div");
2050
2050
  L.setAttribute(zn, I.name), L.setAttribute(Un, String(s.id));
2051
- const W = it(I.style, s.id, r);
2051
+ const W = it(I.style, s.id, o);
2052
2052
  u.push(...W.warnings);
2053
2053
  const P = {
2054
2054
  position: "absolute",
@@ -2061,8 +2061,8 @@ function Bn(e, n, t, i, o, r) {
2061
2061
  };
2062
2062
  for (const [M, j] of Object.entries(P))
2063
2063
  L.style.setProperty(M, j);
2064
- const D = (v = r.fonts) == null ? void 0 : v.get(I.style);
2065
- if (D !== void 0 && (L.style.fontFamily = Se(D.family)), r.theme === "editor" && s.name.local === "Toggle" && I.name === "unity-checkmark") {
2064
+ const D = (v = o.fonts) == null ? void 0 : v.get(I.style);
2065
+ if (D !== void 0 && (L.style.fontFamily = Se(D.family)), o.theme === "editor" && s.name.local === "Toggle" && I.name === "unity-checkmark") {
2066
2066
  y(I.style, "background-color") || L.style.setProperty("background-color", "#2a2a2a");
2067
2067
  const M = ["top-left", "top-right", "bottom-left", "bottom-right"];
2068
2068
  M.some((j) => y(I.style, `border-${j}-radius`)) || (L.style.borderRadius = "2px");
@@ -2072,11 +2072,11 @@ function Bn(e, n, t, i, o, r) {
2072
2072
  }
2073
2073
  L.style.setProperty("box-shadow", "inset 0 1px 0 0 #0d0d0d, inset 1px 0 0 0 #212121, inset -1px 0 0 0 #212121, inset 0 -1px 0 0 #212121");
2074
2074
  }
2075
- if (s.name.local === "Toggle" && I.name === "unity-checkmark" && ((($ = r.checkedNodes) == null ? void 0 : $.has(s.id)) ?? s.attributes.some((M) => M.name === "value" && oe(M.value) === !0))) {
2076
- const M = r.document.createElementNS("http://www.w3.org/2000/svg", "svg");
2075
+ if (s.name.local === "Toggle" && I.name === "unity-checkmark" && ((($ = o.checkedNodes) == null ? void 0 : $.has(s.id)) ?? s.attributes.some((M) => M.name === "value" && re(M.value) === !0))) {
2076
+ const M = o.document.createElementNS("http://www.w3.org/2000/svg", "svg");
2077
2077
  M.setAttribute("viewBox", "0 0 24 24"), M.setAttribute("width", "100%"), M.setAttribute("height", "100%"), M.style.display = "block";
2078
- const j = r.document.createElementNS("http://www.w3.org/2000/svg", "path");
2079
- j.setAttribute("d", "M5 12 L10 17 L19 6"), j.setAttribute("fill", "none"), j.setAttribute("stroke", y(I.style, "-unity-background-image-tint-color") ? I.style.get("-unity-background-image-tint-color").value : r.theme === "editor" ? "#eeeeee" : ((T = I.style.get("-unity-background-image-tint-color")) == null ? void 0 : T.value) ?? "#323232"), j.setAttribute("stroke-width", "2.5"), j.setAttribute("stroke-linecap", "round"), j.setAttribute("stroke-linejoin", "round"), M.appendChild(j), L.appendChild(M);
2078
+ const j = o.document.createElementNS("http://www.w3.org/2000/svg", "path");
2079
+ j.setAttribute("d", "M5 12 L10 17 L19 6"), j.setAttribute("fill", "none"), j.setAttribute("stroke", y(I.style, "-unity-background-image-tint-color") ? I.style.get("-unity-background-image-tint-color").value : o.theme === "editor" ? "#eeeeee" : ((T = I.style.get("-unity-background-image-tint-color")) == null ? void 0 : T.value) ?? "#323232"), j.setAttribute("stroke-width", "2.5"), j.setAttribute("stroke-linecap", "round"), j.setAttribute("stroke-linejoin", "round"), M.appendChild(j), L.appendChild(M);
2080
2080
  }
2081
2081
  C.appendChild(L), F.push({ el: L, box: I.box, border: m(I) }), I.text !== void 0 ? (b(L, I.text, I.style, W), I.name === "unity-text-element--inner-input-field-component" && (L.style.whiteSpace = ((E = I.style.get("white-space")) == null ? void 0 : E.value) === "normal" ? "pre-wrap" : "pre")) : (C = L, O = I.box, R = m(I), V.fileChildrenHost !== "owner" && (A = { el: C, box: O, border: R }));
2082
2082
  }
@@ -2086,85 +2086,85 @@ function Bn(e, n, t, i, o, r) {
2086
2086
  U !== null && C.appendChild(U);
2087
2087
  }
2088
2088
  }
2089
- return c.set(s.id, h), h;
2089
+ return c.set(s.id, p), p;
2090
2090
  }
2091
- o.replaceChildren();
2091
+ r.replaceChildren();
2092
2092
  const S = k(e, null, { left: 0, top: 0 });
2093
- return S !== null && (S.style.setProperty("position", "relative"), o.appendChild(S)), { warnings: u, elements: c };
2093
+ return S !== null && (S.style.setProperty("position", "relative"), r.appendChild(S)), { warnings: u, elements: c };
2094
2094
  }
2095
- const ot = /[A-Za-z0-9_-]/;
2095
+ const rt = /[A-Za-z0-9_-]/;
2096
2096
  function pe(e) {
2097
2097
  return e === " " || e === " " || e === `
2098
2098
  ` || e === "\r" || e === "\f";
2099
2099
  }
2100
2100
  function Ue(e, n, t) {
2101
- let i = n, o = 0;
2101
+ let i = n, r = 0;
2102
2102
  for (; i < e.length; ) {
2103
- const r = e[i];
2104
- if (r === '"' || r === "'") {
2105
- const u = e.indexOf(r, i + 1);
2103
+ const o = e[i];
2104
+ if (o === '"' || o === "'") {
2105
+ const u = e.indexOf(o, i + 1);
2106
2106
  i = u < 0 ? e.length : u + 1;
2107
2107
  continue;
2108
2108
  }
2109
- if (r === "/" && e[i + 1] === "*") {
2109
+ if (o === "/" && e[i + 1] === "*") {
2110
2110
  const u = e.indexOf("*/", i + 2);
2111
2111
  i = u < 0 ? e.length : u + 2;
2112
2112
  continue;
2113
2113
  }
2114
- if (r === "(" || r === "[")
2115
- o++;
2116
- else if (r === ")" || r === "]")
2117
- o > 0 && o--;
2118
- else if (o === 0 && t.includes(r))
2114
+ if (o === "(" || o === "[")
2115
+ r++;
2116
+ else if (o === ")" || o === "]")
2117
+ r > 0 && r--;
2118
+ else if (r === 0 && t.includes(o))
2119
2119
  return i;
2120
2120
  i++;
2121
2121
  }
2122
2122
  return e.length;
2123
2123
  }
2124
2124
  function Ct(e, n, t) {
2125
- let i = n, o = t;
2126
- for (; i < o && pe(e[i]); ) i++;
2127
- for (; o > i && pe(e[o - 1]); ) o--;
2128
- return { start: i, end: o };
2125
+ let i = n, r = t;
2126
+ for (; i < r && pe(e[i]); ) i++;
2127
+ for (; r > i && pe(e[r - 1]); ) r--;
2128
+ return { start: i, end: r };
2129
2129
  }
2130
2130
  function Ot(e, n, t, i) {
2131
- const o = [];
2132
- let r = n;
2133
- for (; r < t; ) {
2134
- for (; r < t && (pe(e[r]) || e.startsWith("/*", r)); )
2135
- if (e.startsWith("/*", r)) {
2136
- const p = e.indexOf("*/", r + 2);
2137
- r = p < 0 ? t : p + 2;
2131
+ const r = [];
2132
+ let o = n;
2133
+ for (; o < t; ) {
2134
+ for (; o < t && (pe(e[o]) || e.startsWith("/*", o)); )
2135
+ if (e.startsWith("/*", o)) {
2136
+ const h = e.indexOf("*/", o + 2);
2137
+ o = h < 0 ? t : h + 2;
2138
2138
  } else
2139
- r++;
2140
- if (r >= t) break;
2141
- if (e[r] === ";") {
2142
- r++;
2139
+ o++;
2140
+ if (o >= t) break;
2141
+ if (e[o] === ";") {
2142
+ o++;
2143
2143
  continue;
2144
2144
  }
2145
- const u = r, c = Ue(e, u, ":;}");
2145
+ const u = o, c = Ue(e, u, ":;}");
2146
2146
  if (c >= t || e[c] !== ":") {
2147
- const p = Math.min(c, t);
2148
- i == null || i("declaration without a value", u, p), r = p + 1;
2147
+ const h = Math.min(c, t);
2148
+ i == null || i("declaration without a value", u, h), o = h + 1;
2149
2149
  continue;
2150
2150
  }
2151
2151
  const g = Math.min(Ue(e, c + 1, ";}"), t), m = Ct(e, c + 1, g);
2152
- o.push({
2152
+ r.push({
2153
2153
  property: e.slice(u, c).trim(),
2154
2154
  value: e.slice(m.start, m.end),
2155
2155
  span: { start: u, end: m.end },
2156
2156
  dirty: !1
2157
- }), r = g + 1;
2157
+ }), o = g + 1;
2158
2158
  }
2159
- return o;
2159
+ return r;
2160
2160
  }
2161
2161
  function Pn(e) {
2162
2162
  const n = e.span.end - 1 - e.value.length;
2163
2163
  return n < e.span.start ? null : n;
2164
2164
  }
2165
2165
  function Ye(e, n = null, t = 0) {
2166
- const i = [], o = [];
2167
- let r = 0;
2166
+ const i = [], r = [];
2167
+ let o = 0;
2168
2168
  function u(l, a, f) {
2169
2169
  i.push({
2170
2170
  kind: "malformed",
@@ -2174,95 +2174,95 @@ function Ye(e, n = null, t = 0) {
2174
2174
  }
2175
2175
  function c() {
2176
2176
  for (; ; ) {
2177
- for (; pe(e[r]); ) r++;
2178
- if (e.startsWith("/*", r)) {
2179
- const l = e.indexOf("*/", r + 2);
2180
- r = l < 0 ? e.length : l + 2;
2177
+ for (; pe(e[o]); ) o++;
2178
+ if (e.startsWith("/*", o)) {
2179
+ const l = e.indexOf("*/", o + 2);
2180
+ o = l < 0 ? e.length : l + 2;
2181
2181
  continue;
2182
2182
  }
2183
2183
  return;
2184
2184
  }
2185
2185
  }
2186
2186
  const g = (l, a) => Ue(e, l, a), m = (l, a) => Ct(e, l, a);
2187
- function p(l) {
2187
+ function h(l) {
2188
2188
  let a = l + 1, f = 1;
2189
2189
  for (; a < e.length; ) {
2190
- const h = e[a];
2191
- if (h === '"' || h === "'") {
2192
- const w = e.indexOf(h, a + 1);
2190
+ const p = e[a];
2191
+ if (p === '"' || p === "'") {
2192
+ const w = e.indexOf(p, a + 1);
2193
2193
  a = w < 0 ? e.length : w + 1;
2194
2194
  continue;
2195
2195
  }
2196
- if (h === "/" && e[a + 1] === "*") {
2196
+ if (p === "/" && e[a + 1] === "*") {
2197
2197
  const w = e.indexOf("*/", a + 2);
2198
2198
  a = w < 0 ? e.length : w + 2;
2199
2199
  continue;
2200
2200
  }
2201
- if (h === "{") f++;
2202
- else if (h === "}" && --f === 0) return a + 1;
2201
+ if (p === "{") f++;
2202
+ else if (p === "}" && --f === 0) return a + 1;
2203
2203
  a++;
2204
2204
  }
2205
2205
  return e.length;
2206
2206
  }
2207
2207
  function d(l) {
2208
2208
  let a = l;
2209
- for (; a < e.length && ot.test(e[a]); ) a++;
2209
+ for (; a < e.length && rt.test(e[a]); ) a++;
2210
2210
  return a;
2211
2211
  }
2212
2212
  function b(l) {
2213
2213
  const a = e[l], f = a === "(" ? ")" : "]";
2214
- let h = l + 1, w = 1;
2215
- for (; h < e.length; ) {
2216
- const _ = e[h];
2214
+ let p = l + 1, w = 1;
2215
+ for (; p < e.length; ) {
2216
+ const _ = e[p];
2217
2217
  if (_ === '"' || _ === "'") {
2218
- const N = e.indexOf(_, h + 1);
2219
- h = N < 0 ? e.length : N + 1;
2218
+ const N = e.indexOf(_, p + 1);
2219
+ p = N < 0 ? e.length : N + 1;
2220
2220
  continue;
2221
2221
  }
2222
2222
  if (_ === a) w++;
2223
- else if (_ === f && --w === 0) return h + 1;
2224
- h++;
2223
+ else if (_ === f && --w === 0) return p + 1;
2224
+ p++;
2225
2225
  }
2226
2226
  return e.length;
2227
2227
  }
2228
2228
  function y(l, a) {
2229
2229
  const f = [];
2230
- let h = l;
2231
- for (; h < a; ) {
2232
- const w = e[h];
2230
+ let p = l;
2231
+ for (; p < a; ) {
2232
+ const w = e[p];
2233
2233
  if (pe(w) || w === ">" || w === "+" || w === "~" || w === ",") break;
2234
2234
  if (w === "*")
2235
- f.push({ kind: "universal" }), h++;
2235
+ f.push({ kind: "universal" }), p++;
2236
2236
  else if (w === "." || w === "#") {
2237
- const _ = d(h + 1);
2237
+ const _ = d(p + 1);
2238
2238
  f.push(
2239
- w === "." ? { kind: "class", name: e.slice(h + 1, _) } : { kind: "name", name: e.slice(h + 1, _) }
2240
- ), h = _;
2239
+ w === "." ? { kind: "class", name: e.slice(p + 1, _) } : { kind: "name", name: e.slice(p + 1, _) }
2240
+ ), p = _;
2241
2241
  } else if (w === "[") {
2242
- const _ = Math.min(b(h), a);
2243
- f.push({ kind: "unknown", text: e.slice(h, _) }), h = _;
2242
+ const _ = Math.min(b(p), a);
2243
+ f.push({ kind: "unknown", text: e.slice(p, _) }), p = _;
2244
2244
  } else if (w === ":")
2245
- if (e[h + 1] === ":") {
2246
- const _ = d(h + 2);
2247
- f.push({ kind: "unknown", text: e.slice(h, _) }), h = _;
2245
+ if (e[p + 1] === ":") {
2246
+ const _ = d(p + 2);
2247
+ f.push({ kind: "unknown", text: e.slice(p, _) }), p = _;
2248
2248
  } else {
2249
- const _ = d(h + 1);
2249
+ const _ = d(p + 1);
2250
2250
  if (e[_] === "(") {
2251
2251
  const N = Math.min(b(_), a);
2252
- f.push({ kind: "unknown", text: e.slice(h, N) }), h = N;
2252
+ f.push({ kind: "unknown", text: e.slice(p, N) }), p = N;
2253
2253
  } else
2254
- f.push({ kind: "pseudo", name: e.slice(h + 1, _) }), h = _;
2254
+ f.push({ kind: "pseudo", name: e.slice(p + 1, _) }), p = _;
2255
2255
  }
2256
- else if (ot.test(w)) {
2257
- const _ = d(h);
2258
- f.push({ kind: "type", name: e.slice(h, _) }), h = _;
2256
+ else if (rt.test(w)) {
2257
+ const _ = d(p);
2258
+ f.push({ kind: "type", name: e.slice(p, _) }), p = _;
2259
2259
  } else
2260
- f.push({ kind: "unknown", text: w }), h++;
2260
+ f.push({ kind: "unknown", text: w }), p++;
2261
2261
  }
2262
- return { simple: f, next: h };
2262
+ return { simple: f, next: p };
2263
2263
  }
2264
2264
  function x(l, a) {
2265
- const f = m(l, a), h = [];
2265
+ const f = m(l, a), p = [];
2266
2266
  let w = "descendant", _ = null, N = f.start;
2267
2267
  for (; N < f.end; ) {
2268
2268
  const z = e[N];
@@ -2283,52 +2283,52 @@ function Ye(e, n = null, t = 0) {
2283
2283
  N++;
2284
2284
  continue;
2285
2285
  }
2286
- _ !== null && (H.unshift({ kind: "unknown", text: _ }), _ = null), h.push({ combinator: w, simple: H }), w = "descendant", N = V;
2286
+ _ !== null && (H.unshift({ kind: "unknown", text: _ }), _ = null), p.push({ combinator: w, simple: H }), w = "descendant", N = V;
2287
2287
  }
2288
- return { parts: h, span: f };
2288
+ return { parts: p, span: f };
2289
2289
  }
2290
2290
  function k(l, a) {
2291
2291
  const f = [];
2292
- let h = l;
2292
+ let p = l;
2293
2293
  for (; ; ) {
2294
- const w = Math.min(g(h, ","), a);
2295
- if (f.push(x(h, w)), w >= a) break;
2296
- h = w + 1;
2294
+ const w = Math.min(g(p, ","), a);
2295
+ if (f.push(x(p, w)), w >= a) break;
2296
+ p = w + 1;
2297
2297
  }
2298
2298
  return f;
2299
2299
  }
2300
2300
  function S() {
2301
- const l = r, a = d(r + 1), f = e.slice(r + 1, a), h = g(a, "{;");
2302
- if (h < e.length && e[h] === "{") {
2303
- const _ = p(h);
2304
- return r = _, { kind: "unknown", span: { start: l, end: _ } };
2301
+ const l = o, a = d(o + 1), f = e.slice(o + 1, a), p = g(a, "{;");
2302
+ if (p < e.length && e[p] === "{") {
2303
+ const _ = h(p);
2304
+ return o = _, { kind: "unknown", span: { start: l, end: _ } };
2305
2305
  }
2306
- const w = h < e.length ? h + 1 : e.length;
2307
- if (r = w, f === "import") {
2306
+ const w = p < e.length ? p + 1 : e.length;
2307
+ if (o = w, f === "import") {
2308
2308
  const _ = e.slice(a, w), N = /["']([^"']*)["']/.exec(_);
2309
2309
  return N === null ? (u("@import without a quoted path", l, w), { kind: "unknown", span: { start: l, end: w } }) : { kind: "import", url: N[1], span: { start: l, end: w } };
2310
2310
  }
2311
2311
  return { kind: "unknown", span: { start: l, end: w } };
2312
2312
  }
2313
2313
  function s() {
2314
- const l = r, a = g(l, "{");
2314
+ const l = o, a = g(l, "{");
2315
2315
  if (a >= e.length)
2316
- return u("rule without a block", l, e.length), r = e.length, { kind: "unknown", span: { start: l, end: e.length } };
2317
- const f = m(l, a), h = p(a);
2318
- (h > e.length || e[h - 1] !== "}") && u("unterminated rule block", l, h);
2316
+ return u("rule without a block", l, e.length), o = e.length, { kind: "unknown", span: { start: l, end: e.length } };
2317
+ const f = m(l, a), p = h(a);
2318
+ (p > e.length || e[p - 1] !== "}") && u("unterminated rule block", l, p);
2319
2319
  const w = {
2320
2320
  selectors: k(f.start, f.end),
2321
- declarations: Ot(e, a + 1, h - 1, u),
2322
- span: { start: f.start, end: h },
2321
+ declarations: Ot(e, a + 1, p - 1, u),
2322
+ span: { start: f.start, end: p },
2323
2323
  selectorSpan: f,
2324
2324
  selectorDirty: !1,
2325
2325
  declarationsDirty: !1
2326
2326
  };
2327
- return r = h, { kind: "rule", rule: w };
2327
+ return o = p, { kind: "rule", rule: w };
2328
2328
  }
2329
- for (; c(), !(r >= e.length); )
2330
- o.push(e[r] === "@" ? S() : s());
2331
- return { sheet: { source: e, origin: n, items: o }, warnings: i };
2329
+ for (; c(), !(o >= e.length); )
2330
+ r.push(e[o] === "@" ? S() : s());
2331
+ return { sheet: { source: e, origin: n, items: r }, warnings: i };
2332
2332
  }
2333
2333
  const Hn = {
2334
2334
  measuredTextLayout: "Measured layout effect in Unity probes, 2026-10-15/16 (tests/text-cohort/unity and tests/layout/unity); auto-size grew 32x15 to 99x49 on 6000.3.25f1",
@@ -2462,14 +2462,14 @@ const Hn = {
2462
2462
  ["width", "6000.0", !1, "layout", "layout", "yoga"],
2463
2463
  ["word-spacing", "6000.0", !0, "layout", "layout", "measuredTextLayout"]
2464
2464
  ], Rt = Vn.map(
2465
- ([e, n, t, i, o, r]) => ({
2465
+ ([e, n, t, i, r, o]) => ({
2466
2466
  name: e,
2467
2467
  since: n,
2468
2468
  inherited: t,
2469
2469
  handling: i,
2470
- unity: o,
2471
- basis: Hn[r],
2472
- inferred: r.endsWith("Inferred")
2470
+ unity: r,
2471
+ basis: Hn[o],
2472
+ inferred: o.endsWith("Inferred")
2473
2473
  })
2474
2474
  ), Gn = new Map(Rt.map((e) => [e.name, e]));
2475
2475
  function Kn(e) {
@@ -2529,20 +2529,20 @@ function At(e, n) {
2529
2529
  return { reason: "invalid-value", message: "opacity: Unity reads 50% as 50 (fully opaque), this preview draws it half-transparent", subject: i };
2530
2530
  if (n.trim() === "inherit")
2531
2531
  return { reason: "invalid-value", message: `${e}: USS has initial but not inherit; Unity resolved color: inherit to transparent`, subject: i };
2532
- const o = t.unity === "layout", r = t.since === "6000.0" ? "" : ` (${Xn(t.since)})`;
2533
- return t.handling === "paint" && o ? {
2534
- message: `${e}${r}: drawn, but left out of text measurement by this preview`,
2532
+ const r = t.unity === "layout", o = t.since === "6000.0" ? "" : ` (${Xn(t.since)})`;
2533
+ return t.handling === "paint" && r ? {
2534
+ message: `${e}${o}: drawn, but left out of text measurement by this preview`,
2535
2535
  reason: "not-rendered",
2536
- subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: o, applied: "paint" }
2536
+ subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: r, applied: "paint" }
2537
2537
  } : t.handling !== "none" ? null : {
2538
- message: `${e}${r}: ${qn[e] ?? "not drawn by this preview"}` + (e === "filter" && /[\w-]+\(/.test(n) ? "; Unity 6000.0 stops styling from this element on" : ""),
2538
+ message: `${e}${o}: ${qn[e] ?? "not drawn by this preview"}` + (e === "filter" && /[\w-]+\(/.test(n) ? "; Unity 6000.0 stops styling from this element on" : ""),
2539
2539
  reason: "not-rendered",
2540
2540
  subject: {
2541
2541
  kind: "property",
2542
2542
  property: e,
2543
2543
  value: n,
2544
2544
  since: t.since,
2545
- affectsLayout: o,
2545
+ affectsLayout: r,
2546
2546
  // Same probes/dumps, measured 2026-10-15: filter functions poison 6000.0 only.
2547
2547
  ...e === "filter" && /[\w-]+\(/.test(n) ? { unityEffect: { kind: "unstyled-from-here", versions: ["6000.0"] } } : {}
2548
2548
  }
@@ -2552,18 +2552,18 @@ const xe = ["hover", "active", "inactive", "focus", "disabled", "enabled", "chec
2552
2552
  function Qn(e) {
2553
2553
  return e.startsWith("--") || Zn.has(e);
2554
2554
  }
2555
- function rt(e) {
2555
+ function ot(e) {
2556
2556
  const n = [];
2557
2557
  let t = 0, i = -1;
2558
- for (let o = 0; o < e.length; o++) {
2559
- const r = e[o];
2560
- r === "(" ? t++ : r === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(r) ? i >= 0 && (n.push(e.slice(i, o)), i = -1) : i < 0 && (i = o);
2558
+ for (let r = 0; r < e.length; r++) {
2559
+ const o = e[r];
2560
+ o === "(" ? t++ : o === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(o) ? i >= 0 && (n.push(e.slice(i, r)), i = -1) : i < 0 && (i = r);
2561
2561
  }
2562
2562
  return i >= 0 && n.push(e.slice(i)), n;
2563
2563
  }
2564
2564
  function ei(e) {
2565
- const [n, t, i, o] = e;
2566
- return n === void 0 ? null : t === void 0 ? [n, n, n, n] : i === void 0 ? [n, t, n, t] : o === void 0 ? [n, t, i, t] : [n, t, i, o];
2565
+ const [n, t, i, r] = e;
2566
+ return n === void 0 ? null : t === void 0 ? [n, n, n, n] : i === void 0 ? [n, t, n, t] : r === void 0 ? [n, t, i, t] : [n, t, i, r];
2567
2567
  }
2568
2568
  const ti = {
2569
2569
  margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
@@ -2596,11 +2596,11 @@ function ni(e) {
2596
2596
  return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : t === void 0 ? st(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : i === void 0 ? st(t) ? [["flex-grow", n], ["flex-shrink", t], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", t]] : [["flex-grow", n], ["flex-shrink", t], ["flex-basis", i]];
2597
2597
  }
2598
2598
  function De(e, n) {
2599
- if (e === "flex") return ni(rt(n));
2599
+ if (e === "flex") return ni(ot(n));
2600
2600
  const t = ti[e];
2601
2601
  if (t === void 0) return [[e, n]];
2602
- const i = ei(rt(n));
2603
- return i === null ? [[e, n]] : t.map((o, r) => [o, i[r]]);
2602
+ const i = ei(ot(n));
2603
+ return i === null ? [[e, n]] : t.map((r, o) => [r, i[o]]);
2604
2604
  }
2605
2605
  function ii(e, n, t) {
2606
2606
  switch (e.kind) {
@@ -2618,17 +2618,17 @@ function ii(e, n, t) {
2618
2618
  return !1;
2619
2619
  }
2620
2620
  }
2621
- function oi(e, n, t) {
2621
+ function ri(e, n, t) {
2622
2622
  return e.simple.every((i) => ii(i, n, t));
2623
2623
  }
2624
2624
  function Be(e, n, t, i) {
2625
- if (!oi(e[n], t, i)) return !1;
2625
+ if (!ri(e[n], t, i)) return !1;
2626
2626
  if (n === 0) return !0;
2627
- const o = i.parentOf(t);
2627
+ const r = i.parentOf(t);
2628
2628
  if (e[n].combinator === "child")
2629
- return o !== null && Be(e, n - 1, o, i);
2630
- for (let r = o; r !== null; r = i.parentOf(r))
2631
- if (Be(e, n - 1, r, i)) return !0;
2629
+ return r !== null && Be(e, n - 1, r, i);
2630
+ for (let o = r; o !== null; o = i.parentOf(o))
2631
+ if (Be(e, n - 1, o, i)) return !0;
2632
2632
  return !1;
2633
2633
  }
2634
2634
  function Pe(e, n, t) {
@@ -2641,14 +2641,14 @@ function Ft(e) {
2641
2641
  i.kind === "pseudo" && i.name !== "root" && !n.includes(i.name) && n.push(i.name);
2642
2642
  return n;
2643
2643
  }
2644
- function ri(e) {
2644
+ function oi(e) {
2645
2645
  const n = [];
2646
2646
  for (const t of e)
2647
2647
  for (const i of t.parts)
2648
- for (const o of i.simple) {
2649
- if (o.kind !== "name" && o.kind !== "class" || !o.name.startsWith("unity-")) continue;
2650
- const r = o.kind === "name" ? `#${o.name}` : `.${o.name}`;
2651
- n.includes(r) || n.push(r);
2648
+ for (const r of i.simple) {
2649
+ if (r.kind !== "name" && r.kind !== "class" || !r.name.startsWith("unity-")) continue;
2650
+ const o = r.kind === "name" ? `#${r.name}` : `.${r.name}`;
2651
+ n.includes(o) || n.push(o);
2652
2652
  }
2653
2653
  return n;
2654
2654
  }
@@ -2663,16 +2663,16 @@ function si(e) {
2663
2663
  const n = /* @__PURE__ */ new Map([[e, null]]), t = [e];
2664
2664
  for (; t.length > 0; ) {
2665
2665
  const i = t.pop();
2666
- for (const o of i.children)
2667
- n.set(o, i), t.push(o);
2666
+ for (const r of i.children)
2667
+ n.set(r, i), t.push(r);
2668
2668
  }
2669
2669
  return n;
2670
2670
  }
2671
2671
  function ai(e) {
2672
2672
  let n = 0, t = 0, i = 0;
2673
- for (const o of e.parts)
2674
- for (const r of o.simple)
2675
- switch (r.kind) {
2673
+ for (const r of e.parts)
2674
+ for (const o of r.simple)
2675
+ switch (o.kind) {
2676
2676
  case "name":
2677
2677
  n++;
2678
2678
  break;
@@ -2702,8 +2702,8 @@ function ci(e, n) {
2702
2702
  return pt[n].slice(e.selectorSpan.start, e.selectorSpan.end).trim();
2703
2703
  }
2704
2704
  function di(e, n, t, i) {
2705
- const o = (t == null ? void 0 : t.activeStates) ?? /* @__PURE__ */ new Set(), r = Object.entries((t == null ? void 0 : t.states) ?? {}), u = [];
2706
- for (const [d, b] of r) {
2705
+ const r = (t == null ? void 0 : t.activeStates) ?? /* @__PURE__ */ new Set(), o = Object.entries((t == null ? void 0 : t.states) ?? {}), u = [];
2706
+ for (const [d, b] of o) {
2707
2707
  const y = Ye(`${d} {}`, null, -1).sheet.items.find((s) => s.kind === "rule"), x = y === void 0 ? d : Lt(y.rule.selectors);
2708
2708
  if (y === void 0 || x !== null) {
2709
2709
  i.push({
@@ -2733,37 +2733,37 @@ function di(e, n, t, i) {
2733
2733
  });
2734
2734
  u.push({ selectors: k, states: b.filter((s) => xe.includes(s)) });
2735
2735
  }
2736
- const c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), m = (d) => d.attributes.some((b) => b.name === "enabled" && oe(b.value) === !1), p = (d, b) => {
2737
- const y = b || m(d), x = new Set([...o].filter((k) => xe.includes(k)));
2736
+ const c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), m = (d) => d.attributes.some((b) => b.name === "enabled" && re(b.value) === !1), h = (d, b) => {
2737
+ const y = b || m(d), x = new Set([...r].filter((k) => xe.includes(k)));
2738
2738
  y && g.add(d), y ? x.add("disabled") : x.add("enabled");
2739
2739
  for (const k of u)
2740
2740
  if (k.selectors.some((S) => Pe(S, { kind: "element", node: d }, n)))
2741
2741
  for (const S of k.states) x.add(S);
2742
- x.has("disabled") && x.delete("enabled"), (d.name.local === "Toggle" || d.name.local === "RadioButton") && d.attributes.some((k) => k.name === "value" && oe(k.value) === !0) && x.add("checked"), c.set(d, x);
2743
- for (const k of d.children) p(k, y);
2742
+ x.has("disabled") && x.delete("enabled"), (d.name.local === "Toggle" || d.name.local === "RadioButton") && d.attributes.some((k) => k.name === "value" && re(k.value) === !0) && x.add("checked"), c.set(d, x);
2743
+ for (const k of d.children) h(k, y);
2744
2744
  };
2745
- return p(e.root, !1), { states: c, disabledSubtree: g };
2745
+ return h(e.root, !1), { states: c, disabledSubtree: g };
2746
2746
  }
2747
2747
  function fi(e, n) {
2748
2748
  const t = [], i = /* @__PURE__ */ new Map();
2749
2749
  e.sheets.forEach((c, g) => {
2750
2750
  c.origin !== null && !i.has(c.origin) && i.set(c.origin, g);
2751
2751
  }), t.push(...ui[n]);
2752
- const o = /* @__PURE__ */ new Map(), r = (c, g) => {
2753
- const m = o.get(g) ?? /* @__PURE__ */ new Set();
2752
+ const r = /* @__PURE__ */ new Map(), o = (c, g) => {
2753
+ const m = r.get(g) ?? /* @__PURE__ */ new Set();
2754
2754
  if (m.has(c)) return;
2755
- m.add(c), o.set(g, m);
2756
- const p = e.sheets[c];
2757
- p !== void 0 && p.items.forEach((d, b) => {
2755
+ m.add(c), r.set(g, m);
2756
+ const h = e.sheets[c];
2757
+ h !== void 0 && h.items.forEach((d, b) => {
2758
2758
  if (d.kind === "rule")
2759
2759
  t.push({ rule: d.rule, sheet: c, item: b, scope: g });
2760
2760
  else if (d.kind === "import") {
2761
2761
  const y = d.resolvedSheet ?? i.get(d.url);
2762
- y !== void 0 && r(y, g);
2762
+ y !== void 0 && o(y, g);
2763
2763
  }
2764
2764
  });
2765
2765
  }, u = e.styleRoots ?? (e.sheets.length === 0 ? [] : [{ sheet: 0, scope: e.root.id }]);
2766
- for (const c of u) r(c.sheet, c.scope);
2766
+ for (const c of u) o(c.sheet, c.scope);
2767
2767
  return t;
2768
2768
  }
2769
2769
  function pi(e, n, t) {
@@ -2784,8 +2784,8 @@ function _e(e, n) {
2784
2784
  const t = n.rule.selectorSpan;
2785
2785
  return ((i = e.sheets[n.sheet]) == null ? void 0 : i.source.slice(t.start, t.end)) ?? "";
2786
2786
  }
2787
- function re(e, n) {
2788
- const t = e.sheets[n], i = e.sheets.find((o) => o.items.some((r) => r.kind === "import" && r.resolvedSheet === n));
2787
+ function oe(e, n) {
2788
+ const t = e.sheets[n], i = e.sheets.find((r) => r.items.some((o) => o.kind === "import" && o.resolvedSheet === n));
2789
2789
  return { url: (t == null ? void 0 : t.origin) ?? null, from: (t == null ? void 0 : t.sourceDocumentFrom) ?? (i == null ? void 0 : i.origin) ?? null };
2790
2790
  }
2791
2791
  function le(e, n) {
@@ -2794,7 +2794,7 @@ function le(e, n) {
2794
2794
  return typeof t == "string" ? { sourceDocument: t } : {};
2795
2795
  }
2796
2796
  function jt(e, n) {
2797
- const t = (n == null ? void 0 : n.theme) ?? $e, i = si(e.root), o = [], r = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), c = (s) => {
2797
+ const t = (n == null ? void 0 : n.theme) ?? $e, i = si(e.root), r = [], o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), c = (s) => {
2798
2798
  var a;
2799
2799
  const l = (a = s.attributes.find((f) => f.name === "class")) == null ? void 0 : a.value;
2800
2800
  return l === void 0 ? [] : l.split(/\s+/).filter((f) => f.length > 0);
@@ -2838,16 +2838,16 @@ function jt(e, n) {
2838
2838
  var l;
2839
2839
  return s.kind === "element" ? [...c(s.node), ...sn(s.node)] : ((l = Z(s.owner).spec.parts[s.depth]) == null ? void 0 : l.classes) ?? [];
2840
2840
  }
2841
- }, p = { ...m, statesOf: () => u }, { states: d, disabledSubtree: b } = di(e, p, n, o), y = {
2841
+ }, h = { ...m, statesOf: () => u }, { states: d, disabledSubtree: b } = di(e, h, n, r), y = {
2842
2842
  ...m,
2843
2843
  // e-{toggle,radio,disabled}.json (6000.3.25f1, both themes): forced
2844
2844
  // states belong only to the matched element. SetEnabled disables all parts;
2845
2845
  // the value's Checked bit belongs only to the control and its input.
2846
2846
  statesOf: (s) => {
2847
- var f, h;
2847
+ var f, p;
2848
2848
  if (s.kind === "element") return d.get(s.node) ?? u;
2849
2849
  const l = /* @__PURE__ */ new Set([b.has(s.owner) ? "disabled" : "enabled"]), a = Z(s.owner).spec.parts[s.depth];
2850
- return (s.owner.name.local === "Toggle" || s.owner.name.local === "RadioButton") && ((f = a == null ? void 0 : a.classes) != null && f.includes(s.owner.name.local === "Toggle" ? "unity-toggle__input" : "unity-radio-button__input")) && ((h = d.get(s.owner)) != null && h.has("checked")) && l.add("checked"), l;
2850
+ return (s.owner.name.local === "Toggle" || s.owner.name.local === "RadioButton") && ((f = a == null ? void 0 : a.classes) != null && f.includes(s.owner.name.local === "Toggle" ? "unity-toggle__input" : "unity-radio-button__input")) && ((p = d.get(s.owner)) != null && p.has("checked")) && l.add("checked"), l;
2851
2851
  }
2852
2852
  }, x = [];
2853
2853
  let k = !1;
@@ -2858,23 +2858,23 @@ function jt(e, n) {
2858
2858
  }
2859
2859
  const l = Lt(s.rule.selectors);
2860
2860
  if (l !== null) {
2861
- o.push({
2861
+ r.push({
2862
2862
  kind: "unsupported-selector",
2863
2863
  message: `"${l}": the whole rule is ignored`,
2864
- at: { in: "uss", sheet: s.sheet, ...re(e, s.sheet), span: s.rule.selectorSpan },
2864
+ at: { in: "uss", sheet: s.sheet, ...oe(e, s.sheet), span: s.rule.selectorSpan },
2865
2865
  reason: "not-uss",
2866
2866
  subject: { kind: "selector", selector: _e(e, s), fragment: l },
2867
2867
  ...le(e, s.sheet)
2868
2868
  });
2869
2869
  continue;
2870
2870
  }
2871
- !k && hi(s.rule) && (k = !0, o.push({
2871
+ !k && hi(s.rule) && (k = !0, r.push({
2872
2872
  kind: "version-dependent",
2873
2873
  // Not a version difference: USS :root means something else than CSS
2874
2874
  // :root, and this preview does what Unity does. Kept as a warning so
2875
2875
  // an author porting CSS is told; the kind stays for compatibility.
2876
2876
  message: ":root matched the element this stylesheet is attached to — the document root, or the TemplateContainer of a template",
2877
- at: { in: "uss", sheet: s.sheet, ...re(e, s.sheet), span: s.rule.selectorSpan },
2877
+ at: { in: "uss", sheet: s.sheet, ...oe(e, s.sheet), span: s.rule.selectorSpan },
2878
2878
  reason: "matches-unity",
2879
2879
  subject: { kind: "selector", selector: _e(e, s), fragment: ":root" },
2880
2880
  ...le(e, s.sheet)
@@ -2888,85 +2888,85 @@ function jt(e, n) {
2888
2888
  S.add(l);
2889
2889
  const a = /* @__PURE__ */ new Set();
2890
2890
  for (const f of s.rule.selectors)
2891
- for (const h of f.parts)
2892
- for (const w of h.simple)
2891
+ for (const p of f.parts)
2892
+ for (const w of p.simple)
2893
2893
  w.kind !== "pseudo" || w.name === "root" || xe.includes(w.name) || a.add(w.name);
2894
2894
  for (const f of a)
2895
- o.push({
2895
+ r.push({
2896
2896
  kind: "unsupported-selector",
2897
2897
  message: `":${f}": never matches; Unity sets no such state`,
2898
- at: { in: "uss", sheet: s.sheet, ...re(e, s.sheet), span: s.rule.selectorSpan },
2898
+ at: { in: "uss", sheet: s.sheet, ...oe(e, s.sheet), span: s.rule.selectorSpan },
2899
2899
  ...le(e, s.sheet),
2900
2900
  reason: "not-uss",
2901
2901
  subject: { kind: "selector", selector: _e(e, s), fragment: `:${f}` }
2902
2902
  });
2903
2903
  for (const f of s.rule.declarations) {
2904
- const h = At(f.property, f.value);
2905
- if (h === null) continue;
2904
+ const p = At(f.property, f.value);
2905
+ if (p === null) continue;
2906
2906
  const w = {
2907
2907
  kind: "unsupported-property",
2908
- ...h,
2909
- at: { in: "uss", sheet: s.sheet, ...re(e, s.sheet), span: f.span },
2908
+ ...p,
2909
+ at: { in: "uss", sheet: s.sheet, ...oe(e, s.sheet), span: f.span },
2910
2910
  ...le(e, s.sheet)
2911
2911
  };
2912
- o.push(w), r.set(w, `${s.sheet}:${s.item}`);
2912
+ r.push(w), o.set(w, `${s.sheet}:${s.item}`);
2913
2913
  }
2914
2914
  }
2915
2915
  return e.sheets.forEach((s, l) => {
2916
2916
  var a;
2917
2917
  for (const f of s.items) {
2918
2918
  if (f.kind !== "unknown") continue;
2919
- const h = (a = /^@([A-Za-z][\w-]*)/.exec(s.source.slice(f.span.start, f.span.end))) == null ? void 0 : a[1];
2920
- h === void 0 || h === "import" || o.push({
2919
+ const p = (a = /^@([A-Za-z][\w-]*)/.exec(s.source.slice(f.span.start, f.span.end))) == null ? void 0 : a[1];
2920
+ p === void 0 || p === "import" || r.push({
2921
2921
  kind: "unsupported-selector",
2922
- message: `@${h}: block ignored`,
2923
- at: { in: "uss", sheet: l, ...re(e, l), span: f.span },
2922
+ message: `@${p}: block ignored`,
2923
+ at: { in: "uss", sheet: l, ...oe(e, l), span: f.span },
2924
2924
  ...le(e, l),
2925
2925
  reason: "not-uss",
2926
- subject: { kind: "at-rule", name: h }
2926
+ subject: { kind: "at-rule", name: p }
2927
2927
  });
2928
2928
  }
2929
- }), { theme: t, ctx: y, usable: x, warnings: o, declarationWarnings: r };
2929
+ }), { theme: t, ctx: y, usable: x, warnings: r, declarationWarnings: o };
2930
2930
  }
2931
2931
  function qe(e, n) {
2932
- const t = n.attributes.find((o) => o.name === "style");
2932
+ const t = n.attributes.find((r) => r.name === "style");
2933
2933
  if (t === void 0) return [];
2934
2934
  const i = Pn(t);
2935
2935
  return i === null ? [] : Ot(e.source, i, i + t.value.length);
2936
2936
  }
2937
2937
  function mi(e, n) {
2938
2938
  let t = null;
2939
- const i = (o, r) => {
2939
+ const i = (r, o) => {
2940
2940
  var u;
2941
- typeof o.sourceDocument != "string" && r.set(((u = o.derived) == null ? void 0 : u.instance) ?? o.id, o);
2942
- for (const c of o.children) i(c, r);
2943
- return r;
2941
+ typeof r.sourceDocument != "string" && o.set(((u = r.derived) == null ? void 0 : u.instance) ?? r.id, r);
2942
+ for (const c of r.children) i(c, o);
2943
+ return o;
2944
2944
  };
2945
- return (o) => {
2946
- var r;
2947
- if (o.kind === "rule") {
2948
- const u = (r = e.sheets[o.sheet]) == null ? void 0 : r.items[o.item], c = (u == null ? void 0 : u.kind) === "rule" ? u.rule.declarations[o.declIndex] : void 0;
2949
- return c === void 0 ? {} : { nodes: [...n.get(`${o.sheet}:${o.item}`) ?? []], at: { in: "uss", sheet: o.sheet, ...re(e, o.sheet), span: c.span }, ...le(e, o.sheet) };
2950
- }
2951
- if (o.kind === "inline") {
2952
- if (typeof o.sourceDocument == "string") return { sourceDocument: o.sourceDocument };
2945
+ return (r) => {
2946
+ var o;
2947
+ if (r.kind === "rule") {
2948
+ const u = (o = e.sheets[r.sheet]) == null ? void 0 : o.items[r.item], c = (u == null ? void 0 : u.kind) === "rule" ? u.rule.declarations[r.declIndex] : void 0;
2949
+ return c === void 0 ? {} : { nodes: [...n.get(`${r.sheet}:${r.item}`) ?? []], at: { in: "uss", sheet: r.sheet, ...oe(e, r.sheet), span: c.span }, ...le(e, r.sheet) };
2950
+ }
2951
+ if (r.kind === "inline") {
2952
+ if (typeof r.sourceDocument == "string") return { sourceDocument: r.sourceDocument };
2953
2953
  t ?? (t = i(e.root, /* @__PURE__ */ new Map()));
2954
- const u = t.get(o.node), c = u === void 0 ? void 0 : qe(e, u)[o.declIndex];
2954
+ const u = t.get(r.node), c = u === void 0 ? void 0 : qe(e, u)[r.declIndex];
2955
2955
  return c === void 0 ? {} : { at: { in: "uxml", span: c.span } };
2956
2956
  }
2957
2957
  return {};
2958
2958
  };
2959
2959
  }
2960
- function zt(e, n, t, i, o) {
2961
- const r = [];
2960
+ function zt(e, n, t, i, r) {
2961
+ const o = [];
2962
2962
  let u = 0;
2963
- const c = (g, m, p, d, b) => {
2964
- r.push({ property: g, value: m, origin: p, rank: d, specificity: b, order: u++, winner: !1 });
2963
+ const c = (g, m, h, d, b) => {
2964
+ o.push({ property: g, value: m, origin: h, rank: d, specificity: b, order: u++, winner: !1 });
2965
2965
  };
2966
2966
  if (n.kind === "part") {
2967
2967
  const g = Z(n.owner).spec.parts[n.depth];
2968
- for (const [m, p] of Object.entries((g == null ? void 0 : g.style) ?? {}))
2969
- for (const [d, b] of De(m, p))
2968
+ for (const [m, h] of Object.entries((g == null ? void 0 : g.style) ?? {}))
2969
+ for (const [d, b] of De(m, h))
2970
2970
  c(
2971
2971
  d,
2972
2972
  b,
@@ -2989,16 +2989,16 @@ function zt(e, n, t, i, o) {
2989
2989
  // TemplateContainer, not to the entry document root.
2990
2990
  isRoot: (b) => b.kind === "element" && b.node.id === g.scope
2991
2991
  };
2992
- let p = null, d = [];
2992
+ let h = null, d = [];
2993
2993
  for (const b of g.rule.selectors) {
2994
2994
  if (!Pe(b, n, m)) continue;
2995
2995
  const y = ai(b);
2996
- (p === null || Dt(y, p) > 0) && (p = y, d = Ft(b));
2996
+ (h === null || Dt(y, h) > 0) && (h = y, d = Ft(b));
2997
2997
  }
2998
- if (p !== null) {
2999
- if (i == null || i.add(g), o !== void 0 && n.kind === "element" && g.builtin !== !0) {
3000
- const b = `${g.sheet}:${g.item}`, y = o.get(b) ?? [];
3001
- y.includes(n.node.id) || y.push(n.node.id), o.set(b, y);
2998
+ if (h !== null) {
2999
+ if (i == null || i.add(g), r !== void 0 && n.kind === "element" && g.builtin !== !0) {
3000
+ const b = `${g.sheet}:${g.item}`, y = r.get(b) ?? [];
3001
+ y.includes(n.node.id) || y.push(n.node.id), r.set(b, y);
3002
3002
  }
3003
3003
  g.rule.declarations.forEach((b, y) => {
3004
3004
  var x, k, S;
@@ -3019,14 +3019,14 @@ function zt(e, n, t, i, o) {
3019
3019
  // common case stays the shape it has always been.
3020
3020
  ...d.length > 0 ? { states: d } : {}
3021
3021
  };
3022
- c(s, l, a, g.builtin === !0 ? 0 : 1, p);
3022
+ c(s, l, a, g.builtin === !0 ? 0 : 1, h);
3023
3023
  }
3024
3024
  });
3025
3025
  }
3026
3026
  }
3027
3027
  if (n.kind === "element") {
3028
3028
  const g = n.node;
3029
- qe(e, g).forEach((m, p) => {
3029
+ qe(e, g).forEach((m, h) => {
3030
3030
  var d;
3031
3031
  for (const [b, y] of De(m.property, m.value))
3032
3032
  c(
@@ -3035,7 +3035,7 @@ function zt(e, n, t, i, o) {
3035
3035
  {
3036
3036
  kind: "inline",
3037
3037
  node: ((d = g.derived) == null ? void 0 : d.instance) ?? g.sourceNode ?? g.id,
3038
- declIndex: p,
3038
+ declIndex: h,
3039
3039
  ...typeof g.sourceDocument == "string" ? { sourceDocument: g.sourceDocument } : {},
3040
3040
  ...g.sourceDocumentFrom === void 0 ? {} : { sourceDocumentFrom: g.sourceDocumentFrom }
3041
3041
  },
@@ -3044,7 +3044,7 @@ function zt(e, n, t, i, o) {
3044
3044
  );
3045
3045
  });
3046
3046
  }
3047
- return r;
3047
+ return o;
3048
3048
  }
3049
3049
  function Ut(e) {
3050
3050
  const n = /* @__PURE__ */ new Map();
@@ -3058,29 +3058,29 @@ function Ut(e) {
3058
3058
  t.rank > i.rank && n.set(t.property, t);
3059
3059
  continue;
3060
3060
  }
3061
- const o = Dt(t.specificity, i.specificity);
3062
- (o > 0 || o === 0 && t.order > i.order) && n.set(t.property, t);
3061
+ const r = Dt(t.specificity, i.specificity);
3062
+ (r > 0 || r === 0 && t.order > i.order) && n.set(t.property, t);
3063
3063
  }
3064
3064
  for (const t of n.values()) t.winner = !0;
3065
3065
  return n;
3066
3066
  }
3067
3067
  const gi = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
3068
3068
  function He(e, n, t = /* @__PURE__ */ new Set()) {
3069
- var o;
3069
+ var r;
3070
3070
  let i = e;
3071
- for (let r = 0; r < 32; r++) {
3071
+ for (let o = 0; o < 32; o++) {
3072
3072
  const u = gi.exec(i);
3073
3073
  if (u === null) return i;
3074
- const c = u[1], g = (o = u[2]) == null ? void 0 : o.trim();
3074
+ const c = u[1], g = (r = u[2]) == null ? void 0 : r.trim();
3075
3075
  if (t.has(c)) return null;
3076
- const m = /* @__PURE__ */ new Set([...t, c]), p = n.get(c), d = p !== void 0 ? He(p, n, m) : g !== void 0 && g.length > 0 ? He(g, n, m) : null;
3076
+ const m = /* @__PURE__ */ new Set([...t, c]), h = n.get(c), d = h !== void 0 ? He(h, n, m) : g !== void 0 && g.length > 0 ? He(g, n, m) : null;
3077
3077
  if (d === null) return null;
3078
3078
  i = i.slice(0, u.index) + d + i.slice(u.index + u[0].length);
3079
3079
  }
3080
3080
  return null;
3081
3081
  }
3082
3082
  function bi(e, n) {
3083
- const t = jt(e, n), i = [...t.warnings], o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), g = (x, k, S) => {
3083
+ const t = jt(e, n), i = [...t.warnings], r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), g = (x, k, S) => {
3084
3084
  const s = zt(e, x, t, u, c), l = Ut(s), a = /* @__PURE__ */ new Map();
3085
3085
  for (const [w, _] of k)
3086
3086
  w.startsWith("--") && a.set(w, _.value);
@@ -3102,21 +3102,21 @@ function bi(e, n) {
3102
3102
  }
3103
3103
  f.set(w, { value: N, origin: _.origin });
3104
3104
  }
3105
- const h = /* @__PURE__ */ new Map();
3105
+ const p = /* @__PURE__ */ new Map();
3106
3106
  for (const [w, _] of f)
3107
- Qn(w) && h.set(w, {
3107
+ Qn(w) && p.set(w, {
3108
3108
  value: _.value,
3109
3109
  origin: { kind: "inherited", from: S, origin: _.origin }
3110
3110
  });
3111
- return { computed: f, forChildren: h };
3112
- }, m = /* @__PURE__ */ new Set(), p = (x) => {
3111
+ return { computed: f, forChildren: p };
3112
+ }, m = /* @__PURE__ */ new Set(), h = (x) => {
3113
3113
  var s;
3114
3114
  const k = ((s = x.derived) == null ? void 0 : s.instance) ?? x.sourceNode ?? x.id, S = typeof x.sourceDocument == "string" ? x.sourceDocument : null;
3115
3115
  qe(e, x).forEach((l, a) => {
3116
3116
  const f = At(l.property, l.value);
3117
3117
  if (f === null) return;
3118
- const h = `${x.sourceDocument ?? ""}#${k}#${a}`;
3119
- m.has(h) || (m.add(h), i.push({
3118
+ const p = `${x.sourceDocument ?? ""}#${k}#${a}`;
3119
+ m.has(p) || (m.add(p), i.push({
3120
3120
  kind: "unsupported-property",
3121
3121
  ...f,
3122
3122
  node: x.id,
@@ -3126,33 +3126,33 @@ function bi(e, n) {
3126
3126
  }));
3127
3127
  });
3128
3128
  }, d = (x, k) => {
3129
- p(x);
3129
+ h(x);
3130
3130
  const S = g({ kind: "element", node: x }, k, x.id);
3131
- o.set(x.id, S.computed);
3131
+ r.set(x.id, S.computed);
3132
3132
  let s = S.forChildren;
3133
3133
  const l = Z(x).spec.parts;
3134
3134
  if (l.length > 0) {
3135
3135
  const a = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
3136
- l.forEach((h, w) => {
3137
- if (h.kind === "leading-text" && !gt(x, h)) return;
3136
+ l.forEach((p, w) => {
3137
+ if (p.kind === "leading-text" && !gt(x, p)) return;
3138
3138
  const _ = g(
3139
- { kind: "part", owner: x, name: h.name, depth: w },
3139
+ { kind: "part", owner: x, name: p.name, depth: w },
3140
3140
  f.get(We(l, w) ?? -1) ?? S.forChildren,
3141
3141
  x.id
3142
3142
  );
3143
- a.set(h.name, _.computed), f.set(w, _.forChildren), h.kind !== "leading-text" && (s = _.forChildren);
3144
- }), r.set(x.id, a);
3143
+ a.set(p.name, _.computed), f.set(w, _.forChildren), p.kind !== "leading-text" && (s = _.forChildren);
3144
+ }), o.set(x.id, a);
3145
3145
  }
3146
3146
  for (const a of x.children) d(a, s);
3147
3147
  };
3148
3148
  d(e.root, /* @__PURE__ */ new Map());
3149
3149
  for (const x of t.usable) {
3150
3150
  if (x.builtin === !0 || u.has(x)) continue;
3151
- const k = ri(x.rule.selectors);
3151
+ const k = oi(x.rule.selectors);
3152
3152
  k.length !== 0 && i.push({
3153
3153
  kind: "unsupported-selector",
3154
3154
  message: `${k.join(", ")} matched nothing; only ${an().join(", ")} are drawn with the parts these names refer to`,
3155
- at: { in: "uss", sheet: x.sheet, ...re(e, x.sheet), span: x.rule.selectorSpan },
3155
+ at: { in: "uss", sheet: x.sheet, ...oe(e, x.sheet), span: x.rule.selectorSpan },
3156
3156
  reason: "not-rendered",
3157
3157
  subject: { kind: "selector", selector: _e(e, x), fragment: k.join(", ") },
3158
3158
  ...le(e, x.sheet)
@@ -3163,13 +3163,13 @@ function bi(e, n) {
3163
3163
  const b = /* @__PURE__ */ new Set(), y = (x) => {
3164
3164
  t.ctx.statesOf({ kind: "element", node: x }).has("checked") && b.add(x.id), x.children.forEach(y);
3165
3165
  };
3166
- return y(e.root), { styles: o, partStyles: r, warnings: i, matchedNodes: c, checkedNodes: b };
3166
+ return y(e.root), { styles: r, partStyles: o, warnings: i, matchedNodes: c, checkedNodes: b };
3167
3167
  }
3168
3168
  function Mi(e, n, t, i) {
3169
- const o = jt(e, i), r = zt(e, { kind: "element", node: n }, o).filter(
3169
+ const r = jt(e, i), o = zt(e, { kind: "element", node: n }, r).filter(
3170
3170
  (u) => u.property === t
3171
3171
  );
3172
- return Ut(r), r;
3172
+ return Ut(o), o;
3173
3173
  }
3174
3174
  const Ii = [
3175
3175
  {
@@ -3196,40 +3196,40 @@ function yi(e, n) {
3196
3196
  function i(m) {
3197
3197
  return m.spans.closeTag !== null ? m.spans.closeTag.end : Math.max(m.spans.openTag.end, m.spans.inner.end);
3198
3198
  }
3199
- function o(m) {
3199
+ function r(m) {
3200
3200
  return m.includes('"') ? m.includes("'") ? `"${m.replace(/"/g, "&quot;")}"` : `'${m}'` : `"${m}"`;
3201
3201
  }
3202
- function r(m) {
3203
- const p = m.attributes.map((b) => ` ${b.name}=${o(b.value)}`).join(""), d = yt(m.name);
3204
- return m.spans.closeTag === null ? `<${d}${p} />` : `<${d}${p}>`;
3202
+ function o(m) {
3203
+ const h = m.attributes.map((b) => ` ${b.name}=${r(b.value)}`).join(""), d = yt(m.name);
3204
+ return m.spans.closeTag === null ? `<${d}${h} />` : `<${d}${h}>`;
3205
3205
  }
3206
3206
  function u(m) {
3207
3207
  var y, x;
3208
- const p = t(m.spans.inner), d = ((y = /^[ \t]*\r?\n[ \t]*/.exec(p)) == null ? void 0 : y[0]) ?? "", b = ((x = /\r?\n[ \t]*$/.exec(p)) == null ? void 0 : x[0]) ?? "";
3208
+ const h = t(m.spans.inner), d = ((y = /^[ \t]*\r?\n[ \t]*/.exec(h)) == null ? void 0 : y[0]) ?? "", b = ((x = /\r?\n[ \t]*$/.exec(h)) == null ? void 0 : x[0]) ?? "";
3209
3209
  return { between: d, before: d, after: b };
3210
3210
  }
3211
3211
  function c(m) {
3212
- const { inner: p } = m.spans;
3213
- if (m.children.length === 0) return t(p);
3212
+ const { inner: h } = m.spans;
3213
+ if (m.children.length === 0) return t(h);
3214
3214
  if (m.childrenDirty) {
3215
3215
  const { between: y, before: x, after: k } = u(m);
3216
3216
  return x + m.children.map(g).join(y) + k;
3217
3217
  }
3218
- let d = "", b = p.start;
3218
+ let d = "", b = h.start;
3219
3219
  for (const y of m.children)
3220
3220
  d += e.slice(b, y.spans.openTag.start), d += g(y), b = i(y);
3221
- return d + e.slice(b, p.end);
3221
+ return d + e.slice(b, h.end);
3222
3222
  }
3223
3223
  function g(m) {
3224
- const p = m.tagDirty ? r(m) : t(m.spans.openTag), d = m.spans.closeTag === null ? "" : t(m.spans.closeTag);
3225
- return p + c(m) + d;
3224
+ const h = m.tagDirty ? o(m) : t(m.spans.openTag), d = m.spans.closeTag === null ? "" : t(m.spans.closeTag);
3225
+ return h + c(m) + d;
3226
3226
  }
3227
3227
  return e.slice(0, n.spans.openTag.start) + g(n) + e.slice(i(n));
3228
3228
  }
3229
3229
  function xi(e) {
3230
- const n = e.source, t = (p) => n.slice(p.start, p.end);
3231
- function i(p) {
3232
- return p.parts.map((d, b) => {
3230
+ const n = e.source, t = (h) => n.slice(h.start, h.end);
3231
+ function i(h) {
3232
+ return h.parts.map((d, b) => {
3233
3233
  const y = b === 0 ? "" : d.combinator === "child" ? " > " : " ", x = d.simple.map((k) => {
3234
3234
  switch (k.kind) {
3235
3235
  case "universal":
@@ -3249,44 +3249,44 @@ function xi(e) {
3249
3249
  return y + x;
3250
3250
  }).join("");
3251
3251
  }
3252
- function o(p) {
3252
+ function r(h) {
3253
3253
  var S, s;
3254
- const d = p.declarations[0];
3254
+ const d = h.declarations[0];
3255
3255
  if (d === void 0) return { between: "", before: "", after: "" };
3256
3256
  const b = n.lastIndexOf(`
3257
- `, d.span.start), y = b < 0 ? "" : n.slice(b, d.span.start), x = n.slice(p.selectorSpan.end, p.span.end), k = ((s = (S = /\r?\n[ \t]*\}$/.exec(x)) == null ? void 0 : S[0]) == null ? void 0 : s.replace(/\}$/, "")) ?? "";
3257
+ `, d.span.start), y = b < 0 ? "" : n.slice(b, d.span.start), x = n.slice(h.selectorSpan.end, h.span.end), k = ((s = (S = /\r?\n[ \t]*\}$/.exec(x)) == null ? void 0 : S[0]) == null ? void 0 : s.replace(/\}$/, "")) ?? "";
3258
3258
  return { between: `;${y}`, before: y, after: `;${k}` };
3259
3259
  }
3260
- function r(p) {
3261
- const d = p.selectorDirty ? p.selectors.map(i).join(", ") : t(p.selectorSpan);
3262
- if (p.declarations.length === 0)
3263
- return d + n.slice(p.selectorSpan.end, p.span.end);
3264
- const b = n.slice(p.selectorSpan.end, p.declarations[0].span.start);
3265
- if (p.declarationsDirty) {
3266
- const { between: k, before: S, after: s } = o(p), l = b.slice(0, b.indexOf("{") + 1), a = p.declarations.map(u).join(k);
3260
+ function o(h) {
3261
+ const d = h.selectorDirty ? h.selectors.map(i).join(", ") : t(h.selectorSpan);
3262
+ if (h.declarations.length === 0)
3263
+ return d + n.slice(h.selectorSpan.end, h.span.end);
3264
+ const b = n.slice(h.selectorSpan.end, h.declarations[0].span.start);
3265
+ if (h.declarationsDirty) {
3266
+ const { between: k, before: S, after: s } = r(h), l = b.slice(0, b.indexOf("{") + 1), a = h.declarations.map(u).join(k);
3267
3267
  return `${d}${l}${S}${a}${s}}`;
3268
3268
  }
3269
- let y = d, x = p.selectorSpan.end;
3270
- for (const k of p.declarations)
3269
+ let y = d, x = h.selectorSpan.end;
3270
+ for (const k of h.declarations)
3271
3271
  y += n.slice(x, k.span.start), y += u(k), x = k.span.end;
3272
- return y + n.slice(x, p.span.end);
3272
+ return y + n.slice(x, h.span.end);
3273
3273
  }
3274
- function u(p) {
3275
- return p.dirty ? `${p.property}: ${p.value}` : t(p.span);
3274
+ function u(h) {
3275
+ return h.dirty ? `${h.property}: ${h.value}` : t(h.span);
3276
3276
  }
3277
- function c(p) {
3278
- return p.kind === "rule" ? r(p.rule) : t(p.span);
3277
+ function c(h) {
3278
+ return h.kind === "rule" ? o(h.rule) : t(h.span);
3279
3279
  }
3280
3280
  let g = "", m = 0;
3281
- for (const p of e.items) {
3282
- const d = p.kind === "rule" ? p.rule.span : p.span;
3283
- g += n.slice(m, d.start), g += c(p), m = d.end;
3281
+ for (const h of e.items) {
3282
+ const d = h.kind === "rule" ? h.rule.span : h.span;
3283
+ g += n.slice(m, d.start), g += c(h), m = d.end;
3284
3284
  }
3285
3285
  return g + n.slice(m);
3286
3286
  }
3287
- function wi(e, n, t, i, o = /* @__PURE__ */ new Map()) {
3288
- const r = /* @__PURE__ */ new Map();
3289
- if (i === void 0) return { fonts: r, warnings: [...n] };
3287
+ function wi(e, n, t, i, r = /* @__PURE__ */ new Map()) {
3288
+ const o = /* @__PURE__ */ new Map();
3289
+ if (i === void 0) return { fonts: o, warnings: [...n] };
3290
3290
  const u = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), g = (d, b, y) => {
3291
3291
  for (; b.kind === "inherited"; ) b = b.origin;
3292
3292
  const x = t(b);
@@ -3297,7 +3297,7 @@ function wi(e, n, t, i, o = /* @__PURE__ */ new Map()) {
3297
3297
  x.at === void 0 ? b.kind === "inline" ? b.node : y : null
3298
3298
  ]);
3299
3299
  }, m = [...e];
3300
- for (const [d, b] of o)
3300
+ for (const [d, b] of r)
3301
3301
  for (const y of b.values()) m.push([d, y]);
3302
3302
  for (const [d, b] of m)
3303
3303
  for (const y of ["-unity-font", "-unity-font-definition"]) {
@@ -3320,9 +3320,9 @@ function wi(e, n, t, i, o = /* @__PURE__ */ new Map()) {
3320
3320
  node: l.kind === "inline" ? l.node : d,
3321
3321
  subject: { kind: "asset", ...k, role: "font" },
3322
3322
  ...t(l)
3323
- } : null), y === "-unity-font-definition" && r.delete(b), s !== null && r.set(b, s);
3323
+ } : null), y === "-unity-font-definition" && o.delete(b), s !== null && o.set(b, s);
3324
3324
  }
3325
- const p = n.filter((d) => {
3325
+ const h = n.filter((d) => {
3326
3326
  var y;
3327
3327
  if (d.reason !== "not-rendered" || ((y = d.subject) == null ? void 0 : y.kind) !== "property") return !0;
3328
3328
  const b = JSON.stringify([
@@ -3333,7 +3333,7 @@ function wi(e, n, t, i, o = /* @__PURE__ */ new Map()) {
3333
3333
  ]);
3334
3334
  return !c.has(b);
3335
3335
  });
3336
- return { fonts: r, warnings: [...p, ...[...c.values()].filter((d) => d !== null)] };
3336
+ return { fonts: o, warnings: [...h, ...[...c.values()].filter((d) => d !== null)] };
3337
3337
  }
3338
3338
  function Ni(e) {
3339
3339
  const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), i = (u) => {
@@ -3342,13 +3342,13 @@ function Ni(e) {
3342
3342
  t.set(c.id, u.id), i(c);
3343
3343
  };
3344
3344
  e.document !== void 0 && i(e.document.root);
3345
- const o = /* @__PURE__ */ new Map(), r = (u) => {
3346
- var m, p, d, b;
3347
- const c = o.get(u);
3345
+ const r = /* @__PURE__ */ new Map(), o = (u) => {
3346
+ var m, h, d, b;
3347
+ const c = r.get(u);
3348
3348
  if (c !== void 0) return c;
3349
3349
  let g;
3350
3350
  for (let y = u; y !== void 0; y = t.get(y)) {
3351
- const x = (p = (m = e.styles) == null ? void 0 : m.get(y)) == null ? void 0 : p.get("display");
3351
+ const x = (h = (m = e.styles) == null ? void 0 : m.get(y)) == null ? void 0 : h.get("display");
3352
3352
  if ((x == null ? void 0 : x.value) === "none") {
3353
3353
  g = { kind: "hidden", by: y, origin: x.origin };
3354
3354
  break;
@@ -3362,15 +3362,15 @@ function Ni(e) {
3362
3362
  return /^-?0+(\.0+)?(px|%)?$/.test(((l = x == null ? void 0 : x.get(s)) == null ? void 0 : l.value) ?? "");
3363
3363
  }), S = ((b = n.get(u)) == null ? void 0 : b.children.filter((s) => e.boxes.has(s.id))) ?? [];
3364
3364
  g = !k && S.length > 0 && S.every((s) => {
3365
- const l = r(s.id).kind;
3365
+ const l = o(s.id).kind;
3366
3366
  return l === "hidden" || l === "emptied";
3367
3367
  }) ? { kind: "emptied" } : { kind: "collapsed", explicitZero: k };
3368
3368
  } else g = { kind: "shown" };
3369
3369
  }
3370
- return o.set(u, g), g;
3370
+ return r.set(u, g), g;
3371
3371
  };
3372
- for (const u of e.boxes.keys()) r(u);
3373
- return o;
3372
+ for (const u of e.boxes.keys()) o(u);
3373
+ return r;
3374
3374
  }
3375
3375
  pn(
3376
3376
  (e, n) => n === void 0 ? lt(e) : lt(e, void 0, { resolveImport: n })
@@ -3379,8 +3379,8 @@ function Bt(e, n = []) {
3379
3379
  var t;
3380
3380
  for (const i of e.children) {
3381
3381
  if (i.name.local === "Style") {
3382
- const o = (t = i.attributes.find((r) => r.name === "src")) == null ? void 0 : t.value;
3383
- o !== void 0 && o.length > 0 && n.push({ url: te(o), scope: e.id });
3382
+ const r = (t = i.attributes.find((o) => o.name === "src")) == null ? void 0 : t.value;
3383
+ r !== void 0 && r.length > 0 && n.push({ url: te(r), scope: e.id });
3384
3384
  }
3385
3385
  Bt(i, n);
3386
3386
  }
@@ -3390,12 +3390,12 @@ function vi(e) {
3390
3390
  return e.startsWith("project://") || e.startsWith("/");
3391
3391
  }
3392
3392
  function lt(e, n, t) {
3393
- var m, p, d;
3394
- const i = bt(e), o = [...i.warnings], r = [], u = [], c = [];
3393
+ var m, h, d;
3394
+ const i = bt(e), r = [...i.warnings], o = [], u = [], c = [];
3395
3395
  for (const { url: b, scope: y } of Bt(i.root)) {
3396
3396
  const x = ((m = t == null ? void 0 : t.resolveImport) == null ? void 0 : m.call(t, b, null)) ?? null;
3397
3397
  if (x === null) {
3398
- o.push({
3398
+ r.push({
3399
3399
  kind: "import-unresolved",
3400
3400
  message: (t == null ? void 0 : t.resolveImport) === void 0 ? `<Style src="${b}"> was not loaded: pass resolveImport to read it, or pass the stylesheet text directly. Until then this document renders unstyled.` : `<Style src="${b}"> could not be resolved`,
3401
3401
  node: i.root.id,
@@ -3418,7 +3418,7 @@ function lt(e, n, t) {
3418
3418
  }
3419
3419
  for (; y.length > 0; ) {
3420
3420
  const k = y.shift(), S = k.sheet, s = Ye(k.text, k.origin, S);
3421
- r.push(s.sheet), o.push(...s.warnings);
3421
+ o.push(s.sheet), r.push(...s.warnings);
3422
3422
  for (const l of s.sheet.items) {
3423
3423
  if (l.kind !== "import") continue;
3424
3424
  const a = vi(l.url) ? l.url : JSON.stringify([l.url, k.origin]);
@@ -3428,9 +3428,9 @@ function lt(e, n, t) {
3428
3428
  continue;
3429
3429
  }
3430
3430
  b.set(a, null);
3431
- const f = ((p = t == null ? void 0 : t.resolveImport) == null ? void 0 : p.call(t, l.url, k.origin)) ?? null;
3431
+ const f = ((h = t == null ? void 0 : t.resolveImport) == null ? void 0 : h.call(t, l.url, k.origin)) ?? null;
3432
3432
  if (f === null) {
3433
- o.push({
3433
+ r.push({
3434
3434
  kind: "import-unresolved",
3435
3435
  message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${l.url}" was not loaded: pass resolveImport to read it` : `@import "${l.url}" could not be resolved`,
3436
3436
  at: { in: "uss", sheet: S, span: l.span },
@@ -3438,14 +3438,14 @@ function lt(e, n, t) {
3438
3438
  });
3439
3439
  continue;
3440
3440
  }
3441
- const h = x++;
3442
- b.set(a, h), l.resolvedSheet = h, y.push({ text: f, origin: l.url, sheet: h });
3441
+ const p = x++;
3442
+ b.set(a, p), l.resolvedSheet = p, y.push({ text: f, origin: l.url, sheet: p });
3443
3443
  }
3444
3444
  }
3445
3445
  }
3446
- const g = { source: e, root: i.root, sheets: r, styleRoots: u, warnings: o };
3447
- for (const b of o)
3448
- ((d = b.at) == null ? void 0 : d.in) === "uss" && Object.assign(b.at, re(g, b.at.sheet));
3446
+ const g = { source: e, root: i.root, sheets: o, styleRoots: u, warnings: r };
3447
+ for (const b of r)
3448
+ ((d = b.at) == null ? void 0 : d.in) === "uss" && Object.assign(b.at, oe(g, b.at.sheet));
3449
3449
  return hn(g, t == null ? void 0 : t.resolveImport), g;
3450
3450
  }
3451
3451
  function Ci(e) {
@@ -3460,31 +3460,31 @@ function Ci(e) {
3460
3460
  function ki(e) {
3461
3461
  const n = /* @__PURE__ */ new Map(), t = [];
3462
3462
  for (const i of e) {
3463
- const o = { ...i }, r = o.at === void 0 ? void 0 : JSON.stringify([o.kind, o.message, o.sourceDocument ?? null, o.at]);
3464
- (r === void 0 ? void 0 : n.get(r)) === void 0 && (r !== void 0 && n.set(r, o), t.push(o));
3463
+ const r = { ...i }, o = r.at === void 0 ? void 0 : JSON.stringify([r.kind, r.message, r.sourceDocument ?? null, r.at]);
3464
+ (o === void 0 ? void 0 : n.get(o)) === void 0 && (o !== void 0 && n.set(o, r), t.push(r));
3465
3465
  }
3466
3466
  return t;
3467
3467
  }
3468
3468
  function Oi(e, n, t) {
3469
- const i = t == null ? void 0 : t.theme, o = i === "runtime" || i === "editor" ? i : $e, r = i === void 0 || i === o ? [] : [{
3469
+ const i = t == null ? void 0 : t.theme, r = i === "runtime" || i === "editor" ? i : $e, o = i === void 0 || i === r ? [] : [{
3470
3470
  kind: "malformed",
3471
3471
  reason: "invalid-value",
3472
- message: `Unknown theme '${String(i)}' in the theme option; drew the default theme '${o}'. Accepted: 'runtime', 'editor'.`
3472
+ message: `Unknown theme '${String(i)}' in the theme option; drew the default theme '${r}'. Accepted: 'runtime', 'editor'.`
3473
3473
  }], u = n.ownerDocument, c = (t == null ? void 0 : t.size) ?? {
3474
3474
  width: n.clientWidth,
3475
3475
  height: n.clientHeight
3476
- }, g = Tn(e), m = g.document, p = bi(m, {
3477
- theme: o,
3476
+ }, g = Tn(e), m = g.document, h = bi(m, {
3477
+ theme: r,
3478
3478
  ...(t == null ? void 0 : t.activeStates) === void 0 ? {} : { activeStates: t.activeStates },
3479
3479
  ...(t == null ? void 0 : t.states) === void 0 ? {} : { states: t.states }
3480
- }), d = (t == null ? void 0 : t.measureText) ?? Mn(u), b = mi(m, p.matchedNodes), y = wi(
3481
- p.styles,
3482
- p.warnings,
3480
+ }), d = (t == null ? void 0 : t.measureText) ?? Mn(u), b = mi(m, h.matchedNodes), y = wi(
3481
+ h.styles,
3482
+ h.warnings,
3483
3483
  b,
3484
3484
  t == null ? void 0 : t.resolveFont,
3485
- p.partStyles
3486
- ), x = Rn(m.root, p.styles, p.partStyles, {
3487
- theme: o,
3485
+ h.partStyles
3486
+ ), x = Rn(m.root, h.styles, h.partStyles, {
3487
+ theme: r,
3488
3488
  size: c,
3489
3489
  measureText: d,
3490
3490
  fonts: y.fonts,
@@ -3492,10 +3492,10 @@ function Oi(e, n, t) {
3492
3492
  });
3493
3493
  let k;
3494
3494
  try {
3495
- k = Bn(m.root, x.boxes, x.parts, p.styles, n, {
3495
+ k = Bn(m.root, x.boxes, x.parts, h.styles, n, {
3496
3496
  document: u,
3497
- checkedNodes: p.checkedNodes,
3498
- theme: o,
3497
+ checkedNodes: h.checkedNodes,
3498
+ theme: r,
3499
3499
  fonts: y.fonts,
3500
3500
  resolveAsset: t == null ? void 0 : t.resolveAsset,
3501
3501
  locate: b
@@ -3505,9 +3505,9 @@ function Oi(e, n, t) {
3505
3505
  }
3506
3506
  let S = !1;
3507
3507
  return {
3508
- theme: o,
3508
+ theme: r,
3509
3509
  warnings: ki([
3510
- ...r,
3510
+ ...o,
3511
3511
  ...g.warnings,
3512
3512
  ...y.warnings,
3513
3513
  ...x.warnings,
@@ -3516,8 +3516,8 @@ function Oi(e, n, t) {
3516
3516
  elements: k.elements,
3517
3517
  boxes: x.boxes,
3518
3518
  document: m,
3519
- styles: p.styles,
3520
- partStyles: p.partStyles,
3519
+ styles: h.styles,
3520
+ partStyles: h.partStyles,
3521
3521
  dispose() {
3522
3522
  S || (S = !0, x.dispose(), n.replaceChildren());
3523
3523
  }