@arabold/docs-mcp-server 2.0.3 → 2.1.0

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.
@@ -23,13 +23,13 @@ function src_default$1(e) {
23
23
  s && (n.hidden = !1), s && (n.style.display = null);
24
24
  let d = n.getBoundingClientRect().height;
25
25
  n.style.height = "auto";
26
- let h = n.getBoundingClientRect().height;
27
- d === h && (d = a), e.transition(n, e.setStyles, {
26
+ let p = n.getBoundingClientRect().height;
27
+ d === p && (d = a), e.transition(n, e.setStyles, {
28
28
  during: l,
29
29
  start: { height: d + "px" },
30
- end: { height: h + "px" }
30
+ end: { height: p + "px" }
31
31
  }, () => n._x_isShown = !0, () => {
32
- Math.abs(n.getBoundingClientRect().height - h) < 1 && (n.style.overflow = null);
32
+ Math.abs(n.getBoundingClientRect().height - p) < 1 && (n.style.overflow = null);
33
33
  });
34
34
  },
35
35
  out(c = () => {
@@ -65,10 +65,16 @@ function modifierValue$1(e, t, n) {
65
65
  }
66
66
  return i;
67
67
  }
68
- var module_default$1 = src_default$1, flushPending = !1, flushing = !1, queue = [], lastFlushedIndex = -1;
68
+ var module_default$1 = src_default$1, flushPending = !1, flushing = !1, queue = [], lastFlushedIndex = -1, transactionActive = !1;
69
69
  function scheduler(e) {
70
70
  queueJob(e);
71
71
  }
72
+ function startTransaction() {
73
+ transactionActive = !0;
74
+ }
75
+ function commitTransaction() {
76
+ transactionActive = !1, queueFlush();
77
+ }
72
78
  function queueJob(e) {
73
79
  queue.includes(e) || queue.push(e), queueFlush();
74
80
  }
@@ -77,7 +83,11 @@ function dequeueJob(e) {
77
83
  t !== -1 && t > lastFlushedIndex && queue.splice(t, 1);
78
84
  }
79
85
  function queueFlush() {
80
- !flushing && !flushPending && (flushPending = !0, queueMicrotask(flushJobs));
86
+ if (!flushing && !flushPending) {
87
+ if (transactionActive)
88
+ return;
89
+ flushPending = !0, queueMicrotask(flushJobs);
90
+ }
81
91
  }
82
92
  function flushJobs() {
83
93
  flushPending = !1, flushing = !0;
@@ -114,12 +124,24 @@ function elementBoundEffect(e) {
114
124
  function watch(e, t) {
115
125
  let n = !0, i, r = effect$3(() => {
116
126
  let a = e();
117
- JSON.stringify(a), n ? i = a : queueMicrotask(() => {
118
- t(a, i), i = a;
119
- }), n = !1;
127
+ if (JSON.stringify(a), !n && (typeof a == "object" || a !== i)) {
128
+ let s = i;
129
+ queueMicrotask(() => {
130
+ t(a, s);
131
+ });
132
+ }
133
+ i = a, n = !1;
120
134
  });
121
135
  return () => release(r);
122
136
  }
137
+ async function transaction(e) {
138
+ startTransaction();
139
+ try {
140
+ await e(), await Promise.resolve();
141
+ } finally {
142
+ commitTransaction();
143
+ }
144
+ }
123
145
  var onAttributeAddeds = [], onElRemoveds = [], onElAddeds = [];
124
146
  function onElAdded(e) {
125
147
  onElAddeds.push(e);
@@ -532,6 +554,7 @@ function outNonAlpineAttributes({ name: e }) {
532
554
  var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`);
533
555
  function toParsedDirectives(e, t) {
534
556
  return ({ name: n, value: i }) => {
557
+ n === i && (i = "");
535
558
  let r = n.match(alpineAttributeRegex()), a = n.match(/:([a-zA-Z0-9\-_:]+)/), s = n.match(/\.[^.\]]+(?=[^\]]*$)/g) || [], o = t || e[n] || n;
536
559
  return {
537
560
  type: r ? r[1] : null,
@@ -759,14 +782,14 @@ function registerTransitionsFromClassString(e, t, n) {
759
782
  function registerTransitionsFromHelper(e, t, n) {
760
783
  registerTransitionObject(e, setStyles);
761
784
  let i = !t.includes("in") && !t.includes("out") && !n, r = i || t.includes("in") || ["enter"].includes(n), a = i || t.includes("out") || ["leave"].includes(n);
762
- t.includes("in") && !i && (t = t.filter((E, g) => g < t.indexOf("out"))), t.includes("out") && !i && (t = t.filter((E, g) => g > t.indexOf("out")));
763
- let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3, h = modifierValue(t, "origin", "center"), b = "opacity, transform", v = modifierValue(t, "duration", 150) / 1e3, x = modifierValue(t, "duration", 75) / 1e3, m = "cubic-bezier(0.4, 0.0, 0.2, 1)";
785
+ t.includes("in") && !i && (t = t.filter((b, m) => m < t.indexOf("out"))), t.includes("out") && !i && (t = t.filter((b, m) => m > t.indexOf("out")));
786
+ let s = !t.includes("opacity") && !t.includes("scale"), o = s || t.includes("opacity"), l = s || t.includes("scale"), c = o ? 0 : 1, u = l ? modifierValue(t, "scale", 95) / 100 : 1, d = modifierValue(t, "delay", 0) / 1e3, p = modifierValue(t, "origin", "center"), x = "opacity, transform", v = modifierValue(t, "duration", 150) / 1e3, y = modifierValue(t, "duration", 75) / 1e3, h = "cubic-bezier(0.4, 0.0, 0.2, 1)";
764
787
  r && (e._x_transition.enter.during = {
765
- transformOrigin: h,
788
+ transformOrigin: p,
766
789
  transitionDelay: `${d}s`,
767
- transitionProperty: b,
790
+ transitionProperty: x,
768
791
  transitionDuration: `${v}s`,
769
- transitionTimingFunction: m
792
+ transitionTimingFunction: h
770
793
  }, e._x_transition.enter.start = {
771
794
  opacity: c,
772
795
  transform: `scale(${u})`
@@ -774,11 +797,11 @@ function registerTransitionsFromHelper(e, t, n) {
774
797
  opacity: 1,
775
798
  transform: "scale(1)"
776
799
  }), a && (e._x_transition.leave.during = {
777
- transformOrigin: h,
800
+ transformOrigin: p,
778
801
  transitionDelay: `${d}s`,
779
- transitionProperty: b,
780
- transitionDuration: `${x}s`,
781
- transitionTimingFunction: m
802
+ transitionProperty: x,
803
+ transitionDuration: `${y}s`,
804
+ transitionTimingFunction: h
782
805
  }, e._x_transition.leave.start = {
783
806
  opacity: 1,
784
807
  transform: "scale(1)"
@@ -1183,7 +1206,10 @@ var Alpine = {
1183
1206
  get raw() {
1184
1207
  return raw;
1185
1208
  },
1186
- version: "3.15.3",
1209
+ get transaction() {
1210
+ return transaction;
1211
+ },
1212
+ version: "3.15.8",
1187
1213
  flushAndStopDeferringMutations,
1188
1214
  dontAutoEvaluateFunctions,
1189
1215
  disableEffectScheduling,
@@ -1479,10 +1505,10 @@ function createIterableMethod(e, t, n) {
1479
1505
  return !t && track(a, "iterate", l ? MAP_KEY_ITERATE_KEY : ITERATE_KEY), {
1480
1506
  // iterator protocol
1481
1507
  next() {
1482
- const { value: d, done: h } = c.next();
1483
- return h ? { value: d, done: h } : {
1508
+ const { value: d, done: p } = c.next();
1509
+ return p ? { value: d, done: p } : {
1484
1510
  value: o ? [u(d[0]), u(d[1])] : u(d),
1485
- done: h
1511
+ done: p
1486
1512
  };
1487
1513
  },
1488
1514
  // iterable protocol
@@ -1719,25 +1745,25 @@ directive("modelable", (e, { expression: t }, { effect: n, evaluateLater: i, cle
1719
1745
  if (!e._x_model)
1720
1746
  return;
1721
1747
  e._x_removeModelListeners.default();
1722
- let u = e._x_model.get, d = e._x_model.set, h = entangle(
1748
+ let u = e._x_model.get, d = e._x_model.set, p = entangle(
1723
1749
  {
1724
1750
  get() {
1725
1751
  return u();
1726
1752
  },
1727
- set(b) {
1728
- d(b);
1753
+ set(x) {
1754
+ d(x);
1729
1755
  }
1730
1756
  },
1731
1757
  {
1732
1758
  get() {
1733
1759
  return s();
1734
1760
  },
1735
- set(b) {
1736
- l(b);
1761
+ set(x) {
1762
+ l(x);
1737
1763
  }
1738
1764
  }
1739
1765
  );
1740
- r(h);
1766
+ r(p);
1741
1767
  });
1742
1768
  });
1743
1769
  directive("teleport", (e, { modifiers: t, expression: n }, { cleanup: i }) => {
@@ -1802,6 +1828,8 @@ function on(e, t, n, i) {
1802
1828
  e.contains(c.target) || c.target.isConnected !== !1 && (e.offsetWidth < 1 && e.offsetHeight < 1 || e._x_isShown !== !1 && l(c));
1803
1829
  })), n.includes("self") && (a = o(a, (l, c) => {
1804
1830
  c.target === e && l(c);
1831
+ })), t === "submit" && (a = o(a, (l, c) => {
1832
+ c.target._x_pendingModelUpdates && c.target._x_pendingModelUpdates.forEach((u) => u()), l(c);
1805
1833
  })), (isKeyEvent(t) || isClickEvent(t)) && (a = o(a, (l, c) => {
1806
1834
  isListeningForASpecificKeyThatHasntBeenPressed(c, n) || l(c);
1807
1835
  })), r.addEventListener(t, a, s), () => {
@@ -1829,7 +1857,7 @@ function isClickEvent(e) {
1829
1857
  return ["contextmenu", "click", "mouse"].some((t) => e.includes(t));
1830
1858
  }
1831
1859
  function isListeningForASpecificKeyThatHasntBeenPressed(e, t) {
1832
- let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive", "preserve-scroll"].includes(a));
1860
+ let n = t.filter((a) => !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive", "preserve-scroll", "blur", "change", "lazy"].includes(a));
1833
1861
  if (n.includes("debounce")) {
1834
1862
  let a = n.indexOf("debounce");
1835
1863
  n.splice(a, isNumeric((n[a + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1);
@@ -1876,42 +1904,57 @@ directive("model", (e, { modifiers: t, expression: n }, { effect: i, cleanup: r
1876
1904
  typeof n == "string" ? o = evaluateLater(a, `${n} = __placeholder`) : typeof n == "function" && typeof n() == "string" ? o = evaluateLater(a, `${n()} = __placeholder`) : o = () => {
1877
1905
  };
1878
1906
  let l = () => {
1907
+ let y;
1908
+ return s((h) => y = h), isGetterSetter(y) ? y.get() : y;
1909
+ }, c = (y) => {
1879
1910
  let h;
1880
- return s((b) => h = b), isGetterSetter(h) ? h.get() : h;
1881
- }, c = (h) => {
1882
- let b;
1883
- s((v) => b = v), isGetterSetter(b) ? b.set(h) : o(() => {
1911
+ s((b) => h = b), isGetterSetter(h) ? h.set(y) : o(() => {
1884
1912
  }, {
1885
- scope: { __placeholder: h }
1913
+ scope: { __placeholder: y }
1886
1914
  });
1887
1915
  };
1888
1916
  typeof n == "string" && e.type === "radio" && mutateDom(() => {
1889
1917
  e.hasAttribute("name") || e.setAttribute("name", n);
1890
1918
  });
1891
- let u = e.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(e.type) || t.includes("lazy") ? "change" : "input", d = isCloning ? () => {
1892
- } : on(e, u, t, (h) => {
1893
- c(getInputValue(e, t, h, l()));
1894
- });
1919
+ let u = t.includes("change") || t.includes("lazy"), d = t.includes("blur"), p = t.includes("enter"), x = u || d || p, v;
1920
+ if (isCloning)
1921
+ v = () => {
1922
+ };
1923
+ else if (x) {
1924
+ let y = [], h = (b) => c(getInputValue(e, t, b, l()));
1925
+ if (u && y.push(on(e, "change", t, h)), d && (y.push(on(e, "blur", t, h)), e.form)) {
1926
+ let b = () => h({ target: e });
1927
+ e.form._x_pendingModelUpdates || (e.form._x_pendingModelUpdates = []), e.form._x_pendingModelUpdates.push(b), r(() => e.form._x_pendingModelUpdates.splice(e.form._x_pendingModelUpdates.indexOf(b), 1));
1928
+ }
1929
+ p && y.push(on(e, "keydown", t, (b) => {
1930
+ b.key === "Enter" && h(b);
1931
+ })), v = () => y.forEach((b) => b());
1932
+ } else {
1933
+ let y = e.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(e.type) ? "change" : "input";
1934
+ v = on(e, y, t, (h) => {
1935
+ c(getInputValue(e, t, h, l()));
1936
+ });
1937
+ }
1895
1938
  if (t.includes("fill") && ([void 0, null, ""].includes(l()) || isCheckbox(e) && Array.isArray(l()) || e.tagName.toLowerCase() === "select" && e.multiple) && c(
1896
1939
  getInputValue(e, t, { target: e }, l())
1897
- ), e._x_removeModelListeners || (e._x_removeModelListeners = {}), e._x_removeModelListeners.default = d, r(() => e._x_removeModelListeners.default()), e.form) {
1898
- let h = on(e.form, "reset", [], (b) => {
1940
+ ), e._x_removeModelListeners || (e._x_removeModelListeners = {}), e._x_removeModelListeners.default = v, r(() => e._x_removeModelListeners.default()), e.form) {
1941
+ let y = on(e.form, "reset", [], (h) => {
1899
1942
  nextTick(() => e._x_model && e._x_model.set(getInputValue(e, t, { target: e }, l())));
1900
1943
  });
1901
- r(() => h());
1944
+ r(() => y());
1902
1945
  }
1903
1946
  e._x_model = {
1904
1947
  get() {
1905
1948
  return l();
1906
1949
  },
1907
- set(h) {
1908
- c(h);
1950
+ set(y) {
1951
+ c(y);
1909
1952
  }
1910
- }, e._x_forceModelUpdate = (h) => {
1911
- h === void 0 && typeof n == "string" && n.match(/\./) && (h = ""), window.fromModel = !0, mutateDom(() => bind(e, "value", h)), delete window.fromModel;
1953
+ }, e._x_forceModelUpdate = (y) => {
1954
+ y === void 0 && typeof n == "string" && n.match(/\./) && (y = ""), window.fromModel = !0, mutateDom(() => bind(e, "value", y)), delete window.fromModel;
1912
1955
  }, i(() => {
1913
- let h = l();
1914
- t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(h);
1956
+ let y = l();
1957
+ t.includes("unintrusive") && document.activeElement.isSameNode(e) || e._x_forceModelUpdate(y);
1915
1958
  });
1916
1959
  });
1917
1960
  function getInputValue(e, t, n, i) {
@@ -2069,66 +2112,66 @@ directive("for", (e, { expression: t }, { effect: n, cleanup: i }) => {
2069
2112
  function loop(e, t, n, i) {
2070
2113
  let r = (s) => typeof s == "object" && !Array.isArray(s), a = e;
2071
2114
  n((s) => {
2072
- isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (m) => m + 1)), s === void 0 && (s = []);
2115
+ isNumeric3(s) && s >= 0 && (s = Array.from(Array(s).keys(), (h) => h + 1)), s === void 0 && (s = []);
2073
2116
  let o = e._x_lookup, l = e._x_prevKeys, c = [], u = [];
2074
2117
  if (r(s))
2075
- s = Object.entries(s).map(([m, E]) => {
2076
- let g = getIterationScopeVariables(t, E, m, s);
2077
- i((y) => {
2078
- u.includes(y) && warn("Duplicate key on x-for", e), u.push(y);
2079
- }, { scope: { index: m, ...g } }), c.push(g);
2118
+ s = Object.entries(s).map(([h, b]) => {
2119
+ let m = getIterationScopeVariables(t, b, h, s);
2120
+ i((_) => {
2121
+ u.includes(_) && warn("Duplicate key on x-for", e), u.push(_);
2122
+ }, { scope: { index: h, ...m } }), c.push(m);
2080
2123
  });
2081
2124
  else
2082
- for (let m = 0; m < s.length; m++) {
2083
- let E = getIterationScopeVariables(t, s[m], m, s);
2084
- i((g) => {
2085
- u.includes(g) && warn("Duplicate key on x-for", e), u.push(g);
2086
- }, { scope: { index: m, ...E } }), c.push(E);
2125
+ for (let h = 0; h < s.length; h++) {
2126
+ let b = getIterationScopeVariables(t, s[h], h, s);
2127
+ i((m) => {
2128
+ u.includes(m) && warn("Duplicate key on x-for", e), u.push(m);
2129
+ }, { scope: { index: h, ...b } }), c.push(b);
2087
2130
  }
2088
- let d = [], h = [], b = [], v = [];
2089
- for (let m = 0; m < l.length; m++) {
2090
- let E = l[m];
2091
- u.indexOf(E) === -1 && b.push(E);
2092
- }
2093
- l = l.filter((m) => !b.includes(m));
2094
- let x = "template";
2095
- for (let m = 0; m < u.length; m++) {
2096
- let E = u[m], g = l.indexOf(E);
2097
- if (g === -1)
2098
- l.splice(m, 0, E), d.push([x, m]);
2099
- else if (g !== m) {
2100
- let y = l.splice(m, 1)[0], f = l.splice(g - 1, 1)[0];
2101
- l.splice(m, 0, f), l.splice(g, 0, y), h.push([y, f]);
2131
+ let d = [], p = [], x = [], v = [];
2132
+ for (let h = 0; h < l.length; h++) {
2133
+ let b = l[h];
2134
+ u.indexOf(b) === -1 && x.push(b);
2135
+ }
2136
+ l = l.filter((h) => !x.includes(h));
2137
+ let y = "template";
2138
+ for (let h = 0; h < u.length; h++) {
2139
+ let b = u[h], m = l.indexOf(b);
2140
+ if (m === -1)
2141
+ l.splice(h, 0, b), d.push([y, h]);
2142
+ else if (m !== h) {
2143
+ let _ = l.splice(h, 1)[0], f = l.splice(m - 1, 1)[0];
2144
+ l.splice(h, 0, f), l.splice(m, 0, _), p.push([_, f]);
2102
2145
  } else
2103
- v.push(E);
2104
- x = E;
2146
+ v.push(b);
2147
+ y = b;
2105
2148
  }
2106
- for (let m = 0; m < b.length; m++) {
2107
- let E = b[m];
2108
- E in o && (mutateDom(() => {
2109
- destroyTree(o[E]), o[E].remove();
2110
- }), delete o[E]);
2149
+ for (let h = 0; h < x.length; h++) {
2150
+ let b = x[h];
2151
+ b in o && (mutateDom(() => {
2152
+ destroyTree(o[b]), o[b].remove();
2153
+ }), delete o[b]);
2111
2154
  }
2112
- for (let m = 0; m < h.length; m++) {
2113
- let [E, g] = h[m], y = o[E], f = o[g], p = document.createElement("div");
2155
+ for (let h = 0; h < p.length; h++) {
2156
+ let [b, m] = p[h], _ = o[b], f = o[m], g = document.createElement("div");
2114
2157
  mutateDom(() => {
2115
- f || warn('x-for ":key" is undefined or invalid', a, g, o), f.after(p), y.after(f), f._x_currentIfEl && f.after(f._x_currentIfEl), p.before(y), y._x_currentIfEl && y.after(y._x_currentIfEl), p.remove();
2116
- }), f._x_refreshXForScope(c[u.indexOf(g)]);
2117
- }
2118
- for (let m = 0; m < d.length; m++) {
2119
- let [E, g] = d[m], y = E === "template" ? a : o[E];
2120
- y._x_currentIfEl && (y = y._x_currentIfEl);
2121
- let f = c[g], p = u[g], _ = document.importNode(a.content, !0).firstElementChild, w = reactive(f);
2122
- addScopeToNode(_, w, a), _._x_refreshXForScope = (D) => {
2123
- Object.entries(D).forEach(([A, S]) => {
2124
- w[A] = S;
2158
+ f || warn('x-for ":key" is undefined or invalid', a, m, o), f.after(g), _.after(f), f._x_currentIfEl && f.after(f._x_currentIfEl), g.before(_), _._x_currentIfEl && _.after(_._x_currentIfEl), g.remove();
2159
+ }), f._x_refreshXForScope(c[u.indexOf(m)]);
2160
+ }
2161
+ for (let h = 0; h < d.length; h++) {
2162
+ let [b, m] = d[h], _ = b === "template" ? a : o[b];
2163
+ _._x_currentIfEl && (_ = _._x_currentIfEl);
2164
+ let f = c[m], g = u[m], w = document.importNode(a.content, !0).firstElementChild, E = reactive(f);
2165
+ addScopeToNode(w, E, a), w._x_refreshXForScope = (D) => {
2166
+ Object.entries(D).forEach(([A, C]) => {
2167
+ E[A] = C;
2125
2168
  });
2126
2169
  }, mutateDom(() => {
2127
- y.after(_), skipDuringClone(() => initTree(_))();
2128
- }), typeof p == "object" && warn("x-for key cannot be an object, it must be a string or an integer", a), o[p] = _;
2170
+ _.after(w), skipDuringClone(() => initTree(w))();
2171
+ }), typeof g == "object" && warn("x-for key cannot be an object, it must be a string or an integer", a), o[g] = w;
2129
2172
  }
2130
- for (let m = 0; m < v.length; m++)
2131
- o[v[m]]._x_refreshXForScope(c[u.indexOf(v[m])]);
2173
+ for (let h = 0; h < v.length; h++)
2174
+ o[v[h]]._x_refreshXForScope(c[u.indexOf(v[h])]);
2132
2175
  a._x_prevKeys = u;
2133
2176
  });
2134
2177
  }
@@ -2695,13 +2738,13 @@ function getBoundingClientRect(e, t, n) {
2695
2738
  t === void 0 && (t = !1), n === void 0 && (n = !1);
2696
2739
  var i = e.getBoundingClientRect(), r = 1, a = 1;
2697
2740
  t && isHTMLElement(e) && (r = e.offsetWidth > 0 && round(i.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && round(i.height) / e.offsetHeight || 1);
2698
- var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r, h = i.height / a;
2741
+ var s = isElement(e) ? getWindow(e) : window, o = s.visualViewport, l = !isLayoutViewport() && n, c = (i.left + (l && o ? o.offsetLeft : 0)) / r, u = (i.top + (l && o ? o.offsetTop : 0)) / a, d = i.width / r, p = i.height / a;
2699
2742
  return {
2700
2743
  width: d,
2701
- height: h,
2744
+ height: p,
2702
2745
  top: u,
2703
2746
  right: c + d,
2704
- bottom: u + h,
2747
+ bottom: u + p,
2705
2748
  left: c,
2706
2749
  x: c,
2707
2750
  y: u
@@ -2813,8 +2856,8 @@ var toPaddingObject = function(t, n) {
2813
2856
  function arrow(e) {
2814
2857
  var t, n = e.state, i = e.name, r = e.options, a = n.elements.arrow, s = n.modifiersData.popperOffsets, o = getBasePlacement(n.placement), l = getMainAxisFromPlacement(o), c = [left, right].indexOf(o) >= 0, u = c ? "height" : "width";
2815
2858
  if (!(!a || !s)) {
2816
- var d = toPaddingObject(r.padding, n), h = getLayoutRect(a), b = l === "y" ? top : left, v = l === "y" ? bottom : right, x = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], m = s[l] - n.rects.reference[l], E = getOffsetParent(a), g = E ? l === "y" ? E.clientHeight || 0 : E.clientWidth || 0 : 0, y = x / 2 - m / 2, f = d[b], p = g - h[u] - d[v], _ = g / 2 - h[u] / 2 + y, w = within(f, _, p), D = l;
2817
- n.modifiersData[i] = (t = {}, t[D] = w, t.centerOffset = w - _, t);
2859
+ var d = toPaddingObject(r.padding, n), p = getLayoutRect(a), x = l === "y" ? top : left, v = l === "y" ? bottom : right, y = n.rects.reference[u] + n.rects.reference[l] - s[l] - n.rects.popper[u], h = s[l] - n.rects.reference[l], b = getOffsetParent(a), m = b ? l === "y" ? b.clientHeight || 0 : b.clientWidth || 0 : 0, _ = y / 2 - h / 2, f = d[x], g = m - p[u] - d[v], w = m / 2 - p[u] / 2 + _, E = within(f, w, g), D = l;
2860
+ n.modifiersData[i] = (t = {}, t[D] = E, t.centerOffset = E - w, t);
2818
2861
  }
2819
2862
  }
2820
2863
  function effect$1(e) {
@@ -2847,48 +2890,48 @@ function roundOffsetsByDPR(e, t) {
2847
2890
  };
2848
2891
  }
2849
2892
  function mapToStyles(e) {
2850
- var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed, h = s.x, b = h === void 0 ? 0 : h, v = s.y, x = v === void 0 ? 0 : v, m = typeof u == "function" ? u({
2851
- x: b,
2852
- y: x
2893
+ var t, n = e.popper, i = e.popperRect, r = e.placement, a = e.variation, s = e.offsets, o = e.position, l = e.gpuAcceleration, c = e.adaptive, u = e.roundOffsets, d = e.isFixed, p = s.x, x = p === void 0 ? 0 : p, v = s.y, y = v === void 0 ? 0 : v, h = typeof u == "function" ? u({
2894
+ x,
2895
+ y
2853
2896
  }) : {
2854
- x: b,
2855
- y: x
2897
+ x,
2898
+ y
2856
2899
  };
2857
- b = m.x, x = m.y;
2858
- var E = s.hasOwnProperty("x"), g = s.hasOwnProperty("y"), y = left, f = top, p = window;
2900
+ x = h.x, y = h.y;
2901
+ var b = s.hasOwnProperty("x"), m = s.hasOwnProperty("y"), _ = left, f = top, g = window;
2859
2902
  if (c) {
2860
- var _ = getOffsetParent(n), w = "clientHeight", D = "clientWidth";
2861
- if (_ === getWindow(n) && (_ = getDocumentElement(n), getComputedStyle$1(_).position !== "static" && o === "absolute" && (w = "scrollHeight", D = "scrollWidth")), _ = _, r === top || (r === left || r === right) && a === end) {
2903
+ var w = getOffsetParent(n), E = "clientHeight", D = "clientWidth";
2904
+ if (w === getWindow(n) && (w = getDocumentElement(n), getComputedStyle$1(w).position !== "static" && o === "absolute" && (E = "scrollHeight", D = "scrollWidth")), w = w, r === top || (r === left || r === right) && a === end) {
2862
2905
  f = bottom;
2863
- var A = d && _ === p && p.visualViewport ? p.visualViewport.height : (
2906
+ var A = d && w === g && g.visualViewport ? g.visualViewport.height : (
2864
2907
  // $FlowFixMe[prop-missing]
2865
- _[w]
2908
+ w[E]
2866
2909
  );
2867
- x -= A - i.height, x *= l ? 1 : -1;
2910
+ y -= A - i.height, y *= l ? 1 : -1;
2868
2911
  }
2869
2912
  if (r === left || (r === top || r === bottom) && a === end) {
2870
- y = right;
2871
- var S = d && _ === p && p.visualViewport ? p.visualViewport.width : (
2913
+ _ = right;
2914
+ var C = d && w === g && g.visualViewport ? g.visualViewport.width : (
2872
2915
  // $FlowFixMe[prop-missing]
2873
- _[D]
2916
+ w[D]
2874
2917
  );
2875
- b -= S - i.width, b *= l ? 1 : -1;
2918
+ x -= C - i.width, x *= l ? 1 : -1;
2876
2919
  }
2877
2920
  }
2878
- var C = Object.assign({
2921
+ var S = Object.assign({
2879
2922
  position: o
2880
2923
  }, c && unsetSides), O = u === !0 ? roundOffsetsByDPR({
2881
- x: b,
2882
- y: x
2924
+ x,
2925
+ y
2883
2926
  }, getWindow(n)) : {
2884
- x: b,
2885
- y: x
2927
+ x,
2928
+ y
2886
2929
  };
2887
- if (b = O.x, x = O.y, l) {
2930
+ if (x = O.x, y = O.y, l) {
2888
2931
  var T;
2889
- return Object.assign({}, C, (T = {}, T[f] = g ? "0" : "", T[y] = E ? "0" : "", T.transform = (p.devicePixelRatio || 1) <= 1 ? "translate(" + b + "px, " + x + "px)" : "translate3d(" + b + "px, " + x + "px, 0)", T));
2932
+ return Object.assign({}, S, (T = {}, T[f] = m ? "0" : "", T[_] = b ? "0" : "", T.transform = (g.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", T));
2890
2933
  }
2891
- return Object.assign({}, C, (t = {}, t[f] = g ? x + "px" : "", t[y] = E ? b + "px" : "", t.transform = "", t));
2934
+ return Object.assign({}, S, (t = {}, t[f] = m ? y + "px" : "", t[_] = b ? x + "px" : "", t.transform = "", t));
2892
2935
  }
2893
2936
  function computeStyles(e) {
2894
2937
  var t = e.state, n = e.options, i = n.gpuAcceleration, r = i === void 0 ? !0 : i, a = n.adaptive, s = a === void 0 ? !0 : a, o = n.roundOffsets, l = o === void 0 ? !0 : o, c = {
@@ -3088,43 +3131,43 @@ function computeOffsets(e) {
3088
3131
  }
3089
3132
  function detectOverflow(e, t) {
3090
3133
  t === void 0 && (t = {});
3091
- var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext, h = d === void 0 ? popper : d, b = n.altBoundary, v = b === void 0 ? !1 : b, x = n.padding, m = x === void 0 ? 0 : x, E = mergePaddingObject(typeof m != "number" ? m : expandToHashMap(m, basePlacements)), g = h === popper ? reference : popper, y = e.rects.popper, f = e.elements[v ? g : h], p = getClippingRect(isElement(f) ? f : f.contextElement || getDocumentElement(e.elements.popper), l, u, s), _ = getBoundingClientRect(e.elements.reference), w = computeOffsets({
3092
- reference: _,
3093
- element: y,
3134
+ var n = t, i = n.placement, r = i === void 0 ? e.placement : i, a = n.strategy, s = a === void 0 ? e.strategy : a, o = n.boundary, l = o === void 0 ? clippingParents : o, c = n.rootBoundary, u = c === void 0 ? viewport : c, d = n.elementContext, p = d === void 0 ? popper : d, x = n.altBoundary, v = x === void 0 ? !1 : x, y = n.padding, h = y === void 0 ? 0 : y, b = mergePaddingObject(typeof h != "number" ? h : expandToHashMap(h, basePlacements)), m = p === popper ? reference : popper, _ = e.rects.popper, f = e.elements[v ? m : p], g = getClippingRect(isElement(f) ? f : f.contextElement || getDocumentElement(e.elements.popper), l, u, s), w = getBoundingClientRect(e.elements.reference), E = computeOffsets({
3135
+ reference: w,
3136
+ element: _,
3094
3137
  placement: r
3095
- }), D = rectToClientRect(Object.assign({}, y, w)), A = h === popper ? D : _, S = {
3096
- top: p.top - A.top + E.top,
3097
- bottom: A.bottom - p.bottom + E.bottom,
3098
- left: p.left - A.left + E.left,
3099
- right: A.right - p.right + E.right
3100
- }, C = e.modifiersData.offset;
3101
- if (h === popper && C) {
3102
- var O = C[r];
3103
- Object.keys(S).forEach(function(T) {
3104
- var L = [right, bottom].indexOf(T) >= 0 ? 1 : -1, R = [top, bottom].indexOf(T) >= 0 ? "y" : "x";
3105
- S[T] += O[R] * L;
3138
+ }), D = rectToClientRect(Object.assign({}, _, E)), A = p === popper ? D : w, C = {
3139
+ top: g.top - A.top + b.top,
3140
+ bottom: A.bottom - g.bottom + b.bottom,
3141
+ left: g.left - A.left + b.left,
3142
+ right: A.right - g.right + b.right
3143
+ }, S = e.modifiersData.offset;
3144
+ if (p === popper && S) {
3145
+ var O = S[r];
3146
+ Object.keys(C).forEach(function(T) {
3147
+ var L = [right, bottom].indexOf(T) >= 0 ? 1 : -1, M = [top, bottom].indexOf(T) >= 0 ? "y" : "x";
3148
+ C[T] += O[M] * L;
3106
3149
  });
3107
3150
  }
3108
- return S;
3151
+ return C;
3109
3152
  }
3110
3153
  function computeAutoPlacement(e, t) {
3111
3154
  t === void 0 && (t = {});
3112
3155
  var n = t, i = n.placement, r = n.boundary, a = n.rootBoundary, s = n.padding, o = n.flipVariations, l = n.allowedAutoPlacements, c = l === void 0 ? placements : l, u = getVariation(i), d = u ? o ? variationPlacements : variationPlacements.filter(function(v) {
3113
3156
  return getVariation(v) === u;
3114
- }) : basePlacements, h = d.filter(function(v) {
3157
+ }) : basePlacements, p = d.filter(function(v) {
3115
3158
  return c.indexOf(v) >= 0;
3116
3159
  });
3117
- h.length === 0 && (h = d);
3118
- var b = h.reduce(function(v, x) {
3119
- return v[x] = detectOverflow(e, {
3120
- placement: x,
3160
+ p.length === 0 && (p = d);
3161
+ var x = p.reduce(function(v, y) {
3162
+ return v[y] = detectOverflow(e, {
3163
+ placement: y,
3121
3164
  boundary: r,
3122
3165
  rootBoundary: a,
3123
3166
  padding: s
3124
- })[getBasePlacement(x)], v;
3167
+ })[getBasePlacement(y)], v;
3125
3168
  }, {});
3126
- return Object.keys(b).sort(function(v, x) {
3127
- return b[v] - b[x];
3169
+ return Object.keys(x).sort(function(v, y) {
3170
+ return x[v] - x[y];
3128
3171
  });
3129
3172
  }
3130
3173
  function getExpandedFallbackPlacements(e) {
@@ -3136,37 +3179,37 @@ function getExpandedFallbackPlacements(e) {
3136
3179
  function flip(e) {
3137
3180
  var t = e.state, n = e.options, i = e.name;
3138
3181
  if (!t.modifiersData[i]._skip) {
3139
- for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary, h = n.altBoundary, b = n.flipVariations, v = b === void 0 ? !0 : b, x = n.allowedAutoPlacements, m = t.options.placement, E = getBasePlacement(m), g = E === m, y = l || (g || !v ? [getOppositePlacement(m)] : getExpandedFallbackPlacements(m)), f = [m].concat(y).reduce(function(V, B) {
3182
+ for (var r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !0 : s, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary, p = n.altBoundary, x = n.flipVariations, v = x === void 0 ? !0 : x, y = n.allowedAutoPlacements, h = t.options.placement, b = getBasePlacement(h), m = b === h, _ = l || (m || !v ? [getOppositePlacement(h)] : getExpandedFallbackPlacements(h)), f = [h].concat(_).reduce(function(V, B) {
3140
3183
  return V.concat(getBasePlacement(B) === auto ? computeAutoPlacement(t, {
3141
3184
  placement: B,
3142
3185
  boundary: u,
3143
3186
  rootBoundary: d,
3144
3187
  padding: c,
3145
3188
  flipVariations: v,
3146
- allowedAutoPlacements: x
3189
+ allowedAutoPlacements: y
3147
3190
  }) : B);
3148
- }, []), p = t.rects.reference, _ = t.rects.popper, w = /* @__PURE__ */ new Map(), D = !0, A = f[0], S = 0; S < f.length; S++) {
3149
- var C = f[S], O = getBasePlacement(C), T = getVariation(C) === start, L = [top, bottom].indexOf(O) >= 0, R = L ? "width" : "height", H = detectOverflow(t, {
3150
- placement: C,
3191
+ }, []), g = t.rects.reference, w = t.rects.popper, E = /* @__PURE__ */ new Map(), D = !0, A = f[0], C = 0; C < f.length; C++) {
3192
+ var S = f[C], O = getBasePlacement(S), T = getVariation(S) === start, L = [top, bottom].indexOf(O) >= 0, M = L ? "width" : "height", H = detectOverflow(t, {
3193
+ placement: S,
3151
3194
  boundary: u,
3152
3195
  rootBoundary: d,
3153
- altBoundary: h,
3196
+ altBoundary: p,
3154
3197
  padding: c
3155
3198
  }), I = L ? T ? right : left : T ? bottom : top;
3156
- p[R] > _[R] && (I = getOppositePlacement(I));
3199
+ g[M] > w[M] && (I = getOppositePlacement(I));
3157
3200
  var W = getOppositePlacement(I), $ = [];
3158
3201
  if (a && $.push(H[O] <= 0), o && $.push(H[I] <= 0, H[W] <= 0), $.every(function(V) {
3159
3202
  return V;
3160
3203
  })) {
3161
- A = C, D = !1;
3204
+ A = S, D = !1;
3162
3205
  break;
3163
3206
  }
3164
- w.set(C, $);
3207
+ E.set(S, $);
3165
3208
  }
3166
3209
  if (D)
3167
3210
  for (var q = v ? 3 : 1, N = function(B) {
3168
- var k = f.find(function(M) {
3169
- var F = w.get(M);
3211
+ var k = f.find(function(R) {
3212
+ var F = E.get(R);
3170
3213
  if (F)
3171
3214
  return F.slice(0, B).every(function(K) {
3172
3215
  return K;
@@ -3274,34 +3317,34 @@ function getAltAxis(e) {
3274
3317
  return e === "x" ? "y" : "x";
3275
3318
  }
3276
3319
  function preventOverflow(e) {
3277
- var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding, h = n.tether, b = h === void 0 ? !0 : h, v = n.tetherOffset, x = v === void 0 ? 0 : v, m = detectOverflow(t, {
3320
+ var t = e.state, n = e.options, i = e.name, r = n.mainAxis, a = r === void 0 ? !0 : r, s = n.altAxis, o = s === void 0 ? !1 : s, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding, p = n.tether, x = p === void 0 ? !0 : p, v = n.tetherOffset, y = v === void 0 ? 0 : v, h = detectOverflow(t, {
3278
3321
  boundary: l,
3279
3322
  rootBoundary: c,
3280
3323
  padding: d,
3281
3324
  altBoundary: u
3282
- }), E = getBasePlacement(t.placement), g = getVariation(t.placement), y = !g, f = getMainAxisFromPlacement(E), p = getAltAxis(f), _ = t.modifiersData.popperOffsets, w = t.rects.reference, D = t.rects.popper, A = typeof x == "function" ? x(Object.assign({}, t.rects, {
3325
+ }), b = getBasePlacement(t.placement), m = getVariation(t.placement), _ = !m, f = getMainAxisFromPlacement(b), g = getAltAxis(f), w = t.modifiersData.popperOffsets, E = t.rects.reference, D = t.rects.popper, A = typeof y == "function" ? y(Object.assign({}, t.rects, {
3283
3326
  placement: t.placement
3284
- })) : x, S = typeof A == "number" ? {
3327
+ })) : y, C = typeof A == "number" ? {
3285
3328
  mainAxis: A,
3286
3329
  altAxis: A
3287
3330
  } : Object.assign({
3288
3331
  mainAxis: 0,
3289
3332
  altAxis: 0
3290
- }, A), C = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, O = {
3333
+ }, A), S = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, O = {
3291
3334
  x: 0,
3292
3335
  y: 0
3293
3336
  };
3294
- if (_) {
3337
+ if (w) {
3295
3338
  if (a) {
3296
- var T, L = f === "y" ? top : left, R = f === "y" ? bottom : right, H = f === "y" ? "height" : "width", I = _[f], W = I + m[L], $ = I - m[R], q = b ? -D[H] / 2 : 0, N = g === start ? w[H] : D[H], P = g === start ? -D[H] : -w[H], j = t.elements.arrow, V = b && j ? getLayoutRect(j) : {
3339
+ var T, L = f === "y" ? top : left, M = f === "y" ? bottom : right, H = f === "y" ? "height" : "width", I = w[f], W = I + h[L], $ = I - h[M], q = x ? -D[H] / 2 : 0, N = m === start ? E[H] : D[H], P = m === start ? -D[H] : -E[H], j = t.elements.arrow, V = x && j ? getLayoutRect(j) : {
3297
3340
  width: 0,
3298
3341
  height: 0
3299
- }, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), k = B[L], M = B[R], F = within(0, w[H], V[H]), K = y ? w[H] / 2 - q - F - k - S.mainAxis : N - F - k - S.mainAxis, ae = y ? -w[H] / 2 + q + F + M + S.mainAxis : P + F + M + S.mainAxis, Y = t.elements.arrow && getOffsetParent(t.elements.arrow), se = Y ? f === "y" ? Y.clientTop || 0 : Y.clientLeft || 0 : 0, J = (T = C?.[f]) != null ? T : 0, oe = I + K - J - se, le = I + ae - J, G = within(b ? min(W, oe) : W, I, b ? max($, le) : $);
3300
- _[f] = G, O[f] = G - I;
3342
+ }, B = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : getFreshSideObject(), k = B[L], R = B[M], F = within(0, E[H], V[H]), K = _ ? E[H] / 2 - q - F - k - C.mainAxis : N - F - k - C.mainAxis, ae = _ ? -E[H] / 2 + q + F + R + C.mainAxis : P + F + R + C.mainAxis, Y = t.elements.arrow && getOffsetParent(t.elements.arrow), se = Y ? f === "y" ? Y.clientTop || 0 : Y.clientLeft || 0 : 0, J = (T = S?.[f]) != null ? T : 0, oe = I + K - J - se, le = I + ae - J, G = within(x ? min(W, oe) : W, I, x ? max($, le) : $);
3343
+ w[f] = G, O[f] = G - I;
3301
3344
  }
3302
3345
  if (o) {
3303
- var Z, ce = f === "x" ? top : left, ue = f === "x" ? bottom : right, z = _[p], U = p === "y" ? "height" : "width", Q = z + m[ce], ee = z - m[ue], X = [top, left].indexOf(E) !== -1, te = (Z = C?.[p]) != null ? Z : 0, ne = X ? Q : z - w[U] - D[U] - te + S.altAxis, ie = X ? z + w[U] + D[U] - te - S.altAxis : ee, re = b && X ? withinMaxClamp(ne, z, ie) : within(b ? ne : Q, z, b ? ie : ee);
3304
- _[p] = re, O[p] = re - z;
3346
+ var Z, ce = f === "x" ? top : left, ue = f === "x" ? bottom : right, z = w[g], U = g === "y" ? "height" : "width", Q = z + h[ce], ee = z - h[ue], X = [top, left].indexOf(b) !== -1, te = (Z = S?.[g]) != null ? Z : 0, ne = X ? Q : z - E[U] - D[U] - te + C.altAxis, ie = X ? z + E[U] + D[U] - te - C.altAxis : ee, re = x && X ? withinMaxClamp(ne, z, ie) : within(x ? ne : Q, z, x ? ie : ee);
3347
+ w[g] = re, O[g] = re - z;
3305
3348
  }
3306
3349
  t.modifiersData[i] = O;
3307
3350
  }
@@ -3420,18 +3463,18 @@ function popperGenerator(e) {
3420
3463
  },
3421
3464
  attributes: {},
3422
3465
  styles: {}
3423
- }, d = [], h = !1, b = {
3466
+ }, d = [], p = !1, x = {
3424
3467
  state: u,
3425
- setOptions: function(E) {
3426
- var g = typeof E == "function" ? E(u.options) : E;
3427
- x(), u.options = Object.assign({}, a, u.options, g), u.scrollParents = {
3468
+ setOptions: function(b) {
3469
+ var m = typeof b == "function" ? b(u.options) : b;
3470
+ y(), u.options = Object.assign({}, a, u.options, m), u.scrollParents = {
3428
3471
  reference: isElement(o) ? listScrollParents(o) : o.contextElement ? listScrollParents(o.contextElement) : [],
3429
3472
  popper: listScrollParents(l)
3430
3473
  };
3431
- var y = orderModifiers(mergeByName([].concat(i, u.options.modifiers)));
3432
- return u.orderedModifiers = y.filter(function(f) {
3474
+ var _ = orderModifiers(mergeByName([].concat(i, u.options.modifiers)));
3475
+ return u.orderedModifiers = _.filter(function(f) {
3433
3476
  return f.enabled;
3434
- }), v(), b.update();
3477
+ }), v(), x.update();
3435
3478
  },
3436
3479
  // Sync update – it will always be executed, even if not necessary. This
3437
3480
  // is useful for low frequency updates where sync behavior simplifies the
@@ -3439,26 +3482,26 @@ function popperGenerator(e) {
3439
3482
  // For high frequency updates (e.g. `resize` and `scroll` events), always
3440
3483
  // prefer the async Popper#update method
3441
3484
  forceUpdate: function() {
3442
- if (!h) {
3443
- var E = u.elements, g = E.reference, y = E.popper;
3444
- if (areValidElements(g, y)) {
3485
+ if (!p) {
3486
+ var b = u.elements, m = b.reference, _ = b.popper;
3487
+ if (areValidElements(m, _)) {
3445
3488
  u.rects = {
3446
- reference: getCompositeRect(g, getOffsetParent(y), u.options.strategy === "fixed"),
3447
- popper: getLayoutRect(y)
3448
- }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(S) {
3449
- return u.modifiersData[S.name] = Object.assign({}, S.data);
3489
+ reference: getCompositeRect(m, getOffsetParent(_), u.options.strategy === "fixed"),
3490
+ popper: getLayoutRect(_)
3491
+ }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(C) {
3492
+ return u.modifiersData[C.name] = Object.assign({}, C.data);
3450
3493
  });
3451
3494
  for (var f = 0; f < u.orderedModifiers.length; f++) {
3452
3495
  if (u.reset === !0) {
3453
3496
  u.reset = !1, f = -1;
3454
3497
  continue;
3455
3498
  }
3456
- var p = u.orderedModifiers[f], _ = p.fn, w = p.options, D = w === void 0 ? {} : w, A = p.name;
3457
- typeof _ == "function" && (u = _({
3499
+ var g = u.orderedModifiers[f], w = g.fn, E = g.options, D = E === void 0 ? {} : E, A = g.name;
3500
+ typeof w == "function" && (u = w({
3458
3501
  state: u,
3459
3502
  options: D,
3460
3503
  name: A,
3461
- instance: b
3504
+ instance: x
3462
3505
  }) || u);
3463
3506
  }
3464
3507
  }
@@ -3467,40 +3510,40 @@ function popperGenerator(e) {
3467
3510
  // Async and optimistically optimized update – it will not be executed if
3468
3511
  // not necessary (debounced to run at most once-per-tick)
3469
3512
  update: debounce(function() {
3470
- return new Promise(function(m) {
3471
- b.forceUpdate(), m(u);
3513
+ return new Promise(function(h) {
3514
+ x.forceUpdate(), h(u);
3472
3515
  });
3473
3516
  }),
3474
3517
  destroy: function() {
3475
- x(), h = !0;
3518
+ y(), p = !0;
3476
3519
  }
3477
3520
  };
3478
3521
  if (!areValidElements(o, l))
3479
- return b;
3480
- b.setOptions(c).then(function(m) {
3481
- !h && c.onFirstUpdate && c.onFirstUpdate(m);
3522
+ return x;
3523
+ x.setOptions(c).then(function(h) {
3524
+ !p && c.onFirstUpdate && c.onFirstUpdate(h);
3482
3525
  });
3483
3526
  function v() {
3484
- u.orderedModifiers.forEach(function(m) {
3485
- var E = m.name, g = m.options, y = g === void 0 ? {} : g, f = m.effect;
3527
+ u.orderedModifiers.forEach(function(h) {
3528
+ var b = h.name, m = h.options, _ = m === void 0 ? {} : m, f = h.effect;
3486
3529
  if (typeof f == "function") {
3487
- var p = f({
3530
+ var g = f({
3488
3531
  state: u,
3489
- name: E,
3490
- instance: b,
3491
- options: y
3492
- }), _ = function() {
3532
+ name: b,
3533
+ instance: x,
3534
+ options: _
3535
+ }), w = function() {
3493
3536
  };
3494
- d.push(p || _);
3537
+ d.push(g || w);
3495
3538
  }
3496
3539
  });
3497
3540
  }
3498
- function x() {
3499
- d.forEach(function(m) {
3500
- return m();
3541
+ function y() {
3542
+ d.forEach(function(h) {
3543
+ return h();
3501
3544
  }), d = [];
3502
3545
  }
3503
- return b;
3546
+ return x;
3504
3547
  };
3505
3548
  }
3506
3549
  var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1], createPopper = /* @__PURE__ */ popperGenerator({
@@ -4968,8 +5011,8 @@ function parseFormatString(e) {
4968
5011
  parser: function(s, o) {
4969
5012
  var l = s.split(reNonDateParts).reduce(function(c, u, d) {
4970
5013
  if (u.length > 0 && n[d]) {
4971
- var h = n[d][0];
4972
- h === "M" ? c.m = u : h !== "D" && (c[h] = u);
5014
+ var p = n[d][0];
5015
+ p === "M" ? c.m = u : p !== "D" && (c[p] = u);
4973
5016
  }
4974
5017
  return c;
4975
5018
  }, {});
@@ -5121,45 +5164,45 @@ function validateViewId(e, t) {
5121
5164
  return i >= 0 && i <= n ? i : t;
5122
5165
  }
5123
5166
  function processOptions(e, t) {
5124
- var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate, h = a.pickLevel, b = a.startView, v = a.weekStart;
5167
+ var n = Object.assign({}, e), i = {}, r = t.constructor.locales, a = t.config || {}, s = a.format, o = a.language, l = a.locale, c = a.maxDate, u = a.maxView, d = a.minDate, p = a.pickLevel, x = a.startView, v = a.weekStart;
5125
5168
  if (n.language) {
5126
- var x;
5127
- if (n.language !== o && (r[n.language] ? x = n.language : (x = n.language.split("-")[0], r[x] === void 0 && (x = !1))), delete n.language, x) {
5128
- o = i.language = x;
5129
- var m = l || r[defaultLang];
5169
+ var y;
5170
+ if (n.language !== o && (r[n.language] ? y = n.language : (y = n.language.split("-")[0], r[y] === void 0 && (y = !1))), delete n.language, y) {
5171
+ o = i.language = y;
5172
+ var h = l || r[defaultLang];
5130
5173
  l = Object.assign({
5131
5174
  format: defaultFormat,
5132
5175
  weekStart: defaultWeekStart
5133
- }, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s === m.format && (s = i.format = l.format), v === m.weekStart && (v = i.weekStart = l.weekStart, i.weekEnd = calcEndOfWeek(l.weekStart));
5176
+ }, r[defaultLang]), o !== defaultLang && Object.assign(l, r[o]), i.locale = l, s === h.format && (s = i.format = l.format), v === h.weekStart && (v = i.weekStart = l.weekStart, i.weekEnd = calcEndOfWeek(l.weekStart));
5134
5177
  }
5135
5178
  }
5136
5179
  if (n.format) {
5137
- var E = typeof n.format.toDisplay == "function", g = typeof n.format.toValue == "function", y = reFormatTokens.test(n.format);
5138
- (E && g || y) && (s = i.format = n.format), delete n.format;
5180
+ var b = typeof n.format.toDisplay == "function", m = typeof n.format.toValue == "function", _ = reFormatTokens.test(n.format);
5181
+ (b && m || _) && (s = i.format = n.format), delete n.format;
5139
5182
  }
5140
- var f = d, p = c;
5141
- if (n.minDate !== void 0 && (f = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, f), delete n.minDate), n.maxDate !== void 0 && (p = n.maxDate === null ? void 0 : validateDate(n.maxDate, s, l, p), delete n.maxDate), p < f ? (d = i.minDate = p, c = i.maxDate = f) : (d !== f && (d = i.minDate = f), c !== p && (c = i.maxDate = p)), n.datesDisabled && (i.datesDisabled = n.datesDisabled.reduce(function(R, H) {
5183
+ var f = d, g = c;
5184
+ if (n.minDate !== void 0 && (f = n.minDate === null ? dateValue(0, 0, 1) : validateDate(n.minDate, s, l, f), delete n.minDate), n.maxDate !== void 0 && (g = n.maxDate === null ? void 0 : validateDate(n.maxDate, s, l, g), delete n.maxDate), g < f ? (d = i.minDate = g, c = i.maxDate = f) : (d !== f && (d = i.minDate = f), c !== g && (c = i.maxDate = g)), n.datesDisabled && (i.datesDisabled = n.datesDisabled.reduce(function(M, H) {
5142
5185
  var I = parseDate(H, s, l);
5143
- return I !== void 0 ? pushUnique(R, I) : R;
5186
+ return I !== void 0 ? pushUnique(M, I) : M;
5144
5187
  }, []), delete n.datesDisabled), n.defaultViewDate !== void 0) {
5145
- var _ = parseDate(n.defaultViewDate, s, l);
5146
- _ !== void 0 && (i.defaultViewDate = _), delete n.defaultViewDate;
5188
+ var w = parseDate(n.defaultViewDate, s, l);
5189
+ w !== void 0 && (i.defaultViewDate = w), delete n.defaultViewDate;
5147
5190
  }
5148
5191
  if (n.weekStart !== void 0) {
5149
- var w = Number(n.weekStart) % 7;
5150
- isNaN(w) || (v = i.weekStart = w, i.weekEnd = calcEndOfWeek(w)), delete n.weekStart;
5192
+ var E = Number(n.weekStart) % 7;
5193
+ isNaN(E) || (v = i.weekStart = E, i.weekEnd = calcEndOfWeek(E)), delete n.weekStart;
5151
5194
  }
5152
5195
  if (n.daysOfWeekDisabled && (i.daysOfWeekDisabled = n.daysOfWeekDisabled.reduce(sanitizeDOW, []), delete n.daysOfWeekDisabled), n.daysOfWeekHighlighted && (i.daysOfWeekHighlighted = n.daysOfWeekHighlighted.reduce(sanitizeDOW, []), delete n.daysOfWeekHighlighted), n.maxNumberOfDates !== void 0) {
5153
5196
  var D = parseInt(n.maxNumberOfDates, 10);
5154
5197
  D >= 0 && (i.maxNumberOfDates = D, i.multidate = D !== 1), delete n.maxNumberOfDates;
5155
5198
  }
5156
5199
  n.dateDelimiter && (i.dateDelimiter = String(n.dateDelimiter), delete n.dateDelimiter);
5157
- var A = h;
5158
- n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !== h && (h = i.pickLevel = A);
5159
- var S = u;
5160
- n.maxView !== void 0 && (S = validateViewId(n.maxView, u), delete n.maxView), S = h > S ? h : S, S !== u && (u = i.maxView = S);
5161
- var C = b;
5162
- if (n.startView !== void 0 && (C = validateViewId(n.startView, C), delete n.startView), C < h ? C = h : C > u && (C = u), C !== b && (i.startView = C), n.prevArrow) {
5200
+ var A = p;
5201
+ n.pickLevel !== void 0 && (A = validateViewId(n.pickLevel, 2), delete n.pickLevel), A !== p && (p = i.pickLevel = A);
5202
+ var C = u;
5203
+ n.maxView !== void 0 && (C = validateViewId(n.maxView, u), delete n.maxView), C = p > C ? p : C, C !== u && (u = i.maxView = C);
5204
+ var S = x;
5205
+ if (n.startView !== void 0 && (S = validateViewId(n.startView, S), delete n.startView), S < p ? S = p : S > u && (S = u), S !== x && (i.startView = S), n.prevArrow) {
5163
5206
  var O = parseHTML(n.prevArrow);
5164
5207
  O.childNodes.length > 0 && (i.prevArrow = O.childNodes), delete n.prevArrow;
5165
5208
  }
@@ -5170,11 +5213,11 @@ function processOptions(e, t) {
5170
5213
  if (n.disableTouchKeyboard !== void 0 && (i.disableTouchKeyboard = "ontouchstart" in document && !!n.disableTouchKeyboard, delete n.disableTouchKeyboard), n.orientation) {
5171
5214
  var L = n.orientation.toLowerCase().split(/\s+/g);
5172
5215
  i.orientation = {
5173
- x: L.find(function(R) {
5174
- return R === "left" || R === "right";
5216
+ x: L.find(function(M) {
5217
+ return M === "left" || M === "right";
5175
5218
  }) || "auto",
5176
- y: L.find(function(R) {
5177
- return R === "top" || R === "bottom";
5219
+ y: L.find(function(M) {
5220
+ return M === "top" || M === "bottom";
5178
5221
  }) || "auto"
5179
5222
  }, delete n.orientation;
5180
5223
  }
@@ -5186,8 +5229,8 @@ function processOptions(e, t) {
5186
5229
  }
5187
5230
  delete n.todayBtnMode;
5188
5231
  }
5189
- return Object.keys(n).forEach(function(R) {
5190
- n[R] !== void 0 && hasProperty(defaultOptions, R) && (i[R] = n[R]);
5232
+ return Object.keys(n).forEach(function(M) {
5233
+ n[M] !== void 0 && hasProperty(defaultOptions, M) && (i[M] = n[M]);
5191
5234
  }), i;
5192
5235
  }
5193
5236
  var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
@@ -5331,8 +5374,8 @@ var pickerTemplate = optimizeTemplateHTML(`<div class="datepicker hidden">
5331
5374
  Array.from(this.grid.children).forEach(function(s, o) {
5332
5375
  var l = s.classList, c = addDays(i.start, o), u = new Date(c), d = u.getDay();
5333
5376
  if (s.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), s.dataset.date = c, s.textContent = u.getDate(), c < i.first ? l.add("prev", "text-fg-disabled") : c > i.last && l.add("next", "text-fg-disabled"), i.today === c && l.add("today", "bg-gray-100", "dark:bg-gray-600"), (c < i.minDate || c > i.maxDate || i.disabled.includes(c)) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer")), i.daysOfWeekDisabled.includes(d) && (l.add("disabled", "cursor-not-allowed", "text-fg-disabled"), l.remove("hover:bg-neutral-tertiary-medium", "text-body", "cursor-pointer"), pushUnique(i.disabled, c)), i.daysOfWeekHighlighted.includes(d) && l.add("highlighted"), i.range) {
5334
- var h = _slicedToArray(i.range, 2), b = h[0], v = h[1];
5335
- c > b && c < v && (l.add("range", "bg-neutral-tertiary-medium"), l.remove("rounded-base", "rounded-s-base", "rounded-e-base")), c === b && (l.add("range-start", "bg-brand", "rounded-s-base"), l.remove("rounded-base", "rounded-e-base")), c === v && (l.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), l.remove("rounded-base", "rounded-s-base"));
5377
+ var p = _slicedToArray(i.range, 2), x = p[0], v = p[1];
5378
+ c > x && c < v && (l.add("range", "bg-neutral-tertiary-medium"), l.remove("rounded-base", "rounded-s-base", "rounded-e-base")), c === x && (l.add("range-start", "bg-brand", "rounded-s-base"), l.remove("rounded-base", "rounded-e-base")), c === v && (l.add("range-end", "bg-neutral-tertiary-medium", "rounded-e-base"), l.remove("rounded-base", "rounded-s-base"));
5336
5379
  }
5337
5380
  i.selected.includes(c) && (l.add("selected", "bg-brand", "text-white"), l.remove("text-body", "hover:bg-neutral-tertiary-medium", "bg-neutral-tertiary-medium")), c === i.focused && l.add("focused"), i.beforeShow && i.performBeforeHook(s, c, c);
5338
5381
  });
@@ -5432,12 +5475,12 @@ var MonthsView = /* @__PURE__ */ (function(e) {
5432
5475
  this.disabled = [], this.picker.setViewSwitchLabel(this.year), this.picker.setPrevBtnDisabled(this.year <= this.minYear), this.picker.setNextBtnDisabled(this.year >= this.maxYear);
5433
5476
  var r = this.selected[this.year] || [], a = this.year < this.minYear || this.year > this.maxYear, s = this.year === this.minYear, o = this.year === this.maxYear, l = computeMonthRange(this.range, this.year);
5434
5477
  Array.from(this.grid.children).forEach(function(c, u) {
5435
- var d = c.classList, h = dateValue(i.year, u, 1);
5436
- if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date = h), c.textContent = i.monthNames[u], (a || s && u < i.minMonth || o && u > i.maxMonth) && d.add("disabled"), l) {
5437
- var b = _slicedToArray(l, 2), v = b[0], x = b[1];
5438
- u > v && u < x && d.add("range"), u === v && d.add("range-start"), u === x && d.add("range-end");
5478
+ var d = c.classList, p = dateValue(i.year, u, 1);
5479
+ if (c.className = "datepicker-cell hover:bg-neutral-tertiary-medium block flex-1 leading-9 border-0 rounded-base cursor-pointer text-center text-body font-medium text-sm ".concat(i.cellClass), i.isMinView && (c.dataset.date = p), c.textContent = i.monthNames[u], (a || s && u < i.minMonth || o && u > i.maxMonth) && d.add("disabled"), l) {
5480
+ var x = _slicedToArray(l, 2), v = x[0], y = x[1];
5481
+ u > v && u < y && d.add("range"), u === v && d.add("range-start"), u === y && d.add("range-end");
5439
5482
  }
5440
- r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u, h);
5483
+ r.includes(u) && (d.add("selected", "bg-brand", "text-white", "dark:text-white"), d.remove("text-body", "hover:bg-neutral-tertiary-medium", "dark:text-white")), u === i.focused && d.add("focused"), i.beforeShow && i.performBeforeHook(c, u, p);
5441
5484
  });
5442
5485
  }
5443
5486
  // Update the view UI by applying the changes of selected and focused items
@@ -5656,19 +5699,19 @@ function getTextDirection(e) {
5656
5699
  var Picker = /* @__PURE__ */ (function() {
5657
5700
  function e(t) {
5658
5701
  _classCallCheck(this, e), this.datepicker = t;
5659
- var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1], h = c[2], b = _slicedToArray(o.firstChild.children, 2), v = b[0], x = b[1], m = {
5702
+ var n = pickerTemplate.replace(/%buttonClass%/g, t.config.buttonClass), i = this.element = parseHTML(n).firstChild, r = _slicedToArray(i.firstChild.children, 3), a = r[0], s = r[1], o = r[2], l = a.firstElementChild, c = _slicedToArray(a.lastElementChild.children, 3), u = c[0], d = c[1], p = c[2], x = _slicedToArray(o.firstChild.children, 2), v = x[0], y = x[1], h = {
5660
5703
  title: l,
5661
5704
  prevBtn: u,
5662
5705
  viewSwitch: d,
5663
- nextBtn: h,
5706
+ nextBtn: p,
5664
5707
  todayBtn: v,
5665
- clearBtn: x
5708
+ clearBtn: y
5666
5709
  };
5667
- this.main = s, this.controls = m;
5668
- var E = t.inline ? "inline" : "dropdown";
5669
- i.classList.add("datepicker-".concat(E)), E === "dropdown" && i.classList.add("dropdown", "absolute", "top-0", "left-0", "z-50", "pt-2"), processPickerOptions(this, t.config), this.viewDate = computeResetViewDate(t), registerListeners(t, [[i, "click", onClickPicker.bind(null, t), {
5710
+ this.main = s, this.controls = h;
5711
+ var b = t.inline ? "inline" : "dropdown";
5712
+ i.classList.add("datepicker-".concat(b)), b === "dropdown" && i.classList.add("dropdown", "absolute", "top-0", "left-0", "z-50", "pt-2"), processPickerOptions(this, t.config), this.viewDate = computeResetViewDate(t), registerListeners(t, [[i, "click", onClickPicker.bind(null, t), {
5670
5713
  capture: !0
5671
- }], [s, "click", onClickView.bind(null, t)], [m.viewSwitch, "click", onClickViewSwitch.bind(null, t)], [m.prevBtn, "click", onClickPrevBtn.bind(null, t)], [m.nextBtn, "click", onClickNextBtn.bind(null, t)], [m.todayBtn, "click", onClickTodayBtn.bind(null, t)], [m.clearBtn, "click", onClickClearBtn.bind(null, t)]]), this.views = [new DaysView(this), new MonthsView(this), new YearsView(this, {
5714
+ }], [s, "click", onClickView.bind(null, t)], [h.viewSwitch, "click", onClickViewSwitch.bind(null, t)], [h.prevBtn, "click", onClickPrevBtn.bind(null, t)], [h.nextBtn, "click", onClickNextBtn.bind(null, t)], [h.todayBtn, "click", onClickTodayBtn.bind(null, t)], [h.clearBtn, "click", onClickClearBtn.bind(null, t)]]), this.views = [new DaysView(this), new MonthsView(this), new YearsView(this, {
5672
5715
  id: 2,
5673
5716
  name: "years",
5674
5717
  cellClass: "year",
@@ -5713,8 +5756,8 @@ var Picker = /* @__PURE__ */ (function() {
5713
5756
  }, {
5714
5757
  key: "place",
5715
5758
  value: function() {
5716
- var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height, h = l.getBoundingClientRect(), b = h.left, v = h.top, x = h.width, m = o.getBoundingClientRect(), E = m.left, g = m.top, y = m.width, f = m.height, p = s.orientation, _ = p.x, w = p.y, D, A, S;
5717
- l === document.body ? (D = window.scrollY, A = E + window.scrollX, S = g + D) : (D = l.scrollTop, A = E - b, S = g - v + D), _ === "auto" && (A < 0 ? (_ = "left", A = 10) : A + u > x ? _ = "right" : _ = getTextDirection(o) === "rtl" ? "right" : "left"), _ === "right" && (A -= u - y), w === "auto" && (w = S - d < D ? "bottom" : "top"), w === "top" ? S -= d : S += f, i.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left"), i.add("datepicker-orient-".concat(w), "datepicker-orient-".concat(_)), r.top = S && "".concat(S, "px"), r.left = A && "".concat(A, "px");
5759
+ var n = this.element, i = n.classList, r = n.style, a = this.datepicker, s = a.config, o = a.inputField, l = s.container, c = this.element.getBoundingClientRect(), u = c.width, d = c.height, p = l.getBoundingClientRect(), x = p.left, v = p.top, y = p.width, h = o.getBoundingClientRect(), b = h.left, m = h.top, _ = h.width, f = h.height, g = s.orientation, w = g.x, E = g.y, D, A, C;
5760
+ l === document.body ? (D = window.scrollY, A = b + window.scrollX, C = m + D) : (D = l.scrollTop, A = b - x, C = m - v + D), w === "auto" && (A < 0 ? (w = "left", A = 10) : A + u > y ? w = "right" : w = getTextDirection(o) === "rtl" ? "right" : "left"), w === "right" && (A -= u - _), E === "auto" && (E = C - d < D ? "bottom" : "top"), E === "top" ? C -= d : C += f, i.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left"), i.add("datepicker-orient-".concat(E), "datepicker-orient-".concat(w)), r.top = C && "".concat(C, "px"), r.left = A && "".concat(A, "px");
5718
5761
  }
5719
5762
  }, {
5720
5763
  key: "setViewSwitchLabel",
@@ -5782,8 +5825,8 @@ function moveByArrowKey(e, t, n, i) {
5782
5825
  break;
5783
5826
  case 1:
5784
5827
  o = addMonths(o, i ? n * 4 : n), l = addMonths, c = function(d) {
5785
- var h = new Date(d), b = a.year, v = a.disabled;
5786
- return h.getFullYear() === b && v.includes(h.getMonth());
5828
+ var p = new Date(d), x = a.year, v = a.disabled;
5829
+ return p.getFullYear() === x && v.includes(p.getMonth());
5787
5830
  };
5788
5831
  break;
5789
5832
  default:
@@ -5974,11 +6017,11 @@ var Datepicker$1 = /* @__PURE__ */ (function() {
5974
6017
  this.dates = [];
5975
6018
  var d = processInputDates(this, o);
5976
6019
  d && d.length > 0 && (this.dates = d), s && (s.value = stringifyDates(this.dates, r));
5977
- var h = this.picker = new Picker(this);
6020
+ var p = this.picker = new Picker(this);
5978
6021
  if (a)
5979
6022
  this.show();
5980
6023
  else {
5981
- var b = onClickOutside.bind(null, this), v = [[s, "keydown", onKeydown.bind(null, this)], [s, "focus", onFocus.bind(null, this)], [s, "mousedown", onMousedown.bind(null, this)], [s, "click", onClickInput.bind(null, this)], [s, "paste", onPaste.bind(null, this)], [document, "mousedown", b], [document, "touchstart", b], [window, "resize", h.place.bind(h)]];
6024
+ var x = onClickOutside.bind(null, this), v = [[s, "keydown", onKeydown.bind(null, this)], [s, "focus", onFocus.bind(null, this)], [s, "mousedown", onMousedown.bind(null, this)], [s, "click", onClickInput.bind(null, this)], [s, "paste", onPaste.bind(null, this)], [document, "mousedown", x], [document, "touchstart", x], [window, "resize", p.place.bind(p)]];
5982
6025
  registerListeners(this, v);
5983
6026
  }
5984
6027
  }
@@ -7367,68 +7410,68 @@ var htmx = (function() {
7367
7410
  // @ts-ignore
7368
7411
  end: u ? u.selectionEnd : null
7369
7412
  };
7370
- const h = makeSettleInfo(e);
7413
+ const p = makeSettleInfo(e);
7371
7414
  if (n.swapStyle === "textContent")
7372
7415
  e.textContent = t;
7373
7416
  else {
7374
7417
  let v = makeFragment(t);
7375
- if (h.title = i.title || v.title, i.historyRequest && (v = v.querySelector("[hx-history-elt],[data-hx-history-elt]") || v), i.selectOOB) {
7376
- const x = i.selectOOB.split(",");
7377
- for (let m = 0; m < x.length; m++) {
7378
- const E = x[m].split(":", 2);
7379
- let g = E[0].trim();
7380
- g.indexOf("#") === 0 && (g = g.substring(1));
7381
- const y = E[1] || "true", f = v.querySelector("#" + g);
7382
- f && oobSwap(y, f, h, c);
7418
+ if (p.title = i.title || v.title, i.historyRequest && (v = v.querySelector("[hx-history-elt],[data-hx-history-elt]") || v), i.selectOOB) {
7419
+ const y = i.selectOOB.split(",");
7420
+ for (let h = 0; h < y.length; h++) {
7421
+ const b = y[h].split(":", 2);
7422
+ let m = b[0].trim();
7423
+ m.indexOf("#") === 0 && (m = m.substring(1));
7424
+ const _ = b[1] || "true", f = v.querySelector("#" + m);
7425
+ f && oobSwap(_, f, p, c);
7383
7426
  }
7384
7427
  }
7385
- if (findAndSwapOobElements(v, h, c), forEach(
7428
+ if (findAndSwapOobElements(v, p, c), forEach(
7386
7429
  findAll(v, "template"),
7387
7430
  /** @param {HTMLTemplateElement} template */
7388
- function(x) {
7389
- x.content && findAndSwapOobElements(x.content, h, c) && x.remove();
7431
+ function(y) {
7432
+ y.content && findAndSwapOobElements(y.content, p, c) && y.remove();
7390
7433
  }
7391
7434
  ), i.select) {
7392
- const x = getDocument().createDocumentFragment();
7393
- forEach(v.querySelectorAll(i.select), function(m) {
7394
- x.appendChild(m);
7395
- }), v = x;
7435
+ const y = getDocument().createDocumentFragment();
7436
+ forEach(v.querySelectorAll(i.select), function(h) {
7437
+ y.appendChild(h);
7438
+ }), v = y;
7396
7439
  }
7397
- handlePreservedElements(v), swapWithStyle(n.swapStyle, i.contextElement, e, v, h), restorePreservedElements();
7440
+ handlePreservedElements(v), swapWithStyle(n.swapStyle, i.contextElement, e, v, p), restorePreservedElements();
7398
7441
  }
7399
7442
  if (d.elt && !bodyContains(d.elt) && getRawAttribute(d.elt, "id")) {
7400
- const v = document.getElementById(getRawAttribute(d.elt, "id")), x = { preventScroll: n.focusScroll !== void 0 ? !n.focusScroll : !htmx.config.defaultFocusScroll };
7443
+ const v = document.getElementById(getRawAttribute(d.elt, "id")), y = { preventScroll: n.focusScroll !== void 0 ? !n.focusScroll : !htmx.config.defaultFocusScroll };
7401
7444
  if (v) {
7402
7445
  if (d.start && v.setSelectionRange)
7403
7446
  try {
7404
7447
  v.setSelectionRange(d.start, d.end);
7405
7448
  } catch {
7406
7449
  }
7407
- v.focus(x);
7450
+ v.focus(y);
7408
7451
  }
7409
7452
  }
7410
- e.classList.remove(htmx.config.swappingClass), forEach(h.elts, function(v) {
7453
+ e.classList.remove(htmx.config.swappingClass), forEach(p.elts, function(v) {
7411
7454
  v.classList && v.classList.add(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSwap", i.eventInfo);
7412
- }), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(h.title);
7413
- const b = function() {
7414
- if (forEach(h.tasks, function(v) {
7455
+ }), maybeCall(i.afterSwapCallback), n.ignoreTitle || handleTitle(p.title);
7456
+ const x = function() {
7457
+ if (forEach(p.tasks, function(v) {
7415
7458
  v.call();
7416
- }), forEach(h.elts, function(v) {
7459
+ }), forEach(p.elts, function(v) {
7417
7460
  v.classList && v.classList.remove(htmx.config.settlingClass), triggerEvent(v, "htmx:afterSettle", i.eventInfo);
7418
7461
  }), i.anchor) {
7419
7462
  const v = asElement(resolveTarget("#" + i.anchor));
7420
7463
  v && v.scrollIntoView({ block: "start", behavior: "auto" });
7421
7464
  }
7422
- updateScrollState(h.elts, n), maybeCall(i.afterSettleCallback), maybeCall(r);
7465
+ updateScrollState(p.elts, n), maybeCall(i.afterSettleCallback), maybeCall(r);
7423
7466
  };
7424
- n.settleDelay > 0 ? getWindow().setTimeout(b, n.settleDelay) : b();
7467
+ n.settleDelay > 0 ? getWindow().setTimeout(x, n.settleDelay) : x();
7425
7468
  }, o = htmx.config.globalViewTransitions;
7426
7469
  n.hasOwnProperty("transition") && (o = n.transition);
7427
7470
  const l = i.contextElement || getDocument();
7428
7471
  if (o && triggerEvent(l, "htmx:beforeTransition", i.eventInfo) && typeof Promise < "u" && // @ts-ignore experimental feature atm
7429
7472
  document.startViewTransition) {
7430
- const c = new Promise(function(d, h) {
7431
- r = d, a = h;
7473
+ const c = new Promise(function(d, p) {
7474
+ r = d, a = p;
7432
7475
  }), u = s;
7433
7476
  s = function() {
7434
7477
  document.startViewTransition(function() {
@@ -7554,8 +7597,8 @@ var htmx = (function() {
7554
7597
  var s = consumeUntil(r, WHITESPACE_OR_COMMA);
7555
7598
  if (s === "closest" || s === "find" || s === "next" || s === "previous") {
7556
7599
  r.shift();
7557
- const b = consumeCSSSelector(r);
7558
- b.length > 0 && (s += " " + b);
7600
+ const x = consumeCSSSelector(r);
7601
+ x.length > 0 && (s += " " + x);
7559
7602
  }
7560
7603
  }
7561
7604
  c.from = s;
@@ -7673,10 +7716,10 @@ var htmx = (function() {
7673
7716
  a.triggeredOnce = !0;
7674
7717
  }
7675
7718
  if (i.changed) {
7676
- const d = c.target, h = d.value, b = a.lastValue.get(i);
7677
- if (b.has(d) && b.get(d) === h)
7719
+ const d = c.target, p = d.value, x = a.lastValue.get(i);
7720
+ if (x.has(d) && x.get(d) === p)
7678
7721
  return;
7679
- b.set(d, h);
7722
+ x.set(d, p);
7680
7723
  }
7681
7724
  if (a.delayed && clearTimeout(a.delayed), a.throttle)
7682
7725
  return;
@@ -8384,8 +8427,8 @@ var htmx = (function() {
8384
8427
  function issueAjaxRequest(e, t, n, i, r, a) {
8385
8428
  let s = null, o = null;
8386
8429
  if (r = r ?? {}, r.returnPromise && typeof Promise < "u")
8387
- var l = new Promise(function(k, M) {
8388
- s = k, o = M;
8430
+ var l = new Promise(function(k, R) {
8431
+ s = k, o = R;
8389
8432
  });
8390
8433
  n == null && (n = getDocument().body);
8391
8434
  const c = r.handler || handleAjaxResponse, u = r.select || null;
@@ -8394,16 +8437,16 @@ var htmx = (function() {
8394
8437
  const d = r.targetOverride || asElement(getTarget(n));
8395
8438
  if (d == null || d == DUMMY_ELT)
8396
8439
  return triggerErrorEvent(n, "htmx:targetError", { target: getClosestAttributeValue(n, "hx-target") }), maybeCall(o), l;
8397
- let h = getInternalData(n);
8398
- const b = h.lastButtonClicked;
8399
- if (b) {
8400
- const k = getRawAttribute(b, "formaction");
8440
+ let p = getInternalData(n);
8441
+ const x = p.lastButtonClicked;
8442
+ if (x) {
8443
+ const k = getRawAttribute(x, "formaction");
8401
8444
  k != null && (t = k);
8402
- const M = getRawAttribute(b, "formmethod");
8403
- if (M != null)
8404
- if (VERBS.includes(M.toLowerCase()))
8445
+ const R = getRawAttribute(x, "formmethod");
8446
+ if (R != null)
8447
+ if (VERBS.includes(R.toLowerCase()))
8405
8448
  e = /** @type HttpVerb */
8406
- M;
8449
+ R;
8407
8450
  else
8408
8451
  return maybeCall(s), l;
8409
8452
  }
@@ -8412,67 +8455,67 @@ var htmx = (function() {
8412
8455
  return issueAjaxRequest(e, t, n, i, r, !!F);
8413
8456
  }, question: v }) === !1)
8414
8457
  return maybeCall(s), l;
8415
- let x = n, m = getClosestAttributeValue(n, "hx-sync"), E = null, g = !1;
8416
- if (m) {
8417
- const k = m.split(":"), M = k[0].trim();
8418
- if (M === "this" ? x = findThisElement(n, "hx-sync") : x = asElement(querySelectorExt(n, M)), m = (k[1] || "drop").trim(), h = getInternalData(x), m === "drop" && h.xhr && h.abortable !== !0)
8458
+ let y = n, h = getClosestAttributeValue(n, "hx-sync"), b = null, m = !1;
8459
+ if (h) {
8460
+ const k = h.split(":"), R = k[0].trim();
8461
+ if (R === "this" ? y = findThisElement(n, "hx-sync") : y = asElement(querySelectorExt(n, R)), h = (k[1] || "drop").trim(), p = getInternalData(y), h === "drop" && p.xhr && p.abortable !== !0)
8419
8462
  return maybeCall(s), l;
8420
- if (m === "abort") {
8421
- if (h.xhr)
8463
+ if (h === "abort") {
8464
+ if (p.xhr)
8422
8465
  return maybeCall(s), l;
8423
- g = !0;
8424
- } else m === "replace" ? triggerEvent(x, "htmx:abort") : m.indexOf("queue") === 0 && (E = (m.split(" ")[1] || "last").trim());
8466
+ m = !0;
8467
+ } else h === "replace" ? triggerEvent(y, "htmx:abort") : h.indexOf("queue") === 0 && (b = (h.split(" ")[1] || "last").trim());
8425
8468
  }
8426
- if (h.xhr)
8427
- if (h.abortable)
8428
- triggerEvent(x, "htmx:abort");
8469
+ if (p.xhr)
8470
+ if (p.abortable)
8471
+ triggerEvent(y, "htmx:abort");
8429
8472
  else {
8430
- if (E == null) {
8473
+ if (b == null) {
8431
8474
  if (i) {
8432
8475
  const k = getInternalData(i);
8433
- k && k.triggerSpec && k.triggerSpec.queue && (E = k.triggerSpec.queue);
8476
+ k && k.triggerSpec && k.triggerSpec.queue && (b = k.triggerSpec.queue);
8434
8477
  }
8435
- E == null && (E = "last");
8478
+ b == null && (b = "last");
8436
8479
  }
8437
- return h.queuedRequests == null && (h.queuedRequests = []), E === "first" && h.queuedRequests.length === 0 ? h.queuedRequests.push(function() {
8480
+ return p.queuedRequests == null && (p.queuedRequests = []), b === "first" && p.queuedRequests.length === 0 ? p.queuedRequests.push(function() {
8438
8481
  issueAjaxRequest(e, t, n, i, r);
8439
- }) : E === "all" ? h.queuedRequests.push(function() {
8482
+ }) : b === "all" ? p.queuedRequests.push(function() {
8440
8483
  issueAjaxRequest(e, t, n, i, r);
8441
- }) : E === "last" && (h.queuedRequests = [], h.queuedRequests.push(function() {
8484
+ }) : b === "last" && (p.queuedRequests = [], p.queuedRequests.push(function() {
8442
8485
  issueAjaxRequest(e, t, n, i, r);
8443
8486
  })), maybeCall(s), l;
8444
8487
  }
8445
- const y = new XMLHttpRequest();
8446
- h.xhr = y, h.abortable = g;
8488
+ const _ = new XMLHttpRequest();
8489
+ p.xhr = _, p.abortable = m;
8447
8490
  const f = function() {
8448
- h.xhr = null, h.abortable = !1, h.queuedRequests != null && h.queuedRequests.length > 0 && h.queuedRequests.shift()();
8449
- }, p = getClosestAttributeValue(n, "hx-prompt");
8450
- if (p) {
8451
- var _ = prompt(p);
8452
- if (_ === null || !triggerEvent(n, "htmx:prompt", { prompt: _, target: d }))
8491
+ p.xhr = null, p.abortable = !1, p.queuedRequests != null && p.queuedRequests.length > 0 && p.queuedRequests.shift()();
8492
+ }, g = getClosestAttributeValue(n, "hx-prompt");
8493
+ if (g) {
8494
+ var w = prompt(g);
8495
+ if (w === null || !triggerEvent(n, "htmx:prompt", { prompt: w, target: d }))
8453
8496
  return maybeCall(s), f(), l;
8454
8497
  }
8455
8498
  if (v && !a && !confirm(v))
8456
8499
  return maybeCall(s), f(), l;
8457
- let w = getHeaders(n, d, _);
8458
- e !== "get" && !usesFormData(n) && (w["Content-Type"] = "application/x-www-form-urlencoded"), r.headers && (w = mergeObjects(w, r.headers));
8500
+ let E = getHeaders(n, d, w);
8501
+ e !== "get" && !usesFormData(n) && (E["Content-Type"] = "application/x-www-form-urlencoded"), r.headers && (E = mergeObjects(E, r.headers));
8459
8502
  const D = getInputValues(n, e);
8460
8503
  let A = D.errors;
8461
- const S = D.formData;
8462
- r.values && overrideFormData(S, formDataFromObject(r.values));
8463
- const C = formDataFromObject(getExpressionVars(n, i)), O = overrideFormData(S, C);
8504
+ const C = D.formData;
8505
+ r.values && overrideFormData(C, formDataFromObject(r.values));
8506
+ const S = formDataFromObject(getExpressionVars(n, i)), O = overrideFormData(C, S);
8464
8507
  let T = filterValues(O, n);
8465
8508
  htmx.config.getCacheBusterParam && e === "get" && T.set("org.htmx.cache-buster", getRawAttribute(d, "id") || "true"), (t == null || t === "") && (t = location.href);
8466
- const L = getValuesForElement(n, "hx-request"), R = getInternalData(n).boosted;
8509
+ const L = getValuesForElement(n, "hx-request"), M = getInternalData(n).boosted;
8467
8510
  let H = htmx.config.methodsThatUseUrlParams.indexOf(e) >= 0;
8468
8511
  const I = {
8469
- boosted: R,
8512
+ boosted: M,
8470
8513
  useUrlParams: H,
8471
8514
  formData: T,
8472
8515
  parameters: formDataProxy(T),
8473
8516
  unfilteredFormData: O,
8474
8517
  unfilteredParameters: formDataProxy(O),
8475
- headers: w,
8518
+ headers: E,
8476
8519
  elt: n,
8477
8520
  target: d,
8478
8521
  verb: e,
@@ -8484,25 +8527,25 @@ var htmx = (function() {
8484
8527
  };
8485
8528
  if (!triggerEvent(n, "htmx:configRequest", I))
8486
8529
  return maybeCall(s), f(), l;
8487
- if (t = I.path, e = I.verb, w = I.headers, T = formDataFromObject(I.parameters), A = I.errors, H = I.useUrlParams, A && A.length > 0)
8530
+ if (t = I.path, e = I.verb, E = I.headers, T = formDataFromObject(I.parameters), A = I.errors, H = I.useUrlParams, A && A.length > 0)
8488
8531
  return triggerEvent(n, "htmx:validation:halted", I), maybeCall(s), f(), l;
8489
8532
  const W = t.split("#"), $ = W[0], q = W[1];
8490
8533
  let N = t;
8491
8534
  if (H && (N = $, !T.keys().next().done && (N.indexOf("?") < 0 ? N += "?" : N += "&", N += urlEncode(T), q && (N += "#" + q))), !verifyPath(n, N, I))
8492
8535
  return triggerErrorEvent(n, "htmx:invalidPath", I), maybeCall(o), f(), l;
8493
- if (y.open(e.toUpperCase(), N, !0), y.overrideMimeType("text/html"), y.withCredentials = I.withCredentials, y.timeout = I.timeout, !L.noHeaders) {
8494
- for (const k in w)
8495
- if (w.hasOwnProperty(k)) {
8496
- const M = w[k];
8497
- safelySetHeaderValue(y, k, M);
8536
+ if (_.open(e.toUpperCase(), N, !0), _.overrideMimeType("text/html"), _.withCredentials = I.withCredentials, _.timeout = I.timeout, !L.noHeaders) {
8537
+ for (const k in E)
8538
+ if (E.hasOwnProperty(k)) {
8539
+ const R = E[k];
8540
+ safelySetHeaderValue(_, k, R);
8498
8541
  }
8499
8542
  }
8500
8543
  const P = {
8501
- xhr: y,
8544
+ xhr: _,
8502
8545
  target: d,
8503
8546
  requestConfig: I,
8504
8547
  etc: r,
8505
- boosted: R,
8548
+ boosted: M,
8506
8549
  select: u,
8507
8550
  pathInfo: {
8508
8551
  requestPath: t,
@@ -8511,16 +8554,16 @@ var htmx = (function() {
8511
8554
  anchor: q
8512
8555
  }
8513
8556
  };
8514
- if (y.onload = function() {
8557
+ if (_.onload = function() {
8515
8558
  try {
8516
8559
  const k = hierarchyForElt(n);
8517
- if (P.pathInfo.responsePath = getPathFromResponse(y), c(n, P), P.keepIndicators !== !0 && removeRequestIndicators(j, V), triggerEvent(n, "htmx:afterRequest", P), triggerEvent(n, "htmx:afterOnLoad", P), !bodyContains(n)) {
8518
- let M = null;
8519
- for (; k.length > 0 && M == null; ) {
8560
+ if (P.pathInfo.responsePath = getPathFromResponse(_), c(n, P), P.keepIndicators !== !0 && removeRequestIndicators(j, V), triggerEvent(n, "htmx:afterRequest", P), triggerEvent(n, "htmx:afterOnLoad", P), !bodyContains(n)) {
8561
+ let R = null;
8562
+ for (; k.length > 0 && R == null; ) {
8520
8563
  const F = k.shift();
8521
- bodyContains(F) && (M = F);
8564
+ bodyContains(F) && (R = F);
8522
8565
  }
8523
- M && (triggerEvent(M, "htmx:afterRequest", P), triggerEvent(M, "htmx:afterOnLoad", P));
8566
+ R && (triggerEvent(R, "htmx:afterRequest", P), triggerEvent(R, "htmx:afterOnLoad", P));
8524
8567
  }
8525
8568
  maybeCall(s);
8526
8569
  } catch (k) {
@@ -8528,18 +8571,18 @@ var htmx = (function() {
8528
8571
  } finally {
8529
8572
  f();
8530
8573
  }
8531
- }, y.onerror = function() {
8574
+ }, _.onerror = function() {
8532
8575
  removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendError", P), maybeCall(o), f();
8533
- }, y.onabort = function() {
8576
+ }, _.onabort = function() {
8534
8577
  removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:sendAbort", P), maybeCall(o), f();
8535
- }, y.ontimeout = function() {
8578
+ }, _.ontimeout = function() {
8536
8579
  removeRequestIndicators(j, V), triggerErrorEvent(n, "htmx:afterRequest", P), triggerErrorEvent(n, "htmx:timeout", P), maybeCall(o), f();
8537
8580
  }, !triggerEvent(n, "htmx:beforeRequest", P))
8538
8581
  return maybeCall(s), f(), l;
8539
8582
  var j = addRequestIndicatorClasses(n), V = disableElements(n);
8540
8583
  forEach(["loadstart", "loadend", "progress", "abort"], function(k) {
8541
- forEach([y, y.upload], function(M) {
8542
- M.addEventListener(k, function(F) {
8584
+ forEach([_, _.upload], function(R) {
8585
+ R.addEventListener(k, function(F) {
8543
8586
  triggerEvent(n, "htmx:xhr:" + k, {
8544
8587
  lengthComputable: F.lengthComputable,
8545
8588
  loaded: F.loaded,
@@ -8548,8 +8591,8 @@ var htmx = (function() {
8548
8591
  });
8549
8592
  });
8550
8593
  }), triggerEvent(n, "htmx:beforeSend", P);
8551
- const B = H ? null : encodeParamsForBody(y, n, T);
8552
- return y.send(B), l;
8594
+ const B = H ? null : encodeParamsForBody(_, n, T);
8595
+ return _.send(B), l;
8553
8596
  }
8554
8597
  function determineHistoryUpdates(e, t) {
8555
8598
  const n = t.xhr;
@@ -8600,9 +8643,9 @@ var htmx = (function() {
8600
8643
  const r = t.etc, a = t.select;
8601
8644
  if (!triggerEvent(e, "htmx:beforeOnLoad", t)) return;
8602
8645
  if (hasHeader(n, /HX-Trigger:/i) && handleTriggerHeader(n, "HX-Trigger", e), hasHeader(n, /HX-Location:/i)) {
8603
- let g = n.getResponseHeader("HX-Location");
8646
+ let m = n.getResponseHeader("HX-Location");
8604
8647
  var s = {};
8605
- g.indexOf("{") === 0 && (s = parseJSON(g), g = s.path, delete s.path), s.push = s.push || "true", ajaxHelper("get", g, s);
8648
+ m.indexOf("{") === 0 && (s = parseJSON(m), m = s.path, delete s.path), s.push = s.push || "true", ajaxHelper("get", m, s);
8606
8649
  return;
8607
8650
  }
8608
8651
  const o = hasHeader(n, /HX-Refresh:/i) && n.getResponseHeader("HX-Refresh") === "true";
@@ -8615,29 +8658,29 @@ var htmx = (function() {
8615
8658
  return;
8616
8659
  }
8617
8660
  const l = determineHistoryUpdates(e, t), c = resolveResponseHandling(n), u = c.swap;
8618
- let d = !!c.error, h = htmx.config.ignoreTitle || c.ignoreTitle, b = c.select;
8661
+ let d = !!c.error, p = htmx.config.ignoreTitle || c.ignoreTitle, x = c.select;
8619
8662
  c.target && (t.target = resolveRetarget(e, c.target));
8620
8663
  var v = r.swapOverride;
8621
8664
  v == null && c.swapOverride && (v = c.swapOverride), hasHeader(n, /HX-Retarget:/i) && (t.target = resolveRetarget(e, n.getResponseHeader("HX-Retarget"))), hasHeader(n, /HX-Reswap:/i) && (v = n.getResponseHeader("HX-Reswap"));
8622
- var x = n.response, m = mergeObjects({
8665
+ var y = n.response, h = mergeObjects({
8623
8666
  shouldSwap: u,
8624
- serverResponse: x,
8667
+ serverResponse: y,
8625
8668
  isError: d,
8626
- ignoreTitle: h,
8627
- selectOverride: b,
8669
+ ignoreTitle: p,
8670
+ selectOverride: x,
8628
8671
  swapOverride: v
8629
8672
  }, t);
8630
- if (!(c.event && !triggerEvent(i, c.event, m)) && triggerEvent(i, "htmx:beforeSwap", m)) {
8631
- if (i = m.target, x = m.serverResponse, d = m.isError, h = m.ignoreTitle, b = m.selectOverride, v = m.swapOverride, t.target = i, t.failed = d, t.successful = !d, m.shouldSwap) {
8673
+ if (!(c.event && !triggerEvent(i, c.event, h)) && triggerEvent(i, "htmx:beforeSwap", h)) {
8674
+ if (i = h.target, y = h.serverResponse, d = h.isError, p = h.ignoreTitle, x = h.selectOverride, v = h.swapOverride, t.target = i, t.failed = d, t.successful = !d, h.shouldSwap) {
8632
8675
  n.status === 286 && cancelPolling(e), withExtensions(e, function(f) {
8633
- x = f.transformResponse(x, n, e);
8676
+ y = f.transformResponse(y, n, e);
8634
8677
  }), l.type && saveCurrentPageToHistory();
8635
- var E = getSwapSpecification(e, v);
8636
- E.hasOwnProperty("ignoreTitle") || (E.ignoreTitle = h), i.classList.add(htmx.config.swappingClass), a && (b = a), hasHeader(n, /HX-Reselect:/i) && (b = n.getResponseHeader("HX-Reselect"));
8637
- const g = r.selectOOB || getClosestAttributeValue(e, "hx-select-oob"), y = getClosestAttributeValue(e, "hx-select");
8638
- swap(i, x, E, {
8639
- select: b === "unset" ? null : b || y,
8640
- selectOOB: g,
8678
+ var b = getSwapSpecification(e, v);
8679
+ b.hasOwnProperty("ignoreTitle") || (b.ignoreTitle = p), i.classList.add(htmx.config.swappingClass), a && (x = a), hasHeader(n, /HX-Reselect:/i) && (x = n.getResponseHeader("HX-Reselect"));
8680
+ const m = r.selectOOB || getClosestAttributeValue(e, "hx-select-oob"), _ = getClosestAttributeValue(e, "hx-select");
8681
+ swap(i, y, b, {
8682
+ select: x === "unset" ? null : x || _,
8683
+ selectOOB: m,
8641
8684
  eventInfo: t,
8642
8685
  anchor: t.pathInfo.anchor,
8643
8686
  contextElement: e,
@@ -8774,454 +8817,454 @@ var htmx = (function() {
8774
8817
  },
8775
8818
  head: {
8776
8819
  style: "merge",
8777
- shouldPreserve: (h) => h.getAttribute("im-preserve") === "true",
8778
- shouldReAppend: (h) => h.getAttribute("im-re-append") === "true",
8820
+ shouldPreserve: (p) => p.getAttribute("im-preserve") === "true",
8821
+ shouldReAppend: (p) => p.getAttribute("im-re-append") === "true",
8779
8822
  shouldRemove: e,
8780
8823
  afterHeadMorphed: e
8781
8824
  },
8782
8825
  restoreFocus: !0
8783
8826
  };
8784
- function n(h, b, v = {}) {
8785
- h = u(h);
8786
- const x = d(b), m = c(h, x, v), E = r(m, () => o(
8787
- m,
8827
+ function n(p, x, v = {}) {
8828
+ p = u(p);
8829
+ const y = d(x), h = c(p, y, v), b = r(h, () => o(
8788
8830
  h,
8789
- x,
8831
+ p,
8832
+ y,
8790
8833
  /** @param {MorphContext} ctx */
8791
- (g) => g.morphStyle === "innerHTML" ? (a(g, h, x), Array.from(h.childNodes)) : i(g, h, x)
8834
+ (m) => m.morphStyle === "innerHTML" ? (a(m, p, y), Array.from(p.childNodes)) : i(m, p, y)
8792
8835
  ));
8793
- return m.pantry.remove(), E;
8836
+ return h.pantry.remove(), b;
8794
8837
  }
8795
- function i(h, b, v) {
8796
- const x = d(b);
8838
+ function i(p, x, v) {
8839
+ const y = d(x);
8797
8840
  return a(
8798
- h,
8799
- x,
8841
+ p,
8842
+ y,
8800
8843
  v,
8801
8844
  // these two optional params are the secret sauce
8802
- b,
8845
+ x,
8803
8846
  // start point for iteration
8804
- b.nextSibling
8847
+ x.nextSibling
8805
8848
  // end point for iteration
8806
- ), Array.from(x.childNodes);
8849
+ ), Array.from(y.childNodes);
8807
8850
  }
8808
- function r(h, b) {
8809
- if (!h.config.restoreFocus) return b();
8851
+ function r(p, x) {
8852
+ if (!p.config.restoreFocus) return x();
8810
8853
  let v = (
8811
8854
  /** @type {HTMLInputElement|HTMLTextAreaElement|null} */
8812
8855
  document.activeElement
8813
8856
  );
8814
8857
  if (!(v instanceof HTMLInputElement || v instanceof HTMLTextAreaElement))
8815
- return b();
8816
- const { id: x, selectionStart: m, selectionEnd: E } = v, g = b();
8817
- return x && x !== document.activeElement?.getAttribute("id") && (v = h.target.querySelector(`[id="${x}"]`), v?.focus()), v && !v.selectionEnd && E && v.setSelectionRange(m, E), g;
8858
+ return x();
8859
+ const { id: y, selectionStart: h, selectionEnd: b } = v, m = x();
8860
+ return y && y !== document.activeElement?.getAttribute("id") && (v = p.target.querySelector(`[id="${y}"]`), v?.focus()), v && !v.selectionEnd && b && v.setSelectionRange(h, b), m;
8818
8861
  }
8819
8862
  const a = /* @__PURE__ */ (function() {
8820
- function h(f, p, _, w = null, D = null) {
8821
- p instanceof HTMLTemplateElement && _ instanceof HTMLTemplateElement && (p = p.content, _ = _.content), w ||= p.firstChild;
8822
- for (const A of _.childNodes) {
8823
- if (w && w != D) {
8824
- const C = v(
8863
+ function p(f, g, w, E = null, D = null) {
8864
+ g instanceof HTMLTemplateElement && w instanceof HTMLTemplateElement && (g = g.content, w = w.content), E ||= g.firstChild;
8865
+ for (const A of w.childNodes) {
8866
+ if (E && E != D) {
8867
+ const S = v(
8825
8868
  f,
8826
8869
  A,
8827
- w,
8870
+ E,
8828
8871
  D
8829
8872
  );
8830
- if (C) {
8831
- C !== w && m(f, w, C), s(C, A, f), w = C.nextSibling;
8873
+ if (S) {
8874
+ S !== E && h(f, E, S), s(S, A, f), E = S.nextSibling;
8832
8875
  continue;
8833
8876
  }
8834
8877
  }
8835
8878
  if (A instanceof Element) {
8836
- const C = (
8879
+ const S = (
8837
8880
  /** @type {String} */
8838
8881
  A.getAttribute("id")
8839
8882
  );
8840
- if (f.persistentIds.has(C)) {
8841
- const O = E(
8842
- p,
8843
- C,
8844
- w,
8883
+ if (f.persistentIds.has(S)) {
8884
+ const O = b(
8885
+ g,
8886
+ S,
8887
+ E,
8845
8888
  f
8846
8889
  );
8847
- s(O, A, f), w = O.nextSibling;
8890
+ s(O, A, f), E = O.nextSibling;
8848
8891
  continue;
8849
8892
  }
8850
8893
  }
8851
- const S = b(
8852
- p,
8894
+ const C = x(
8895
+ g,
8853
8896
  A,
8854
- w,
8897
+ E,
8855
8898
  f
8856
8899
  );
8857
- S && (w = S.nextSibling);
8900
+ C && (E = C.nextSibling);
8858
8901
  }
8859
- for (; w && w != D; ) {
8860
- const A = w;
8861
- w = w.nextSibling, x(f, A);
8902
+ for (; E && E != D; ) {
8903
+ const A = E;
8904
+ E = E.nextSibling, y(f, A);
8862
8905
  }
8863
8906
  }
8864
- function b(f, p, _, w) {
8865
- if (w.callbacks.beforeNodeAdded(p) === !1) return null;
8866
- if (w.idMap.has(p)) {
8907
+ function x(f, g, w, E) {
8908
+ if (E.callbacks.beforeNodeAdded(g) === !1) return null;
8909
+ if (E.idMap.has(g)) {
8867
8910
  const D = document.createElement(
8868
8911
  /** @type {Element} */
8869
- p.tagName
8912
+ g.tagName
8870
8913
  );
8871
- return f.insertBefore(D, _), s(D, p, w), w.callbacks.afterNodeAdded(D), D;
8914
+ return f.insertBefore(D, w), s(D, g, E), E.callbacks.afterNodeAdded(D), D;
8872
8915
  } else {
8873
- const D = document.importNode(p, !0);
8874
- return f.insertBefore(D, _), w.callbacks.afterNodeAdded(D), D;
8916
+ const D = document.importNode(g, !0);
8917
+ return f.insertBefore(D, w), E.callbacks.afterNodeAdded(D), D;
8875
8918
  }
8876
8919
  }
8877
8920
  const v = /* @__PURE__ */ (function() {
8878
- function f(w, D, A, S) {
8879
- let C = null, O = D.nextSibling, T = 0, L = A;
8880
- for (; L && L != S; ) {
8881
- if (_(L, D)) {
8882
- if (p(w, L, D))
8921
+ function f(E, D, A, C) {
8922
+ let S = null, O = D.nextSibling, T = 0, L = A;
8923
+ for (; L && L != C; ) {
8924
+ if (w(L, D)) {
8925
+ if (g(E, L, D))
8883
8926
  return L;
8884
- C === null && (w.idMap.has(L) || (C = L));
8927
+ S === null && (E.idMap.has(L) || (S = L));
8885
8928
  }
8886
- if (C === null && O && _(L, O) && (T++, O = O.nextSibling, T >= 2 && (C = void 0)), w.activeElementAndParents.includes(L)) break;
8929
+ if (S === null && O && w(L, O) && (T++, O = O.nextSibling, T >= 2 && (S = void 0)), E.activeElementAndParents.includes(L)) break;
8887
8930
  L = L.nextSibling;
8888
8931
  }
8889
- return C || null;
8932
+ return S || null;
8890
8933
  }
8891
- function p(w, D, A) {
8892
- let S = w.idMap.get(D), C = w.idMap.get(A);
8893
- if (!C || !S) return !1;
8894
- for (const O of S)
8895
- if (C.has(O))
8934
+ function g(E, D, A) {
8935
+ let C = E.idMap.get(D), S = E.idMap.get(A);
8936
+ if (!S || !C) return !1;
8937
+ for (const O of C)
8938
+ if (S.has(O))
8896
8939
  return !0;
8897
8940
  return !1;
8898
8941
  }
8899
- function _(w, D) {
8942
+ function w(E, D) {
8900
8943
  const A = (
8901
8944
  /** @type {Element} */
8902
- w
8903
- ), S = (
8945
+ E
8946
+ ), C = (
8904
8947
  /** @type {Element} */
8905
8948
  D
8906
8949
  );
8907
- return A.nodeType === S.nodeType && A.tagName === S.tagName && // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.
8950
+ return A.nodeType === C.nodeType && A.tagName === C.tagName && // If oldElt has an `id` with possible state and it doesn't match newElt.id then avoid morphing.
8908
8951
  // We'll still match an anonymous node with an IDed newElt, though, because if it got this far,
8909
8952
  // its not persistent, and new nodes can't have any hidden state.
8910
8953
  // We can't use .id because of form input shadowing, and we can't count on .getAttribute's presence because it could be a document-fragment
8911
- (!A.getAttribute?.("id") || A.getAttribute?.("id") === S.getAttribute?.("id"));
8954
+ (!A.getAttribute?.("id") || A.getAttribute?.("id") === C.getAttribute?.("id"));
8912
8955
  }
8913
8956
  return f;
8914
8957
  })();
8915
- function x(f, p) {
8916
- if (f.idMap.has(p))
8917
- y(f.pantry, p, null);
8958
+ function y(f, g) {
8959
+ if (f.idMap.has(g))
8960
+ _(f.pantry, g, null);
8918
8961
  else {
8919
- if (f.callbacks.beforeNodeRemoved(p) === !1) return;
8920
- p.parentNode?.removeChild(p), f.callbacks.afterNodeRemoved(p);
8962
+ if (f.callbacks.beforeNodeRemoved(g) === !1) return;
8963
+ g.parentNode?.removeChild(g), f.callbacks.afterNodeRemoved(g);
8921
8964
  }
8922
8965
  }
8923
- function m(f, p, _) {
8924
- let w = p;
8925
- for (; w && w !== _; ) {
8966
+ function h(f, g, w) {
8967
+ let E = g;
8968
+ for (; E && E !== w; ) {
8926
8969
  let D = (
8927
8970
  /** @type {Node} */
8928
- w
8971
+ E
8929
8972
  );
8930
- w = w.nextSibling, x(f, D);
8973
+ E = E.nextSibling, y(f, D);
8931
8974
  }
8932
- return w;
8975
+ return E;
8933
8976
  }
8934
- function E(f, p, _, w) {
8977
+ function b(f, g, w, E) {
8935
8978
  const D = (
8936
8979
  /** @type {Element} - will always be found */
8937
8980
  // ctx.target.id unsafe because of form input shadowing
8938
8981
  // ctx.target could be a document fragment which doesn't have `getAttribute`
8939
- w.target.getAttribute?.("id") === p && w.target || w.target.querySelector(`[id="${p}"]`) || w.pantry.querySelector(`[id="${p}"]`)
8982
+ E.target.getAttribute?.("id") === g && E.target || E.target.querySelector(`[id="${g}"]`) || E.pantry.querySelector(`[id="${g}"]`)
8940
8983
  );
8941
- return g(D, w), y(f, D, _), D;
8984
+ return m(D, E), _(f, D, w), D;
8942
8985
  }
8943
- function g(f, p) {
8944
- const _ = (
8986
+ function m(f, g) {
8987
+ const w = (
8945
8988
  /** @type {String} */
8946
8989
  f.getAttribute("id")
8947
8990
  );
8948
8991
  for (; f = f.parentNode; ) {
8949
- let w = p.idMap.get(f);
8950
- w && (w.delete(_), w.size || p.idMap.delete(f));
8992
+ let E = g.idMap.get(f);
8993
+ E && (E.delete(w), E.size || g.idMap.delete(f));
8951
8994
  }
8952
8995
  }
8953
- function y(f, p, _) {
8996
+ function _(f, g, w) {
8954
8997
  if (f.moveBefore)
8955
8998
  try {
8956
- f.moveBefore(p, _);
8999
+ f.moveBefore(g, w);
8957
9000
  } catch {
8958
- f.insertBefore(p, _);
9001
+ f.insertBefore(g, w);
8959
9002
  }
8960
9003
  else
8961
- f.insertBefore(p, _);
9004
+ f.insertBefore(g, w);
8962
9005
  }
8963
- return h;
9006
+ return p;
8964
9007
  })(), s = /* @__PURE__ */ (function() {
8965
- function h(g, y, f) {
8966
- return f.ignoreActive && g === document.activeElement ? null : (f.callbacks.beforeNodeMorphed(g, y) === !1 || (g instanceof HTMLHeadElement && f.head.ignore || (g instanceof HTMLHeadElement && f.head.style !== "morph" ? l(
8967
- g,
9008
+ function p(m, _, f) {
9009
+ return f.ignoreActive && m === document.activeElement ? null : (f.callbacks.beforeNodeMorphed(m, _) === !1 || (m instanceof HTMLHeadElement && f.head.ignore || (m instanceof HTMLHeadElement && f.head.style !== "morph" ? l(
9010
+ m,
8968
9011
  /** @type {HTMLHeadElement} */
8969
- y,
9012
+ _,
8970
9013
  f
8971
- ) : (b(g, y, f), E(g, f) || a(f, g, y))), f.callbacks.afterNodeMorphed(g, y)), g);
9014
+ ) : (x(m, _, f), b(m, f) || a(f, m, _))), f.callbacks.afterNodeMorphed(m, _)), m);
8972
9015
  }
8973
- function b(g, y, f) {
8974
- let p = y.nodeType;
8975
- if (p === 1) {
8976
- const _ = (
9016
+ function x(m, _, f) {
9017
+ let g = _.nodeType;
9018
+ if (g === 1) {
9019
+ const w = (
8977
9020
  /** @type {Element} */
8978
- g
8979
- ), w = (
9021
+ m
9022
+ ), E = (
8980
9023
  /** @type {Element} */
8981
- y
8982
- ), D = _.attributes, A = w.attributes;
8983
- for (const S of A)
8984
- m(S.name, _, "update", f) || _.getAttribute(S.name) !== S.value && _.setAttribute(S.name, S.value);
8985
- for (let S = D.length - 1; 0 <= S; S--) {
8986
- const C = D[S];
8987
- if (C && !w.hasAttribute(C.name)) {
8988
- if (m(C.name, _, "remove", f))
9024
+ _
9025
+ ), D = w.attributes, A = E.attributes;
9026
+ for (const C of A)
9027
+ h(C.name, w, "update", f) || w.getAttribute(C.name) !== C.value && w.setAttribute(C.name, C.value);
9028
+ for (let C = D.length - 1; 0 <= C; C--) {
9029
+ const S = D[C];
9030
+ if (S && !E.hasAttribute(S.name)) {
9031
+ if (h(S.name, w, "remove", f))
8989
9032
  continue;
8990
- _.removeAttribute(C.name);
9033
+ w.removeAttribute(S.name);
8991
9034
  }
8992
9035
  }
8993
- E(_, f) || v(_, w, f);
9036
+ b(w, f) || v(w, E, f);
8994
9037
  }
8995
- (p === 8 || p === 3) && g.nodeValue !== y.nodeValue && (g.nodeValue = y.nodeValue);
8996
- }
8997
- function v(g, y, f) {
8998
- if (g instanceof HTMLInputElement && y instanceof HTMLInputElement && y.type !== "file") {
8999
- let p = y.value, _ = g.value;
9000
- x(g, y, "checked", f), x(g, y, "disabled", f), y.hasAttribute("value") ? _ !== p && (m("value", g, "update", f) || (g.setAttribute("value", p), g.value = p)) : m("value", g, "remove", f) || (g.value = "", g.removeAttribute("value"));
9001
- } else if (g instanceof HTMLOptionElement && y instanceof HTMLOptionElement)
9002
- x(g, y, "selected", f);
9003
- else if (g instanceof HTMLTextAreaElement && y instanceof HTMLTextAreaElement) {
9004
- let p = y.value, _ = g.value;
9005
- if (m("value", g, "update", f))
9038
+ (g === 8 || g === 3) && m.nodeValue !== _.nodeValue && (m.nodeValue = _.nodeValue);
9039
+ }
9040
+ function v(m, _, f) {
9041
+ if (m instanceof HTMLInputElement && _ instanceof HTMLInputElement && _.type !== "file") {
9042
+ let g = _.value, w = m.value;
9043
+ y(m, _, "checked", f), y(m, _, "disabled", f), _.hasAttribute("value") ? w !== g && (h("value", m, "update", f) || (m.setAttribute("value", g), m.value = g)) : h("value", m, "remove", f) || (m.value = "", m.removeAttribute("value"));
9044
+ } else if (m instanceof HTMLOptionElement && _ instanceof HTMLOptionElement)
9045
+ y(m, _, "selected", f);
9046
+ else if (m instanceof HTMLTextAreaElement && _ instanceof HTMLTextAreaElement) {
9047
+ let g = _.value, w = m.value;
9048
+ if (h("value", m, "update", f))
9006
9049
  return;
9007
- p !== _ && (g.value = p), g.firstChild && g.firstChild.nodeValue !== p && (g.firstChild.nodeValue = p);
9050
+ g !== w && (m.value = g), m.firstChild && m.firstChild.nodeValue !== g && (m.firstChild.nodeValue = g);
9008
9051
  }
9009
9052
  }
9010
- function x(g, y, f, p) {
9011
- const _ = y[f], w = g[f];
9012
- if (_ !== w) {
9013
- const D = m(
9053
+ function y(m, _, f, g) {
9054
+ const w = _[f], E = m[f];
9055
+ if (w !== E) {
9056
+ const D = h(
9014
9057
  f,
9015
- g,
9058
+ m,
9016
9059
  "update",
9017
- p
9060
+ g
9018
9061
  );
9019
- D || (g[f] = y[f]), _ ? D || g.setAttribute(f, "") : m(f, g, "remove", p) || g.removeAttribute(f);
9062
+ D || (m[f] = _[f]), w ? D || m.setAttribute(f, "") : h(f, m, "remove", g) || m.removeAttribute(f);
9020
9063
  }
9021
9064
  }
9022
- function m(g, y, f, p) {
9023
- return g === "value" && p.ignoreActiveValue && y === document.activeElement ? !0 : p.callbacks.beforeAttributeUpdated(g, y, f) === !1;
9065
+ function h(m, _, f, g) {
9066
+ return m === "value" && g.ignoreActiveValue && _ === document.activeElement ? !0 : g.callbacks.beforeAttributeUpdated(m, _, f) === !1;
9024
9067
  }
9025
- function E(g, y) {
9026
- return !!y.ignoreActiveValue && g === document.activeElement && g !== document.body;
9068
+ function b(m, _) {
9069
+ return !!_.ignoreActiveValue && m === document.activeElement && m !== document.body;
9027
9070
  }
9028
- return h;
9071
+ return p;
9029
9072
  })();
9030
- function o(h, b, v, x) {
9031
- if (h.head.block) {
9032
- const m = b.querySelector("head"), E = v.querySelector("head");
9033
- if (m && E) {
9034
- const g = l(m, E, h);
9035
- return Promise.all(g).then(() => {
9036
- const y = Object.assign(h, {
9073
+ function o(p, x, v, y) {
9074
+ if (p.head.block) {
9075
+ const h = x.querySelector("head"), b = v.querySelector("head");
9076
+ if (h && b) {
9077
+ const m = l(h, b, p);
9078
+ return Promise.all(m).then(() => {
9079
+ const _ = Object.assign(p, {
9037
9080
  head: {
9038
9081
  block: !1,
9039
9082
  ignore: !0
9040
9083
  }
9041
9084
  });
9042
- return x(y);
9085
+ return y(_);
9043
9086
  });
9044
9087
  }
9045
9088
  }
9046
- return x(h);
9089
+ return y(p);
9047
9090
  }
9048
- function l(h, b, v) {
9049
- let x = [], m = [], E = [], g = [], y = /* @__PURE__ */ new Map();
9050
- for (const p of b.children)
9051
- y.set(p.outerHTML, p);
9052
- for (const p of h.children) {
9053
- let _ = y.has(p.outerHTML), w = v.head.shouldReAppend(p), D = v.head.shouldPreserve(p);
9054
- _ || D ? w ? m.push(p) : (y.delete(p.outerHTML), E.push(p)) : v.head.style === "append" ? w && (m.push(p), g.push(p)) : v.head.shouldRemove(p) !== !1 && m.push(p);
9091
+ function l(p, x, v) {
9092
+ let y = [], h = [], b = [], m = [], _ = /* @__PURE__ */ new Map();
9093
+ for (const g of x.children)
9094
+ _.set(g.outerHTML, g);
9095
+ for (const g of p.children) {
9096
+ let w = _.has(g.outerHTML), E = v.head.shouldReAppend(g), D = v.head.shouldPreserve(g);
9097
+ w || D ? E ? h.push(g) : (_.delete(g.outerHTML), b.push(g)) : v.head.style === "append" ? E && (h.push(g), m.push(g)) : v.head.shouldRemove(g) !== !1 && h.push(g);
9055
9098
  }
9056
- g.push(...y.values());
9099
+ m.push(..._.values());
9057
9100
  let f = [];
9058
- for (const p of g) {
9059
- let _ = (
9101
+ for (const g of m) {
9102
+ let w = (
9060
9103
  /** @type {ChildNode} */
9061
- document.createRange().createContextualFragment(p.outerHTML).firstChild
9104
+ document.createRange().createContextualFragment(g.outerHTML).firstChild
9062
9105
  );
9063
- if (v.callbacks.beforeNodeAdded(_) !== !1) {
9064
- if ("href" in _ && _.href || "src" in _ && _.src) {
9065
- let w, D = new Promise(function(A) {
9066
- w = A;
9106
+ if (v.callbacks.beforeNodeAdded(w) !== !1) {
9107
+ if ("href" in w && w.href || "src" in w && w.src) {
9108
+ let E, D = new Promise(function(A) {
9109
+ E = A;
9067
9110
  });
9068
- _.addEventListener("load", function() {
9069
- w();
9111
+ w.addEventListener("load", function() {
9112
+ E();
9070
9113
  }), f.push(D);
9071
9114
  }
9072
- h.appendChild(_), v.callbacks.afterNodeAdded(_), x.push(_);
9115
+ p.appendChild(w), v.callbacks.afterNodeAdded(w), y.push(w);
9073
9116
  }
9074
9117
  }
9075
- for (const p of m)
9076
- v.callbacks.beforeNodeRemoved(p) !== !1 && (h.removeChild(p), v.callbacks.afterNodeRemoved(p));
9077
- return v.head.afterHeadMorphed(h, {
9078
- added: x,
9079
- kept: E,
9080
- removed: m
9118
+ for (const g of h)
9119
+ v.callbacks.beforeNodeRemoved(g) !== !1 && (p.removeChild(g), v.callbacks.afterNodeRemoved(g));
9120
+ return v.head.afterHeadMorphed(p, {
9121
+ added: y,
9122
+ kept: b,
9123
+ removed: h
9081
9124
  }), f;
9082
9125
  }
9083
9126
  const c = /* @__PURE__ */ (function() {
9084
- function h(f, p, _) {
9085
- const { persistentIds: w, idMap: D } = g(f, p), A = b(_), S = A.morphStyle || "outerHTML";
9086
- if (!["innerHTML", "outerHTML"].includes(S))
9087
- throw `Do not understand how to morph style ${S}`;
9127
+ function p(f, g, w) {
9128
+ const { persistentIds: E, idMap: D } = m(f, g), A = x(w), C = A.morphStyle || "outerHTML";
9129
+ if (!["innerHTML", "outerHTML"].includes(C))
9130
+ throw `Do not understand how to morph style ${C}`;
9088
9131
  return {
9089
9132
  target: f,
9090
- newContent: p,
9133
+ newContent: g,
9091
9134
  config: A,
9092
- morphStyle: S,
9135
+ morphStyle: C,
9093
9136
  ignoreActive: A.ignoreActive,
9094
9137
  ignoreActiveValue: A.ignoreActiveValue,
9095
9138
  restoreFocus: A.restoreFocus,
9096
9139
  idMap: D,
9097
- persistentIds: w,
9140
+ persistentIds: E,
9098
9141
  pantry: v(),
9099
- activeElementAndParents: x(f),
9142
+ activeElementAndParents: y(f),
9100
9143
  callbacks: A.callbacks,
9101
9144
  head: A.head
9102
9145
  };
9103
9146
  }
9104
- function b(f) {
9105
- let p = Object.assign({}, t);
9106
- return Object.assign(p, f), p.callbacks = Object.assign(
9147
+ function x(f) {
9148
+ let g = Object.assign({}, t);
9149
+ return Object.assign(g, f), g.callbacks = Object.assign(
9107
9150
  {},
9108
9151
  t.callbacks,
9109
9152
  f.callbacks
9110
- ), p.head = Object.assign({}, t.head, f.head), p;
9153
+ ), g.head = Object.assign({}, t.head, f.head), g;
9111
9154
  }
9112
9155
  function v() {
9113
9156
  const f = document.createElement("div");
9114
9157
  return f.hidden = !0, document.body.insertAdjacentElement("afterend", f), f;
9115
9158
  }
9116
- function x(f) {
9117
- let p = [], _ = document.activeElement;
9118
- if (_?.tagName !== "BODY" && f.contains(_))
9119
- for (; _ && (p.push(_), _ !== f); )
9120
- _ = _.parentElement;
9121
- return p;
9122
- }
9123
- function m(f) {
9124
- let p = Array.from(f.querySelectorAll("[id]"));
9125
- return f.getAttribute?.("id") && p.push(f), p;
9126
- }
9127
- function E(f, p, _, w) {
9128
- for (const D of w) {
9159
+ function y(f) {
9160
+ let g = [], w = document.activeElement;
9161
+ if (w?.tagName !== "BODY" && f.contains(w))
9162
+ for (; w && (g.push(w), w !== f); )
9163
+ w = w.parentElement;
9164
+ return g;
9165
+ }
9166
+ function h(f) {
9167
+ let g = Array.from(f.querySelectorAll("[id]"));
9168
+ return f.getAttribute?.("id") && g.push(f), g;
9169
+ }
9170
+ function b(f, g, w, E) {
9171
+ for (const D of E) {
9129
9172
  const A = (
9130
9173
  /** @type {String} */
9131
9174
  D.getAttribute("id")
9132
9175
  );
9133
- if (p.has(A)) {
9134
- let S = D;
9135
- for (; S; ) {
9136
- let C = f.get(S);
9137
- if (C == null && (C = /* @__PURE__ */ new Set(), f.set(S, C)), C.add(A), S === _) break;
9138
- S = S.parentElement;
9176
+ if (g.has(A)) {
9177
+ let C = D;
9178
+ for (; C; ) {
9179
+ let S = f.get(C);
9180
+ if (S == null && (S = /* @__PURE__ */ new Set(), f.set(C, S)), S.add(A), C === w) break;
9181
+ C = C.parentElement;
9139
9182
  }
9140
9183
  }
9141
9184
  }
9142
9185
  }
9143
- function g(f, p) {
9144
- const _ = m(f), w = m(p), D = y(_, w);
9186
+ function m(f, g) {
9187
+ const w = h(f), E = h(g), D = _(w, E);
9145
9188
  let A = /* @__PURE__ */ new Map();
9146
- E(A, D, f, _);
9147
- const S = p.__idiomorphRoot || p;
9148
- return E(A, D, S, w), { persistentIds: D, idMap: A };
9149
- }
9150
- function y(f, p) {
9151
- let _ = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
9152
- for (const { id: A, tagName: S } of f)
9153
- w.has(A) ? _.add(A) : w.set(A, S);
9189
+ b(A, D, f, w);
9190
+ const C = g.__idiomorphRoot || g;
9191
+ return b(A, D, C, E), { persistentIds: D, idMap: A };
9192
+ }
9193
+ function _(f, g) {
9194
+ let w = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Map();
9195
+ for (const { id: A, tagName: C } of f)
9196
+ E.has(A) ? w.add(A) : E.set(A, C);
9154
9197
  let D = /* @__PURE__ */ new Set();
9155
- for (const { id: A, tagName: S } of p)
9156
- D.has(A) ? _.add(A) : w.get(A) === S && D.add(A);
9157
- for (const A of _)
9198
+ for (const { id: A, tagName: C } of g)
9199
+ D.has(A) ? w.add(A) : E.get(A) === C && D.add(A);
9200
+ for (const A of w)
9158
9201
  D.delete(A);
9159
9202
  return D;
9160
9203
  }
9161
- return h;
9204
+ return p;
9162
9205
  })(), { normalizeElement: u, normalizeParent: d } = /* @__PURE__ */ (function() {
9163
- const h = /* @__PURE__ */ new WeakSet();
9164
- function b(E) {
9165
- return E instanceof Document ? E.documentElement : E;
9206
+ const p = /* @__PURE__ */ new WeakSet();
9207
+ function x(b) {
9208
+ return b instanceof Document ? b.documentElement : b;
9166
9209
  }
9167
- function v(E) {
9168
- if (E == null)
9210
+ function v(b) {
9211
+ if (b == null)
9169
9212
  return document.createElement("div");
9170
- if (typeof E == "string")
9171
- return v(m(E));
9172
- if (h.has(
9213
+ if (typeof b == "string")
9214
+ return v(h(b));
9215
+ if (p.has(
9173
9216
  /** @type {Element} */
9174
- E
9217
+ b
9175
9218
  ))
9176
9219
  return (
9177
9220
  /** @type {Element} */
9178
- E
9221
+ b
9179
9222
  );
9180
- if (E instanceof Node) {
9181
- if (E.parentNode)
9223
+ if (b instanceof Node) {
9224
+ if (b.parentNode)
9182
9225
  return (
9183
9226
  /** @type {any} */
9184
- new x(E)
9227
+ new y(b)
9185
9228
  );
9186
9229
  {
9187
- const g = document.createElement("div");
9188
- return g.append(E), g;
9230
+ const m = document.createElement("div");
9231
+ return m.append(b), m;
9189
9232
  }
9190
9233
  } else {
9191
- const g = document.createElement("div");
9192
- for (const y of [...E])
9193
- g.append(y);
9194
- return g;
9234
+ const m = document.createElement("div");
9235
+ for (const _ of [...b])
9236
+ m.append(_);
9237
+ return m;
9195
9238
  }
9196
9239
  }
9197
- class x {
9240
+ class y {
9198
9241
  /** @param {Node} node */
9199
- constructor(g) {
9200
- this.originalNode = g, this.realParentNode = /** @type {Element} */
9201
- g.parentNode, this.previousSibling = g.previousSibling, this.nextSibling = g.nextSibling;
9242
+ constructor(m) {
9243
+ this.originalNode = m, this.realParentNode = /** @type {Element} */
9244
+ m.parentNode, this.previousSibling = m.previousSibling, this.nextSibling = m.nextSibling;
9202
9245
  }
9203
9246
  /** @returns {Node[]} */
9204
9247
  get childNodes() {
9205
- const g = [];
9206
- let y = this.previousSibling ? this.previousSibling.nextSibling : this.realParentNode.firstChild;
9207
- for (; y && y != this.nextSibling; )
9208
- g.push(y), y = y.nextSibling;
9209
- return g;
9248
+ const m = [];
9249
+ let _ = this.previousSibling ? this.previousSibling.nextSibling : this.realParentNode.firstChild;
9250
+ for (; _ && _ != this.nextSibling; )
9251
+ m.push(_), _ = _.nextSibling;
9252
+ return m;
9210
9253
  }
9211
9254
  /**
9212
9255
  * @param {string} selector
9213
9256
  * @returns {Element[]}
9214
9257
  */
9215
- querySelectorAll(g) {
9258
+ querySelectorAll(m) {
9216
9259
  return this.childNodes.reduce(
9217
- (y, f) => {
9260
+ (_, f) => {
9218
9261
  if (f instanceof Element) {
9219
- f.matches(g) && y.push(f);
9220
- const p = f.querySelectorAll(g);
9221
- for (let _ = 0; _ < p.length; _++)
9222
- y.push(p[_]);
9262
+ f.matches(m) && _.push(f);
9263
+ const g = f.querySelectorAll(m);
9264
+ for (let w = 0; w < g.length; w++)
9265
+ _.push(g[w]);
9223
9266
  }
9224
- return y;
9267
+ return _;
9225
9268
  },
9226
9269
  /** @type {Element[]} */
9227
9270
  []
@@ -9232,16 +9275,16 @@ var htmx = (function() {
9232
9275
  * @param {Node} referenceNode
9233
9276
  * @returns {Node}
9234
9277
  */
9235
- insertBefore(g, y) {
9236
- return this.realParentNode.insertBefore(g, y);
9278
+ insertBefore(m, _) {
9279
+ return this.realParentNode.insertBefore(m, _);
9237
9280
  }
9238
9281
  /**
9239
9282
  * @param {Node} node
9240
9283
  * @param {Node} referenceNode
9241
9284
  * @returns {Node}
9242
9285
  */
9243
- moveBefore(g, y) {
9244
- return this.realParentNode.moveBefore(g, y);
9286
+ moveBefore(m, _) {
9287
+ return this.realParentNode.moveBefore(m, _);
9245
9288
  }
9246
9289
  /**
9247
9290
  * for later use with populateIdMapWithTree to halt upwards iteration
@@ -9251,31 +9294,31 @@ var htmx = (function() {
9251
9294
  return this.originalNode;
9252
9295
  }
9253
9296
  }
9254
- function m(E) {
9255
- let g = new DOMParser(), y = E.replace(
9297
+ function h(b) {
9298
+ let m = new DOMParser(), _ = b.replace(
9256
9299
  /<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,
9257
9300
  ""
9258
9301
  );
9259
- if (y.match(/<\/html>/) || y.match(/<\/head>/) || y.match(/<\/body>/)) {
9260
- let f = g.parseFromString(E, "text/html");
9261
- if (y.match(/<\/html>/))
9262
- return h.add(f), f;
9302
+ if (_.match(/<\/html>/) || _.match(/<\/head>/) || _.match(/<\/body>/)) {
9303
+ let f = m.parseFromString(b, "text/html");
9304
+ if (_.match(/<\/html>/))
9305
+ return p.add(f), f;
9263
9306
  {
9264
- let p = f.firstChild;
9265
- return p && h.add(p), p;
9307
+ let g = f.firstChild;
9308
+ return g && p.add(g), g;
9266
9309
  }
9267
9310
  } else {
9268
- let p = (
9311
+ let g = (
9269
9312
  /** @type {HTMLTemplateElement} */
9270
- g.parseFromString(
9271
- "<body><template>" + E + "</template></body>",
9313
+ m.parseFromString(
9314
+ "<body><template>" + b + "</template></body>",
9272
9315
  "text/html"
9273
9316
  ).body.querySelector("template").content
9274
9317
  );
9275
- return h.add(p), p;
9318
+ return p.add(g), g;
9276
9319
  }
9277
9320
  }
9278
- return { normalizeElement: b, normalizeParent: v };
9321
+ return { normalizeElement: x, normalizeParent: v };
9279
9322
  })();
9280
9323
  return {
9281
9324
  morph: n,