import { r as c, L as p, m as u, j as a, ak as x, ap as b, c as l, F as h, H as m } from "./index-6wLGsgHc.js";
const f = /* @__PURE__ */ l("div", {
  target: "e11k5jya2"
})({
  name: "b6wrti",
  styles: "display:flex;flex-direction:column;width:100%"
}), k = /* @__PURE__ */ l("a", {
  target: "e11k5jya1"
})(({
  disabled: t,
  isCurrentPage: o,
  theme: e
}) => ({
  textDecoration: "none",
  width: "100%",
  display: "flex",
  flexDirection: "row",
  alignItems: "center",
  justifyContent: "flex-start",
  gap: e.spacing.sm,
  borderRadius: e.radii.default,
  paddingLeft: e.spacing.sm,
  paddingRight: e.spacing.sm,
  marginTop: e.spacing.threeXS,
  marginBottom: e.spacing.threeXS,
  lineHeight: e.lineHeights.menuItem,
  backgroundColor: o ? e.colors.darkenedBgMix15 : "transparent",
  "&:hover": {
    backgroundColor: o ? e.colors.darkenedBgMix25 : e.colors.darkenedBgMix15
  },
  "&:active,&:visited,&:hover": {
    textDecoration: "none"
  },
  "&:focus": {
    outline: "none"
  },
  "&:focus-visible": {
    backgroundColor: e.colors.darkenedBgMix15
  },
  "@media print": {
    paddingLeft: e.spacing.none
  },
  ...t ? {
    borderColor: e.colors.borderColor,
    backgroundColor: e.colors.transparent,
    color: e.colors.fadedText40,
    cursor: "not-allowed",
    "&:hover": {
      color: e.colors.fadedText40,
      backgroundColor: e.colors.transparent
    }
  } : {}
}), ""), C = /* @__PURE__ */ l("span", {
  target: "e11k5jya0"
})(({
  disabled: t,
  theme: o
}) => ({
  color: o.colors.bodyText,
  overflow: "hidden",
  whiteSpace: "nowrap",
  textOverflow: "ellipsis",
  display: "table-cell",
  ...t ? {
    borderColor: o.colors.borderColor,
    backgroundColor: o.colors.transparent,
    color: o.colors.fadedText40,
    cursor: "not-allowed"
  } : {}
}), "");
function j(t) {
  const {
    onPageChange: o,
    currentPageScriptHash: e
  } = c.useContext(p), {
    colors: s
  } = u(), {
    disabled: n,
    element: r
  } = t, i = e === r.pageScriptHash, g = (d) => {
    r.external ? n && d.preventDefault() : (d.preventDefault(), n || o(r.pageScriptHash));
  };
  return /* @__PURE__ */ a.jsx("div", {
    className: "stPageLink",
    "data-testid": "stPageLink",
    children: /* @__PURE__ */ a.jsx(x, {
      help: r.help,
      placement: b.TOP_RIGHT,
      containerWidth: !0,
      children: /* @__PURE__ */ a.jsx(f, {
        children: /* @__PURE__ */ a.jsxs(k, {
          "data-testid": "stPageLink-NavLink",
          disabled: n,
          isCurrentPage: i,
          href: r.page,
          target: r.external ? "_blank" : "",
          rel: "noreferrer",
          onClick: g,
          children: [r.icon && /* @__PURE__ */ a.jsx(h, {
            size: "lg",
            color: n ? s.fadedText40 : s.bodyText,
            iconValue: r.icon
          }), /* @__PURE__ */ a.jsx(C, {
            disabled: n,
            children: /* @__PURE__ */ a.jsx(m, {
              source: r.label,
              allowHTML: !1,
              isLabel: !0,
              boldLabel: i,
              largerLabel: !0,
              disableLinks: !0
            })
          })]
        })
      })
    })
  });
}
const y = c.memo(j);
export {
  y as default
};
//# sourceMappingURL=index-D5JbiLwX-7DwN5rWO.js.map
