"use client";
'use strict';

var jsxRuntime = require('react/jsx-runtime');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');

// src/chrome/app-line-field-dial-preset.tsx
var appLineFieldPattern = {
  lineField: {
    spacing: 4,
    thickness: 1.2,
    topOpacity: 0.18,
    bottomOpacity: 0.15,
    /** Pinstripe tint matches `--theme-background-sidebar` (warm shell gray). */
    tint: "#F9FAFA",
    blur: 0,
    lift: 0
  },
  surface: {
    showPattern: true,
    glowOpacity: 0.2,
    noiseOpacity: 0.08
  }
};
function hexToRgb(hex) {
  const normalized = hex.replace("#", "");
  const expanded = normalized.length === 3 ? normalized.split("").map((character) => `${character}${character}`).join("") : normalized;
  if (!/^[\da-fA-F]{6}$/.test(expanded)) {
    return { r: 148, g: 163, b: 184 };
  }
  return {
    r: Number.parseInt(expanded.slice(0, 2), 16),
    g: Number.parseInt(expanded.slice(2, 4), 16),
    b: Number.parseInt(expanded.slice(4, 6), 16)
  };
}
var DARK_LINE_ALPHA_SCALE = 0.14;
function flatLightStripeColor(pattern, tint) {
  const a = (pattern.lineField.topOpacity + pattern.lineField.bottomOpacity) / 2;
  return `rgba(${tint.r}, ${tint.g}, ${tint.b}, ${a})`;
}
function flatDarkStripeColor(pattern) {
  const a = (pattern.lineField.topOpacity + pattern.lineField.bottomOpacity) / 2 * DARK_LINE_ALPHA_SCALE;
  return `rgba(255, 255, 255, ${a})`;
}
function GroovedHorizontalStripes({
  pattern,
  tint,
  patternOpacity,
  lift,
  mask,
  isDark
}) {
  const stripeColor = isDark ? flatDarkStripeColor(pattern) : flatLightStripeColor(pattern, tint);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      className: "absolute inset-0",
      style: {
        transform: lift,
        filter: `blur(${pattern.lineField.blur}px)`,
        backgroundColor: stripeColor,
        opacity: patternOpacity,
        WebkitMaskImage: mask,
        maskImage: mask
      }
    }
  );
}
function LineFieldPatternLayers({
  pattern
}) {
  const tint = hexToRgb(pattern.lineField.tint);
  const lift = `translateY(${pattern.lineField.lift}px)`;
  const mask = `repeating-linear-gradient(to bottom, rgba(0,0,0,1) 0px, rgba(0,0,0,1) ${pattern.lineField.thickness}px, transparent ${pattern.lineField.thickness}px, transparent ${pattern.lineField.spacing}px)`;
  const patternOpacity = pattern.surface.showPattern ? 1 : 0;
  const darkShellLayers = /* @__PURE__ */ jsxRuntime.jsx(
    GroovedHorizontalStripes,
    {
      pattern,
      tint,
      patternOpacity,
      lift,
      mask,
      isDark: true
    }
  );
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      "aria-hidden": true,
      className: "pointer-events-none absolute inset-0 z-0 overflow-hidden",
      suppressHydrationWarning: true,
      children: [
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 dark:hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
          GroovedHorizontalStripes,
          {
            pattern,
            tint,
            patternOpacity,
            lift,
            mask,
            isDark: false
          }
        ) }),
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 hidden dark:block", children: darkShellLayers })
      ]
    }
  );
}
function AppShellLineFieldPattern() {
  return /* @__PURE__ */ jsxRuntime.jsx(LineFieldPatternLayers, { pattern: appLineFieldPattern });
}
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
function AppGroovedMainColumn({
  children,
  className,
  panelClassName
}) {
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      className: cn(
        "relative isolate flex min-h-0 min-w-0 flex-1 flex-col bg-shell pt-3 pr-3 pb-3 pl-0 dark:bg-background",
        className
      ),
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(AppShellLineFieldPattern, {}),
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-[1] flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsxRuntime.jsx(
          "div",
          {
            className: cn(
              "app-shell-main-panel flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-[14px] bg-sidebar dark:bg-sidebar",
              panelClassName
            ),
            children
          }
        ) })
      ]
    }
  );
}

exports.AppGroovedMainColumn = AppGroovedMainColumn;
//# sourceMappingURL=app-grooved-main-column.cjs.map
//# sourceMappingURL=app-grooved-main-column.cjs.map