import { hero as n } from "@universityofmaryland/web-elements-library/composite";
import { Register as c, Lifecycle as u, Attributes as t, Slots as o } from "@universityofmaryland/web-model-library";
import { createSlot as f } from "@universityofmaryland/web-utilities-library/elements";
import { getValidatedSlotImage as p } from "@universityofmaryland/web-utilities-library/validation";
const y = "umd-element-hero", C = (e) => {
  const a = ({ element: d }) => ({
    eyebrow: o.eyebrow.default({ element: d }),
    headline: o.headline.default({ element: d }),
    text: o.text.default({ element: d }),
    video: o.assets.video({ element: d }),
    image: o.assets.image({ element: d }),
    actions: o.actions.default({ element: d })
  }), r = t.isDisplay.overlay({ element: e }), l = t.isDisplay.stacked({ element: e }), s = t.includesFeature.animation({ element: e }), i = t.isTheme.dark({ element: e });
  return r ? n.overlay({
    ...a({ element: e }),
    includesAnimation: s
  }) : l ? n.stacked({
    ...a({ element: e }),
    isHeightSmall: t.isLayout.heightSmall({ element: e }) || !1,
    isWidthLarge: t.isLayout.spaceHorizontalLarge({ element: e }) || !1,
    isThemeDark: i,
    includesAnimation: s,
    topPosition: t.getValue.topPosition({
      element: e
    })
  }) : t.isDisplay.stackedInterior({
    element: e
  }) ? n.stacked({
    ...a({ element: e }),
    isHeightSmall: !0,
    isWidthLarge: !0,
    isThemeDark: i,
    includesAnimation: s
  }) : t.isDisplay.standardCentered({
    element: e
  }) ? n.standard({
    ...a({ element: e }),
    isTextCenter: !0,
    isHeightSmall: !1,
    includesAnimation: s
  }) : t.isDisplay.standardInterior({
    element: e
  }) ? n.standard({
    ...a({ element: e }),
    isHeightSmall: !0,
    isThemeDark: i,
    includesAnimation: s
  }) : t.isDisplay.standardInteriorCentered({
    element: e
  }) ? n.standard({
    ...a({ element: e }),
    isHeightSmall: !0,
    isTextCenter: !0,
    includesAnimation: s
  }) : n.standard({
    ...a({ element: e }),
    isHeightSmall: t.isLayout.heightSmall({ element: e }) || !1,
    isTextCenter: t.isLayout.textCentered({ element: e }) || !1,
    isThemeDark: i,
    includesAnimation: s
  });
}, v = c.webComponent({
  tagName: y,
  createComponent: C,
  afterConnect: u.hooks.loadOnConnect
});
var B = v;
const T = "umd-element-hero-brand-video", b = (e) => {
  const a = e.getAttribute("animation-trigger"), r = e.querySelector("video");
  return n.custom.videoArrow({
    video: r,
    headline: o.headline.default({ element: e }),
    text: o.text.default({ element: e }),
    isAnimationOnLoad: a === "load"
  });
}, S = c.webComponent({
  tagName: T,
  createComponent: b,
  afterConnect: u.hooks.loadOnConnect
});
var W = S;
const k = "umd-element-hero-grid", x = (e) => {
  const a = e.querySelector(
    '[slot="column-left"]'
  ), r = e.querySelector(
    '[slot="column-right"]'
  ), l = e.querySelector(
    '[slot="column-center"]'
  ), s = Array.from(
    a.querySelectorAll("img")
  ), i = Array.from(
    r.querySelectorAll("img")
  ), d = Array.from(
    l.querySelectorAll("img")
  ), m = l.querySelector(
    "video"
  ), h = {
    corners: [
      {
        images: s,
        isCornerLeft: !0
      },
      {
        images: i,
        isCornerLeft: !1
      }
    ],
    center: {
      images: d,
      video: m
    },
    headline: o.headline.default({ element: e }),
    text: o.text.default({ element: e }),
    actions: o.actions.default({ element: e }),
    isThemeDark: t.isTheme.dark({ element: e }) || !1
  }, g = n.custom.grid(h);
  return g || { element: document.createElement("div"), styles: "" };
}, L = c.webComponent({
  tagName: k,
  createComponent: x
});
var Y = L;
const D = "umd-element-hero-expand", w = t.handler.combine(
  t.handler.observe.visuallyPosition({
    callback: (e, a) => e.events?.setTopPosition({ value: a })
  }),
  // Deprecated
  t.handler.observe.visuallyPosition({
    name: t.names.deprecated.layout.LAYOUT_STICKY_TOP,
    callback: (e, a) => e.events?.setTopPosition({ value: a })
  })
), A = (e) => {
  const a = p({
    element: e,
    slotName: o.name.assets.image
  }), r = e.querySelector('[slot="video"]'), l = f(o.name.actions.default), s = f(o.name.ADDITIONAL), i = {
    eyebrow: o.eyebrow.default({ element: e }),
    headline: o.headline.default({ element: e }),
    topPosition: t.getValue.topPosition({ element: e })
  }, d = r instanceof HTMLVideoElement;
  if (a && (i.image = a), d && (i.video = r), !d && r && r.children.length > 0) {
    const m = r.querySelector("video");
    m && (i.video = m);
  }
  return l && (i.actions = l), s && (i.additional = s), n.custom.expand(i);
}, H = c.webComponent({
  tagName: D,
  createComponent: A,
  attributes: w,
  afterConnect: (e) => {
    if (e.element instanceof HTMLElement) {
      const a = t.getValue.topPosition({
        element: e.element
      });
      a && e?.events?.setTopPosition({ value: a });
    }
  }
});
var z = H;
const N = "umd-element-hero-logo", P = (e) => n.logo({
  isThemeDark: t.isTheme.dark({
    element: e
  }),
  isThemeLight: t.isTheme.light({
    element: e
  }),
  isThemeMaryland: t.isTheme.maryland({
    element: e
  }),
  eyebrow: o.eyebrow.default({ element: e }),
  headline: o.headline.default({ element: e }),
  text: o.text.default({ element: e }),
  image: o.assets.image({ element: e }),
  actions: o.actions.default({ element: e })
}), q = c.webComponent({
  tagName: N,
  createComponent: P,
  afterConnect: u.hooks.loadOnConnect
});
var F = q;
const I = "umd-element-hero-minimal", $ = (e) => n.minimal({
  isThemeDark: t.isTheme.dark({
    element: e
  }),
  isThemeLight: t.isTheme.light({
    element: e
  }),
  isThemeMaryland: t.isTheme.maryland({
    element: e
  }),
  eyebrow: o.eyebrow.default({ element: e }),
  headline: o.headline.default({ element: e }),
  text: o.text.default({ element: e }),
  image: o.assets.image({ element: e }),
  actions: o.actions.default({ element: e })
}), O = c.webComponent({
  tagName: I,
  createComponent: $,
  afterConnect: u.hooks.loadOnConnect
});
var G = O;
export {
  B as b,
  z as e,
  Y as g,
  F as l,
  G as m,
  W as v
};
//# sourceMappingURL=minimal-lg-8HdqL.js.map
