import { s as __toESM } from "./chunk-BNovOVIE.js";
import { _ as Logger, d as createSlot, f as createSlottable, g as cn, m as useComposedRefs, n as buttonVariants, r as cva } from "./button-Dj4BTre0.js";
import { t as require_react } from "./react-DA-nE2FX.js";
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
import { $ as StyleNamespace, P as object, R as string, X as withFullScreenAsRoot, _t as Primitive, at as FocusScope, dt as Presence, et as hideOthers, ft as useControllableState, gt as createContextScope, ht as createContext2, it as Portal, mt as composeEventHandlers, rt as useFocusGuards, st as DismissableLayer, tt as Combination_default, ut as useId } from "./zod-BWkcDORu.js";
var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), DIALOG_NAME = "Dialog", [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME), [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME), Dialog = (t) => {
  let { __scopeDialog: F, children: I, open: L, defaultOpen: R, onOpenChange: z, modal: B = true } = t, V = import_react.useRef(null), H = import_react.useRef(null), [U, W] = useControllableState({
    prop: L,
    defaultProp: R ?? false,
    onChange: z,
    caller: DIALOG_NAME
  });
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogProvider, {
    scope: F,
    triggerRef: V,
    contentRef: H,
    contentId: useId(),
    titleId: useId(),
    descriptionId: useId(),
    open: U,
    onOpenChange: W,
    onOpenToggle: import_react.useCallback(() => W((t2) => !t2), [W]),
    modal: B,
    children: I
  });
};
Dialog.displayName = DIALOG_NAME;
var TRIGGER_NAME$1 = "DialogTrigger", DialogTrigger = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, ...L } = t, R = useDialogContext(TRIGGER_NAME$1, I), B = useComposedRefs(F, R.triggerRef);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
    type: "button",
    "aria-haspopup": "dialog",
    "aria-expanded": R.open,
    "aria-controls": R.contentId,
    "data-state": getState(R.open),
    ...L,
    ref: B,
    onClick: composeEventHandlers(t.onClick, R.onOpenToggle)
  });
});
DialogTrigger.displayName = TRIGGER_NAME$1;
var PORTAL_NAME$1 = "DialogPortal", [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME$1, { forceMount: void 0 }), DialogPortal = (t) => {
  let { __scopeDialog: F, forceMount: I, children: L, container: R } = t, z = useDialogContext(PORTAL_NAME$1, F);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, {
    scope: F,
    forceMount: I,
    children: import_react.Children.map(L, (t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
      present: I || z.open,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
        asChild: true,
        container: R,
        children: t2
      })
    }))
  });
};
DialogPortal.displayName = PORTAL_NAME$1;
var OVERLAY_NAME$1 = "DialogOverlay", DialogOverlay = import_react.forwardRef((t, F) => {
  let I = usePortalContext(OVERLAY_NAME$1, t.__scopeDialog), { forceMount: L = I.forceMount, ...R } = t, z = useDialogContext(OVERLAY_NAME$1, t.__scopeDialog);
  return z.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
    present: L || z.open,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, {
      ...R,
      ref: F
    })
  }) : null;
});
DialogOverlay.displayName = OVERLAY_NAME$1;
var Slot = createSlot("DialogOverlay.RemoveScroll"), DialogOverlayImpl = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, ...L } = t, R = useDialogContext(OVERLAY_NAME$1, I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Combination_default, {
    as: Slot,
    allowPinchZoom: true,
    shards: [R.contentRef],
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
      "data-state": getState(R.open),
      ...L,
      ref: F,
      style: {
        pointerEvents: "auto",
        ...L.style
      }
    })
  });
}), CONTENT_NAME$1 = "DialogContent", DialogContent = import_react.forwardRef((t, F) => {
  let I = usePortalContext(CONTENT_NAME$1, t.__scopeDialog), { forceMount: L = I.forceMount, ...R } = t, z = useDialogContext(CONTENT_NAME$1, t.__scopeDialog);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
    present: L || z.open,
    children: z.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, {
      ...R,
      ref: F
    }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, {
      ...R,
      ref: F
    })
  });
});
DialogContent.displayName = CONTENT_NAME$1;
var DialogContentModal = import_react.forwardRef((t, F) => {
  let I = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), L = import_react.useRef(null), R = useComposedRefs(F, I.contentRef, L);
  return import_react.useEffect(() => {
    let t2 = L.current;
    if (t2) return hideOthers(t2);
  }, []), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
    ...t,
    ref: R,
    trapFocus: I.open,
    disableOutsidePointerEvents: true,
    onCloseAutoFocus: composeEventHandlers(t.onCloseAutoFocus, (t2) => {
      var _a;
      t2.preventDefault(), (_a = I.triggerRef.current) == null ? void 0 : _a.focus();
    }),
    onPointerDownOutside: composeEventHandlers(t.onPointerDownOutside, (t2) => {
      let F2 = t2.detail.originalEvent, I2 = F2.button === 0 && F2.ctrlKey === true;
      (F2.button === 2 || I2) && t2.preventDefault();
    }),
    onFocusOutside: composeEventHandlers(t.onFocusOutside, (t2) => t2.preventDefault())
  });
}), DialogContentNonModal = import_react.forwardRef((t, F) => {
  let I = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), L = import_react.useRef(false), R = import_react.useRef(false);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
    ...t,
    ref: F,
    trapFocus: false,
    disableOutsidePointerEvents: false,
    onCloseAutoFocus: (F2) => {
      var _a, _b;
      (_a = t.onCloseAutoFocus) == null ? void 0 : _a.call(t, F2), F2.defaultPrevented || (L.current || ((_b = I.triggerRef.current) == null ? void 0 : _b.focus()), F2.preventDefault()), L.current = false, R.current = false;
    },
    onInteractOutside: (F2) => {
      var _a, _b;
      (_a = t.onInteractOutside) == null ? void 0 : _a.call(t, F2), F2.defaultPrevented || (L.current = true, F2.detail.originalEvent.type === "pointerdown" && (R.current = true));
      let z = F2.target;
      ((_b = I.triggerRef.current) == null ? void 0 : _b.contains(z)) && F2.preventDefault(), F2.detail.originalEvent.type === "focusin" && R.current && F2.preventDefault();
    }
  });
}), DialogContentImpl = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, trapFocus: L, onOpenAutoFocus: R, onCloseAutoFocus: B, ...V } = t, H = useDialogContext(CONTENT_NAME$1, I), U = import_react.useRef(null), W = useComposedRefs(F, U);
  return useFocusGuards(), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
    asChild: true,
    loop: true,
    trapped: L,
    onMountAutoFocus: R,
    onUnmountAutoFocus: B,
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
      role: "dialog",
      id: H.contentId,
      "aria-describedby": H.descriptionId,
      "aria-labelledby": H.titleId,
      "data-state": getState(H.open),
      ...V,
      ref: W,
      onDismiss: () => H.onOpenChange(false)
    })
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: H.titleId }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning$1, {
    contentRef: U,
    descriptionId: H.descriptionId
  })] })] });
}), TITLE_NAME$1 = "DialogTitle", DialogTitle = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, ...L } = t, R = useDialogContext(TITLE_NAME$1, I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.h2, {
    id: R.titleId,
    ...L,
    ref: F
  });
});
DialogTitle.displayName = TITLE_NAME$1;
var DESCRIPTION_NAME$1 = "DialogDescription", DialogDescription = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, ...L } = t, R = useDialogContext(DESCRIPTION_NAME$1, I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.p, {
    id: R.descriptionId,
    ...L,
    ref: F
  });
});
DialogDescription.displayName = DESCRIPTION_NAME$1;
var CLOSE_NAME = "DialogClose", DialogClose = import_react.forwardRef((t, F) => {
  let { __scopeDialog: I, ...L } = t, R = useDialogContext(CLOSE_NAME, I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
    type: "button",
    ...L,
    ref: F,
    onClick: composeEventHandlers(t.onClick, () => R.onOpenChange(false))
  });
});
DialogClose.displayName = CLOSE_NAME;
function getState(t) {
  return t ? "open" : "closed";
}
var TITLE_WARNING_NAME = "DialogTitleWarning", [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
  contentName: CONTENT_NAME$1,
  titleName: TITLE_NAME$1,
  docsSlug: "dialog"
}), TitleWarning = ({ titleId: t }) => {
  let F = useWarningContext(TITLE_WARNING_NAME), I = `\`${F.contentName}\` requires a \`${F.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${F.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${F.docsSlug}`;
  return import_react.useEffect(() => {
    t && (document.getElementById(t) || console.error(I));
  }, [I, t]), null;
}, DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning", DescriptionWarning$1 = ({ contentRef: t, descriptionId: F }) => {
  let I = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
  return import_react.useEffect(() => {
    var _a;
    let L = (_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby");
    F && L && (document.getElementById(F) || console.warn(I));
  }, [
    I,
    t,
    F
  ]), null;
}, Root = Dialog, Trigger = DialogTrigger, Portal$1 = DialogPortal, Overlay = DialogOverlay, Content = DialogContent, Title = DialogTitle, Description = DialogDescription, Close = DialogClose, ROOT_NAME = "AlertDialog", [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [createDialogScope]), useDialogScope = createDialogScope(), AlertDialog$1 = (t) => {
  let { __scopeAlertDialog: F, ...I } = t, L = useDialogScope(F);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, {
    ...L,
    ...I,
    modal: true
  });
};
AlertDialog$1.displayName = ROOT_NAME;
var TRIGGER_NAME = "AlertDialogTrigger", AlertDialogTrigger$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
    ...R,
    ...L,
    ref: F
  });
});
AlertDialogTrigger$1.displayName = TRIGGER_NAME;
var PORTAL_NAME = "AlertDialogPortal", AlertDialogPortal$1 = (t) => {
  let { __scopeAlertDialog: F, ...I } = t, L = useDialogScope(F);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$1, {
    ...L,
    ...I
  });
};
AlertDialogPortal$1.displayName = PORTAL_NAME;
var OVERLAY_NAME = "AlertDialogOverlay", AlertDialogOverlay$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay, {
    ...R,
    ...L,
    ref: F
  });
});
AlertDialogOverlay$1.displayName = OVERLAY_NAME;
var CONTENT_NAME = "AlertDialogContent", [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME), Slottable = createSlottable("AlertDialogContent"), AlertDialogContent$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, children: L, ...R } = t, B = useDialogScope(I), V = import_react.useRef(null), H = useComposedRefs(F, V), U = import_react.useRef(null);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WarningProvider, {
    contentName: CONTENT_NAME,
    titleName: TITLE_NAME,
    docsSlug: "alert-dialog",
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentProvider, {
      scope: I,
      cancelRef: U,
      children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
        role: "alertdialog",
        ...B,
        ...R,
        ref: H,
        onOpenAutoFocus: composeEventHandlers(R.onOpenAutoFocus, (t2) => {
          var _a;
          t2.preventDefault(), (_a = U.current) == null ? void 0 : _a.focus({ preventScroll: true });
        }),
        onPointerDownOutside: (t2) => t2.preventDefault(),
        onInteractOutside: (t2) => t2.preventDefault(),
        children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable, { children: L }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef: V })]
      })
    })
  });
});
AlertDialogContent$1.displayName = CONTENT_NAME;
var TITLE_NAME = "AlertDialogTitle", AlertDialogTitle$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {
    ...R,
    ...L,
    ref: F
  });
});
AlertDialogTitle$1.displayName = TITLE_NAME;
var DESCRIPTION_NAME = "AlertDialogDescription", AlertDialogDescription$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
    ...R,
    ...L,
    ref: F
  });
});
AlertDialogDescription$1.displayName = DESCRIPTION_NAME;
var ACTION_NAME = "AlertDialogAction", AlertDialogAction$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, R = useDialogScope(I);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
    ...R,
    ...L,
    ref: F
  });
});
AlertDialogAction$1.displayName = ACTION_NAME;
var CANCEL_NAME = "AlertDialogCancel", AlertDialogCancel$1 = import_react.forwardRef((t, F) => {
  let { __scopeAlertDialog: I, ...L } = t, { cancelRef: R } = useAlertDialogContentContext(CANCEL_NAME, I), B = useDialogScope(I), V = useComposedRefs(F, R);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
    ...B,
    ...L,
    ref: V
  });
});
AlertDialogCancel$1.displayName = CANCEL_NAME;
var DescriptionWarning = ({ contentRef: t }) => {
  let F = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
  return import_react.useEffect(() => {
    var _a;
    document.getElementById((_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby")) || console.warn(F);
  }, [F, t]), null;
}, Root2 = AlertDialog$1, Portal2 = AlertDialogPortal$1, Overlay2 = AlertDialogOverlay$1, Content2 = AlertDialogContent$1, Action = AlertDialogAction$1, Cancel = AlertDialogCancel$1, Title2 = AlertDialogTitle$1, Description2 = AlertDialogDescription$1, DetailsSchema = object({ detail: string() }), ErrorSchema = object({ error: string() });
function prettyError(t) {
  if (!t) return "Unknown error";
  if (t instanceof Error) {
    let F = DetailsSchema.safeParse(t.cause);
    return F.success ? F.data.detail : maybeExtractDetails(t.message);
  }
  if (typeof t == "object") {
    let F = DetailsSchema.safeParse(t);
    if (F.success) return F.data.detail;
    let I = ErrorSchema.safeParse(t);
    if (I.success) return I.data.error;
  }
  try {
    return JSON.stringify(t);
  } catch {
    return String(t);
  }
}
function maybeExtractDetails(t) {
  let F = safeJSONParse(t);
  if (!F) return t;
  let I = DetailsSchema.safeParse(F);
  if (I.success) return I.data.detail;
  let L = ErrorSchema.safeParse(F);
  return L.success ? L.data.error : t;
}
function safeJSONParse(t) {
  try {
    return JSON.parse(t);
  } catch {
    return t;
  }
}
var CellNotInitializedError = class extends Error {
  constructor(t = "The cell containing this UI element has not been run yet. Please run the cell first.") {
    super(t), this.name = "CellNotInitializedError";
  }
}, import_compiler_runtime$2 = require_compiler_runtime();
function useRestoreFocus() {
  let t = (0, import_compiler_runtime$2.c)(3), [F, I] = (0, import_react.useState)(null), L;
  t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => {
    I(document.activeElement);
  }, t[0] = L) : L = t[0];
  let R = L, z;
  return t[1] === F ? z = t[2] : (z = {
    onOpenAutoFocus: R,
    onCloseAutoFocus: (t2) => {
      document.activeElement === document.body && (F instanceof HTMLElement && F.focus(), t2.preventDefault());
    }
  }, t[1] = F, t[2] = z), z;
}
var import_compiler_runtime$1 = require_compiler_runtime(), AlertDialog = Root2, AlertDialogPortal = withFullScreenAsRoot(({ children: t, ...F }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, {
  ...F,
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleNamespace, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: "fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]",
    children: t
  }) })
}));
AlertDialogPortal.displayName = Portal2.displayName;
var AlertDialogOverlay = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  if (I[0] !== t) {
    let { className: F2, children: R, ...B2 } = t;
    L = F2, z = B2, I[0] = t, I[1] = L, I[2] = z;
  } else L = I[1], z = I[2];
  let B;
  I[3] === L ? B = I[4] : (B = cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-xs transition-opacity animate-in fade-in", L), I[3] = L, I[4] = B);
  let V;
  return I[5] !== z || I[6] !== F || I[7] !== B ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay2, {
    className: B,
    ...z,
    ref: F
  }), I[5] = z, I[6] = F, I[7] = B, I[8] = V) : V = I[8], V;
});
AlertDialogOverlay.displayName = Overlay2.displayName;
var AlertDialogContent = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(11), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let B = useRestoreFocus(), V;
  I[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogOverlay, {}), I[3] = V) : V = I[3];
  let H;
  I[4] === L ? H = I[5] : (H = cn("fixed z-50 grid w-full max-w-2xl scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full", L), I[4] = L, I[5] = H);
  let U;
  return I[6] !== z || I[7] !== F || I[8] !== B || I[9] !== H ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogPortal, { children: [V, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2, {
    ref: F,
    className: H,
    ...B,
    ...z
  })] }), I[6] = z, I[7] = F, I[8] = B, I[9] = H, I[10] = U) : U = I[10], U;
});
AlertDialogContent.displayName = Content2.displayName;
var AlertDialogHeader = (t) => {
  let F = (0, import_compiler_runtime$1.c)(8), I, L;
  F[0] === t ? (I = F[1], L = F[2]) : ({ className: I, ...L } = t, F[0] = t, F[1] = I, F[2] = L);
  let z;
  F[3] === I ? z = F[4] : (z = cn("flex flex-col space-y-2 text-center sm:text-left", I), F[3] = I, F[4] = z);
  let B;
  return F[5] !== L || F[6] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: z,
    ...L
  }), F[5] = L, F[6] = z, F[7] = B) : B = F[7], B;
};
AlertDialogHeader.displayName = "AlertDialogHeader";
var AlertDialogFooter = (t) => {
  let F = (0, import_compiler_runtime$1.c)(8), I, L;
  F[0] === t ? (I = F[1], L = F[2]) : ({ className: I, ...L } = t, F[0] = t, F[1] = I, F[2] = L);
  let z;
  F[3] === I ? z = F[4] : (z = cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", I), F[3] = I, F[4] = z);
  let B;
  return F[5] !== L || F[6] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: z,
    ...L
  }), F[5] = L, F[6] = z, F[7] = B) : B = F[7], B;
};
AlertDialogFooter.displayName = "AlertDialogFooter";
var AlertDialogTitle = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let B;
  I[3] === L ? B = I[4] : (B = cn("text-lg font-semibold", L), I[3] = L, I[4] = B);
  let V;
  return I[5] !== z || I[6] !== F || I[7] !== B ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title2, {
    ref: F,
    className: B,
    ...z
  }), I[5] = z, I[6] = F, I[7] = B, I[8] = V) : V = I[8], V;
});
AlertDialogTitle.displayName = Title2.displayName;
var AlertDialogDescription = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let B;
  I[3] === L ? B = I[4] : (B = cn("text-muted-foreground", L), I[3] = L, I[4] = B);
  let V;
  return I[5] !== z || I[6] !== F || I[7] !== B ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description2, {
    ref: F,
    className: B,
    ...z
  }), I[5] = z, I[6] = F, I[7] = B, I[8] = V) : V = I[8], V;
});
AlertDialogDescription.displayName = Description2.displayName;
var AlertDialogAction = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let V;
  I[3] === L ? V = I[4] : (V = cn(buttonVariants(), L), I[3] = L, I[4] = V);
  let H;
  return I[5] !== z || I[6] !== F || I[7] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
    ref: F,
    className: V,
    ...z
  }), I[5] = z, I[6] = F, I[7] = V, I[8] = H) : H = I[8], H;
});
AlertDialogAction.displayName = Action.displayName;
var AlertDialogDestructiveAction = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let V;
  I[3] === L ? V = I[4] : (V = cn(buttonVariants({ variant: "destructive" }), L), I[3] = L, I[4] = V);
  let H;
  return I[5] !== z || I[6] !== F || I[7] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
    ref: F,
    className: V,
    ...z
  }), I[5] = z, I[6] = F, I[7] = V, I[8] = H) : H = I[8], H;
});
AlertDialogDestructiveAction.displayName = "AlertDialogDestructiveAction";
var AlertDialogCancel = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, z;
  I[0] === t ? (L = I[1], z = I[2]) : ({ className: L, ...z } = t, I[0] = t, I[1] = L, I[2] = z);
  let V;
  I[3] === L ? V = I[4] : (V = cn(buttonVariants({ variant: "secondary" }), "mt-2 sm:mt-0", L), I[3] = L, I[4] = V);
  let H;
  return I[5] !== z || I[6] !== F || I[7] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cancel, {
    ref: F,
    className: V,
    ...z
  }), I[5] = z, I[6] = F, I[7] = V, I[8] = H) : H = I[8], H;
});
AlertDialogCancel.displayName = Cancel.displayName;
var import_compiler_runtime = require_compiler_runtime();
const ErrorBanner = (t) => {
  let I = (0, import_compiler_runtime.c)(23), { error: L, className: R, action: z } = t, [B, V] = (0, import_react.useState)(false);
  if (!L) return null;
  Logger.error(L);
  let H;
  I[0] === L ? H = I[1] : (H = prettyError(L), I[0] = L, I[1] = H);
  let U = H, W;
  I[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => V(true), I[2] = W) : W = I[2];
  let G;
  I[3] === U ? G = I[4] : (G = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
    className: "line-clamp-4",
    children: U
  }), I[3] = U, I[4] = G);
  let K;
  I[5] === z ? K = I[6] : (K = z && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: "flex justify-end",
    children: z
  }), I[5] = z, I[6] = K);
  let q;
  I[7] !== R || I[8] !== G || I[9] !== K ? (q = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Banner, {
    kind: "danger",
    className: R,
    clickable: true,
    onClick: W,
    children: [G, K]
  }), I[7] = R, I[8] = G, I[9] = K, I[10] = q) : q = I[10];
  let J;
  I[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogTitle, {
    className: "text-error",
    children: "Error"
  }) }), I[11] = J) : J = I[11];
  let Y;
  I[12] === U ? Y = I[13] : (Y = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogDescription, {
    asChild: true,
    className: "text-error text-sm p-2 font-mono overflow-auto whitespace-pre-wrap",
    children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: U })
  }), I[12] = U, I[13] = Y);
  let X;
  I[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogAction, {
    autoFocus: true,
    onClick: () => V(false),
    children: "Ok"
  }) }), I[14] = X) : X = I[14];
  let Z;
  I[15] === Y ? Z = I[16] : (Z = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogContent, {
    className: "max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",
    children: [
      J,
      Y,
      X
    ]
  }), I[15] = Y, I[16] = Z);
  let Q;
  I[17] !== B || I[18] !== Z ? (Q = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog, {
    open: B,
    onOpenChange: V,
    children: Z
  }), I[17] = B, I[18] = Z, I[19] = Q) : Q = I[19];
  let $;
  return I[20] !== Q || I[21] !== q ? ($ = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [q, Q] }), I[20] = Q, I[21] = q, I[22] = $) : $ = I[22], $;
};
var bannerStyle = cva("text-sm p-2 border whitespace-pre-wrap overflow-hidden", {
  variants: {
    kind: {
      danger: "text-error border-(--red-6) shadow-md-solid shadow-error bg-(--red-1)",
      info: "text-primary border-(--blue-6) shadow-md-solid shadow-accent bg-(--blue-1)",
      warn: "border-(--yellow-6) bg-(--yellow-2) dark:bg-(--yellow-4) text-(--yellow-11) dark:text-(--yellow-12)"
    },
    clickable: { true: "cursor-pointer" }
  },
  compoundVariants: [
    {
      clickable: true,
      kind: "danger",
      className: "hover:bg-(--red-3)"
    },
    {
      clickable: true,
      kind: "info",
      className: "hover:bg-(--blue-3)"
    },
    {
      clickable: true,
      kind: "warn",
      className: "hover:bg-(--yellow-3)"
    }
  ],
  defaultVariants: { kind: "info" }
});
const Banner = (t) => {
  let F = (0, import_compiler_runtime.c)(14), I, L, z, B, V;
  F[0] === t ? (I = F[1], L = F[2], z = F[3], B = F[4], V = F[5]) : ({ kind: B, clickable: z, className: L, children: I, ...V } = t, F[0] = t, F[1] = I, F[2] = L, F[3] = z, F[4] = B, F[5] = V);
  let H;
  F[6] !== L || F[7] !== z || F[8] !== B ? (H = cn(bannerStyle({
    kind: B,
    clickable: z
  }), L), F[6] = L, F[7] = z, F[8] = B, F[9] = H) : H = F[9];
  let U;
  return F[10] !== I || F[11] !== V || F[12] !== H ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: H,
    ...V,
    children: I
  }), F[10] = I, F[11] = V, F[12] = H, F[13] = U) : U = F[13], U;
};
export {
  Content as a,
  Root as c,
  prettyError as i,
  ErrorBanner as n,
  Overlay as o,
  CellNotInitializedError as r,
  Portal$1 as s,
  Banner as t
};
