"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/molecules/learning-post.tsx
var learning_post_exports = {};
__export(learning_post_exports, {
  LearningPost: () => LearningPost
});
module.exports = __toCommonJS(learning_post_exports);

// src/theme/theme-provider.tsx
var import_themes = require("@radix-ui/themes");
var import_jsx_runtime = require("react/jsx-runtime");
function ThemeProvider(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Theme, __spreadValues({ accentColor: "iris", radius: "medium" }, props));
}

// src/atoms/grid.tsx
var import_themes2 = require("@radix-ui/themes");

// src/atoms/flex.tsx
var import_themes3 = require("@radix-ui/themes");

// src/atoms/heading.tsx
var import_themes4 = require("@radix-ui/themes");
var import_react = require("react");
var import_themes5 = require("@radix-ui/themes");
var import_jsx_runtime2 = require("react/jsx-runtime");
function Heading2(props) {
  const _a = props, { size, children, variant } = _a, rest = __objRest(_a, ["size", "children", "variant"]);
  const radixSize = (0, import_react.useMemo)(() => {
    switch (variant) {
      case "heading1":
        return "7";
      case "heading2":
        return "6";
      case "heading3":
        return "5";
      case "heading4":
        return "4";
      case "heading5":
        return "3";
      default:
        return size;
    }
  }, [size, variant]);
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_themes4.Heading, __spreadProps(__spreadValues({}, rest), { size: radixSize, children }));
}

// src/atoms/typo.tsx
var import_themes6 = require("@radix-ui/themes");
var import_react2 = require("react");
var import_jsx_runtime3 = require("react/jsx-runtime");
var Typo = (0, import_react2.forwardRef)(
  (props, ref) => {
    const _a = props, { size, variant, children } = _a, rest = __objRest(_a, ["size", "variant", "children"]);
    const radixSize = (0, import_react2.useMemo)(() => {
      if (size !== void 0)
        return size;
      switch (variant) {
        case "caption":
          return "1";
        case "subtitle":
          return "3";
        case "body":
        default:
          return "2";
      }
    }, [size, variant]);
    return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_themes6.Text, __spreadProps(__spreadValues({}, rest), { ref, size: radixSize, children }));
  }
);
Typo.displayName = "Typo";

// src/atoms/aspect-ratio.tsx
var import_themes7 = require("@radix-ui/themes");

// src/atoms/badge.tsx
var import_themes8 = require("@radix-ui/themes");
var import_react3 = require("react");
var import_jsx_runtime4 = require("react/jsx-runtime");
var Badge = (0, import_react3.forwardRef)(
  (props, ref) => {
    const _a = props, { size = "small", color = "accent" } = _a, rest = __objRest(_a, ["size", "color"]);
    const radixSize = (0, import_react3.useMemo)(() => {
      switch (size) {
        case "small":
          return "1";
        case "medium":
          return "2";
        case "large":
          return "3";
        default:
          return "1";
      }
    }, [size]);
    const radixColor = (0, import_react3.useMemo)(() => {
      switch (color) {
        case "error":
          return "red";
        case "neutral":
          return "gray";
        case "success":
          return "green";
        case "accent":
        default:
          return void 0;
      }
    }, [color]);
    return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_themes8.Badge, __spreadProps(__spreadValues({}, rest), { color: radixColor, ref, size: radixSize }));
  }
);
Badge.displayName = "Badge";

// src/atoms/box.tsx
var import_themes9 = require("@radix-ui/themes");

// src/atoms/button.tsx
var import_react4 = require("react");
var import_themes10 = require("@radix-ui/themes");

// src/utils/convert-button-size.ts
var convertSizeStr = (size) => {
  switch (size) {
    case "small":
      return "1";
    case "medium":
      return "2";
    case "large":
      return "3";
    default:
      return "2";
  }
};
var convertSizeResponse = (size) => {
  if (typeof size === "string" || typeof size === "undefined") {
    return convertSizeStr(size);
  }
  const radixSize = {};
  let key = "initial";
  for (key in size) {
    radixSize[key] = convertSizeStr(size[key]);
  }
  return radixSize;
};
var convertSize = (size) => {
  if (typeof size === "string") {
    return convertSizeStr(size);
  }
  return convertSizeResponse(size);
};

// src/atoms/button.tsx
var import_jsx_runtime5 = require("react/jsx-runtime");
var Button = (0, import_react4.forwardRef)(
  (props, ref) => {
    const _a = props, { size, style, variant } = _a, restProps = __objRest(_a, ["size", "style", "variant"]);
    const radixSize = (0, import_react4.useMemo)(() => {
      return convertSize(size);
    }, [size]);
    const mergedStyle = (0, import_react4.useMemo)(() => {
      const baseStyle = {
        background: variant === "transparent" ? "transparent" : void 0,
        fontWeight: 400
      };
      return __spreadValues(__spreadValues({}, baseStyle), style);
    }, [style, variant]);
    const radixVariant = (0, import_react4.useMemo)(() => {
      if (variant === "transparent")
        return "ghost";
      return variant;
    }, [variant]);
    return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
      import_themes10.Button,
      __spreadProps(__spreadValues({
        style: mergedStyle,
        variant: radixVariant
      }, restProps), {
        ref,
        size: radixSize
      })
    );
  }
);
Button.displayName = "Button";

// src/molecules/learning-post.tsx
var import_jsx_runtime6 = require("react/jsx-runtime");
function LearningPost(props) {
  const {
    defaultThemeProps,
    html,
    tags,
    title,
    metaDescription,
    imageComp,
    onPageBack,
    children
  } = props;
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
    ThemeProvider,
    __spreadProps(__spreadValues({}, defaultThemeProps), {
      accentColor: "iris",
      scaling: "110%",
      style: {},
      children: html ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
        import_themes2.Grid,
        {
          columns: { initial: "1", md: "130px 1fr 130px" },
          gap: { initial: "2", md: "5" },
          height: "100%",
          justify: "center",
          pb: "160px",
          position: "relative",
          px: "4",
          width: "100%",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {}),
            /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
              import_themes3.Flex,
              {
                align: "center",
                direction: "column",
                maxWidth: "880px",
                mt: { initial: "3", md: "8" },
                overflow: "hidden",
                width: "100%",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_themes2.Grid, { align: "start", columns: { initial: "1", sm: "2" }, gap: "2", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
                      import_themes2.Grid,
                      {
                        gap: "3",
                        mb: { initial: "4", sm: "0" },
                        style: { alignSelf: "flex-start" },
                        children: [
                          /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                            Heading2,
                            {
                              style: {
                                fontSize: "2.4rem",
                                lineHeight: 1.25,
                                wordBreak: "keep-all"
                              },
                              variant: "heading1",
                              children: title
                            }
                          ),
                          /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Typo, { children: metaDescription }),
                          /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_themes3.Flex, { gap: "1", wrap: "wrap", children: tags == null ? void 0 : tags.map((el) => {
                            var _a;
                            if ((_a = el.name) == null ? void 0 : _a.startsWith("filter"))
                              return;
                            return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge, { size: "large", variant: "solid", children: el.name }, el.id);
                          }) })
                        ]
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                      import_themes7.AspectRatio,
                      {
                        ratio: 5 / 3,
                        style: {
                          overflow: "hidden",
                          borderRadius: "var(--radius-4)",
                          objectFit: "cover"
                        },
                        children: imageComp
                      }
                    )
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_themes9.Box, { mt: "5", width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                    "div",
                    {
                      className: "gh-content",
                      dangerouslySetInnerHTML: { __html: html }
                    }
                  ) })
                ]
              }
            ),
            children
          ]
        }
      ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
        import_themes3.Flex,
        {
          align: "center",
          direction: "column",
          gap: "6",
          height: "100%",
          justify: "center",
          width: "100%",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Heading2, { variant: "heading1", children: "\uCF58\uD150\uCE20\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4." }),
            /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
              Heading2,
              {
                align: "center",
                color: "gray",
                variant: "heading4",
                weight: "regular",
                children: `\uC694\uCCAD\uD558\uC2E0 \uCF58\uD150\uCE20\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
        \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.`
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { onClick: onPageBack, size: "large", children: "\uB4A4\uB85C\uAC00\uAE30" })
          ]
        }
      )
    })
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  LearningPost
});
//# sourceMappingURL=learning-post.cjs.map