import { an as U, ao as L, ap as j, aq as O, ar as E, as as N, at as R, ae as F, au as P, q as a, N as p, s as M, av as G, r as V, aw as x, ax as K, ay as q, z } from "./index-jYYVpIDL.js";
import { memo as Q, useState as D } from "react";
function W(e, t) {
  var s = -1, n = e.length;
  for (t || (t = Array(n)); ++s < n; )
    t[s] = e[s];
  return t;
}
var Z = W, H = Math.floor, Y = Math.random;
function X(e, t) {
  return e + H(Y() * (t - e + 1));
}
var J = X, B = J;
function ee(e, t) {
  var s = -1, n = e.length, o = n - 1;
  for (t = t === void 0 ? n : t; ++s < t; ) {
    var r = B(s, o), i = e[r];
    e[r] = e[s], e[s] = i;
  }
  return e.length = t, e;
}
var C = ee, re = Z, te = C;
function se(e) {
  return te(re(e));
}
var ae = se, ie = U;
function oe(e, t) {
  return ie(t, function(s) {
    return e[s];
  });
}
var ne = oe;
function le(e, t) {
  for (var s = -1, n = Array(e); ++s < e; )
    n[s] = t(s);
  return n;
}
var ce = le, de = L, me = j, ue = "[object Arguments]";
function pe(e) {
  return me(e) && de(e) == ue;
}
var fe = pe, k = fe, he = j, $ = Object.prototype, ge = $.hasOwnProperty, be = $.propertyIsEnumerable, ve = k(/* @__PURE__ */ function() {
  return arguments;
}()) ? k : function(e) {
  return he(e) && ge.call(e, "callee") && !be.call(e, "callee");
}, ye = ve, v = { exports: {} };
function xe() {
  return !1;
}
var je = xe;
v.exports;
(function(e, t) {
  var s = O, n = je, o = t && !t.nodeType && t, r = o && !0 && e && !e.nodeType && e, i = r && r.exports === o, c = i ? s.Buffer : void 0, d = c ? c.isBuffer : void 0, m = d || n;
  e.exports = m;
})(v, v.exports);
var Te = v.exports, ke = 9007199254740991, we = /^(?:0|[1-9]\d*)$/;
function Ae(e, t) {
  var s = typeof e;
  return t = t ?? ke, !!t && (s == "number" || s != "symbol" && we.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
var Le = Ae, Ne = 9007199254740991;
function Ce(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Ne;
}
var _ = Ce, $e = L, _e = _, Ie = j, Se = "[object Arguments]", Ue = "[object Array]", Oe = "[object Boolean]", Ee = "[object Date]", Re = "[object Error]", Fe = "[object Function]", Pe = "[object Map]", Me = "[object Number]", Ge = "[object Object]", Ve = "[object RegExp]", Ke = "[object Set]", qe = "[object String]", ze = "[object WeakMap]", Qe = "[object ArrayBuffer]", De = "[object DataView]", We = "[object Float32Array]", Ze = "[object Float64Array]", He = "[object Int8Array]", Ye = "[object Int16Array]", Xe = "[object Int32Array]", Je = "[object Uint8Array]", Be = "[object Uint8ClampedArray]", er = "[object Uint16Array]", rr = "[object Uint32Array]", l = {};
l[We] = l[Ze] = l[He] = l[Ye] = l[Xe] = l[Je] = l[Be] = l[er] = l[rr] = !0;
l[Se] = l[Ue] = l[Qe] = l[Oe] = l[De] = l[Ee] = l[Re] = l[Fe] = l[Pe] = l[Me] = l[Ge] = l[Ve] = l[Ke] = l[qe] = l[ze] = !1;
function tr(e) {
  return Ie(e) && _e(e.length) && !!l[$e(e)];
}
var sr = tr;
function ar(e) {
  return function(t) {
    return e(t);
  };
}
var ir = ar, y = { exports: {} };
y.exports;
(function(e, t) {
  var s = E, n = t && !t.nodeType && t, o = n && !0 && e && !e.nodeType && e, r = o && o.exports === n, i = r && s.process, c = function() {
    try {
      var d = o && o.require && o.require("util").types;
      return d || i && i.binding && i.binding("util");
    } catch {
    }
  }();
  e.exports = c;
})(y, y.exports);
var or = y.exports, nr = sr, lr = ir, w = or, A = w && w.isTypedArray, cr = A ? lr(A) : nr, dr = cr, mr = ce, ur = ye, pr = N, fr = Te, hr = Le, gr = dr, br = Object.prototype, vr = br.hasOwnProperty;
function yr(e, t) {
  var s = pr(e), n = !s && ur(e), o = !s && !n && fr(e), r = !s && !n && !o && gr(e), i = s || n || o || r, c = i ? mr(e.length, String) : [], d = c.length;
  for (var m in e)
    (t || vr.call(e, m)) && !(i && // Safari 9 has enumerable `arguments.length` in strict mode.
    (m == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    o && (m == "offset" || m == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    r && (m == "buffer" || m == "byteLength" || m == "byteOffset") || // Skip index properties.
    hr(m, d))) && c.push(m);
  return c;
}
var xr = yr, jr = Object.prototype;
function Tr(e) {
  var t = e && e.constructor, s = typeof t == "function" && t.prototype || jr;
  return e === s;
}
var kr = Tr;
function wr(e, t) {
  return function(s) {
    return e(t(s));
  };
}
var Ar = wr, Lr = Ar, Nr = Lr(Object.keys, Object), Cr = Nr, $r = kr, _r = Cr, Ir = Object.prototype, Sr = Ir.hasOwnProperty;
function Ur(e) {
  if (!$r(e))
    return _r(e);
  var t = [];
  for (var s in Object(e))
    Sr.call(e, s) && s != "constructor" && t.push(s);
  return t;
}
var Or = Ur, Er = R, Rr = _;
function Fr(e) {
  return e != null && Rr(e.length) && !Er(e);
}
var Pr = Fr, Mr = xr, Gr = Or, Vr = Pr;
function Kr(e) {
  return Vr(e) ? Mr(e) : Gr(e);
}
var qr = Kr, zr = ne, Qr = qr;
function Dr(e) {
  return e == null ? [] : zr(e, Qr(e));
}
var Wr = Dr, Zr = C, Hr = Wr;
function Yr(e) {
  return Zr(Hr(e));
}
var Xr = Yr, Jr = ae, Br = Xr, et = N;
function rt(e) {
  var t = et(e) ? Jr : Br;
  return t(e);
}
var tt = rt;
const st = /* @__PURE__ */ F(tt), g = G("", {
  // Variants won't have any style by default. Style will only be applied if the variants are combined.
  // So, style is defined in compoundVariants.
  variants: {
    variant: {
      basic: "",
      ProfileCard: "",
      SidebarCard: ""
    },
    structure: {
      image: "",
      card: "",
      title: "",
      description: ""
    }
  },
  compoundVariants: [
    // Style for Basic Variants types
    {
      variant: "basic",
      structure: "image",
      className: "w-10 h-auto"
    },
    {
      variant: "basic",
      structure: "card",
      className: "p-5"
    },
    {
      variant: "basic",
      structure: "title",
      className: "text-base mt-4"
    },
    {
      variant: "basic",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for ProfileCard Variant Types
    {
      variant: "ProfileCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "ProfileCard",
      structure: "card",
      className: "w-80 p-4 hover:bg-subtle"
    },
    {
      variant: "ProfileCard",
      structure: "title",
      className: "text-base"
    },
    {
      variant: "ProfileCard",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for SidebarCard Variant Types
    {
      variant: "SidebarCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "SidebarCard",
      structure: "card",
      className: "w-full p-3 border border-subtle"
    },
    {
      variant: "SidebarCard",
      structure: "title",
      className: "text-sm font-cal"
    },
    {
      variant: "SidebarCard",
      structure: "description",
      className: "text-xs text-default line-clamp-2"
    }
  ]
});
function at({
  image: e,
  title: t,
  icon: s,
  description: n,
  variant: o,
  actionButton: r,
  containerProps: i,
  imageProps: c,
  mediaLink: d,
  thumbnailUrl: m,
  learnMore: u
}) {
  const f = u && u.href.startsWith("https") ? "a" : P;
  return /* @__PURE__ */ a.jsxs(
    "div",
    {
      className: p(
        i == null ? void 0 : i.className,
        g({ variant: o, structure: "card" }),
        "bg-default border-subtle text-default flex flex-col justify-between rounded-md border"
      ),
      "data-testid": "card-container",
      ...i,
      children: [
        /* @__PURE__ */ a.jsxs("div", { children: [
          s && s,
          e && /* @__PURE__ */ a.jsx(
            "img",
            {
              src: e,
              alt: c == null ? void 0 : c.alt,
              className: p(
                c == null ? void 0 : c.className,
                g({ variant: o, structure: "image" })
              ),
              ...c
            }
          ),
          /* @__PURE__ */ a.jsx(
            "h5",
            {
              title: t,
              className: p(
                g({ variant: o, structure: "title" }),
                "text-emphasis line-clamp-1 font-bold leading-5"
              ),
              children: t
            }
          ),
          n && /* @__PURE__ */ a.jsx(
            "p",
            {
              title: n.toString(),
              className: p(g({ variant: o, structure: "description" }), "pt-1"),
              children: n
            }
          )
        ] }),
        o === "SidebarCard" && /* @__PURE__ */ a.jsxs(
          "a",
          {
            onClick: r == null ? void 0 : r.onClick,
            target: "_blank",
            rel: "noreferrer",
            href: d,
            "data-testid": r == null ? void 0 : r["data-testid"],
            className: "group relative my-3 flex aspect-video items-center overflow-hidden rounded",
            children: [
              /* @__PURE__ */ a.jsx("div", { className: "absolute inset-0 bg-black bg-opacity-50 transition group-hover:bg-opacity-40" }),
              /* @__PURE__ */ a.jsxs(
                "svg",
                {
                  className: "text-inverted absolute left-1/2 top-1/2 h-8 w-8 -translate-x-1/2 -translate-y-1/2 transform rounded-full shadow-lg transition-all hover:-mt-px",
                  viewBox: "0 0 32 32",
                  fill: "none",
                  xmlns: "http://www.w3.org/2000/svg",
                  children: [
                    /* @__PURE__ */ a.jsx(
                      "path",
                      {
                        d: "M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",
                        fill: "white"
                      }
                    ),
                    /* @__PURE__ */ a.jsx(
                      "path",
                      {
                        d: "M12.1667 8.5L23.8334 16L12.1667 23.5V8.5Z",
                        fill: "#111827",
                        stroke: "#111827",
                        strokeWidth: "1.5",
                        strokeLinecap: "round",
                        strokeLinejoin: "round"
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ a.jsx("img", { alt: "play feature video", src: m })
            ]
          }
        ),
        o === "basic" && r && /* @__PURE__ */ a.jsx("div", { children: /* @__PURE__ */ a.jsx(
          M,
          {
            color: "secondary",
            href: r == null ? void 0 : r.href,
            className: "mt-10",
            EndIcon: "arrow-right",
            "data-testid": r["data-testid"],
            children: r == null ? void 0 : r.child
          }
        ) }),
        o === "SidebarCard" && /* @__PURE__ */ a.jsxs("div", { className: "mt-2 flex items-center justify-between", children: [
          u && /* @__PURE__ */ a.jsx(
            f,
            {
              href: u.href,
              onClick: r == null ? void 0 : r.onClick,
              target: "_blank",
              rel: "noreferrer",
              className: "text-default text-xs font-medium",
              children: u.text
            }
          ),
          (r == null ? void 0 : r.child) && /* @__PURE__ */ a.jsx(
            "button",
            {
              className: "text-default hover:text-emphasis p-0 text-xs font-normal",
              color: "minimal",
              "data-testid": r == null ? void 0 : r["data-testid"],
              onClick: r == null ? void 0 : r.onClick,
              children: r == null ? void 0 : r.child
            }
          )
        ] })
      ]
    }
  );
}
const it = [
  {
    id: 17,
    thumbnailUrl: "https://img.youtube.com/vi/fMHW6jYPIb8/0.jpg",
    mediaLink: "https://go.cal.com/embed-video",
    title: "Embed",
    description: "Embed your booking page on your website",
    href: "https://go.cal.com/embed-video"
  },
  {
    id: 16,
    thumbnailUrl: "https://img.youtube.com/vi/xopxmk2H4Ng/0.jpg",
    mediaLink: "https://go.cal.com/paid-booking",
    title: "Paid Bookings",
    description: "Charge for your time with Cal.com's paid bookings",
    href: "https://go.cal.com/paid-booking"
  },
  {
    id: 15,
    thumbnailUrl: "https://img.youtube.com/vi/ZjSD1yPgLLQ/0.jpg",
    mediaLink: "https://go.cal.com/instant-meetings-video",
    title: "Instant Meetings",
    description: "Book meetings instantly with a link",
    href: "https://go.cal.com/instant-meetings-video"
  },
  {
    id: 14,
    thumbnailUrl: "https://img.youtube.com/vi/IZ4-nUiIpvY/0.jpg",
    mediaLink: "https://go.cal.com/custom-attributes",
    title: "Custom Attributes",
    description: "Define roles and attributes for your teams",
    href: "https://go.cal.com/custom-attributes"
  },
  {
    id: 13,
    thumbnailUrl: "https://img.youtube.com/vi/TTAASLLPKk0/0.jpg",
    mediaLink: "https://go.cal.com/ooo-video",
    title: "ooo.new",
    description: "Easily go out-of-office",
    href: "https://go.cal.com/ooo-video"
  },
  {
    id: 12,
    thumbnailUrl: "https://cal.com/og-image-cal-ai.jpg",
    mediaLink: "https://go.cal.com/cal-ai",
    title: "Cal.ai",
    description: "Your personal AI scheduling assistant",
    href: "https://go.cal.com/cal-ai"
  },
  {
    id: 11,
    thumbnailUrl: "https://img.youtube.com/vi/KTg_qzA9NEc/0.jpg",
    mediaLink: "https://go.cal.com/insights",
    title: "Insights",
    description: "Get a better understanding of your business",
    href: "https://go.cal.com/insights"
  },
  {
    id: 10,
    thumbnailUrl: "https://img.youtube.com/vi/jvaBafzVUQc/0.jpg",
    mediaLink: "https://go.cal.com/video",
    title: "Cal Video",
    description: "Free video conferencing with recording",
    href: "https://go.cal.com/video"
  },
  {
    id: 9,
    thumbnailUrl: "https://img.youtube.com/vi/93iOmzHieCU/0.jpg",
    mediaLink: "https://go.cal.com/round-robin",
    title: "Round-Robin",
    description: "Create advanced group meetings with round-robin",
    href: "https://go.cal.com/round-robin"
  },
  {
    id: 8,
    thumbnailUrl: "https://img.youtube.com/vi/piKlAiibAFo/0.jpg",
    mediaLink: "https://go.cal.com/workflows",
    title: "Automate Workflows",
    description: "Make time work for you and automate tasks",
    href: "https://go.cal.com/workflows"
  },
  {
    id: 7,
    thumbnailUrl: "https://img.youtube.com/vi/UVXgo12cY4g/0.jpg",
    mediaLink: "https://go.cal.com/routing-forms",
    title: "Routing Forms",
    description: "Ask questions and route to the correct person",
    href: "https://go.cal.com/routing-forms"
  },
  {
    id: 6,
    thumbnailUrl: "https://img.youtube.com/vi/yGiZo1Ry5-8/0.jpg",
    mediaLink: "https://go.cal.com/recurring-video",
    title: "Recurring Bookings",
    description: "Learn how to create a recurring schedule",
    href: "https://go.cal.com/recurring-video"
  },
  {
    id: 5,
    thumbnailUrl: "https://img.youtube.com/vi/0v_nQtpxC_4/0.jpg",
    mediaLink: "https://go.cal.com/payments-video",
    title: "Accept Payments",
    description: "Charge for your time with Cal.com's Stripe App",
    href: "https://app.cal.com/apps/stripe"
  },
  {
    id: 4,
    thumbnailUrl: "https://img.youtube.com/vi/zGr_s-fG84k/0.jpg",
    mediaLink: "https://go.cal.com/confirmation-video",
    title: "Requires Confirmation",
    description: "Learn how to be in charge of your bookings",
    href: "https://cal.com/resources/feature/opt-in"
  },
  {
    id: 3,
    thumbnailUrl: "https://img.youtube.com/vi/-L8MCiT6uhQ/0.jpg",
    mediaLink: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl",
    title: "Routing Forms, Workflows",
    description: "Ask screening questions of potential bookers to connect them with the right person",
    href: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl"
  },
  {
    id: 2,
    thumbnailUrl: "https://img.youtube.com/vi/EAc46SPL6iA/0.jpg",
    mediaLink: "https://go.cal.com/teams-video",
    title: "How to set up Teams",
    description: "Learn how to use round-robin and collective events.",
    href: "https://cal.com/docs/enterprise-features/teams"
  },
  {
    id: 1,
    thumbnailUrl: "https://img.youtube.com/vi/VZ5PfQzzxBw/0.jpg",
    mediaLink: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a",
    title: "Dynamic booking links",
    description: "Booking link that allows people to quickly schedule meetings.",
    href: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a"
  }
], b = st(it).slice(0).reverse();
function ot() {
  const { t: e } = V(), [t, s] = D(() => {
    if (typeof window > "u")
      return b;
    try {
      const r = x.getItem("removedTipsIds");
      if (r !== null) {
        const i = r.split(",").map((d) => parseInt(d, 10));
        return b.filter((d) => i.indexOf(d.id) === -1);
      } else
        return b;
    } catch {
      return b;
    }
  }), n = (r) => {
    s((i) => {
      const c = x.getItem("removedTipsIds") || "", d = i.findIndex((m) => m.id === r);
      return d === -1 ? [...i] : (x.setItem(
        "removedTipsIds",
        `${i[d].id.toString()}${c.length > 0 ? `,${c}` : ""}`
      ), i.splice(d, 1), [...i]);
    });
  }, o = t.slice(0).reverse();
  return /* @__PURE__ */ a.jsx(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: t.map((r) => {
        const i = o.indexOf(r) === 0;
        return /* @__PURE__ */ a.jsx(
          "div",
          {
            className: "relative",
            style: {
              gridRowStart: 1,
              gridColumnStart: 1
            },
            children: /* @__PURE__ */ a.jsx(
              "div",
              {
                className: "relative",
                style: {
                  transform: `scale(${1 - o.indexOf(r) / 20})`,
                  top: -o.indexOf(r) * 10,
                  opacity: `${1 - o.indexOf(r) / 7}`
                },
                children: /* @__PURE__ */ a.jsx(
                  at,
                  {
                    variant: "SidebarCard",
                    thumbnailUrl: r.thumbnailUrl,
                    mediaLink: i ? r.mediaLink : void 0,
                    title: r.title,
                    description: r.description,
                    learnMore: i ? { href: r.href, text: e("learn_more") } : void 0,
                    actionButton: i ? { onClick: () => n(r.id), child: e("dismiss") } : void 0,
                    containerProps: {
                      tabIndex: i ? void 0 : -1,
                      "aria-hidden": i ? void 0 : "true"
                    }
                  }
                )
              }
            )
          },
          r.id
        );
      })
    }
  );
}
const ct = Q(ot);
function dt({
  title: e,
  description: t,
  background: s,
  features: n,
  buttons: o,
  isParentLoading: r,
  children: i,
  plan: c
}) {
  const { resolvedTheme: d } = K(), { isPending: m, hasTeamPlan: u } = q(), { data: f } = z.viewer.teams.getUpgradeable.useQuery(), T = `${s}${d === "dark" ? "-dark" : ""}.jpg`, I = !1, S = !!(f != null && f[0]);
  return c === "team" && (u || S) ? /* @__PURE__ */ a.jsx(a.Fragment, { children: i }) : c === "enterprise" && I ? /* @__PURE__ */ a.jsx(a.Fragment, { children: i }) : m ? /* @__PURE__ */ a.jsx(a.Fragment, { children: r }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
    /* @__PURE__ */ a.jsxs("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ a.jsxs("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ a.jsx("source", { srcSet: T, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ a.jsx(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: T,
            loading: "lazy",
            alt: e
          }
        )
      ] }),
      /* @__PURE__ */ a.jsxs("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ a.jsx("h1", { className: p("font-cal mt-4 text-3xl"), children: e }),
        /* @__PURE__ */ a.jsx("p", { className: p("mb-8 mt-4 max-w-sm"), children: t }),
        o
      ] })
    ] }),
    /* @__PURE__ */ a.jsx("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: n.map((h) => /* @__PURE__ */ a.jsxs("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      h.icon,
      /* @__PURE__ */ a.jsx("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: h.title }),
      /* @__PURE__ */ a.jsx("p", { className: "text-default", children: h.description })
    ] }, h.title)) })
  ] });
}
export {
  ct as Tips,
  dt as UpgradeTip
};
