@orangecheck/design 0.6.1 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as React2 from 'react';
4
- import { createContext, useState, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
4
+ import { createContext, useState, useRef, useEffect, useCallback, useMemo, useContext, Fragment as Fragment$1, useId } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { useTheme } from 'next-themes';
7
- import { ChevronDown, Palette, Check, Sun, Moon, Monitor, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy } from 'lucide-react';
7
+ import { ChevronDown, Palette, Check, Sun, Moon, Monitor, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy, HelpCircle, Boxes, CornerDownLeft, Plus, Loader2 } from 'lucide-react';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import { cva } from 'class-variance-authority';
10
10
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -17,131 +17,13 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
17
17
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
18
18
  import * as SelectPrimitive from '@radix-ui/react-select';
19
19
  import { Toaster as Toaster$1 } from 'sonner';
20
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
20
21
  import QRCode from 'qrcode';
21
- import * as ui_star from '@orangecheck/ui';
22
+ import Link6 from 'next/link';
23
+ import { useRouter } from 'next/router';
24
+ import { useOcSession, fetchOcLinkedIdentities } from '@orangecheck/auth-client';
22
25
 
23
- var __defProp = Object.defineProperty;
24
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25
- var __getOwnPropNames = Object.getOwnPropertyNames;
26
- var __hasOwnProp = Object.prototype.hasOwnProperty;
27
- var __export = (target, all) => {
28
- for (var name in all)
29
- __defProp(target, name, { get: all[name], enumerable: true });
30
- };
31
- var __copyProps = (to, from, except, desc) => {
32
- if (from && typeof from === "object" || typeof from === "function") {
33
- for (let key of __getOwnPropNames(from))
34
- if (!__hasOwnProp.call(to, key) && key !== except)
35
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36
- }
37
- return to;
38
- };
39
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
40
-
41
- // src/index.ts
42
- var src_exports = {};
43
- __export(src_exports, {
44
- Accordion: () => Accordion,
45
- AccordionContent: () => AccordionContent,
46
- AccordionItem: () => AccordionItem,
47
- AccordionTrigger: () => AccordionTrigger,
48
- Alert: () => Alert,
49
- AlertDescription: () => AlertDescription,
50
- AlertTitle: () => AlertTitle,
51
- AlertWithAction: () => AlertWithAction,
52
- AlertWithCountdown: () => AlertWithCountdown,
53
- Badge: () => Badge,
54
- Bar: () => Bar,
55
- BitcoinAddress: () => BitcoinAddress,
56
- Button: () => Button,
57
- Card: () => Card,
58
- Checkbox: () => Checkbox,
59
- ConfirmHost: () => ConfirmHost,
60
- CopyButton: () => CopyButton,
61
- DEFAULT_OC_THEME: () => DEFAULT_OC_THEME,
62
- Dialog: () => Dialog,
63
- DialogClose: () => DialogClose,
64
- DialogContent: () => DialogContent,
65
- DialogDescription: () => DialogDescription,
66
- DialogFooter: () => DialogFooter,
67
- DialogHeader: () => DialogHeader,
68
- DialogOverlay: () => DialogOverlay,
69
- DialogPortal: () => DialogPortal,
70
- DialogTitle: () => DialogTitle,
71
- DialogTrigger: () => DialogTrigger,
72
- ErrorBoundary: () => ErrorBoundary,
73
- Input: () => Input,
74
- Label: () => Label,
75
- Modal: () => Modal,
76
- OC_DEFAULT_ACCENT: () => OC_DEFAULT_ACCENT,
77
- OC_SKIN_COOKIE: () => OC_SKIN_COOKIE,
78
- OC_THEMES: () => OC_THEMES,
79
- OcAppearanceMenu: () => OcAppearanceMenu,
80
- OcThemeBridge: () => OcThemeBridge,
81
- OcThemePicker: () => OcThemePicker,
82
- OcThemeProvider: () => OcThemeProvider,
83
- Pagination: () => Pagination,
84
- Popover: () => Popover,
85
- PopoverAnchor: () => PopoverAnchor,
86
- PopoverContent: () => PopoverContent,
87
- PopoverTrigger: () => PopoverTrigger,
88
- PromptHost: () => PromptHost,
89
- QrCode: () => QrCode,
90
- REFERENCE_BTC_USD: () => REFERENCE_BTC_USD,
91
- RadioGroup: () => RadioGroup,
92
- RadioGroupItem: () => RadioGroupItem,
93
- SatsAmount: () => SatsAmount,
94
- Select: () => Select,
95
- SelectContent: () => SelectContent,
96
- SelectGroup: () => SelectGroup,
97
- SelectItem: () => SelectItem,
98
- SelectLabel: () => SelectLabel,
99
- SelectScrollDownButton: () => SelectScrollDownButton,
100
- SelectScrollUpButton: () => SelectScrollUpButton,
101
- SelectSeparator: () => SelectSeparator,
102
- SelectTrigger: () => SelectTrigger,
103
- SelectValue: () => SelectValue,
104
- Separator: () => Separator,
105
- Sheet: () => Sheet,
106
- SheetClose: () => SheetClose,
107
- SheetContent: () => SheetContent,
108
- SheetDescription: () => SheetDescription,
109
- SheetFooter: () => SheetFooter,
110
- SheetHeader: () => SheetHeader,
111
- SheetOverlay: () => SheetOverlay,
112
- SheetPortal: () => SheetPortal,
113
- SheetTitle: () => SheetTitle,
114
- SheetTrigger: () => SheetTrigger,
115
- Skeleton: () => Skeleton,
116
- Sparkline: () => Sparkline,
117
- StatBlock: () => StatBlock,
118
- StatusPill: () => StatusPill,
119
- Switch: () => Switch,
120
- Textarea: () => Textarea,
121
- ThemeToggle: () => ThemeToggle,
122
- ThemeToggleLink: () => ThemeToggleLink,
123
- Toaster: () => Toaster,
124
- Working: () => Working,
125
- WorkingPanel: () => WorkingPanel,
126
- accentFor: () => accentFor,
127
- badgeVariants: () => badgeVariants,
128
- buttonVariants: () => buttonVariants,
129
- cn: () => cn,
130
- confirm: () => confirm,
131
- explorerUrl: () => explorerUrl,
132
- formatSats: () => formatSats,
133
- formatSatsCompact: () => formatSatsCompact,
134
- getOcThemeInitScript: () => getOcThemeInitScript,
135
- isKnownTheme: () => isKnownTheme,
136
- priceBoth: () => priceBoth,
137
- prompt: () => prompt,
138
- relativeTime: () => relativeTime,
139
- resolveTheme: () => resolveTheme,
140
- satsToUsd: () => satsToUsd,
141
- shortenAddress: () => shortenAddress,
142
- usdToSats: () => usdToSats,
143
- useOcSkin: () => useOcSkin
144
- });
26
+ // src/tokens/cn.ts
145
27
  function cn(...inputs) {
146
28
  return twMerge(clsx(inputs));
147
29
  }
@@ -944,6 +826,7 @@ var ErrorBoundary = class extends React2.Component {
944
826
  }
945
827
  componentDidCatch(error, info) {
946
828
  console.error("[ErrorBoundary]", error, info);
829
+ this.props.onError?.(error, info);
947
830
  }
948
831
  render() {
949
832
  if (this.state.error) {
@@ -951,7 +834,7 @@ var ErrorBoundary = class extends React2.Component {
951
834
  return this.props.fallback(this.state.error, this.reset);
952
835
  }
953
836
  return /* @__PURE__ */ jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxs("div", { className: "terminal", children: [
954
- /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
837
+ /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: this.props.title ?? "! fatal" }) }),
955
838
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
956
839
  /* @__PURE__ */ jsxs("p", { children: [
957
840
  /* @__PURE__ */ jsxs("span", { className: "text-destructive", children: [
@@ -963,7 +846,7 @@ var ErrorBoundary = class extends React2.Component {
963
846
  ] }),
964
847
  /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
965
848
  "> ",
966
- "this page crashed. reload to recover."
849
+ this.props.message ?? "this page crashed. reload to recover."
967
850
  ] }),
968
851
  /* @__PURE__ */ jsx(
969
852
  "button",
@@ -1900,7 +1783,37 @@ var TONE = {
1900
1783
  primary: "text-primary",
1901
1784
  info: "text-info"
1902
1785
  };
1903
- function StatusPill({ label, tone = "muted", icon, className }) {
1786
+ var BORDER_TONE = {
1787
+ success: "border-success/40 text-success",
1788
+ warning: "border-warning/40 text-warning",
1789
+ destructive: "border-destructive/40 text-destructive",
1790
+ muted: "border-muted-foreground/40 text-muted-foreground",
1791
+ primary: "border-primary/40 text-primary",
1792
+ info: "border-info/40 text-info"
1793
+ };
1794
+ function StatusPill({
1795
+ label,
1796
+ tone = "muted",
1797
+ variant = "plain",
1798
+ icon,
1799
+ className
1800
+ }) {
1801
+ if (variant === "bordered") {
1802
+ return /* @__PURE__ */ jsxs(
1803
+ "span",
1804
+ {
1805
+ className: cn(
1806
+ "inline-flex items-center gap-1.5 border px-1.5 py-0.5 font-mono text-[9px] tracking-widest uppercase",
1807
+ BORDER_TONE[tone],
1808
+ className
1809
+ ),
1810
+ children: [
1811
+ icon,
1812
+ label
1813
+ ]
1814
+ }
1815
+ );
1816
+ }
1904
1817
  return /* @__PURE__ */ jsxs(
1905
1818
  "span",
1906
1819
  {
@@ -1916,6 +1829,60 @@ function StatusPill({ label, tone = "muted", icon, className }) {
1916
1829
  }
1917
1830
  );
1918
1831
  }
1832
+ function makeStatusPill(map, options) {
1833
+ const variant = options?.variant ?? "plain";
1834
+ const fallbackTone = options?.fallbackTone ?? "muted";
1835
+ function DomainStatusPill({ status, className }) {
1836
+ const spec = map[status];
1837
+ return /* @__PURE__ */ jsx(
1838
+ StatusPill,
1839
+ {
1840
+ tone: spec?.tone ?? fallbackTone,
1841
+ label: spec?.label ?? status,
1842
+ icon: spec?.icon,
1843
+ variant,
1844
+ className
1845
+ }
1846
+ );
1847
+ }
1848
+ return DomainStatusPill;
1849
+ }
1850
+ function Tabs({ ...props }) {
1851
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-slot": "tabs", ...props });
1852
+ }
1853
+ function TabsList({ className, ...props }) {
1854
+ return /* @__PURE__ */ jsx(
1855
+ TabsPrimitive.List,
1856
+ {
1857
+ "data-slot": "tabs-list",
1858
+ className: cn("border-border -mb-px flex items-center gap-6 border-b", className),
1859
+ ...props
1860
+ }
1861
+ );
1862
+ }
1863
+ function TabsTrigger({ className, ...props }) {
1864
+ return /* @__PURE__ */ jsx(
1865
+ TabsPrimitive.Trigger,
1866
+ {
1867
+ "data-slot": "tabs-trigger",
1868
+ className: cn(
1869
+ "text-muted-foreground hover:text-foreground data-[state=active]:text-primary data-[state=active]:border-primary -mb-px border-b-2 border-transparent py-2 font-mono text-[11px] tracking-widest uppercase transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1870
+ className
1871
+ ),
1872
+ ...props
1873
+ }
1874
+ );
1875
+ }
1876
+ function TabsContent({ className, ...props }) {
1877
+ return /* @__PURE__ */ jsx(
1878
+ TabsPrimitive.Content,
1879
+ {
1880
+ "data-slot": "tabs-content",
1881
+ className: cn("mt-4 outline-none", className),
1882
+ ...props
1883
+ }
1884
+ );
1885
+ }
1919
1886
 
1920
1887
  // src/format/index.ts
1921
1888
  var REFERENCE_BTC_USD = 95e3;
@@ -2085,14 +2052,1800 @@ function QrCode({ value, size = 200, label, className }) {
2085
2052
  }
2086
2053
  );
2087
2054
  }
2055
+ function HelpHint({
2056
+ title,
2057
+ children,
2058
+ side = "bottom",
2059
+ label = "more information",
2060
+ className
2061
+ }) {
2062
+ return /* @__PURE__ */ jsxs(Popover, { children: [
2063
+ /* @__PURE__ */ jsx(
2064
+ PopoverTrigger,
2065
+ {
2066
+ "aria-label": label,
2067
+ className: cn(
2068
+ "text-muted-foreground/60 hover:text-foreground inline-flex size-3.5 items-center justify-center align-middle transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",
2069
+ className
2070
+ ),
2071
+ children: /* @__PURE__ */ jsx(HelpCircle, { className: "size-3.5", "aria-hidden": true })
2072
+ }
2073
+ ),
2074
+ /* @__PURE__ */ jsxs(PopoverContent, { side, className: "w-72 space-y-1.5", children: [
2075
+ title && /* @__PURE__ */ jsx("p", { className: "label-mono text-foreground text-[10px]", children: title }),
2076
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs leading-relaxed", children })
2077
+ ] })
2078
+ ] });
2079
+ }
2080
+ var TONE_CLASS = {
2081
+ primary: "text-primary",
2082
+ muted: "text-muted-foreground",
2083
+ warning: "text-warning",
2084
+ success: "text-success",
2085
+ destructive: "text-destructive"
2086
+ };
2087
+ function SectionHeader({
2088
+ label,
2089
+ meta,
2090
+ hint,
2091
+ tone = "primary",
2092
+ className = ""
2093
+ }) {
2094
+ return /* @__PURE__ */ jsxs("div", { className: `mb-3 flex items-baseline justify-between gap-2 ${className}`, children: [
2095
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
2096
+ /* @__PURE__ */ jsxs("div", { className: `label-mono ${TONE_CLASS[tone]}`, children: [
2097
+ "\xA7 ",
2098
+ label
2099
+ ] }),
2100
+ hint && /* @__PURE__ */ jsx(HelpHint, { title: hint.title, side: hint.side ?? "bottom", children: hint.body })
2101
+ ] }),
2102
+ meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
2103
+ ] });
2104
+ }
2105
+ var TONE_CLASS2 = {
2106
+ info: "border-primary/30 bg-primary/5",
2107
+ warning: "border-warning/40 bg-warning/5",
2108
+ muted: "border-border bg-muted/20"
2109
+ };
2110
+ var LABEL_TONE_CLASS = {
2111
+ info: "text-primary",
2112
+ warning: "text-warning",
2113
+ muted: "text-muted-foreground"
2114
+ };
2115
+ function EmptyState({
2116
+ label,
2117
+ children,
2118
+ cta,
2119
+ secondary,
2120
+ tone = "info",
2121
+ className = ""
2122
+ }) {
2123
+ return /* @__PURE__ */ jsxs("div", { className: `border p-5 md:p-6 ${TONE_CLASS2[tone]} ${className}`, children: [
2124
+ /* @__PURE__ */ jsxs("div", { className: `label-mono mb-2 ${LABEL_TONE_CLASS[tone]}`, children: [
2125
+ "\xA7 ",
2126
+ label
2127
+ ] }),
2128
+ /* @__PURE__ */ jsx("div", { className: "text-foreground/85 max-w-2xl text-sm leading-relaxed", children }),
2129
+ (cta || secondary) && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap gap-3", children: [
2130
+ cta && /* @__PURE__ */ jsx(CtaLink, { ...cta, variant: "primary" }),
2131
+ secondary && /* @__PURE__ */ jsx(CtaLink, { ...secondary, variant: "secondary" })
2132
+ ] })
2133
+ ] });
2134
+ }
2135
+ function CtaLink({
2136
+ label,
2137
+ href,
2138
+ external,
2139
+ variant
2140
+ }) {
2141
+ const cls = variant === "primary" ? "bg-primary text-primary-foreground hover:bg-primary/90 inline-flex h-9 items-center justify-center rounded-md px-4 font-mono text-[11px] font-semibold tracking-widest uppercase" : "text-muted-foreground hover:text-foreground border-input hover:bg-accent inline-flex h-9 items-center justify-center rounded-md border px-4 font-mono text-[11px] tracking-widest uppercase";
2142
+ const text = external ? `${label} \u2197` : label;
2143
+ if (external) {
2144
+ return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", className: cls, children: text });
2145
+ }
2146
+ return /* @__PURE__ */ jsx(Link6, { href, className: cls, children: text });
2147
+ }
2148
+ var TONE_CLASS3 = {
2149
+ default: "",
2150
+ primary: "text-primary",
2151
+ success: "text-success",
2152
+ warning: "text-warning",
2153
+ destructive: "text-destructive",
2154
+ muted: "text-muted-foreground"
2155
+ };
2156
+ var COL_CLASS = {
2157
+ 1: "",
2158
+ 2: "md:grid-cols-2",
2159
+ 3: "md:grid-cols-3",
2160
+ 4: "md:grid-cols-2 lg:grid-cols-4"
2161
+ };
2162
+ function StatGrid({ items, columns = 3, className = "" }) {
2163
+ return /* @__PURE__ */ jsx("div", { className: `bg-border grid gap-px border ${COL_CLASS[columns]} ${className}`, children: items.map((it, i) => /* @__PURE__ */ jsx(Tile, { item: it }, `${it.label}-${i}`)) });
2164
+ }
2165
+ function Tile({ item }) {
2166
+ const tone = item.tone ?? (item.accent ? "primary" : "default");
2167
+ return /* @__PURE__ */ jsxs("div", { className: "bg-background p-5", children: [
2168
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 font-mono text-[10px] tracking-widest uppercase", children: item.label }),
2169
+ /* @__PURE__ */ jsx(
2170
+ "div",
2171
+ {
2172
+ className: `font-display mt-1 text-2xl font-bold tabular-nums tracking-tight ${TONE_CLASS3[tone]}`,
2173
+ children: item.value
2174
+ }
2175
+ ),
2176
+ item.sub && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/70 mt-1 font-mono text-[10px] tracking-widest uppercase", children: item.sub })
2177
+ ] });
2178
+ }
2179
+ function StatTile({ children, ...item }) {
2180
+ return /* @__PURE__ */ jsxs("div", { children: [
2181
+ /* @__PURE__ */ jsx(Tile, { item }),
2182
+ children
2183
+ ] });
2184
+ }
2185
+ var FRAME = {
2186
+ info: "border-primary/30 bg-primary/5",
2187
+ warning: "border-warning/40 bg-warning/5",
2188
+ destructive: "border-destructive/40 bg-destructive/5",
2189
+ success: "border-success/40 bg-success/5",
2190
+ muted: "border-border bg-muted/20"
2191
+ };
2192
+ var LABEL = {
2193
+ info: "text-primary",
2194
+ warning: "text-warning",
2195
+ destructive: "text-destructive",
2196
+ success: "text-success",
2197
+ muted: "text-muted-foreground"
2198
+ };
2199
+ function Callout({ tone = "info", label, icon, children, action, className }) {
2200
+ return /* @__PURE__ */ jsxs("div", { className: cn("border p-4 md:p-5", FRAME[tone], className), children: [
2201
+ label && /* @__PURE__ */ jsxs("div", { className: cn("label-mono mb-2 flex items-center gap-1.5", LABEL[tone]), children: [
2202
+ icon,
2203
+ /* @__PURE__ */ jsxs("span", { children: [
2204
+ "\xA7 ",
2205
+ label
2206
+ ] })
2207
+ ] }),
2208
+ /* @__PURE__ */ jsxs("div", { className: "text-foreground/85 text-sm leading-relaxed", children: [
2209
+ !label && icon ? /* @__PURE__ */ jsx("span", { className: cn("mr-2 inline-flex align-middle", LABEL[tone]), children: icon }) : null,
2210
+ children
2211
+ ] }),
2212
+ action && /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-3", children: action })
2213
+ ] });
2214
+ }
2215
+ function DefinitionList({ items, className }) {
2216
+ return /* @__PURE__ */ jsx(
2217
+ "dl",
2218
+ {
2219
+ className: cn(
2220
+ "grid gap-x-5 gap-y-2 text-sm sm:grid-cols-[auto_1fr] sm:items-baseline",
2221
+ className
2222
+ ),
2223
+ children: items.map((item, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
2224
+ /* @__PURE__ */ jsx("dt", { className: "label-mono text-muted-foreground text-[10px]", children: item.label }),
2225
+ /* @__PURE__ */ jsx("dd", { className: "text-foreground font-mono text-xs break-all", children: item.value })
2226
+ ] }, i))
2227
+ }
2228
+ );
2229
+ }
2230
+ function DataRow({ children, meta, action, as, className }) {
2231
+ const Tag = as ?? "div";
2232
+ return /* @__PURE__ */ jsxs(
2233
+ Tag,
2234
+ {
2235
+ className: cn(
2236
+ "flex flex-col gap-1 py-3 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4",
2237
+ className
2238
+ ),
2239
+ children: [
2240
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children }),
2241
+ (meta || action) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-3 sm:justify-end", children: [
2242
+ meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[11px] tracking-wide", children: meta }),
2243
+ action
2244
+ ] })
2245
+ ]
2246
+ }
2247
+ );
2248
+ }
2249
+ var ENTRIES = [
2250
+ {
2251
+ slug: "home",
2252
+ href: "https://ochk.io",
2253
+ label: "orangecheck",
2254
+ sub: "umbrella",
2255
+ docsHref: "https://docs.ochk.io"
2256
+ },
2257
+ {
2258
+ slug: "docs",
2259
+ href: "https://docs.ochk.io",
2260
+ label: "oc\xB7docs",
2261
+ sub: "unified docs",
2262
+ docsHref: "https://docs.ochk.io"
2263
+ },
2264
+ {
2265
+ slug: "fleet",
2266
+ href: "https://fleet.ochk.io",
2267
+ label: "oc\xB7fleet",
2268
+ sub: "managed \u2014 agent fleet",
2269
+ docsHref: "https://docs.ochk.io/fleet"
2270
+ },
2271
+ {
2272
+ slug: "me",
2273
+ href: "https://me.ochk.io",
2274
+ label: "oc\xB7me",
2275
+ sub: "earn \u2014 consumer identity",
2276
+ docsHref: "https://docs.ochk.io/me"
2277
+ },
2278
+ {
2279
+ slug: "vault",
2280
+ href: "https://vault.ochk.io",
2281
+ label: "oc\xB7vault",
2282
+ sub: "keep \u2014 encrypted secrets",
2283
+ docsHref: "https://docs.ochk.io/vault"
2284
+ },
2285
+ {
2286
+ slug: "attest",
2287
+ href: "https://attest.ochk.io",
2288
+ label: "oc\xB7attest",
2289
+ sub: "am \u2014 sybil resistance",
2290
+ docsHref: "https://docs.ochk.io/attest"
2291
+ },
2292
+ {
2293
+ slug: "lock",
2294
+ href: "https://lock.ochk.io",
2295
+ label: "oc\xB7lock",
2296
+ sub: "whisper \u2014 encryption",
2297
+ docsHref: "https://docs.ochk.io/lock"
2298
+ },
2299
+ {
2300
+ slug: "vote",
2301
+ href: "https://vote.ochk.io",
2302
+ label: "oc\xB7vote",
2303
+ sub: "decide \u2014 polls",
2304
+ docsHref: "https://docs.ochk.io/vote"
2305
+ },
2306
+ {
2307
+ slug: "stamp",
2308
+ href: "https://stamp.ochk.io",
2309
+ label: "oc\xB7stamp",
2310
+ sub: "declare \u2014 block-anchored",
2311
+ docsHref: "https://docs.ochk.io/stamp"
2312
+ },
2313
+ {
2314
+ slug: "agent",
2315
+ href: "https://agent.ochk.io",
2316
+ label: "oc\xB7agent",
2317
+ sub: "delegate \u2014 scoped auth",
2318
+ docsHref: "https://docs.ochk.io/agent"
2319
+ },
2320
+ {
2321
+ slug: "pledge",
2322
+ href: "https://pledge.ochk.io",
2323
+ label: "oc\xB7pledge",
2324
+ sub: "swear \u2014 bonded commitment",
2325
+ docsHref: "https://docs.ochk.io/pledge"
2326
+ }
2327
+ ];
2328
+ var OWNER_ENTRIES = [
2329
+ {
2330
+ slug: "analytics",
2331
+ href: "https://analytics.ochk.io",
2332
+ label: "oc\xB7analytics",
2333
+ sub: "owner cockpit",
2334
+ docsHref: "https://analytics.ochk.io"
2335
+ }
2336
+ ];
2337
+ function EcosystemSwitcher({
2338
+ current,
2339
+ className,
2340
+ showOwnerEntries = false
2341
+ }) {
2342
+ const [open, setOpen] = useState(false);
2343
+ const containerRef = useRef(null);
2344
+ useEffect(() => {
2345
+ if (!open) return;
2346
+ function onDoc(e) {
2347
+ if (!containerRef.current) return;
2348
+ if (!containerRef.current.contains(e.target)) setOpen(false);
2349
+ }
2350
+ function onKey(e) {
2351
+ if (e.key === "Escape") setOpen(false);
2352
+ }
2353
+ document.addEventListener("mousedown", onDoc);
2354
+ document.addEventListener("keydown", onKey);
2355
+ return () => {
2356
+ document.removeEventListener("mousedown", onDoc);
2357
+ document.removeEventListener("keydown", onKey);
2358
+ };
2359
+ }, [open]);
2360
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative " + (className ?? ""), children: [
2361
+ /* @__PURE__ */ jsxs(
2362
+ "button",
2363
+ {
2364
+ type: "button",
2365
+ "aria-haspopup": "menu",
2366
+ "aria-expanded": open,
2367
+ "aria-label": "Switch OrangeCheck product",
2368
+ title: "Switch product",
2369
+ onClick: () => setOpen((v) => !v),
2370
+ className: "inline-flex items-center gap-1 px-2 py-1 transition-colors " + (open ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
2371
+ children: [
2372
+ /* @__PURE__ */ jsx(Boxes, { className: "h-4 w-4" }),
2373
+ /* @__PURE__ */ jsx(
2374
+ ChevronDown,
2375
+ {
2376
+ className: "h-3.5 w-3.5 transition-transform " + (open ? "rotate-180" : "")
2377
+ }
2378
+ )
2379
+ ]
2380
+ }
2381
+ ),
2382
+ open && /* @__PURE__ */ jsxs(
2383
+ "div",
2384
+ {
2385
+ role: "menu",
2386
+ "aria-label": "Switch OrangeCheck product",
2387
+ className: "bg-background absolute right-0 top-full z-[60] mt-2 w-72 border shadow-lg",
2388
+ children: [
2389
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the family" }),
2390
+ /* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
2391
+ const isActive2 = e.slug === current;
2392
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
2393
+ Link6,
2394
+ {
2395
+ href: e.href,
2396
+ onClick: () => setOpen(false),
2397
+ "aria-current": isActive2 ? "page" : void 0,
2398
+ className: "group flex items-baseline gap-3 px-4 py-2 transition-colors " + (isActive2 ? "bg-primary/5" : "hover:bg-muted"),
2399
+ children: [
2400
+ /* @__PURE__ */ jsx(
2401
+ "span",
2402
+ {
2403
+ className: "font-display flex-1 text-[12px] font-semibold tracking-tight " + (isActive2 ? "text-primary" : "text-foreground group-hover:text-primary transition-colors"),
2404
+ children: e.label
2405
+ }
2406
+ ),
2407
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[10px] tracking-wider uppercase", children: e.sub }),
2408
+ isActive2 && /* @__PURE__ */ jsx(Check, { className: "text-primary h-3 w-3" })
2409
+ ]
2410
+ }
2411
+ ) }, e.slug);
2412
+ }) }),
2413
+ /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
2414
+ Link6,
2415
+ {
2416
+ href: "https://docs.ochk.io",
2417
+ onClick: () => setOpen(false),
2418
+ className: "text-muted-foreground hover:text-foreground inline-block transition-colors",
2419
+ children: "docs.ochk.io \u2192"
2420
+ }
2421
+ ) })
2422
+ ]
2423
+ }
2424
+ )
2425
+ ] });
2426
+ }
2088
2427
 
2089
- // src/components/index.ts
2090
- var components_exports = {};
2091
- __reExport(components_exports, ui_star);
2092
-
2093
- // src/index.ts
2094
- __reExport(src_exports, components_exports);
2428
+ // src/chrome/family-properties.ts
2429
+ var FAMILY_PROPERTIES = [
2430
+ {
2431
+ slug: "home",
2432
+ origin: "https://ochk.io",
2433
+ hostname: "ochk.io",
2434
+ label: "orangecheck",
2435
+ sub: "umbrella \xB7 sign-in",
2436
+ docsHref: "https://docs.ochk.io",
2437
+ category: "hub"
2438
+ },
2439
+ {
2440
+ slug: "docs",
2441
+ origin: "https://docs.ochk.io",
2442
+ hostname: "docs.ochk.io",
2443
+ label: "oc\xB7docs",
2444
+ sub: "unified reference",
2445
+ docsHref: "https://docs.ochk.io",
2446
+ category: "hub"
2447
+ },
2448
+ {
2449
+ slug: "me",
2450
+ origin: "https://me.ochk.io",
2451
+ hostname: "me.ochk.io",
2452
+ label: "oc\xB7me",
2453
+ sub: "earn \u2014 consumer identity",
2454
+ docsHref: "https://docs.ochk.io/me",
2455
+ category: "product"
2456
+ },
2457
+ {
2458
+ slug: "vault",
2459
+ origin: "https://vault.ochk.io",
2460
+ hostname: "vault.ochk.io",
2461
+ label: "oc\xB7vault",
2462
+ sub: "keep \u2014 encrypted secrets",
2463
+ docsHref: "https://docs.ochk.io/vault",
2464
+ category: "product"
2465
+ },
2466
+ {
2467
+ slug: "fleet",
2468
+ origin: "https://fleet.ochk.io",
2469
+ hostname: "fleet.ochk.io",
2470
+ label: "oc\xB7fleet",
2471
+ sub: "managed \u2014 agent fleet",
2472
+ docsHref: "https://docs.ochk.io/fleet",
2473
+ category: "product"
2474
+ },
2475
+ {
2476
+ slug: "attest",
2477
+ origin: "https://attest.ochk.io",
2478
+ hostname: "attest.ochk.io",
2479
+ label: "oc\xB7attest",
2480
+ sub: "am \u2014 sybil resistance",
2481
+ docsHref: "https://docs.ochk.io/attest",
2482
+ category: "protocol"
2483
+ },
2484
+ {
2485
+ slug: "lock",
2486
+ origin: "https://lock.ochk.io",
2487
+ hostname: "lock.ochk.io",
2488
+ label: "oc\xB7lock",
2489
+ sub: "whisper \u2014 encryption",
2490
+ docsHref: "https://docs.ochk.io/lock",
2491
+ category: "protocol"
2492
+ },
2493
+ {
2494
+ slug: "vote",
2495
+ origin: "https://vote.ochk.io",
2496
+ hostname: "vote.ochk.io",
2497
+ label: "oc\xB7vote",
2498
+ sub: "decide \u2014 polls",
2499
+ docsHref: "https://docs.ochk.io/vote",
2500
+ category: "protocol"
2501
+ },
2502
+ {
2503
+ slug: "stamp",
2504
+ origin: "https://stamp.ochk.io",
2505
+ hostname: "stamp.ochk.io",
2506
+ label: "oc\xB7stamp",
2507
+ sub: "declare \u2014 block-anchored",
2508
+ docsHref: "https://docs.ochk.io/stamp",
2509
+ category: "protocol"
2510
+ },
2511
+ {
2512
+ slug: "agent",
2513
+ origin: "https://agent.ochk.io",
2514
+ hostname: "agent.ochk.io",
2515
+ label: "oc\xB7agent",
2516
+ sub: "delegate \u2014 scoped auth",
2517
+ docsHref: "https://docs.ochk.io/agent",
2518
+ category: "protocol"
2519
+ },
2520
+ {
2521
+ slug: "pledge",
2522
+ origin: "https://pledge.ochk.io",
2523
+ hostname: "pledge.ochk.io",
2524
+ label: "oc\xB7pledge",
2525
+ sub: "swear \u2014 bonded commitment",
2526
+ docsHref: "https://docs.ochk.io/pledge",
2527
+ category: "protocol"
2528
+ },
2529
+ {
2530
+ slug: "analytics",
2531
+ origin: "https://analytics.ochk.io",
2532
+ hostname: "analytics.ochk.io",
2533
+ label: "oc\xB7analytics",
2534
+ sub: "owner cockpit",
2535
+ docsHref: "https://analytics.ochk.io",
2536
+ category: "owner"
2537
+ }
2538
+ ];
2539
+ var SITE_STATE_LABEL = {
2540
+ alpha: "alpha",
2541
+ beta: "beta"
2542
+ };
2543
+ function findFamilyProperty(slug) {
2544
+ return FAMILY_PROPERTIES.find((p) => p.slug === slug);
2545
+ }
2546
+ var SECTIONS = [
2547
+ { category: "hub", label: "hub" },
2548
+ { category: "product", label: "products" },
2549
+ { category: "protocol", label: "protocols" },
2550
+ { category: "owner", label: "owner" }
2551
+ ];
2552
+ function CategoryChip({ category }) {
2553
+ if (category === "hub") return null;
2554
+ const label = category === "product" ? "product" : category === "protocol" ? "protocol" : "owner";
2555
+ const tone = category === "product" ? "border-primary/25 bg-primary/10 text-primary" : category === "protocol" ? "border-muted-foreground/20 bg-muted/40 text-muted-foreground/85" : "border-warning/30 bg-warning/10 text-warning";
2556
+ return /* @__PURE__ */ jsx(
2557
+ "span",
2558
+ {
2559
+ "aria-label": category === "product" ? "commercial product" : category === "protocol" ? "protocol reference" : "owner-only surface",
2560
+ className: "ml-1 hidden rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block " + tone,
2561
+ "data-oc-category": category,
2562
+ children: label
2563
+ }
2564
+ );
2565
+ }
2566
+ function SiteStateBadge({ state }) {
2567
+ if (state === "live") return null;
2568
+ return /* @__PURE__ */ jsx(
2569
+ "span",
2570
+ {
2571
+ "aria-label": `site lifecycle: ${state}`,
2572
+ className: "text-muted-foreground/70 ml-1 hidden font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block",
2573
+ "data-oc-site-state": state,
2574
+ children: SITE_STATE_LABEL[state]
2575
+ }
2576
+ );
2577
+ }
2578
+ function MenuCategoryChip({ category }) {
2579
+ if (category === "hub") return null;
2580
+ const label = category === "product" ? "pro" : category === "protocol" ? "spec" : "own";
2581
+ const tone = category === "product" ? "bg-primary/10 text-primary" : category === "protocol" ? "bg-muted/60 text-muted-foreground/80" : "bg-warning/15 text-warning";
2582
+ return /* @__PURE__ */ jsx(
2583
+ "span",
2584
+ {
2585
+ "aria-hidden": true,
2586
+ className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " + tone,
2587
+ children: label
2588
+ }
2589
+ );
2590
+ }
2591
+ function OcLogoDropdown({
2592
+ current,
2593
+ homeHref = "/",
2594
+ siteState = "live",
2595
+ children,
2596
+ className,
2597
+ triggerClassName,
2598
+ popoverClassName,
2599
+ showOwnerEntries = false
2600
+ }) {
2601
+ const [open, setOpen] = useState(false);
2602
+ const containerRef = useRef(null);
2603
+ const menuId = useId();
2604
+ const router = useRouter();
2605
+ const currentCategory = findFamilyProperty(current)?.category ?? "hub";
2606
+ function handleTriggerClick(e) {
2607
+ if (e.detail >= 2) {
2608
+ e.preventDefault();
2609
+ setOpen(false);
2610
+ void router.push(homeHref);
2611
+ return;
2612
+ }
2613
+ setOpen((v) => !v);
2614
+ }
2615
+ useEffect(() => {
2616
+ if (!open) return;
2617
+ function onDoc(e) {
2618
+ if (!containerRef.current) return;
2619
+ if (!containerRef.current.contains(e.target)) setOpen(false);
2620
+ }
2621
+ function onKey(e) {
2622
+ if (e.key === "Escape") setOpen(false);
2623
+ }
2624
+ document.addEventListener("mousedown", onDoc);
2625
+ document.addEventListener("keydown", onKey);
2626
+ return () => {
2627
+ document.removeEventListener("mousedown", onDoc);
2628
+ document.removeEventListener("keydown", onKey);
2629
+ };
2630
+ }, [open]);
2631
+ return /* @__PURE__ */ jsxs(
2632
+ "div",
2633
+ {
2634
+ ref: containerRef,
2635
+ className: "relative inline-flex items-center " + (className ?? ""),
2636
+ "data-oc-logo-dropdown": "",
2637
+ "data-oc-current-category": currentCategory,
2638
+ "data-oc-site-state": siteState,
2639
+ children: [
2640
+ /* @__PURE__ */ jsxs(
2641
+ "button",
2642
+ {
2643
+ type: "button",
2644
+ "aria-haspopup": "menu",
2645
+ "aria-expanded": open,
2646
+ "aria-controls": menuId,
2647
+ "aria-label": "OrangeCheck family \xB7 click to open property menu, double-click to go home",
2648
+ title: "single-click \xB7 family menu \xB7 double-click \xB7 go home",
2649
+ onClick: handleTriggerClick,
2650
+ className: triggerClassName ?? "group hover:bg-accent/30 -mx-1.5 -my-1 flex min-h-[40px] items-center gap-2 rounded-sm px-1.5 py-1 transition-colors " + (open ? "bg-accent/20" : ""),
2651
+ "data-oc-logo-dropdown-trigger": "",
2652
+ "data-oc-logo-dropdown-open": open ? "true" : "false",
2653
+ children: [
2654
+ children,
2655
+ /* @__PURE__ */ jsx(CategoryChip, { category: currentCategory }),
2656
+ /* @__PURE__ */ jsx(SiteStateBadge, { state: siteState }),
2657
+ /* @__PURE__ */ jsx(
2658
+ ChevronDown,
2659
+ {
2660
+ "aria-hidden": true,
2661
+ className: "text-muted-foreground/70 group-hover:text-foreground/80 h-3.5 w-3.5 shrink-0 transition-transform duration-200 " + (open ? "rotate-180" : "")
2662
+ }
2663
+ )
2664
+ ]
2665
+ }
2666
+ ),
2667
+ /* @__PURE__ */ jsxs(
2668
+ Link6,
2669
+ {
2670
+ href: homeHref,
2671
+ "aria-label": "go to " + homeHref + " (this site's home)",
2672
+ onClick: () => setOpen(false),
2673
+ tabIndex: open ? 0 : -1,
2674
+ className: "hover:text-primary group/home -ml-1 hidden items-center gap-1 rounded-sm px-1.5 py-1 font-mono text-[9px] tracking-widest uppercase transition-all duration-200 sm:inline-flex " + (open ? "pointer-events-auto translate-x-0 text-muted-foreground/70 opacity-100 hover:bg-accent/30" : "pointer-events-none -translate-x-1 opacity-0"),
2675
+ "data-oc-logo-dropdown-home-hint": "",
2676
+ children: [
2677
+ /* @__PURE__ */ jsx(
2678
+ CornerDownLeft,
2679
+ {
2680
+ "aria-hidden": true,
2681
+ className: "h-3 w-3 group-hover/home:text-primary " + (open ? "motion-safe:animate-pulse" : "")
2682
+ }
2683
+ ),
2684
+ /* @__PURE__ */ jsx("span", { className: "text-primary/70 group-hover/home:text-primary", children: "home" })
2685
+ ]
2686
+ }
2687
+ ),
2688
+ open && /* @__PURE__ */ jsxs(
2689
+ "div",
2690
+ {
2691
+ id: menuId,
2692
+ role: "menu",
2693
+ "aria-label": "OrangeCheck family",
2694
+ className: popoverClassName ?? "bg-background absolute top-full left-0 z-[60] mt-2 w-[min(20rem,calc(100vw-1rem))] border shadow-lg",
2695
+ "data-oc-logo-dropdown-popover": "",
2696
+ children: [
2697
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the orangecheck family" }),
2698
+ /* @__PURE__ */ jsx("div", { className: "max-h-[min(28rem,70vh)] overflow-y-auto py-1", role: "none", children: SECTIONS.map(({ category, label }) => {
2699
+ if (category === "owner" && !showOwnerEntries) return null;
2700
+ const sectionEntries = FAMILY_PROPERTIES.filter(
2701
+ (e) => e.category === category
2702
+ );
2703
+ if (sectionEntries.length === 0) return null;
2704
+ return /* @__PURE__ */ jsxs("div", { role: "none", "data-oc-section": category, children: [
2705
+ /* @__PURE__ */ jsx(
2706
+ "div",
2707
+ {
2708
+ role: "separator",
2709
+ "aria-hidden": true,
2710
+ className: "text-muted-foreground/60 px-4 pt-2.5 pb-1 font-mono text-[9px] font-medium tracking-widest uppercase " + (category === "hub" ? "" : "border-t mt-1"),
2711
+ children: label
2712
+ }
2713
+ ),
2714
+ /* @__PURE__ */ jsx("ul", { role: "none", className: "pb-1", children: sectionEntries.map((e) => {
2715
+ const isActive2 = e.slug === current;
2716
+ const href = isActive2 ? homeHref : e.origin;
2717
+ return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
2718
+ Link6,
2719
+ {
2720
+ href,
2721
+ role: "menuitem",
2722
+ onClick: () => setOpen(false),
2723
+ "aria-current": isActive2 ? "page" : void 0,
2724
+ className: "group flex items-center gap-2 px-4 py-2 transition-colors " + (isActive2 ? "bg-primary/8 border-primary -ml-px border-l-2" : "hover:bg-muted -ml-px border-l-2 border-transparent"),
2725
+ "data-oc-logo-dropdown-item": isActive2 ? "current" : "sibling",
2726
+ "data-oc-entry-category": e.category,
2727
+ children: [
2728
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col leading-tight", children: [
2729
+ /* @__PURE__ */ jsx(
2730
+ "span",
2731
+ {
2732
+ className: "font-display text-[12px] font-semibold tracking-tight " + (isActive2 ? "text-primary" : "text-foreground group-hover:text-primary transition-colors"),
2733
+ children: e.label
2734
+ }
2735
+ ),
2736
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground mt-0.5 font-mono text-[10px] tracking-wide", children: e.sub })
2737
+ ] }),
2738
+ /* @__PURE__ */ jsx(MenuCategoryChip, { category: e.category }),
2739
+ isActive2 ? /* @__PURE__ */ jsxs("span", { className: "text-primary inline-flex shrink-0 items-center gap-1 font-mono text-[10px] tracking-widest uppercase", children: [
2740
+ "home",
2741
+ /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" })
2742
+ ] }) : null
2743
+ ]
2744
+ }
2745
+ ) }, e.slug);
2746
+ }) })
2747
+ ] }, category);
2748
+ }) }),
2749
+ /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
2750
+ Link6,
2751
+ {
2752
+ href: "https://docs.ochk.io",
2753
+ onClick: () => setOpen(false),
2754
+ className: "text-muted-foreground hover:text-foreground inline-block transition-colors",
2755
+ children: "docs.ochk.io \u2192"
2756
+ }
2757
+ ) })
2758
+ ]
2759
+ }
2760
+ )
2761
+ ]
2762
+ }
2763
+ );
2764
+ }
2765
+ function obscureIdentity(value) {
2766
+ if (value.length <= 12) {
2767
+ return `${value.slice(0, 4)}\u2026${value.slice(-3)}`;
2768
+ }
2769
+ return `${value.slice(0, 6)}\u2026${value.slice(-4)}`;
2770
+ }
2771
+ var IDENTITY_KIND_LABEL = {
2772
+ did: "did:oc",
2773
+ btc: "bitcoin",
2774
+ email: "email",
2775
+ nostr: "nostr"
2776
+ };
2777
+ async function writeClipboard(text) {
2778
+ try {
2779
+ if (navigator.clipboard?.writeText) {
2780
+ await navigator.clipboard.writeText(text);
2781
+ return true;
2782
+ }
2783
+ } catch {
2784
+ }
2785
+ try {
2786
+ const ta = document.createElement("textarea");
2787
+ ta.value = text;
2788
+ ta.setAttribute("readonly", "");
2789
+ ta.style.position = "fixed";
2790
+ ta.style.top = "-1000px";
2791
+ ta.style.opacity = "0";
2792
+ document.body.appendChild(ta);
2793
+ ta.select();
2794
+ const ok = document.execCommand("copy");
2795
+ document.body.removeChild(ta);
2796
+ return ok;
2797
+ } catch {
2798
+ return false;
2799
+ }
2800
+ }
2801
+ function CopyableDid({ did }) {
2802
+ const [copied, setCopied] = useState(false);
2803
+ const timerRef = useRef(null);
2804
+ useEffect(
2805
+ () => () => {
2806
+ if (timerRef.current) clearTimeout(timerRef.current);
2807
+ },
2808
+ []
2809
+ );
2810
+ const onCopy = async () => {
2811
+ const ok = await writeClipboard(did);
2812
+ if (!ok) return;
2813
+ setCopied(true);
2814
+ if (timerRef.current) clearTimeout(timerRef.current);
2815
+ timerRef.current = setTimeout(() => setCopied(false), 1600);
2816
+ };
2817
+ return /* @__PURE__ */ jsxs(
2818
+ "button",
2819
+ {
2820
+ type: "button",
2821
+ onClick: onCopy,
2822
+ "aria-label": copied ? "OrangeCheck identity copied to clipboard" : `Copy OrangeCheck identity ${did} to clipboard`,
2823
+ title: "Copy identity",
2824
+ "data-oc-account-menu-copy-did": "",
2825
+ "data-copied": copied ? "" : void 0,
2826
+ className: "group/did hover:bg-accent focus-visible:ring-ring/60 -mx-1.5 mt-px flex w-[calc(100%+0.75rem)] items-start gap-1.5 rounded px-1.5 py-1 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none",
2827
+ children: [
2828
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 font-mono text-[11px] leading-tight break-all", children: did }),
2829
+ /* @__PURE__ */ jsx(
2830
+ "span",
2831
+ {
2832
+ className: "mt-px shrink-0 transition-colors " + (copied ? "text-primary" : "text-muted-foreground/50 group-hover/did:text-foreground/80"),
2833
+ "aria-hidden": true,
2834
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3.5" })
2835
+ }
2836
+ ),
2837
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: copied ? "Copied to clipboard" : "" })
2838
+ ]
2839
+ }
2840
+ );
2841
+ }
2842
+ function PromoteRow({
2843
+ kind,
2844
+ value,
2845
+ active,
2846
+ busy,
2847
+ disabled,
2848
+ onPromote
2849
+ }) {
2850
+ const [copied, setCopied] = useState(false);
2851
+ const timerRef = useRef(null);
2852
+ useEffect(
2853
+ () => () => {
2854
+ if (timerRef.current) clearTimeout(timerRef.current);
2855
+ },
2856
+ []
2857
+ );
2858
+ const onCopy = async () => {
2859
+ const ok = await writeClipboard(value);
2860
+ if (!ok) return;
2861
+ setCopied(true);
2862
+ if (timerRef.current) clearTimeout(timerRef.current);
2863
+ timerRef.current = setTimeout(() => setCopied(false), 1600);
2864
+ };
2865
+ const kindLabel = IDENTITY_KIND_LABEL[kind];
2866
+ return /* @__PURE__ */ jsxs(
2867
+ "div",
2868
+ {
2869
+ className: "hover:bg-accent flex items-center gap-1 pr-2 transition-colors",
2870
+ "data-oc-account-menu-promote-row": kind,
2871
+ "data-active": active ? "" : void 0,
2872
+ children: [
2873
+ /* @__PURE__ */ jsxs(
2874
+ "button",
2875
+ {
2876
+ type: "button",
2877
+ role: "menuitemradio",
2878
+ "aria-checked": active,
2879
+ "aria-label": active ? `Showing as ${kindLabel}` : `Show as ${kindLabel}`,
2880
+ disabled: disabled || active,
2881
+ onClick: onPromote,
2882
+ "data-oc-account-menu-promote": kind,
2883
+ className: "flex min-w-0 flex-1 items-center gap-2 py-2 pl-3 text-left font-mono text-[11px] tracking-wide disabled:cursor-default",
2884
+ children: [
2885
+ /* @__PURE__ */ jsx(
2886
+ "span",
2887
+ {
2888
+ className: "flex size-3.5 shrink-0 items-center justify-center rounded-full border " + (active ? "border-primary" : "border-muted-foreground/40"),
2889
+ "aria-hidden": true,
2890
+ children: active ? /* @__PURE__ */ jsx("span", { className: "bg-primary size-1.5 rounded-full" }) : null
2891
+ }
2892
+ ),
2893
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 truncate", children: obscureIdentity(value) })
2894
+ ]
2895
+ }
2896
+ ),
2897
+ /* @__PURE__ */ jsx(
2898
+ "button",
2899
+ {
2900
+ type: "button",
2901
+ onClick: () => void onCopy(),
2902
+ "aria-label": copied ? `${kindLabel} copied to clipboard` : `Copy ${kindLabel} to clipboard`,
2903
+ title: "Copy",
2904
+ "data-oc-account-menu-promote-copy": kind,
2905
+ "data-copied": copied ? "" : void 0,
2906
+ className: "hover:bg-background/70 focus-visible:ring-ring/60 flex size-6 shrink-0 items-center justify-center rounded transition-colors focus-visible:ring-2 focus-visible:outline-none",
2907
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "text-primary size-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "text-muted-foreground/50 size-3.5" })
2908
+ }
2909
+ ),
2910
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50 w-14 shrink-0 text-right text-[9px] tracking-widest uppercase", children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "ml-auto size-3 animate-spin" }) : kindLabel }),
2911
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: copied ? "Copied to clipboard" : "" })
2912
+ ]
2913
+ }
2914
+ );
2915
+ }
2916
+ function IdentityPromoteSection({
2917
+ didOc,
2918
+ nostrNpub,
2919
+ current,
2920
+ open,
2921
+ setDisplayIdentity
2922
+ }) {
2923
+ const [identities, setIdentities] = useState(null);
2924
+ const [loadFailed, setLoadFailed] = useState(false);
2925
+ const [promoting, setPromoting] = useState(null);
2926
+ const [promoteErr, setPromoteErr] = useState(null);
2927
+ const lastFetchKeyRef = useRef(null);
2928
+ useEffect(() => {
2929
+ if (!open) return;
2930
+ if (lastFetchKeyRef.current === didOc) return;
2931
+ lastFetchKeyRef.current = didOc;
2932
+ let cancelled = false;
2933
+ setIdentities(null);
2934
+ setLoadFailed(false);
2935
+ void fetchOcLinkedIdentities().then((rows) => {
2936
+ if (!cancelled) setIdentities(rows);
2937
+ }).catch(() => {
2938
+ if (!cancelled) setLoadFailed(true);
2939
+ });
2940
+ return () => {
2941
+ cancelled = true;
2942
+ };
2943
+ }, [open, didOc]);
2944
+ if (identities === null && !loadFailed) return null;
2945
+ const btc = identities?.find((i) => i.kind === "btc" && i.is_primary && i.value) ?? identities?.find((i) => i.kind === "btc" && i.value);
2946
+ const email = identities?.find((i) => i.kind === "email" && i.is_primary && i.value) ?? identities?.find((i) => i.kind === "email" && i.value);
2947
+ const options = [
2948
+ { kind: "did", value: didOc }
2949
+ ];
2950
+ if (btc?.value) options.push({ kind: "btc", value: btc.value });
2951
+ if (email?.value) options.push({ kind: "email", value: email.value });
2952
+ if (nostrNpub) options.push({ kind: "nostr", value: nostrNpub });
2953
+ if (options.length < 2) return null;
2954
+ const promote = async (kind) => {
2955
+ if (promoting || kind === current.kind) return;
2956
+ setPromoting(kind);
2957
+ setPromoteErr(null);
2958
+ try {
2959
+ await setDisplayIdentity(kind);
2960
+ } catch (e) {
2961
+ setPromoteErr(e instanceof Error ? e.message : "promotion failed");
2962
+ } finally {
2963
+ setPromoting(null);
2964
+ }
2965
+ };
2966
+ return /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-1", "data-oc-account-menu-section": "show-as", children: [
2967
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 show as" }),
2968
+ options.map((opt) => /* @__PURE__ */ jsx(
2969
+ PromoteRow,
2970
+ {
2971
+ kind: opt.kind,
2972
+ value: opt.value,
2973
+ active: opt.kind === current.kind,
2974
+ busy: promoting === opt.kind,
2975
+ disabled: promoting !== null,
2976
+ onPromote: () => void promote(opt.kind)
2977
+ },
2978
+ opt.kind
2979
+ )),
2980
+ promoteErr ? /* @__PURE__ */ jsx("div", { className: "text-destructive/80 px-3 pt-1 pb-2 font-mono text-[10px]", children: promoteErr }) : null
2981
+ ] });
2982
+ }
2983
+ function OcAccountMenu(props) {
2984
+ const session = useOcSession();
2985
+ return /* @__PURE__ */ jsx(
2986
+ OcAccountMenuView,
2987
+ {
2988
+ ...props,
2989
+ session: {
2990
+ status: session.status,
2991
+ account: session.account ? {
2992
+ didOc: session.account.didOc,
2993
+ displayName: session.account.displayName ?? null,
2994
+ displayIdentity: session.account.displayIdentity,
2995
+ nostrNpub: session.account.nostrNpub ?? null
2996
+ } : null,
2997
+ signOut: session.signOut,
2998
+ refresh: session.refresh,
2999
+ setDisplayIdentity: session.setDisplayIdentity,
3000
+ // Multi-account · the connected variant always forwards
3001
+ // these from useOcSession(). The View variant accepts
3002
+ // them as optional so sites running their own auth
3003
+ // context (oc-www) can opt in incrementally.
3004
+ roster: session.roster,
3005
+ switchAccount: session.switchAccount,
3006
+ addAccountUrl: session.addAccountUrl
3007
+ }
3008
+ }
3009
+ );
3010
+ }
3011
+ function OcAccountMenuView({
3012
+ current,
3013
+ signInUrl = "/signin",
3014
+ signInLabel = "sign in",
3015
+ signOutRedirect = "/",
3016
+ menuItems,
3017
+ primaryNavLinks,
3018
+ secondaryNavLinks,
3019
+ showFamilyDashboard,
3020
+ build,
3021
+ siteState,
3022
+ className,
3023
+ triggerClassName,
3024
+ popoverClassName,
3025
+ session
3026
+ }) {
3027
+ const {
3028
+ status,
3029
+ account,
3030
+ signOut,
3031
+ refresh,
3032
+ setDisplayIdentity,
3033
+ roster,
3034
+ switchAccount,
3035
+ addAccountUrl
3036
+ } = session;
3037
+ const [hydrated, setHydrated] = useState(false);
3038
+ const [open, setOpen] = useState(false);
3039
+ const wrapRef = useRef(null);
3040
+ const property = findFamilyProperty(current);
3041
+ const hostname = property?.hostname ?? `${current}.ochk.io`;
3042
+ const isHome = current === "home";
3043
+ const familyDashboardEnabled = showFamilyDashboard ?? !isHome;
3044
+ useEffect(() => setHydrated(true), []);
3045
+ useEffect(() => {
3046
+ const onWake = () => {
3047
+ if (document.visibilityState === "visible") void refresh();
3048
+ };
3049
+ const onFocus = () => void refresh();
3050
+ document.addEventListener("visibilitychange", onWake);
3051
+ window.addEventListener("focus", onFocus);
3052
+ return () => {
3053
+ document.removeEventListener("visibilitychange", onWake);
3054
+ window.removeEventListener("focus", onFocus);
3055
+ };
3056
+ }, [refresh]);
3057
+ useEffect(() => {
3058
+ if (!open) return;
3059
+ const onClick = (e) => {
3060
+ if (wrapRef.current && !wrapRef.current.contains(e.target)) setOpen(false);
3061
+ };
3062
+ const onKey = (e) => {
3063
+ if (e.key === "Escape") setOpen(false);
3064
+ };
3065
+ document.addEventListener("mousedown", onClick);
3066
+ document.addEventListener("keydown", onKey);
3067
+ return () => {
3068
+ document.removeEventListener("mousedown", onClick);
3069
+ document.removeEventListener("keydown", onKey);
3070
+ };
3071
+ }, [open]);
3072
+ const signInTrigger = /* @__PURE__ */ jsx(
3073
+ "a",
3074
+ {
3075
+ href: signInUrl,
3076
+ "aria-label": signInLabel,
3077
+ "data-oc-account-menu-signin": "",
3078
+ className: triggerClassName ?? "border-input bg-background hover:bg-accent inline-flex h-8 items-center justify-center rounded-md border px-3 font-mono text-[11px] font-semibold tracking-widest uppercase transition-colors",
3079
+ children: signInLabel
3080
+ }
3081
+ );
3082
+ if (!hydrated || status === "loading") {
3083
+ return signInTrigger;
3084
+ }
3085
+ if (status !== "authenticated" || !account) {
3086
+ return signInTrigger;
3087
+ }
3088
+ const displayName = account.displayName ?? null;
3089
+ const label = displayName ?? obscureIdentity(account.displayIdentity.value);
3090
+ return /* @__PURE__ */ jsxs(
3091
+ "div",
3092
+ {
3093
+ ref: wrapRef,
3094
+ className: "relative inline-block " + (className ?? ""),
3095
+ "data-oc-account-menu": "",
3096
+ children: [
3097
+ /* @__PURE__ */ jsxs(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ onClick: () => setOpen((v) => !v),
3102
+ "aria-haspopup": "menu",
3103
+ "aria-expanded": open,
3104
+ "aria-label": `Signed in as ${account.didOc}. Open account menu.`,
3105
+ className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-3 font-mono text-[11px] tracking-wide transition-colors",
3106
+ "data-oc-account-menu-trigger": "",
3107
+ children: [
3108
+ /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block size-1.5 rounded-full", "aria-hidden": true }),
3109
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: label }),
3110
+ /* @__PURE__ */ jsx(
3111
+ "svg",
3112
+ {
3113
+ width: "9",
3114
+ height: "9",
3115
+ viewBox: "0 0 10 10",
3116
+ "aria-hidden": true,
3117
+ className: "opacity-60 transition-transform " + (open ? "rotate-180" : "rotate-0"),
3118
+ children: /* @__PURE__ */ jsx(
3119
+ "path",
3120
+ {
3121
+ d: "M2 4 L5 7 L8 4",
3122
+ stroke: "currentColor",
3123
+ strokeWidth: "1.5",
3124
+ fill: "none",
3125
+ strokeLinecap: "round"
3126
+ }
3127
+ )
3128
+ }
3129
+ )
3130
+ ]
3131
+ }
3132
+ ),
3133
+ open && /* @__PURE__ */ jsxs(
3134
+ "div",
3135
+ {
3136
+ role: "menu",
3137
+ "aria-label": "Account menu",
3138
+ className: popoverClassName ?? "border-border bg-popover text-popover-foreground absolute top-[calc(100%+6px)] right-0 z-50 w-[min(20rem,calc(100vw-1rem))] border shadow-xl",
3139
+ "data-oc-account-menu-popover": "",
3140
+ children: [
3141
+ /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-3", children: [
3142
+ /* @__PURE__ */ jsxs("div", { className: "text-primary mb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3143
+ "\xA7 signed in \xB7 ",
3144
+ hostname
3145
+ ] }),
3146
+ /* @__PURE__ */ jsx(CopyableDid, { did: account.didOc }),
3147
+ displayName ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
3148
+ ] }),
3149
+ /* @__PURE__ */ jsx(
3150
+ IdentityPromoteSection,
3151
+ {
3152
+ didOc: account.didOc,
3153
+ nostrNpub: account.nostrNpub ?? null,
3154
+ current: account.displayIdentity,
3155
+ open,
3156
+ setDisplayIdentity
3157
+ }
3158
+ ),
3159
+ /* @__PURE__ */ jsx(
3160
+ AccountsSection,
3161
+ {
3162
+ roster: roster ?? [],
3163
+ switchAccount,
3164
+ addAccountUrl,
3165
+ signOut,
3166
+ onActionStart: () => setOpen(false)
3167
+ }
3168
+ ),
3169
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3170
+ PopoverSection,
3171
+ {
3172
+ label: "navigate",
3173
+ items: primaryNavLinks,
3174
+ onItemClick: () => setOpen(false)
3175
+ }
3176
+ ) : null,
3177
+ /* @__PURE__ */ jsxs("div", { className: "p-1", "data-oc-account-menu-section": "account", children: [
3178
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pb-1 pt-2 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 account" }) : null,
3179
+ menuItems?.map((item) => {
3180
+ const onClick = () => setOpen(false);
3181
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3182
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3183
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3184
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3185
+ item.external ? /* @__PURE__ */ jsx(
3186
+ "span",
3187
+ {
3188
+ className: "text-muted-foreground/70 text-[10px]",
3189
+ "aria-hidden": true,
3190
+ children: "\u2197"
3191
+ }
3192
+ ) : null
3193
+ ] });
3194
+ return item.external ? /* @__PURE__ */ jsx(
3195
+ "a",
3196
+ {
3197
+ href: item.href,
3198
+ target: "_blank",
3199
+ rel: "noreferrer",
3200
+ onClick,
3201
+ role: "menuitem",
3202
+ className: cls,
3203
+ "data-oc-account-menu-item": "",
3204
+ children: inner
3205
+ },
3206
+ item.href
3207
+ ) : /* @__PURE__ */ jsx(
3208
+ Link6,
3209
+ {
3210
+ href: item.href,
3211
+ onClick,
3212
+ role: "menuitem",
3213
+ className: cls,
3214
+ "data-oc-account-menu-item": "",
3215
+ children: inner
3216
+ },
3217
+ item.href
3218
+ );
3219
+ }),
3220
+ familyDashboardEnabled ? /* @__PURE__ */ jsxs(
3221
+ "a",
3222
+ {
3223
+ href: "https://ochk.io/dashboard",
3224
+ target: "_blank",
3225
+ rel: "noreferrer",
3226
+ onClick: () => setOpen(false),
3227
+ role: "menuitem",
3228
+ className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3229
+ "data-oc-account-menu-item": "",
3230
+ "data-oc-account-menu-family-dashboard": "",
3231
+ children: [
3232
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3233
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "family dashboard" }),
3234
+ /* @__PURE__ */ jsx(
3235
+ "span",
3236
+ {
3237
+ className: "text-muted-foreground/70 text-[10px]",
3238
+ "aria-hidden": true,
3239
+ children: "\u2197"
3240
+ }
3241
+ )
3242
+ ]
3243
+ }
3244
+ ) : null,
3245
+ /* @__PURE__ */ jsxs(
3246
+ "button",
3247
+ {
3248
+ type: "button",
3249
+ role: "menuitem",
3250
+ onClick: () => {
3251
+ setOpen(false);
3252
+ void (async () => {
3253
+ await signOut();
3254
+ if (typeof window !== "undefined") {
3255
+ window.location.assign(signOutRedirect);
3256
+ }
3257
+ })();
3258
+ },
3259
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3260
+ "data-oc-account-menu-item": "",
3261
+ "data-oc-account-menu-signout": "",
3262
+ children: [
3263
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3264
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "sign out" })
3265
+ ]
3266
+ }
3267
+ )
3268
+ ] }),
3269
+ secondaryNavLinks && secondaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3270
+ PopoverSection,
3271
+ {
3272
+ label: "more",
3273
+ items: secondaryNavLinks,
3274
+ onItemClick: () => setOpen(false),
3275
+ bordered: true
3276
+ }
3277
+ ) : null,
3278
+ build ? /* @__PURE__ */ jsx(BuildFooter, { hostname, build, state: siteState }) : null
3279
+ ]
3280
+ }
3281
+ )
3282
+ ]
3283
+ }
3284
+ );
3285
+ }
3286
+ function AccountsSection({
3287
+ roster,
3288
+ switchAccount,
3289
+ addAccountUrl,
3290
+ signOut,
3291
+ onActionStart
3292
+ }) {
3293
+ const [switching, setSwitching] = useState(null);
3294
+ const [err, setErr] = useState(null);
3295
+ if (!addAccountUrl) return null;
3296
+ const onSwitch = async (didOc) => {
3297
+ if (!switchAccount || switching) return;
3298
+ setSwitching(didOc);
3299
+ setErr(null);
3300
+ try {
3301
+ await switchAccount(didOc);
3302
+ } catch (e) {
3303
+ setErr(e instanceof Error ? e.message : "switch failed");
3304
+ } finally {
3305
+ setSwitching(null);
3306
+ }
3307
+ };
3308
+ return /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-1", "data-oc-account-menu-section": "accounts", children: [
3309
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 accounts" }),
3310
+ roster.map((peer) => /* @__PURE__ */ jsx(
3311
+ SwitchRow,
3312
+ {
3313
+ peer,
3314
+ busy: switching === peer.didOc,
3315
+ disabled: switching !== null,
3316
+ onSwitch: () => void onSwitch(peer.didOc)
3317
+ },
3318
+ peer.didOc
3319
+ )),
3320
+ /* @__PURE__ */ jsxs(
3321
+ "a",
3322
+ {
3323
+ href: addAccountUrl(),
3324
+ onClick: () => onActionStart(),
3325
+ role: "menuitem",
3326
+ "data-oc-account-menu-add-account": "",
3327
+ className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3328
+ children: [
3329
+ /* @__PURE__ */ jsx(Plus, { className: "text-muted-foreground size-3.5 shrink-0", "aria-hidden": true }),
3330
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: roster.length === 0 ? "add another account" : "add another" })
3331
+ ]
3332
+ }
3333
+ ),
3334
+ roster.length > 0 ? /* @__PURE__ */ jsxs(
3335
+ "button",
3336
+ {
3337
+ type: "button",
3338
+ role: "menuitem",
3339
+ onClick: () => {
3340
+ onActionStart();
3341
+ void (async () => {
3342
+ try {
3343
+ await signOut({ scope: "current" });
3344
+ } catch {
3345
+ }
3346
+ })();
3347
+ },
3348
+ "data-oc-account-menu-leave-current": "",
3349
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3350
+ children: [
3351
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3352
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "leave this account" })
3353
+ ]
3354
+ }
3355
+ ) : null,
3356
+ err ? /* @__PURE__ */ jsx("div", { className: "text-destructive/80 px-3 pt-1 pb-2 font-mono text-[10px]", children: err }) : null
3357
+ ] });
3358
+ }
3359
+ function SwitchRow({
3360
+ peer,
3361
+ busy,
3362
+ disabled,
3363
+ onSwitch
3364
+ }) {
3365
+ const label = peer.displayName ?? obscureIdentity(peer.displayIdentity.value);
3366
+ const kindLabel = IDENTITY_KIND_LABEL[peer.displayIdentity.kind];
3367
+ return /* @__PURE__ */ jsxs(
3368
+ "button",
3369
+ {
3370
+ type: "button",
3371
+ role: "menuitemradio",
3372
+ "aria-checked": false,
3373
+ "aria-label": `Switch to ${peer.didOc}`,
3374
+ disabled,
3375
+ onClick: onSwitch,
3376
+ "data-oc-account-menu-switch-row": "",
3377
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors disabled:cursor-default",
3378
+ children: [
3379
+ /* @__PURE__ */ jsx(
3380
+ "span",
3381
+ {
3382
+ className: "border-muted-foreground/40 flex size-3.5 shrink-0 items-center justify-center rounded-full border",
3383
+ "aria-hidden": true
3384
+ }
3385
+ ),
3386
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 truncate", children: label }),
3387
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50 w-14 shrink-0 text-right text-[9px] tracking-widest uppercase", children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "ml-auto size-3 animate-spin" }) : kindLabel })
3388
+ ]
3389
+ }
3390
+ );
3391
+ }
3392
+ function PopoverSection({
3393
+ label,
3394
+ items,
3395
+ onItemClick,
3396
+ bordered
3397
+ }) {
3398
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3399
+ return /* @__PURE__ */ jsxs(
3400
+ "div",
3401
+ {
3402
+ className: "p-1 " + (bordered ? "border-border border-t" : ""),
3403
+ "data-oc-account-menu-section": label,
3404
+ children: [
3405
+ /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3406
+ "\xA7 ",
3407
+ label
3408
+ ] }),
3409
+ items.map((item) => {
3410
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3411
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3412
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3413
+ item.external ? /* @__PURE__ */ jsx(
3414
+ "span",
3415
+ {
3416
+ className: "text-muted-foreground/70 text-[10px]",
3417
+ "aria-hidden": true,
3418
+ children: "\u2197"
3419
+ }
3420
+ ) : null
3421
+ ] });
3422
+ return item.external ? /* @__PURE__ */ jsx(
3423
+ "a",
3424
+ {
3425
+ href: item.href,
3426
+ target: "_blank",
3427
+ rel: "noreferrer",
3428
+ onClick: onItemClick,
3429
+ role: "menuitem",
3430
+ className: cls,
3431
+ "data-oc-account-menu-item": "",
3432
+ children: inner
3433
+ },
3434
+ item.href
3435
+ ) : /* @__PURE__ */ jsx(
3436
+ Link6,
3437
+ {
3438
+ href: item.href,
3439
+ onClick: onItemClick,
3440
+ role: "menuitem",
3441
+ className: cls,
3442
+ "data-oc-account-menu-item": "",
3443
+ children: inner
3444
+ },
3445
+ item.href
3446
+ );
3447
+ })
3448
+ ]
3449
+ }
3450
+ );
3451
+ }
3452
+ function BuildFooter({
3453
+ hostname,
3454
+ build,
3455
+ state
3456
+ }) {
3457
+ const sha = build.sha;
3458
+ const showSha = !!sha && sha !== "dev";
3459
+ const commitUrl = showSha && build.repo ? `https://github.com/${build.repo}/commit/${sha}` : null;
3460
+ return /* @__PURE__ */ jsxs(
3461
+ "div",
3462
+ {
3463
+ className: "text-muted-foreground/60 border-border border-t px-3 py-2 font-mono text-[9.5px] tracking-widest uppercase",
3464
+ "data-oc-account-menu-build": "",
3465
+ children: [
3466
+ hostname,
3467
+ state && state !== "live" ? /* @__PURE__ */ jsxs(Fragment, { children: [
3468
+ " \xB7 ",
3469
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/80", children: state })
3470
+ ] }) : null,
3471
+ " ",
3472
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground/80", children: [
3473
+ "v",
3474
+ build.version,
3475
+ showSha ? /* @__PURE__ */ jsxs(Fragment, { children: [
3476
+ " \xB7 ",
3477
+ commitUrl ? /* @__PURE__ */ jsx(
3478
+ "a",
3479
+ {
3480
+ href: commitUrl,
3481
+ target: "_blank",
3482
+ rel: "noreferrer",
3483
+ className: "hover:text-foreground/90 underline decoration-dotted underline-offset-2",
3484
+ children: sha
3485
+ }
3486
+ ) : sha
3487
+ ] }) : null
3488
+ ] })
3489
+ ]
3490
+ }
3491
+ );
3492
+ }
3493
+ function isActive(pathname, link) {
3494
+ if (link.external) return false;
3495
+ if (link.matchExact) return pathname === link.href;
3496
+ if (link.href === "/") return pathname === "/";
3497
+ return pathname === link.href || pathname.startsWith(link.href + "/");
3498
+ }
3499
+ function OcPrimaryNav({ activePath, links, className }) {
3500
+ return /* @__PURE__ */ jsx(
3501
+ "nav",
3502
+ {
3503
+ "aria-label": "primary",
3504
+ className: "flex min-w-0 items-center justify-start overflow-x-auto gap-0.5 sm:gap-1 whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden " + (className ?? ""),
3505
+ "data-oc-primary-nav": "",
3506
+ children: links.map((link) => {
3507
+ const active = isActive(activePath, link);
3508
+ const className2 = "font-display relative shrink-0 px-2 py-1 sm:px-3 text-[11px] sm:text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? 'text-primary after:bg-primary after:absolute after:inset-x-2 after:-bottom-[13px] after:h-px after:content-[""]' : "text-muted-foreground hover:text-foreground");
3509
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3510
+ link.label,
3511
+ link.external ? /* @__PURE__ */ jsx(
3512
+ "span",
3513
+ {
3514
+ "aria-hidden": true,
3515
+ className: "text-muted-foreground/60 ml-1 text-[9px]",
3516
+ children: "\u2197"
3517
+ }
3518
+ ) : null
3519
+ ] });
3520
+ return link.external ? /* @__PURE__ */ jsx(
3521
+ "a",
3522
+ {
3523
+ href: link.href,
3524
+ target: "_blank",
3525
+ rel: "noreferrer",
3526
+ className: className2,
3527
+ "data-oc-primary-nav-item": "",
3528
+ children: content
3529
+ },
3530
+ link.href
3531
+ ) : /* @__PURE__ */ jsx(
3532
+ Link6,
3533
+ {
3534
+ href: link.href,
3535
+ "aria-current": active ? "page" : void 0,
3536
+ className: className2,
3537
+ "data-oc-primary-nav-item": active ? "active" : "sibling",
3538
+ children: content
3539
+ },
3540
+ link.href
3541
+ );
3542
+ })
3543
+ }
3544
+ );
3545
+ }
3546
+ function OcDashboardShell({
3547
+ rootHref = "/dashboard",
3548
+ siteLabel,
3549
+ tools,
3550
+ active,
3551
+ eyebrow,
3552
+ title,
3553
+ description,
3554
+ children,
3555
+ className
3556
+ }) {
3557
+ const [drawerOpen, setDrawerOpen] = useState(false);
3558
+ useEffect(() => {
3559
+ if (!drawerOpen) return;
3560
+ function onKey(e) {
3561
+ if (e.key === "Escape") setDrawerOpen(false);
3562
+ }
3563
+ document.addEventListener("keydown", onKey);
3564
+ const prevOverflow = document.body.style.overflow;
3565
+ document.body.style.overflow = "hidden";
3566
+ return () => {
3567
+ document.removeEventListener("keydown", onKey);
3568
+ document.body.style.overflow = prevOverflow;
3569
+ };
3570
+ }, [drawerOpen]);
3571
+ const hasHeader = Boolean(title) || Boolean(eyebrow);
3572
+ return /* @__PURE__ */ jsxs(
3573
+ "div",
3574
+ {
3575
+ className: "container " + (className ?? ""),
3576
+ "data-oc-dashboard-shell": "",
3577
+ children: [
3578
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-[calc(100vh-3rem)] flex-col md:flex-row md:gap-8", children: [
3579
+ /* @__PURE__ */ jsx(
3580
+ Sidebar,
3581
+ {
3582
+ rootHref,
3583
+ siteLabel,
3584
+ tools,
3585
+ active,
3586
+ variant: "desktop"
3587
+ }
3588
+ ),
3589
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
3590
+ /* @__PURE__ */ jsxs("div", { className: "border-border flex items-center justify-between border-b py-3 md:hidden", children: [
3591
+ /* @__PURE__ */ jsxs(
3592
+ "button",
3593
+ {
3594
+ type: "button",
3595
+ onClick: () => setDrawerOpen(true),
3596
+ className: "text-muted-foreground hover:text-foreground inline-flex h-9 items-center gap-2 px-1 font-mono text-[11px] tracking-widest uppercase transition-colors",
3597
+ "aria-label": "open dashboard tools",
3598
+ "aria-expanded": drawerOpen,
3599
+ "data-oc-dashboard-mobile-trigger": "",
3600
+ children: [
3601
+ /* @__PURE__ */ jsx("span", { className: "text-[14px] leading-none", children: "\u2261" }),
3602
+ /* @__PURE__ */ jsx("span", { children: "tools" })
3603
+ ]
3604
+ }
3605
+ ),
3606
+ /* @__PURE__ */ jsx(
3607
+ Link6,
3608
+ {
3609
+ href: rootHref,
3610
+ className: "text-primary font-mono text-[11px] tracking-widest uppercase",
3611
+ children: "\xA7 dashboard"
3612
+ }
3613
+ )
3614
+ ] }),
3615
+ /* @__PURE__ */ jsxs("div", { className: "pt-6 md:pt-3", children: [
3616
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "max-w-3xl", children: [
3617
+ eyebrow ? /* @__PURE__ */ jsx("div", { className: "label-mono text-primary mb-3 font-mono text-[10px] tracking-widest uppercase", children: eyebrow }) : null,
3618
+ title ? /* @__PURE__ */ jsx("h1", { className: "font-display text-2xl font-bold tracking-tight sm:text-3xl", children: title }) : null,
3619
+ description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-3 max-w-[64ch] text-sm leading-relaxed", children: description }) : null
3620
+ ] }),
3621
+ /* @__PURE__ */ jsx("div", { className: hasHeader ? "mt-8 pb-12" : "pb-12", children })
3622
+ ] })
3623
+ ] })
3624
+ ] }),
3625
+ drawerOpen ? /* @__PURE__ */ jsxs(
3626
+ "div",
3627
+ {
3628
+ className: "fixed inset-0 z-50 md:hidden",
3629
+ role: "dialog",
3630
+ "aria-modal": "true",
3631
+ "aria-label": "dashboard tools",
3632
+ "data-oc-dashboard-drawer": "",
3633
+ children: [
3634
+ /* @__PURE__ */ jsx(
3635
+ "div",
3636
+ {
3637
+ className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
3638
+ onClick: () => setDrawerOpen(false),
3639
+ "aria-hidden": true
3640
+ }
3641
+ ),
3642
+ /* @__PURE__ */ jsx("div", { className: "bg-background absolute top-0 left-0 h-full w-[85vw] max-w-sm border-r shadow-xl", children: /* @__PURE__ */ jsx(
3643
+ Sidebar,
3644
+ {
3645
+ rootHref,
3646
+ siteLabel,
3647
+ tools,
3648
+ active,
3649
+ variant: "drawer",
3650
+ onClose: () => setDrawerOpen(false)
3651
+ }
3652
+ ) })
3653
+ ]
3654
+ }
3655
+ ) : null
3656
+ ]
3657
+ }
3658
+ );
3659
+ }
3660
+ function Sidebar({
3661
+ rootHref,
3662
+ siteLabel,
3663
+ tools,
3664
+ active,
3665
+ variant,
3666
+ onClose
3667
+ }) {
3668
+ const isDrawer = variant === "drawer";
3669
+ return /* @__PURE__ */ jsxs(
3670
+ "aside",
3671
+ {
3672
+ className: isDrawer ? "flex h-full w-full flex-col bg-card" : "hidden md:sticky md:top-4 md:flex md:h-[calc(100vh-2rem)] md:w-56 md:shrink-0 md:flex-col md:self-start md:overflow-y-auto md:rounded md:border md:bg-card/40 lg:w-60",
3673
+ "aria-label": "dashboard tools",
3674
+ "data-oc-dashboard-sidebar": variant,
3675
+ children: [
3676
+ /* @__PURE__ */ jsxs("div", { className: "border-b px-4 py-3", children: [
3677
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
3678
+ /* @__PURE__ */ jsx(
3679
+ Link6,
3680
+ {
3681
+ href: rootHref,
3682
+ onClick: onClose,
3683
+ className: "hover:text-foreground font-display text-sm font-bold tracking-tight",
3684
+ children: "\xA7 dashboard"
3685
+ }
3686
+ ),
3687
+ isDrawer ? /* @__PURE__ */ jsx(
3688
+ "button",
3689
+ {
3690
+ type: "button",
3691
+ onClick: onClose,
3692
+ className: "text-muted-foreground hover:text-foreground -mr-2 inline-flex h-8 w-8 items-center justify-center rounded font-mono text-lg",
3693
+ "aria-label": "close navigation",
3694
+ children: "\xD7"
3695
+ }
3696
+ ) : null
3697
+ ] }),
3698
+ siteLabel ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/70 mt-1 font-mono text-[10px] tracking-widest uppercase", children: siteLabel }) : null
3699
+ ] }),
3700
+ /* @__PURE__ */ jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [
3701
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 mb-1 px-3 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 tools" }),
3702
+ /* @__PURE__ */ jsx("ul", { className: "space-y-0.5", children: tools.map((tool) => {
3703
+ const isActive2 = tool.id === active;
3704
+ const innerCls = "flex items-baseline gap-2 rounded px-3 py-1.5 text-[12.5px] transition-colors " + (isActive2 ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground hover:text-foreground hover:bg-muted/30");
3705
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3706
+ tool.icon ? /* @__PURE__ */ jsx(
3707
+ "span",
3708
+ {
3709
+ className: "shrink-0 font-mono text-[11px] " + (isActive2 ? "text-primary" : "text-muted-foreground/70"),
3710
+ "aria-hidden": true,
3711
+ children: tool.icon
3712
+ }
3713
+ ) : null,
3714
+ /* @__PURE__ */ jsxs("span", { className: "flex-1 leading-tight", children: [
3715
+ /* @__PURE__ */ jsx("span", { children: tool.label }),
3716
+ tool.tagline ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60 mt-0.5 block font-mono text-[10px] tracking-wide normal-case", children: tool.tagline }) : null
3717
+ ] }),
3718
+ tool.external ? /* @__PURE__ */ jsx(
3719
+ "span",
3720
+ {
3721
+ className: "text-muted-foreground/60 text-[10px]",
3722
+ "aria-hidden": true,
3723
+ children: "\u2197"
3724
+ }
3725
+ ) : null
3726
+ ] });
3727
+ return /* @__PURE__ */ jsx("li", { children: tool.external ? /* @__PURE__ */ jsx(
3728
+ "a",
3729
+ {
3730
+ href: tool.href,
3731
+ target: "_blank",
3732
+ rel: "noreferrer",
3733
+ onClick: onClose,
3734
+ className: innerCls,
3735
+ "data-oc-dashboard-tool": isActive2 ? "active" : "sibling",
3736
+ children: content
3737
+ }
3738
+ ) : /* @__PURE__ */ jsx(
3739
+ Link6,
3740
+ {
3741
+ href: tool.href,
3742
+ onClick: onClose,
3743
+ "aria-current": isActive2 ? "page" : void 0,
3744
+ className: innerCls,
3745
+ "data-oc-dashboard-tool": isActive2 ? "active" : "sibling",
3746
+ children: content
3747
+ }
3748
+ ) }, tool.id);
3749
+ }) })
3750
+ ] })
3751
+ ]
3752
+ }
3753
+ );
3754
+ }
3755
+ function OcDashboardHub({ tools, className }) {
3756
+ return /* @__PURE__ */ jsx(
3757
+ "ul",
3758
+ {
3759
+ className: "grid gap-px border-t border-l sm:grid-cols-2 " + (className ?? ""),
3760
+ "data-oc-dashboard-hub": "",
3761
+ children: tools.map((tool) => {
3762
+ const content = /* @__PURE__ */ jsxs("span", { className: "flex h-full flex-col gap-3 p-5 transition-colors", children: [
3763
+ /* @__PURE__ */ jsxs("span", { className: "flex items-baseline gap-3", children: [
3764
+ tool.icon ? /* @__PURE__ */ jsx(
3765
+ "span",
3766
+ {
3767
+ className: "text-primary font-mono text-[13px]",
3768
+ "aria-hidden": true,
3769
+ children: tool.icon
3770
+ }
3771
+ ) : null,
3772
+ /* @__PURE__ */ jsx("span", { className: "font-display text-foreground text-base font-bold tracking-tight", children: tool.label }),
3773
+ tool.external ? /* @__PURE__ */ jsx(
3774
+ "span",
3775
+ {
3776
+ className: "text-muted-foreground/60 ml-auto text-xs",
3777
+ "aria-hidden": true,
3778
+ children: "\u2197"
3779
+ }
3780
+ ) : /* @__PURE__ */ jsx(
3781
+ "span",
3782
+ {
3783
+ className: "text-muted-foreground/60 ml-auto text-xs",
3784
+ "aria-hidden": true,
3785
+ children: "\u2192"
3786
+ }
3787
+ )
3788
+ ] }),
3789
+ tool.tagline ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm leading-relaxed", children: tool.tagline }) : null
3790
+ ] });
3791
+ const cls = "hover:bg-muted/30 group block border-r border-b transition-colors";
3792
+ return /* @__PURE__ */ jsx("li", { children: tool.external ? /* @__PURE__ */ jsx(
3793
+ "a",
3794
+ {
3795
+ href: tool.href,
3796
+ target: "_blank",
3797
+ rel: "noreferrer",
3798
+ className: cls,
3799
+ children: content
3800
+ }
3801
+ ) : /* @__PURE__ */ jsx(Link6, { href: tool.href, className: cls, children: content }) }, tool.id);
3802
+ })
3803
+ }
3804
+ );
3805
+ }
3806
+ function AppShell({
3807
+ eyebrow,
3808
+ title,
3809
+ description,
3810
+ headerActions,
3811
+ children,
3812
+ className
3813
+ }) {
3814
+ const hasHeader = Boolean(title);
3815
+ return /* @__PURE__ */ jsx("div", { className: "container " + (className ?? ""), children: /* @__PURE__ */ jsx("div", { className: "flex min-h-[calc(100vh-3rem)] flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "pt-6 md:pt-8", children: [
3816
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [
3817
+ /* @__PURE__ */ jsxs("div", { className: "max-w-3xl", children: [
3818
+ eyebrow && /* @__PURE__ */ jsx("div", { className: "label-mono text-primary mb-3", children: eyebrow }),
3819
+ /* @__PURE__ */ jsx("h1", { className: "font-display text-2xl font-bold tracking-tight sm:text-3xl", children: title }),
3820
+ description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-3 max-w-[64ch] text-sm leading-relaxed", children: description })
3821
+ ] }),
3822
+ headerActions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: headerActions })
3823
+ ] }),
3824
+ /* @__PURE__ */ jsx("div", { className: hasHeader ? "mt-8 pb-12" : "pb-12", children })
3825
+ ] }) }) }) });
3826
+ }
3827
+ var HIDE = {
3828
+ sm: "hidden sm:inline",
3829
+ md: "hidden md:inline",
3830
+ lg: "hidden lg:inline"
3831
+ };
3832
+ function LayoutSubHeader({
3833
+ product,
3834
+ status = "live \xB7 mainnet",
3835
+ tags = [],
3836
+ noHeartbeat = false,
3837
+ className
3838
+ }) {
3839
+ return /* @__PURE__ */ jsx("div", { className: cn("border-b", className), children: /* @__PURE__ */ jsxs("div", { className: "container flex flex-wrap items-center justify-between gap-x-6 gap-y-1 py-2 font-mono text-[11px]", children: [
3840
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
3841
+ !noHeartbeat && /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block h-1.5 w-1.5 animate-pulse rounded-full" }),
3842
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground tracking-widest uppercase", children: status }),
3843
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: product })
3844
+ ] }),
3845
+ tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 tracking-widest uppercase", children: tags.map((tag, i) => /* @__PURE__ */ jsx("span", { className: tag.hideBelow ? HIDE[tag.hideBelow] : void 0, children: tag.label }, i)) })
3846
+ ] }) });
3847
+ }
2095
3848
 
2096
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, Badge, Bar, BitcoinAddress, Button, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAppearanceMenu, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SatsAmount, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatusPill, Switch, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, accentFor, badgeVariants, buttonVariants, cn, confirm, explorerUrl, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin };
3849
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, Badge, Bar, BitcoinAddress, Button, Callout, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, HelpHint, Input, Label, LayoutSubHeader, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppearanceMenu, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatGrid, StatTile, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, accentFor, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, makeStatusPill, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin };
2097
3850
  //# sourceMappingURL=index.mjs.map
2098
3851
  //# sourceMappingURL=index.mjs.map