@orangecheck/design 0.6.0 → 0.7.0

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