import { s as __toESM } from "./chunk-BNovOVIE.js";
import { t as require_react } from "./react-Bs6Z0kvn.js";
import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
import { d as createSlot, f as createSlottable, g as Logger, m as useComposedRefs, n as buttonVariants, r as cva, y as cn } from "./button-DNlNlZY_.js";
import { t as require_jsx_runtime } from "./jsx-runtime-9hcJiI23.js";
import { $ as StyleNamespace, P as object, R as string, X as withFullScreenAsRoot, at as FocusScope, ct as useId, et as hideOthers, ft as composeEventHandlers, ht as Primitive, it as Portal, lt as Presence, mt as createContextScope, ot as DismissableLayer, pt as createContext2, rt as useFocusGuards, tt as Combination_default, ut as useControllableState } from "./zod-C6UGQ3fz.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), z = 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: z,
    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: z, ...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: z,
    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, z = 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",
        ...z,
        ...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), z = useDialogScope(I), V = useComposedRefs(F, R);
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
    ...z,
    ...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, R;
  if (I[0] !== t) {
    let { className: F2, children: z2, ...B2 } = t;
    L = F2, R = B2, I[0] = t, I[1] = L, I[2] = R;
  } else L = I[1], R = I[2];
  let z;
  I[3] === L ? z = I[4] : (z = cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-xs transition-opacity animate-in fade-in", L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay2, {
    className: z,
    ...R,
    ref: F
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogOverlay.displayName = Overlay2.displayName;
var AlertDialogContent = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(11), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z = useRestoreFocus(), B;
  I[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogOverlay, {}), I[3] = B) : B = I[3];
  let V;
  I[4] === L ? V = I[5] : (V = 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] = V);
  let H;
  return I[6] !== R || I[7] !== F || I[8] !== z || I[9] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogPortal, { children: [B, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2, {
    ref: F,
    className: V,
    ...z,
    ...R
  })] }), I[6] = R, I[7] = F, I[8] = z, I[9] = V, I[10] = H) : H = I[10], H;
});
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 R;
  F[3] === I ? R = F[4] : (R = cn("flex flex-col space-y-2 text-center sm:text-left", I), F[3] = I, F[4] = R);
  let z;
  return F[5] !== L || F[6] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: R,
    ...L
  }), F[5] = L, F[6] = R, F[7] = z) : z = F[7], z;
};
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 R;
  F[3] === I ? R = F[4] : (R = cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", I), F[3] = I, F[4] = R);
  let z;
  return F[5] !== L || F[6] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: R,
    ...L
  }), F[5] = L, F[6] = R, F[7] = z) : z = F[7], z;
};
AlertDialogFooter.displayName = "AlertDialogFooter";
var AlertDialogTitle = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z;
  I[3] === L ? z = I[4] : (z = cn("text-lg font-semibold", L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title2, {
    ref: F,
    className: z,
    ...R
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogTitle.displayName = Title2.displayName;
var AlertDialogDescription = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z;
  I[3] === L ? z = I[4] : (z = cn("text-muted-foreground", L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description2, {
    ref: F,
    className: z,
    ...R
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogDescription.displayName = Description2.displayName;
var AlertDialogAction = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z;
  I[3] === L ? z = I[4] : (z = cn(buttonVariants(), L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
    ref: F,
    className: z,
    ...R
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogAction.displayName = Action.displayName;
var AlertDialogDestructiveAction = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z;
  I[3] === L ? z = I[4] : (z = cn(buttonVariants({ variant: "destructive" }), L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
    ref: F,
    className: z,
    ...R
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogDestructiveAction.displayName = "AlertDialogDestructiveAction";
var AlertDialogCancel = import_react.forwardRef((t, F) => {
  let I = (0, import_compiler_runtime$1.c)(9), L, R;
  I[0] === t ? (L = I[1], R = I[2]) : ({ className: L, ...R } = t, I[0] = t, I[1] = L, I[2] = R);
  let z;
  I[3] === L ? z = I[4] : (z = cn(buttonVariants({ variant: "secondary" }), "mt-2 sm:mt-0", L), I[3] = L, I[4] = z);
  let B;
  return I[5] !== R || I[6] !== F || I[7] !== z ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cancel, {
    ref: F,
    className: z,
    ...R
  }), I[5] = R, I[6] = F, I[7] = z, I[8] = B) : B = I[8], B;
});
AlertDialogCancel.displayName = Cancel.displayName;
var import_compiler_runtime = require_compiler_runtime();
const ErrorBanner = (t) => {
  let F = (0, import_compiler_runtime.c)(23), { error: I, className: L, action: R } = t, [B, V] = (0, import_react.useState)(false);
  if (!I) return null;
  Logger.error(I);
  let H;
  F[0] === I ? H = F[1] : (H = prettyError(I), F[0] = I, F[1] = H);
  let U = H, W;
  F[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => V(true), F[2] = W) : W = F[2];
  let G;
  F[3] === U ? G = F[4] : (G = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
    className: "line-clamp-4",
    children: U
  }), F[3] = U, F[4] = G);
  let K;
  F[5] === R ? K = F[6] : (K = R && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: "flex justify-end",
    children: R
  }), F[5] = R, F[6] = K);
  let q;
  F[7] !== L || F[8] !== G || F[9] !== K ? (q = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Banner, {
    kind: "danger",
    className: L,
    clickable: true,
    onClick: W,
    children: [G, K]
  }), F[7] = L, F[8] = G, F[9] = K, F[10] = q) : q = F[10];
  let J;
  F[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"
  }) }), F[11] = J) : J = F[11];
  let Y;
  F[12] === U ? Y = F[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 })
  }), F[12] = U, F[13] = Y);
  let X;
  F[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"
  }) }), F[14] = X) : X = F[14];
  let Z;
  F[15] === Y ? Z = F[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
    ]
  }), F[15] = Y, F[16] = Z);
  let Q;
  F[17] !== B || F[18] !== Z ? (Q = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog, {
    open: B,
    onOpenChange: V,
    children: Z
  }), F[17] = B, F[18] = Z, F[19] = Q) : Q = F[19];
  let $;
  return F[20] !== Q || F[21] !== q ? ($ = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [q, Q] }), F[20] = Q, F[21] = q, F[22] = $) : $ = F[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, R, z, B;
  F[0] === t ? (I = F[1], L = F[2], R = F[3], z = F[4], B = F[5]) : ({ kind: z, clickable: R, className: L, children: I, ...B } = t, F[0] = t, F[1] = I, F[2] = L, F[3] = R, F[4] = z, F[5] = B);
  let V;
  F[6] !== L || F[7] !== R || F[8] !== z ? (V = cn(bannerStyle({
    kind: z,
    clickable: R
  }), L), F[6] = L, F[7] = R, F[8] = z, F[9] = V) : V = F[9];
  let H;
  return F[10] !== I || F[11] !== B || F[12] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
    className: V,
    ...B,
    children: I
  }), F[10] = I, F[11] = B, F[12] = V, F[13] = H) : H = F[13], H;
};
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
};
