"use client";
import "./chunk-KHHFHXXD.mjs";
import {
  ConditionalWrapper,
  DefaultAvatar,
  EventMarketPage,
  HomePage,
  USER_PROFILE_TAB_ACTIVITY,
  USER_PROFILE_TAB_OPEN_ORDERS,
  USER_PROFILE_TAB_POSITIONS,
  UserProfilePage,
  buildAggTxExplorerHref,
  useHomePageModals
} from "./chunk-IQT4I5B4.mjs";
import {
  EventList,
  EventListItem,
  EventListItemDetails,
  EventListItemV2,
  MarketDetails,
  MarketDetailsList,
  Orderbook,
  OrderbookWithStates,
  SettlementSummary,
  collectEligibleVenueOutcomeIds,
  collectEligibleVenueOutcomes,
  mergeVenueOutcomeOrderbooks,
  orderbookRowLimitDefault,
  useCenterOrderbookSpread
} from "./chunk-NK57KMYN.mjs";
import {
  CARD_NETWORK_OPTIONS,
  ConnectAccountsStep,
  ConnectKalshiModal,
  ConnectOnchainModal,
  DepositModal,
  GeoBlockModal,
  HowItWorksStep,
  OnboardingModal,
  ProfileModal,
  ProfileSetupStep,
  WithdrawModal,
  buildTerminalSummary,
  clearPendingCardSession,
  getPendingCardSession,
  subscribeAggDepositNotification
} from "./chunk-WU2C3C6K.mjs";
import {
  DEPOSIT_MODAL_OPEN_EVENT,
  PlaceOrder,
  PlaceOrderFailureView,
  PlaceOrderSuccessView,
  SettlementDetails,
  WITHDRAW_MODAL_OPEN_EVENT,
  parseAmount,
  parseVenue,
  requestAggDepositModalOpen,
  requestAggWithdrawModalOpen
} from "./chunk-XHDGSRG7.mjs";
import {
  SETTLEMENT_SECTION_ID,
  Settlement,
  defaultSettlementSectionLabel,
  defaultTradingDisclaimer,
  formatProbabilityCents,
  getTradingAveragePriceLabel,
  getTradingBalanceLabel,
  getTradingDateLabel,
  getTradingPriceLabel,
  getTradingSharesLabel,
  getTradingSlippageLabel,
  getTradingValueLabel,
  getTradingVenueLabel,
  resolveOrderBookRows,
  resolveUnifiedOrderBookEntries,
  useEventTradingContext
} from "./chunk-TERG43WW.mjs";
import {
  GeoBlockBanner
} from "./chunk-RPXRTXCY.mjs";
import {
  AGG_DEFAULT_URL,
  AGG_DOCS_URL,
  AGG_PRIVACY_POLICY_URL,
  AGG_ROOT_CLASS_NAME,
  AGG_TERMS_OF_SERVICE_URL,
  ActivityChartIcon,
  AggErrorBoundary,
  AggLogo,
  AppleIcon,
  AppsIcon,
  ArbitrumIcon,
  ArrowRightIcon,
  ArrowTrendUpIcon,
  ArrowsToDotIcon,
  AutocompleteSelect,
  Badge,
  BadgeCheckThinIcon,
  BankIcon,
  BaseIcon,
  BestPricesIcon,
  BnbIcon,
  BoltIcon,
  Button,
  Card,
  ChartCandlestickIcon,
  ChartLineIcon,
  CheckCircleIcon,
  ChevronDownIcon,
  ChevronLeftIcon,
  ChevronRightIcon,
  ChevronUpIcon,
  CircleOverlapIcon,
  CircleXmarkIcon,
  CloseIcon,
  CopyButton,
  CopyIcon,
  CreateAccountIcon,
  CreditCardIcon,
  CurrencyInput,
  DisconnectIcon,
  DocumentIcon,
  DotsHorizontalIcon,
  DownloadIcon,
  ErrorFilledIcon,
  EthereumIcon,
  ExternalLinkIcon,
  Footer,
  GiftBonusIcon,
  GoogleIcon,
  Header,
  HourglassStartIcon,
  Icon,
  ImageIcon,
  InfoIcon,
  InlineAlert,
  LineChart,
  LinkAccountsIcon,
  LoadingIcon,
  LockIcon,
  Modal,
  NumberValue,
  PaperModeIcon,
  PaperPlaneIcon,
  PencilIcon,
  PlaceOrderRouteCardSkeleton,
  PlaySquareIcon,
  PolygonIcon,
  ProfileIcon,
  RemoteImage,
  RevenueAltIcon,
  Search,
  SearchIcon,
  Select,
  ShieldTrustIcon,
  Skeleton,
  SolanaIcon,
  SparklesFilledIcon,
  StateMessage,
  StayInControlIcon,
  SuccessCheckIcon,
  SwitchButton,
  Tabs,
  ToastProvider,
  Tooltip,
  TriangleDownIcon,
  TriangleUpFilledIcon,
  TriangleUpIcon,
  Typography,
  UploadIcon,
  UsdcIcon,
  UserTrustIcon,
  VenueLogo,
  WalletAvatarIcon,
  WalletFilledIcon,
  WalletIcon,
  WarningFilledIcon,
  WarningIcon,
  __objRest,
  __spreadProps,
  __spreadValues,
  badgeSizes,
  cn,
  formatAmountDisplay,
  formatCompactUsd,
  formatTokenAmount,
  formatUsd,
  getMotionClassName,
  getScrollBehavior,
  iconNames,
  isTruthy,
  isValidDateValue,
  shortenAddress,
  skeletonViews,
  toDate,
  typographyVariants,
  useOptionalToast,
  useToast,
  venueLogoNames
} from "./chunk-YJO6LMRT.mjs";

// src/notifications/agg-notification-events-provider.tsx
import {
  useAggAuthState,
  useAggLabels,
  useAggUiConfig,
  useOnOrderEvent,
  useOnWithdrawalLifecycle,
  useOptionalAggClient,
  useUserActivity
} from "@agg-build/hooks";
import { useCallback, useEffect, useRef } from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
function AggNotificationEventsProvider({
  children,
  enabled = true,
  depositActivityLimit = 25
}) {
  const aggClient = useOptionalAggClient();
  if (!aggClient) {
    return /* @__PURE__ */ jsx(Fragment, { children });
  }
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsx(AggNotificationEventsBridge, { enabled, depositActivityLimit }),
    children
  ] });
}
var TERMINAL_ORDER_EVENTS = /* @__PURE__ */ new Set(["filled", "partial_fill", "failed"]);
var TERMINAL_WITHDRAWAL_STATUSES = /* @__PURE__ */ new Set([
  "completed",
  "partial",
  "failed"
]);
var isTerminalWithdrawalStatus = (value) => TERMINAL_WITHDRAWAL_STATUSES.has(value);
var MICRO_UNITS_SCALE = 1e6;
var formatScaledMicroAmount = (value) => {
  if (!value) return void 0;
  if (value.includes(".")) {
    const parsed = Number(value);
    if (!Number.isFinite(parsed)) return void 0;
    return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
  }
  try {
    const raw = BigInt(value);
    const whole = raw / BigInt(MICRO_UNITS_SCALE);
    const remainder = raw % BigInt(MICRO_UNITS_SCALE);
    const parsed = Number(whole) + Number(remainder) / MICRO_UNITS_SCALE;
    return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
  } catch (e) {
    const parsed = Number(value);
    if (!Number.isFinite(parsed)) return void 0;
    return (parsed / MICRO_UNITS_SCALE).toLocaleString("en-US", { maximumFractionDigits: 2 });
  }
};
var formatDecimalAmount = (value) => {
  if (!value) return void 0;
  const parsed = Number(value.replace(/,/g, ""));
  if (!Number.isFinite(parsed)) return value;
  return parsed.toLocaleString("en-US", { maximumFractionDigits: 2 });
};
var formatPriceCents = (value) => {
  if (!value) return void 0;
  const parsed = Number(value);
  if (!Number.isFinite(parsed)) return void 0;
  const cents = parsed * 100;
  const display = cents.toLocaleString("en-US", {
    minimumFractionDigits: 0,
    maximumFractionDigits: 1
  });
  return `${display}\xA2`;
};
var formatSharesLabel = (raw) => {
  const formatted = formatScaledMicroAmount(raw);
  if (!formatted) return void 0;
  return `${formatted} shares`;
};
var capitalize = (value) => {
  if (!value) return void 0;
  return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
};
var venueLabelFor = (venueKey, labels) => {
  var _a;
  if (!venueKey) return void 0;
  const normalized = venueKey.toLowerCase();
  const lookup = labels.venues;
  return (_a = lookup[normalized]) != null ? _a : capitalize(venueKey);
};
function AggNotificationEventsBridge({ enabled, depositActivityLimit }) {
  var _a;
  const toastCtx = useOptionalToast();
  const { user, isAuthenticated } = useAggAuthState();
  const labels = useAggLabels();
  const { features } = useAggUiConfig();
  const notificationsFeatureEnabled = features.enableNotifications !== false;
  const effectivelyEnabled = enabled && notificationsFeatureEnabled;
  const currentUserId = (_a = user == null ? void 0 : user.id) != null ? _a : null;
  const firedKeysRef = useRef(/* @__PURE__ */ new Set());
  const depositStatusesRef = useRef(/* @__PURE__ */ new Map());
  const hasSeededDepositStatusesRef = useRef(false);
  const recentClientDepositFingerprintsRef = useRef(/* @__PURE__ */ new Map());
  const lastUserIdRef = useRef("uninitialized");
  useEffect(() => {
    if (lastUserIdRef.current === currentUserId) return;
    lastUserIdRef.current = currentUserId;
    firedKeysRef.current = /* @__PURE__ */ new Set();
    depositStatusesRef.current = /* @__PURE__ */ new Map();
    hasSeededDepositStatusesRef.current = false;
    recentClientDepositFingerprintsRef.current = /* @__PURE__ */ new Map();
  }, [currentUserId]);
  const fireOnce = useCallback(
    (key, tone, title, message, detail) => {
      if (!effectivelyEnabled) return;
      const toast = toastCtx == null ? void 0 : toastCtx.toast;
      if (!toast) return;
      if (firedKeysRef.current.has(key)) return;
      firedKeysRef.current.add(key);
      toast(message, { tone, title, detail });
    },
    [effectivelyEnabled, toastCtx]
  );
  const orderEventCallback = useCallback(
    (event) => {
      if (!effectivelyEnabled || !isAuthenticated) return;
      if (!currentUserId || event.userId !== currentUserId) return;
      if (!TERMINAL_ORDER_EVENTS.has(event.event)) return;
      handleOrderEvent({ event, labels, fireOnce });
    },
    [currentUserId, effectivelyEnabled, fireOnce, isAuthenticated, labels]
  );
  useOnOrderEvent(orderEventCallback);
  const withdrawalCallback = useCallback(
    (event) => {
      if (!effectivelyEnabled || !isAuthenticated) return;
      if (!currentUserId || event.userId !== currentUserId) return;
      if (!event.terminal) return;
      if (!isTerminalWithdrawalStatus(event.status)) return;
      handleWithdrawalEvent({ event, labels, fireOnce });
    },
    [currentUserId, effectivelyEnabled, fireOnce, isAuthenticated, labels]
  );
  useOnWithdrawalLifecycle(withdrawalCallback);
  useEffect(() => {
    if (!effectivelyEnabled || !isAuthenticated || !currentUserId) return;
    return subscribeAggDepositNotification((event) => {
      handleClientDepositNotification({
        event,
        labels,
        fireOnce,
        recentClientDepositFingerprints: recentClientDepositFingerprintsRef.current
      });
    });
  }, [currentUserId, effectivelyEnabled, fireOnce, isAuthenticated, labels]);
  const depositActivity = useUserActivity({
    type: "deposit",
    limit: depositActivityLimit,
    enabled: effectivelyEnabled && isAuthenticated && currentUserId !== null
  });
  const depositActivities = depositActivity.activities;
  useEffect(() => {
    if (!effectivelyEnabled || !isAuthenticated || !currentUserId) return;
    if (!depositActivity.isSuccess) return;
    handleDepositActivities({
      deposits: depositActivities,
      previousStatuses: depositStatusesRef.current,
      hasSeededStatuses: hasSeededDepositStatusesRef.current,
      labels,
      fireOnce,
      shouldSuppressToast: (status, amountLabel, tokenLabel) => hasRecentClientDepositNotification({
        recentClientDepositFingerprints: recentClientDepositFingerprintsRef.current,
        status,
        amountLabel,
        tokenLabel
      })
    });
    hasSeededDepositStatusesRef.current = true;
  }, [
    currentUserId,
    depositActivities,
    depositActivity.isSuccess,
    effectivelyEnabled,
    fireOnce,
    isAuthenticated,
    labels
  ]);
  return null;
}
function handleOrderEvent({ event, labels, fireOnce }) {
  var _a, _b;
  const venueLabel = venueLabelFor(event.venue, labels);
  const amountLabel = formatSharesLabel((_a = event.actualSharesRaw) != null ? _a : event.filledAmountRaw);
  const priceLabel = formatPriceCents((_b = event.executionPriceRaw) != null ? _b : event.quotedPriceRaw);
  if (event.event === "filled") {
    fireOnce(
      `order:${event.orderId}:filled`,
      "success",
      labels.notifications.order.filledTitle,
      labels.notifications.order.filledMessage({ venueLabel, amountLabel, priceLabel })
    );
    return;
  }
  if (event.event === "partial_fill") {
    fireOnce(
      `order:${event.orderId}:partial_fill`,
      "warning",
      labels.notifications.order.partialFilledTitle,
      labels.notifications.order.partialFilledMessage({ venueLabel, amountLabel, priceLabel })
    );
    return;
  }
  if (event.event === "failed") {
    fireOnce(
      `order:${event.orderId}:failed`,
      "error",
      labels.notifications.order.failedTitle,
      labels.notifications.order.failedMessage(event.errorReason),
      venueLabel
    );
  }
}
function handleWithdrawalEvent({ event, labels, fireOnce }) {
  var _a;
  const amountLabel = formatScaledMicroAmount((_a = event.completedAmountRaw) != null ? _a : event.requestedAmountRaw);
  if (event.status === "completed") {
    fireOnce(
      `withdrawal:${event.withdrawalId}:completed`,
      "success",
      labels.notifications.withdrawal.completedTitle,
      labels.notifications.withdrawal.completedMessage({ amountLabel })
    );
    return;
  }
  if (event.status === "partial") {
    fireOnce(
      `withdrawal:${event.withdrawalId}:partial`,
      "warning",
      labels.notifications.withdrawal.partialTitle,
      labels.notifications.withdrawal.partialMessage({ amountLabel })
    );
    return;
  }
  if (event.status === "failed") {
    fireOnce(
      `withdrawal:${event.withdrawalId}:failed`,
      "error",
      labels.notifications.withdrawal.failedTitle,
      labels.notifications.withdrawal.failedMessage(event.errorMessage)
    );
  }
}
var DEPOSIT_COMPLETED_STATUSES = /* @__PURE__ */ new Set(["completed", "confirmed", "succeeded", "success"]);
var DEPOSIT_FAILED_STATUSES = /* @__PURE__ */ new Set(["failed", "errored", "rejected"]);
var CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS = 2 * 60 * 1e3;
var isTerminalDepositStatus = (status) => DEPOSIT_COMPLETED_STATUSES.has(status) || DEPOSIT_FAILED_STATUSES.has(status);
var getDepositNotificationFingerprint = ({
  status,
  amountLabel,
  tokenLabel
}) => `${status}:${amountLabel != null ? amountLabel : ""}:${tokenLabel != null ? tokenLabel : ""}`.toLowerCase();
var hasRecentClientDepositNotification = ({
  recentClientDepositFingerprints,
  status,
  amountLabel,
  tokenLabel
}) => {
  const fingerprint = getDepositNotificationFingerprint({ status, amountLabel, tokenLabel });
  const lastNotifiedAt = recentClientDepositFingerprints.get(fingerprint);
  if (!lastNotifiedAt) return false;
  if (Date.now() - lastNotifiedAt <= CLIENT_DEPOSIT_ACTIVITY_SUPPRESSION_MS) {
    return true;
  }
  recentClientDepositFingerprints.delete(fingerprint);
  return false;
};
function handleClientDepositNotification({
  event,
  labels,
  fireOnce,
  recentClientDepositFingerprints
}) {
  var _a, _b, _c;
  const amountLabel = formatDecimalAmount(event.amount);
  const tokenLabel = event.tokenSymbol;
  const fingerprint = getDepositNotificationFingerprint({
    status: event.status,
    amountLabel,
    tokenLabel
  });
  recentClientDepositFingerprints.set(fingerprint, Date.now());
  if (event.status === "completed") {
    fireOnce(
      `deposit-client:${(_a = event.id) != null ? _a : fingerprint}:completed`,
      "success",
      labels.notifications.deposit.completedTitle,
      labels.notifications.deposit.completedMessage({ amountLabel, tokenLabel })
    );
    return;
  }
  fireOnce(
    `deposit-client:${(_b = event.id) != null ? _b : fingerprint}:failed`,
    "error",
    labels.notifications.deposit.failedTitle,
    (_c = event.errorMessage) != null ? _c : labels.notifications.deposit.failedMessage({ amountLabel, tokenLabel })
  );
}
function handleDepositActivities({
  deposits,
  previousStatuses,
  hasSeededStatuses,
  labels,
  fireOnce,
  shouldSuppressToast
}) {
  for (const item of deposits) {
    if (item.type !== "deposit") continue;
    const deposit = item;
    const status = deposit.status.toLowerCase();
    const isCompleted = DEPOSIT_COMPLETED_STATUSES.has(status);
    const isFailed = DEPOSIT_FAILED_STATUSES.has(status);
    const previousStatus = previousStatuses.get(deposit.id);
    previousStatuses.set(deposit.id, status);
    if (!hasSeededStatuses) continue;
    if (!previousStatus) continue;
    if (isTerminalDepositStatus(previousStatus)) continue;
    if (!isCompleted && !isFailed) continue;
    const amountLabel = formatScaledMicroAmount(deposit.amountRaw);
    const tokenLabel = deposit.tokenSymbol;
    const terminalStatus = isCompleted ? "completed" : "failed";
    if (shouldSuppressToast == null ? void 0 : shouldSuppressToast(terminalStatus, amountLabel, tokenLabel)) continue;
    if (isCompleted) {
      fireOnce(
        `deposit:${deposit.id}:completed`,
        "success",
        labels.notifications.deposit.completedTitle,
        labels.notifications.deposit.completedMessage({ amountLabel, tokenLabel })
      );
    } else {
      fireOnce(
        `deposit:${deposit.id}:failed`,
        "error",
        labels.notifications.deposit.failedTitle,
        labels.notifications.deposit.failedMessage({ amountLabel, tokenLabel })
      );
    }
  }
}

// src/notifications/agg-toast-provider.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
function AggToastProvider(_a) {
  var _b = _a, {
    children,
    disableAggNotifications = false,
    notificationDepositActivityLimit
  } = _b, toastProps = __objRest(_b, [
    "children",
    "disableAggNotifications",
    "notificationDepositActivityLimit"
  ]);
  return /* @__PURE__ */ jsx2(ToastProvider, __spreadProps(__spreadValues({}, toastProps), { children: disableAggNotifications ? children : /* @__PURE__ */ jsx2(AggNotificationEventsProvider, { depositActivityLimit: notificationDepositActivityLimit, children }) }));
}

// src/agg-provider.tsx
import {
  AggProvider as AggSdkProvider
} from "@agg-build/hooks";
import { jsx as jsx3 } from "react/jsx-runtime";
function AggProvider(_a) {
  var _b = _a, { children, toast } = _b, providerProps = __objRest(_b, ["children", "toast"]);
  return /* @__PURE__ */ jsx3(AggSdkProvider, __spreadProps(__spreadValues({}, providerProps), { children: /* @__PURE__ */ jsx3(AggToastProvider, __spreadProps(__spreadValues({}, toast), { children })) }));
}

// src/auth/connect-button-view/index.tsx
import { optimizedImageUrl, useAggAuthContext, useLabels, useSdkUiConfig } from "@agg-build/hooks";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";

// src/auth/connect-button-view/connect-button-view.constants.ts
var connectButtonContainerClassName = cn(
  "inline-flex flex-col items-start gap-2 font-agg-sans max-w-full"
);
var authNoticeClassName = cn("text-agg-xs leading-agg-4 text-agg-muted-foreground");
var authErrorClassName = cn("text-agg-sm leading-agg-5 text-red-500");
var authModalContainerClassName = cn("max-w-[400px] rounded-[24px]");
var authModalBodyClassName = cn("px-8 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-6");
var authSectionClassName = cn("flex w-full flex-col gap-5");
var authSectionHeadingClassName = cn(
  "text-center text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground"
);
var authMethodsListClassName = cn("flex w-full flex-col gap-6 pt-2");
var authInputFormClassName = cn("flex w-full flex-col gap-3");
var authInputFieldClassName = cn(
  "h-10 w-full rounded-[4px] border border-agg-separator bg-agg-secondary px-4 text-agg-base leading-agg-6 text-agg-foreground outline-none",
  "placeholder:text-agg-muted-foreground focus-visible:border-agg-primary-hover focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-[-1px] focus-visible:ring-offset-agg-secondary",
  "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
);
var authPrimaryActionClassName = cn("h-10 w-full");
var authMethodGridClassName = cn(
  "grid w-full gap-3 [grid-template-columns:repeat(auto-fit,minmax(60px,1fr))]",
  "[&>*]:w-full [&>*]:mx-auto"
);
var authWalletMethodGridClassName = cn("flex w-full flex-col gap-2");
var authSocialButtonClassName = cn(
  "cursor-pointer! hover:cursor-pointer hover:bg-agg-secondary-hover",
  "flex h-[60px] items-center justify-center rounded-xl border border-agg-separator bg-agg-secondary text-agg-foreground",
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
  "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
);
var authWalletButtonClassName = cn(
  "cursor-pointer! hover:cursor-pointer hover:bg-agg-secondary-hover",
  "flex h-12 items-center justify-center gap-2 rounded-agg-full border border-agg-separator bg-agg-secondary px-4 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground",
  "hover:bg-agg-secondary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
  "disabled:cursor-not-allowed disabled:text-agg-muted-foreground"
);
var authWalletIconGroupClassName = cn("flex items-center justify-center -space-x-2");
var authHelperTextClassName = cn(
  "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground"
);
var authHelperLinkClassName = cn("underline underline-offset-2 decoration-current");
var authDividerClassName = cn("flex w-full items-center gap-3");
var authDividerLineClassName = cn("h-px flex-1 bg-agg-separator");
var authDividerLabelClassName = cn(
  "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground"
);
var authLegalTextClassName = cn(
  "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground"
);
var connectedButtonsRowClassName = cn("inline-flex h-10 items-center gap-2 max-w-full");
var connectedBalanceChipClassName = cn(
  "hidden md:inline-flex",
  "h-10 items-center gap-4 rounded-agg-full border border-agg-separator bg-agg-secondary pl-[12px] pr-13 font-agg-sans"
);
var profileMenuContentClassName = cn(
  "z-50 w-64 max-w-[calc(100vw-2rem)] overflow-hidden rounded-agg-xl font-agg-sans",
  "border border-agg-separator bg-agg-secondary",
  "shadow-agg-popover"
);
var profileMenuSectionClassName = cn("flex w-full flex-col gap-5 px-5 py-5");
var profileMenuSeparatorClassName = cn("h-px w-full bg-agg-separator");
var profileMenuActionItemClassName = cn(
  "flex w-full items-center gap-3 px-5 py-4 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground",
  "outline-none",
  "hover:bg-agg-secondary-hover focus:bg-agg-secondary-hover"
);
var avatarRootClassName = cn(
  "inline-flex size-6 shrink-0 items-center justify-center rounded-agg-full bg-agg-separator"
);
var avatarIconClassName = cn("h-[66%] w-[66%] text-agg-muted-foreground");

// src/auth/connect-button-view/index.tsx
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
var WalletAvatar = ({ className }) => {
  const { isAuthenticated, user } = useAggAuthContext();
  if (isAuthenticated && (user == null ? void 0 : user.avatarUrl)) {
    return /* @__PURE__ */ jsx4(
      "img",
      {
        src: optimizedImageUrl(user.avatarUrl, 44),
        alt: "Avatar",
        className: cn(avatarRootClassName, className)
      }
    );
  }
  return /* @__PURE__ */ jsx4(DefaultAvatar, { className: cn("size-6 shrink-0 rounded-full", className) });
};
var AuthMethodActionButton = ({
  activeMethodId,
  className,
  disabled,
  method,
  onSelect,
  renderLabel = true
}) => {
  var _a;
  const labels = useLabels();
  const isMethodLoading = activeMethodId === method.id;
  const isMethodDisabled = disabled || !method.isAvailable || activeMethodId !== null && !isMethodLoading;
  return /* @__PURE__ */ jsxs2(
    "button",
    {
      type: "button",
      className,
      disabled: isMethodDisabled,
      "aria-busy": isMethodLoading || void 0,
      "aria-label": labels.auth.signInWithMethod(method.label),
      onClick: () => onSelect(method.id),
      children: [
        isMethodLoading ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "small" }) : /* @__PURE__ */ jsx4(
          Icon,
          {
            name: (_a = method.iconName) != null ? _a : "profile",
            size: "medium",
            className: cn("!rounded-agg-lg", renderLabel ? void 0 : "h-6 w-6 text-agg-foreground"),
            title: renderLabel ? void 0 : method.label
          }
        ),
        renderLabel ? /* @__PURE__ */ jsx4("span", { children: labels.auth.connect(method.label) }) : null
      ]
    }
  );
};
var UnauthenticatedConnectView = ({
  activeMethodId,
  buttonProps,
  challengeContent,
  classNames,
  disabled,
  emailMethod,
  emailError,
  emailValue,
  errorMessage,
  isBusy,
  isChooserOpen,
  notice,
  onChooserOpenChange,
  onEmailChange,
  onEmailSubmit,
  onMethodSelect,
  socialMethods,
  walletMethods
}) => {
  var _a, _b, _c, _d, _e;
  const labels = useLabels();
  const hasConfiguredMethods = emailMethod !== null || socialMethods.length > 0 || walletMethods.length > 0;
  const showWalletDivider = walletMethods.length > 0 && (emailMethod !== null || socialMethods.length > 0);
  return /* @__PURE__ */ jsxs2("div", { className: cn(connectButtonContainerClassName, classNames == null ? void 0 : classNames.root), children: [
    /* @__PURE__ */ jsx4(
      Button,
      __spreadProps(__spreadValues({
        variant: "primary",
        size: "large",
        className: classNames == null ? void 0 : classNames.connectButton,
        onClick: () => onChooserOpenChange(true),
        disabled: disabled || !hasConfiguredMethods,
        "aria-label": labels.auth.connect()
      }, buttonProps), {
        children: labels.auth.connect()
      })
    ),
    notice ? /* @__PURE__ */ jsx4("p", { className: cn(authNoticeClassName, classNames == null ? void 0 : classNames.authNotice), children: notice }) : null,
    /* @__PURE__ */ jsx4(Modal, { open: isChooserOpen || !!challengeContent, onOpenChange: onChooserOpenChange, children: /* @__PURE__ */ jsxs2(
      Modal.Container,
      {
        maxWidth: "400px",
        classNames: {
          container: cn(authModalContainerClassName, classNames == null ? void 0 : classNames.authModalContent)
        },
        "aria-label": challengeContent ? "Security Check" : labels.auth.signIn,
        children: [
          /* @__PURE__ */ jsx4(
            Modal.Header,
            {
              title: challengeContent ? "Security Check" : labels.auth.signIn,
              hideBorder: true,
              classNames: {
                container: "px-8 py-6",
                title: "text-agg-2xl leading-agg-8",
                titleContainer: "max-w-none"
              }
            }
          ),
          /* @__PURE__ */ jsx4(Modal.Body, { classNames: { root: authModalBodyClassName }, children: challengeContent ? challengeContent : /* @__PURE__ */ jsxs2("div", { className: authMethodsListClassName, children: [
            emailMethod ? /* @__PURE__ */ jsxs2(
              "form",
              {
                className: authSectionClassName,
                onSubmit: (event) => {
                  event.preventDefault();
                  onEmailSubmit();
                },
                children: [
                  /* @__PURE__ */ jsxs2("div", { className: authInputFormClassName, children: [
                    /* @__PURE__ */ jsx4(
                      "input",
                      {
                        id: "agg-auth-email",
                        type: "email",
                        value: emailValue,
                        onChange: (event) => onEmailChange(event.target.value),
                        placeholder: (_b = (_a = emailMethod.input) == null ? void 0 : _a.placeholder) != null ? _b : labels.auth.emailAddress,
                        className: cn(authInputFieldClassName, classNames == null ? void 0 : classNames.authFormField),
                        "aria-label": labels.auth.emailAddress,
                        disabled: disabled || isBusy || !emailMethod.isAvailable
                      }
                    ),
                    /* @__PURE__ */ jsx4(
                      Button,
                      {
                        type: "submit",
                        variant: "secondary",
                        size: "large",
                        className: authPrimaryActionClassName,
                        isLoading: activeMethodId === emailMethod.id,
                        disabled: disabled || isBusy || !emailMethod.isAvailable,
                        children: (_d = (_c = emailMethod.input) == null ? void 0 : _c.submitLabel) != null ? _d : labels.auth.continue
                      }
                    )
                  ] }),
                  emailMethod.isAvailable && ((_e = emailMethod.input) == null ? void 0 : _e.helperText) ? /* @__PURE__ */ jsx4("p", { className: cn(authNoticeClassName, classNames == null ? void 0 : classNames.authNotice), children: emailMethod.input.helperText }) : null,
                  !emailMethod.isAvailable ? /* @__PURE__ */ jsx4(
                    InlineAlert,
                    {
                      tone: "warning",
                      variant: "surface",
                      message: labels.auth.emailUnavailable,
                      className: classNames == null ? void 0 : classNames.authError
                    }
                  ) : null,
                  emailError ? /* @__PURE__ */ jsx4(
                    InlineAlert,
                    {
                      tone: "error",
                      message: emailError,
                      className: classNames == null ? void 0 : classNames.authError
                    }
                  ) : null
                ]
              }
            ) : null,
            socialMethods.length > 0 ? /* @__PURE__ */ jsxs2("div", { className: authSectionClassName, children: [
              /* @__PURE__ */ jsx4("div", { className: cn(authMethodGridClassName, classNames == null ? void 0 : classNames.authMethodGrid), children: socialMethods.map((method) => /* @__PURE__ */ jsx4(
                AuthMethodActionButton,
                {
                  activeMethodId,
                  className: cn(authSocialButtonClassName, classNames == null ? void 0 : classNames.authMethodButton),
                  disabled: disabled || isBusy,
                  method,
                  onSelect: onMethodSelect,
                  renderLabel: false
                },
                method.id
              )) }),
              /* @__PURE__ */ jsxs2("p", { className: authHelperTextClassName, children: [
                labels.auth.socialWalletNotice,
                " ",
                /* @__PURE__ */ jsx4("span", { className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink), children: labels.auth.learnMore })
              ] })
            ] }) : null,
            showWalletDivider ? /* @__PURE__ */ jsxs2("div", { className: authDividerClassName, children: [
              /* @__PURE__ */ jsx4("div", { className: authDividerLineClassName }),
              /* @__PURE__ */ jsx4("span", { className: authDividerLabelClassName, children: labels.auth.dividerOr }),
              /* @__PURE__ */ jsx4("div", { className: authDividerLineClassName })
            ] }) : null,
            walletMethods.length > 0 ? /* @__PURE__ */ jsx4("div", { className: authSectionClassName, children: /* @__PURE__ */ jsx4("div", { className: cn(authWalletMethodGridClassName, classNames == null ? void 0 : classNames.authMethodGrid), children: walletMethods.map((method) => /* @__PURE__ */ jsx4(
              AuthMethodActionButton,
              {
                activeMethodId,
                className: cn(authWalletButtonClassName, classNames == null ? void 0 : classNames.authMethodButton),
                disabled: disabled || isBusy,
                method,
                onSelect: onMethodSelect
              },
              method.id
            )) }) }) : null,
            /* @__PURE__ */ jsxs2("p", { className: authLegalTextClassName, children: [
              labels.auth.legalNoticePrefix,
              " ",
              /* @__PURE__ */ jsx4(
                "a",
                {
                  className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink),
                  href: AGG_TERMS_OF_SERVICE_URL,
                  target: "_blank",
                  rel: "noreferrer",
                  children: labels.auth.terms
                }
              ),
              " ",
              labels.auth.legalNoticeSeparator,
              " ",
              /* @__PURE__ */ jsx4(
                "a",
                {
                  className: cn(authHelperLinkClassName, classNames == null ? void 0 : classNames.authHelperLink),
                  href: AGG_PRIVACY_POLICY_URL,
                  target: "_blank",
                  rel: "noreferrer",
                  children: labels.auth.privacyPolicy
                }
              ),
              "."
            ] }),
            errorMessage ? /* @__PURE__ */ jsx4(
              InlineAlert,
              {
                tone: "error",
                message: errorMessage,
                className: classNames == null ? void 0 : classNames.authError
              }
            ) : null
          ] }) })
        ]
      }
    ) })
  ] });
};
var AuthConnectButtonView = ({
  activeMethodId,
  addressLabel,
  buttonProps,
  challengeContent,
  classNames,
  disabled,
  emailMethod,
  emailError,
  emailValue,
  errorMessage,
  isAuthenticated,
  isBalanceLoading,
  isBusy,
  isChooserOpen,
  isProfileMenuOpen,
  notice,
  onChooserOpenChange,
  onDepositClick,
  onDisconnectClick,
  onEmailChange,
  onEmailSubmit,
  onMethodSelect,
  onProfileCardClick,
  onProfileClick,
  onProfileMenuOpenChange,
  socialMethods,
  onWithdrawClick,
  profileLabel,
  totalBalance,
  positionsBalance,
  claimReadyCount = 0,
  onClaimWinningsClick,
  walletMethods,
  isDepositBlocked = false
}) => {
  var _a;
  const labels = useLabels();
  const {
    general: { rootClassName },
    features: { enableAnimations }
  } = useSdkUiConfig();
  const resolvedProfileLabel = profileLabel || labels.auth.myProfile;
  const authLabelsWithClaim = labels.auth;
  const resolveClaimTooltipLabel = (count) => {
    var _a2, _b;
    return (_b = (_a2 = authLabelsWithClaim.claimableWinningsTooltip) == null ? void 0 : _a2.call(authLabelsWithClaim, count)) != null ? _b : `${count} position${count === 1 ? "" : "s"} ready to claim`;
  };
  const resolveClaimBadgeAriaLabel = (count) => {
    var _a2, _b;
    return (_b = (_a2 = authLabelsWithClaim.claimableWinningsBadge) == null ? void 0 : _a2.call(authLabelsWithClaim, count)) != null ? _b : `${count} claimable winning${count === 1 ? "" : "s"}`;
  };
  const claimWinningsLabel = (_a = authLabelsWithClaim.claimWinnings) != null ? _a : "Claim Now";
  const dropdownMenuItemClassName = cn(
    "cursor-pointer",
    profileMenuActionItemClassName,
    enableAnimations ? "transition-colors" : null,
    disabled ? "pointer-events-none opacity-50" : null,
    classNames == null ? void 0 : classNames.profileMenuActionItem
  );
  if (!isAuthenticated) {
    return /* @__PURE__ */ jsx4(
      UnauthenticatedConnectView,
      {
        activeMethodId,
        buttonProps,
        challengeContent,
        classNames,
        disabled,
        emailMethod,
        emailError,
        emailValue,
        errorMessage,
        isBusy,
        isChooserOpen,
        notice,
        onChooserOpenChange,
        onEmailChange,
        onEmailSubmit,
        onMethodSelect,
        socialMethods,
        walletMethods
      }
    );
  }
  return /* @__PURE__ */ jsx4("div", { className: cn(connectButtonContainerClassName, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsxs2("div", { className: cn(connectedButtonsRowClassName, classNames == null ? void 0 : classNames.connectedRow), children: [
    /* @__PURE__ */ jsxs2("div", { className: cn(connectedBalanceChipClassName, classNames == null ? void 0 : classNames.balanceChip), children: [
      /* @__PURE__ */ jsx4("div", { className: "hidden lg:inline-flex", children: /* @__PURE__ */ jsx4(
        ConditionalWrapper,
        {
          condition: isDepositBlocked,
          wrapper: (children) => /* @__PURE__ */ jsx4(
            Tooltip,
            {
              content: /* @__PURE__ */ jsx4("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
              sideOffset: 4,
              children
            }
          ),
          children: /* @__PURE__ */ jsx4(
            Button,
            __spreadProps(__spreadValues({
              variant: "primary",
              size: "small",
              className: cn("h-6! px-3! text-agg-xs! leading-agg-4!", classNames == null ? void 0 : classNames.depositButton)
            }, !isDepositBlocked ? { onClick: onDepositClick } : { disabled: true }), {
              "aria-label": labels.auth.deposit,
              children: labels.auth.deposit
            })
          )
        }
      ) }),
      /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx4("span", { className: "h-3.5 w-3.5 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: /* @__PURE__ */ jsx4(Icon, { name: "activity-chart", size: "small", className: "text-agg-muted-foreground" }) }),
        /* @__PURE__ */ jsx4("p", { className: cn("agg-type-label text-agg-foreground", classNames == null ? void 0 : classNames.positionsText), children: isBalanceLoading ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "small" }) : formatUsd(positionsBalance) }),
        claimReadyCount > 0 ? /* @__PURE__ */ jsx4(
          Tooltip,
          {
            size: "medium",
            classNames: { content: "px-5 py-4" },
            content: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-2", children: [
              /* @__PURE__ */ jsx4("p", { children: resolveClaimTooltipLabel(claimReadyCount) }),
              onClaimWinningsClick ? /* @__PURE__ */ jsxs2(
                "button",
                {
                  type: "button",
                  className: "inline-flex cursor-pointer items-center gap-1.5 font-agg-bold text-agg-primary hover:text-agg-primary-hover",
                  onClick: onClaimWinningsClick,
                  children: [
                    claimWinningsLabel,
                    /* @__PURE__ */ jsx4(
                      Icon,
                      {
                        name: "arrow-right",
                        size: "small",
                        className: "h-3.5 w-3.5 text-agg-primary",
                        "aria-hidden": true
                      }
                    )
                  ]
                }
              ) : null
            ] }),
            children: /* @__PURE__ */ jsx4(
              "span",
              {
                className: cn(
                  "agg-claim-badge agg-type-overline",
                  "inline-flex items-center justify-center rounded-full leading-none",
                  "bg-linear-to-r from-agg-primary to-agg-primary-hover",
                  "shrink-0 px-0.5 min-w-4 h-4 text-agg-on-primary text-center",
                  "cursor-pointer"
                ),
                "aria-label": resolveClaimBadgeAriaLabel(claimReadyCount),
                children: claimReadyCount
              }
            )
          }
        ) : null
      ] }),
      /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx4("span", { className: "h-3.5 w-3.5 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: /* @__PURE__ */ jsx4(Icon, { name: "wallet-filled", size: "small", className: "text-agg-muted-foreground" }) }),
        /* @__PURE__ */ jsx4("p", { className: cn("agg-type-label text-agg-foreground", classNames == null ? void 0 : classNames.balanceText), children: isBalanceLoading ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "small" }) : formatUsd(totalBalance) })
      ] })
    ] }),
    /* @__PURE__ */ jsxs2(DropdownMenu.Root, { open: isProfileMenuOpen, onOpenChange: onProfileMenuOpenChange, children: [
      /* @__PURE__ */ jsx4(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
        "button",
        {
          type: "button",
          className: cn(
            "ml-0 md:-ml-12 max-w-48",
            "inline-flex items-center rounded-agg-full bg-agg-secondary",
            "h-7 gap-1.5 pl-1 pr-2 border-2",
            "md:h-10 md:gap-3 md:pl-2 md:pr-3 md:border",
            "cursor-pointer hover:bg-agg-secondary-hover",
            "focus-visible:outline-none focus-visible:border-agg-primary",
            isProfileMenuOpen ? "border-agg-primary" : "border-agg-primary md:border-agg-separator",
            enableAnimations ? "transition-colors" : null,
            classNames == null ? void 0 : classNames.profileTrigger
          ),
          disabled,
          "aria-label": labels.auth.walletMenuFor(resolvedProfileLabel),
          children: [
            /* @__PURE__ */ jsx4(WalletAvatar, { className: "size-5! md:size-6!" }),
            /* @__PURE__ */ jsx4(
              Typography,
              {
                variant: "body-strong",
                className: cn(
                  "whitespace-pre text-sm md:text-base leading-5 md:leading-6 truncate",
                  classNames == null ? void 0 : classNames.profileTriggerLabel
                ),
                children: resolvedProfileLabel
              }
            ),
            /* @__PURE__ */ jsx4(
              Icon,
              {
                name: isProfileMenuOpen ? "chevron-up" : "chevron-down",
                size: "small",
                className: "h-3 w-3 md:h-3.5 md:w-3.5 text-agg-foreground",
                "aria-hidden": "true"
              }
            )
          ]
        }
      ) }),
      /* @__PURE__ */ jsx4(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx4(
        DropdownMenu.Content,
        {
          className: cn(AGG_ROOT_CLASS_NAME, rootClassName, "z-50 outline-none"),
          "data-agg-animations": enableAnimations ? "true" : "false",
          sideOffset: 4,
          align: "end",
          children: /* @__PURE__ */ jsxs2(
            "div",
            {
              className: cn(
                "font-agg-sans bg-agg-secondary",
                "w-screen h-screen overflow-y-auto",
                "md:h-auto md:w-64 md:max-w-[calc(100vw-2rem)] md:overflow-hidden md:rounded-agg-xl md:border md:border-agg-separator md:shadow-agg-popover",
                classNames == null ? void 0 : classNames.profileMenuContent
              ),
              children: [
                /* @__PURE__ */ jsxs2(
                  "button",
                  {
                    type: "button",
                    className: cn(
                      profileMenuSectionClassName,
                      "cursor-pointer",
                      "hover:bg-agg-secondary-hover focus:bg-agg-secondary-hover focus:outline-none",
                      enableAnimations ? "transition-colors" : null,
                      disabled ? "pointer-events-none opacity-50" : null,
                      classNames == null ? void 0 : classNames.profileMenuSection
                    ),
                    onClick: () => {
                      onProfileMenuOpenChange(false);
                      onProfileCardClick == null ? void 0 : onProfileCardClick();
                    },
                    disabled,
                    children: [
                      /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row items-center justify-between gap-3", children: [
                        /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-3", children: [
                          /* @__PURE__ */ jsx4(WalletAvatar, { className: "size-11" }),
                          /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-col items-start justify-start gap-0.5", children: [
                            /* @__PURE__ */ jsx4("p", { className: "w-full text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground text-left truncate", children: resolvedProfileLabel }),
                            addressLabel ? /* @__PURE__ */ jsx4("p", { className: "w-full text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground text-left", children: addressLabel }) : null
                          ] })
                        ] }),
                        /* @__PURE__ */ jsx4(
                          Icon,
                          {
                            name: "arrow-right",
                            size: "small",
                            className: "md:hidden h-4 w-4 shrink-0 text-agg-foreground",
                            "aria-hidden": "true"
                          }
                        )
                      ] }),
                      /* @__PURE__ */ jsxs2("div", { className: "md:hidden flex w-full items-start gap-5", children: [
                        /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 min-w-0 flex-col gap-2", children: [
                          /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-2", children: [
                            /* @__PURE__ */ jsx4(
                              Icon,
                              {
                                name: "wallet-filled",
                                size: "small",
                                className: "h-4 w-4 shrink-0 text-agg-muted-foreground"
                              }
                            ),
                            /* @__PURE__ */ jsx4("span", { className: "truncate text-agg-sm leading-agg-5 text-agg-foreground", children: "Withdrawable Balance" })
                          ] }),
                          /* @__PURE__ */ jsx4("p", { className: "text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground text-left", children: isBalanceLoading ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "small" }) : formatUsd(totalBalance) })
                        ] }),
                        /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 min-w-0 flex-col gap-2", children: [
                          /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 items-center gap-2", children: [
                            /* @__PURE__ */ jsx4(
                              Icon,
                              {
                                name: "activity-chart",
                                size: "small",
                                className: "h-4 w-4 shrink-0 text-agg-muted-foreground"
                              }
                            ),
                            /* @__PURE__ */ jsx4("span", { className: "truncate text-agg-sm leading-agg-5 text-agg-foreground", children: "Positions Value" })
                          ] }),
                          /* @__PURE__ */ jsx4("p", { className: "text-agg-lg font-agg-bold leading-agg-7 text-agg-foreground text-left", children: isBalanceLoading ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "small" }) : formatUsd(positionsBalance) })
                        ] })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ jsx4(
                  "div",
                  {
                    className: cn(profileMenuSeparatorClassName, classNames == null ? void 0 : classNames.profileMenuSeparator)
                  }
                ),
                /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-col py-2", children: [
                  /* @__PURE__ */ jsxs2(
                    DropdownMenu.Item,
                    {
                      className: dropdownMenuItemClassName,
                      onSelect: onProfileClick,
                      disabled,
                      children: [
                        /* @__PURE__ */ jsx4(Icon, { name: "profile", size: "small", className: "text-agg-foreground" }),
                        /* @__PURE__ */ jsx4("span", { children: labels.auth.myProfile })
                      ]
                    }
                  ),
                  isDepositBlocked ? /* @__PURE__ */ jsx4(
                    DropdownMenu.Item,
                    {
                      className: cn(dropdownMenuItemClassName, "opacity-50 cursor-not-allowed!"),
                      onSelect: (e) => e.preventDefault(),
                      "aria-disabled": "true",
                      children: /* @__PURE__ */ jsx4(
                        Tooltip,
                        {
                          content: /* @__PURE__ */ jsx4("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
                          side: "bottom",
                          sideOffset: 4,
                          children: /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-3", children: [
                            /* @__PURE__ */ jsx4(Icon, { name: "download", size: "small", className: "text-agg-foreground" }),
                            /* @__PURE__ */ jsx4("span", { children: labels.auth.deposit })
                          ] })
                        }
                      )
                    }
                  ) : /* @__PURE__ */ jsxs2(
                    DropdownMenu.Item,
                    {
                      className: dropdownMenuItemClassName,
                      onSelect: onDepositClick,
                      disabled,
                      children: [
                        /* @__PURE__ */ jsx4(Icon, { name: "download", size: "small", className: "text-agg-foreground" }),
                        /* @__PURE__ */ jsx4("span", { children: labels.auth.deposit })
                      ]
                    }
                  ),
                  /* @__PURE__ */ jsxs2(
                    DropdownMenu.Item,
                    {
                      className: dropdownMenuItemClassName,
                      onSelect: onWithdrawClick,
                      disabled,
                      children: [
                        /* @__PURE__ */ jsx4(Icon, { name: "upload", size: "small", className: "text-agg-foreground" }),
                        /* @__PURE__ */ jsx4("span", { children: labels.auth.withdraw })
                      ]
                    }
                  ),
                  /* @__PURE__ */ jsxs2(
                    DropdownMenu.Item,
                    {
                      className: dropdownMenuItemClassName,
                      onSelect: onDisconnectClick,
                      disabled,
                      children: [
                        /* @__PURE__ */ jsx4(Icon, { name: "disconnect", size: "small", className: "text-agg-foreground" }),
                        /* @__PURE__ */ jsx4("span", { children: labels.auth.disconnect })
                      ]
                    }
                  )
                ] })
              ]
            }
          )
        }
      ) })
    ] })
  ] }) });
};
AuthConnectButtonView.displayName = "AuthConnectButtonView";
export {
  AGG_DEFAULT_URL,
  AGG_DOCS_URL,
  AGG_PRIVACY_POLICY_URL,
  AGG_ROOT_CLASS_NAME,
  AGG_TERMS_OF_SERVICE_URL,
  ActivityChartIcon,
  AggErrorBoundary,
  AggLogo,
  AggNotificationEventsProvider,
  AggProvider,
  AggToastProvider,
  AppleIcon,
  AppsIcon,
  ArbitrumIcon,
  ArrowRightIcon,
  ArrowTrendUpIcon,
  ArrowsToDotIcon,
  AuthConnectButtonView,
  AutocompleteSelect,
  Badge,
  BadgeCheckThinIcon,
  BankIcon,
  BaseIcon,
  BestPricesIcon,
  BnbIcon,
  BoltIcon,
  Button,
  CARD_NETWORK_OPTIONS,
  Card,
  ChartCandlestickIcon,
  ChartLineIcon,
  CheckCircleIcon,
  ChevronDownIcon,
  ChevronLeftIcon,
  ChevronRightIcon,
  ChevronUpIcon,
  CircleOverlapIcon,
  CircleXmarkIcon,
  CloseIcon,
  ConnectAccountsStep,
  ConnectKalshiModal,
  ConnectOnchainModal,
  CopyButton,
  CopyIcon,
  CreateAccountIcon,
  CreditCardIcon,
  CurrencyInput,
  DEPOSIT_MODAL_OPEN_EVENT,
  DepositModal,
  DisconnectIcon,
  DocumentIcon,
  DotsHorizontalIcon,
  DownloadIcon,
  ErrorFilledIcon,
  EthereumIcon,
  EventList,
  EventListItem,
  EventListItemDetails,
  EventListItemV2,
  EventMarketPage,
  ExternalLinkIcon,
  Footer,
  GeoBlockBanner,
  GeoBlockModal,
  GiftBonusIcon,
  GoogleIcon,
  Header,
  HomePage,
  HourglassStartIcon,
  HowItWorksStep,
  Icon,
  ImageIcon,
  InfoIcon,
  InlineAlert,
  LineChart,
  LinkAccountsIcon,
  LoadingIcon,
  LockIcon,
  MarketDetails,
  MarketDetailsList,
  Modal,
  NumberValue,
  OnboardingModal,
  Orderbook,
  OrderbookWithStates,
  PaperModeIcon,
  PaperPlaneIcon,
  PencilIcon,
  PlaceOrder,
  PlaceOrderFailureView,
  PlaceOrderRouteCardSkeleton,
  PlaceOrderSuccessView,
  PlaySquareIcon,
  PolygonIcon,
  ProfileIcon,
  ProfileModal,
  ProfileSetupStep,
  RemoteImage,
  RevenueAltIcon,
  SETTLEMENT_SECTION_ID,
  Search,
  SearchIcon,
  Select,
  Settlement,
  SettlementDetails,
  SettlementSummary,
  ShieldTrustIcon,
  Skeleton,
  SolanaIcon,
  SparklesFilledIcon,
  StateMessage,
  StayInControlIcon,
  SuccessCheckIcon,
  SwitchButton,
  Tabs,
  ToastProvider,
  Tooltip,
  TriangleDownIcon,
  TriangleUpFilledIcon,
  TriangleUpIcon,
  Typography,
  USER_PROFILE_TAB_ACTIVITY,
  USER_PROFILE_TAB_OPEN_ORDERS,
  USER_PROFILE_TAB_POSITIONS,
  UploadIcon,
  UsdcIcon,
  UserProfilePage,
  UserTrustIcon,
  VenueLogo,
  WITHDRAW_MODAL_OPEN_EVENT,
  WalletAvatarIcon,
  WalletFilledIcon,
  WalletIcon,
  WarningFilledIcon,
  WarningIcon,
  WithdrawModal,
  AGG_ROOT_CLASS_NAME as aggRootClassName,
  badgeSizes,
  buildAggTxExplorerHref,
  buildTerminalSummary,
  clearPendingCardSession,
  cn,
  collectEligibleVenueOutcomeIds,
  collectEligibleVenueOutcomes,
  defaultSettlementSectionLabel,
  defaultTradingDisclaimer,
  formatAmountDisplay,
  formatCompactUsd,
  formatProbabilityCents,
  formatTokenAmount,
  formatUsd,
  getMotionClassName,
  getPendingCardSession,
  getScrollBehavior,
  getTradingAveragePriceLabel,
  getTradingBalanceLabel,
  getTradingDateLabel,
  getTradingPriceLabel,
  getTradingSharesLabel,
  getTradingSlippageLabel,
  getTradingValueLabel,
  getTradingVenueLabel,
  iconNames,
  isTruthy,
  isValidDateValue,
  mergeVenueOutcomeOrderbooks,
  orderbookRowLimitDefault,
  parseAmount,
  parseVenue,
  requestAggDepositModalOpen,
  requestAggWithdrawModalOpen,
  resolveOrderBookRows,
  resolveUnifiedOrderBookEntries,
  shortenAddress,
  skeletonViews,
  toDate,
  typographyVariants,
  useCenterOrderbookSpread,
  useEventTradingContext,
  useHomePageModals,
  useOptionalToast,
  useToast,
  venueLogoNames
};
