import { getGlobalMatrix as O, _setDoc as rt, Matrix2D as Ge, _getDocScrollLeft as qe, _getDocScrollTop as Ne, _getCTM as st } from "./utils/matrix.es.js";
/*!
 * Flip 3.13.0
 * https://gsap.com
 *
 * @license Copyright 2008-2025, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license
 * @author: Jack Doyle, jack@greensock.com
*/
var at = 1, ie, A, b, ne, J, q, Ie, Se = function(e, i) {
  return e.actions.forEach(function(t) {
    return t.vars[i] && t.vars[i](t);
  });
}, Pe = {}, ze = 180 / Math.PI, ot = Math.PI / 180, ue = {}, Re = {}, ce = {}, Be = function(e) {
  return typeof e == "string" ? e.split(" ").join("").split(",") : e;
}, lt = Be("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"), fe = Be("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"), re = function(e) {
  return ie(e)[0] || console.warn("Element not found:", e);
}, Q = function(e) {
  return Math.round(e * 1e4) / 1e4 || 0;
}, be = function(e, i, t) {
  return e.forEach(function(r) {
    return r.classList[t](i);
  });
}, Ye = {
  zIndex: 1,
  kill: 1,
  simple: 1,
  spin: 1,
  clearProps: 1,
  targets: 1,
  toggleClass: 1,
  onComplete: 1,
  onUpdate: 1,
  onInterrupt: 1,
  onStart: 1,
  delay: 1,
  repeat: 1,
  repeatDelay: 1,
  yoyo: 1,
  scale: 1,
  fade: 1,
  absolute: 1,
  props: 1,
  onEnter: 1,
  onLeave: 1,
  custom: 1,
  paused: 1,
  nested: 1,
  prune: 1,
  absoluteOnLeave: 1
}, Je = {
  zIndex: 1,
  simple: 1,
  clearProps: 1,
  scale: 1,
  absolute: 1,
  fitChild: 1,
  getVars: 1,
  props: 1
}, Ue = function(e) {
  return e.replace(/([A-Z])/g, "-$1").toLowerCase();
}, ee = function(e, i) {
  var t = {}, r;
  for (r in e)
    i[r] || (t[r] = e[r]);
  return t;
}, Ce = {}, Ze = function(e) {
  var i = Ce[e] = Be(e);
  return ce[e] = i.concat(fe), i;
}, ut = function(e) {
  var i = e._gsap || A.core.getCache(e);
  return i.gmCache === A.ticker.frame ? i.gMatrix : (i.gmCache = A.ticker.frame, i.gMatrix = O(e, !0, !1, !0));
}, ht = function o(e, i, t) {
  t === void 0 && (t = 0);
  for (var r = e.parentNode, n = 1e3 * Math.pow(10, t) * (i ? -1 : 1), s = i ? -n * 900 : 0; e; )
    s += n, e = e.previousSibling;
  return r ? s + o(r, i, t + 1) : s;
}, he = function(e, i, t) {
  return e.forEach(function(r) {
    return r.d = ht(t ? r.element : r.t, i);
  }), e.sort(function(r, n) {
    return r.d - n.d;
  }), e;
}, se = function(e, i) {
  for (var t = e.element.style, r = e.css = e.css || [], n = i.length, s, l; n--; )
    s = i[n], l = t[s] || t.getPropertyValue(s), r.push(l ? s : Re[s] || (Re[s] = Ue(s)), l);
  return t;
}, pe = function(e) {
  var i = e.css, t = e.element.style, r = 0;
  for (e.cache.uncache = 1; r < i.length; r += 2)
    i[r + 1] ? t[i[r]] = i[r + 1] : t.removeProperty(i[r]);
  !i[i.indexOf("transform") + 1] && t.translate && (t.removeProperty("translate"), t.removeProperty("scale"), t.removeProperty("rotate"));
}, Oe = function(e, i) {
  e.forEach(function(t) {
    return t.a.cache.uncache = 1;
  }), i || e.finalStates.forEach(pe);
}, xe = "paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","), Le = function(e, i, t) {
  var r = e.element, n = e.width, s = e.height, l = e.uncache, u = e.getProp, a = r.style, c = 4, h, x, w;
  if (typeof i != "object" && (i = e), b && t !== 1)
    return b._abs.push({
      t: r,
      b: e,
      a: e,
      sd: 0
    }), b._final.push(function() {
      return (e.cache.uncache = 1) && pe(e);
    }), r;
  for (x = u("display") === "none", (!e.isVisible || x) && (x && (se(e, ["display"]).display = i.display), e.matrix = i.matrix, e.width = n = e.width || i.width, e.height = s = e.height || i.height), se(e, xe), w = window.getComputedStyle(r); c--; )
    a[xe[c]] = w[xe[c]];
  if (a.gridArea = "1 / 1 / 1 / 1", a.transition = "none", a.position = "absolute", a.width = n + "px", a.height = s + "px", a.top || (a.top = "0px"), a.left || (a.left = "0px"), l)
    h = new Z(r);
  else if (h = ee(e, ue), h.position = "absolute", e.simple) {
    var _ = r.getBoundingClientRect();
    h.matrix = new Ge(1, 0, 0, 1, _.left + qe(), _.top + Ne());
  } else
    h.matrix = O(r, !1, !1, !0);
  return h = te(h, e, !0), e.x = q(h.x, 0.01), e.y = q(h.y, 0.01), r;
}, He = function(e, i) {
  return i !== !0 && (i = ie(i), e = e.filter(function(t) {
    if (i.indexOf((t.sd < 0 ? t.b : t.a).element) !== -1)
      return !0;
    t.t._gsap.renderTransform(1), t.b.isVisible && (t.t.style.width = t.b.width + "px", t.t.style.height = t.b.height + "px");
  })), e;
}, $e = function(e) {
  return he(e, !0).forEach(function(i) {
    return (i.a.isVisible || i.b.isVisible) && Le(i.sd < 0 ? i.b : i.a, i.b, 1);
  });
}, pt = function(e, i) {
  return i && e.idLookup[Ve(i).id] || e.elementStates[0];
}, Ve = function(e, i, t, r) {
  return e instanceof Z ? e : e instanceof S ? pt(e, r) : new Z(typeof e == "string" ? re(e) || console.warn(e + " not found") : e, i, t);
}, ct = function(e, i) {
  for (var t = A.getProperty(e.element, null, "native"), r = e.props = {}, n = i.length; n--; )
    r[i[n]] = (t(i[n]) + "").trim();
  return r.zIndex && (r.zIndex = parseFloat(r.zIndex) || 0), e;
}, Ke = function(e, i) {
  var t = e.style || e, r;
  for (r in i)
    t[r] = i[r];
}, ft = function(e) {
  var i = e.getAttribute("data-flip-id");
  return i || e.setAttribute("data-flip-id", i = "auto-" + at++), i;
}, Qe = function(e) {
  return e.map(function(i) {
    return i.element;
  });
}, We = function(e, i, t) {
  return e && i.length && t.add(e(Qe(i), t, new S(i, 0, !0)), 0);
}, te = function(e, i, t, r, n, s) {
  var l = e.element, u = e.cache, a = e.parent, c = e.x, h = e.y, x = i.width, w = i.height, _ = i.scaleX, v = i.scaleY, g = i.rotation, y = i.bounds, M = s && Ie && Ie(l, "transform,width,height"), f = e, B = i.matrix, I = B.e, L = B.f, z = e.bounds.width !== y.width || e.bounds.height !== y.height || e.scaleX !== _ || e.scaleY !== v || e.rotation !== g, R = !z && e.simple && i.simple && !n, C, m, k, H, X, D, d;
  return R || !a ? (_ = v = 1, g = C = 0) : (X = ut(a), D = X.clone().multiply(i.ctm ? i.matrix.clone().multiply(i.ctm) : i.matrix), g = Q(Math.atan2(D.b, D.a) * ze), C = Q(Math.atan2(D.c, D.d) * ze + g) % 360, _ = Math.sqrt(Math.pow(D.a, 2) + Math.pow(D.b, 2)), v = Math.sqrt(Math.pow(D.c, 2) + Math.pow(D.d, 2)) * Math.cos(C * ot), n && (n = ie(n)[0], H = A.getProperty(n), d = n.getBBox && typeof n.getBBox == "function" && n.getBBox(), f = {
    scaleX: H("scaleX"),
    scaleY: H("scaleY"),
    width: d ? d.width : Math.ceil(parseFloat(H("width", "px"))),
    height: d ? d.height : parseFloat(H("height", "px"))
  }), u.rotation = g + "deg", u.skewX = C + "deg"), t ? (_ *= x === f.width || !f.width ? 1 : x / f.width, v *= w === f.height || !f.height ? 1 : w / f.height, u.scaleX = _, u.scaleY = v) : (x = q(x * _ / f.scaleX, 0), w = q(w * v / f.scaleY, 0), l.style.width = x + "px", l.style.height = w + "px"), r && Ke(l, i.props), R || !a ? (c += I - e.matrix.e, h += L - e.matrix.f) : z || a !== i.parent ? (u.renderTransform(1, u), D = O(n || l, !1, !1, !0), m = X.apply({
    x: D.e,
    y: D.f
  }), k = X.apply({
    x: I,
    y: L
  }), c += k.x - m.x, h += k.y - m.y) : (X.e = X.f = 0, k = X.apply({
    x: I - e.matrix.e,
    y: L - e.matrix.f
  }), c += k.x, h += k.y), c = q(c, 0.02), h = q(h, 0.02), s && !(s instanceof Z) ? M && M.revert() : (u.x = c + "px", u.y = h + "px", u.renderTransform(1, u)), s && (s.x = c, s.y = h, s.rotation = g, s.skewX = C, t ? (s.scaleX = _, s.scaleY = v) : (s.width = x, s.height = w)), s || u;
}, we = function(e, i) {
  return e instanceof S ? e : new S(e, i);
}, et = function(e, i, t) {
  var r = e.idLookup[t], n = e.alt[t];
  return n.isVisible && (!(i.getElementState(n.element) || n).isVisible || !r.isVisible) ? n : r;
}, ve = [], ke = "width,height,overflowX,overflowY".split(","), oe, je = function(e) {
  if (e !== oe) {
    var i = J.style, t = J.clientWidth === window.outerWidth, r = J.clientHeight === window.outerHeight, n = 4;
    if (e && (t || r)) {
      for (; n--; )
        ve[n] = i[ke[n]];
      t && (i.width = J.clientWidth + "px", i.overflowY = "hidden"), r && (i.height = J.clientHeight + "px", i.overflowX = "hidden"), oe = e;
    } else if (oe) {
      for (; n--; )
        ve[n] ? i[ke[n]] = ve[n] : i.removeProperty(Ue(ke[n]));
      oe = e;
    }
  }
}, Ee = function(e, i, t, r) {
  e instanceof S && i instanceof S || console.warn("Not a valid state object."), t = t || {};
  var n = t, s = n.clearProps, l = n.onEnter, u = n.onLeave, a = n.absolute, c = n.absoluteOnLeave, h = n.custom, x = n.delay, w = n.paused, _ = n.repeat, v = n.repeatDelay, g = n.yoyo, y = n.toggleClass, M = n.nested, f = n.zIndex, B = n.scale, I = n.fade, L = n.stagger, z = n.spin, R = n.prune, C = ("props" in t ? t : e).props, m = ee(t, Ye), k = A.timeline({
    delay: x,
    paused: w,
    repeat: _,
    repeatDelay: v,
    yoyo: g,
    data: "isFlip"
  }), H = m, X = [], D = [], d = [], ae = [], tt = z === !0 ? 1 : z || 0, it = typeof z == "function" ? z : function() {
    return tt;
  }, de = e.interrupted || i.interrupted, Ae = k[r !== 1 ? "to" : "from"], $, F, Te, N, V, E, K, Y, me, W, j, ge, P, T;
  for (F in i.idLookup)
    j = i.alt[F] ? et(i, e, F) : i.idLookup[F], V = j.element, W = e.idLookup[F], e.alt[F] && V === W.element && (e.alt[F].isVisible || !j.isVisible) && (W = e.alt[F]), W ? (E = {
      t: V,
      b: W,
      a: j,
      sd: W.element === V ? 0 : j.isVisible ? 1 : -1
    }, d.push(E), E.sd && (E.sd < 0 && (E.b = j, E.a = W), de && se(E.b, C ? ce[C] : fe), I && d.push(E.swap = {
      t: W.element,
      b: E.b,
      a: E.a,
      sd: -E.sd,
      swap: E
    })), V._flip = W.element._flip = b ? b.timeline : k) : j.isVisible && (d.push({
      t: V,
      b: ee(j, {
        isVisible: 1
      }),
      a: j,
      sd: 0,
      entering: 1
    }), V._flip = b ? b.timeline : k);
  if (C && (Ce[C] || Ze(C)).forEach(function(G) {
    return m[G] = function(U) {
      return d[U].a.props[G];
    };
  }), d.finalStates = me = [], ge = function() {
    for (he(d), je(!0), N = 0; N < d.length; N++)
      E = d[N], P = E.a, T = E.b, R && !P.isDifferent(T) && !E.entering ? d.splice(N--, 1) : (V = E.t, M && !(E.sd < 0) && N && (P.matrix = O(V, !1, !1, !0)), T.isVisible && P.isVisible ? (E.sd < 0 ? (K = new Z(V, C, e.simple), te(K, P, B, 0, 0, K), K.matrix = O(V, !1, !1, !0), K.css = E.b.css, E.a = P = K, I && (V.style.opacity = de ? T.opacity : P.opacity), L && ae.push(V)) : E.sd > 0 && I && (V.style.opacity = de ? P.opacity - T.opacity : "0"), te(P, T, B, C)) : T.isVisible !== P.isVisible && (T.isVisible ? P.isVisible || (T.css = P.css, D.push(T), d.splice(N--, 1), a && M && te(P, T, B, C)) : (P.isVisible && X.push(P), d.splice(N--, 1))), B || (V.style.maxWidth = Math.max(P.width, T.width) + "px", V.style.maxHeight = Math.max(P.height, T.height) + "px", V.style.minWidth = Math.min(P.width, T.width) + "px", V.style.minHeight = Math.min(P.height, T.height) + "px"), M && y && V.classList.add(y)), me.push(P);
    var U;
    if (y && (U = me.map(function(p) {
      return p.element;
    }), M && U.forEach(function(p) {
      return p.classList.remove(y);
    })), je(!1), B ? (m.scaleX = function(p) {
      return d[p].a.scaleX;
    }, m.scaleY = function(p) {
      return d[p].a.scaleY;
    }) : (m.width = function(p) {
      return d[p].a.width + "px";
    }, m.height = function(p) {
      return d[p].a.height + "px";
    }, m.autoRound = t.autoRound || !1), m.x = function(p) {
      return d[p].a.x + "px";
    }, m.y = function(p) {
      return d[p].a.y + "px";
    }, m.rotation = function(p) {
      return d[p].a.rotation + (z ? it(p, Y[p], Y) * 360 : 0);
    }, m.skewX = function(p) {
      return d[p].a.skewX;
    }, Y = d.map(function(p) {
      return p.t;
    }), (f || f === 0) && (m.modifiers = {
      zIndex: function() {
        return f;
      }
    }, m.zIndex = f, m.immediateRender = t.immediateRender !== !1), I && (m.opacity = function(p) {
      return d[p].sd < 0 ? 0 : d[p].sd > 0 ? d[p].a.opacity : "+=0";
    }), ae.length) {
      L = A.utils.distribute(L);
      var nt = Y.slice(ae.length);
      m.stagger = function(p, Xe) {
        return L(~ae.indexOf(Xe) ? Y.indexOf(d[p].swap.t) : p, Xe, nt);
      };
    }
    if (lt.forEach(function(p) {
      return t[p] && k.eventCallback(p, t[p], t[p + "Params"]);
    }), h && Y.length) {
      H = ee(m, Ye), "scale" in h && (h.scaleX = h.scaleY = h.scale, delete h.scale);
      for (F in h)
        $ = ee(h[F], Je), $[F] = m[F], !("duration" in $) && "duration" in m && ($.duration = m.duration), $.stagger = m.stagger, Ae.call(k, Y, $, 0), delete H[F];
    }
    (Y.length || D.length || X.length) && (y && k.add(function() {
      return be(U, y, k._zTime < 0 ? "remove" : "add");
    }, 0) && !w && be(U, y, "add"), Y.length && Ae.call(k, Y, H, 0)), We(l, X, k), We(u, D, k);
    var _e = b && b.timeline;
    _e && (_e.add(k, 0), b._final.push(function() {
      return Oe(d, !s);
    })), Te = k.duration(), k.call(function() {
      var p = k.time() >= Te;
      p && !_e && Oe(d, !s), y && be(U, y, p ? "remove" : "add");
    });
  }, c && (a = d.filter(function(G) {
    return !G.sd && !G.a.isVisible && G.b.isVisible;
  }).map(function(G) {
    return G.a.element;
  })), b) {
    var Fe;
    a && (Fe = b._abs).push.apply(Fe, He(d, a)), b._run.push(ge);
  } else
    a && $e(He(d, a)), ge();
  var ye = b ? b.timeline : k;
  return ye.revert = function() {
    return Me(ye, 1, 1);
  }, ye;
}, dt = function o(e) {
  e.vars.onInterrupt && e.vars.onInterrupt.apply(e, e.vars.onInterruptParams || []), e.getChildren(!0, !1, !0).forEach(o);
}, Me = function(e, i, t) {
  if (e && e.progress() < 1 && (!e.paused() || t))
    return i && (dt(e), i < 2 && e.progress(1), e.kill()), !0;
}, le = function(e) {
  for (var i = e.idLookup = {}, t = e.alt = {}, r = e.elementStates, n = r.length, s; n--; )
    s = r[n], i[s.id] ? t[s.id] = s : i[s.id] = s;
}, S = /* @__PURE__ */ (function() {
  function o(i, t, r) {
    if (this.props = t && t.props, this.simple = !!(t && t.simple), r)
      this.targets = Qe(i), this.elementStates = i, le(this);
    else {
      this.targets = ie(i);
      var n = t && (t.kill === !1 || t.batch && !t.kill);
      b && !n && b._kill.push(this), this.update(n || !!b);
    }
  }
  var e = o.prototype;
  return e.update = function(t) {
    var r = this;
    return this.elementStates = this.targets.map(function(n) {
      return new Z(n, r.props, r.simple);
    }), le(this), this.interrupt(t), this.recordInlineStyles(), this;
  }, e.clear = function() {
    return this.targets.length = this.elementStates.length = 0, le(this), this;
  }, e.fit = function(t, r, n) {
    for (var s = he(this.elementStates.slice(0), !1, !0), l = (t || this).idLookup, u = 0, a, c; u < s.length; u++)
      a = s[u], n && (a.matrix = O(a.element, !1, !1, !0)), c = l[a.id], c && te(a, c, r, !0, 0, a), a.matrix = O(a.element, !1, !1, !0);
    return this;
  }, e.getProperty = function(t, r) {
    var n = this.getElementState(t) || ue;
    return (r in n ? n : n.props || ue)[r];
  }, e.add = function(t) {
    for (var r = t.targets.length, n = this.idLookup, s = this.alt, l, u, a; r--; )
      u = t.elementStates[r], a = n[u.id], a && (u.element === a.element || s[u.id] && s[u.id].element === u.element) ? (l = this.elementStates.indexOf(u.element === a.element ? a : s[u.id]), this.targets.splice(l, 1, t.targets[r]), this.elementStates.splice(l, 1, u)) : (this.targets.push(t.targets[r]), this.elementStates.push(u));
    return t.interrupted && (this.interrupted = !0), t.simple || (this.simple = !1), le(this), this;
  }, e.compare = function(t) {
    var r = t.idLookup, n = this.idLookup, s = [], l = [], u = [], a = [], c = [], h = t.alt, x = this.alt, w = function(R, C, m) {
      return (R.isVisible !== C.isVisible ? R.isVisible ? u : a : R.isVisible ? l : s).push(m) && c.push(m);
    }, _ = function(R, C, m) {
      return c.indexOf(m) < 0 && w(R, C, m);
    }, v, g, y, M, f, B, I, L;
    for (y in r)
      f = h[y], B = x[y], v = f ? et(t, this, y) : r[y], M = v.element, g = n[y], B ? (L = g.isVisible || !B.isVisible && M === g.element ? g : B, I = f && !v.isVisible && !f.isVisible && L.element === f.element ? f : v, I.isVisible && L.isVisible && I.element !== L.element ? ((I.isDifferent(L) ? l : s).push(I.element, L.element), c.push(I.element, L.element)) : w(I, L, I.element), f && I.element === f.element && (f = r[y]), _(I.element !== g.element && f ? f : I, g, g.element), _(f && f.element === B.element ? f : I, B, B.element), f && _(f, B.element === f.element ? B : g, f.element)) : (g ? g.isDifferent(v) ? w(v, g, M) : s.push(M) : u.push(M), f && _(f, g, f.element));
    for (y in n)
      r[y] || (a.push(n[y].element), x[y] && a.push(x[y].element));
    return {
      changed: l,
      unchanged: s,
      enter: u,
      leave: a
    };
  }, e.recordInlineStyles = function() {
    for (var t = ce[this.props] || fe, r = this.elementStates.length; r--; )
      se(this.elementStates[r], t);
  }, e.interrupt = function(t) {
    var r = this, n = [];
    this.targets.forEach(function(s) {
      var l = s._flip, u = Me(l, t ? 0 : 1);
      t && u && n.indexOf(l) < 0 && l.add(function() {
        return r.updateVisibility();
      }), u && n.push(l);
    }), !t && n.length && this.updateVisibility(), this.interrupted || (this.interrupted = !!n.length);
  }, e.updateVisibility = function() {
    this.elementStates.forEach(function(t) {
      var r = t.element.getBoundingClientRect();
      t.isVisible = !!(r.width || r.height || r.top || r.left), t.uncache = 1;
    });
  }, e.getElementState = function(t) {
    return this.elementStates[this.targets.indexOf(re(t))];
  }, e.makeAbsolute = function() {
    return he(this.elementStates.slice(0), !0, !0).map(Le);
  }, o;
})(), Z = /* @__PURE__ */ (function() {
  function o(i, t, r) {
    this.element = i, this.update(t, r);
  }
  var e = o.prototype;
  return e.isDifferent = function(t) {
    var r = this.bounds, n = t.bounds;
    return r.top !== n.top || r.left !== n.left || r.width !== n.width || r.height !== n.height || !this.matrix.equals(t.matrix) || this.opacity !== t.opacity || this.props && t.props && JSON.stringify(this.props) !== JSON.stringify(t.props);
  }, e.update = function(t, r) {
    var n = this, s = n.element, l = A.getProperty(s), u = A.core.getCache(s), a = s.getBoundingClientRect(), c = s.getBBox && typeof s.getBBox == "function" && s.nodeName.toLowerCase() !== "svg" && s.getBBox(), h = r ? new Ge(1, 0, 0, 1, a.left + qe(), a.top + Ne()) : O(s, !1, !1, !0);
    u.uncache = 1, n.getProp = l, n.element = s, n.id = ft(s), n.matrix = h, n.cache = u, n.bounds = a, n.isVisible = !!(a.width || a.height || a.left || a.top), n.display = l("display"), n.position = l("position"), n.parent = s.parentNode, n.x = l("x"), n.y = l("y"), n.scaleX = u.scaleX, n.scaleY = u.scaleY, n.rotation = l("rotation"), n.skewX = l("skewX"), n.opacity = l("opacity"), n.width = c ? c.width : q(l("width", "px"), 0.04), n.height = c ? c.height : q(l("height", "px"), 0.04), t && ct(n, Ce[t] || Ze(t)), n.ctm = s.getCTM && s.nodeName.toLowerCase() === "svg" && st(s).inverse(), n.simple = r || Q(h.a) === 1 && !Q(h.b) && !Q(h.c) && Q(h.d) === 1, n.uncache = 0;
  }, o;
})(), mt = /* @__PURE__ */ (function() {
  function o(i, t) {
    this.vars = i, this.batch = t, this.states = [], this.timeline = t.timeline;
  }
  var e = o.prototype;
  return e.getStateById = function(t) {
    for (var r = this.states.length; r--; )
      if (this.states[r].idLookup[t])
        return this.states[r];
  }, e.kill = function() {
    this.batch.remove(this);
  }, o;
})(), gt = /* @__PURE__ */ (function() {
  function o(i) {
    this.id = i, this.actions = [], this._kill = [], this._final = [], this._abs = [], this._run = [], this.data = {}, this.state = new S(), this.timeline = A.timeline();
  }
  var e = o.prototype;
  return e.add = function(t) {
    var r = this.actions.filter(function(n) {
      return n.vars === t;
    });
    return r.length ? r[0] : (r = new mt(typeof t == "function" ? {
      animate: t
    } : t, this), this.actions.push(r), r);
  }, e.remove = function(t) {
    var r = this.actions.indexOf(t);
    return r >= 0 && this.actions.splice(r, 1), this;
  }, e.getState = function(t) {
    var r = this, n = b, s = ne;
    return b = this, this.state.clear(), this._kill.length = 0, this.actions.forEach(function(l) {
      l.vars.getState && (l.states.length = 0, ne = l, l.state = l.vars.getState(l)), t && l.states.forEach(function(u) {
        return r.state.add(u);
      });
    }), ne = s, b = n, this.killConflicts(), this;
  }, e.animate = function() {
    var t = this, r = b, n = this.timeline, s = this.actions.length, l, u;
    for (b = this, n.clear(), this._abs.length = this._final.length = this._run.length = 0, this.actions.forEach(function(a) {
      a.vars.animate && a.vars.animate(a);
      var c = a.vars.onEnter, h = a.vars.onLeave, x = a.targets, w, _;
      x && x.length && (c || h) && (w = new S(), a.states.forEach(function(v) {
        return w.add(v);
      }), _ = w.compare(De.getState(x)), _.enter.length && c && c(_.enter), _.leave.length && h && h(_.leave));
    }), $e(this._abs), this._run.forEach(function(a) {
      return a();
    }), u = n.duration(), l = this._final.slice(0), n.add(function() {
      u <= n.time() && (l.forEach(function(a) {
        return a();
      }), Se(t, "onComplete"));
    }), b = r; s--; )
      this.actions[s].vars.once && this.actions[s].kill();
    return Se(this, "onStart"), n.restart(), this;
  }, e.loadState = function(t) {
    t || (t = function() {
      return 0;
    });
    var r = [];
    return this.actions.forEach(function(n) {
      if (n.vars.loadState) {
        var s, l = function u(a) {
          a && (n.targets = a), s = r.indexOf(u), ~s && (r.splice(s, 1), r.length || t());
        };
        r.push(l), n.vars.loadState(l);
      }
    }), r.length || t(), this;
  }, e.setState = function() {
    return this.actions.forEach(function(t) {
      return t.targets = t.vars.setState && t.vars.setState(t);
    }), this;
  }, e.killConflicts = function(t) {
    return this.state.interrupt(t), this._kill.forEach(function(r) {
      return r.interrupt(t);
    }), this;
  }, e.run = function(t, r) {
    var n = this;
    return this !== b && (t || this.getState(r), this.loadState(function() {
      n._killed || (n.setState(), n.animate());
    })), this;
  }, e.clear = function(t) {
    this.state.clear(), t || (this.actions.length = 0);
  }, e.getStateById = function(t) {
    for (var r = this.actions.length, n; r--; )
      if (n = this.actions[r].getStateById(t), n)
        return n;
    return this.state.idLookup[t] && this.state;
  }, e.kill = function() {
    this._killed = 1, this.clear(), delete Pe[this.id];
  }, o;
})(), De = /* @__PURE__ */ (function() {
  function o() {
  }
  return o.getState = function(i, t) {
    var r = we(i, t);
    return ne && ne.states.push(r), t && t.batch && o.batch(t.batch).state.add(r), r;
  }, o.from = function(i, t) {
    return t = t || {}, "clearProps" in t || (t.clearProps = !0), Ee(i, we(t.targets || i.targets, {
      props: t.props || i.props,
      simple: t.simple,
      kill: !!t.kill
    }), t, -1);
  }, o.to = function(i, t) {
    return Ee(i, we(t.targets || i.targets, {
      props: t.props || i.props,
      simple: t.simple,
      kill: !!t.kill
    }), t, 1);
  }, o.fromTo = function(i, t, r) {
    return Ee(i, t, r);
  }, o.fit = function(i, t, r) {
    var n = r ? ee(r, Je) : {}, s = r || n, l = s.absolute, u = s.scale, a = s.getVars, c = s.props, h = s.runBackwards, x = s.onComplete, w = s.simple, _ = r && r.fitChild && re(r.fitChild), v = Ve(t, c, w, i), g = Ve(i, 0, w, v), y = c ? ce[c] : fe, M = A.context();
    return c && Ke(n, v.props), se(g, y), h && ("immediateRender" in n || (n.immediateRender = !0), n.onComplete = function() {
      pe(g), x && x.apply(this, arguments);
    }), l && Le(g, v), n = te(g, v, u || _, !n.duration && c, _, n.duration || a ? n : 0), typeof r == "object" && "zIndex" in r && (n.zIndex = r.zIndex), M && !a && M.add(function() {
      return function() {
        return pe(g);
      };
    }), a ? n : n.duration ? A.to(g.element, n) : null;
  }, o.makeAbsolute = function(i, t) {
    return (i instanceof S ? i : new S(i, t)).makeAbsolute();
  }, o.batch = function(i) {
    return i || (i = "default"), Pe[i] || (Pe[i] = new gt(i));
  }, o.killFlipsOf = function(i, t) {
    (i instanceof S ? i.targets : ie(i)).forEach(function(r) {
      return r && Me(r._flip, t !== !1 ? 1 : 2);
    });
  }, o.isFlipping = function(i) {
    var t = o.getByTarget(i);
    return !!t && t.isActive();
  }, o.getByTarget = function(i) {
    return (re(i) || ue)._flip;
  }, o.getElementState = function(i, t) {
    return new Z(re(i), t);
  }, o.convertCoordinates = function(i, t, r) {
    var n = O(t, !0, !0).multiply(O(i));
    return r ? n.apply(r) : n;
  }, o.register = function(i) {
    if (J = typeof document != "undefined" && document.body, J) {
      A = i, rt(J), ie = A.utils.toArray, Ie = A.core.getStyleSaver;
      var t = A.utils.snap(0.1);
      q = function(n, s) {
        return t(parseFloat(n) + s);
      };
    }
  }, o;
})();
De.version = "3.13.0";
typeof window != "undefined" && window.gsap && window.gsap.registerPlugin(De);
export {
  De as Flip,
  De as default
};
