@panphora/clayjs 1.11.0 → 1.11.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.
@@ -1,4 +1,4 @@
1
- /* clayjs 1.11.0 standalone build: every clayjs module in one file. https://clayjs.com/offline
1
+ /* clayjs 1.11.1 standalone build: every clayjs module in one file. https://clayjs.com/offline
2
2
  Third-party code inside keeps its own license (Sortable MIT, Squire MIT, DOMPurify Apache-2.0 OR MPL-2.0, MicroModal MIT, parse5 MIT): https://clayjs.com/THIRD-PARTY-NOTICES.md */
3
3
  (() => {
4
4
  var __create = Object.create;
@@ -40494,28 +40494,28 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40494
40494
  "entries/sap.js"() {
40495
40495
  (function() {
40496
40496
  var Sap = (() => {
40497
- var Ht3 = Object.defineProperty;
40498
- var Pe3 = Object.getOwnPropertyDescriptor;
40499
- var Fe3 = Object.getOwnPropertyNames;
40500
- var Be3 = Object.prototype.hasOwnProperty;
40501
- var qe3 = (t, e) => {
40502
- for (var n2 in e) Ht3(t, n2, { get: e[n2], enumerable: true });
40503
- }, ze3 = (t, e, n2, r) => {
40504
- if (e && typeof e == "object" || typeof e == "function") for (let o2 of Fe3(e)) !Be3.call(t, o2) && o2 !== n2 && Ht3(t, o2, { get: () => e[o2], enumerable: !(r = Pe3(e, o2)) || r.enumerable });
40497
+ var Yt3 = Object.defineProperty;
40498
+ var Ke3 = Object.getOwnPropertyDescriptor;
40499
+ var Je3 = Object.getOwnPropertyNames;
40500
+ var Qe3 = Object.prototype.hasOwnProperty;
40501
+ var Ze3 = (t, e) => {
40502
+ for (var n2 in e) Yt3(t, n2, { get: e[n2], enumerable: true });
40503
+ }, tr2 = (t, e, n2, r) => {
40504
+ if (e && typeof e == "object" || typeof e == "function") for (let i2 of Je3(e)) !Qe3.call(t, i2) && i2 !== n2 && Yt3(t, i2, { get: () => e[i2], enumerable: !(r = Ke3(e, i2)) || r.enumerable });
40505
40505
  return t;
40506
40506
  };
40507
- var He3 = (t) => ze3(Ht3({}, "__esModule", { value: true }), t);
40508
- var zr2 = {};
40509
- qe3(zr2, { Sap: () => I3, default: () => qr2, mount: () => Oe3, mountAll: () => qt3, runtime: () => ut3 });
40510
- function ee3(t) {
40507
+ var er2 = (t) => tr2(Yt3({}, "__esModule", { value: true }), t);
40508
+ var nn2 = {};
40509
+ Ze3(nn2, { Sap: () => F2, default: () => rn, mount: () => Xe3, mountAll: () => Ut3, runtime: () => dt3 });
40510
+ function ue3(t) {
40511
40511
  let e = false, n2 = /* @__PURE__ */ new Set(), r = [];
40512
- function o2(f2) {
40512
+ function i2(f2) {
40513
40513
  f2 && (r.push(f2), r.length > 8 && r.shift());
40514
40514
  }
40515
- function a(f2, w2) {
40516
- o2(w2), !f2._broken && (n2.add(f2), !e && (e = true, queueMicrotask(u2)));
40515
+ function s2(f2, w2) {
40516
+ i2(w2), !f2._broken && (n2.add(f2), !e && (e = true, queueMicrotask(a)));
40517
40517
  }
40518
- function u2() {
40518
+ function a() {
40519
40519
  e = false;
40520
40520
  let f2 = [...n2];
40521
40521
  n2.clear();
@@ -40533,42 +40533,105 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40533
40533
  }
40534
40534
  }
40535
40535
  function k2(f2, w2) {
40536
- o2(w2), R2(f2);
40536
+ i2(w2), R2(f2);
40537
40537
  }
40538
- function y2(f2) {
40538
+ function A2(f2) {
40539
40539
  f2._broken = false, f2._passes = 0;
40540
40540
  }
40541
- return { schedule: a, runNow: k2, rearm: y2, ring: r };
40541
+ return { schedule: s2, runNow: k2, rearm: A2, ring: r };
40542
+ }
40543
+ var Xt3 = { E01: { slug: "foreign-dialect", behavior: "HALT" }, E02: { slug: "moustaches-in-text", behavior: "HALT" }, E04: { slug: "duplicate-declaration", behavior: "HALT" }, E05: { slug: "reserved-name", behavior: "HALT" }, E06: { slug: "global-html-name", behavior: "HALT" }, E07: { slug: "calc-cycle", behavior: "ERR" }, E08: { slug: "expression-syntax", behavior: "HALT" }, E10: { slug: "orphan-item", behavior: "HALT" }, E12: { slug: "unknown-state-key", behavior: "ERR" }, E15: { slug: "write-to-undeclared-key", behavior: "ERR" }, E16: { slug: "write-to-computed-field", behavior: "ERR" }, E17: { slug: "unresolvable-action-target", behavior: "HALT" }, E18: { slug: "paint-on-form-control", behavior: "HALT" }, E20: { slug: "bind-on-non-control", behavior: "HALT" }, E22: { slug: "format-type", behavior: "ERR" }, E24: { slug: "runtime-expression-throw", behavior: "ERR" }, E26: { slug: "circuit-breaker", behavior: "HALT" }, E30: { slug: "attr-on-bound-control", behavior: "HALT" }, E31: { slug: "password-without-transient", behavior: "HALT" }, E32: { slug: "file-bind", behavior: "HALT" }, E33: { slug: "dialog-state-open", behavior: "HALT" }, E34: { slug: "transient-persist-collision", behavior: "HALT" }, E35: { slug: "presence-state-misuse", behavior: "HALT" }, E40: { slug: "each-not-array", behavior: "ERR" }, E41: { slug: "each-bad-key", behavior: "ERR" }, E42: { slug: "each-template", behavior: "ERR" }, E43: { slug: "bind-in-each-row", behavior: "ERR" }, W03: { slug: "unknown-colon-attribute", behavior: "WARN" }, W04: { slug: "expression-in-when", behavior: "WARN" }, W30: { slug: "nonzero-mount-writes", behavior: "WARN" }, W31: { slug: "detail-dialog-saved-open", behavior: "WARN" } }, mt3 = ["disabled", "readonly", "required", "checked", "selected", "multiple", "open", "inert", "autofocus", "novalidate", "hidden"], St3 = /* @__PURE__ */ new Set(["title", "style", "hidden", "lang", "dir", "translate", "class", "id", "nonce", "autofocus", "tabindex", "contenteditable", "spellcheck", "draggable", "role", "slot", "part", "name", "value", "type", "itemscope", "itemtype", "itemid", "itemprop", "itemref"]), Rt3 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "calc", "text", "show", "attr", "set", "trigger", "move", "sort", "detail", "each", "effect", "invalid", "confirm", "transient", "default", "persist", "sortable", "editmode"]);
40544
+ function Dt3(t) {
40545
+ if (!t || t.nodeType !== 1) return "?";
40546
+ if (t.id) return `${t.tagName.toLowerCase()}#${t.id}`;
40547
+ let e = [], n2 = t, r = 0;
40548
+ for (; n2 && n2.nodeType === 1 && r < 4; ) {
40549
+ let i2 = n2.tagName.toLowerCase();
40550
+ if (n2.hasAttribute("sap")) i2 += "[sap]";
40551
+ else if (n2.parentElement) {
40552
+ let s2 = [...n2.parentElement.children].filter((a) => a.tagName === n2.tagName);
40553
+ s2.length > 1 && (i2 += `:nth-of-type(${s2.indexOf(n2) + 1})`);
40554
+ }
40555
+ if (e.unshift(i2), n2.hasAttribute("sap")) break;
40556
+ n2 = n2.parentElement, r++;
40557
+ }
40558
+ return e.join(" > ");
40559
+ }
40560
+ function ce3(t) {
40561
+ let e = t.toLowerCase();
40562
+ return /^x-text$|^x-html$/.test(e) ? 'use text="state.x" (Sap paints text only)' : /^x-show$|^v-show$|^v-if$/.test(e) ? 'use show="expr" (toggles native hidden)' : /^x-model$|^v-model$/.test(e) ? 'use bind="field"' : /^@|^x-on:|^v-on:|^on:/.test(e) ? "use native onclick + Sap(this) (no event directive)" : /^:|^x-bind:class$|^v-bind:class$/.test(e) ? 'use class:NAME="expr" or attr:NAME="expr"' : /^x-for$|^v-for$/.test(e) ? 'use items="name" on the container and item template on the row' : /^x-data$/.test(e) ? "declare state with state= / bind / items (no JS state object)" : /^x-init$/.test(e) ? "use a <script> or onclick + Sap(this)" : /^bind:/.test(e) ? 'use bind="field"; one-way paint is attr:NAME="expr"' : /^x-/.test(e) || /^v-/.test(e) ? "this is a foreign-dialect attribute; Sap has no x-/v- attributes" : null;
40563
+ }
40564
+ var pt3 = class {
40565
+ constructor(e) {
40566
+ this.appName = e, this.errors = [], this.warnings = [], this.halted = false, this.haltReason = null;
40567
+ }
40568
+ block(e, n2, r = {}) {
40569
+ let i2 = (Xt3[e] || {}).slug || "error", s2 = { code: e, slug: i2, el: Dt3(n2), attr: r.attr || null, expr: r.expr || null, key: r.key || null, problem: r.problem || "", didYouMean: r.didYouMean || null, fix: r.fix || null, phase: r.phase || "runtime" }, a = [`
40570
+ ` + (e[0] === "W" ? "sap \u26A0 " : "sap \u2717 ") + e + " " + i2];
40571
+ return a.push(` at ${s2.el}${s2.attr ? ` \u2014 ${s2.attr}="${s2.expr ?? ""}"` : ""}`), s2.problem && a.push(` problem: ${s2.problem}`), s2.didYouMean && a.push(` did you mean: ${s2.didYouMean}`), s2.fix && a.push(` fix: ${s2.fix}`), console.error(a.join(`
40572
+ `)), s2;
40573
+ }
40574
+ error(e, n2, r = {}) {
40575
+ let i2 = this.block(e, n2, r);
40576
+ return this.errors.push(i2), i2;
40577
+ }
40578
+ warn(e, n2, r = {}) {
40579
+ let i2 = this.block(e, n2, r);
40580
+ return this.warnings.push(i2), i2;
40581
+ }
40582
+ report() {
40583
+ return { ok: this.errors.length === 0 && !this.halted, app: this.appName, halted: this.halted, haltReason: this.haltReason, errors: this.errors.slice(), warnings: this.warnings.slice() };
40584
+ }
40585
+ };
40586
+ function ut3(t, e) {
40587
+ t && t.getAttribute("sap-error") !== e && t.setAttribute("sap-error", e);
40588
+ }
40589
+ function Ct3(t) {
40590
+ t && t.hasAttribute("sap-error") && t.removeAttribute("sap-error");
40591
+ }
40592
+ function xt3(t, e) {
40593
+ let n2 = null, r = 3;
40594
+ for (let i2 of e) {
40595
+ let s2 = rr2(t, i2);
40596
+ s2 < r && (r = s2, n2 = i2);
40597
+ }
40598
+ return n2;
40599
+ }
40600
+ function rr2(t, e) {
40601
+ let n2 = t.length, r = e.length, i2 = Array.from({ length: n2 + 1 }, (s2, a) => [a, ...new Array(r).fill(0)]);
40602
+ for (let s2 = 0; s2 <= r; s2++) i2[0][s2] = s2;
40603
+ for (let s2 = 1; s2 <= n2; s2++) for (let a = 1; a <= r; a++) i2[s2][a] = Math.min(i2[s2 - 1][a] + 1, i2[s2][a - 1] + 1, i2[s2 - 1][a - 1] + (t[s2 - 1] === e[a - 1] ? 0 : 1));
40604
+ return i2[n2][r];
40542
40605
  }
40543
- var je3 = 0, re3 = /* @__PURE__ */ new WeakMap();
40544
- function xt3(t, e = "sap") {
40606
+ var nr2 = new Set(mt3), or2 = { readonly: "readOnly", novalidate: "noValidate" }, ir2 = 0, fe3 = /* @__PURE__ */ new WeakMap();
40607
+ function Mt3(t, e = "sap") {
40545
40608
  let n2 = t.getAttribute("data-id");
40546
40609
  if (n2) return n2;
40547
40610
  if (t.id) return t.id;
40548
- let r = re3.get(t);
40549
- return r || (r = `${e}-${(je3++).toString(36)}`, re3.set(t, r)), r;
40611
+ let r = fe3.get(t);
40612
+ return r || (r = `${e}-${(ir2++).toString(36)}`, fe3.set(t, r)), r;
40550
40613
  }
40551
- function kt3(t, e = "row") {
40614
+ function le3(t, e = "row") {
40552
40615
  for (; ; ) {
40553
40616
  let n2 = `${e}-${Math.random().toString(36).slice(2, 8)}`;
40554
40617
  if (!t.getElementById(n2) && !t.querySelector(`[data-id="${n2}"]`)) return n2;
40555
40618
  }
40556
40619
  }
40557
- function Ue3(t) {
40620
+ function sr2(t) {
40558
40621
  return t.hasAttribute("scope") || t.hasAttribute("items") || t.hasAttribute("detail") || t.hasAttribute("each");
40559
40622
  }
40560
- function Ve2(t) {
40561
- return t.hasAttribute("sap-ignore") || t.hasAttribute("template");
40623
+ function ar2(t) {
40624
+ return t.tagName === "TEMPLATE" || t.hasAttribute("sap-ignore") || t.hasAttribute("template");
40562
40625
  }
40563
- function Y2(t, e) {
40626
+ function K2(t, e) {
40564
40627
  for (let r of t.children) n2(r);
40565
40628
  function n2(r) {
40566
- if (r.nodeType !== 1 || Ve2(r)) return;
40567
- let o2 = Ue3(r);
40568
- if (e(r, o2), !o2) for (let a of r.children) n2(a);
40629
+ if (r.nodeType !== 1 || ar2(r)) return;
40630
+ let i2 = sr2(r);
40631
+ if (e(r, i2), !i2) for (let s2 of r.children) n2(s2);
40569
40632
  }
40570
40633
  }
40571
- function H2(t) {
40634
+ function Y2(t) {
40572
40635
  let e = t;
40573
40636
  for (; e; ) {
40574
40637
  if (e.hasAttribute("sap") || e.hasAttribute("scope") || e.hasAttribute("item") || e.hasAttribute("detail")) return e;
@@ -40576,14 +40639,14 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40576
40639
  }
40577
40640
  return null;
40578
40641
  }
40579
- function gt3(t) {
40642
+ function ft2(t) {
40580
40643
  for (let e = t; e && e.nodeType === 1; e = e.parentElement) {
40581
40644
  if (e._sapEachRow) return e;
40582
40645
  if (e.hasAttribute("item") || e.hasAttribute("sap")) return null;
40583
40646
  }
40584
40647
  return null;
40585
40648
  }
40586
- function $t3(t) {
40649
+ function It3(t) {
40587
40650
  let e = t;
40588
40651
  for (; e; ) {
40589
40652
  if (e.hasAttribute("detail") || e.hasAttribute("item")) return e;
@@ -40591,7 +40654,7 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40591
40654
  }
40592
40655
  return null;
40593
40656
  }
40594
- function wt3(t) {
40657
+ function kt3(t) {
40595
40658
  let e = t;
40596
40659
  for (; e; ) {
40597
40660
  if (e.hasAttribute("detail")) return e;
@@ -40599,39 +40662,56 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40599
40662
  }
40600
40663
  return null;
40601
40664
  }
40602
- function ft2(t, e) {
40665
+ function lt3(t, e) {
40666
+ if (t.hasAttribute("item") && t.getAttribute("bind") === e) return t;
40603
40667
  let n2 = null;
40604
- return Y2(t, (r) => {
40668
+ return K2(t, (r) => {
40605
40669
  !n2 && r.getAttribute("bind") === e && (n2 = r);
40606
40670
  }), n2;
40607
40671
  }
40608
- function bt3(t, e) {
40672
+ function ht3(t, e) {
40609
40673
  let n2 = null;
40610
- return Y2(t, (r) => {
40674
+ return K2(t, (r) => {
40611
40675
  !n2 && r.getAttribute("items") === e && (n2 = r);
40612
40676
  }), n2;
40613
40677
  }
40614
- function X2(t) {
40678
+ function bt3(t, e) {
40679
+ return !t || t.nodeType !== 1 || !t.hasAttribute("item") ? false : lt3(t, e) || ht3(t, e) ? true : z2(t.getAttribute("state") || "").some((n2) => n2.name === e);
40680
+ }
40681
+ function de3(t) {
40682
+ let e = t && t.$el;
40683
+ return e && e.nodeType === 1 && e.isConnected && e.hasAttribute("item") ? e : null;
40684
+ }
40685
+ function Ot3(t) {
40686
+ return !!t.closest("form[trigger-add]");
40687
+ }
40688
+ function Z3(t) {
40615
40689
  return [...t.children].filter((e) => e.hasAttribute("item") && !e.hasAttribute("template"));
40616
40690
  }
40617
- function _t2(t) {
40618
- return [...t.children].find((e) => e.hasAttribute("item") && e.hasAttribute("template")) || null;
40691
+ function Kt2(t, e) {
40692
+ if (!t || !e) return null;
40693
+ let n2 = [...t.querySelectorAll(`template[items="${e}"]`)].find((i2) => i2.closest("[sap]") === t), r = n2 && n2.content.firstElementChild;
40694
+ return r && r.hasAttribute("item") ? r : null;
40619
40695
  }
40620
- function q3(t) {
40696
+ function Ft3(t) {
40697
+ let e = [...t.children].find((n2) => n2.hasAttribute("item") && n2.hasAttribute("template"));
40698
+ return e || Kt2(t.closest("[sap]"), t.getAttribute("items"));
40699
+ }
40700
+ function z2(t) {
40621
40701
  let e = [];
40622
40702
  if (!t) return e;
40623
40703
  for (let n2 of t.trim().split(/\s+/)) {
40624
40704
  if (!n2) continue;
40625
- let r = n2, o2, a = r.indexOf("=");
40626
- a >= 0 && (o2 = r.slice(a + 1), r = r.slice(0, a));
40627
- let u2 = r.split(":"), R2 = u2[0], k2 = "string", y2 = false;
40628
- for (let N2 of u2.slice(1)) N2 === "num" ? k2 = "num" : N2 === "bool" ? k2 = "bool" : N2 === "transient" && (y2 = true);
40629
- let f2 = R2, w2 = f2.startsWith("data-") && f2.length > 5 ? f2.slice(5).replace(/-([a-z])/g, (N2, W3) => W3.toUpperCase()) : f2;
40630
- e.push({ name: w2, attr: f2, type: k2, default: o2, transient: y2 });
40705
+ let r = n2, i2, s2 = r.indexOf("=");
40706
+ s2 >= 0 && (i2 = r.slice(s2 + 1), r = r.slice(0, s2));
40707
+ let a = r.split(":"), R2 = a[0], k2 = "string", A2 = false;
40708
+ for (let N2 of a.slice(1)) N2 === "num" ? k2 = "num" : N2 === "bool" ? k2 = "bool" : N2 === "presence" ? k2 = "presence" : N2 === "transient" && (A2 = true);
40709
+ let f2 = R2, w2 = f2.startsWith("data-") && f2.length > 5 ? f2.slice(5).replace(/-([a-z])/g, (N2, I3) => I3.toUpperCase()) : f2;
40710
+ e.push({ name: w2, attr: f2, type: k2, default: i2, transient: A2 });
40631
40711
  }
40632
40712
  return e;
40633
40713
  }
40634
- function it3(t, e) {
40714
+ function ct3(t, e) {
40635
40715
  if (e === "num") {
40636
40716
  if (t == null || t === "") return 0;
40637
40717
  let n2 = Number(t);
@@ -40639,161 +40719,187 @@ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
40639
40719
  }
40640
40720
  return e === "bool" ? t === "true" || t === "" || t === "1" : t ?? "";
40641
40721
  }
40642
- function Nt3(t, e) {
40722
+ function Jt3(t, e) {
40643
40723
  return e === "bool" ? t ? "true" : "false" : t == null ? "" : String(t);
40644
40724
  }
40645
- function Tt3(t, e) {
40725
+ function Qt3(t, e) {
40726
+ return nr2.has(e) && typeof t[or2[e] || e] == "boolean";
40727
+ }
40728
+ function gt3(t, e) {
40729
+ return e.type === "presence" || e.type !== "num" && Qt3(t, e.attr || e.name);
40730
+ }
40731
+ function $t3(t) {
40732
+ return t.default != null ? t.default : t.type === "num" ? "0" : t.type === "bool" ? "false" : "";
40733
+ }
40734
+ function pe3(t, e) {
40735
+ let n2 = e.attr || e.name;
40736
+ if (gt3(t, e)) return t.hasAttribute(n2);
40737
+ let r = t.getAttribute(n2);
40738
+ return ct3(r ?? $t3(e), e.type);
40739
+ }
40740
+ function me3(t, e) {
40741
+ return gt3(t, e) ? e.default != null ? ct3(e.default, "bool") : false : ct3($t3(e), e.type);
40742
+ }
40743
+ function _t2(t, e, n2) {
40744
+ let r = e.attr || e.name;
40745
+ if (gt3(t, e)) {
40746
+ n2 ? t.hasAttribute(r) || t.setAttribute(r, "") : t.hasAttribute(r) && t.removeAttribute(r);
40747
+ return;
40748
+ }
40749
+ t.setAttribute(r, Jt3(n2, e.type));
40750
+ }
40751
+ function Pt3(t, e) {
40646
40752
  let n2 = e.attr || e.name, r = t._sapTransient || (t._sapTransient = {});
40647
40753
  if (!(e.name in r)) {
40648
- let o2 = t.getAttribute(n2);
40649
- o2 == null && (o2 = e.default != null ? e.default : e.type === "num" ? "0" : e.type === "bool" ? "false" : ""), r[e.name] = it3(o2, e.type);
40754
+ let i2 = t.getAttribute(n2);
40755
+ i2 == null && (i2 = $t3(e)), r[e.name] = ct3(i2, e.type);
40650
40756
  }
40651
40757
  return t.hasAttribute(n2) && t.removeAttribute(n2), r[e.name];
40652
40758
  }
40653
- function jt3(t, e, n2) {
40759
+ function Tt3(t, e, n2) {
40654
40760
  let r = e.attr || e.name;
40655
40761
  (t._sapTransient || (t._sapTransient = {}))[e.name] = n2, t.hasAttribute(r) && t.removeAttribute(r);
40656
40762
  }
40657
- function yt3(t, e, n2) {
40658
- let r = String(n2).split("."), o2 = r[r.length - 1];
40763
+ function Nt3(t, e, n2) {
40764
+ let r = String(n2).split("."), i2 = r[r.length - 1];
40659
40765
  if (r.length === 1) {
40660
- let R2 = Ye3(e, o2);
40661
- return R2 || (t.getAttribute("items") === o2 ? t : t.querySelector(`[items="${o2}"]`));
40766
+ let R2 = ur2(e, i2);
40767
+ return R2 || (t.getAttribute("items") === i2 ? t : t.querySelector(`[items="${i2}"]:not(template)`));
40662
40768
  }
40663
- let a = r[r.length - 2], u2 = [...t.querySelectorAll(`[scope="${a}"]`)].find((R2) => bt3(R2, o2));
40664
- return u2 ? bt3(u2, o2) : null;
40769
+ let s2 = r[r.length - 2], a = [...t.querySelectorAll(`[scope="${s2}"]`)].find((R2) => ht3(R2, i2));
40770
+ return a ? ht3(a, i2) : null;
40665
40771
  }
40666
- function Ye3(t, e) {
40667
- let n2 = H2(t);
40772
+ function ur2(t, e) {
40773
+ let n2 = Y2(t);
40668
40774
  for (; n2; ) {
40669
40775
  if (n2.getAttribute("items") === e) return n2;
40670
- let r = bt3(n2, e);
40776
+ let r = ht3(n2, e);
40671
40777
  if (r) return r;
40672
- n2 = H2(n2.parentElement);
40778
+ n2 = Y2(n2.parentElement);
40673
40779
  }
40674
40780
  return null;
40675
40781
  }
40676
- function K2(t) {
40782
+ function tt3(t) {
40677
40783
  if (typeof t == "number") return t;
40678
40784
  if (t == null || t === "") return 0;
40679
40785
  let e = Number(typeof t == "string" ? t.replace(/[$,%\s]/g, "") : t);
40680
40786
  return Number.isNaN(e) ? 0 : e;
40681
40787
  }
40682
- function Lt2(t, e) {
40788
+ function Wt3(t, e) {
40683
40789
  return Array.isArray(t) ? e == null ? t : t.map((n2) => typeof e == "function" ? e(n2) : n2?.[e]) : [];
40684
40790
  }
40685
- function ne3(t, e) {
40686
- return Lt2(t, e).reduce((n2, r) => n2 + K2(r), 0);
40791
+ function he3(t, e) {
40792
+ return Wt3(t, e).reduce((n2, r) => n2 + tt3(r), 0);
40687
40793
  }
40688
- function Ge3(t, e) {
40794
+ function cr2(t, e) {
40689
40795
  return Array.isArray(t) ? e == null ? t.length : t.reduce((n2, r) => n2 + (e(r) ? 1 : 0), 0) : 0;
40690
40796
  }
40691
- function Xe3(t, e) {
40692
- let n2 = Lt2(t, e);
40693
- return n2.length ? ne3(t, e) / n2.length : 0;
40797
+ function fr2(t, e) {
40798
+ let n2 = Wt3(t, e);
40799
+ return n2.length ? he3(t, e) / n2.length : 0;
40694
40800
  }
40695
- function Ke3(t, e) {
40696
- let n2 = Lt2(t, e).filter((r) => r != null && r !== "");
40697
- return n2.length ? n2.every((r) => typeof r == "number" || !Number.isNaN(Number(r))) ? Math.min(...n2.map(Number)) : n2.reduce((r, o2) => String(r) <= String(o2) ? r : o2) : 0;
40801
+ function lr2(t, e) {
40802
+ let n2 = Wt3(t, e).filter((r) => r != null && r !== "");
40803
+ return n2.length ? n2.every((r) => typeof r == "number" || !Number.isNaN(Number(r))) ? Math.min(...n2.map(Number)) : n2.reduce((r, i2) => String(r) <= String(i2) ? r : i2) : 0;
40698
40804
  }
40699
- function Je3(t, e) {
40700
- let n2 = Lt2(t, e).filter((r) => r != null && r !== "");
40701
- return n2.length ? n2.every((r) => typeof r == "number" || !Number.isNaN(Number(r))) ? Math.max(...n2.map(Number)) : n2.reduce((r, o2) => String(r) >= String(o2) ? r : o2) : 0;
40805
+ function dr2(t, e) {
40806
+ let n2 = Wt3(t, e).filter((r) => r != null && r !== "");
40807
+ return n2.length ? n2.every((r) => typeof r == "number" || !Number.isNaN(Number(r))) ? Math.max(...n2.map(Number)) : n2.reduce((r, i2) => String(r) >= String(i2) ? r : i2) : 0;
40702
40808
  }
40703
- function Qe3(t, e, n2) {
40704
- let r = K2(t) === 1 ? e : n2 ?? e + "s";
40809
+ function pr2(t, e, n2) {
40810
+ let r = tt3(t) === 1 ? e : n2 ?? e + "s";
40705
40811
  return `${t} ${r}`;
40706
40812
  }
40707
- function Ze3(t, e) {
40813
+ function mr2(t, e) {
40708
40814
  let n2 = new Date(t), r = new Date(e);
40709
40815
  return Number.isNaN(+n2) || Number.isNaN(+r) ? 0 : Math.round((r - n2) / 864e5);
40710
40816
  }
40711
- function Z3(t) {
40817
+ function nt3(t) {
40712
40818
  return typeof t == "number" ? t : Number(t);
40713
40819
  }
40714
- var At2 = { usd: (t) => "$" + Z3(t).toLocaleString("en-US", { maximumFractionDigits: 0 }), usd2: (t) => "$" + Z3(t).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), pct: (t) => Math.round(Z3(t)) + "%", pct1: (t) => Z3(t).toFixed(1) + "%", int: (t) => Math.round(Z3(t)).toLocaleString("en-US"), num: (t) => Z3(t).toLocaleString("en-US"), num2: (t) => Z3(t).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), compact: (t) => Z3(t).toLocaleString("en-US", { notation: "compact" }), date: (t) => {
40820
+ var Lt2 = { usd: (t) => "$" + nt3(t).toLocaleString("en-US", { maximumFractionDigits: 0 }), usd2: (t) => "$" + nt3(t).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), pct: (t) => Math.round(nt3(t)) + "%", pct1: (t) => nt3(t).toFixed(1) + "%", int: (t) => Math.round(nt3(t)).toLocaleString("en-US"), num: (t) => nt3(t).toLocaleString("en-US"), num2: (t) => nt3(t).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), compact: (t) => nt3(t).toLocaleString("en-US", { notation: "compact" }), date: (t) => {
40715
40821
  let e = new Date(t);
40716
40822
  return Number.isNaN(+e) ? String(t) : e.toLocaleDateString("en-US");
40717
40823
  }, clock: (t) => {
40718
- let e = Z3(t), n2 = Math.floor(e / 100), r = n2 % 10, o2 = Math.floor(n2 / 10) % 60;
40719
- return `${Math.floor(n2 / 600)}:${String(o2).padStart(2, "0")}.${r}`;
40720
- } }, tr2 = /* @__PURE__ */ new Set(["usd", "usd2", "pct", "pct1", "int", "num", "num2", "compact", "clock"]);
40721
- function oe3(t, e) {
40824
+ let e = nt3(t), n2 = Math.floor(e / 100), r = n2 % 10, i2 = Math.floor(n2 / 10) % 60;
40825
+ return `${Math.floor(n2 / 600)}:${String(i2).padStart(2, "0")}.${r}`;
40826
+ } }, hr2 = /* @__PURE__ */ new Set(["usd", "usd2", "pct", "pct1", "int", "num", "num2", "compact", "clock"]);
40827
+ function be3(t, e) {
40722
40828
  if (!t) return e == null ? "" : String(e);
40723
- let n2 = At2[t];
40829
+ let n2 = Lt2[t];
40724
40830
  if (typeof n2 != "function") {
40725
40831
  let r = new Error(`unknown format "${t}"`);
40726
40832
  throw r.sapCode = "E22", r;
40727
40833
  }
40728
- if (tr2.has(t)) {
40834
+ if (hr2.has(t)) {
40729
40835
  let r = typeof e == "number" ? e : Number(e);
40730
40836
  if (!Number.isFinite(r)) {
40731
- let o2 = new Error(`format "${t}" received ${typeof e == "string" ? `"${e}"` : e}`);
40732
- throw o2.sapCode = "E22", o2;
40837
+ let i2 = new Error(`format "${t}" received ${typeof e == "string" ? `"${e}"` : e}`);
40838
+ throw i2.sapCode = "E22", i2;
40733
40839
  }
40734
40840
  }
40735
40841
  return n2(e);
40736
40842
  }
40737
- function se3() {
40738
- return [At2, K2, ne3, Ge3, Xe3, Ke3, Je3, Qe3, Ze3];
40843
+ function ge2() {
40844
+ return [Lt2, tt3, he3, cr2, fr2, lr2, dr2, pr2, mr2];
40739
40845
  }
40740
- var er2 = ["state", "item", "el", "root", "fmt", "num", "sum", "count", "avg", "min", "max", "plural", "days"], Rt3 = /* @__PURE__ */ new Map(), ie3 = /\bstate\.([a-z][a-z0-9_]*)/g, ae3 = /\bitem\.([a-z][a-z0-9_]*)/g;
40741
- function rr2(t) {
40846
+ var br2 = ["state", "item", "el", "root", "fmt", "num", "sum", "count", "avg", "min", "max", "plural", "days"], Bt3 = /* @__PURE__ */ new Map(), we3 = /\bstate\.([a-z][a-z0-9_]*)/g, ye3 = /\bitem\.([a-z][a-z0-9_]*)/g;
40847
+ function gr2(t) {
40742
40848
  let e = /* @__PURE__ */ new Set(), n2 = /* @__PURE__ */ new Set(), r;
40743
- for (ie3.lastIndex = 0; r = ie3.exec(t); ) e.add(r[1]);
40744
- for (ae3.lastIndex = 0; r = ae3.exec(t); ) n2.add(r[1]);
40849
+ for (we3.lastIndex = 0; r = we3.exec(t); ) e.add(r[1]);
40850
+ for (ye3.lastIndex = 0; r = ye3.exec(t); ) n2.add(r[1]);
40745
40851
  return { state: e, item: n2 };
40746
40852
  }
40747
- function P2(t, e = false) {
40748
- let n2 = (e ? "!" : "") + t, r = Rt3.get(n2);
40853
+ function H2(t, e = false) {
40854
+ let n2 = (e ? "!" : "") + t, r = Bt3.get(n2);
40749
40855
  if (r) return r;
40750
- Rt3.size > 512 && Rt3.clear();
40856
+ Bt3.size > 512 && Bt3.clear();
40751
40857
  try {
40752
- let o2 = e ? `"use strict";
40858
+ let i2 = e ? `"use strict";
40753
40859
  ${t}` : `"use strict"; return (${t});`;
40754
- r = { fn: new Function(...er2, o2), src: t, statement: e, deps: rr2(t), error: null };
40755
- } catch (o2) {
40756
- r = { fn: null, src: t, statement: e, deps: { state: /* @__PURE__ */ new Set(), item: /* @__PURE__ */ new Set() }, error: o2 };
40860
+ r = { fn: new Function(...br2, i2), src: t, statement: e, deps: gr2(t), error: null };
40861
+ } catch (i2) {
40862
+ r = { fn: null, src: t, statement: e, deps: { state: /* @__PURE__ */ new Set(), item: /* @__PURE__ */ new Set() }, error: i2 };
40757
40863
  }
40758
- return Rt3.set(n2, r), r;
40864
+ return Bt3.set(n2, r), r;
40759
40865
  }
40760
- function G3(t, e) {
40866
+ function J3(t, e) {
40761
40867
  if (t.error) throw t.error;
40762
- return t.fn(e.state, e.item, e.el ?? null, e.root, ...se3());
40868
+ return t.fn(e.state, e.item, e.el ?? null, e.root, ...ge2());
40763
40869
  }
40764
- function ue3(t) {
40870
+ function Ae3(t) {
40765
40871
  let e = /* @__PURE__ */ new Map();
40766
- for (let u2 of t) e.set(u2.name, u2);
40767
- let n2 = [], r = /* @__PURE__ */ new Map(), o2 = [];
40768
- function a(u2) {
40769
- let R2 = r.get(u2.name);
40872
+ for (let a of t) e.set(a.name, a);
40873
+ let n2 = [], r = /* @__PURE__ */ new Map(), i2 = [];
40874
+ function s2(a) {
40875
+ let R2 = r.get(a.name);
40770
40876
  if (R2 !== 1) {
40771
40877
  if (R2 === 0) {
40772
- let k2 = [...o2.slice(o2.indexOf(u2.name)), u2.name].join(" -> "), y2 = new Error(`calc: cycle: ${k2}`);
40773
- throw y2.sapCode = "E07", y2.cycle = k2, y2;
40878
+ let k2 = [...i2.slice(i2.indexOf(a.name)), a.name].join(" -> "), A2 = new Error(`calc: cycle: ${k2}`);
40879
+ throw A2.sapCode = "E07", A2.cycle = k2, A2;
40774
40880
  }
40775
- r.set(u2.name, 0), o2.push(u2.name);
40776
- for (let k2 of u2.entry.deps.state) {
40777
- let y2 = e.get(k2);
40778
- y2 && y2 !== u2 && a(y2);
40881
+ r.set(a.name, 0), i2.push(a.name);
40882
+ for (let k2 of a.entry.deps.state) {
40883
+ let A2 = e.get(k2);
40884
+ A2 && A2 !== a && s2(A2);
40779
40885
  }
40780
- for (let k2 of u2.entry.deps.item) {
40781
- let y2 = e.get(k2);
40782
- y2 && y2 !== u2 && a(y2);
40886
+ for (let k2 of a.entry.deps.item) {
40887
+ let A2 = e.get(k2);
40888
+ A2 && A2 !== a && s2(A2);
40783
40889
  }
40784
- o2.pop(), r.set(u2.name, 1), n2.push(u2);
40890
+ i2.pop(), r.set(a.name, 1), n2.push(a);
40785
40891
  }
40786
40892
  }
40787
- for (let u2 of t) a(u2);
40893
+ for (let a of t) s2(a);
40788
40894
  return n2;
40789
40895
  }
40790
- function ce3(t) {
40896
+ function Ee3(t) {
40791
40897
  return (t.getAttribute("type") || "text").toLowerCase();
40792
40898
  }
40793
- function lt3(t) {
40899
+ function wt3(t) {
40794
40900
  let e = t.tagName;
40795
40901
  if (e === "INPUT") {
40796
- let n2 = ce3(t);
40902
+ let n2 = Ee3(t);
40797
40903
  n2 === "checkbox" || n2 === "radio" ? t.checked ? t.setAttribute("checked", "") : t.removeAttribute("checked") : t.setAttribute("value", t.value);
40798
40904
  return;
40799
40905
  }
@@ -40806,10 +40912,10 @@ ${t}` : `"use strict"; return (${t});`;
40806
40912
  for (let r = 0; r < n2.length; r++) n2[r].selected ? n2[r].setAttribute("selected", "") : n2[r].removeAttribute("selected");
40807
40913
  }
40808
40914
  }
40809
- function fe3(t, e = t) {
40915
+ function ve3(t, e = t) {
40810
40916
  let n2 = t.tagName;
40811
40917
  if (n2 === "INPUT") {
40812
- let r = ce3(t);
40918
+ let r = Ee3(t);
40813
40919
  r === "checkbox" || r === "radio" ? e.checked ? t.hasAttribute("checked") || t.setAttribute("checked", "") : t.removeAttribute("checked") : e.value !== (t.getAttribute("value") ?? "") && t.setAttribute("value", e.value);
40814
40920
  return;
40815
40921
  }
@@ -40821,77 +40927,77 @@ ${t}` : `"use strict"; return (${t});`;
40821
40927
  return;
40822
40928
  }
40823
40929
  if (n2 === "SELECT") {
40824
- let r = t.options, o2 = e.options;
40825
- for (let a = 0; a < r.length; a++) o2[a] && o2[a].selected ? r[a].hasAttribute("selected") || r[a].setAttribute("selected", "") : r[a].removeAttribute("selected");
40930
+ let r = t.options, i2 = e.options;
40931
+ for (let s2 = 0; s2 < r.length; s2++) i2[s2] && i2[s2].selected ? r[s2].hasAttribute("selected") || r[s2].setAttribute("selected", "") : r[s2].removeAttribute("selected");
40826
40932
  }
40827
40933
  }
40828
- function Ct3(t) {
40934
+ function qt3(t) {
40829
40935
  t.tagName !== "TEXTAREA" || !t.hasAttribute("data-value") || t !== t.ownerDocument.activeElement && (t.textContent = t.getAttribute("data-value"), t.removeAttribute("data-value"));
40830
40936
  }
40831
- function j2(t) {
40937
+ function X2(t) {
40832
40938
  if (typeof window > "u") return null;
40833
40939
  let e = window.clay, n2 = window.hyperclay;
40834
40940
  return t === "consent" ? e?.confirm || n2?.consent || null : e?.[t] || n2?.[t] || null;
40835
40941
  }
40836
- var Ut3 = ["clay:mutation-ready", "hyperclay:mutation-ready"], nr2 = ["clay:sync-applied", "hyperclay:livesync-applied"], or2 = ["clay:ready", "hyperclay:ready"];
40837
- function vt2(t, e, n2) {
40838
- let r = null, o2 = (a) => {
40839
- r !== null && r !== a.type || (r = a.type, queueMicrotask(() => {
40942
+ var Zt3 = ["clay:mutation-ready", "hyperclay:mutation-ready"], wr2 = ["clay:sync-applied", "hyperclay:livesync-applied"], yr2 = ["clay:ready", "hyperclay:ready"], Ar2 = ["clay:route"];
40943
+ function yt3(t, e, n2) {
40944
+ let r = null, i2 = (s2) => {
40945
+ r !== null && r !== s2.type || (r = s2.type, queueMicrotask(() => {
40840
40946
  r = null;
40841
- }), n2(a));
40947
+ }), n2(s2));
40842
40948
  };
40843
- for (let a of e) t.addEventListener(a, o2);
40949
+ for (let s2 of e) t.addEventListener(s2, i2);
40844
40950
  return () => {
40845
- for (let a of e) t.removeEventListener(a, o2);
40951
+ for (let s2 of e) t.removeEventListener(s2, i2);
40846
40952
  };
40847
40953
  }
40848
- function le3(t) {
40954
+ function Se3(t) {
40849
40955
  let e = typeof window < "u" && window.clay && window.clay.ready;
40850
40956
  e && typeof e.then == "function" ? e.then(() => t(), () => t()) : t();
40851
40957
  }
40852
- function Mt3(t) {
40853
- let e = j2("region");
40958
+ function Vt3(t) {
40959
+ let e = X2("region");
40854
40960
  return !e || typeof e.resolveRegionPolicy != "function" || typeof e.skipForPolicy != "function" ? false : e.skipForPolicy(e.resolveRegionPolicy(t), void 0, ["no-save", "freeze"]);
40855
40961
  }
40856
- function de3() {
40857
- let t = j2("consent");
40962
+ function xe3() {
40963
+ let t = X2("consent");
40858
40964
  return typeof t == "function" ? t : null;
40859
40965
  }
40860
- function pe3(t, e) {
40966
+ function ke3(t, e) {
40861
40967
  if (typeof e != "function") throw new Error("Sap.batch(label, fn): fn must be a function");
40862
- let n2 = j2("undo");
40968
+ let n2 = X2("undo");
40863
40969
  n2 && n2.flush && n2.flush();
40864
40970
  let r = e();
40865
40971
  if (r && typeof r.then == "function") throw new Error("Sap.batch fn must be synchronous (it returned a promise)");
40866
40972
  return n2 && n2.commitCaptured && n2.commitCaptured(t), r;
40867
40973
  }
40868
- function me3(t) {
40974
+ function $e3(t) {
40869
40975
  if (typeof window > "u" || typeof document > "u") return;
40870
40976
  let e = () => {
40871
- let a = false;
40872
- for (let u2 of t.apps()) u2.root.isConnected ? t.runNow(u2, "platform") : a = true;
40873
- a && (t.pruneDisconnected(), t.remountIfPresent());
40977
+ let s2 = false;
40978
+ for (let a of t.apps()) a.root.isConnected ? t.runNow(a, "platform") : s2 = true;
40979
+ s2 && (t.pruneDisconnected(), t.remountIfPresent());
40874
40980
  };
40875
- vt2(document, nr2, e);
40981
+ yt3(document, wr2, e), yt3(document, Ar2, e);
40876
40982
  let n2 = false, r = () => {
40877
- }, o2 = () => {
40983
+ }, i2 = () => {
40878
40984
  if (n2) return true;
40879
- let a = j2("undo");
40880
- if (!a || typeof a.on != "function") return false;
40881
- let u2 = a.on("undo", e);
40882
- return typeof u2 != "function" ? false : typeof a.on("redo", e) != "function" ? (u2(), false) : (n2 = true, r(), true);
40985
+ let s2 = X2("undo");
40986
+ if (!s2 || typeof s2.on != "function") return false;
40987
+ let a = s2.on("undo", e);
40988
+ return typeof a != "function" ? false : typeof s2.on("redo", e) != "function" ? (a(), false) : (n2 = true, r(), true);
40883
40989
  };
40884
- if (!o2()) {
40885
- let a = vt2(document, Ut3, o2), u2 = vt2(document, or2, o2);
40990
+ if (!i2()) {
40991
+ let s2 = yt3(document, Zt3, i2), a = yt3(document, yr2, i2);
40886
40992
  r = () => {
40887
- a(), u2();
40993
+ s2(), a();
40888
40994
  };
40889
- let R2 = j2("ready");
40890
- R2 && typeof R2.then == "function" && R2.then(o2, () => {
40995
+ let R2 = X2("ready");
40996
+ R2 && typeof R2.then == "function" && R2.then(i2, () => {
40891
40997
  });
40892
40998
  }
40893
40999
  }
40894
- function sr2(t) {
41000
+ function Er2(t) {
40895
41001
  let e = t.tagName;
40896
41002
  if (e === "INPUT") {
40897
41003
  let n2 = (t.getAttribute("type") || "text").toLowerCase();
@@ -40899,20 +41005,20 @@ ${t}` : `"use strict"; return (${t});`;
40899
41005
  }
40900
41006
  return e === "TEXTAREA" ? "text" : e === "SELECT" ? t.multiple ? "select-multiple" : "select-one" : "leaf";
40901
41007
  }
40902
- function ir2(t) {
41008
+ function vr2(t) {
40903
41009
  if (t.validity && t.validity.badInput) return t.hasAttribute("value") ? Number(t.getAttribute("value")) || 0 : t._sapLastGood ?? 0;
40904
41010
  if (t.value === "") return 0;
40905
41011
  let e = Number(t.value);
40906
41012
  return Number.isNaN(e) ? t._sapLastGood ?? 0 : (t._sapLastGood = e, e);
40907
41013
  }
40908
- function ar2(t, e) {
41014
+ function Sr2(t, e) {
40909
41015
  switch (e) {
40910
41016
  case "checkbox":
40911
41017
  return t.checked;
40912
41018
  case "radio":
40913
41019
  return t.checked ? t.value : void 0;
40914
41020
  case "number":
40915
- return ir2(t);
41021
+ return vr2(t);
40916
41022
  case "select-one":
40917
41023
  return t.value;
40918
41024
  case "select-multiple":
@@ -40926,7 +41032,7 @@ ${t}` : `"use strict"; return (${t});`;
40926
41032
  return t.value;
40927
41033
  }
40928
41034
  }
40929
- function ur2(t, e, n2) {
41035
+ function xr2(t, e, n2) {
40930
41036
  switch (e) {
40931
41037
  case "checkbox":
40932
41038
  t.checked = !!n2;
@@ -40944,7 +41050,7 @@ ${t}` : `"use strict"; return (${t});`;
40944
41050
  break;
40945
41051
  case "select-multiple": {
40946
41052
  let r = new Set((Array.isArray(n2) ? n2 : [n2]).map(String));
40947
- for (let o2 of t.options) o2.selected = r.has(o2.value);
41053
+ for (let i2 of t.options) i2.selected = r.has(i2.value);
40948
41054
  break;
40949
41055
  }
40950
41056
  case "leaf":
@@ -40954,91 +41060,28 @@ ${t}` : `"use strict"; return (${t});`;
40954
41060
  t.value = n2 == null ? "" : String(n2);
40955
41061
  }
40956
41062
  }
40957
- function he3(t) {
41063
+ function _e3(t) {
40958
41064
  if (t.hasAttribute("transient")) {
40959
41065
  t.removeAttribute("value"), t.removeAttribute("checked"), t.removeAttribute("data-value");
40960
41066
  return;
40961
41067
  }
40962
- Mt3(t) || lt3(t);
41068
+ Vt3(t) || wt3(t);
40963
41069
  }
40964
- function cr2(t) {
41070
+ function kr2(t) {
40965
41071
  t.dispatchEvent(new Event("input", { bubbles: true })), t.dispatchEvent(new Event("change", { bubbles: true }));
40966
41072
  }
40967
- function F2(t) {
40968
- let e = sr2(t);
41073
+ function P2(t) {
41074
+ let e = Er2(t);
40969
41075
  return { el: t, kind: e, read() {
40970
- return ar2(t, e);
41076
+ return Sr2(t, e);
40971
41077
  }, write(n2, r = {}) {
40972
- ur2(t, e, n2), r.noMirror || he3(t), r.silent || cr2(t);
41078
+ xr2(t, e, n2), r.noMirror || _e3(t), r.silent || kr2(t);
40973
41079
  }, mirror() {
40974
- he3(t);
41080
+ _e3(t);
40975
41081
  } };
40976
41082
  }
40977
- var Vt3 = { E01: { slug: "foreign-dialect", behavior: "HALT" }, E02: { slug: "moustaches-in-text", behavior: "HALT" }, E04: { slug: "duplicate-declaration", behavior: "HALT" }, E05: { slug: "reserved-name", behavior: "HALT" }, E06: { slug: "global-html-name", behavior: "HALT" }, E07: { slug: "calc-cycle", behavior: "ERR" }, E08: { slug: "expression-syntax", behavior: "HALT" }, E10: { slug: "orphan-item", behavior: "HALT" }, E12: { slug: "unknown-state-key", behavior: "ERR" }, E15: { slug: "write-to-undeclared-key", behavior: "ERR" }, E16: { slug: "write-to-computed-field", behavior: "ERR" }, E17: { slug: "unresolvable-action-target", behavior: "HALT" }, E18: { slug: "paint-on-form-control", behavior: "HALT" }, E20: { slug: "bind-on-non-control", behavior: "HALT" }, E22: { slug: "format-type", behavior: "ERR" }, E24: { slug: "runtime-expression-throw", behavior: "ERR" }, E26: { slug: "circuit-breaker", behavior: "HALT" }, E30: { slug: "attr-on-bound-control", behavior: "HALT" }, E31: { slug: "password-without-transient", behavior: "HALT" }, E32: { slug: "file-bind", behavior: "HALT" }, E33: { slug: "dialog-state-open", behavior: "HALT" }, E34: { slug: "transient-persist-collision", behavior: "HALT" }, E40: { slug: "each-not-array", behavior: "ERR" }, E41: { slug: "each-bad-key", behavior: "ERR" }, E42: { slug: "each-template", behavior: "ERR" }, E43: { slug: "bind-in-each-row", behavior: "ERR" }, W03: { slug: "unknown-colon-attribute", behavior: "WARN" }, W04: { slug: "expression-in-when", behavior: "WARN" }, W30: { slug: "nonzero-mount-writes", behavior: "WARN" } }, Dt3 = ["disabled", "readonly", "required", "checked", "selected", "multiple", "open", "inert", "autofocus", "novalidate", "hidden"], Et3 = /* @__PURE__ */ new Set(["title", "style", "hidden", "lang", "dir", "translate", "class", "id", "nonce", "autofocus", "tabindex", "contenteditable", "spellcheck", "draggable", "role", "slot", "part", "name", "value", "type", "itemscope", "itemtype", "itemid", "itemprop", "itemref"]), It3 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "calc", "text", "show", "attr", "set", "trigger", "move", "sort", "detail", "each", "effect", "invalid", "confirm", "transient", "default", "persist", "sortable", "editmode"]);
40978
- function Wt3(t) {
40979
- if (!t || t.nodeType !== 1) return "?";
40980
- if (t.id) return `${t.tagName.toLowerCase()}#${t.id}`;
40981
- let e = [], n2 = t, r = 0;
40982
- for (; n2 && n2.nodeType === 1 && r < 4; ) {
40983
- let o2 = n2.tagName.toLowerCase();
40984
- if (n2.hasAttribute("sap")) o2 += "[sap]";
40985
- else if (n2.parentElement) {
40986
- let a = [...n2.parentElement.children].filter((u2) => u2.tagName === n2.tagName);
40987
- a.length > 1 && (o2 += `:nth-of-type(${a.indexOf(n2) + 1})`);
40988
- }
40989
- if (e.unshift(o2), n2.hasAttribute("sap")) break;
40990
- n2 = n2.parentElement, r++;
40991
- }
40992
- return e.join(" > ");
40993
- }
40994
- function be3(t) {
40995
- let e = t.toLowerCase();
40996
- return /^x-text$|^x-html$/.test(e) ? 'use text="state.x" (Sap paints text only)' : /^x-show$|^v-show$|^v-if$/.test(e) ? 'use show="expr" (toggles native hidden)' : /^x-model$|^v-model$/.test(e) ? 'use bind="field"' : /^@|^x-on:|^v-on:|^on:/.test(e) ? "use native onclick + Sap(this) (no event directive)" : /^:|^x-bind:class$|^v-bind:class$/.test(e) ? 'use class:NAME="expr" or attr:NAME="expr"' : /^x-for$|^v-for$/.test(e) ? 'use items="name" on the container and item template on the row' : /^x-data$/.test(e) ? "declare state with state= / bind / items (no JS state object)" : /^x-init$/.test(e) ? "use a <script> or onclick + Sap(this)" : /^bind:/.test(e) ? 'use bind="field"; one-way paint is attr:NAME="expr"' : /^x-/.test(e) || /^v-/.test(e) ? "this is a foreign-dialect attribute; Sap has no x-/v- attributes" : null;
40997
- }
40998
- var dt3 = class {
40999
- constructor(e) {
41000
- this.appName = e, this.errors = [], this.warnings = [], this.halted = false, this.haltReason = null;
41001
- }
41002
- block(e, n2, r = {}) {
41003
- let o2 = (Vt3[e] || {}).slug || "error", a = { code: e, slug: o2, el: Wt3(n2), attr: r.attr || null, expr: r.expr || null, key: r.key || null, problem: r.problem || "", didYouMean: r.didYouMean || null, fix: r.fix || null, phase: r.phase || "runtime" }, u2 = [`
41004
- ` + (e[0] === "W" ? "sap \u26A0 " : "sap \u2717 ") + e + " " + o2];
41005
- return u2.push(` at ${a.el}${a.attr ? ` \u2014 ${a.attr}="${a.expr ?? ""}"` : ""}`), a.problem && u2.push(` problem: ${a.problem}`), a.didYouMean && u2.push(` did you mean: ${a.didYouMean}`), a.fix && u2.push(` fix: ${a.fix}`), console.error(u2.join(`
41006
- `)), a;
41007
- }
41008
- error(e, n2, r = {}) {
41009
- let o2 = this.block(e, n2, r);
41010
- return this.errors.push(o2), o2;
41011
- }
41012
- warn(e, n2, r = {}) {
41013
- let o2 = this.block(e, n2, r);
41014
- return this.warnings.push(o2), o2;
41015
- }
41016
- report() {
41017
- return { ok: this.errors.length === 0 && !this.halted, app: this.appName, halted: this.halted, haltReason: this.haltReason, errors: this.errors.slice(), warnings: this.warnings.slice() };
41018
- }
41019
- };
41020
- function at3(t, e) {
41021
- t && t.getAttribute("sap-error") !== e && t.setAttribute("sap-error", e);
41022
- }
41023
- function Ot3(t) {
41024
- t && t.hasAttribute("sap-error") && t.removeAttribute("sap-error");
41025
- }
41026
- function St3(t, e) {
41027
- let n2 = null, r = 3;
41028
- for (let o2 of e) {
41029
- let a = fr2(t, o2);
41030
- a < r && (r = a, n2 = o2);
41031
- }
41032
- return n2;
41033
- }
41034
- function fr2(t, e) {
41035
- let n2 = t.length, r = e.length, o2 = Array.from({ length: n2 + 1 }, (a, u2) => [u2, ...new Array(r).fill(0)]);
41036
- for (let a = 0; a <= r; a++) o2[0][a] = a;
41037
- for (let a = 1; a <= n2; a++) for (let u2 = 1; u2 <= r; u2++) o2[a][u2] = Math.min(o2[a - 1][u2] + 1, o2[a][u2 - 1] + 1, o2[a - 1][u2 - 1] + (t[a - 1] === e[u2 - 1] ? 0 : 1));
41038
- return o2[n2][r];
41039
- }
41040
- var et3 = null, Ft3 = false, pt3 = null;
41041
- function ge2(t) {
41083
+ var ot3 = null, Ht3 = false, At2 = null;
41084
+ function Te3(t) {
41042
41085
  let e = null;
41043
41086
  return { kind: "hub", subscribe(n2) {
41044
41087
  let r = t.onAnyChange({ debounce: 0, require: "observed" }, n2);
@@ -41060,14 +41103,14 @@ ${t}` : `"use strict"; return (${t});`;
41060
41103
  }
41061
41104
  } };
41062
41105
  }
41063
- function lr2() {
41106
+ function $r2() {
41064
41107
  let t = null;
41065
41108
  return { kind: "native", subscribe(e) {
41066
- t = new MutationObserver((r) => e(dr2(r)));
41109
+ t = new MutationObserver((r) => e(_r2(r)));
41067
41110
  let n2 = typeof document < "u" && document.body || typeof document < "u" && document.documentElement;
41068
41111
  n2 && t.observe(n2, { childList: true, subtree: true, attributes: true, characterData: true });
41069
41112
  }, suppress(e) {
41070
- let n2 = j2("undo");
41113
+ let n2 = X2("undo");
41071
41114
  n2 && n2.pause && n2.pause();
41072
41115
  try {
41073
41116
  return e();
@@ -41078,36 +41121,36 @@ ${t}` : `"use strict"; return (${t});`;
41078
41121
  t && (t.disconnect(), t = null);
41079
41122
  } };
41080
41123
  }
41081
- function dr2(t) {
41124
+ function _r2(t) {
41082
41125
  let e = [];
41083
41126
  for (let n2 of t) if (n2.type === "attributes") {
41084
41127
  let r = n2.target;
41085
- r && r.nodeType === 1 && !Pt3(r) && e.push({ type: "attribute", element: r });
41128
+ r && r.nodeType === 1 && !zt3(r) && e.push({ type: "attribute", element: r });
41086
41129
  } else if (n2.type === "characterData") {
41087
41130
  let r = n2.target && n2.target.parentElement;
41088
- r && !Pt3(r) && e.push({ type: "characterData", element: r });
41131
+ r && !zt3(r) && e.push({ type: "characterData", element: r });
41089
41132
  } else if (n2.type === "childList") {
41090
- for (let r of n2.addedNodes) if (!(r.nodeType !== 1 || Pt3(r)) && (e.push({ type: "add", element: r }), r.querySelectorAll)) for (let o2 of r.querySelectorAll("*")) Pt3(o2) || e.push({ type: "add", element: o2 });
41133
+ for (let r of n2.addedNodes) if (!(r.nodeType !== 1 || zt3(r)) && (e.push({ type: "add", element: r }), r.querySelectorAll)) for (let i2 of r.querySelectorAll("*")) zt3(i2) || e.push({ type: "add", element: i2 });
41091
41134
  for (let r of n2.removedNodes) r.nodeType === 1 && e.push({ type: "remove", element: r, parent: n2.target });
41092
41135
  }
41093
41136
  return e;
41094
41137
  }
41095
- function Pt3(t) {
41138
+ function zt3(t) {
41096
41139
  return !!(t.closest && t.closest("[sap-ignore],[template]"));
41097
41140
  }
41098
- function pr2(t, e) {
41141
+ function Tr2(t, e) {
41099
41142
  t.pruneDisconnected();
41100
41143
  let n2 = /* @__PURE__ */ new Set(), r = false;
41101
- for (let o2 of e) {
41102
- let a = o2.type === "remove" ? o2.parent : o2.element, u2 = a && t.appFor(a);
41103
- u2 && n2.add(u2), o2.type === "add" && o2.element && o2.element.nodeType === 1 && o2.element.hasAttribute && o2.element.hasAttribute("sap") && !(t.isRegistered && t.isRegistered(o2.element)) && (r = true);
41144
+ for (let i2 of e) {
41145
+ let s2 = i2.type === "remove" ? i2.parent : i2.element, a = s2 && t.appFor(s2);
41146
+ a && n2.add(a), i2.type === "add" && i2.element && i2.element.nodeType === 1 && i2.element.hasAttribute && i2.element.hasAttribute("sap") && !(t.isRegistered && t.isRegistered(i2.element)) && (r = true);
41104
41147
  }
41105
41148
  r && t.remountIfPresent();
41106
- for (let o2 of n2) o2.root.isConnected && t.schedule(o2, "mutation");
41149
+ for (let i2 of n2) i2.root.isConnected && t.schedule(i2, "mutation");
41107
41150
  }
41108
- function we3(t) {
41109
- if (et3) return et3.suppress(t);
41110
- let e = j2("undo");
41151
+ function Ne3(t) {
41152
+ if (ot3) return ot3.suppress(t);
41153
+ let e = X2("undo");
41111
41154
  if (e && e.pause && e.resume) {
41112
41155
  e.pause();
41113
41156
  try {
@@ -41118,258 +41161,286 @@ ${t}` : `"use strict"; return (${t});`;
41118
41161
  }
41119
41162
  return t();
41120
41163
  }
41121
- function Yt3(t, e) {
41122
- Ft3 = true, et3 = t, t.subscribe((n2) => pr2(e, n2));
41164
+ function te3(t, e) {
41165
+ Ht3 = true, ot3 = t, t.subscribe((n2) => Tr2(e, n2));
41123
41166
  }
41124
- function Gt2(t) {
41125
- if (Ft3 || typeof window > "u" || typeof document > "u") return;
41126
- let e = j2("Mutation");
41167
+ function ee3(t) {
41168
+ if (Ht3 || typeof window > "u" || typeof document > "u") return;
41169
+ let e = X2("Mutation");
41127
41170
  if (e && typeof e.onAnyChange == "function") {
41128
- Yt3(ge2(e), t);
41171
+ te3(Te3(e), t);
41129
41172
  return;
41130
41173
  }
41131
- typeof MutationObserver == "function" && (Yt3(lr2(), t), pt3 = vt2(document, Ut3, function() {
41132
- let r = j2("Mutation");
41133
- r && (pt3(), pt3 = null, et3 && et3.teardown(), Ft3 = false, Yt3(ge2(r), t));
41174
+ typeof MutationObserver == "function" && (te3($r2(), t), At2 = yt3(document, Zt3, function() {
41175
+ let r = X2("Mutation");
41176
+ r && (At2(), At2 = null, ot3 && ot3.teardown(), Ht3 = false, te3(Te3(r), t));
41134
41177
  }));
41135
41178
  }
41136
- function ye3() {
41137
- if (et3) try {
41138
- et3.teardown();
41179
+ function Le3() {
41180
+ if (ot3) try {
41181
+ ot3.teardown();
41139
41182
  } catch {
41140
41183
  }
41141
- pt3 && typeof document < "u" && pt3(), et3 = null, Ft3 = false, pt3 = null;
41184
+ At2 && typeof document < "u" && At2(), ot3 = null, Ht3 = false, At2 = null;
41142
41185
  }
41143
- var Ee3 = new Set(Dt3);
41144
- function mt3(t, e = {}) {
41186
+ var Nr2 = new Set(mt3);
41187
+ function Et3(t, e = {}) {
41145
41188
  if (e.breaker) {
41146
- t.diag.error("E26", t.root, { problem: "recompute loop halted after 50 passes; recent triggers: " + (t._breakerRing || []).join(", ") }), at3(t.root, "loop");
41189
+ t.diag.error("E26", t.root, { problem: "recompute loop halted after 50 passes; recent triggers: " + (t._breakerRing || []).join(", ") }), ut3(t.root, "loop");
41147
41190
  return;
41148
41191
  }
41149
- we3(() => mr2(t, e)), t._viewsChanged && (t._viewsChanged = false, t.root.dispatchEvent(new CustomEvent("sap:views-updated", { bubbles: true })));
41192
+ Ne3(() => Lr2(t, e)), t._viewsChanged && (t._viewsChanged = false, t.root.dispatchEvent(new CustomEvent("sap:views-updated", { bubbles: true })));
41150
41193
  }
41151
- function mr2(t, e) {
41152
- let n2 = t.root, r = {}, o2 = [], a = [], u2 = [], R2 = [], k2 = [], y2 = [], f2 = [], w2 = /* @__PURE__ */ new Set();
41194
+ function Lr2(t, e) {
41195
+ let n2 = t.root, r = {}, i2 = [], s2 = [], a = [], R2 = [], k2 = [], A2 = [], f2 = [], w2 = /* @__PURE__ */ new Set();
41153
41196
  t.diag.errors = [];
41154
41197
  let N2 = { root: r, state: r, item: null, ownerEl: n2, projection: false };
41155
- function W3(s2, p2) {
41156
- let h = p2.attr || p2.name, d = s2.getAttribute(h);
41157
- return d == null && (d = p2.default != null ? p2.default : p2.type === "num" ? "0" : p2.type === "bool" ? "false" : "", k2.push({ el: s2, name: p2.name, attr: h, value: Nt3(it3(d, p2.type), p2.type) })), it3(d, p2.type);
41158
- }
41159
- function b(s2, p2) {
41160
- let h = q3(s2.getAttribute("state") || "");
41161
- s2._sapStateDecls = h;
41162
- for (let d of h) {
41163
- if (d.type === "string" && Ee3.has(d.attr) && typeof s2[d.attr] == "boolean") {
41164
- p2[d.name] = s2.hasAttribute(d.attr);
41198
+ function I3(o2, p2) {
41199
+ let l = p2.attr || p2.name, g = o2.getAttribute(l);
41200
+ return g == null && (g = $t3(p2), k2.push({ el: o2, name: p2.name, attr: l, value: Jt3(ct3(g, p2.type), p2.type) })), ct3(g, p2.type);
41201
+ }
41202
+ function W3(o2, p2) {
41203
+ let l = z2(o2.getAttribute("state") || "");
41204
+ o2._sapStateDecls = l;
41205
+ for (let g of l) {
41206
+ if (g.transient) {
41207
+ p2[g.name] = Pt3(o2, g);
41165
41208
  continue;
41166
41209
  }
41167
- if (d.transient) {
41168
- p2[d.name] = Tt3(s2, d);
41210
+ if (gt3(o2, g)) {
41211
+ p2[g.name] = o2.hasAttribute(g.attr);
41169
41212
  continue;
41170
41213
  }
41171
- p2[d.name] = W3(s2, d);
41172
- }
41173
- }
41174
- function g(s2, p2) {
41175
- if (!s2.hasAttribute("bind")) return;
41176
- let h = s2.getAttribute("bind"), d = p2.item || p2.state, _ = F2(s2);
41177
- _.kind === "radio" ? (h in d || (d[h] = ""), s2.checked && (d[h] = s2.value)) : d[h] = _.read(), s2.hasAttribute("transient") && (s2.removeAttribute("value"), s2.removeAttribute("checked"));
41178
- }
41179
- function c2(s2, p2) {
41180
- for (let h of s2.attributes) {
41181
- let d = h.name, _ = h.value;
41182
- if (d.startsWith("calc:")) o2.push({ owner: p2.item || p2.state, ownerEl: p2.ownerEl, name: d.slice(5), entry: P2(_), el: s2, ctx: p2 });
41183
- else if (d === "text" || d.startsWith("text:")) a.push({ el: s2, kind: "text", fmt: d.includes(":") ? d.slice(5) : null, entry: P2(_), ctx: p2 });
41184
- else if (d === "show") a.push({ el: s2, kind: "show", entry: P2(_), ctx: p2 });
41185
- else if (d.startsWith("attr:")) a.push({ el: s2, kind: "attr", arg: d.slice(5), entry: P2(_), ctx: p2 });
41186
- else if (d.startsWith("class:")) a.push({ el: s2, kind: "class", arg: d.slice(6), entry: P2(_), ctx: p2 });
41187
- else if (d.startsWith("css:")) a.push({ el: s2, kind: "css", arg: d.slice(4), entry: P2(_), ctx: p2 });
41188
- else if (d === "effect") u2.push({ el: s2, entry: P2(_, true), ctx: p2 });
41189
- else if (d === "invalid") R2.push({ el: s2, entry: P2(_), ctx: p2 });
41190
- else if (d.startsWith("show-when:") || d.startsWith("option:")) {
41191
- let D2 = d.slice(d.indexOf(":") + 1);
41192
- w2.add(D2), a.push({ el: s2, kind: "when", match: "show", field: D2, values: _.split("|"), ctx: p2 });
41193
- } else if (d.startsWith("hide-when:")) {
41194
- let D2 = d.slice(d.indexOf(":") + 1);
41195
- w2.add(D2), a.push({ el: s2, kind: "when", match: "hide", field: D2, values: _.split("|"), ctx: p2 });
41196
- } else if (d.startsWith("option-not:")) {
41197
- let D2 = d.slice(d.indexOf(":") + 1);
41198
- w2.add(D2), a.push({ el: s2, kind: "when", match: "show-not", field: D2, values: _.split("|"), ctx: p2 });
41214
+ p2[g.name] = I3(o2, g);
41215
+ }
41216
+ }
41217
+ function h(o2, p2) {
41218
+ if (!o2.hasAttribute("bind")) return;
41219
+ let l = o2.getAttribute("bind"), g = p2.item || p2.state, L3 = P2(o2);
41220
+ L3.kind === "radio" ? (l in g || (g[l] = ""), o2.checked && (g[l] = o2.value)) : g[l] = L3.read(), o2.hasAttribute("transient") && (o2.removeAttribute("value"), o2.removeAttribute("checked"));
41221
+ }
41222
+ function d(o2, p2) {
41223
+ for (let l of o2.attributes) {
41224
+ let g = l.name, L3 = l.value;
41225
+ if (g.startsWith("calc:")) i2.push({ owner: p2.item || p2.state, ownerEl: p2.ownerEl, name: g.slice(5), entry: H2(L3), el: o2, ctx: p2 });
41226
+ else if (g === "text" || g.startsWith("text:")) s2.push({ el: o2, kind: "text", fmt: g.includes(":") ? g.slice(5) : null, entry: H2(L3), ctx: p2 });
41227
+ else if (g === "show") s2.push({ el: o2, kind: "show", entry: H2(L3), ctx: p2 });
41228
+ else if (g.startsWith("attr:")) s2.push({ el: o2, kind: "attr", arg: g.slice(5), entry: H2(L3), ctx: p2 });
41229
+ else if (g.startsWith("class:")) s2.push({ el: o2, kind: "class", arg: g.slice(6), entry: H2(L3), ctx: p2 });
41230
+ else if (g.startsWith("css:")) s2.push({ el: o2, kind: "css", arg: g.slice(4), entry: H2(L3), ctx: p2 });
41231
+ else if (g === "effect") a.push({ el: o2, entry: H2(L3, true), ctx: p2 });
41232
+ else if (g === "invalid") R2.push({ el: o2, entry: H2(L3), ctx: p2 });
41233
+ else if (g.startsWith("show-when:") || g.startsWith("option:")) {
41234
+ let C2 = g.slice(g.indexOf(":") + 1);
41235
+ w2.add(C2), s2.push({ el: o2, kind: "when", match: "show", field: C2, values: L3.split("|"), ctx: p2 });
41236
+ } else if (g.startsWith("hide-when:")) {
41237
+ let C2 = g.slice(g.indexOf(":") + 1);
41238
+ w2.add(C2), s2.push({ el: o2, kind: "when", match: "hide", field: C2, values: L3.split("|"), ctx: p2 });
41239
+ } else if (g.startsWith("option-not:")) {
41240
+ let C2 = g.slice(g.indexOf(":") + 1);
41241
+ w2.add(C2), s2.push({ el: o2, kind: "when", match: "show-not", field: C2, values: L3.split("|"), ctx: p2 });
41199
41242
  }
41200
41243
  }
41201
- p2.view && s2.hasAttribute("bind") && t.diag.error("E43", s2, { attr: "bind", expr: s2.getAttribute("bind"), problem: "bind inside an each row; rows are read-only views of the data", fix: "change the record with set:, Sap(el), or a detail panel" }), p2.projection && s2.hasAttribute("bind") && a.push({ el: s2, kind: "projection", field: s2.getAttribute("bind"), ctx: p2 });
41244
+ if (o2.hasAttribute("bind") && (p2.view || p2.projection) && !Ot3(o2)) {
41245
+ let l = o2.getAttribute("bind");
41246
+ p2.view ? bt3(de3(p2.item), l) ? (o2._sapViewBind = "item", s2.push({ el: o2, kind: "projection", field: l, ctx: p2, from: "item" })) : l in p2.state || l in p2.root ? (o2._sapViewBind = "drawn", s2.push({ el: o2, kind: "projection", field: l, ctx: p2, from: "drawn" })) : (o2._sapViewBind = null, t.diag.error("E43", o2, { attr: "bind", expr: l, problem: `bind="${l}" inside an each row matches no field of the row's record or of the scope the row is drawn in`, fix: "bind a field the record owns (bind, state= or items= on the [item]), or declare it with state= where the list is drawn" })) : s2.push({ el: o2, kind: "projection", field: l, ctx: p2 });
41247
+ }
41202
41248
  }
41203
- function A2(s2, p2, h) {
41204
- Object.defineProperty(s2, "$key", { value: xt3(p2, "row"), enumerable: false }), Object.defineProperty(s2, "$index", { value: h, enumerable: false }), Object.defineProperty(s2, "$el", { value: p2, enumerable: false });
41249
+ function m2(o2, p2, l) {
41250
+ Object.defineProperty(o2, "$key", { value: Mt3(p2, "row"), enumerable: false }), Object.defineProperty(o2, "$index", { value: l, enumerable: false }), Object.defineProperty(o2, "$el", { value: p2, enumerable: false });
41205
41251
  }
41206
- function x2(s2, p2, h) {
41207
- b(s2, p2), s2._sapScope = p2, !h.projection && s2.hasAttribute("bind") && g(s2, h), c2(s2, h), s2.hasAttribute("items") ? O2(s2, p2, h) : E2(s2, p2, h);
41252
+ function y2(o2, p2, l) {
41253
+ W3(o2, p2), o2._sapScope = p2, !l.projection && o2.hasAttribute("bind") && h(o2, l), d(o2, l), o2.hasAttribute("items") ? $3(o2, p2, l) : E2(o2, p2, l);
41208
41254
  }
41209
- function E2(s2, p2, h) {
41210
- Y2(s2, (d, _) => {
41211
- _ ? d.hasAttribute("scope") ? $3(d, p2, h) : d.hasAttribute("items") ? (c2(d, h), O2(d, p2, h)) : d.hasAttribute("detail") ? l(d, p2, h) : d.hasAttribute("each") && (c2(d, h), f2.push({ el: d, ctx: h })) : (!h.projection && !h.view && g(d, h), c2(d, h));
41255
+ function E2(o2, p2, l) {
41256
+ K2(o2, (g, L3) => {
41257
+ L3 ? g.hasAttribute("scope") ? x2(g, p2, l) : g.hasAttribute("items") ? (d(g, l), $3(g, p2, l)) : g.hasAttribute("detail") ? B2(g, p2, l) : g.hasAttribute("each") && (d(g, l), f2.push({ el: g, ctx: l })) : (!l.projection && !l.view && h(g, l), d(g, l));
41212
41258
  });
41213
41259
  }
41214
- function $3(s2, p2, h) {
41215
- let d = s2.getAttribute("scope"), _ = {};
41216
- p2[d] = _;
41217
- let D2 = { root: h.root, state: _, item: null, ownerEl: s2, projection: h.projection };
41218
- x2(s2, _, D2);
41219
- }
41220
- function O2(s2, p2, h) {
41221
- let d = s2.getAttribute("items"), _ = [];
41222
- p2[d] = _, s2._sapList = _, X2(s2).forEach((D2, ct3) => {
41223
- let V3 = {};
41224
- A2(V3, D2, ct3);
41225
- let tt3 = { root: h.root, state: h.state, item: V3, ownerEl: D2, projection: h.projection };
41226
- x2(D2, V3, tt3), _.push(V3);
41260
+ function x2(o2, p2, l) {
41261
+ let g = o2.getAttribute("scope"), L3 = {};
41262
+ p2[g] = L3;
41263
+ let C2 = { root: l.root, state: L3, item: null, ownerEl: o2, projection: l.projection };
41264
+ y2(o2, L3, C2);
41265
+ }
41266
+ function $3(o2, p2, l) {
41267
+ let g = o2.getAttribute("items"), L3 = [];
41268
+ p2[g] = L3, o2._sapList = L3, Z3(o2).forEach((C2, Q3) => {
41269
+ let q3 = {};
41270
+ m2(q3, C2, Q3);
41271
+ let rt3 = { root: l.root, state: l.state, item: q3, ownerEl: C2, projection: l.projection };
41272
+ y2(C2, q3, rt3), L3.push(q3);
41227
41273
  });
41228
41274
  }
41229
- function U3(s2, p2) {
41230
- let h = String(s2).split("."), d = p2.state;
41231
- for (let _ of h) d = d?.[_];
41232
- if (d === void 0) {
41233
- d = p2.root;
41234
- for (let _ of h) d = d?.[_];
41235
- }
41236
- return d;
41275
+ function O2(o2, p2) {
41276
+ let l = String(o2).split("."), g = (C2) => {
41277
+ for (let Q3 of l) {
41278
+ if (C2 == null) return;
41279
+ C2 = Array.isArray(C2) ? C2.flatMap((q3) => q3 && q3[Q3] != null ? q3[Q3] : []) : C2[Q3];
41280
+ }
41281
+ return C2;
41282
+ }, L3 = g(p2.state);
41283
+ return L3 === void 0 ? g(p2.root) : L3;
41237
41284
  }
41238
- function l(s2, p2, h) {
41239
- for (let d of q3(s2.getAttribute("state") || "")) d.name in p2 || (p2[d.name] = W3(s2, d));
41240
- y2.push({ el: s2, parentObj: p2, ctx: h });
41285
+ function B2(o2, p2, l) {
41286
+ for (let g of z2(o2.getAttribute("state") || "")) g.name in p2 || (p2[g.name] = gt3(o2, g) ? o2.hasAttribute(g.attr) : I3(o2, g));
41287
+ A2.push({ el: o2, parentObj: p2, ctx: l });
41241
41288
  }
41242
- function i2(s2, p2, h) {
41243
- s2._sapScope = p2;
41244
- let d = s2.getAttribute("detail") || "", _ = /^([\w.]+)\s+by\s+(.+)$/.exec(d);
41245
- if (!_) {
41246
- s2.hidden = true, s2._sapDetailRow = null;
41289
+ function c2(o2, p2, l) {
41290
+ o2._sapScope = p2;
41291
+ let g = o2.getAttribute("detail") || "", L3 = /^([\w.]+)\s+by\s+(.+)$/.exec(g);
41292
+ if (!L3) {
41293
+ o2.hidden = true, o2._sapDetailRow = null;
41247
41294
  return;
41248
41295
  }
41249
- let D2 = _[1], ct3 = _[2].trim(), V3 = U3(D2, h), tt3;
41296
+ let C2 = L3[1], Q3 = L3[2].trim(), q3 = O2(C2, l), rt3;
41250
41297
  try {
41251
- tt3 = G3(P2(ct3), { state: p2, item: h.item, el: s2, root: h.root });
41298
+ rt3 = J3(H2(Q3), { state: p2, item: l.item, el: o2, root: l.root });
41252
41299
  } catch {
41253
- tt3 = void 0;
41300
+ rt3 = void 0;
41254
41301
  }
41255
- let Q3 = Array.isArray(V3) ? V3.find((st3) => st3 && String(st3.$key) === String(tt3)) : null;
41256
- if (s2._sapDetailRow = Q3 ? Q3.$el : null, !Q3) {
41257
- s2.hidden || (s2.hidden = true);
41258
- return;
41302
+ let U3 = Array.isArray(q3) && rt3 != null ? q3.find((V3) => V3 && typeof V3 == "object" && V3.$el && String(V3.$key) === String(rt3)) : null;
41303
+ if (o2._sapDetailRow = U3 ? U3.$el : null, o2.tagName === "DIALOG") {
41304
+ let V3 = U3 ? String(U3.$key) : null;
41305
+ if (V3 !== o2._sapDetailKey && (o2._sapDetailKey = V3, o2._sapDismissed = false), !U3) {
41306
+ o2._sapOpenedFor = null, o2.open && typeof o2.close == "function" && (o2._sapEngineClose = true, o2.close());
41307
+ return;
41308
+ }
41309
+ o2.open ? o2._sapOpenedFor = V3 : (o2._sapOpenedFor === V3 && (o2._sapDismissed = true), o2._sapOpenedFor = null, !o2._sapDismissed && o2.isConnected && typeof o2.showModal == "function" && (o2.hidden && (o2.hidden = false), o2.showModal(), o2._sapOpenedFor = V3));
41310
+ } else {
41311
+ if (!U3) {
41312
+ o2.hidden || (o2.hidden = true);
41313
+ return;
41314
+ }
41315
+ o2.hidden && (o2.hidden = false);
41259
41316
  }
41260
- s2.hidden && (s2.hidden = false);
41261
- let ot3 = { root: h.root, state: p2, item: Q3, ownerEl: Q3.$el, projection: true };
41262
- c2(s2, ot3), E2(s2, Q3, ot3);
41317
+ let at3 = { root: l.root, state: p2, item: U3, ownerEl: U3.$el, projection: true };
41318
+ d(o2, at3), E2(o2, U3, at3);
41263
41319
  }
41264
- function m2(s2, p2) {
41265
- let h = [...s2.children].find((B2) => B2.tagName === "TEMPLATE"), d = h && h.content.children.length === 1 ? h.content.firstElementChild : null;
41266
- if (!d) return t.diag.error("E42", s2, { attr: "each", problem: "each needs one <template> child with exactly one element root" }), 0;
41267
- let _ = s2.getAttribute("each"), D2;
41320
+ function u2(o2, p2) {
41321
+ for (let l = o2.parentElement; l; l = l.parentElement) if (l._sapScope === p2 && !l.hasAttribute("detail") || l.hasAttribute("sap")) return l;
41322
+ return n2;
41323
+ }
41324
+ function b(o2, p2) {
41325
+ o2._sapDrawnEl = u2(o2, p2.state);
41326
+ let l = [...o2.children].find((j2) => j2.tagName === "TEMPLATE"), g = l && l.content.children.length === 1 ? l.content.firstElementChild : null;
41327
+ if (!g) return t.diag.error("E42", o2, { attr: "each", problem: "each needs one <template> child with exactly one element root" }), 0;
41328
+ let L3 = o2.getAttribute("each"), C2;
41268
41329
  try {
41269
- D2 = G3(P2(_), { state: p2.state, item: p2.item, el: s2, root: p2.root });
41270
- } catch (B2) {
41271
- return t.diag.error("E24", s2, { attr: "each", expr: _, problem: String(B2.message) }), 0;
41272
- }
41273
- if (!Array.isArray(D2)) return t.diag.error("E40", s2, { attr: "each", expr: _, problem: "each must evaluate to an array; the list keeps its last good rows" }), 0;
41274
- let ct3 = P2(s2.getAttribute("key") || "item.$key"), V3 = [], tt3 = /* @__PURE__ */ new Set();
41275
- for (let B2 of D2) {
41276
- let z2;
41330
+ C2 = J3(H2(L3), { state: p2.state, item: p2.item, el: o2, root: p2.root });
41331
+ } catch (j2) {
41332
+ return t.diag.error("E24", o2, { attr: "each", expr: L3, problem: String(j2.message) }), 0;
41333
+ }
41334
+ if (!Array.isArray(C2)) return t.diag.error("E40", o2, { attr: "each", expr: L3, problem: "each must evaluate to an array; the list keeps its last good rows" }), 0;
41335
+ let Q3 = H2(o2.getAttribute("key") || "item.$key"), q3 = [], rt3 = /* @__PURE__ */ new Set();
41336
+ for (let j2 of C2) {
41337
+ let G3;
41277
41338
  try {
41278
- z2 = G3(ct3, { state: p2.state, item: B2, el: s2, root: p2.root });
41339
+ G3 = J3(Q3, { state: p2.state, item: j2, el: o2, root: p2.root });
41279
41340
  } catch {
41280
- z2 = void 0;
41341
+ G3 = void 0;
41281
41342
  }
41282
- let M2 = z2 == null ? "" : String(z2);
41283
- if (M2 === "" || tt3.has(M2)) return t.diag.error("E41", s2, { attr: "key", expr: ct3.src, problem: M2 === "" ? "an item has no key; the list keeps its last good rows" : `duplicate key "${M2}"; the list keeps its last good rows` }), 0;
41284
- tt3.add(M2), V3.push(M2);
41285
- }
41286
- let Q3 = s2._sapEach || /* @__PURE__ */ new Map(), ot3 = /* @__PURE__ */ new Map(), st3 = 0, zt3 = h;
41287
- V3.forEach((B2, z2) => {
41288
- let M2 = Q3.get(B2);
41289
- if (!M2 || M2.parentElement !== s2) {
41290
- M2 = s2.ownerDocument.importNode(d, true);
41291
- let ht3 = (M2.getAttribute("clay") || "").split(/\s+/).filter(Boolean);
41292
- ht3.includes("editor-ui") || M2.setAttribute("clay", [...ht3, "editor-ui"].join(" ")), M2._sapEachRow = true, st3++;
41343
+ let M2 = G3 == null ? "" : String(G3);
41344
+ if (M2 === "" || rt3.has(M2)) return t.diag.error("E41", o2, { attr: "key", expr: Q3.src, problem: M2 === "" ? "an item has no key; the list keeps its last good rows" : `duplicate key "${M2}"; the list keeps its last good rows` }), 0;
41345
+ rt3.add(M2), q3.push(M2);
41346
+ }
41347
+ let U3 = o2._sapEach || /* @__PURE__ */ new Map(), at3 = /* @__PURE__ */ new Map(), V3 = 0, Gt2 = l;
41348
+ q3.forEach((j2, G3) => {
41349
+ let M2 = U3.get(j2);
41350
+ if (!M2 || M2.parentElement !== o2) {
41351
+ M2 = o2.ownerDocument.importNode(g, true);
41352
+ let vt2 = (M2.getAttribute("clay") || "").split(/\s+/).filter(Boolean);
41353
+ vt2.includes("editor-ui") || M2.setAttribute("clay", [...vt2, "editor-ui"].join(" ")), M2._sapEachRow = true, V3++;
41293
41354
  }
41294
- M2.getAttribute("data-key") !== B2 && M2.setAttribute("data-key", B2), zt3.nextElementSibling !== M2 && (Ar2(s2, M2, zt3), st3++), M2._sapEachItem = D2[z2], ot3.set(B2, M2), zt3 = M2;
41355
+ M2.getAttribute("data-key") !== j2 && M2.setAttribute("data-key", j2), Gt2.nextElementSibling !== M2 && (Ir2(o2, M2, Gt2), V3++), M2._sapEachItem = C2[G3], at3.set(j2, M2), Gt2 = M2;
41295
41356
  });
41296
- for (let [B2, z2] of Q3) ot3.get(B2) !== z2 && z2.parentElement === s2 && (z2.remove(), st3++);
41297
- return s2._sapEach = ot3, V3.forEach((B2, z2) => {
41298
- let M2 = ot3.get(B2), ht3 = { root: p2.root, state: p2.state, item: D2[z2], ownerEl: M2, projection: false, view: true };
41299
- c2(M2, ht3), E2(M2, {}, ht3);
41300
- }), st3;
41301
- }
41302
- x2(n2, r, N2);
41303
- for (let s2 = 0; s2 < y2.length; s2++) {
41304
- let { el: p2, parentObj: h, ctx: d } = y2[s2];
41305
- i2(p2, h, d);
41306
- }
41307
- if (k2.length && w2.size) for (let s2 of k2) w2.has(s2.attr) && s2.el.getAttribute(s2.attr) == null && s2.el.setAttribute(s2.attr, s2.value);
41357
+ for (let [j2, G3] of U3) at3.get(j2) !== G3 && G3.parentElement === o2 && (G3.remove(), V3++);
41358
+ return o2._sapEach = at3, q3.forEach((j2, G3) => {
41359
+ let M2 = at3.get(j2), vt2 = { root: p2.root, state: p2.state, item: C2[G3], ownerEl: M2, projection: false, view: true };
41360
+ d(M2, vt2), E2(M2, {}, vt2);
41361
+ }), V3;
41362
+ }
41363
+ y2(n2, r, N2);
41364
+ for (let o2 = 0; o2 < A2.length; o2++) {
41365
+ let { el: p2, parentObj: l, ctx: g } = A2[o2];
41366
+ c2(p2, l, g);
41367
+ }
41368
+ if (k2.length && w2.size) for (let o2 of k2) w2.has(o2.attr) && o2.el.getAttribute(o2.attr) == null && o2.el.setAttribute(o2.attr, o2.value);
41308
41369
  let v2 = /* @__PURE__ */ new Map();
41309
- for (let s2 of o2) {
41310
- let p2 = v2.get(s2.owner);
41311
- p2 || (p2 = { ownerEl: s2.ownerEl, list: [] }, v2.set(s2.owner, p2)), p2.list.push(s2);
41370
+ for (let o2 of i2) {
41371
+ let p2 = v2.get(o2.owner);
41372
+ p2 || (p2 = { ownerEl: o2.ownerEl, list: [] }, v2.set(o2.owner, p2)), p2.list.push(o2);
41312
41373
  }
41313
- let S2 = [...v2.values()].sort((s2, p2) => ve3(p2.ownerEl) - ve3(s2.ownerEl));
41314
- for (let s2 of S2) {
41374
+ let S2 = [...v2.values()].sort((o2, p2) => Ce3(p2.ownerEl) - Ce3(o2.ownerEl));
41375
+ for (let o2 of S2) {
41315
41376
  let p2;
41316
41377
  try {
41317
- p2 = ue3(s2.list);
41318
- } catch (h) {
41319
- t.diag.error("E07", s2.list[0].el, { problem: h.message }), p2 = s2.list;
41378
+ p2 = Ae3(o2.list);
41379
+ } catch (l) {
41380
+ t.diag.error("E07", o2.list[0].el, { problem: l.message }), p2 = o2.list;
41320
41381
  }
41321
- for (let h of p2) try {
41322
- h.owner[h.name] = G3(h.entry, { state: h.ctx.state, item: h.ctx.item, el: h.el, root: h.ctx.root }), Ot3(h.el);
41323
- } catch (d) {
41324
- h.owner[h.name] = void 0, t.diag.error("E24", h.el, { attr: "calc:" + h.name, expr: h.entry.src, problem: String(d.message) }), at3(h.el, d.sapCode || "E24");
41382
+ for (let l of p2) try {
41383
+ l.owner[l.name] = J3(l.entry, { state: l.ctx.state, item: l.ctx.item, el: l.el, root: l.ctx.root }), Ct3(l.el);
41384
+ } catch (g) {
41385
+ l.owner[l.name] = void 0, t.diag.error("E24", l.el, { attr: "calc:" + l.name, expr: l.entry.src, problem: String(g.message) }), ut3(l.el, g.sapCode || "E24");
41325
41386
  }
41326
41387
  }
41327
- let T2 = 0;
41328
- for (let s2 = 0; s2 < f2.length; s2++) T2 += m2(f2[s2].el, f2[s2].ctx);
41329
- let L3 = 0, C2 = T2;
41330
- for (let s2 of a) {
41331
- let p2 = gr2(s2, t);
41332
- s2.ctx.view ? C2 += p2 : L3 += p2;
41388
+ let _ = 0;
41389
+ for (let o2 = 0; o2 < f2.length; o2++) _ += b(f2[o2].el, f2[o2].ctx);
41390
+ let T2 = 0, D2 = _;
41391
+ for (let o2 of s2) {
41392
+ let p2 = Dr2(o2, t);
41393
+ o2.ctx.view ? D2 += p2 : T2 += p2;
41333
41394
  }
41334
- for (let s2 of u2) wr2(s2, t);
41335
- for (let s2 of R2) yr2(s2);
41336
- t._state = r, t._stats = { fields: Object.keys(r).filter((s2) => typeof r[s2] != "function").length, calcs: o2.length, paints: a.length, lists: v2.size, writes: L3, viewWrites: C2 }, t._viewsChanged = C2 > 0, t._lastPass = { trigger: e.trigger || "refresh", writes: L3 }, t._debug && console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${L3}/${a.length}`);
41395
+ for (let o2 of a) Cr2(o2, t);
41396
+ for (let o2 of R2) Mr2(o2);
41397
+ t._state = r, t._stats = { fields: Object.keys(r).filter((o2) => typeof r[o2] != "function").length, calcs: i2.length, paints: s2.length, lists: v2.size, writes: T2, viewWrites: D2 }, t._viewsChanged = D2 > 0, t._lastPass = { trigger: e.trigger || "refresh", writes: T2 }, t._debug && console.log(`sap pass \xB7 trigger: ${t._lastPass.trigger} \xB7 writes ${T2}/${s2.length}`);
41337
41398
  }
41338
- function hr2(t) {
41399
+ function Rr2(t) {
41339
41400
  return t.kind === "text" ? t.fmt ? "text:" + t.fmt : "text" : t.kind === "attr" ? "attr:" + t.arg : t.kind === "class" ? "class:" + t.arg : t.kind === "css" ? "css:" + t.arg : t.kind === "when" ? (t.match === "hide" ? "hide-when:" : t.match === "show-not" ? "option-not:" : "show-when:") + t.field : t.kind;
41340
41401
  }
41341
- function Xt3(t, e, n2, r) {
41342
- let o2 = t;
41343
- for (; o2 && o2.nodeType === 1; ) {
41344
- if (o2.hasAttribute && o2.hasAttribute(e)) {
41345
- let a = n2.includes(o2.getAttribute(e));
41346
- if (r ? !a : a) return true;
41402
+ function re3(t, e, n2, r) {
41403
+ let i2 = t;
41404
+ for (; i2 && i2.nodeType === 1; ) {
41405
+ if (i2.hasAttribute && i2.hasAttribute(e)) {
41406
+ let s2 = n2.includes(i2.getAttribute(e));
41407
+ if (r ? !s2 : s2) return true;
41347
41408
  }
41348
- o2 = o2.parentElement;
41409
+ i2 = i2.parentElement;
41349
41410
  }
41350
41411
  return false;
41351
41412
  }
41352
- function br2(t, e) {
41413
+ function Re3(t, e) {
41353
41414
  if (t === t.ownerDocument.activeElement) return 0;
41354
- let n2 = F2(t), r = n2.read(), o2 = e ?? "";
41355
- return String(r) !== String(o2) ? (n2.write(o2, { silent: true }), 1) : 0;
41415
+ if (t.type === "radio") {
41416
+ let s2 = e != null && String(t.value) === String(e);
41417
+ return t.checked === s2 ? 0 : (t.checked = s2, 1);
41418
+ }
41419
+ let n2 = P2(t), r = n2.read(), i2 = e ?? "";
41420
+ return String(r) !== String(i2) ? (n2.write(i2, { silent: true }), 1) : 0;
41356
41421
  }
41357
- function gr2(t, e) {
41358
- if (t.kind === "projection") return br2(t.el, t.ctx.item ? t.ctx.item[t.field] : "");
41359
- if (t.kind === "when") return Ae3(t, null);
41422
+ function Dr2(t, e) {
41423
+ if (t.kind === "projection") {
41424
+ if (t.from === "drawn") {
41425
+ let r = t.field in t.ctx.state ? t.ctx.state : t.ctx.root;
41426
+ return Re3(t.el, r[t.field]);
41427
+ }
41428
+ return Re3(t.el, t.ctx.item ? t.ctx.item[t.field] : "");
41429
+ }
41430
+ if (t.kind === "when") return De3(t, null);
41360
41431
  let n2 = { state: t.ctx.state, item: t.ctx.item, el: t.el, root: t.ctx.root };
41361
41432
  try {
41362
- let r = G3(t.entry, n2), o2 = Ae3(t, r);
41363
- return Ot3(t.el), o2;
41433
+ let r = J3(t.entry, n2), i2 = De3(t, r);
41434
+ return Ct3(t.el), i2;
41364
41435
  } catch (r) {
41365
- return e.diag.error(r.sapCode === "E22" ? "E22" : "E24", t.el, { attr: hr2(t), expr: t.entry && t.entry.src, problem: String(r.message) }), at3(t.el, r.sapCode || "E24"), 0;
41436
+ return e.diag.error(r.sapCode === "E22" ? "E22" : "E24", t.el, { attr: Rr2(t), expr: t.entry && t.entry.src, problem: String(r.message) }), ut3(t.el, r.sapCode || "E24"), 0;
41366
41437
  }
41367
41438
  }
41368
- function Ae3(t, e) {
41439
+ function De3(t, e) {
41369
41440
  let n2 = t.el;
41370
41441
  switch (t.kind) {
41371
41442
  case "text": {
41372
- let r = t.fmt != null ? oe3(t.fmt, e) : e == null ? "" : String(e);
41443
+ let r = t.fmt != null ? be3(t.fmt, e) : e == null ? "" : String(e);
41373
41444
  return n2.textContent !== r ? (n2.textContent = r, 1) : 0;
41374
41445
  }
41375
41446
  case "show": {
@@ -41377,21 +41448,25 @@ ${t}` : `"use strict"; return (${t});`;
41377
41448
  return n2.hidden !== r ? (n2.hidden = r, 1) : 0;
41378
41449
  }
41379
41450
  case "when": {
41380
- let r = j2("optionVisibility");
41451
+ let r = X2("optionVisibility");
41381
41452
  if (r && r._started) return n2._sapWhen && n2.hidden ? (n2.hidden = false, n2._sapWhen = false, 1) : 0;
41382
- let o2;
41383
- t.match === "hide" ? o2 = !Xt3(n2, t.field, t.values, false) : t.match === "show-not" ? o2 = Xt3(n2, t.field, t.values, true) : o2 = Xt3(n2, t.field, t.values, false), n2._sapWhen = true;
41384
- let a = !o2;
41385
- return n2.hidden !== a ? (n2.hidden = a, 1) : 0;
41453
+ let i2;
41454
+ t.match === "hide" ? i2 = !re3(n2, t.field, t.values, false) : t.match === "show-not" ? i2 = re3(n2, t.field, t.values, true) : i2 = re3(n2, t.field, t.values, false), n2._sapWhen = true;
41455
+ let s2 = !i2;
41456
+ return n2.hidden !== s2 ? (n2.hidden = s2, 1) : 0;
41386
41457
  }
41387
41458
  case "attr": {
41388
41459
  let r = t.arg;
41389
- if (Ee3.has(r)) {
41390
- let a = n2.hasAttribute(r);
41391
- return e && !a ? (n2.setAttribute(r, ""), 1) : !e && a ? (n2.removeAttribute(r), 1) : 0;
41460
+ if ((r === "checked" || r === "selected") && typeof n2[r] == "boolean" && !n2.hasAttribute("bind") && !n2.closest("select[bind]")) {
41461
+ let s2 = 0;
41462
+ return n2[r] !== !!e && (n2[r] = !!e, s2 = 1), !!e !== n2.hasAttribute(r) && (e ? n2.setAttribute(r, "") : n2.removeAttribute(r), s2 = 1), s2;
41392
41463
  }
41393
- let o2 = typeof e == "boolean" ? String(e) : e == null ? "" : String(e);
41394
- return n2.getAttribute(r) !== o2 ? (n2.setAttribute(r, o2), 1) : 0;
41464
+ if (Nr2.has(r)) {
41465
+ let s2 = n2.hasAttribute(r);
41466
+ return e && !s2 ? (n2.setAttribute(r, ""), 1) : !e && s2 ? (n2.removeAttribute(r), 1) : 0;
41467
+ }
41468
+ let i2 = typeof e == "boolean" ? String(e) : e == null ? "" : String(e);
41469
+ return n2.getAttribute(r) !== i2 ? (n2.setAttribute(r, i2), 1) : 0;
41395
41470
  }
41396
41471
  case "class": {
41397
41472
  let r = !!e;
@@ -41405,29 +41480,29 @@ ${t}` : `"use strict"; return (${t});`;
41405
41480
  return 0;
41406
41481
  }
41407
41482
  }
41408
- function wr2(t, e) {
41483
+ function Cr2(t, e) {
41409
41484
  try {
41410
- G3(t.entry, { state: t.ctx.state, item: t.ctx.item, el: t.el, root: t.ctx.root }), Ot3(t.el);
41485
+ J3(t.entry, { state: t.ctx.state, item: t.ctx.item, el: t.el, root: t.ctx.root }), Ct3(t.el);
41411
41486
  } catch (n2) {
41412
- e.diag.error("E24", t.el, { attr: "effect", expr: t.entry && t.entry.src, problem: String(n2.message) }), at3(t.el, "E24");
41487
+ e.diag.error("E24", t.el, { attr: "effect", expr: t.entry && t.entry.src, problem: String(n2.message) }), ut3(t.el, "E24");
41413
41488
  }
41414
41489
  }
41415
- function yr2(t) {
41490
+ function Mr2(t) {
41416
41491
  let e = "";
41417
41492
  try {
41418
- let n2 = G3(t.entry, { state: t.ctx.state, item: t.ctx.item, el: t.el, root: t.ctx.root });
41493
+ let n2 = J3(t.entry, { state: t.ctx.state, item: t.ctx.item, el: t.el, root: t.ctx.root });
41419
41494
  e = typeof n2 == "string" ? n2 : "";
41420
41495
  } catch {
41421
41496
  e = "";
41422
41497
  }
41423
41498
  typeof t.el.setCustomValidity == "function" && t.el.setCustomValidity(e);
41424
41499
  }
41425
- function ve3(t) {
41500
+ function Ce3(t) {
41426
41501
  let e = 0, n2 = t;
41427
41502
  for (; n2 && !(n2.hasAttribute && n2.hasAttribute("sap")); ) n2 = n2.parentElement, e++;
41428
41503
  return e;
41429
41504
  }
41430
- function Ar2(t, e, n2) {
41505
+ function Ir2(t, e, n2) {
41431
41506
  let r = n2.nextSibling;
41432
41507
  if (e.isConnected && t.moveBefore) try {
41433
41508
  t.moveBefore(e, r);
@@ -41436,531 +41511,582 @@ ${t}` : `"use strict"; return (${t});`;
41436
41511
  }
41437
41512
  t.insertBefore(e, r);
41438
41513
  }
41439
- var vr2 = new Set(Dt3), Se3 = /* @__PURE__ */ new Set(["calc", "text", "attr", "class", "css", "set", "move", "sort", "option", "option-not", "show-when", "hide-when", "editmode"]), Er2 = /* @__PURE__ */ new Set(["show-when", "hide-when", "option", "option-not"]), Sr2 = /\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/, xe3 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "show", "effect", "invalid", "detail", "state", "transient", "confirm", "default", "persist", "sortable", "trigger-add", "trigger-remove", "trigger-reset", "sap-ignore", "sap-error", "no-save", "no-watch", "no-undo", "no-trigger-autosave", "freeze", "mutations-ignore", "save-remove", "save-ignore", "save-freeze"]);
41440
- function xr2(t) {
41514
+ var Or2 = new Set(mt3), Me3 = /* @__PURE__ */ new Set(["calc", "text", "attr", "class", "css", "set", "move", "sort", "option", "option-not", "show-when", "hide-when", "editmode"]), Fr2 = /* @__PURE__ */ new Set(["show-when", "hide-when", "option", "option-not"]), Pr2 = /\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/, Ie3 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "show", "effect", "invalid", "detail", "state", "transient", "confirm", "default", "persist", "sortable", "trigger-add", "trigger-remove", "trigger-reset", "sap-ignore", "sap-error", "no-save", "no-watch", "no-undo", "no-trigger-autosave", "freeze", "mutations-ignore", "save-remove", "save-ignore", "save-freeze"]);
41515
+ function Wr(t) {
41441
41516
  return t.tagName === "INPUT" || t.tagName === "SELECT" || t.tagName === "TEXTAREA";
41442
41517
  }
41443
- function Kt2(t) {
41518
+ function ne3(t) {
41444
41519
  return t.hasAttribute("bind");
41445
41520
  }
41446
- function kr2(t, e) {
41521
+ function Br2(t, e) {
41447
41522
  e(t);
41448
41523
  for (let r of t.children) n2(r);
41449
41524
  function n2(r) {
41450
- if (r.nodeType === 1 && !((r.hasAttribute("sap-ignore") || r.hasAttribute("template")) && r.hasAttribute("sap-ignore"))) {
41525
+ if (r.nodeType === 1 && !r.hasAttribute("sap-ignore")) {
41526
+ if (r.tagName === "TEMPLATE") {
41527
+ if (r.hasAttribute("items")) for (let i2 of r.content.children) n2(i2);
41528
+ return;
41529
+ }
41451
41530
  e(r);
41452
- for (let o2 of r.children) n2(o2);
41531
+ for (let i2 of r.children) n2(i2);
41453
41532
  }
41454
41533
  }
41455
41534
  }
41456
- function Bt3(t, e) {
41457
- let n2 = false, r = (u2, R2, k2) => {
41458
- e.error(u2, R2, k2), n2 = true;
41459
- }, o2 = t.ownerDocument.createTreeWalker(t, 4), a;
41460
- for (; a = o2.nextNode(); ) if (/\{\{.*\}\}/.test(a.nodeValue || "")) {
41461
- r("E02", a.parentElement || t, { problem: "moustaches in text content are not a Sap feature", fix: 'move the expression onto the element: text="state.x"' });
41535
+ function jt3(t, e) {
41536
+ let n2 = false, r = (a, R2, k2) => {
41537
+ e.error(a, R2, k2), n2 = true;
41538
+ }, i2 = t.ownerDocument.createTreeWalker(t, 4), s2;
41539
+ for (; s2 = i2.nextNode(); ) if (/\{\{.*\}\}/.test(s2.nodeValue || "")) {
41540
+ r("E02", s2.parentElement || t, { problem: "moustaches in text content are not a Sap feature", fix: 'move the expression onto the element: text="state.x"' });
41462
41541
  break;
41463
41542
  }
41464
- return kr2(t, (u2) => {
41465
- let R2 = u2.closest && u2.closest("[detail]");
41466
- for (let k2 of [...u2.attributes]) {
41467
- let y2 = k2.name, f2 = be3(y2);
41543
+ return Br2(t, (a) => {
41544
+ let R2 = a.closest && a.closest("[detail]");
41545
+ for (let k2 of [...a.attributes]) {
41546
+ let A2 = k2.name, f2 = ce3(A2);
41468
41547
  if (f2) {
41469
- r("E01", u2, { attr: y2, expr: k2.value, problem: `"${y2}" is a foreign-dialect attribute; Sap has no ${y2.split(/[:=]/)[0]} directive`, fix: f2 + " \u2014 or wrap the subtree in sap-ignore if intentional" });
41548
+ r("E01", a, { attr: A2, expr: k2.value, problem: `"${A2}" is a foreign-dialect attribute; Sap has no ${A2.split(/[:=]/)[0]} directive`, fix: f2 + " \u2014 or wrap the subtree in sap-ignore if intentional" });
41470
41549
  continue;
41471
41550
  }
41472
- if (y2.includes(":")) {
41473
- let w2 = y2.slice(0, y2.indexOf(":"));
41474
- if (Se3.has(w2)) {
41475
- if (Er2.has(w2) && Sr2.test(k2.value)) {
41476
- let N2 = y2.slice(y2.indexOf(":") + 1);
41477
- e.warn("W04", u2, { attr: y2, expr: k2.value, problem: `${w2}: compares the "${N2}" attribute against a literal value, not a JS expression`, fix: `use show="${k2.value}" for an expression, or a literal like ${w2}:${N2}="overview"` });
41551
+ if (A2.includes(":")) {
41552
+ let N2 = A2.slice(0, A2.indexOf(":"));
41553
+ if (Me3.has(N2)) {
41554
+ if (Fr2.has(N2) && Pr2.test(k2.value)) {
41555
+ let I3 = A2.slice(A2.indexOf(":") + 1);
41556
+ e.warn("W04", a, { attr: A2, expr: k2.value, problem: `${N2}: compares the "${I3}" attribute against a literal value, not a JS expression`, fix: `use show="${k2.value}" for an expression, or a literal like ${N2}:${I3}="overview"` });
41478
41557
  }
41479
41558
  } else {
41480
- let N2 = St3(w2, [...Se3]);
41481
- e.warn("W03", u2, { attr: y2, problem: `unknown "${w2}:" attribute`, didYouMean: N2 ? `${N2}:` : null });
41559
+ let I3 = xt3(N2, [...Me3]);
41560
+ e.warn("W03", a, { attr: A2, problem: `unknown "${N2}:" attribute`, didYouMean: I3 ? `${I3}:` : null });
41482
41561
  }
41483
- } else if (!xe3.has(y2) && !Et3.has(y2) && !vr2.has(y2) && !/^(data-|aria-|on)/.test(y2) && !(y2 in u2)) {
41484
- let w2 = St3(y2, [...xe3]);
41485
- w2 && e.warn("W03", u2, { attr: y2, problem: `unknown "${y2}" attribute`, didYouMean: w2 });
41562
+ } else if (!Ie3.has(A2) && !St3.has(A2) && !Or2.has(A2) && !/^(data-|aria-|on)/.test(A2) && !(A2 in a)) {
41563
+ let N2 = xt3(A2, [...Ie3]);
41564
+ N2 && e.warn("W03", a, { attr: A2, problem: `unknown "${A2}" attribute`, didYouMean: N2 });
41565
+ }
41566
+ A2 === "attr:hidden" && e.warn("W03", a, { attr: A2, problem: "attr:hidden paints the wrong attribute", fix: 'use show="expr"' });
41567
+ let w2 = ne3(a) || A2 === "attr:selected" && a.tagName === "OPTION" && !!a.closest("select[bind]");
41568
+ (A2 === "attr:value" || A2 === "attr:checked" || A2 === "attr:selected") && w2 && r("E30", a, { attr: A2, problem: "attr: on a bound control collides with persist ownership", fix: "remove it; bind owns this attribute" }), A2 === "effect" && ne3(a) && /\b(value|checked)\s*=[^=]/.test(k2.value) && r("E30", a, { attr: A2, expr: k2.value, problem: "effect writes value/checked on a bound control (writes a stale value with no synthetic event)", fix: "write through onclick + Sap(this) instead" }), (A2 === "text" || A2.startsWith("text:") || A2 === "show") && Wr(a) && (A2 === "show" || r("E18", a, { attr: A2, problem: "paint belongs on output elements, not form controls", fix: "move the paint to an <output> or <span>" }));
41569
+ }
41570
+ if (a.hasAttribute("state")) {
41571
+ let k2 = z2(a.getAttribute("state")), A2 = /* @__PURE__ */ new Set();
41572
+ for (let f2 of k2) {
41573
+ f2.name.includes("-") && r("E08", a, { attr: "state", problem: `field "${f2.name}" is not a valid identifier (the hyphen parses as subtraction)`, fix: `rename to ${f2.name.replace(/-/g, "")}` }), A2.has(f2.name) && r("E04", a, { attr: "state", problem: `field "${f2.name}" is declared twice in one scope` }), A2.add(f2.name), Rt3.has(f2.attr) && r("E05", a, { attr: "state", problem: `"${f2.name}" is a reserved Sap word` }), St3.has(f2.attr) && r("E06", a, { attr: "state", problem: `"${f2.name}" is a global HTML attribute name; pick another field name` }), f2.name === "open" && a.tagName === "DIALOG" && r("E33", a, { attr: "state", problem: "dialog open is transient", fix: "use showModal() \u2014 declare state= only on <details> or popovers" });
41574
+ let w2 = Qt3(a, f2.attr);
41575
+ w2 && (f2.attr === "checked" || f2.attr === "selected") && r("E35", a, { attr: "state", problem: `"${f2.attr}" on a form control is the control's own state, not a declared field`, fix: 'bind the control instead, e.g. <input type="checkbox" bind="done">' }), w2 && f2.type === "num" && r("E35", a, { attr: "state", problem: `"${f2.attr}" is an HTML boolean attribute; it cannot hold a number`, fix: `declare it bare: state="${f2.attr}"` }), f2.transient && (w2 || f2.type === "presence") && r("E35", a, { attr: "state", problem: `"${f2.name}" is carried by attribute presence, which transient would strip`, fix: "declare a separate name:bool:transient field and paint the attribute from it" });
41486
41576
  }
41487
- y2 === "attr:hidden" && e.warn("W03", u2, { attr: y2, problem: "attr:hidden paints the wrong attribute", fix: 'use show="expr"' }), (y2 === "attr:value" || y2 === "attr:checked" || y2 === "attr:selected") && Kt2(u2) && r("E30", u2, { attr: y2, problem: "attr: on a bound control collides with persist ownership", fix: "remove it; bind owns this attribute" }), y2 === "effect" && Kt2(u2) && /\b(value|checked)\s*=[^=]/.test(k2.value) && r("E30", u2, { attr: y2, expr: k2.value, problem: "effect writes value/checked on a bound control (writes a stale value with no synthetic event)", fix: "write through onclick + Sap(this) instead" }), (y2 === "text" || y2.startsWith("text:") || y2 === "show") && xr2(u2) && (y2 === "show" || r("E18", u2, { attr: y2, problem: "paint belongs on output elements, not form controls", fix: "move the paint to an <output> or <span>" }));
41488
- }
41489
- if (u2.hasAttribute("state")) {
41490
- let k2 = q3(u2.getAttribute("state")), y2 = /* @__PURE__ */ new Set();
41491
- for (let f2 of k2) f2.name.includes("-") && r("E08", u2, { attr: "state", problem: `field "${f2.name}" is not a valid identifier (the hyphen parses as subtraction)`, fix: `rename to ${f2.name.replace(/-/g, "")}` }), y2.has(f2.name) && r("E04", u2, { attr: "state", problem: `field "${f2.name}" is declared twice in one scope` }), y2.add(f2.name), It3.has(f2.attr) && r("E05", u2, { attr: "state", problem: `"${f2.name}" is a reserved Sap word` }), Et3.has(f2.attr) && r("E06", u2, { attr: "state", problem: `"${f2.name}" is a global HTML attribute name; pick another field name` }), f2.name === "open" && u2.tagName === "DIALOG" && r("E33", u2, { attr: "state", problem: "dialog open is transient", fix: "use showModal() \u2014 declare state= only on <details> or popovers" });
41492
- }
41493
- if (Kt2(u2)) {
41494
- if (u2.hasAttribute("-"), u2.tagName === "INPUT") {
41495
- let k2 = (u2.getAttribute("type") || "text").toLowerCase();
41496
- k2 === "file" && r("E32", u2, { attr: "bind", problem: "files never serialize into an HTML file", fix: "use no-save + effect instead of bind" }), k2 === "password" && !u2.hasAttribute("transient") && r("E31", u2, { attr: "bind", problem: "a password must never serialize into a world-readable file", fix: "add transient to the password input" });
41497
- } else if (u2.tagName !== "SELECT" && u2.tagName !== "TEXTAREA") {
41498
- let k2 = u2.getAttribute("contenteditable");
41499
- !(k2 != null && k2 !== "false") && u2.children.length > 0 && r("E20", u2, { attr: "bind", problem: "bind on a container element is not a control; a write would overwrite its children", fix: "bind a control (input/select/textarea), a contenteditable, or an empty text leaf" });
41577
+ }
41578
+ if (ne3(a)) {
41579
+ if (a.hasAttribute("-"), a.tagName === "INPUT") {
41580
+ let k2 = (a.getAttribute("type") || "text").toLowerCase();
41581
+ k2 === "file" && r("E32", a, { attr: "bind", problem: "files never serialize into an HTML file", fix: "use no-save + effect instead of bind" }), k2 === "password" && !a.hasAttribute("transient") && r("E31", a, { attr: "bind", problem: "a password must never serialize into a world-readable file", fix: "add transient to the password input" });
41582
+ } else if (a.tagName !== "SELECT" && a.tagName !== "TEXTAREA") {
41583
+ let k2 = a.getAttribute("contenteditable");
41584
+ !(k2 != null && k2 !== "false") && a.children.length > 0 && r("E20", a, { attr: "bind", problem: "bind on a container element is not a control; a write would overwrite its children", fix: "bind a control (input/select/textarea), a contenteditable, or an empty text leaf" });
41500
41585
  }
41501
41586
  }
41502
- if (u2.hasAttribute("transient") && u2.hasAttribute("persist") && r("E34", u2, { problem: "transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops", fix: "remove one \u2014 transient to keep it out of the file, or persist to save it" }), u2.hasAttribute("item") && !u2.hasAttribute("template")) {
41503
- let k2 = u2.parentElement;
41504
- (!k2 || !k2.hasAttribute("items")) && r("E10", u2, { problem: "an [item] must be a direct child of an [items] list", fix: 'wrap it in a container with items="name"' });
41587
+ if (a.hasAttribute("transient") && a.hasAttribute("persist") && r("E34", a, { problem: "transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops", fix: "remove one \u2014 transient to keep it out of the file, or persist to save it" }), a.tagName === "DIALOG" && a.hasAttribute("detail") && !(a.parentElement && a.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]')) && e.warn("W31", a, { attr: "detail", problem: "a detail dialog writes open when it opens, and that attribute would be saved into the file", fix: 'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient' }), a.hasAttribute("item") && !a.hasAttribute("template") && a.parentNode && a.parentNode.nodeType === 1) {
41588
+ let k2 = a.parentElement;
41589
+ (!k2 || !k2.hasAttribute("items")) && r("E10", a, { problem: "an [item] must be a direct child of an [items] list", fix: 'wrap it in a container with items="name"' });
41505
41590
  }
41506
- if (u2.hasAttribute("items") && R2 && r("E17", u2, { attr: "items", problem: "nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)" }), u2.hasAttribute("items")) {
41507
- let k2 = t.querySelector(`[trigger-add="${u2.getAttribute("items")}"]`);
41508
- !_t2(u2) && X2(u2).length === 0 && k2 && r("E17", u2, { attr: "items", problem: `trigger-add targets items="${u2.getAttribute("items")}" but it has no [item template] to clone` });
41591
+ if (a.hasAttribute("items") && R2 && r("E17", a, { attr: "items", problem: "nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)" }), a.hasAttribute("items")) {
41592
+ let k2 = t.querySelector(`[trigger-add="${a.getAttribute("items")}"]`);
41593
+ !Ft3(a) && !Kt2(t, a.getAttribute("items")) && Z3(a).length === 0 && k2 && r("E17", a, { attr: "items", problem: `trigger-add targets items="${a.getAttribute("items")}" but it has no [item template] to clone` });
41509
41594
  }
41510
- }), n2 && (e.halted = true, e.haltReason = e.errors[0] ? e.errors[0].code : "halt", at3(t, e.haltReason)), !n2;
41595
+ }), n2 && (e.halted = true, e.haltReason = e.errors[0] ? e.errors[0].code : "halt", ut3(t, e.haltReason)), !n2;
41511
41596
  }
41512
- var ke3 = "sap-styles", $e3 = "[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}", Jt3 = /* @__PURE__ */ new WeakSet();
41513
- function $r2(t) {
41514
- if (Jt3.has(t)) return;
41597
+ var Oe3 = "sap-styles", Fe3 = "[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}", oe3 = /* @__PURE__ */ new WeakSet();
41598
+ function qr2(t) {
41599
+ if (oe3.has(t)) return;
41515
41600
  let e = t.defaultView, n2 = e && e.CSSStyleSheet;
41516
41601
  if (n2 && "adoptedStyleSheets" in t) try {
41517
41602
  let r = new n2();
41518
- r.replaceSync($e3), t.adoptedStyleSheets = [...t.adoptedStyleSheets, r], Jt3.add(t);
41603
+ r.replaceSync(Fe3), t.adoptedStyleSheets = [...t.adoptedStyleSheets, r], oe3.add(t);
41519
41604
  return;
41520
41605
  } catch {
41521
41606
  }
41522
- if (!t.getElementById(ke3)) {
41607
+ if (!t.getElementById(Oe3)) {
41523
41608
  let r = t.createElement("style");
41524
- r.id = ke3, r.textContent = $e3, (t.head || t.documentElement).appendChild(r);
41609
+ r.id = Oe3, r.textContent = Fe3, (t.head || t.documentElement).appendChild(r);
41525
41610
  }
41526
- Jt3.add(t);
41611
+ oe3.add(t);
41527
41612
  }
41528
- var _r2 = 0;
41529
- function _e3() {
41613
+ var Vr2 = 0;
41614
+ function Pe3() {
41530
41615
  return typeof performance < "u" && performance.now ? performance.now() : 0;
41531
41616
  }
41532
- function Qt3(t) {
41533
- let e = t.id || t.getAttribute("sap") || `app-${_r2++}`, n2 = new dt3(e), r = { root: t, name: e, diag: n2, _state: null, _stats: null, _lastPass: null, _passes: 0, _broken: false, _mountMs: 0, _mountWrites: 0 };
41534
- if (!Bt3(t, n2)) return r.halted = true, r;
41535
- $r2(t.ownerDocument);
41536
- for (let u2 of t.querySelectorAll("textarea[data-value]")) Ct3(u2);
41537
- let a = _e3();
41538
- return mt3(r, { trigger: "mount" }), r._mountMs = _e3() - a, r._mountWrites = r._stats ? r._stats.writes : 0, r._mountWrites > 0 && n2.warn("W30", t, { problem: `${r._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`, fix: "re-save once so the file mounts clean (a settled file writes nothing)" }), r;
41617
+ function ie3(t) {
41618
+ let e = t.id || t.getAttribute("sap") || `app-${Vr2++}`, n2 = new pt3(e), r = { root: t, name: e, diag: n2, _state: null, _stats: null, _lastPass: null, _passes: 0, _broken: false, _mountMs: 0, _mountWrites: 0 };
41619
+ if (!jt3(t, n2)) return r.halted = true, r;
41620
+ qr2(t.ownerDocument);
41621
+ for (let a of t.querySelectorAll("textarea[data-value]")) qt3(a);
41622
+ let s2 = Pe3();
41623
+ return Et3(r, { trigger: "mount" }), r._mountMs = Pe3() - s2, r._mountWrites = r._stats ? r._stats.writes : 0, r._mountWrites > 0 && n2.warn("W30", t, { problem: `${r._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`, fix: "re-save once so the file mounts clean (a settled file writes nothing)" }), r;
41539
41624
  }
41540
- function Nr2(t, e) {
41625
+ var zr2 = ["for", "form", "list", "headers", "popovertarget", "commandfor", "anchor", "aria-activedescendant", "aria-controls", "aria-describedby", "aria-details", "aria-errormessage", "aria-flowto", "aria-labelledby", "aria-owns"];
41626
+ function Hr2(t, e) {
41541
41627
  let n2 = null;
41542
- return Y2(t, (r) => {
41628
+ return K2(t, (r) => {
41543
41629
  !n2 && r.getAttribute("scope") === e && (n2 = r);
41544
41630
  }), n2;
41545
41631
  }
41546
- function Ne3(t, e, n2) {
41547
- let r = H2(t) || e;
41632
+ function We3(t, e, n2) {
41633
+ let r = Y2(t) || e;
41548
41634
  for (; r; ) {
41549
- for (let o2 of q3(r.getAttribute("state") || "")) if (o2.name === n2) return { el: r, decl: o2 };
41635
+ for (let i2 of z2(r.getAttribute("state") || "")) if (i2.name === n2) return { el: r, decl: i2 };
41550
41636
  if (r.hasAttribute("sap")) break;
41551
- r = H2(r.parentElement);
41637
+ r = Y2(r.parentElement);
41552
41638
  }
41553
41639
  return null;
41554
41640
  }
41555
- function Tr2(t) {
41641
+ function jr2(t) {
41556
41642
  return typeof t == "number" ? "num" : typeof t == "boolean" ? "bool" : "string";
41557
41643
  }
41558
- function Te3(t) {
41559
- function e(b) {
41560
- let g = t.appFor(b);
41561
- if (!g) return null;
41562
- let c2 = gt3(b), A2 = c2 && c2._sapEachItem && c2._sapEachItem.$el;
41563
- if (A2 && A2.isConnected) return { ctxEl: A2, appRec: g, isRow: true };
41564
- let x2 = wt3(b);
41565
- if (x2) return x2._sapDetailRow ? { ctxEl: x2._sapDetailRow, appRec: g, isRow: true } : { ctxEl: H2(x2.parentElement) || g.root, appRec: g, isRow: false };
41566
- let E2 = $t3(b);
41567
- if (E2 && E2.hasAttribute("item")) return { ctxEl: E2, appRec: g, isRow: true };
41568
- let $3 = H2(b) || g.root;
41569
- return { ctxEl: $3, appRec: g, isRow: $3.hasAttribute("item") };
41570
- }
41571
- function n2(b) {
41572
- let g = typeof b == "string" ? document.querySelector(b) : b;
41573
- if (!g || g.nodeType !== 1) return null;
41574
- let c2 = e(g);
41575
- return c2 ? W3(c2.ctxEl, c2.appRec, c2.isRow) : null;
41576
- }
41577
- function r(b, g, c2) {
41578
- let A2 = ft2(b, c2);
41579
- if (A2) return F2(A2).read();
41580
- let x2 = bt3(b, c2);
41581
- if (x2) return X2(x2).map((U3) => W3(U3, g, true));
41582
- let E2 = Nr2(b, c2);
41583
- if (E2) return W3(E2, g, false);
41584
- let $3 = Ne3(b, g.root, c2);
41585
- if ($3) return $3.decl.transient ? Tt3($3.el, $3.decl) : it3($3.el.getAttribute($3.decl.attr || c2), $3.decl.type);
41586
- let O2 = b._sapScope;
41587
- return O2 ? O2[c2] : void 0;
41588
- }
41589
- function o2(b, g, c2, A2, x2) {
41590
- A2.transient ? jt3(b, A2, c2) : b.setAttribute(A2.attr || g, Nt3(c2, A2.type)), t.schedule(x2, "set:" + g);
41591
- }
41592
- function a(b, g) {
41593
- let c2 = /* @__PURE__ */ new Set(), A2 = H2(b) || g;
41594
- for (; A2; ) {
41595
- for (let x2 of q3(A2.getAttribute("state") || "")) c2.add(x2.name);
41596
- if (A2.hasAttribute("sap")) break;
41597
- A2 = H2(A2.parentElement);
41598
- }
41599
- return Y2(b, (x2) => {
41600
- let E2 = x2.getAttribute("bind");
41601
- E2 && c2.add(E2);
41602
- }), c2;
41603
- }
41604
- function u2(b, g, c2, A2) {
41605
- let x2 = ft2(b, c2);
41606
- if (x2) {
41607
- F2(x2).write(A2);
41644
+ function Be3(t) {
41645
+ function e(h) {
41646
+ let d = t.appFor(h);
41647
+ if (!d) return null;
41648
+ let m2 = ft2(h), y2 = m2 && m2._sapEachItem && m2._sapEachItem.$el;
41649
+ if (y2 && y2.isConnected) return { ctxEl: y2, appRec: d, isRow: true };
41650
+ let E2 = kt3(h);
41651
+ if (E2) return E2._sapDetailRow ? { ctxEl: E2._sapDetailRow, appRec: d, isRow: true } : { ctxEl: Y2(E2.parentElement) || d.root, appRec: d, isRow: false };
41652
+ let x2 = It3(h);
41653
+ if (x2 && x2.hasAttribute("item")) return { ctxEl: x2, appRec: d, isRow: true };
41654
+ let $3 = Y2(h) || d.root;
41655
+ return { ctxEl: $3, appRec: d, isRow: $3.hasAttribute("item") };
41656
+ }
41657
+ function n2(h) {
41658
+ let d = typeof h == "string" ? document.querySelector(h) : h;
41659
+ if (!d || d.nodeType !== 1) return null;
41660
+ let m2 = e(d);
41661
+ return m2 ? W3(m2.ctxEl, m2.appRec, m2.isRow) : null;
41662
+ }
41663
+ function r(h, d) {
41664
+ let m2 = ft2(h);
41665
+ if (!m2) return n2(h);
41666
+ let y2 = t.appFor(h), E2 = m2._sapEachItem && m2._sapEachItem.$el;
41667
+ if (E2 && E2.nodeType === 1 && E2.hasAttribute("item") && bt3(E2, d)) return E2.isConnected ? W3(E2, y2, true) : null;
41668
+ let x2 = m2.parentElement && m2.parentElement._sapDrawnEl;
41669
+ return !x2 || !x2.isConnected ? null : W3(x2, y2, x2.hasAttribute("item"));
41670
+ }
41671
+ function i2(h, d, m2) {
41672
+ let y2 = lt3(h, m2);
41673
+ if (y2) return P2(y2).read();
41674
+ let E2 = ht3(h, m2);
41675
+ if (E2) return Z3(E2).map((B2) => W3(B2, d, true));
41676
+ let x2 = Hr2(h, m2);
41677
+ if (x2) return W3(x2, d, false);
41678
+ let $3 = We3(h, d.root, m2);
41679
+ if ($3) return $3.decl.transient ? Pt3($3.el, $3.decl) : pe3($3.el, $3.decl);
41680
+ let O2 = h._sapScope;
41681
+ return O2 ? O2[m2] : void 0;
41682
+ }
41683
+ function s2(h, d, m2, y2, E2) {
41684
+ y2.transient ? Tt3(h, y2, m2) : _t2(h, y2, m2), t.schedule(E2, "set:" + d);
41685
+ }
41686
+ function a(h, d) {
41687
+ let m2 = /* @__PURE__ */ new Set(), y2 = Y2(h) || d;
41688
+ for (; y2; ) {
41689
+ for (let E2 of z2(y2.getAttribute("state") || "")) m2.add(E2.name);
41690
+ if (y2.hasAttribute("sap")) break;
41691
+ y2 = Y2(y2.parentElement);
41692
+ }
41693
+ return K2(h, (E2) => {
41694
+ let x2 = E2.getAttribute("bind");
41695
+ x2 && m2.add(x2);
41696
+ }), m2;
41697
+ }
41698
+ function R2(h, d, m2, y2) {
41699
+ let E2 = lt3(h, m2);
41700
+ if (E2) {
41701
+ P2(E2).write(y2);
41608
41702
  return;
41609
41703
  }
41610
- let E2 = b;
41611
- for (; E2; ) {
41612
- for (let S2 of E2.attributes) if (S2.name === "calc:" + c2) {
41613
- g.diag.error("E16", E2, { attr: "calc:" + c2, problem: `"${c2}" is a computed field; computed fields are read-only` });
41704
+ let x2 = h;
41705
+ for (; x2; ) {
41706
+ for (let S2 of x2.attributes) if (S2.name === "calc:" + m2) {
41707
+ d.diag.error("E16", x2, { attr: "calc:" + m2, problem: `"${m2}" is a computed field; computed fields are read-only` });
41614
41708
  return;
41615
41709
  }
41616
- if (E2.hasAttribute("sap")) break;
41617
- E2 = E2.parentElement;
41710
+ if (x2.hasAttribute("sap")) break;
41711
+ x2 = x2.parentElement;
41618
41712
  }
41619
- let $3 = Ne3(b, g.root, c2);
41713
+ let $3 = We3(h, d.root, m2);
41620
41714
  if ($3) {
41621
- o2($3.el, c2, A2, $3.decl, g);
41715
+ s2($3.el, m2, y2, $3.decl, d);
41622
41716
  return;
41623
41717
  }
41624
- let O2 = a(b, g.root);
41625
- O2.delete(c2);
41626
- let U3 = c2.length >= 4 ? St3(c2, [...O2]) : null;
41627
- if (U3) {
41628
- g.diag.error("E12", b, { key: c2, problem: `unknown state key "${c2}"`, didYouMean: U3 });
41718
+ let O2 = a(h, d.root);
41719
+ O2.delete(m2);
41720
+ let B2 = m2.length >= 4 ? xt3(m2, [...O2]) : null;
41721
+ if (B2) {
41722
+ d.diag.error("E12", h, { key: m2, problem: `unknown state key "${m2}"`, didYouMean: B2 });
41629
41723
  return;
41630
41724
  }
41631
- if (It3.has(c2) || Et3.has(c2)) {
41632
- g.diag.error("E15", b, { key: c2, problem: `cannot write undeclared field "${c2}" \u2014 it is a reserved/global name and cannot become state`, fix: "pick a different field name, or declare it explicitly in a state= attribute" });
41725
+ if (Rt3.has(m2) || St3.has(m2)) {
41726
+ d.diag.error("E15", h, { key: m2, problem: `cannot write undeclared field "${m2}" \u2014 it is a reserved/global name and cannot become state`, fix: "pick a different field name, or declare it explicitly in a state= attribute" });
41633
41727
  return;
41634
41728
  }
41635
- let l = g.root, i2 = Tr2(A2), m2 = l.getAttribute("state") || "", v2 = i2 === "string" ? c2 : `${c2}:${i2}`;
41636
- l.setAttribute("state", m2 ? `${m2} ${v2}` : v2), o2(l, c2, A2, { name: c2, type: i2, transient: false }, g);
41637
- }
41638
- function R2(b) {
41639
- let g = b.ownerDocument;
41640
- b.querySelectorAll("[id]").forEach((c2) => {
41641
- c2.id = kt3(g);
41642
- }), b.querySelectorAll("[sap-error]").forEach((c2) => c2.removeAttribute("sap-error")), b.removeAttribute("sap-error"), b.hasAttribute("data-id") ? (b.removeAttribute("id"), b.setAttribute("data-id", kt3(g))) : b.id = kt3(g);
41643
- }
41644
- function k2(b, g, c2) {
41645
- let A2 = yt3(g.root, b, c2);
41646
- if (!A2) return g.diag.error("E17", b, { problem: `cannot resolve a list named "${c2}" from here` }), null;
41647
- let x2 = _t2(A2);
41648
- if (!x2) return g.diag.error("E17", A2, { problem: `items="${c2}" has no [item template] to clone` }), null;
41649
- let E2 = x2.cloneNode(true);
41650
- return E2.removeAttribute("template"), R2(E2), A2.appendChild(E2), t.schedule(g, "trigger-add:" + c2), W3(E2, g, true);
41651
- }
41652
- function y2(b, g) {
41653
- Y2(b, (c2) => {
41654
- if (c2.hasAttribute("bind")) {
41655
- let A2 = F2(c2), x2 = c2.getAttribute("default");
41656
- A2.kind === "checkbox" || A2.kind === "radio" ? A2.write(x2 != null ? x2 === "" || x2 === "true" || c2.value === x2 : c2.hasAttribute("checked")) : A2.write(x2 ?? (c2.getAttribute("value") || ""));
41729
+ let c2 = d.root, u2 = jr2(y2), b = c2.getAttribute("state") || "", v2 = u2 === "string" ? m2 : `${m2}:${u2}`;
41730
+ c2.setAttribute("state", b ? `${b} ${v2}` : v2), s2(c2, m2, y2, { name: m2, attr: m2, type: u2, transient: false }, d);
41731
+ }
41732
+ function k2(h) {
41733
+ let d = h.ownerDocument, m2 = /* @__PURE__ */ new Map(), y2 = (E2, x2) => {
41734
+ let $3 = le3(d), O2 = E2.getAttribute(x2);
41735
+ O2 && x2 === "id" && m2.set(O2, $3), E2.setAttribute(x2, $3);
41736
+ };
41737
+ h.querySelectorAll("[id]").forEach((E2) => y2(E2, "id")), h.querySelectorAll("[data-id]").forEach((E2) => y2(E2, "data-id")), h.querySelectorAll("[sap-error]").forEach((E2) => E2.removeAttribute("sap-error")), h.removeAttribute("sap-error"), h.hasAttribute("data-id") ? (h.removeAttribute("id"), y2(h, "data-id")) : y2(h, "id");
41738
+ for (let E2 of [h, ...h.querySelectorAll("*")]) for (let x2 of zr2) {
41739
+ let $3 = E2.getAttribute(x2);
41740
+ if ($3 == null) continue;
41741
+ let O2 = $3.split(/\s+/).map((B2) => m2.get(B2) || B2).join(" ");
41742
+ O2 !== $3 && E2.setAttribute(x2, O2);
41743
+ }
41744
+ }
41745
+ function A2(h, d, m2) {
41746
+ let y2 = Nt3(d.root, h, m2);
41747
+ if (!y2) return d.diag.error("E17", h, { problem: `cannot resolve a list named "${m2}" from here` }), null;
41748
+ let E2 = Ft3(y2);
41749
+ if (!E2) return d.diag.error("E17", y2, { problem: `items="${m2}" has no [item template] to clone` }), null;
41750
+ let x2 = y2.ownerDocument.importNode(E2, true);
41751
+ return x2.removeAttribute("template"), k2(x2), y2.appendChild(x2), t.schedule(d, "trigger-add:" + m2), W3(x2, d, true);
41752
+ }
41753
+ function f2(h, d) {
41754
+ K2(h, (m2) => {
41755
+ if (m2.hasAttribute("bind")) {
41756
+ let y2 = P2(m2), E2 = m2.getAttribute("default");
41757
+ y2.kind === "checkbox" || y2.kind === "radio" ? y2.write(E2 != null ? E2 === "" || E2 === "true" || m2.value === E2 : m2.hasAttribute("checked")) : y2.write(E2 ?? (m2.getAttribute("value") || ""));
41657
41758
  }
41658
41759
  });
41659
- for (let c2 of q3(b.getAttribute("state") || "")) {
41660
- let A2 = c2.default != null ? c2.default : c2.type === "num" ? "0" : c2.type === "bool" ? "false" : "";
41661
- c2.transient ? jt3(b, c2, it3(A2, c2.type)) : b.setAttribute(c2.attr, A2);
41760
+ for (let m2 of z2(h.getAttribute("state") || "")) {
41761
+ let y2 = me3(h, m2);
41762
+ m2.transient ? Tt3(h, m2, y2) : _t2(h, m2, y2);
41662
41763
  }
41663
- t.schedule(g, "trigger-reset");
41764
+ t.schedule(d, "trigger-reset");
41664
41765
  }
41665
- function f2(b, g) {
41666
- if (!b.isConnected) throw new Error("stale row handle: $remove() on a removed row");
41667
- b.remove(), t.schedule(g, "trigger-remove");
41766
+ function w2(h, d) {
41767
+ if (!h.isConnected) throw new Error("stale row handle: $remove() on a removed row");
41768
+ h.remove(), t.schedule(d, "trigger-remove");
41668
41769
  }
41669
- function w2(b, g, c2) {
41670
- if (!b.isConnected) throw new Error("stale row handle: $move() on a removed row");
41671
- let A2 = null;
41672
- if (c2 && c2.nodeType === 1 ? A2 = c2 : typeof c2 == "string" && (A2 = yt3(g.root, b, c2)), !A2) {
41673
- g.diag.error("E17", b, { problem: `$move() cannot resolve target "${c2}"` });
41770
+ function N2(h, d, m2) {
41771
+ if (!h.isConnected) throw new Error("stale row handle: $move() on a removed row");
41772
+ let y2 = null;
41773
+ if (m2 && m2.nodeType === 1 ? y2 = m2 : typeof m2 == "string" && (y2 = Nt3(d.root, h, m2)), !y2) {
41774
+ d.diag.error("E17", h, { problem: `$move() cannot resolve target "${m2}"` });
41674
41775
  return;
41675
41776
  }
41676
- t.moveInto(A2, b), t.schedule(g, "trigger-move");
41777
+ t.moveInto(y2, h), t.schedule(d, "trigger-move");
41677
41778
  }
41678
- function N2(b) {
41679
- let g = b.parentElement;
41680
- return g ? X2(g).indexOf(b) : -1;
41779
+ function I3(h) {
41780
+ let d = h.parentElement;
41781
+ return d ? Z3(d).indexOf(h) : -1;
41681
41782
  }
41682
- function W3(b, g, c2) {
41683
- let A2 = { get $el() {
41684
- return b;
41783
+ function W3(h, d, m2) {
41784
+ let y2 = { get $el() {
41785
+ return h;
41685
41786
  }, get $key() {
41686
- return xt3(b, c2 ? "row" : "scope");
41787
+ return Mt3(h, m2 ? "row" : "scope");
41687
41788
  }, get $index() {
41688
- return N2(b);
41689
- }, $add(E2) {
41690
- return k2(b, g, E2);
41789
+ return I3(h);
41790
+ }, $add(x2) {
41791
+ return A2(h, d, x2);
41691
41792
  }, $reset() {
41692
- return y2(b, g), x2;
41793
+ return f2(h, d), E2;
41693
41794
  }, $remove() {
41694
- f2(b, g);
41695
- }, $move(E2) {
41696
- w2(b, g, E2);
41795
+ w2(h, d);
41796
+ }, $move(x2) {
41797
+ N2(h, d, x2);
41697
41798
  }, get $appRec() {
41698
- return g;
41699
- } }, x2 = new Proxy(A2, { get(E2, $3) {
41700
- return typeof $3 == "symbol" || $3[0] === "$" ? E2[$3] : r(b, g, $3);
41701
- }, set(E2, $3, O2) {
41702
- return typeof $3 == "string" && $3[0] === "$" ? (E2[$3] = O2, true) : (u2(b, g, $3, O2), true);
41703
- }, has(E2, $3) {
41704
- return typeof $3 == "string" && $3[0] === "$" ? $3 in E2 : r(b, g, $3) !== void 0;
41799
+ return d;
41800
+ } }, E2 = new Proxy(y2, { get(x2, $3) {
41801
+ return typeof $3 == "symbol" || $3[0] === "$" ? x2[$3] : i2(h, d, $3);
41802
+ }, set(x2, $3, O2) {
41803
+ return typeof $3 == "string" && $3[0] === "$" ? (x2[$3] = O2, true) : (R2(h, d, $3, O2), true);
41804
+ }, has(x2, $3) {
41805
+ return typeof $3 == "string" && $3[0] === "$" ? $3 in x2 : i2(h, d, $3) !== void 0;
41705
41806
  } });
41706
- return x2;
41807
+ return E2;
41707
41808
  }
41708
- return { Sap: n2, contextElFor: e, readField: r, writeField: u2, makeProxy: W3 };
41809
+ return { Sap: n2, contextElFor: e, readField: i2, writeField: R2, makeProxy: W3, writeTargetFor: r };
41709
41810
  }
41710
- var Lr2 = ["trigger-add", "trigger-remove", "trigger-reset"];
41711
- function Rr2(t) {
41811
+ var Ur2 = ["trigger-add", "trigger-remove", "trigger-reset"];
41812
+ function Gr(t) {
41712
41813
  if (t.nodeType !== 1) return false;
41713
41814
  for (let e of t.attributes) {
41714
41815
  let n2 = e.name;
41715
- if (n2.startsWith("set:") || n2.startsWith("move:") || n2.startsWith("sort:") || Lr2.includes(n2)) return true;
41816
+ if (n2.startsWith("set:") || n2.startsWith("move:") || n2.startsWith("sort:") || Ur2.includes(n2)) return true;
41716
41817
  }
41717
41818
  return false;
41718
41819
  }
41719
- function Cr2(t, e) {
41820
+ function Yr(t, e) {
41720
41821
  let n2 = t, r = e.parentElement;
41721
41822
  for (; n2 && n2 !== r; ) {
41722
- if (n2.nodeType === 1 && Rr2(n2) && !(n2.tagName === "FORM" && n2.hasAttribute("trigger-add"))) return n2;
41823
+ if (n2.nodeType === 1 && Gr(n2) && !(n2.tagName === "FORM" && n2.hasAttribute("trigger-add"))) return n2;
41723
41824
  n2 = n2.parentElement;
41724
41825
  }
41725
41826
  return null;
41726
41827
  }
41727
- function Le3(t, e) {
41828
+ function qe3(t, e) {
41728
41829
  let { Sap: n2 } = e;
41729
- function r(l, i2) {
41730
- let m2 = null, v2 = gt3(l), S2 = wt3(l);
41731
- if (v2) m2 = v2._sapEachItem ?? null;
41732
- else if (S2 && S2._sapDetailRow) m2 = S2._sapDetailRow._sapScope || null;
41830
+ function r(c2, u2) {
41831
+ let b = null, v2 = ft2(c2), S2 = kt3(c2);
41832
+ if (v2) b = v2._sapEachItem ?? null;
41833
+ else if (S2 && S2._sapDetailRow) b = S2._sapDetailRow._sapScope || null;
41733
41834
  else {
41734
- let C2 = $t3(l);
41735
- C2 && C2.hasAttribute("item") && (m2 = C2._sapScope || null);
41835
+ let D2 = It3(c2);
41836
+ D2 && D2.hasAttribute("item") && (b = D2._sapScope || null);
41736
41837
  }
41737
- return { state: (H2(l) || i2.root)._sapScope || i2._state || {}, item: m2, el: l, root: i2._state || {} };
41838
+ return { state: (Y2(c2) || u2.root)._sapScope || u2._state || {}, item: b, el: c2, root: u2._state || {} };
41738
41839
  }
41739
- function o2(l, i2, m2) {
41740
- if (!l.hasAttribute("confirm")) {
41741
- m2();
41840
+ function i2(c2, u2, b) {
41841
+ if (!c2.hasAttribute("confirm")) {
41842
+ b();
41742
41843
  return;
41743
41844
  }
41744
- let v2 = l.getAttribute("confirm"), S2 = v2, T2 = P2(v2);
41745
- if (!T2.error) try {
41746
- let s2 = G3(T2, r(l, i2));
41747
- (typeof s2 == "string" || typeof s2 == "number") && (S2 = String(s2));
41845
+ let v2 = c2.getAttribute("confirm"), S2 = v2, _ = H2(v2);
41846
+ if (!_.error) try {
41847
+ let o2 = J3(_, r(c2, u2));
41848
+ (typeof o2 == "string" || typeof o2 == "number") && (S2 = String(o2));
41748
41849
  } catch {
41749
41850
  }
41750
- let L3 = de3();
41751
- if (!L3) {
41752
- window.confirm(S2) && m2();
41851
+ let T2 = xe3();
41852
+ if (!T2) {
41853
+ window.confirm(S2) && b();
41753
41854
  return;
41754
41855
  }
41755
- if (l._sapGatePending) return;
41756
- l._sapGatePending = true;
41757
- let C2 = () => {
41758
- l._sapGatePending = false;
41856
+ if (c2._sapGatePending) return;
41857
+ c2._sapGatePending = true;
41858
+ let D2 = () => {
41859
+ c2._sapGatePending = false;
41759
41860
  };
41760
- L3(S2, () => {
41761
- C2(), m2();
41762
- }).catch(C2);
41763
- }
41764
- function a(l, i2) {
41765
- for (let m2 of l.attributes) {
41766
- if (!m2.name.startsWith("set:")) continue;
41767
- let v2 = m2.name.slice(4), S2 = P2(m2.value);
41861
+ T2(S2, () => {
41862
+ D2(), b();
41863
+ }).catch(D2);
41864
+ }
41865
+ function s2(c2, u2) {
41866
+ for (let b of c2.attributes) {
41867
+ if (!b.name.startsWith("set:")) continue;
41868
+ let v2 = b.name.slice(4), S2 = H2(b.value);
41768
41869
  if (S2.error) {
41769
- i2.diag.error("E08", l, { attr: m2.name, expr: m2.value, problem: String(S2.error.message) });
41870
+ u2.diag.error("E08", c2, { attr: b.name, expr: b.value, problem: String(S2.error.message) });
41770
41871
  continue;
41771
41872
  }
41772
- let T2;
41873
+ let _;
41773
41874
  try {
41774
- T2 = G3(S2, r(l, i2));
41775
- } catch (C2) {
41776
- i2.diag.error("E24", l, { attr: m2.name, expr: m2.value, problem: String(C2.message) });
41875
+ _ = J3(S2, r(c2, u2));
41876
+ } catch (D2) {
41877
+ u2.diag.error("E24", c2, { attr: b.name, expr: b.value, problem: String(D2.message) });
41777
41878
  continue;
41778
41879
  }
41779
- let L3 = n2(l);
41780
- L3 && (L3[v2] = T2);
41880
+ let T2 = e.writeTargetFor(c2, v2);
41881
+ T2 && (T2[v2] = _);
41781
41882
  }
41782
41883
  }
41783
- function u2(l) {
41784
- let i2 = gt3(l);
41785
- if (!i2) return l.closest("[item]");
41786
- let m2 = i2._sapEachItem && i2._sapEachItem.$el;
41787
- return m2 && m2.nodeType === 1 && m2.hasAttribute("item") ? m2 : null;
41884
+ function a(c2) {
41885
+ let u2 = ft2(c2);
41886
+ if (!u2) return c2.closest("[item]");
41887
+ let b = u2._sapEachItem && u2._sapEachItem.$el;
41888
+ return b && b.nodeType === 1 && b.hasAttribute("item") ? b : null;
41788
41889
  }
41789
- function R2(l, i2) {
41790
- let m2 = u2(l);
41791
- if (!m2) return;
41792
- let v2 = X2(m2.parentElement), S2 = v2.indexOf(m2);
41793
- i2 === "up" && S2 > 0 ? t.placeBefore(m2, v2[S2 - 1]) : i2 === "down" && S2 < v2.length - 1 && t.placeBefore(v2[S2 + 1], m2);
41890
+ function R2(c2, u2) {
41891
+ let b = a(c2);
41892
+ if (!b) return;
41893
+ let v2 = Z3(b.parentElement), S2 = v2.indexOf(b);
41894
+ u2 === "up" && S2 > 0 ? t.placeBefore(b, v2[S2 - 1]) : u2 === "down" && S2 < v2.length - 1 && t.placeBefore(v2[S2 + 1], b);
41794
41895
  }
41795
- function k2(l, i2, m2) {
41796
- if (i2) return yt3(m2.root, l, i2);
41797
- let v2 = l;
41896
+ function k2(c2, u2, b) {
41897
+ if (u2) return Nt3(b.root, c2, u2);
41898
+ let v2 = c2;
41798
41899
  for (; v2; ) {
41799
41900
  if (v2.hasAttribute && v2.hasAttribute("items")) return v2;
41800
41901
  v2 = v2.parentElement;
41801
41902
  }
41802
- let S2 = H2(l) || m2.root, T2 = [];
41803
- return Y2(S2, (L3) => {
41804
- L3.hasAttribute("items") && T2.push(L3);
41805
- }), T2[0] || null;
41903
+ let S2 = Y2(c2) || b.root, _ = [];
41904
+ return K2(S2, (T2) => {
41905
+ T2.hasAttribute("items") && _.push(T2);
41906
+ }), _[0] || null;
41806
41907
  }
41807
- function y2(l, i2) {
41808
- let m2 = l == null || l === "", v2 = i2 == null || i2 === "";
41809
- if (m2 && v2) return 0;
41810
- if (m2) return 1;
41908
+ function A2(c2, u2) {
41909
+ let b = c2 == null || c2 === "", v2 = u2 == null || u2 === "";
41910
+ if (b && v2) return 0;
41911
+ if (b) return 1;
41811
41912
  if (v2) return -1;
41812
- let S2 = Number(l), T2 = Number(i2);
41813
- return !Number.isNaN(S2) && !Number.isNaN(T2) ? S2 - T2 : String(l) < String(i2) ? -1 : String(l) > String(i2) ? 1 : 0;
41913
+ let S2 = Number(c2), _ = Number(u2);
41914
+ return !Number.isNaN(S2) && !Number.isNaN(_) ? S2 - _ : String(c2) < String(u2) ? -1 : String(c2) > String(u2) ? 1 : 0;
41814
41915
  }
41815
- function f2(l, i2, m2, v2) {
41816
- let S2 = k2(l, m2, v2);
41916
+ function f2(c2, u2, b, v2) {
41917
+ let S2 = k2(c2, b, v2);
41817
41918
  if (!S2) {
41818
- v2.diag.error("E17", l, { attr: "sort:" + i2, problem: `no items list resolvable for sort:${i2}` });
41919
+ v2.diag.error("E17", c2, { attr: "sort:" + u2, problem: `no items list resolvable for sort:${u2}` });
41819
41920
  return;
41820
41921
  }
41821
- let T2 = X2(S2), L3 = (h) => h._sapScope ? h._sapScope[i2] : void 0, C2 = [...T2].sort((h, d) => y2(L3(h), L3(d))), p2 = C2.every((h, d) => h === T2[d]) ? [...C2].reverse() : C2;
41822
- for (let h of p2) t.moveInto(S2, h);
41823
- t.schedule(v2, "sort:" + i2);
41922
+ let _ = Z3(S2), T2 = (l) => l._sapScope ? l._sapScope[u2] : void 0, D2 = [..._].sort((l, g) => A2(T2(l), T2(g))), p2 = D2.every((l, g) => l === _[g]) ? [...D2].reverse() : D2;
41923
+ for (let l of p2) t.moveInto(S2, l);
41924
+ t.schedule(v2, "sort:" + u2);
41824
41925
  }
41825
- function w2(l) {
41826
- if (!l || l.hidden) return;
41827
- let i2 = l.querySelector("[bind]:not([type=hidden]), [contenteditable]");
41828
- i2 && typeof i2.focus == "function" && i2.focus();
41926
+ function w2(c2) {
41927
+ if (!c2 || c2.hidden) return;
41928
+ let u2 = c2.querySelector("[bind]:not([type=hidden]), [contenteditable]");
41929
+ u2 && typeof u2.focus == "function" && u2.focus();
41829
41930
  }
41830
- function N2(l, i2) {
41831
- o2(l, i2, () => {
41832
- let m2 = n2(l);
41833
- for (let v2 of [...l.attributes]) {
41931
+ function N2(c2, u2) {
41932
+ i2(c2, u2, () => {
41933
+ let b = n2(c2);
41934
+ for (let v2 of [...c2.attributes]) {
41834
41935
  let S2 = v2.name;
41835
- if (S2 === "trigger-remove") m2 && m2.$remove();
41836
- else if (S2 === "trigger-reset") m2 && m2.$reset();
41936
+ if (S2 === "trigger-remove") b && b.$remove();
41937
+ else if (S2 === "trigger-reset") b && b.$reset();
41837
41938
  else if (S2 === "trigger-add") {
41838
- let T2 = m2 && m2.$add(v2.value);
41839
- T2 && w2(T2.$el);
41840
- } else S2 === "move:up" ? (R2(l, "up"), t.schedule(i2, "move:up")) : S2 === "move:down" ? (R2(l, "down"), t.schedule(i2, "move:down")) : S2.startsWith("move:to") ? m2 && m2.$move(v2.value) : S2.startsWith("sort:") && f2(l, S2.slice(5), v2.value, i2);
41939
+ let _ = b && b.$add(v2.value);
41940
+ _ && w2(_.$el);
41941
+ } else S2 === "move:up" ? (R2(c2, "up"), t.schedule(u2, "move:up")) : S2 === "move:down" ? (R2(c2, "down"), t.schedule(u2, "move:down")) : S2.startsWith("move:to") ? b && b.$move(v2.value) : S2.startsWith("sort:") && f2(c2, S2.slice(5), v2.value, u2);
41841
41942
  }
41842
- [...l.attributes].some((v2) => v2.name.startsWith("set:")) && a(l, i2);
41943
+ [...c2.attributes].some((v2) => v2.name.startsWith("set:")) && s2(c2, u2);
41843
41944
  });
41844
41945
  }
41845
- function W3(l) {
41846
- let i2 = l.target;
41847
- if (!i2 || i2.nodeType !== 1) return;
41848
- let m2 = t.appFor(i2);
41849
- if (!m2) return;
41850
- let v2 = Cr2(i2, m2.root);
41851
- v2 && N2(v2, m2);
41946
+ function I3(c2) {
41947
+ let u2 = c2.target;
41948
+ if (!u2 || u2.nodeType !== 1) return;
41949
+ let b = t.appFor(u2);
41950
+ if (!b) return;
41951
+ let v2 = Yr(u2, b.root);
41952
+ v2 && N2(v2, b);
41852
41953
  }
41853
- function b(l) {
41854
- let i2 = F2(l), m2 = l.getAttribute("default");
41855
- i2.kind === "checkbox" ? i2.write(m2 === "" || m2 === "true") : i2.write(m2 ?? "");
41954
+ function W3(c2) {
41955
+ let u2 = P2(c2), b = c2.getAttribute("default");
41956
+ u2.kind === "checkbox" ? u2.write(b === "" || b === "true") : u2.write(b ?? "");
41856
41957
  }
41857
- function g(l, i2, m2) {
41858
- let v2 = n2(l);
41958
+ function h(c2, u2, b) {
41959
+ let v2 = n2(c2);
41859
41960
  if (!v2) return;
41860
- let S2 = v2.$add(m2);
41961
+ let S2 = v2.$add(b);
41861
41962
  if (!S2) return;
41862
- let T2 = [];
41863
- Y2(l, (L3) => {
41864
- L3.hasAttribute("bind") && T2.push(L3);
41963
+ let _ = [];
41964
+ K2(c2, (T2) => {
41965
+ T2.hasAttribute("bind") && _.push(T2);
41865
41966
  });
41866
- for (let L3 of T2) {
41867
- let C2 = ft2(S2.$el, L3.getAttribute("bind"));
41868
- C2 && F2(C2).write(F2(L3).read());
41869
- }
41870
- T2.forEach(b), T2.length ? typeof T2[0].focus == "function" && T2[0].focus() : w2(S2.$el);
41871
- }
41872
- function c2(l) {
41873
- let i2 = l.target;
41874
- if (!i2 || !i2.hasAttribute || !i2.hasAttribute("trigger-add")) return;
41875
- let m2 = t.appFor(i2);
41876
- m2 && (l.preventDefault(), o2(i2, m2, () => g(i2, m2, i2.getAttribute("trigger-add"))));
41877
- }
41878
- function A2(l) {
41879
- let i2 = l.target, m2 = t.appFor(i2);
41880
- m2 && setTimeout(() => {
41881
- i2.querySelectorAll("[bind]").forEach((v2) => {
41967
+ for (let T2 of _) {
41968
+ if (T2.type === "radio" && !T2.checked) continue;
41969
+ let D2 = T2.getAttribute("bind"), o2 = lt3(S2.$el, D2);
41970
+ o2 ? P2(o2).write(P2(T2).read()) : bt3(S2.$el, D2) && (S2[D2] = P2(T2).read());
41971
+ }
41972
+ _.forEach(W3), _.length ? typeof _[0].focus == "function" && _[0].focus() : w2(S2.$el);
41973
+ }
41974
+ function d(c2) {
41975
+ let u2 = c2.target;
41976
+ if (!u2 || !u2.hasAttribute || !u2.hasAttribute("trigger-add")) return;
41977
+ let b = t.appFor(u2);
41978
+ b && (c2.preventDefault(), i2(u2, b, () => h(u2, b, u2.getAttribute("trigger-add"))));
41979
+ }
41980
+ function m2(c2) {
41981
+ let u2 = c2.target, b = t.appFor(u2);
41982
+ b && setTimeout(() => {
41983
+ u2.querySelectorAll("[bind]").forEach((v2) => {
41882
41984
  v2.dispatchEvent(new Event("input", { bubbles: true })), v2.dispatchEvent(new Event("change", { bubbles: true }));
41883
- }), t.schedule(m2, "reset");
41985
+ }), t.schedule(b, "reset");
41884
41986
  }, 0);
41885
41987
  }
41886
- function x2(l) {
41887
- let i2 = t.appFor(l.target);
41888
- i2 && t.schedule(i2, "toggle");
41889
- }
41890
- function E2(l) {
41891
- let i2 = l.target;
41892
- if (!i2 || i2.nodeType !== 1) return;
41893
- let m2 = t.appFor(i2);
41894
- if (!m2) return;
41895
- i2.hasAttribute("persist") && !Mt3(i2) && lt3(i2);
41896
- let v2 = wt3(i2);
41897
- if (v2 && v2._sapDetailRow && i2.hasAttribute("bind")) {
41898
- let S2 = v2._sapDetailRow, T2 = i2.getAttribute("bind"), L3 = ft2(S2, T2);
41899
- if (L3 && L3 !== i2) {
41900
- F2(L3).write(F2(i2).read());
41988
+ function y2(c2) {
41989
+ let u2 = t.appFor(c2.target);
41990
+ u2 && t.schedule(u2, "toggle");
41991
+ }
41992
+ function E2(c2) {
41993
+ let u2 = c2.target;
41994
+ if (!u2 || u2.tagName !== "DIALOG" || !u2.hasAttribute("detail")) return;
41995
+ if (u2._sapEngineClose) {
41996
+ u2._sapEngineClose = false;
41997
+ return;
41998
+ }
41999
+ if (u2.open) return;
42000
+ let b = /^[\w.]+\s+by\s+state\.(\w+)\s*$/.exec(u2.getAttribute("detail") || ""), v2 = t.appFor(u2);
42001
+ if (!b || !v2) return;
42002
+ let S2 = z2(u2.getAttribute("state") || "").find((T2) => T2.name === b[1]);
42003
+ if (S2) {
42004
+ S2.transient ? Tt3(u2, S2, "") : _t2(u2, S2, ""), t.schedule(v2, "close");
42005
+ return;
42006
+ }
42007
+ let _ = n2(u2.parentElement);
42008
+ _ && _[b[1]] !== "" && (_[b[1]] = "");
42009
+ }
42010
+ function x2(c2) {
42011
+ let u2 = c2.target;
42012
+ if (!u2 || u2.nodeType !== 1) return;
42013
+ let b = t.appFor(u2);
42014
+ if (!b) return;
42015
+ u2.hasAttribute("persist") && !Vt3(u2) && wt3(u2);
42016
+ let v2 = u2.hasAttribute("bind") && Ot3(u2);
42017
+ if (!v2 && u2.hasAttribute("bind") && ft2(u2)) {
42018
+ let _ = u2.getAttribute("bind"), T2 = u2._sapViewBind ? e.writeTargetFor(u2, _) : null;
42019
+ T2 && (T2[_] = P2(u2).read());
42020
+ return;
42021
+ }
42022
+ let S2 = kt3(u2);
42023
+ if (S2 && S2._sapDetailRow && u2.hasAttribute("bind") && !v2) {
42024
+ let _ = S2._sapDetailRow, T2 = u2.getAttribute("bind"), D2 = lt3(_, T2);
42025
+ if (D2 && D2 !== u2) {
42026
+ P2(D2).write(P2(u2).read());
41901
42027
  return;
41902
42028
  }
41903
- if (!L3 && q3(S2.getAttribute("state") || "").some((C2) => C2.name === T2)) {
41904
- e.writeField(S2, m2, T2, F2(i2).read());
42029
+ if (!D2 && z2(_.getAttribute("state") || "").some((o2) => o2.name === T2)) {
42030
+ e.writeField(_, b, T2, P2(u2).read());
41905
42031
  return;
41906
42032
  }
41907
42033
  }
41908
- t.schedule(m2, l.type + " " + (i2.id || i2.tagName.toLowerCase()));
42034
+ t.schedule(b, c2.type + " " + (u2.id || u2.tagName.toLowerCase()));
41909
42035
  }
41910
- function $3(l) {
41911
- let i2 = l.detail || {};
41912
- for (let m2 of [i2.from, i2.to, l.target]) {
41913
- if (!m2 || m2.nodeType !== 1) continue;
41914
- let v2 = t.appFor(m2);
42036
+ function $3(c2) {
42037
+ let u2 = c2.detail || {};
42038
+ for (let b of [u2.from, u2.to, c2.target]) {
42039
+ if (!b || b.nodeType !== 1) continue;
42040
+ let v2 = t.appFor(b);
41915
42041
  v2 && t.schedule(v2, "sorted");
41916
42042
  }
41917
42043
  }
41918
- function O2(l) {
41919
- if (l.key !== "ArrowUp" && l.key !== "ArrowDown") return;
41920
- let i2 = l.target;
41921
- if (!i2 || i2.nodeType !== 1 || i2.tagName !== "INPUT" || !i2.hasAttribute("bind") || !i2.hasAttribute("step")) return;
41922
- let m2 = (i2.getAttribute("type") || "text").toLowerCase();
41923
- if (m2 !== "text" && m2 !== "tel" && m2 !== "search" || !t.appFor(i2)) return;
41924
- l.preventDefault();
41925
- let S2 = K2(i2.getAttribute("step")) || 1, T2 = l.key === "ArrowUp" ? 1 : -1, L3 = K2(i2.value) + S2 * (l.shiftKey ? 10 : 1) * T2, C2 = i2.getAttribute("min"), s2 = i2.getAttribute("max");
41926
- C2 !== null && C2 !== "" && L3 < K2(C2) && (L3 = K2(C2)), s2 !== null && s2 !== "" && L3 > K2(s2) && (L3 = K2(s2)), F2(i2).write(String(Number(L3.toFixed(2))));
42044
+ function O2(c2) {
42045
+ if (c2.key !== "ArrowUp" && c2.key !== "ArrowDown") return;
42046
+ let u2 = c2.target;
42047
+ if (!u2 || u2.nodeType !== 1 || u2.tagName !== "INPUT" || !u2.hasAttribute("bind") || !u2.hasAttribute("step")) return;
42048
+ let b = (u2.getAttribute("type") || "text").toLowerCase();
42049
+ if (b !== "text" && b !== "tel" && b !== "search" || !t.appFor(u2)) return;
42050
+ c2.preventDefault();
42051
+ let S2 = tt3(u2.getAttribute("step")) || 1, _ = c2.key === "ArrowUp" ? 1 : -1, T2 = tt3(u2.value) + S2 * (c2.shiftKey ? 10 : 1) * _, D2 = u2.getAttribute("min"), o2 = u2.getAttribute("max");
42052
+ D2 !== null && D2 !== "" && T2 < tt3(D2) && (T2 = tt3(D2)), o2 !== null && o2 !== "" && T2 > tt3(o2) && (T2 = tt3(o2)), P2(u2).write(String(Number(T2.toFixed(2))));
41927
42053
  }
41928
- function U3(l = document) {
41929
- l.addEventListener("click", W3), l.addEventListener("submit", c2), l.addEventListener("reset", A2), l.addEventListener("toggle", x2, true), l.addEventListener("input", E2), l.addEventListener("change", E2), l.addEventListener("clay:sorted", $3), l.addEventListener("keydown", O2);
42054
+ function B2(c2 = document) {
42055
+ c2.addEventListener("click", I3), c2.addEventListener("submit", d), c2.addEventListener("reset", m2), c2.addEventListener("toggle", y2, true), c2.addEventListener("close", E2, true), c2.addEventListener("input", x2), c2.addEventListener("change", x2), c2.addEventListener("clay:sorted", $3), c2.addEventListener("keydown", O2);
41930
42056
  }
41931
- return { install: U3 };
42057
+ return { install: B2 };
41932
42058
  }
41933
- var Re3 = /^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;
41934
- function Zt3(t) {
42059
+ var Ve2 = /^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;
42060
+ function se3(t) {
41935
42061
  return `${t.tagName.toLowerCase()}[sap]`;
41936
42062
  }
41937
- function Mr2(t) {
42063
+ function Xr(t) {
41938
42064
  let e = 0;
41939
- for (let n2 of t.querySelectorAll("*")) for (let r of n2.attributes) if (Re3.test(r.name)) {
42065
+ for (let n2 of t.querySelectorAll("*")) for (let r of n2.attributes) if (Ve2.test(r.name)) {
41940
42066
  e++;
41941
42067
  break;
41942
42068
  }
41943
- for (let n2 of t.attributes) if (Re3.test(n2.name)) {
42069
+ for (let n2 of t.attributes) if (Ve2.test(n2.name)) {
41944
42070
  e++;
41945
42071
  break;
41946
42072
  }
41947
42073
  return e;
41948
42074
  }
41949
- function Ce3(t) {
42075
+ function ze3(t) {
41950
42076
  let e = [], n2 = (r) => {
41951
- for (let o2 of r.attributes) {
41952
- let a = o2.name;
41953
- (a.startsWith("calc:") || a === "text" || a.startsWith("text:") || a === "show" || a.startsWith("attr:") || a.startsWith("class:") || a.startsWith("css:") || a === "effect" || a === "invalid" || a.startsWith("set:") || a === "detail") && e.push({ el: r, attr: a, src: o2.value });
42077
+ for (let i2 of r.attributes) {
42078
+ let s2 = i2.name;
42079
+ (s2.startsWith("calc:") || s2 === "text" || s2.startsWith("text:") || s2 === "show" || s2.startsWith("attr:") || s2.startsWith("class:") || s2.startsWith("css:") || s2 === "effect" || s2 === "invalid" || s2.startsWith("set:") || s2 === "detail") && e.push({ el: r, attr: s2, src: i2.value });
41954
42080
  }
41955
42081
  };
41956
42082
  n2(t);
41957
42083
  for (let r of t.querySelectorAll("*")) n2(r);
41958
42084
  return e;
41959
42085
  }
41960
- function Me3(t) {
42086
+ function He3(t) {
41961
42087
  function e(f2) {
41962
42088
  let w2 = f2._stats || {}, N2 = f2.root;
41963
- return { root: Zt3(N2), fields: w2.fields || 0, calcs: w2.calcs || 0, paints: w2.paints || 0, actions: Mr2(N2), lists: (N2.hasAttribute("items") ? 1 : 0) + N2.querySelectorAll("[items]").length, rows: N2.querySelectorAll("[item]:not([template])").length, warnings: f2.diag.warnings.length, errors: f2.diag.errors.length, mountWrites: f2._mountWrites || 0, ms: Math.round((f2._mountMs || 0) * 10) / 10, passes: f2._passes || 0, lastPass: f2._lastPass || null, ok: f2.diag.errors.length === 0 && !f2.halted };
42089
+ return { root: se3(N2), fields: w2.fields || 0, calcs: w2.calcs || 0, paints: w2.paints || 0, actions: Xr(N2), lists: (N2.hasAttribute("items") ? 1 : 0) + N2.querySelectorAll("[items]").length, rows: N2.querySelectorAll("[item]:not([template])").length, warnings: f2.diag.warnings.length, errors: f2.diag.errors.length, mountWrites: f2._mountWrites || 0, ms: Math.round((f2._mountMs || 0) * 10) / 10, passes: f2._passes || 0, lastPass: f2._lastPass || null, ok: f2.diag.errors.length === 0 && !f2.halted };
41964
42090
  }
41965
42091
  function n2() {
41966
42092
  let f2 = t.apps().map(e);
@@ -41970,36 +42096,36 @@ ${t}` : `"use strict"; return (${t});`;
41970
42096
  let w2 = e(f2);
41971
42097
  return w2.ok ? `sap \u2713 ${w2.root} \xB7 fields ${w2.fields} \xB7 calcs ${w2.calcs} \xB7 paints ${w2.paints} \xB7 actions ${w2.actions} \xB7 lists ${w2.lists} \xB7 rows ${w2.rows} \xB7 warnings ${w2.warnings} \xB7 mount writes ${w2.mountWrites} \xB7 ${w2.ms}ms` : `sap \u2717 ${w2.root} \xB7 errors ${w2.errors} \xB7 warnings ${w2.warnings} \xB7 ${w2.ms}ms`;
41972
42098
  }
41973
- function o2() {
42099
+ function i2() {
41974
42100
  for (let f2 of t.apps()) {
41975
42101
  let w2 = r(f2);
41976
42102
  f2.diag.errors.length || f2.halted ? console.error(w2) : console.log(w2);
41977
42103
  }
41978
42104
  }
41979
- function a() {
42105
+ function s2() {
41980
42106
  let f2 = [], w2 = [];
41981
42107
  for (let N2 of t.apps()) f2.push(...N2.diag.errors), w2.push(...N2.diag.warnings);
41982
42108
  return { ok: f2.length === 0, errors: f2, warnings: w2, counts: { errors: f2.length, warnings: w2.length } };
41983
42109
  }
41984
- function u2(f2) {
42110
+ function a(f2) {
41985
42111
  return f2 ? typeof f2 == "string" ? document.querySelector(f2) : f2.nodeType === 1 ? f2 : null : null;
41986
42112
  }
41987
42113
  function R2(f2, w2) {
41988
- let N2 = u2(f2);
42114
+ let N2 = a(f2);
41989
42115
  if (!N2) return console.warn("sap why: element not found"), null;
41990
- let W3 = [`sap why <${N2.tagName.toLowerCase()}> \u2014 ${Wt3(N2)}`], b = [...N2.attributes].filter((c2) => /^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(c2.name));
41991
- for (let c2 of b) W3.push(` ${c2.name}="${c2.value}"`);
41992
- let g = N2;
41993
- for (; g && !g._sapScope; ) g = g.parentElement;
41994
- if (g && g._sapScope) {
41995
- let c2 = g._sapScope, A2 = w2 ? [w2] : Object.keys(c2);
41996
- W3.push(" reads:");
41997
- for (let x2 of A2) {
41998
- let E2 = c2[x2];
41999
- typeof E2 != "function" && W3.push(` ${x2} = ${JSON.stringify(Array.isArray(E2) ? `[${E2.length} rows]` : E2)}`);
42116
+ let I3 = [`sap why <${N2.tagName.toLowerCase()}> \u2014 ${Dt3(N2)}`], W3 = [...N2.attributes].filter((d) => /^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(d.name));
42117
+ for (let d of W3) I3.push(` ${d.name}="${d.value}"`);
42118
+ let h = N2;
42119
+ for (; h && !h._sapScope; ) h = h.parentElement;
42120
+ if (h && h._sapScope) {
42121
+ let d = h._sapScope, m2 = w2 ? [w2] : Object.keys(d);
42122
+ I3.push(" reads:");
42123
+ for (let y2 of m2) {
42124
+ let E2 = d[y2];
42125
+ typeof E2 != "function" && I3.push(` ${y2} = ${JSON.stringify(Array.isArray(E2) ? `[${E2.length} rows]` : E2)}`);
42000
42126
  }
42001
42127
  }
42002
- return W3.push(" serialization: textContent and value/checked attributes save with the file; reads live from properties"), console.log(W3.join(`
42128
+ return I3.push(" serialization: textContent and value/checked attributes save with the file; reads live from properties"), console.log(I3.join(`
42003
42129
  `)), null;
42004
42130
  }
42005
42131
  function k2(f2) {
@@ -42007,56 +42133,57 @@ ${t}` : `"use strict"; return (${t});`;
42007
42133
  for (let N2 of t.apps()) N2._debug = w2;
42008
42134
  return console.log(`sap debug ${w2 ? "on" : "off"} \u2014 per-pass headers will ${w2 ? "" : "no longer "}log`), w2;
42009
42135
  }
42010
- function y2() {
42136
+ function A2() {
42011
42137
  let f2 = [], w2 = 0;
42012
- for (let c2 of t.apps()) {
42013
- let A2 = c2.root, x2 = Zt3(A2);
42138
+ for (let d of t.apps()) {
42139
+ let m2 = d.root, y2 = se3(m2);
42014
42140
  w2++;
42015
- let E2 = new dt3(c2.name);
42016
- Bt3(A2, E2);
42017
- for (let i2 of E2.errors) f2.push({ code: i2.code, severity: "error", message: `${x2}: ${i2.code} ${i2.slug} at ${i2.el}` });
42018
- for (let i2 of E2.warnings) f2.push({ code: i2.code, severity: "warn", message: `${x2}: ${i2.code} ${i2.slug} at ${i2.el}` });
42019
- w2++, mt3(c2, { trigger: "doctor-dryrun" });
42020
- let $3 = c2._stats ? c2._stats.writes : 0;
42021
- $3 > 0 && f2.push({ code: "W30", severity: "warn", message: `${x2}: dry recompute wrote ${$3} cells on a quiet page; an element is stale or non-idempotent` }), w2++;
42022
- let O2 = Ce3(A2).map((i2) => i2.src).join(" \0 "), U3 = [];
42023
- for (let i2 of [A2, ...A2.querySelectorAll("[state]")]) for (let m2 of q3(i2.getAttribute("state") || "")) U3.push(m2.name);
42024
- for (let i2 of U3) new RegExp(`(state|item)\\.${i2}\\b`).test(O2) || f2.push({ code: "I33", severity: "info", message: `${x2}: field "${i2}" is declared but read nowhere (dead state)` });
42141
+ let E2 = new pt3(d.name);
42142
+ jt3(m2, E2);
42143
+ for (let c2 of E2.errors) f2.push({ code: c2.code, severity: "error", message: `${y2}: ${c2.code} ${c2.slug} at ${c2.el}` });
42144
+ for (let c2 of E2.warnings) f2.push({ code: c2.code, severity: "warn", message: `${y2}: ${c2.code} ${c2.slug} at ${c2.el}` });
42145
+ w2++, Et3(d, { trigger: "doctor-dryrun" });
42146
+ let x2 = d._stats ? d._stats.writes : 0;
42147
+ x2 > 0 && f2.push({ code: "W30", severity: "warn", message: `${y2}: dry recompute wrote ${x2} cells on a quiet page; an element is stale or non-idempotent` }), w2++;
42148
+ let $3 = ze3(m2).map((c2) => c2.src).join(" \0 "), O2 = [];
42149
+ for (let c2 of [m2, ...m2.querySelectorAll("[state]")]) for (let u2 of z2(c2.getAttribute("state") || "")) O2.push(u2.name);
42150
+ for (let c2 of O2) new RegExp(`(state|item)\\.${c2}\\b`).test($3) || f2.push({ code: "I33", severity: "info", message: `${y2}: field "${c2}" is declared but read nowhere (dead state)` });
42025
42151
  w2++;
42026
- let l = /* @__PURE__ */ new Map();
42027
- for (let i2 of A2.querySelectorAll("[id]")) l.set(i2.id, (l.get(i2.id) || 0) + 1);
42028
- for (let [i2, m2] of l) m2 > 1 && f2.push({ code: "W32", severity: "warn", message: `${x2}: duplicate id "${i2}" (${m2} elements) \u2014 clone/edit collision` });
42152
+ let B2 = /* @__PURE__ */ new Map();
42153
+ for (let c2 of m2.querySelectorAll("[id]")) B2.set(c2.id, (B2.get(c2.id) || 0) + 1);
42154
+ for (let [c2, u2] of B2) u2 > 1 && f2.push({ code: "W32", severity: "warn", message: `${y2}: duplicate id "${c2}" (${u2} elements) \u2014 clone/edit collision` });
42029
42155
  w2++;
42030
- for (let i2 of Ce3(A2)) i2.src.length > 120 && f2.push({ code: "I33", severity: "info", message: `${x2}: ${i2.attr} expression is ${i2.src.length} chars; consider a calc: field` });
42156
+ for (let c2 of ze3(m2)) c2.src.length > 120 && f2.push({ code: "I33", severity: "info", message: `${y2}: ${c2.attr} expression is ${c2.src.length} chars; consider a calc: field` });
42031
42157
  w2++;
42032
- for (let i2 of A2.querySelectorAll("[text], [text\\:num]")) {
42033
- let m2 = i2.textContent || "";
42034
- /\.\d{5,}/.test(m2) && f2.push({ code: "I33", severity: "info", message: `${x2}: ${Wt3(i2)} paints >4 decimals; consider text:FMT` });
42158
+ for (let c2 of m2.querySelectorAll("[text], [text\\:num]")) {
42159
+ let u2 = c2.textContent || "";
42160
+ /\.\d{5,}/.test(u2) && f2.push({ code: "I33", severity: "info", message: `${y2}: ${Dt3(c2)} paints >4 decimals; consider text:FMT` });
42035
42161
  }
42036
42162
  }
42037
- let N2 = f2.filter((c2) => c2.severity === "error").length, W3 = f2.filter((c2) => c2.severity === "warn").length, b = f2.filter((c2) => c2.severity === "info").length;
42038
- console.log(`sap doctor \xB7 ${t.apps().map((c2) => Zt3(c2.root)).join(", ")} \xB7 errors ${N2} \xB7 warnings ${W3} \xB7 info ${b} \xB7 ${w2} checks \xB7 0ms`);
42039
- for (let c2 of f2) (c2.severity === "error" ? console.error : c2.severity === "warn" ? console.warn : console.info)(` ${c2.severity === "error" ? "\u2717" : c2.severity === "warn" ? "\u26A0" : "\xB7"} ${c2.message}`);
42163
+ let N2 = f2.filter((d) => d.severity === "error").length, I3 = f2.filter((d) => d.severity === "warn").length, W3 = f2.filter((d) => d.severity === "info").length;
42164
+ console.log(`sap doctor \xB7 ${t.apps().map((d) => se3(d.root)).join(", ")} \xB7 errors ${N2} \xB7 warnings ${I3} \xB7 info ${W3} \xB7 ${w2} checks \xB7 0ms`);
42165
+ for (let d of f2) (d.severity === "error" ? console.error : d.severity === "warn" ? console.warn : console.info)(` ${d.severity === "error" ? "\u2717" : d.severity === "warn" ? "\u26A0" : "\xB7"} ${d.message}`);
42040
42166
  return f2;
42041
42167
  }
42042
- return { status: n2, report: a, why: R2, debug: k2, doctor: y2, greenLine: r, printGreenLines: o2, REGISTRY: Vt3 };
42168
+ return { status: n2, report: s2, why: R2, debug: k2, doctor: A2, greenLine: r, printGreenLines: i2, REGISTRY: Xt3 };
42043
42169
  }
42044
- var Dr2 = "0.2.0", J3 = /* @__PURE__ */ new Map(), rt3 = [], te3 = ee3(mt3);
42045
- function Ir2(t) {
42170
+ var je3 = "0.5.0";
42171
+ var et3 = /* @__PURE__ */ new Map(), it3 = [], ae3 = ue3(Et3);
42172
+ function Kr(t) {
42046
42173
  let e = t;
42047
42174
  for (; e; ) {
42048
- if (e.nodeType === 1 && e.hasAttribute && e.hasAttribute("sap")) return J3.get(e) || null;
42175
+ if (e.nodeType === 1 && e.hasAttribute && e.hasAttribute("sap")) return et3.get(e) || null;
42049
42176
  e = e.parentNode && e.parentNode.host ? e.parentNode.host : e.parentElement;
42050
42177
  }
42051
42178
  return null;
42052
42179
  }
42053
- function Wr() {
42054
- for (let t = rt3.length - 1; t >= 0; t--) {
42055
- let e = rt3[t];
42056
- e.root.isConnected || (J3.delete(e.root), rt3.splice(t, 1));
42180
+ function Jr() {
42181
+ for (let t = it3.length - 1; t >= 0; t--) {
42182
+ let e = it3[t];
42183
+ e.root.isConnected || (et3.delete(e.root), it3.splice(t, 1));
42057
42184
  }
42058
42185
  }
42059
- function Or2(t, e) {
42186
+ function Qr(t, e) {
42060
42187
  if (t.moveBefore) try {
42061
42188
  t.moveBefore(e, null);
42062
42189
  return;
@@ -42064,7 +42191,7 @@ ${t}` : `"use strict"; return (${t});`;
42064
42191
  }
42065
42192
  t.appendChild(e);
42066
42193
  }
42067
- function Pr2(t, e) {
42194
+ function Zr(t, e) {
42068
42195
  let n2 = e.parentElement;
42069
42196
  if (n2) {
42070
42197
  if (n2.moveBefore) try {
@@ -42075,67 +42202,67 @@ ${t}` : `"use strict"; return (${t});`;
42075
42202
  n2.insertBefore(t, e);
42076
42203
  }
42077
42204
  }
42078
- var ut3 = { apps: () => rt3.slice(), appFor: Ir2, isRegistered: (t) => J3.has(t), pruneDisconnected: Wr, schedule: (t, e) => te3.schedule(t, e), runNow: (t, e) => te3.runNow(t, e), moveInto: Or2, placeBefore: Pr2, remountIfPresent: () => qt3() }, Ie3 = Te3(ut3), Fr2 = Le3(ut3, Ie3), nt3 = Me3(ut3), De3 = false;
42079
- function We3() {
42080
- De3 || (De3 = true, Fr2.install(document), me3(ut3));
42205
+ var dt3 = { apps: () => it3.slice(), appFor: Kr, isRegistered: (t) => et3.has(t), pruneDisconnected: Jr, schedule: (t, e) => ae3.schedule(t, e), runNow: (t, e) => ae3.runNow(t, e), moveInto: Qr, placeBefore: Zr, remountIfPresent: () => Ut3() }, Ge3 = Be3(dt3), tn = qe3(dt3, Ge3), st3 = He3(dt3), Ue3 = false;
42206
+ function Ye3() {
42207
+ Ue3 || (Ue3 = true, tn.install(document), $e3(dt3));
42081
42208
  }
42082
- function qt3(t = document) {
42083
- We3(), Gt2(ut3);
42209
+ function Ut3(t = document) {
42210
+ Ye3(), ee3(dt3);
42084
42211
  let e = t.querySelectorAll("[sap]"), n2 = [];
42085
42212
  for (let r of e) {
42086
- if (J3.has(r)) continue;
42087
- let o2 = Qt3(r);
42088
- J3.set(r, o2), rt3.push(o2), n2.push(o2);
42213
+ if (et3.has(r)) continue;
42214
+ let i2 = ie3(r);
42215
+ et3.set(r, i2), it3.push(i2), n2.push(i2);
42089
42216
  }
42090
42217
  for (let r of n2) {
42091
- let o2 = nt3.greenLine(r);
42092
- r.diag.errors.length || r.halted ? console.error(o2) : console.log(o2);
42218
+ let i2 = st3.greenLine(r);
42219
+ r.diag.errors.length || r.halted ? console.error(i2) : console.log(i2);
42093
42220
  }
42094
42221
  return n2;
42095
42222
  }
42096
- function Oe3(t) {
42097
- if (We3(), Gt2(ut3), !t) return qt3();
42223
+ function Xe3(t) {
42224
+ if (Ye3(), ee3(dt3), !t) return Ut3();
42098
42225
  let e = typeof t == "string" ? document.querySelector(t) : t;
42099
42226
  if (!e) return null;
42100
- if (J3.has(e)) return J3.get(e);
42101
- let n2 = Qt3(e);
42102
- J3.set(e, n2), rt3.push(n2);
42103
- let r = nt3.greenLine(n2);
42227
+ if (et3.has(e)) return et3.get(e);
42228
+ let n2 = ie3(e);
42229
+ et3.set(e, n2), it3.push(n2);
42230
+ let r = st3.greenLine(n2);
42104
42231
  return n2.diag.errors.length || n2.halted ? console.error(r) : console.log(r), n2;
42105
42232
  }
42106
- var I3 = Ie3.Sap;
42107
- I3.version = Dr2;
42108
- I3.refresh = function() {
42109
- for (let e of rt3) e.root.isConnected && te3.runNow(e, "refresh");
42233
+ var F2 = Ge3.Sap;
42234
+ F2.version = je3;
42235
+ F2.refresh = function() {
42236
+ for (let e of it3) e.root.isConnected && ae3.runNow(e, "refresh");
42110
42237
  };
42111
- I3.batch = pe3;
42112
- I3.status = nt3.status;
42113
- I3.report = nt3.report;
42114
- I3.why = nt3.why;
42115
- I3.debug = nt3.debug;
42116
- I3.doctor = nt3.doctor;
42117
- I3.greenLine = nt3.greenLine;
42118
- I3.formats = At2;
42119
- I3.serializeControlToAttributes = lt3;
42120
- I3.finalizeControlForSave = fe3;
42121
- I3.rehydrateControlFromAttributes = Ct3;
42122
- I3.mount = Oe3;
42123
- I3.config = function(e = {}) {
42124
- return e.formats && Object.assign(At2, e.formats), I3;
42238
+ F2.batch = ke3;
42239
+ F2.status = st3.status;
42240
+ F2.report = st3.report;
42241
+ F2.why = st3.why;
42242
+ F2.debug = st3.debug;
42243
+ F2.doctor = st3.doctor;
42244
+ F2.greenLine = st3.greenLine;
42245
+ F2.formats = Lt2;
42246
+ F2.serializeControlToAttributes = wt3;
42247
+ F2.finalizeControlForSave = ve3;
42248
+ F2.rehydrateControlFromAttributes = qt3;
42249
+ F2.mount = Xe3;
42250
+ F2.config = function(e = {}) {
42251
+ return e.formats && Object.assign(Lt2, e.formats), F2;
42125
42252
  };
42126
- I3._registry = J3;
42127
- I3._reset = function() {
42128
- J3.clear(), rt3.length = 0, ye3();
42253
+ F2._registry = et3;
42254
+ F2._reset = function() {
42255
+ et3.clear(), it3.length = 0, Le3();
42129
42256
  };
42130
- function Br2() {
42257
+ function en() {
42131
42258
  if (typeof document > "u") return;
42132
- let t = () => le3(() => qt3());
42259
+ let t = () => Se3(() => Ut3());
42133
42260
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t) : t();
42134
42261
  }
42135
- Br2();
42136
- typeof window < "u" && (window.Sap = I3);
42137
- var qr2 = I3;
42138
- return He3(zr2);
42262
+ en();
42263
+ typeof window < "u" && (window.Sap = F2);
42264
+ var rn = F2;
42265
+ return er2(nn2);
42139
42266
  })();
42140
42267
  if (typeof window !== "undefined" && Sap && Sap.default) window.Sap = Sap.default;
42141
42268
  var sapDefault = Sap.default;