"use client";
import * as AccordionPrimitive from '@radix-ui/react-accordion';
import { Loader2, ChevronDown, SunMedium, Moon, ArrowUpRight, Menu } from 'lucide-react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import * as React4 from 'react';
import React4__default, { useState, useEffect, useLayoutEffect } from 'react';
import Image2 from 'next/image';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
import Link from 'next/link';
import { useInView } from 'react-intersection-observer';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};

// blocks/def/space-block.ts
var SPACE_DEFAULTS = {
  xs: 2,
  sm: 4,
  md: 5,
  lg: 6,
  xl: 8
};
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
__name(cn, "cn");
var Accordion = AccordionPrimitive.Root;
var AccordionItem = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, { className: cn("", className), ref, ...props }), "AccordionItem");
AccordionItem.displayName = "AccordionItem";
var AccordionTrigger = /* @__PURE__ */ __name(({
  className,
  children,
  hideArrow = false,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
  AccordionPrimitive.Trigger,
  {
    className: cn(
      "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
      className
    ),
    ref,
    ...props,
    children: [
      children,
      hideArrow ? null : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
    ]
  }
) }), "AccordionTrigger");
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
var AccordionContent = /* @__PURE__ */ __name(({
  className,
  children,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AccordionPrimitive.Content,
  {
    className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down w-full overflow-hidden text-sm transition-all",
    ref,
    ...props,
    children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
  }
), "AccordionContent");
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
var Card = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(
  "div",
  {
    className: cn(
      "bg-card text-card-foreground rounded-lg border shadow-xs",
      className
    ),
    ref,
    ...props
  }
), "Card");
Card.displayName = "Card";
var CardHeader = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(
  "div",
  {
    className: cn("flex flex-col space-y-1.5 p-6", className),
    ref,
    ...props
  }
), "CardHeader");
CardHeader.displayName = "CardHeader";
var CardTitle = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(
  "h3",
  {
    className: cn(
      "text-2xl leading-none font-semibold tracking-tight",
      className
    ),
    ref,
    ...props
  }
), "CardTitle");
CardTitle.displayName = "CardTitle";
var CardDescription = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  "p",
  {
    className: cn("text-text-secondary text-sm", className),
    ref,
    ...props
  }
), "CardDescription");
CardDescription.displayName = "CardDescription";
var CardContent = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("p-6 pt-0", className), ref, ...props }), "CardContent");
CardContent.displayName = "CardContent";
var CardFooter = /* @__PURE__ */ __name(({ className, ref, ...props }) => /* @__PURE__ */ jsx(
  "div",
  {
    className: cn("flex items-center p-6 pt-0", className),
    ref,
    ...props
  }
), "CardFooter");
CardFooter.displayName = "CardFooter";

// util/specifier.ts
var getPrimaryStartingWith = /* @__PURE__ */ __name((s, toFind) => {
  const tokenArray = s.split(" ");
  return tokenArray.find((tok) => tok.startsWith(`${toFind}-`));
}, "getPrimaryStartingWith");
function getSpecifierData(main, getPrimary, getData, def) {
  const primary = getPrimary(main);
  if (primary) {
    return getData(primary) ?? def;
  }
  return def ?? void 0;
}
__name(getSpecifierData, "getSpecifierData");

// util/index.ts
function constrain(value, minOrConstrainTo, max) {
  if (typeof value === "number" && typeof minOrConstrainTo === "number" && typeof max === "number") {
    return Math.min(Math.max(value, minOrConstrainTo), max);
  }
  if (typeof value === "object" && typeof minOrConstrainTo === "object") {
    const dim = value;
    const constrainTo = minOrConstrainTo;
    const aspectRatio = dim.w / dim.h;
    const constrainAspectRatio = constrainTo.w / constrainTo.h;
    if (aspectRatio > constrainAspectRatio) {
      return {
        w: constrainTo.w,
        h: constrainTo.w / aspectRatio
      };
    } else {
      return {
        w: constrainTo.h * aspectRatio,
        h: constrainTo.h
      };
    }
  }
  throw new Error("Invalid parameters for constrain function");
}
__name(constrain, "constrain");
function containsToken(text, token) {
  if (!text) return false;
  return text.toLowerCase().includes(token.toLowerCase());
}
__name(containsToken, "containsToken");
function ldMerge(...objects) {
  const result = {};
  for (const obj of objects) {
    if (obj && typeof obj === "object") {
      Object.assign(result, obj);
    }
  }
  return result;
}
__name(ldMerge, "ldMerge");
var ApplyTypography = /* @__PURE__ */ __name(({
  children,
  className = "",
  asTag = "div",
  size = "responsive",
  ...rest
}) => {
  let typoClasses = "typography gap-3 xs:typography-sm sm:typography sm:gap-4 lg:typography-lg lg:gap-5 xl:typography-xl xl:gap-6 typography-headings:font-heading ";
  switch (size) {
    case "sm":
      {
        typoClasses = "typography typography-sm gap-3 typography-headings:font-heading typography-p:text-sm ";
      }
      break;
    case "base":
      {
        typoClasses = "typography gap-4 typography-headings:font-heading ";
      }
      break;
    case "lg":
      {
        typoClasses = "typography typography-lg gap-5 typography-headings:font-heading typography-p:text-lg ";
      }
      break;
    case "xl":
      {
        typoClasses = "typography typography-xl gap-6 typography-headings:font-heading typography-p:text-lg ";
      }
      break;
  }
  const Tag = asTag;
  return /* @__PURE__ */ jsx(Tag, { ...rest, className: cn(typoClasses, className), children });
}, "ApplyTypography");
var VideoPlayer = React4__default.forwardRef(
  ({
    sources,
    ...rest
  }, ref) => {
    return /* @__PURE__ */ jsx("video", { ref, ...rest, children: sources.map((source, index) => /* @__PURE__ */ jsx("source", { src: source }, index)) });
  }
);
var video_player_default = VideoPlayer;
var AccordianBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = ""
}) => {
  if (block.blockType !== "accordian") {
    return /* @__PURE__ */ jsx(Fragment, { children: "accordian block required" });
  }
  const accordian = block;
  return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, className: cn("w-full border rounded-xl overflow-hidden", className), children: accordian.items.map((item, index) => /* @__PURE__ */ jsxs(AccordionItem, { className: "border-b last:border-0 overflow-hidden", value: `value-${index}`, children: [
    /* @__PURE__ */ jsx(AccordionTrigger, { className: "px-3 md:px-4 lg:px-6 hover:no-underline hover:bg-level-3", children: /* @__PURE__ */ jsx(ApplyTypography, { children: /* @__PURE__ */ jsx("h6", { className: "leading-[1.2] text-[1.05rem] font-semibold ", children: item.trigger }) }) }),
    /* @__PURE__ */ jsx(AccordionContent, { className: "p-4 border-t bg-level-1", children: /* @__PURE__ */ jsx(ApplyTypography, { className: "flex flex-col justify-start items-start ", children: typeof item.content === "string" ? /* @__PURE__ */ jsx("p", { children: item.content }) : item.content }) })
  ] }, index)) });
}, "AccordianBlockComponent");
var accordian_block_default = AccordianBlockComponent;
var InlineIcon = /* @__PURE__ */ __name(({
  icon,
  size,
  agent,
  className = ""
}) => {
  if (!icon) return null;
  const phone = agent === "phone";
  if (typeof icon === "string") {
    const _size = phone && size ? size * 0.75 : size;
    return /* @__PURE__ */ jsx(Image2, { src: icon, width: _size, height: _size, alt: "icon", className });
  }
  return /* @__PURE__ */ jsx("div", { className, children: icon });
}, "InlineIcon");
var inline_icon_default = InlineIcon;

// blocks/components/grid-block/table-borders.mutator.ts
var getCellClx = /* @__PURE__ */ __name((cellIndex, cellCount, colCount) => {
  const isFirstRow = /* @__PURE__ */ __name(() => cellIndex < colCount, "isFirstRow");
  const isFirstColumn = /* @__PURE__ */ __name(() => cellIndex % colCount === 0, "isFirstColumn");
  const isTLCorner = /* @__PURE__ */ __name(() => cellIndex === 0, "isTLCorner");
  const isTRCorner = /* @__PURE__ */ __name(() => cellIndex === colCount - 1, "isTRCorner");
  const isBLCorner = /* @__PURE__ */ __name(() => cellIndex === cellCount - colCount, "isBLCorner");
  const isBRCorner = /* @__PURE__ */ __name(() => cellIndex === cellCount - 1, "isBRCorner");
  let clx = "border-b md:border-r p-4 md:p-8 lg:p-12 ";
  if (isFirstRow()) {
    clx += "border-t ";
  }
  if (isFirstColumn()) {
    clx += "md:border-l ";
  }
  if (isTLCorner()) {
    clx += "border-t md:rounded-tl-lg ";
  } else if (isTRCorner()) {
    clx += "md:rounded-tr-lg ";
  } else if (isBLCorner()) {
    clx += "md:rounded-bl-lg ";
  } else if (isBRCorner()) {
    clx += "md:rounded-br-lg ";
  }
  return clx;
}, "getCellClx");
var gapClx = "gap-0 md:gap-0 xl:gap-0";
var table_borders_mutator_default = {
  getCellClx,
  gapClx
};

// blocks/components/grid-block/mutator-registry.ts
var map = /* @__PURE__ */ new Map();
map.set("style-table-borders", table_borders_mutator_default);
var mutator_registry_default = /* @__PURE__ */ __name((key) => map.get(key), "default");
var gridClx = /* @__PURE__ */ __name((d, prefix) => typeof d === "number" ? `${prefix ?? ""}grid-cols-${d} ` : `${prefix ?? ""}grid-cols-${d.columns} ${prefix ?? ""}gap-${d.gap} `, "gridClx");
var GridBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent,
  children
}) => {
  if (block.blockType !== "grid") {
    return /* @__PURE__ */ jsx(Fragment, { children: "grid block required" });
  }
  const { cells, grid, specifiers } = block;
  const specified = /* @__PURE__ */ __name((s) => containsToken(specifiers, s), "specified");
  const mutator = specified("style-table-borders") ? mutator_registry_default("style-table-borders") : void 0;
  let clx = "grid ";
  if (agent === "phone") {
    const d = grid.mobile ? grid.mobile : grid.at.xs ? grid.at.xs : grid.at.sm ?? 1;
    clx += gridClx(d);
  } else {
    let defaultSet = false;
    for (const [key, value] of Object.entries(grid.at)) {
      if (!defaultSet) {
        clx += gridClx(value);
        defaultSet = true;
      } else {
        clx += gridClx(value, `${key}:`);
      }
    }
  }
  let getMutatorCellClx = /* @__PURE__ */ __name((ignore) => "", "getMutatorCellClx");
  if (mutator?.getCellClx) {
    const colCount = typeof grid.at.md === "number" ? grid.at.md : grid.at.md.columns;
    const cellCount = cells?.length;
    if (!colCount || !cellCount) {
      throw new Error("GridBlockComponent: using mutator, but colCount and / or cellCount is invalid!");
    }
    getMutatorCellClx = /* @__PURE__ */ __name((cellIndex) => mutator.getCellClx(cellIndex, cellCount, colCount), "getMutatorCellClx");
  }
  return /* @__PURE__ */ jsx("div", { className: cn("grid gap-2 md:gap-4 xl:gap-6", clx, mutator?.gapClx ?? "", className), children: React4__default.Children.count(children) > 0 ? children : cells?.map((cell, index) => /* @__PURE__ */ jsx(ContentComponent, { blocks: cell, agent, className: getMutatorCellClx(index) }, `cell-${index}`)) });
}, "GridBlockComponent");
var grid_block_default = GridBlockComponent;
var BulletCardsBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent
}) => {
  if (block.blockType !== "bullet-cards") {
    return /* @__PURE__ */ jsx(Fragment, { children: "bullet cards block required" });
  }
  const b = block;
  const specified = /* @__PURE__ */ __name((s) => containsToken(b.specifiers, s), "specified");
  const noBorder = specified("no-card-border") ? "border-0" : "md:border";
  const mobileTextXs = specified("mobile-small-text") ? "text-xs" : "text-sm";
  const borderclx = specified("border-muted-3") ? "md:border-muted-3" : specified("border-muted-1") ? "md:border-muted-1" : "md:border-muted-2";
  return /* @__PURE__ */ jsx(grid_block_default, { block: { blockType: "grid", grid: b.grid }, className, agent, children: b.cards.map((card, index) => /* @__PURE__ */ jsxs("div", { className: cn(
    "px-0 sm:px-4 py-1 md:py-4 rounded-lg flex flex-row justify-start items-center not-typography text-foreground",
    noBorder,
    borderclx
  ), children: [
    /* @__PURE__ */ jsx(inline_icon_default, { icon: card.icon, size: b.iconSize ?? 28, agent, className: "shrink-0 mr-2 md:mr-4 " }),
    /* @__PURE__ */ jsx("p", { className: cn("m-0 sm:text-base", mobileTextXs), children: card.text })
  ] }, index)) });
}, "BulletCardsBlockComponent");
var bullet_cards_block_default = BulletCardsBlockComponent;
var buttonVariants = cva(
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
        outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline",
        // Keep the additional Hanzo variants for backward compatibility
        primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        linkFG: "text-primary underline-offset-4 hover:underline",
        linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
      },
      size: {
        default: "h-9 px-4 py-2",
        sm: "h-8 rounded-md px-3 text-xs",
        lg: "h-10 rounded-md px-8",
        icon: "h-9 w-9"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default"
    }
  }
);
var Button = React4.forwardRef(
  ({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
    const Comp = asChild ? Slot : "button";
    return /* @__PURE__ */ jsxs(
      Comp,
      {
        className: cn(buttonVariants({ variant, size, className })),
        ref,
        ...props,
        children: [
          isLoading ? /* @__PURE__ */ jsx(
            Loader2,
            {
              className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
            }
          ) : null,
          isLoading && size === "icon" ? null : children
        ]
      }
    );
  }
);
Button.displayName = "Button";
var DialogVideoController = /* @__PURE__ */ __name(({
  children
}) => {
  const [open, setOpen] = useState(false);
  const onOpenChange = /* @__PURE__ */ __name((b) => {
    setOpen(b);
    const videos = document.getElementsByTagName("video");
    const videoArray = Array.from(videos);
    videoArray.forEach((v) => {
      if (b) {
        v.pause();
      } else {
        v.play();
      }
    });
  }, "onOpenChange");
  const updatedChildren = React4__default.Children.map(
    children,
    (child) => React4__default.cloneElement(
      child,
      { open, onOpenChange }
    )
  );
  return /* @__PURE__ */ jsx(Fragment, { children: updatedChildren });
}, "DialogVideoController");
var dialog_video_controller_default = DialogVideoController;
var ActionButton = /* @__PURE__ */ __name(({
  def,
  className = "",
  ...rest
}) => {
  if (def.action.type === "modal") {
    const m = def.action.def;
    const Modal = m.Comp;
    return /* @__PURE__ */ jsx(dialog_video_controller_default, { children: /* @__PURE__ */ jsx(
      Modal,
      {
        title: m.title,
        byline: m.byline,
        buttonText: def.text,
        buttonProps: { ...def.props, ...rest, className: cn(def.props?.className ?? "", className) },
        action: m.action,
        actionEnclosure: m.actionEnclosure,
        ...m.props
      }
    ) });
  }
  return /* @__PURE__ */ jsx(Fragment, {});
}, "ActionButton");
var action_button_default = ActionButton;

// primitives/icons/index.ts
var icons_exports = {};
__export(icons_exports, {
  burger: () => Menu,
  gitHub: () => github_default,
  linkOut: () => ArrowUpRight,
  moon: () => Moon,
  sun: () => SunMedium,
  youtube: () => youtube_logo_default
});
var YouTubeLogo = /* @__PURE__ */ __name((props) => /* @__PURE__ */ jsx(
  "svg",
  {
    viewBox: "0 0 256 256",
    xmlns: "http://www.w3.org/2000/svg",
    ...props,
    children: /* @__PURE__ */ jsxs(
      "g",
      {
        style: {
          stroke: "none",
          strokeWidth: 0,
          strokeDasharray: "none",
          strokeLinecap: "butt",
          strokeLinejoin: "miter",
          strokeMiterlimit: 10,
          fill: "none",
          fillRule: "nonzero",
          opacity: 1
        },
        transform: "translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)",
        children: [
          /* @__PURE__ */ jsx(
            "path",
            {
              d: "M 88.119 23.338 c -1.035 -3.872 -4.085 -6.922 -7.957 -7.957 C 73.144 13.5 45 13.5 45 13.5 s -28.144 0 -35.162 1.881 c -3.872 1.035 -6.922 4.085 -7.957 7.957 C 0 30.356 0 45 0 45 s 0 14.644 1.881 21.662 c 1.035 3.872 4.085 6.922 7.957 7.957 C 16.856 76.5 45 76.5 45 76.5 s 28.144 0 35.162 -1.881 c 3.872 -1.035 6.922 -4.085 7.957 -7.957 C 90 59.644 90 45 90 45 S 90 30.356 88.119 23.338 z",
              style: {
                stroke: "none",
                strokeWidth: 1,
                strokeDasharray: "none",
                strokeLinecap: "butt",
                strokeLinejoin: "miter",
                strokeMiterlimit: 10,
                fill: "red",
                fillRule: "nonzero",
                opacity: 1
              },
              transform: " matrix(1 0 0 1 0 0) ",
              strokeLinecap: "round"
            }
          ),
          /* @__PURE__ */ jsx(
            "polygon",
            {
              points: "36,58.5 59.38,45 36,31.5 ",
              style: {
                stroke: "none",
                strokeWidth: 1,
                strokeDasharray: "none",
                strokeLinecap: "butt",
                strokeLinejoin: "miter",
                strokeMiterlimit: 10,
                fill: "white",
                fillRule: "nonzero",
                opacity: 1
              },
              transform: "matrix(1 0 0 1 0 0)"
            }
          )
        ]
      }
    )
  }
), "YouTubeLogo");
var youtube_logo_default = YouTubeLogo;
var GitHub = /* @__PURE__ */ __name((props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 438.549 438.549", ...props, children: /* @__PURE__ */ jsx(
  "path",
  {
    fill: "currentColor",
    d: "M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
  }
) }), "GitHub");
var github_default = GitHub;
var LinkElement = /* @__PURE__ */ __name(({
  def,
  // DO NOT provide a default to any of the props that also appear in def!
  onClick,
  size,
  variant,
  icon,
  iconAfter,
  className = "",
  children
}) => {
  const {
    href,
    newTab,
    variant: defVariant,
    size: defSize,
    title
  } = def;
  const linkProps = {};
  if (href.startsWith("http") || href.startsWith("mailto")) {
    linkProps.rel = "noreferrer noopener";
    if (newTab ?? true) {
      linkProps.target = "_blank";
    }
  } else if (newTab) {
    linkProps.target = "_blank";
  }
  const toSpread = {
    href,
    ...onClick ? { onClick } : {},
    ...linkProps
  };
  const Contents = /* @__PURE__ */ __name(() => {
    if (React4__default.Children.count(children) > 0) return children;
    const _icon = icon ? icon : def.icon ? def.icon : void 0;
    const _iconAfter = iconAfter ? iconAfter : def.iconAfter ? def.iconAfter : false;
    return /* @__PURE__ */ jsxs(Fragment, { children: [
      _icon && !_iconAfter && /* @__PURE__ */ jsx("div", { className: "pr-1", children: _icon }),
      title && /* @__PURE__ */ jsx("div", { children: title }),
      _icon && _iconAfter && /* @__PURE__ */ jsx("div", { className: "pl-1", children: _icon })
    ] });
  }, "Contents");
  return /* @__PURE__ */ jsx(
    Link,
    {
      className: cn(
        buttonVariants({
          variant: variant ? variant : defVariant ? defVariant : "link",
          size: size ? size : defSize || "default"
        }),
        // This is a "label only" LinkDef.  cf: footer"
        href.length > 0 || onClick ? "" : "pointer-events-none",
        className
      ),
      ...toSpread,
      children: /* @__PURE__ */ jsx(Contents, {})
    }
  );
}, "LinkElement");
var link_element_default = LinkElement;
var CtaBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  // assigned to each item
  itemClasses = "",
  itemSize,
  // do not provide default.  this is an override to the def
  renderLink,
  renderButton,
  agent
}) => {
  if (block.blockType !== "cta") {
    return /* @__PURE__ */ jsx(Fragment, { children: "cta block required" });
  }
  const { elements, specifiers } = block;
  let wrapperClasses = "";
  let itemclx = "";
  if (containsToken(specifiers, "fill")) {
    wrapperClasses += "w-full ";
    itemclx += "grow shrink !min-w-0";
  } else if (containsToken(specifiers, "left")) {
    wrapperClasses += "md:justify-start ";
  } else if (containsToken(specifiers, "right")) {
    wrapperClasses += "md:justify-end ";
  } else {
    wrapperClasses += "md:justify-center ";
  }
  const mobile2Columns = containsToken(specifiers, "mobile-2-columns");
  const fillEvenly = !containsToken(specifiers, "desktop-dont-fill");
  const mobileCenterFirstIfOdd = containsToken(specifiers, "mobile-center-first-if-odd");
  const mobileOddFullWidth = containsToken(specifiers, "mobile-odd-full-width");
  let layoutclx = void 0;
  if (elements.length > 1) {
    let resetMinWidth = false;
    if (mobile2Columns) {
      layoutclx = "grid grid-cols-2 gap-2 self-stretch ";
      resetMinWidth = true;
    }
    if (fillEvenly) {
      layoutclx = layoutclx ?? "grid grid-cols-2 gap-2 self-stretch";
      resetMinWidth = true;
    } else {
      layoutclx = layoutclx ? layoutclx + "md:flex md:flex-row md:justify-center " : "flex flex-row justify-center ";
    }
    itemclx += resetMinWidth ? "!min-w-0 " : "";
  }
  layoutclx = layoutclx ?? "flex flex-col items-stretch gap-2 self-stretch md:flex-row sm:justify-center ";
  const getMobileColSpanClx = /* @__PURE__ */ __name((index, total) => {
    const indexToCenter = total % 2 === 0 ? -1 : mobileCenterFirstIfOdd ? 0 : total - 1;
    const widthclx = mobileOddFullWidth ? "w-full " : "w-3/5 mx-auto ";
    return agent === "phone" && mobile2Columns && index === indexToCenter ? "col-span-2 " + widthclx : "";
  }, "getMobileColSpanClx");
  return /* @__PURE__ */ jsx("div", { className: cn(
    layoutclx,
    wrapperClasses,
    className
  ), children: elements.map((element, index) => {
    const twoColClx = getMobileColSpanClx(index, elements.length);
    if (element.title) {
      const def = element;
      return renderLink ? renderLink(def, index) : /* @__PURE__ */ jsx(
        link_element_default,
        {
          def,
          size: itemSize,
          className: cn(itemclx, itemClasses, twoColClx)
        },
        index
      );
    } else {
      const def = element;
      return renderButton ? renderButton(def, index) : /* @__PURE__ */ jsx(
        action_button_default,
        {
          def,
          size: itemSize,
          className: cn(itemclx, itemClasses, twoColClx)
        },
        index
      );
    }
  }) });
}, "CtaBlockComponent");
var cta_block_default = CtaBlockComponent;
var ImageBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent,
  constraintTo
}) => {
  if (block.blockType !== "image") {
    return /* @__PURE__ */ jsx(Fragment, { children: "image block required" });
  }
  const {
    src,
    alt,
    dim,
    props,
    sizes,
    fullWidthOnMobile,
    svgFillClass,
    specifiers
  } = block;
  const specified = /* @__PURE__ */ __name((s) => containsToken(specifiers, s), "specified");
  const toSpread = {};
  if (props?.fill === void 0) {
    const resolved = constraintTo ? constrain(dim, constraintTo) : dim;
    toSpread.width = resolved.w;
    toSpread.height = resolved.h;
  }
  let _alt;
  if (alt) {
    _alt = alt;
  } else {
    const tokens = src.split("/");
    _alt = tokens.length > 0 ? tokens[tokens.length] : src;
  }
  const _svgFillClass = svgFillClass ?? "";
  if (agent === "phone") {
    if (specified("mobile-full-width") || fullWidthOnMobile) {
      const toSpread2 = {
        style: {
          width: "100%",
          height: "auto",
          maxWidth: "420px"
        },
        sizes: "100vw"
      };
      toSpread2.width = dim.w;
      toSpread2.height = dim.h;
      return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center w-full", children: /* @__PURE__ */ jsx(Image2, { src, alt: _alt, ...toSpread2, className: cn(_svgFillClass, className) }) });
    } else if (!specified("mobile-no-scale")) {
      if (props?.style?.width === "auto" && typeof props.style.height === "number") {
        props.style.height = props.style.height * 0.75;
      } else if (props?.style?.height === "auto" && typeof props?.style?.width === "number") {
        props.style.width = props.style.width * 0.75;
      } else if (props?.style && !props?.style.width) {
        toSpread.width = dim.w * 0.75;
        toSpread.height = dim.h * 0.75;
      }
    }
  }
  if (sizes) {
    toSpread.sizes = sizes;
  }
  const right = containsToken(specifiers, "right");
  const center = containsToken(specifiers, "center");
  const alignSelfClx = right ? "self-end" : center ? "self-center" : "self-start";
  return props?.fill ? /* @__PURE__ */ jsx("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx(Image2, { src, alt: _alt, ...toSpread, ...props, className: cn(_svgFillClass, "max-w-[70vw] mx-auto", className) }) }) : /* @__PURE__ */ jsx(Image2, { src, alt: _alt, ...toSpread, ...props, className: cn(alignSelfClx, _svgFillClass, "max-w-[70vw] mx-auto", className) });
}, "ImageBlockComponent");
var image_block_default = ImageBlockComponent;
var VideoBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent,
  usePoster = false,
  size = "md",
  constrainTo
}) => {
  const [_dim, setDim] = useState(void 0);
  const onResize = /* @__PURE__ */ __name(() => {
    setDim({
      w: window.innerWidth,
      h: window.innerHeight
    });
  }, "onResize");
  const windowDefined = typeof window !== "undefined";
  useEffect(() => {
    if (window && agent === "desktop") {
      window.addEventListener("resize", onResize);
      return () => window.removeEventListener("resize", onResize);
    }
  }, [windowDefined]);
  useLayoutEffect(() => {
    onResize();
  }, []);
  if (block.blockType !== "video") {
    return /* @__PURE__ */ jsx(Fragment, { children: "video block required" });
  }
  const b = block;
  const ar = b.dim.md.w / b.dim.md.h;
  if (agent === "phone") {
    if (b.sizing?.mobile?.vw) {
      if (!_dim) {
        const width = `${b.sizing.mobile.vw}vw`;
        return /* @__PURE__ */ jsx("div", { className: "dummy-div", style: {
          maxWidth: "100%",
          maxHeight: "100%",
          width,
          height: `calc(${width}/${ar})`,
          backgroundImage: `url(${b.poster})`,
          backgroundSize: "contain",
          backgroundRepeat: "no-repeat"
        } });
      } else {
        const width = b.sizing.mobile.vw / 100 * _dim.w;
        const dim2 = {
          h: width / ar,
          w: width
        };
        return /* @__PURE__ */ jsx(
          video_player_default,
          {
            className: cn("mx-auto", className),
            sources: b.sources,
            width: dim2.w,
            height: dim2.h,
            ...b.videoProps
          }
        );
      }
    }
  } else if (b.sizing?.vh) {
    if (!_dim) {
      const height = `${b.sizing.vh}vh`;
      return /* @__PURE__ */ jsx("div", { className: "dummy-div", style: {
        maxWidth: "100%",
        maxHeight: "100%",
        height,
        width: `calc(${height}*${ar})`,
        backgroundImage: `url(${b.poster})`,
        backgroundSize: "contain",
        backgroundRepeat: "no-repeat"
      } });
    } else {
      const height = b.sizing.vh / 100 * _dim.h;
      const dim2 = {
        h: height,
        w: height * ar
      };
      return /* @__PURE__ */ jsx(
        video_player_default,
        {
          className: cn("mx-auto", className),
          sources: b.sources,
          width: dim2.w,
          height: dim2.h,
          ...b.videoProps
        }
      );
    }
  }
  const videoDims = b.dim;
  const dim = size && size in videoDims ? videoDims[size] : videoDims.md;
  const conDim = constrainTo ? constrain(dim, constrainTo) : dim;
  return usePoster ? /* @__PURE__ */ jsx(Image2, { src: b.poster, alt: "image", width: conDim.w, height: conDim.h, className }) : /* @__PURE__ */ jsx(
    video_player_default,
    {
      className: cn("mx-auto", className),
      sources: b.sources,
      width: conDim.w,
      height: conDim.h,
      ...b.videoProps
    }
  );
}, "VideoBlockComponent");
var video_block_default = VideoBlockComponent;

// blocks/components/card-block/util.ts
var getTypographySize = /* @__PURE__ */ __name((s) => getSpecifierData(
  s,
  (s2) => getPrimaryStartingWith(s2, "typography"),
  (s2) => {
    const subTokenArray = s2.split("-");
    return subTokenArray[subTokenArray.length - 1];
  },
  "responsive"
), "getTypographySize");
var ArrowLinkElement = /* @__PURE__ */ __name(({
  def
}) => /* @__PURE__ */ jsx(
  link_element_default,
  {
    def,
    className: "justify-between",
    variant: "link",
    icon: /* @__PURE__ */ jsx(icons_exports.linkOut, { className: "w-[18px] h-[18px]" }),
    iconAfter: true
  }
), "ArrowLinkElement");
var link_out_button_default = ArrowLinkElement;
var CardBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  contentClassName = ""
}) => {
  if (block.blockType !== "card") {
    return /* @__PURE__ */ jsx(Fragment, { children: "card block required" });
  }
  const card = block;
  const has = /* @__PURE__ */ __name((s) => card.specifiers?.includes(s), "has");
  const ghost = has("ghost");
  const contentclx = (has("content-left") ? "items-start " : " items-center ") + (has("content-top") ? "!justify-start" : "") + contentClassName;
  const disabledBorder = has("appear-disabled") ? " border-muted-4" : " border-muted-3";
  const outerBorder = has("no-outer-border") || ghost ? " border-0" : "";
  const innerBorder = ghost ? " border-0" : "";
  const paddingclx = ghost ? " px-0 py-0" : " px-6 py-3";
  const mainGap = ghost ? " gap-2" : "";
  const disabledText = has("appear-disabled") ? " text-muted-2" : "";
  const disabledTypoText = has("appear-disabled") ? " typography-p:text-muted-2" : "";
  const bgclx = has("bg-card") ? " bg-level-1" : "";
  const titleclx = (has("heading-style-title") ? " font-heading text-base leading-tight" : "") + (ghost ? " text-left md:text-xl" : "");
  const typoSize = card.specifiers ? getTypographySize(card.specifiers) : "responsive";
  const typoclx = typoSize === "sm" ? "typography-sm typography-p:text-sm " : typoSize === "lg" ? "typography-lg " : "";
  const contentBefore = has("content-before");
  const iconInline = has("icon-inline");
  const contentOnHover = has("reveal-content-on-hover");
  const Header2 = /* @__PURE__ */ __name(({
    inContent = false,
    className: className2 = ""
  }) => card.title || card.byline || card.icon ? /* @__PURE__ */ jsxs(CardHeader, { className: "not-typography text-accent" + disabledText + paddingclx + innerBorder + className2, children: [
    /* @__PURE__ */ jsxs("div", { className: iconInline || inContent ? "flex flex-row justify-start items-end my-3" : "", children: [
      card.icon && !card.iconAfter && /* @__PURE__ */ jsx("div", { className: iconInline ? "mr-1" : "mb-2", children: card.icon }),
      card.title && /* @__PURE__ */ jsx(CardTitle, { className: "text-center text-lg font-medium" + titleclx + (iconInline ? " md:text-xl/none" : ""), children: card.title }),
      card.icon && card.iconAfter && /* @__PURE__ */ jsx("div", { className: iconInline ? "ml-1" : "my-1", children: card.icon })
    ] }),
    card.byline && /* @__PURE__ */ jsx(CardDescription, { children: card.byline })
  ] }) : null, "Header");
  const MediaAndContent = /* @__PURE__ */ __name(({
    className: className2 = ""
  }) => has("media-left") ? (
    // media left layout
    /* @__PURE__ */ jsxs(CardContent, { className: "flex flex-row justify-start items-stretch p-0 grow " + disabledBorder + bgclx + contentclx + className2, children: [
      card.media && /* @__PURE__ */ jsx("div", { className: "box-content grow-0 not-typography" + paddingclx, style: {
        // If this layout has been specified, assume media is video, and that the 'sm' dim exists.
        width: card.media.dim.sm.w
      }, children: /* @__PURE__ */ jsx(
        video_block_default,
        {
          block: card.media,
          usePoster: has("video-use-poster"),
          size: "sm",
          className: has("appear-disabled") ? "opacity-[0.6]" : ""
        }
      ) }),
      card.content && /* @__PURE__ */ jsx(ApplyTypography, { className: "grow border-l flex flex-col justify-center " + disabledTypoText + paddingclx + disabledBorder + contentclx, size: typoSize, children: typeof card.content === "string" ? /* @__PURE__ */ jsx("p", { children: card.content }) : card.content })
    ] })
  ) : (
    // default layout
    /* @__PURE__ */ jsxs(CardContent, { className: "grow typography flex flex-col justify-center " + typoclx + disabledTypoText + bgclx + paddingclx + contentclx + (has("full-width") ? " p-0 " : " ") + className2, children: [
      contentOnHover && /* @__PURE__ */ jsx(Header2, { inContent: true }),
      card.content && contentBefore && (typeof card.content === "string" ? /* @__PURE__ */ jsx("p", { children: card.content }) : card.content),
      card.media && (card.media.blockType === "image" ? /* @__PURE__ */ jsx(image_block_default, { block: card.media }) : /* @__PURE__ */ jsx(video_block_default, { block: card.media })),
      card.content && !contentBefore && (typeof card.content === "string" ? /* @__PURE__ */ jsx("p", { children: card.content }) : card.content)
    ] })
  ), "MediaAndContent");
  const Footer = /* @__PURE__ */ __name(() => !card.cta ? null : has("links-w-arrow") ? (
    // links w arrow
    /* @__PURE__ */ jsx(CardFooter, { className: "typography typography-a:text-muted-2 typography-a:hover:text-muted-1 typography-a:text-xs typography-a:no-underline typography-a:hover:underline flex flex-col justify-start items-stretch " + paddingclx, children: /* @__PURE__ */ jsx(
      cta_block_default,
      {
        block: card.cta,
        renderLink: (def, key) => /* @__PURE__ */ jsx(link_out_button_default, { def }, key)
      }
    ) })
  ) : (
    // default 
    /* @__PURE__ */ jsx(CardFooter, { className: "grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center " + paddingclx, children: /* @__PURE__ */ jsx(cta_block_default, { block: card.cta }) })
  ), "Footer");
  return /* @__PURE__ */ jsxs(Card, { className: cn(
    "flex flex-col self-stretch " + (contentOnHover ? "group relative" : "") + disabledBorder + outerBorder + bgclx + mainGap,
    className
  ), children: [
    /* @__PURE__ */ jsx(Header2, { className: contentOnHover ? " absolute top-[0px] left-[0px] w-full hidden " : "" }),
    /* @__PURE__ */ jsx(MediaAndContent, { className: contentOnHover ? " bg-gradient-to-t from-secondary to-65% items-start justify-start rounded-lg p-4 transition-opacity duration-500 ease-out opacity-100  " : "" }),
    /* @__PURE__ */ jsx(Footer, {})
  ] });
}, "CardBlockComponent");
var card_block_default = CardBlockComponent;
var VariantContentLeft = /* @__PURE__ */ __name(({
  block,
  agent,
  className,
  headingclx,
  contentclx,
  footerclx
}) => {
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
      block.topContent && /* @__PURE__ */ jsx(ContentComponent, { blocks: block.topContent, agent, className: "self-center ml-6 mt-6" }),
      /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
        block.heading && /* @__PURE__ */ jsx(CardHeader, { className: cn("typography-img:m-0", headingclx), children: /* @__PURE__ */ jsx(enh_heading_block_default, { block: block.heading, className: "text-accent", agent }) }),
        block.content && /* @__PURE__ */ jsx(CardContent, { className: cn("typography flex flex-col justify-start", contentclx, className), children: /* @__PURE__ */ jsx(ContentComponent, { blocks: block.content, agent }) })
      ] })
    ] }),
    block.cta && /* @__PURE__ */ jsx(CardFooter, { className: cn("grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center mx-auto", footerclx), children: /* @__PURE__ */ jsx(cta_block_default, { block: block.cta, agent }) })
  ] });
}, "VariantContentLeft");
var variant_content_left_default = VariantContentLeft;
var _getClx = /* @__PURE__ */ __name((specifier, section) => {
  let result = "";
  if (specifier === "big-padding") {
    switch (section) {
      // defaults: p-4 lg:p-6 xl:p-8 
      case "header":
        {
          result = "md:p-8 lg:p-12 xl:p-16";
        }
        break;
    }
  }
  if (specifier === "big-padding-content") {
    switch (section) {
      case "content":
        {
          result = "md:p-8 lg:p-12 xl:p-16";
        }
        break;
    }
  } else if (specifier === "no-inner-borders") {
    switch (section) {
      case "header":
        {
          result = "border-none";
        }
        break;
      case "footer":
        {
          result = "border-t-0";
        }
        break;
    }
  }
  return result;
}, "_getClx");
var CarteBlancheBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent
}) => {
  if (block.blockType !== "carte-blanche") {
    return /* @__PURE__ */ jsx(Fragment, { children: "carte blanche block required" });
  }
  const b = block;
  const specified = /* @__PURE__ */ __name((s) => containsToken(b.specifiers, s), "specified");
  const getClx = /* @__PURE__ */ __name((specifier, section) => specified(specifier) ? _getClx(specifier, section) : "", "getClx");
  const headingclx = [
    getClx("big-padding", "header"),
    getClx("no-inner-borders", "header")
  ].join(" ");
  const contentclx = [
    getClx("big-padding-content", "content")
  ].join(" ");
  const footerclx = [
    getClx("no-inner-borders", "footer")
  ].join(" ");
  const noOuterBorders = specified("no-outer-borders");
  const contentLeft = specified("variant-content-left");
  const mobileContentLeft = specified("variant-mobile-content-left");
  return /* @__PURE__ */ jsx(Card, { className: cn("flex flex-col", className, noOuterBorders ? "border-none" : ""), children: contentLeft || mobileContentLeft && agent === "phone" ? /* @__PURE__ */ jsx(variant_content_left_default, { block: b, agent, className, headingclx, contentclx, footerclx }) : /* @__PURE__ */ jsxs(Fragment, { children: [
    (b.heading || b.topContent) && /* @__PURE__ */ jsxs(CardHeader, { className: cn("typography-img:m-0", headingclx), children: [
      b.topContent && /* @__PURE__ */ jsx(ContentComponent, { blocks: b.topContent, agent, className: "" }),
      b.heading && /* @__PURE__ */ jsx(enh_heading_block_default, { block: b.heading, className: "text-accent", agent })
    ] }),
    b.content && /* @__PURE__ */ jsx(CardContent, { className: cn("typography flex flex-col justify-center", contentclx, className), children: /* @__PURE__ */ jsx(ContentComponent, { blocks: b.content, agent }) }),
    b.cta && /* @__PURE__ */ jsx(CardFooter, { className: cn("grid grid-cols-1 gap-2 md:flex md:flex-row md:justify-center", footerclx), children: /* @__PURE__ */ jsx(cta_block_default, { block: b.cta, agent }) })
  ] }) });
}, "CarteBlancheBlockComponent");
var carte_blanche_block_default = CarteBlancheBlockComponent;
var DEFAULTS = {
  preheading: {
    tag: "h4",
    mb: 2
  },
  heading: {
    tag: "h1",
    mb: 2
  },
  byline: {
    tag: "h6"
  }
};
var tagFromLevel = /* @__PURE__ */ __name((level) => {
  switch (level) {
    case 1: {
      return "h1";
    }
    case 2: {
      return "h2";
    }
    case 3: {
      return "h3";
    }
    case 4: {
      return "h4";
    }
    case 5: {
      return "h5";
    }
    case 6: {
      return "h6";
    }
  }
  return "p";
}, "tagFromLevel");
var Element = /* @__PURE__ */ __name(({
  asTag: Tag,
  text,
  icon,
  iconLeft = true,
  className: elClassName = ""
}) => /* @__PURE__ */ jsx(Tag, { className: elClassName, children: text }), "Element");
var getPositionClx = /* @__PURE__ */ __name((specified, agent) => {
  const mobileHeadingCentered = specified("mobile-heading-centered");
  const mobileHeadingLeft = specified("mobile-heading-left");
  const headingCentered = specified("center");
  const headingRight = specified("right");
  const bylineCentered = specified("byline-center");
  const bylineRight = specified("byline-right");
  const mobileBylineLeft = specified("mobile-byline-left");
  let headerclx = "";
  let bylineclx = bylineCentered ? "self-center !text-center" : bylineRight ? "self-end !text-right" : "self-start !text-left";
  if (agent === "phone") {
    if (mobileHeadingLeft) {
      headerclx = "self-start text-left";
    } else {
      headerclx = mobileHeadingCentered || headingCentered ? "self-center text-center" : headingRight ? "self-end text-right" : "self-start text-left";
    }
    if (mobileBylineLeft) {
      bylineclx = "self-start !text-left";
    }
  } else {
    const largerclx = headingCentered ? "self-center text-center" : headingRight ? "self-end text-right" : "self-start text-left";
    if (mobileHeadingCentered) {
      headerclx = "self-center text-center md:" + largerclx.split(" ").join(" md:");
    } else {
      headerclx = largerclx;
    }
  }
  return {
    preheading: headerclx,
    heading: headerclx,
    byline: bylineclx
  };
}, "getPositionClx");
var EnhHeadingBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = "",
  agent,
  applyTypography = true,
  extraSpecifiers = ""
}) => {
  if (block.blockType !== "enh-heading") {
    return /* @__PURE__ */ jsx(Fragment, { children: "enhance heading block required" });
  }
  const b = block;
  const specified = /* @__PURE__ */ __name((s) => containsToken(b.specifiers + extraSpecifiers, s), "specified");
  const preheadingHeadingFont = specified("preheading-heading-font");
  const phFontClx = preheadingHeadingFont ? "font-heading" : "";
  const alignMiddleClx = specified("align-middle") ? "my-auto" : "";
  const positionclx = getPositionClx(specified, agent);
  const Inner = /* @__PURE__ */ __name(() => {
    const toRender = [
      {
        tag: b.preheading ? b.preheading.level !== void 0 ? tagFromLevel(b.preheading.level) : DEFAULTS.preheading.tag : void 0,
        clx: b.preheading ? (b.preheading.mb !== void 0 ? `mb-${b.preheading.mb}` : `mb-${DEFAULTS.preheading.mb}`) + " " + positionclx.preheading + " " + phFontClx : positionclx.preheading + " " + phFontClx,
        text: b.preheading ? b.preheading.text : void 0
      },
      {
        tag: b.heading.level !== void 0 ? tagFromLevel(b.heading.level) : DEFAULTS.heading.tag,
        clx: (b.heading.mb !== void 0 ? `mb-${b.heading.mb}` : `mb-${DEFAULTS.heading.mb}`) + " " + positionclx.heading,
        text: b.heading.text
      },
      {
        tag: b.byline ? b.byline.level !== void 0 ? tagFromLevel(b.byline.level) : DEFAULTS.byline.tag : void 0,
        clx: positionclx.byline,
        text: b.byline ? b.byline.text : void 0
      }
    ];
    let iconRendered = false;
    return /* @__PURE__ */ jsx(Fragment, { children: toRender.map(({ tag, clx, text }, index) => {
      if (!tag) return null;
      if (b.icon && !iconRendered) {
        iconRendered = true;
        return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-row items-center gap-2 sm:gap-4", clx), children: [
          /* @__PURE__ */ jsx(inline_icon_default, { icon: b.icon, size: b.iconSize ?? 32, agent }),
          /* @__PURE__ */ jsx(Element, { asTag: tag, text })
        ] }, `div-${index}`);
      }
      return /* @__PURE__ */ jsx(Element, { asTag: tag, text, className: clx }, `el-${index}`);
    }) });
  }, "Inner");
  return applyTypography ? /* @__PURE__ */ jsx(ApplyTypography, { className: cn("flex flex-col w-full !gap-0", className, alignMiddleClx), children: /* @__PURE__ */ jsx(Inner, {}) }) : /* @__PURE__ */ jsx("div", { className: cn("flex flex-col w-full gap-0", className, alignMiddleClx), children: /* @__PURE__ */ jsx(Inner, {}) });
}, "EnhHeadingBlockComponent");
var enh_heading_block_default = EnhHeadingBlockComponent;
var HeadingBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = ""
}) => {
  if (block.blockType !== "heading") {
    return /* @__PURE__ */ jsx(Fragment, { children: "heading block required" });
  }
  const heading = block;
  let Tag;
  let BylineTag = void 0;
  switch (heading.bylineLevel) {
    case 0:
      {
        BylineTag = "p";
      }
      break;
    case 1:
      {
        BylineTag = "h1";
      }
      break;
    case 2:
      {
        BylineTag = "h2";
      }
      break;
    case 3:
      {
        BylineTag = "h3";
      }
      break;
    case 4:
      {
        BylineTag = "h4";
      }
      break;
    case 5:
      {
        BylineTag = "h5";
      }
      break;
    case 6:
      {
        BylineTag = "h6";
      }
      break;
  }
  switch (heading.level) {
    case 0:
      {
        Tag = "p";
        BylineTag = BylineTag ?? "p";
      }
      break;
    case 1:
      {
        Tag = "h1";
        BylineTag = BylineTag ?? "h3";
      }
      break;
    case 2:
      {
        Tag = "h2";
        BylineTag = BylineTag ?? "h4";
      }
      break;
    // 3 is default
    case 4:
      {
        Tag = "h4";
        BylineTag = BylineTag ?? "h6";
      }
      break;
    case 5:
      {
        Tag = "h5";
        BylineTag = BylineTag ?? "p";
      }
      break;
    case 6:
      {
        Tag = "h6";
        BylineTag = BylineTag ?? "p";
      }
      break;
    default: {
      Tag = "h3";
      BylineTag = BylineTag ?? "h5";
    }
  }
  return /* @__PURE__ */ jsxs(ApplyTypography, { className, children: [
    /* @__PURE__ */ jsx(Tag, { children: heading.heading }),
    heading.spaceBetween && /* @__PURE__ */ jsx("div", { className: `w-[1px] h-${heading.spaceBetween}` }),
    heading.byline && /* @__PURE__ */ jsx(BylineTag, { children: heading.byline }),
    heading.spaceAfter && /* @__PURE__ */ jsx("div", { className: `w-[1px] h-${heading.spaceAfter}` })
  ] });
}, "HeadingBlockComponent");
var heading_block_default = HeadingBlockComponent;

// tailwind/screens.tailwind.js
var screens_tailwind_default = {
  xs: "0px",
  // <-- phone
  sm: "480px",
  // phone --><-- sm tablets / narrow
  md: "768px",
  // sm tablets / narrow -->
  lg: "1024px",
  xl: "1280px",
  "2xl": "1500px"
};

// types/breakpoints.ts
var Breakpoints = Object.keys(screens_tailwind_default);
var getLayoutInfo = /* @__PURE__ */ __name((s) => {
  const tokenArray = s.split(" ");
  const layoutToken = tokenArray.find((tok) => tok.startsWith("layout-"));
  if (layoutToken) {
    const subtokens = layoutToken.split("-");
    const layout = subtokens[1];
    let spec = {};
    switch (layout) {
      case "grid":
        {
          const columns = parseInt(subtokens[2], 10);
          const starting = subtokens[4];
          if (Number.isNaN(columns) || columns < 2 || columns > 6 || !Breakpoints.includes(starting)) {
            return void 0;
          }
          spec = {
            columns,
            starting
          };
        }
        break;
    }
    return {
      layout,
      spec
    };
  }
  return void 0;
}, "getLayoutInfo");
var GroupBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = ""
}) => {
  if (block.blockType !== "group") {
    return /* @__PURE__ */ jsx(Fragment, { children: "group block required" });
  }
  const group = block;
  if (group.specifiers?.includes("layout")) {
    const layoutSpec = getLayoutInfo(group.specifiers);
    if (!layoutSpec) {
      return /* @__PURE__ */ jsx(Fragment, { children: "invalid or missing layout specifier in group block!" });
    }
    if (layoutSpec.layout === "grid") {
      const { elements } = group;
      const { spec: { starting, columns } } = layoutSpec;
      const clazzName = cn(
        "grid xs:grid-cols-1 gap-2 sm:gap-3",
        `${starting}:grid-cols-${columns} `,
        className
      );
      return /* @__PURE__ */ jsx("div", { className: clazzName, children: /* @__PURE__ */ jsx(ContentComponent, { blocks: elements }) });
    }
  }
  return null;
}, "GroupBlockComponent");
var group_block_default = GroupBlockComponent;
var TAGS = [
  "div",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6"
];
var SpaceBlockComponent = /* @__PURE__ */ __name(({
  block,
  className = ""
}) => {
  if (block && block.blockType !== "space") {
    return /* @__PURE__ */ jsx(Fragment, { children: "space block required" });
  }
  const b = block;
  if (!b.level) {
    if (typeof b.sizes == "number") {
      return /* @__PURE__ */ jsx("div", { className: cn(`invisible w-[1px] h-${b.sizes}`, className) });
    }
    const _sizes = {};
    ldMerge(_sizes, SPACE_DEFAULTS, b.sizes);
    let clx = "";
    for (const [key, value] of Object.entries(_sizes)) {
      clx += `${key}:h-${value} `;
    }
    if (b.test) {
      console.log(clx);
    }
    return /* @__PURE__ */ jsx("div", { className: cn("invisible w-[1px] " + clx, className) });
  }
  const Tag = TAGS[b.level];
  const heightClx = b.level === 0 ? "h-4" : "";
  return /* @__PURE__ */ jsx(ApplyTypography, { className, children: /* @__PURE__ */ jsx(Tag, { className: "invisible m-0 " + heightClx, children: "\xA0" }) });
}, "SpaceBlockComponent");
var space_block_default = SpaceBlockComponent;
var map2 = /* @__PURE__ */ new Map();
map2.set("accordian", accordian_block_default);
map2.set("bullet-cards", bullet_cards_block_default);
map2.set("card", card_block_default);
map2.set("carte-blanche", carte_blanche_block_default);
map2.set("cta", cta_block_default);
map2.set("heading", heading_block_default);
map2.set("enh-heading", enh_heading_block_default);
map2.set("space", space_block_default);
map2.set("image", image_block_default);
map2.set("video", video_block_default);
map2.set("group", group_block_default);
map2.set("grid", grid_block_default);
var registerBlockType = /* @__PURE__ */ __name((key, type) => {
  map2.set(key, type);
}, "registerBlockType");
var renderBlock = /* @__PURE__ */ __name((block, className, agent, keyStr) => {
  if (block.blockType === "element") {
    return block.element;
  }
  const CompType = map2.get(block.blockType);
  if (!CompType) return null;
  return /* @__PURE__ */ jsx(CompType, { block, className, agent }, keyStr ?? "");
}, "renderBlock");
var ContentComponent = /* @__PURE__ */ __name(({
  blocks,
  className = "",
  agent
}) => {
  if (!blocks) return null;
  if (Array.isArray(blocks)) {
    return blocks.map((block, index) => renderBlock(block, className, agent, `content-block-${block.blockType}-${index}`));
  }
  return renderBlock(blocks, className, agent);
}, "ContentComponent");
var Poster = /* @__PURE__ */ __name(({
  children,
  banner,
  className = ""
}) => banner ? /* @__PURE__ */ jsx(
  "div",
  {
    className: cn("relative", className),
    style: {
      height: "100%",
      width: "100%",
      backgroundImage: `url(${typeof banner === "string" ? banner : banner.poster})`,
      backgroundSize: "cover",
      backgroundRepeat: "no-repeat"
    },
    children
  }
) : /* @__PURE__ */ jsx("div", { className: cn("bg-transparent h-full w-full relative", className), children }), "Poster");
var poster_background_default = Poster;
var ContentColumn = /* @__PURE__ */ __name(({
  blocks,
  specifiers,
  agent,
  className = ""
}) => {
  const specified = /* @__PURE__ */ __name((s) => containsToken(specifiers, s), "specified");
  let modifiers = "";
  if (agent !== "phone") {
    if (specified("right")) {
      modifiers += "items-end ";
    } else if (specified("center")) {
      modifiers += "items-center ";
    } else {
      modifiers += "items-start ";
    }
  } else {
    modifiers += "items-start ";
  }
  if (agent !== "phone") {
    if (specified("bottom")) {
      modifiers += "justify-end ";
    } else if (specified("vert-center")) {
      modifiers += "justify-center ";
    } else {
      modifiers += "justify-start ";
    }
    if (specified("text-align-right")) {
      modifiers += "text-right ";
    } else {
      modifiers += "text-left ";
    }
  } else {
    if (specified("mobile-vert-center")) {
      modifiers += "justify-center ";
    } else {
      modifiers += "justify-start ";
    }
  }
  if (agent === "phone" && specified("mobile-center-headings")) {
    modifiers += "typography-headings:text-center ";
  }
  return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col justify-center h-full", modifiers, className), children: /* @__PURE__ */ jsx(ContentComponent, { blocks, agent }) });
}, "ContentColumn");
var Content2 = /* @__PURE__ */ __name(({
  block: b,
  agent,
  className = ""
}) => {
  const layoutClx = "flex flex-col gap-2 sm:gap-4 h-full " + (agent !== "phone" ? `md:grid md:gap-8 md:grid-cols-${b.contentColumns.length} ` : "");
  const orderclx = /* @__PURE__ */ __name((columnIndex) => {
    const orderIndex = b.mobileOrder?.indexOf(columnIndex);
    return orderIndex && orderIndex >= 0 ? `order-${orderIndex} md:order-none` : "";
  }, "orderclx");
  return b.contentColumns.length == 1 ? /* @__PURE__ */ jsx(
    ContentColumn,
    {
      blocks: b.contentColumns[0],
      specifiers: b.columnSpecifiers?.[0],
      agent,
      className: cn(className)
    }
  ) : /* @__PURE__ */ jsx("div", { className: cn(layoutClx, className), children: b.contentColumns.map((column, index) => /* @__PURE__ */ jsx(
    ContentColumn,
    {
      blocks: column,
      specifiers: b.columnSpecifiers?.[index],
      agent,
      className: orderclx(index)
    },
    index
  )) });
}, "Content");
var content_default = Content2;
var VideoBG = /* @__PURE__ */ __name(({
  block,
  className = "",
  initialInView
}) => {
  const { ref, inView } = useInView({
    threshold: 0.75,
    initialInView
  });
  return block ? /* @__PURE__ */ jsx("div", { ref, className, children: inView && /* @__PURE__ */ jsx(
    "video",
    {
      autoPlay: true,
      loop: true,
      muted: true,
      style: {
        margin: 0,
        height: "100%",
        width: "100%",
        objectFit: "cover"
      },
      children: block.sources?.map((src, index) => /* @__PURE__ */ jsx("source", { src }, index))
    }
  ) }) : null;
}, "VideoBG");
var video_background_default = VideoBG;
var Video = /* @__PURE__ */ __name((props) => {
  const [mounted, setMounted] = useState(false);
  useEffect(() => {
    setMounted(true);
  }, []);
  if (!mounted) return null;
  return /* @__PURE__ */ jsx(video_background_default, { ...props });
}, "Video");
var ScreenfulComponent = /* @__PURE__ */ __name(({
  block,
  agent,
  initialInView = false,
  snapTile = false,
  clx = "",
  contentClx = "",
  bottom
}) => {
  if (block.blockType !== "screenful") {
    return /* @__PURE__ */ jsx(Fragment, { children: "screenful block required" });
  }
  const b = block;
  const hasBannerVideo = /* @__PURE__ */ __name(() => !!b.banner && typeof b.banner === "object", "hasBannerVideo");
  const tileHeight = agent === "desktop" ? "h-full " : "h-[100svh] ";
  const specified = /* @__PURE__ */ __name((s) => containsToken(b.specifiers, s), "specified");
  const narrowGutters = specified("narrow-gutters");
  const noGutters = specified("no-gutters");
  const fullScreenWidth = specified("full-screen-width");
  const vertCenter = specified("vert-center");
  const oneColumn = b.contentColumns.length === 1;
  const cwclx = [
    "xl:mx-auto overflow-y-hidden h-full",
    fullScreenWidth ? "" : "max-w-screen-xl",
    // desktop header: 80px / pt-20
    // mobile header: 44px / pt-11  
    narrowGutters ? "px-6 lg:px-8 2xl:px-2 pb-4 lg:pb-6 xl:pb-8 " + (snapTile ? "pt-15 md:pt-26 lg:pt-28 " : "") : noGutters ? "px-0 pb-0 " + (snapTile ? "pt-11 lg:pt-20 " : "") : "px-[8vw] xl:px-[1vw] pb-[8vh] pt-[calc(44px+4vh)] md:pt-[calc(80px+6vh)] ",
    agent && agent !== "desktop" ? "pt-15 sm:pt-17 pb-0 px-3 sm:px-8" : ""
  ];
  return /* @__PURE__ */ jsxs("section", { ...b.anchorId ? { id: b.anchorId } : {}, className: cn(
    snapTile ? "snap-start snap-always h-[100vh]" : "min-h-screen",
    bottom ? "flex flex-col" : "",
    clx
  ), children: [
    /* @__PURE__ */ jsx(ApplyTypography, { className: cn(
      "w-full flex flex-row justify-center self-stretch",
      snapTile ? tileHeight : "",
      bottom ? "grow" : ""
    ), children: /* @__PURE__ */ jsxs(poster_background_default, { banner: b.banner, children: [
      hasBannerVideo() && /* @__PURE__ */ jsx(
        Video,
        {
          block: b.banner,
          className: "absolute top-0 left-0 bottom-0 right-0",
          initialInView
        }
      ),
      /* @__PURE__ */ jsxs(
        "div",
        {
          className: cn(
            ...cwclx,
            snapTile ? "absolute left-0 right-0 top-0 bottom-0 " : "flex min-h-screen w-full",
            contentClx,
            // TODO :aa py-0 breaks padding for header!  Investigate why I would have done this!
            vertCenter ? "self-center " + (oneColumn ? "!py-0" : "") : ""
          ),
          children: [
            /* @__PURE__ */ jsx(content_default, { block: b, agent, className: "w-full" }),
            b.footer
          ]
        }
      )
    ] }) }),
    bottom
  ] });
}, "ScreenfulComponent");
var screenful_block_default = ScreenfulComponent;

export { accordian_block_default as AccordianBlockComponent, ContentComponent as BlocksComponent, cta_block_default as CTABlockComponent, card_block_default as CardBlockComponent, ContentComponent, enh_heading_block_default as EnhHeadingBlockComponent, group_block_default as GroupBlockComponent, heading_block_default as HeadingBlockComponent, image_block_default as ImageBlockComponent, SPACE_DEFAULTS, screenful_block_default as ScreenfulBlockComponent, space_block_default as SpaceBlockComponent, video_block_default as VideoBlockComponent, registerBlockType };
