PageSourceSearch

https://www.principal.com/profiles/contrib/houston/modules/pfg_pds…/5.22.1/es/floating-ui.dom.DV7ofceA.js

js principal.com collected 2026-09-24 08:41:37 UTC 28,262 bytes, 1,083 lines download raw bytes

1const X = Math.min, C = Math.max, ot = Math.round, nt = Math.floor, k = (t) => ({
2  x: t,
3  y: t
4}), $t = {
5  left: "right",
6  right: "left",
7  bottom: "top",
8  top: "bottom"
9};
10function dt(t, e, o) {
11  return C(t, X(e, o));
12}
13function j(t, e) {
14  return typeof t == "function" ? t(e) : t;
15}
16function $(t) {
17  return t.split("-")[0];
18}
19function Q(t) {
20  return t.split("-")[1];
21}
22function gt(t) {
23  return t === "x" ? "y" : "x";
24}
25function pt(t) {
26  return t === "y" ? "height" : "width";
27}
28function W(t) {
29  const e = t[0];
30  return e === "t" || e === "b" ? "y" : "x";
31}
32function wt(t) {
33  return gt(W(t));
34}
35function Ht(t, e, o) {
36  o === void 0 && (o = !1);
37  const n = Q(t), i = wt(t), r = pt(i);
38  let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
39  return e.reference[r] > e.floating[r] && (s = it(s)), [s, it(s)];
40}
41function _t(t) {
42  const e = it(t);
43  return [mt(t), e, mt(e)];
44}
45function mt(t) {
46  return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
47}
48const bt = ["left", "right"], At = ["right", "left"], zt = ["top", "bottom"], It = ["bottom", "top"];
49function Xt(t, e, o) {
50  switch (t) {
51    case "top":
52    case "bottom":
53      return o ? e ? At : bt : e ? bt : At;
54    case "left":
55    case "right":
56      return e ? zt : It;
57    default:
58      return [];
59  }
60}
61function jt(t, e, o, n) {
62  const i = Q(t);
63  let r = Xt($(t), o === "start", n);
64  return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(mt)))), r;
65}
66function it(t) {
67  const e = $(t);
68  return $t[e] + t.slice(e.length);
69}
70function Yt(t) {
71  return {
72    top: 0,
73    right: 0,
74    bottom: 0,
75    left: 0,
76    ...t
77  };
78}
79function Et(t) {
80  return typeof t != "number" ? Yt(t) : {
81    top: t,
82    right: t,
83    bottom: t,
84    left: t
85  };
86}
87function st(t) {
88  const {
89    x: e,
90    y: o,
91    width: n,
92    height: i
93  } = t;
94  return {
95    width: n,
96    height: i,
97    top: o,
98    left: e,
99    right: e + n,
100    bottom: o + i,
101    x: e,
102    y: o
103  };
104}
105function Rt(t, e, o) {
106  let {
107    reference: n,
108    floating: i
109  } = t;
110  const r = W(e), s = wt(e), c = pt(s), a = $(e), d = r === "y", f = n.x + n.width / 2 - i.width / 2, u = n.y + n.height / 2 - i.height / 2, m = n[c] / 2 - i[c] / 2;
111  let l;
112  switch (a) {
113    case "top":
114      l = {
115        x: f,
116        y: n.y - i.height
117      };
118      break;
119    case "bottom":
120      l = {
121        x: f,
122        y: n.y + n.height
123      };
124      break;
125    case "right":
126      l = {
127        x: n.x + n.width,
128        y: u
129      };
130      break;
131    case "left":
132      l = {
133        x: n.x - i.width,
134        y: u
135      };
136      break;
137    default:
138      l = {
139        x: n.x,
140        y: n.y
141      };
142  }
143  switch (Q(e)) {
144    case "start":
145      l[s] -= m * (o && d ? -1 : 1);
146      break;
147    case "end":
148      l[s] += m * (o && d ? -1 : 1);
149      break;
150  }
151  return l;
152}
153async function qt(t, e) {
154  var o;
155  e === void 0 && (e = {});
156  const {
157    x: n,
158    y: i,
159    platform: r,
160    rects: s,
161    elements: c,
162    strategy: a
163  } = t, {
164    boundary: d = "clippingAncestors",
165    rootBoundary: f = "viewport",
166    elementContext: u = "floating",
167    altBoundary: m = !1,
168    padding: l = 0
169  } = j(e, t), h = Et(l), w = c[m ? u === "floating" ? "reference" : "floating" : u], p = st(await r.getClippingRect({
170    element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
171    boundary: d,
172    rootBoundary: f,
173    strategy: a
174  })), y = u === "floating" ? {
175    x: n,
176    y: i,
177    width: s.floating.width,
178    height: s.floating.height
179  } : s.reference, x = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), v = await (r.isElement == null ? void 0 : r.isElement(x)) ? await (r.getScale == null ? void 0 : r.getScale(x)) || {
180    x: 1,
181    y: 1
182  } : {
183    x: 1,
184    y: 1
185  }, b = st(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
186    elements: c,
187    rect: y,
188    offsetParent: x,
189    strategy: a
190  }) : y);
191  return {
192    top: (p.top - b.top + h.top) / v.y,
193    bottom: (b.bottom - p.bottom + h.bottom) / v.y,
194    left: (p.left - b.left + h.left) / v.x,
195    right: (b.right - p.right + h.right) / v.x
196  };
197}
198const Ut = 50, Kt = async (t, e, o) => {
199  const {
200    placement: n = "bottom",
201    strategy: i = "absolute",
202    middleware: r = [],
203    platform: s
204  } = o, c = s.detectOverflow ? s : {
205    ...s,
206    detectOverflow: qt
207  }, a = await (s.isRTL == null ? void 0 : s.isRTL(e));
208  let d = await s.getElementRects({
209    reference: t,
210    floating: e,
211    strategy: i
212  }), {
213    x: f,
214    y: u
215  } = Rt(d, n, a), m = n, l = 0;
216  const h = {};
217  for (let g = 0; g < r.length; g++) {
218    const w = r[g];
219    if (!w)
220      continue;
221    const {
222      name: p,
223      fn: y
224    } = w, {
225      x,
226      y: v,
227      data: b,
228      reset: A
229    } = await y({
230      x: f,
231      y: u,
232      initialPlacement: n,
233      placement: m,
234      strategy: i,
235      middlewareData: h,
236      rects: d,
237      platform: c,
238      elements: {
239        reference: t,
240        floating: e
241      }
242    });
243    f = x ?? f, u = v ?? u, h[p] = {
244      ...h[p],
245      ...b
246    }, A && l < Ut && (l++, typeof A == "object" && (A.placement && (m = A.placement), A.rects && (d = A.rects === !0 ? await s.getElementRects({
247      reference: t,
248      floating: e,
249      strategy: i
250    }) : A.rects), {
251      x: f,
252      y: u
253    } = Rt(d, m, a)), g = -1);
254  }
255  return {
256    x: f,
257    y: u,
258    placement: m,
259    strategy: i,
260    middlewareData: h
261  };
262}, Gt = (t) => ({
263  name: "arrow",
264  options: t,
265  async fn(e) {
266    const {
267      x: o,
268      y: n,
269      placement: i,
270      rects: r,
271      platform: s,
272      elements: c,
273      middlewareData: a
274    } = e, {
275      element: d,
276      padding: f = 0
277    } = j(t, e) || {};
278    if (d == null)
279      return {};
280    const u = Et(f), m = {
281      x: o,
282      y: n
283    }, l = wt(i), h = pt(l), g = await s.getDimensions(d), w = l === "y", p = w ? "top" : "left", y = w ? "bottom" : "right", x = w ? "clientHeight" : "clientWidth", v = r.reference[h] + r.reference[l] - m[l] - r.floating[h], b = m[l] - r.reference[l], A = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d));
284    let R = A ? A[x] : 0;
285    (!R || !await (s.isElement == null ? void 0 : s.isElement(A))) && (R = c.floating[x] || r.floating[h]);
286    const B = v / 2 - b / 2, M = R / 2 - g[h] / 2 - 1, L = X(u[p], M), _ = X(u[y], M), F = L, z = R - g[h] - _, O = R / 2 - g[h] / 2 + B, q = dt(F, O, z), V = !a.arrow && Q(i) != null && O !== q && r.reference[h] / 2 - (O < F ? L : _) - g[h] / 2 < 0, E = V ? O < F ? O - F : O - z : 0;
287    return {
288      [l]: m[l] + E,
289      data: {
290        [l]: q,
291        centerOffset: O - q - E,
292        ...V && {
293          alignmentOffset: E
294        }
295      },
296      reset: V
297    };
298  }
299}), Jt = function(t) {
300  return t === void 0 && (t = {}), {
301    name: "flip",
302    options: t,
303    async fn(e) {
304      var o, n;
305      const {
306        placement: i,
307        middlewareData: r,
308        rects: s,
309        initialPlacement: c,
310        platform: a,
311        elements: d
312      } = e, {
313        mainAxis: f = !0,
314        crossAxis: u = !0,
315        fallbackPlacements: m,
316        fallbackStrategy: l = "bestFit",
317        fallbackAxisSideDirection: h = "none",
318        flipAlignment: g = !0,
319        ...w
320      } = j(t, e);
321      if ((o = r.arrow) != null && o.alignmentOffset)
322        return {};
323      const p = $(i), y = W(c), x = $(c) === c, v = await (a.isRTL == null ? void 0 : a.isRTL(d.floating)), b = m || (x || !g ? [it(c)] : _t(c)), A = h !== "none";
324      !m && A && b.push(...jt(c, g, h, v));
325      const R = [c, ...b], B = await a.detectOverflow(e, w), M = [];
326      let L = ((n = r.flip) == null ? void 0 : n.overflows) || [];
327      if (f && M.push(B[p]), u) {
328        const O = Ht(i, s, v);
329        M.push(B[O[0]], B[O[1]]);
330      }
331      if (L = [...L, {
332        placement: i,
333        overflows: M
334      }], !M.every((O) => O <= 0)) {
335        var _, F;
336        const O = (((_ = r.flip) == null ? void 0 : _.index) || 0) + 1, q = R[O];
337        if (q && (!(u === "alignment" ? y !== W(q) : !1) || // We leave the current main axis only if every placement on that axis
338        // overflows the main axis.
339        L.every((T) => W(T.placement) === y ? T.overflows[0] >
339 0 : !0)))
340          return {
341            data: {
342              index: O,
343              overflows: L
344            },
345            reset: {
346              placement: q
347            }
348          };
349        let V = (F = L.filter((E) => E.overflows[0] <= 0).sort((E, T) => E.overflows[1] - T.overflows[1])[0]) == null ? void 0 : F.placement;
350        if (!V)
351          switch (l) {
352            case "bestFit": {
353              var z;
354              const E = (z = L.filter((T) => {
355                if (A) {
356                  const I = W(T.placement);
357                  return I === y || // Create a bias to the `y` side axis due to horizontal
358                  // reading directions favoring greater width.
359                  I === "y";
360                }
361                return !0;
362              }).map((T) => [T.placement, T.overflows.filter((I) => I > 0).reduce((I, Vt) => I + Vt, 0)]).sort((T, I) => T[1] - I[1])[0]) == null ? void 0 : z[0];
363              E && (V = E);
364              break;
365            }
366            case "initialPlacement":
367              V = c;
368              break;
369          }
370        if (i !== V)
371          return {
372            reset: {
373              placement: V
374            }
375          };
376      }
377      return {};
378    }
379  };
380}, Tt = /* @__PURE__ */ new Set(["left", "top"]);
381async function Qt(t, e) {
382  const {
383    placement: o,
384    platform: n,
385    elements: i
386  } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = $(o), c = Q(o), a = W(o) === "y", d = Tt.has(s) ? -1 : 1, f = r && a ? -1 : 1, u = j(e, t);
387  let {
388    mainAxis: m,
389    crossAxis: l,
390    alignmentAxis: h
391  } = typeof u == "number" ? {
392    mainAxis: u,
393    crossAxis: 0,
394    alignmentAxis: null
395  } : {
396    mainAxis: u.mainAxis || 0,
397    crossAxis: u.crossAxis || 0,
398    alignmentAxis: u.alignmentAxis
399  };
400  return c && typeof h == "number" && (l = c === "end" ? h * -1 : h), a ? {
401    x: l * f,
402    y: m * d
403  } : {
404    x: m * d,
405    y: l * f
406  };
407}
408const Zt = function(t) {
409  return t === void 0 && (t = 0), {
410    name: "offset",
411    options: t,
412    async fn(e) {
413      var o, n;
414      const {
415        x: i,
416        y: r,
417        placement: s,
418        middlewareData: c
419      } = e, a = await Qt(e, t);
420      return s === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
421        x: i + a.x,
422        y: r + a.y,
423        data: {
424          ...a,
425          placement: s
426        }
427      };
428    }
429  };
430}, te = function(t) {
431  return t === void 0 && (t = {}), {
432    name: "shift",
433    options: t,
434    async fn(e) {
435      const {
436        x: o,
437        y: n,
438        placement: i,
439        platform: r
440      } = e, {
441        mainAxis: s = !0,
442        crossAxis: c = !1,
443        limiter: a = {
444          fn: (p) => {
445            let {
446              x: y,
447              y: x
448            } = p;
449            return {
450              x: y,
451              y: x
452            };
453          }
454        },
455        ...d
456      } = j(t, e), f = {
457        x: o,
458        y: n
459      }, u = await r.detectOverflow(e, d), m = W($(i)), l = gt(m);
460      let h = f[l], g = f[m];
461      if (s) {
462        const p = l === "y" ? "top" : "left", y = l === "y" ? "bottom" : "right", x = h + u[p], v = h - u[y];
463        h = dt(x, h, v);
464      }
465      if (c) {
466        const p = m === "y" ? "top" : "left", y = m === "y" ? "bottom" : "right", x = g + u[p], v = g - u[y];
467        g = dt(x, g, v);
468      }
469      const w = a.fn({
470        ...e,
471        [l]: h,
472        [m]: g
473      });
474      return {
475        ...w,
476        data: {
477          x: w.x - o,
478          y: w.y - n,
479          enabled: {
480            [l]: s,
481            [m]: c
482          }
483        }
484      };
485    }
486  };
487}, ee = function(t) {
488  return t === void 0 && (t = {}), {
489    options: t,
490    fn(e) {
491      const {
492        x: o,
493        y: n,
494        placement: i,
495        rects: r,
496        middlewareData: s
497      } = e, {
498        offset: c = 0,
499        mainAxis: a = !0,
500        crossAxis: d = !0
501      } = j(t, e), f = {
502        x: o,
503        y: n
504      }, u = W(i), m = gt(u);
505      let l = f[m], h = f[u];
506      const g = j(c, e), w = typeof g == "number" ? {
507        mainAxis: g,
508        crossAxis: 0
509      } : {
510        mainAxis: 0,
511        crossAxis: 0,
512        ...g
513      };
514      if (a) {
515        const x = m === "y" ? "height" : "width", v = r.reference[m] - r.floating[x] + w.mainAxis, b = r.reference[m] + r.reference[x] - w.mainAxis;
516        l < v ? l = v : l > b && (l = b);
517      }
518      if (d) {
519        var p, y;
520        const x = m === "y" ? "width" : "height", v = Tt.has($(i)), b = r.reference[u] - r.floating[x] + (v && ((p = s.offset) == null ? void 0 : p[u]) || 0) + (v ? 0 : w.crossAxis), A = r.reference[u] + r.reference[x] + (v ? 0 : ((y = s.offset) == null ? void 0 : y[u]) || 0) - (v ? w.crossAxis : 0);
521        h < b ? h = b : h > A && (h = A);
522      }
523      return {
524        [m]: l,
525        [u]: h
526      };
527    }
528  };
529}, ne = function(t) {
530  return t === void 0 && (t = {}), {
531    name: "size",
532    options: t,
533    async fn(e) {
534      var o, n;
535      const {
536        placement: i,
537        rects: r,
538        platform: s,
539        elements: c
540      } = e, {
541        apply: a = () => {
542        },
543        ...d
544      } = j(t, e), f = await s.detectOverflow(e, d), u = $(i), m = Q(i), l = W(i) === "y", {
545        width: h,
546        height: g
547      } = r.floating;
548      let w, p;
549      u === "top" || u === "bottom" ? (w = u, p = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (p = u, w = m === "end" ? "top" : "bottom");
550      const y = g - f.top - f.bottom, x = h - f.left - f.right, v = X(g - f[w], y), b = X(h - f[p], x), A = !e.middlewareData.shift;
551      let R = v, B = b;
552      if ((o = e.middlewareData.shift) != null && o.enabled.x && (B = x), (n = e.middlewareData.shift) != null && n.enabled.y && (R = y), A && !m) {
553        const L = C(f.left, 0), _ = C(f.right, 0), F = C(f.top, 0), z = C(f.bottom, 0);
554        l ? B = h - 2 * (L !== 0 || _ !== 0 ? L + _ : C(f.left, f.right)) : R = g - 2 * (F !== 0 || z !== 0 ? F + z : C(f.top, f.bottom));
555      }
556      await a({
557        ...e,
558        availableWidth: B,
559        availableHeight: R
560      });
561      const M = await s.getDimensions(c.floating);
562      return h !== M.width || g !== M.height ? {
563        reset: {
564          rects: !0
565        }
566      } : {};
567    }
568  };
569};
570function rt() {
571  return typeof window < "u";
572}
573function Z(t) {
574  return Dt(t) ? (t.nodeName || "").toLowerCase() : "#document";
575}
576function S(t) {
577  var e;
578  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
579}
580function N(t) {
581  var e;
582  return (e = (Dt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
583}
584function Dt(t) {
585  return rt() ? t instanceof Node || t instanceof S(t).Node : !1;
586}
587function D(t) {
588  return rt() ? t instanceof Element || t instanceof S(t).Element : !1;
589}
590function H(t) {
591  return rt() ? t instanceof HTMLElement || t instanceof S(t).HTMLElement : !1;
592}
593function Ot(t) {
594  return !rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof S(t).ShadowRoot;
595}
596function et(t) {
597  const {
598    overflow: e,
599    overflowX: o,
600    overflowY: n,
601    display: i
602  } = P(t);
603  return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && i !== "inline" && i !== "contents";
604}
605function oe(t) {
606  return /^(table|td|th)$/.test(Z(t));
607}
608function ct(t) {
609  try {
610    if (t.matches(":popover-open"))
611      return !0;
612  } catch {
613  }
614  try {
615    return t.matches(":modal");
616  } catch {
617    return !1;
618  }
619}
620const ie = /transform|translate|scale|rotate|perspective|filter/, se = /paint|layout|strict|content/, U = (t) => !!t && t !== "none";
621let at;
622function xt(t) {
623  const e = D(t) ? P(t) : t;
624  return U(e.transform) || U(e.translate) || U(e.scale) || U(e.rotate) || U(e.perspective) || !yt() && (U(e.backdropFilter) || U(e.filter)) || ie.test(e.willChange || "") || se.test(e.contain || "");
625}
626function re(t) {
627  let e = Y(t);
628  for (; H(e) && !J(e); ) {
629    if (xt(e))
630      return e;
631    if (ct(e))
632      return null;
633    e = Y(e);
634  }
635  return null;
636}
637function yt() {
638  return at == null && (at = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), at;
639}
640function J(t) {
641  return /^(html|body|#document)$/.test(Z(t));
642}
643function P(t) {
644  return S(t).getComputedStyle(t);
645}
646function lt(t) {
647  return D(t) ? {
648    scrollLeft: t.scrollLeft,
649    scrollTop: t.scrollTop
650  } : {
651    scrollLeft: t.scrollX,
652    scrollTop: t.scrollY
653  };
654}
655function Y(t) {
656  if (Z(t) === "html")
657    return t;
658  const e = (
659    // Step into the shadow DOM of the parent of a slotted node.
660    t.assignedSlot || // DOM Element detected.
661    t.parentNode || // ShadowRoot detected.
662    Ot(t) && t.host || // Fallback.
663    N(t)
664  );
665  return Ot(e) ? e.host : e;
666}
667function Pt(t) {
668  const e = Y(t);
669  return J(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : H(e) && et(e) ? e : Pt(e);
670}
671function tt(t, e, o) {
672  var n;
673  e === void 0 && (e = []), o === void 0 && (o = !0);
674  const i = Pt(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = S(i);
675  if (r) {
676    const c = ht(s);
677    return e.concat(s, s.visualViewport || [], et(i) ? i : [], c && o ? tt(c) : []);
678  } else
679    return e.concat(i, tt(i, [], o));
680}
681function ht(t) {
682  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
683}
684function Mt(t) {
685  const e = P(t);
686  let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
687  const i = H(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, c = ot(o) !== r || ot(n) !== s;
688  return c && (o = r, n = s), {
689    width: o,
690    height: n,
691    $: c
692  };
693}
694function vt(t) {
695  return D(t) ? t : t.contextElement;
696}
697function G(t) {
698  const e = vt(t);
699  if (!H(e))
700    return k(1);
701  const o = e.getBoundingClientRect(), {
702    width: n,
703    height: i,
704    $: r
705  } = Mt(e);
706  let s = (r ? ot(o.width) : o.width) / n, c = (r ? ot(o.height) : o.height) / i;
707  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
708    x: s,
709    y: c
710  };
711}
712const ce = /* @__PURE__ */ k(0);
713function Ft(t) {
714  const e = S(t);
715  return !yt() || !e.visualViewport ? ce : {
716    x: e.visualViewport.offsetLeft,
717    y: e.visualViewport.offsetTop
718  };
719}
720function le(t, e, o) {
721  return e === void 0 && (e = !1), !o || e && o !== S(t) ? !1 : e;
722}
723function K(t, e, o, n) {
724  e === void 0 && (e = !1), o === void 0 && (o = !1);
725  const i = t.getBoundingClientRect(), r = vt(t);
726  let s = k(1);
727  e && (n ? D(n) && (s = G(n)) : s = G(t));
728  const c = le(r, o, n) ? Ft(r) : k(0);
729  let a = (i.left + c.x) / s.x, d = (i.top + c.y) / s.y, f = i.width / s.x, u = i.height / s.y;
730  if (r) {
731    const m = S(r), l = n && D(n) ? S(n) : n;
732    let h = m, g = ht(h);
733    for (; g && n && l !== h; ) {
734      const w = G(g), p = g.getBoundingClientRect(), y = P(g), x = p.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, v = p.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
735      a *= w.x, d *= w.y, f *= w.x, u *= w.y, a += x, d += v, h = S(g), g = ht(h);
736    }
737  }
738  return st({
739    width: f,
740    height: u,
741    x: a,
742    y: d
743  });
744}
745function ft(t, e) {
746  const o = lt(t).scrollLeft;
747  return e ? e.left + o : K(N(t)).left + o;
748}
749function Wt(t, e) {
750  const o = t.getBoundingClientRect(), n = o.left + e.scrollLeft - ft(t, o), i = o.top + e.scrollTop;
751  return {
752    x: n,
753    y: i
754  };
755}
756function fe(t) {
757  let {
758    elements: e,
759    rect: o,
760    offsetParent: n,
761    strategy: i
762  } = t;
763  const r = i === "fixed", s = N(n), c = e ? ct(e.floating) : !1;
764  if (n === s || c && r)
765    return o;
766  let a = {
767    scrollLeft: 0,
768    scrollTop: 0
769  }, d = k(1);
770  const f = k(0), u = H(n);
771  if ((u || !u && !r) && ((Z(n) !== "body" || et(s)) && (a = lt(n)), u)) {
772    const l = K(n);
773    d = G(n), f.x = l.x + n.clientLeft, f.y = l.y + n.clientTop;
774  }
775  const m = s && !u && !r ? Wt(s, a) : k(0);
776  return {
777    width: o.width * d.x,
778    height: o.height * d.y,
779    x: o.x * d.x - a.scrollLeft * d.x + f.x + m.x,
780    y: o.y * d.y - a.scrollTop * d.y + f.y + m.y
781  };
782}
783function ae(t) {
784  return Array.from(t.getClientRects());
785}
786function ue(t) {
787  const e = N(t), o = lt(t), n = t.ownerDocument.body, i = C(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = C(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
788  let s = -o.scrollLeft + ft(t);
789  const c = -o.scrollTop;
790  return P(n).direction === "rtl" && (s += C(e.clientWidth, n.clientWidth) - i), {
791    width: i,
792    height: r,
793    x: s,
794    y: c
795  };
796}
797const Ct = 25;
798function de(t, e) {
799  const o = S(t), n = N(t), i = o.visualViewport;
800  let r = n.clientWidth, s = n.clientHeight, c = 0, a = 0;
801  if (i) {
802    r = i.width, s = i.height;
803    const f = yt();
804    (!f || f && e === "fixed") && (c = i.offsetLeft, a = i.offsetTop);
805  }
806  const d = ft(n);
807  if (d <= 0) {
808    const f = n.ownerDocument, u = f.body, m = getComputedStyle(u), l = f.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(n.clientWidth - u.clientWidth - l);
809    h <= Ct && (r -= h);
810  } else d <= Ct && (r += d);
811  return {
812    width: r,
813    height: s,
814    x: c,
815    y: a
816  };
817}
818function me(t, e) {
819  const o = K(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = H(t) ? G(t) : k(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, d = n * r.y;
820  return {
821    width: s,
822    height: c,
823    x: a,
824    y: d
825  };
826}
827function St(t, e, o) {
828  let n;
829  if (e === "viewport")
830    n = de(t, o);
831  else if (e === "document")
832    n = ue(N(t));
833  else if (D(e))
834    n = me(e, o);
835  else {
836    const i = Ft(t);
837    n = {
838      x: e.x - i.x,
839      y: e.y - i.y,
840      width: e.width,
841      height: e.height
842    };
843  }
844  return st(n);
845}
846function kt(t, e) {
847  const o = Y(t);
848  return o === e || !D(o) || J(o) ? !1 : P(o).position === "fixed" || kt(o, e);
849}
850function he(t, e) {
851  const o = e.get(t);
852  if (o)
853    return o;
854  let n = tt(t, [], !1).filter((c) => D(c) && Z(c) !== "body"), i = null;
855  const r = P(t).position === "fixed";
856  let s = r ? Y(t) : t;
857  for (; D(s) && !J(s); ) {
858    const c = P(s), a = xt(s);
859    !a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && (i.position === "absolute" || i.position === "fixed") || et(s) && !a && kt(t, s)) ? n = n.filter((f) => f !== s) : i = c, s = Y(s);
860  }
861  return e.set(t, n), n;
862}
863function ge(t) {
864  let {
865    element: e,
866    boundary: o,
867    rootBoundary: n,
868    strategy: i
869  } = t;
870  const s = [...o === "clippingAncestors" ? ct(e) ? [] : he(e, this._c) : [].concat(o), n], c = St(e, s[0], i);
871  let a = c.top, d = c.right, f = c.bottom, u = c.left;
872  for (let m = 1; m < s.length; m++) {
873    const l = St(e, s[m], i);
874    a = C(l.top, a), d = X(l.right, d), f = X(l.bottom, f), u = C(l.left, u);
875  }
876  return {
877    width: d - u,
878    height: f - a,
879    x: u,
880    y: a
881  };
882}
883function pe(t) {
884  const {
885    width: e,
886    height: o
887  } = Mt(t);
888  return {
889    width: e,
890    height: o
891  };
892}
893function we(t, e, o) {
894  const n = H(e), i = N(e), r = o === "fixed", s = K(t, !0, r, e);
895  let c = {
896    scrollLeft: 0,
897    scrollTop: 0
898  };
899  const a = k(0);
900  function d() {
901    a.x = ft(i);
902  }
903  if (n || !n && !r)
904    if ((Z(e) !== "body" || et(i)) && (c = lt(e)), n) {
905      const l = K(e, !0, r, e);
906      a.x = l.x + e.clientLeft, a.y = l.y + e.clientTop;
907    } else i && d();
908  r && !n && i && d();
909  const f = i && !n && !r ? Wt(i, c) : k(0), u = s.left + c.scrollLeft - a.x - f.x, m = s.top + c.scrollTop - a.y - f.y;
910  return {
911    x: u,
912    y: m,
913    width: s.width,
914    height: s.height
915  };
916}
917function ut(t) {
918  return P(t).position === "static";
919}
920function Lt(t, e) {
921  if (!H(t) || P(t).position === "fixed")
922    return null;
923  if (e)
924    return e(t);
925  let o = t.offsetParent;
926  return N(t) === o && (o = o.ownerDocument.body), o;
927}
928function Nt(t, e) {
929  const o = S(t);
930  if (ct(t))
931    return o;
932  if (!H(t)) {
933    let i = Y(t);
934    for (; i && !J(i); ) {
935      if (D(i) && !ut(i))
936        return i;
937      i = Y(i);
938    }
939    return o;
940  }
941  let n = Lt(t, e);
942  for (; n && oe(n) && ut(n); )
943    n = Lt(n, e);
944  return n && J(n) && ut(n) && !xt(n) ? o : n || re(t) || o;
945}
946const xe = async function(t) {
947  const e = this.getOffsetParent || Nt, o = this.getDimensions, n = await o(t.floating);
948  return {
949    reference: we(t.reference, await e(t.floating), t.strategy),
950    floating: {
951      x: 0,
952      y: 0,
953      width: n.width,
954      height: n.height
955    }
956  };
957};
958function ye(t) {
959  return P(t).direction === "rtl";
960}
961const ve = {
962  convertOffsetParentRelativeRectToViewportRelativeRect: fe,
963  getDocumentElement: N,
964  getClippingRect: ge,
965  getOffsetParent: Nt,
966  getElementRects: xe,
967  getClientRects: ae,
968  getDimensions: pe,
969  getScale: G,
970  isElement: D,
971  isRTL: ye
972};
973function Bt(t, e) {
974  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
975}
976function be(t, e) {
977  let o = null, n;
978  const i = N(t);
979  function r() {
980    var c;
981    clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
982  }
983  function s(c, a) {
984    c === void 0 && (c = !1), a === void 0 && (a = 1), r();
985    const d = t.getBoundingClientRect(), {
986      left: f,
987      top: u,
988      width: m,
989      height: l
990    } = d;
991    if (c || e(), !m || !l)
992      return;
993    const h = nt(u), g = nt(i.clientWidth - (f + m)), w = nt(i.clientHeight - (u + l)), p = nt(f), x = {
994      rootMargin: -h + "px " + -g + "px " + -w + "px " + -p + "px",
995      threshold: C(0, X(1, a)) || 1
996    };
997    let v = !0;
998    function b(A) {
999      const R = A[0].intersectionRatio;
1000      if (R !== a) {
1001        if (!v)
1002          return s();
1003        R ? s(!1, R) : n = setTimeout(() => {
1004          s(!1, 1e-7);
1005        }, 1e3);
1006      }
1007      R === 1 && !Bt(d, t.getBoundingClientRect()) && s(), v = !1;
1008    }
1009    try {
1010      o = new IntersectionObserver(b, {
1011        ...x,
1012        // Handle <iframe>s
1013        root: i.ownerDocument
1014      });
1015    } catch {
1016      o = new IntersectionObserver(b, x);
1017    }
1018    o.observe(t);
1019  }
1020  return s(!0), r;
1021}
1022function Ae(t, e, o, n) {
1023  n === void 0 && (n = {});
1024  const {
1025    ancestorScroll: i = !0,
1026    ancestorResize: r = !0,
1027    elementResize: s = typeof ResizeObserver == "function",
1028    layoutShift: c = typeof IntersectionObserver == "function",
1029    animationFrame: a = !1
1030  } = n, d = vt(t), f = i || r ? [...d ? tt(d) : [], ...e ? tt(e) : []] : [];
1031  f.forEach((p) => {
1032    i && p.addEventListener("scroll", o, {
1033      passive: !0
1034    }), r && p.addEventListener("resize", o);
1035  });
1036  const u = d && c ? be(d, o) : null;
1037  let m = -1, l = null;
1038  s && (l = new ResizeObserver((p) => {
1039    let [y] = p;
1040    y && y.target === d && l && e && (l.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1041      var x;
1042      (x = l) == null || x.observe(e);
1043    })), o();
1044  }), d && !a && l.observe(d), e && l.observe(e));
1045  let h, g = a ? K(t) : null;
1046  a && w();
1047  function w() {
1048    const p = K(t);
1049    g && !Bt(g, p) && o(), g = p, h = requestAnimationFrame(w);
1050  }
1051  return o(), () => {
1052    var p;
1053    f.forEach((y) => {
1054      i && y.removeEventListener("scroll", o), r && y.removeEventListener("resize", o);
1055    }), u?.(), (p = l) == null || p.disconnect(), l = null, a && cancelAnimationFrame(h);
1056  };
1057}
1058const Re = Zt, Oe = te, Ce = Jt, Se = ne, Le = Gt, Ee = ee, Te = (t, e, o) => {
1059  const n = /* @__PURE__ */ new Map(), i = {
1060    platform: ve,
1061    ...o
1062  }, r = {
1063    ...i.platform,
1064    _c: n
1065  };
1066  return Kt(t, e, {
1067    ...i,
1068    platform: r
1069  });
1070};
1071export {
1072  Ae as a,
1073  Se as b,
1074  Te as c,
1075  Le as d,
1076  Ce as f,
1077  xt as i,
1078  Ee as l,
1079  Re as o,
1080  ve as p,
1081  Oe as s
1082};
1083//# sourceMappingURL=floating-ui.dom.DV7ofceA.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.