@openrails/billing-ui 0.251.0 → 0.252.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/CHANGELOG.md +9 -0
- package/dist/admin/messages.d.ts +8 -0
- package/dist/{admin-catalog-3pPEAuDY.js → admin-catalog-Bsxo2gyS.js} +2 -2
- package/dist/{admin-catalog-3pPEAuDY.js.map → admin-catalog-Bsxo2gyS.js.map} +1 -1
- package/dist/{admin-price-detail-BeGDPxKX.js → admin-price-detail-ByCmrx_W.js} +2 -3
- package/dist/admin-price-detail-ByCmrx_W.js.map +1 -0
- package/dist/{admin-price-wizard-ferZSTfO.js → admin-price-wizard-m7Qjhq6W.js} +2 -2
- package/dist/admin-price-wizard-m7Qjhq6W.js.map +1 -0
- package/dist/{admin-settings-C6eWFkDn.js → admin-settings-BIUgvclv.js} +99 -17
- package/dist/admin-settings-BIUgvclv.js.map +1 -0
- package/dist/admin.js +13 -5
- package/dist/admin.js.map +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +1 -1
- package/dist/client/generated/wire.d.ts +6 -6
- package/package.json +1 -2
- package/dist/admin-price-detail-BeGDPxKX.js.map +0 -1
- package/dist/admin-price-wizard-ferZSTfO.js.map +0 -1
- package/dist/admin-settings-C6eWFkDn.js.map +0 -1
package/dist/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","names":[],"sources":["../src/appearance.ts","../src/admin/routes.tsx","../src/admin/hooks/use-mobile.ts","../src/admin/components/ui/separator.tsx","../src/admin/components/ui/sheet.tsx","../src/admin/components/ui/tooltip.tsx","../src/admin/components/ui/sidebar.tsx","../src/admin/navigation.tsx","../src/admin/components/app-sidebar.tsx","../src/admin/components/no-access.tsx","../src/admin/components/no-merchants.tsx","../src/admin/components/notification-bell.tsx","../src/admin/components/ui/breadcrumb.tsx","../src/admin/components/site-header.tsx","../src/admin/layouts/app-layout.tsx","../src/admin/components/ui/alert-dialog.tsx","../src/admin/components/confirm.tsx","../src/admin/components/ui/sonner.tsx","../src/admin/lib/chunk-error.ts","../src/admin/components/route-error.tsx","../src/admin/lib/query-client.ts","../src/admin/theme.ts","../src/admin/billing-admin.tsx","../src/admin/summary.tsx","../src/admin/messages.ts"],"sourcesContent":["// Integrator theming. The component scopes the standard shadcn token set\n// under its root, so `theme` flips the whole palette and `variables` override\n// individual tokens without the integrator touching our CSS.\nimport type { CSSProperties } from \"react\"\n\n// `inherit` uses the host page's shadcn tokens (`--background`, ...) and its\n// `.dark` class instead of the bundled zinc palette.\nexport type BillingTheme = \"light\" | \"dark\" | \"auto\" | \"inherit\"\n\n// The tokens integrators may override. Values are raw CSS color/length\n// strings; they land as custom properties on the purchase root.\nexport interface BillingVariables {\n background?: string\n foreground?: string\n card?: string\n mutedForeground?: string\n faintForeground?: string\n border?: string\n input?: string\n primary?: string\n primaryForeground?: string\n destructive?: string\n ring?: string\n radius?: string\n fontFamily?: string\n}\n\nexport interface BillingAppearance {\n theme?: BillingTheme\n variables?: BillingVariables\n}\n\nconst VARIABLE_TO_CSS: Record<keyof BillingVariables, string> = {\n background: \"--background\",\n foreground: \"--foreground\",\n card: \"--card\",\n mutedForeground: \"--muted-foreground\",\n faintForeground: \"--orck-faint\",\n border: \"--border\",\n input: \"--input\",\n primary: \"--primary\",\n primaryForeground: \"--primary-foreground\",\n destructive: \"--destructive\",\n ring: \"--ring\",\n radius: \"--radius\",\n fontFamily: \"--orck-font\",\n}\n\nexport function appearanceStyle(\n appearance: BillingAppearance | undefined,\n namespace: \"orck\" | \"orba\" = \"orck\"\n): CSSProperties | undefined {\n const variables = appearance?.variables\n if (!variables) return undefined\n const style: Record<string, string> = {}\n for (const [key, value] of Object.entries(variables)) {\n if (!value) continue\n style[\n VARIABLE_TO_CSS[key as keyof BillingVariables].replace(\n \"--orck-\",\n `--${namespace}-`\n )\n ] = value\n }\n return style as CSSProperties\n}\n\nexport function appearanceTheme(\n appearance: BillingAppearance | undefined\n): BillingTheme {\n return appearance?.theme ?? \"auto\"\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { lazy, Suspense } from \"react\"\nimport { RouteParams, useLocation } from \"./router\"\n\nconst routes = [\n {\n path: \"/payments/attempts\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.AttemptsPage,\n }))\n ),\n },\n {\n path: \"/catalog/metering\",\n Component: lazy(() =>\n import(\"./pages/catalog/metering\").then((m) => ({\n default: m.CatalogMeteringPage,\n }))\n ),\n },\n {\n path: \"/payments/health\",\n Component: lazy(() =>\n import(\"./pages/payments/health\").then((m) => ({\n default: m.PaymentHealthPage,\n }))\n ),\n },\n {\n path: \"/payments/cycles\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.CyclesPage,\n }))\n ),\n },\n {\n path: \"/catalog/prices\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({ default: m.CatalogPricesPage }))\n ),\n },\n {\n path: \"/subscriptions\",\n Component: lazy(() =>\n import(\"./pages/subscriptions\").then((m) => ({\n default: m.SubscriptionsPage,\n }))\n ),\n },\n {\n path: \"/catalog/drift\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({ default: m.CatalogDriftPage }))\n ),\n },\n {\n path: \"/customers\",\n Component: lazy(() =>\n import(\"./pages/customers\").then((m) => ({ default: m.CustomersPage }))\n ),\n },\n {\n path: \"/payments\",\n Component: lazy(() =>\n import(\"./pages/payments\").then((m) => ({ default: m.PaymentsPage }))\n ),\n },\n {\n path: \"/settings\",\n Component: lazy(() =>\n import(\"./pages/settings\").then((m) => ({ default: m.SettingsPage }))\n ),\n },\n {\n path: \"/reports\",\n Component: lazy(() =>\n import(\"./pages/dashboard/reports\").then((m) => ({\n default: m.ReportsPage,\n }))\n ),\n },\n {\n path: \"/catalog\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({\n default: m.CatalogProductsPage,\n }))\n ),\n },\n {\n path: \"/orders\",\n Component: lazy(() =>\n import(\"./pages/orders\").then((m) => ({ default: m.OrdersPage }))\n ),\n },\n {\n path: \"/ops\",\n Component: lazy(() =>\n import(\"./pages/ops\").then((m) => ({ default: m.OpsPage }))\n ),\n },\n {\n path: \"/\",\n Component: lazy(() =>\n import(\"./pages/dashboard\").then((m) => ({ default: m.DashboardPage }))\n ),\n },\n {\n path: \"/customers/:customerId\",\n Component: lazy(() =>\n import(\"./pages/customers/detail\").then((m) => ({\n default: m.CustomerDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/attempts/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.AttemptDetailPage,\n }))\n ),\n },\n {\n path: \"/catalog/metering/:key\",\n Component: lazy(() =>\n import(\"./pages/catalog/metering\").then((m) => ({\n default: m.MeterDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/cycles/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.CycleDetailPage,\n }))\n ),\n },\n {\n path: \"/catalog/prices/:id\",\n Component: lazy(() =>\n import(\"./pages/catalog/price-detail\").then((m) => ({\n default: m.PriceDetailPage,\n }))\n ),\n },\n {\n path: \"/subscriptions/:id\",\n Component: lazy(() =>\n import(\"./pages/subscriptions/detail\").then((m) => ({\n default: m.SubscriptionDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/detail\").then((m) => ({\n default: m.PaymentDetailPage,\n }))\n ),\n },\n {\n path: \"/orders/:id\",\n Component: lazy(() =>\n import(\"./pages/orders/detail\").then((m) => ({\n default: m.OrderDetailPage,\n }))\n ),\n },\n]\n\nexport function matchAdminRoute(pathname: string) {\n for (const { path, Component } of routes) {\n const actual = pathname.replace(/\\/$/, \"\").split(\"/\")\n const expected = path === \"/\" ? [\"\"] : path.split(\"/\")\n const params: Record<string, string> = {}\n if (actual.length !== expected.length) continue\n if (\n !expected.every((part, i) => {\n if (part.startsWith(\":\")) {\n try {\n params[part.slice(1)] = decodeURIComponent(actual[i])\n return true\n } catch {\n return false\n }\n }\n return part === actual[i]\n })\n )\n continue\n return { Component, params }\n }\n}\nexport function AdminPages() {\n const match = matchAdminRoute(useLocation().pathname)\n if (!match)\n return (\n <p role=\"status\">\n <AdminMessage id={\"This billing page does not exist.\"} />\n </p>\n )\n return (\n <RouteParams params={match.params}>\n <Suspense\n fallback={\n <p role=\"status\">\n <AdminMessage id={\"Loading…\"} />\n </p>\n }\n >\n <match.Component />\n </Suspense>\n </RouteParams>\n )\n}\n","import { useSyncExternalStore } from \"react\"\nconst query = \"(max-width: 767px)\"\nconst subscribe = (notify: () => void) => {\n const media = window.matchMedia(query)\n media.addEventListener(\"change\", notify)\n return () => media.removeEventListener(\"change\", notify)\n}\nexport function useIsMobile() {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false\n )\n}\n","import { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: SeparatorPrimitive.Props) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useAdminContext } from \"#orck/admin/context\"\nimport * as React from \"react\"\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: SheetPrimitive.Close.Props) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {\n return (\n <SheetPrimitive.Portal\n container={useAdminContext().portal}\n data-slot=\"sheet-portal\"\n {...props}\n />\n )\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 right-3\"\n size=\"icon-sm\"\n />\n }\n >\n <XIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"Close\"} />\n </span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-0.5 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\n \"font-heading text-base font-medium text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: SheetPrimitive.Description.Props) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n","\"use client\"\nimport { useAdminContext } from \"#orck/admin/context\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\n\nfunction TooltipProvider({\n delay = 0,\n ...props\n}: TooltipPrimitive.Provider.Props) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delay}\n {...props}\n />\n )\n}\n\nfunction Tooltip({ ...props }: TooltipPrimitive.Root.Props) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\nfunction TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n side = \"top\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n children,\n ...props\n}: TooltipPrimitive.Popup.Props &\n Pick<\n TooltipPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <TooltipPrimitive.Portal container={useAdminContext().portal}>\n <TooltipPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-content\"\n className={cn(\n \"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5\" />\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","\"use client\"\nimport { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\n\nimport * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { useIsMobile } from \"#orck/admin/hooks/use-mobile\"\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { Input } from \"#orck/admin/components/ui/input\"\nimport { Separator } from \"#orck/admin/components/ui/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"#orck/admin/components/ui/sheet\"\nimport { Skeleton } from \"#orck/admin/components/ui/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"#orck/admin/components/ui/tooltip\"\nimport { PanelLeftIcon } from \"lucide-react\"\n\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\"\n open: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n isMobile: boolean\n toggleSidebar: () => void\n}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\")\n }\n\n return context\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}) {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n if (setOpenProp) {\n setOpenProp(openState)\n } else {\n _setOpen(openState)\n }\n },\n [setOpenProp, open]\n )\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)\n }, [isMobile, setOpen, setOpenMobile])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\"\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n data-slot=\"sidebar-wrapper\"\n onKeyDown={(event) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }}\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar relative flex min-h-[30rem] w-full\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n dir,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n dir={dir}\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>\n <AdminMessage id={\"Sidebar\"} />\n </SheetTitle>\n <SheetDescription>\n <AdminMessage id={\"Displays the mobile sidebar.\"} />\n </SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n )\n }\n\n return (\n <div\n className=\"group peer text-sidebar-foreground relative hidden md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n data-side={side}\n className={cn(\n \"absolute inset-y-0 z-10 hidden h-full w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1\"\n >\n {children}\n </div>\n </div>\n </div>\n )\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn(className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"Toggle Sidebar\"} />\n </span>\n </Button>\n )\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { text: adminText } = useAdminUI()\n\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label={adminText(\"Toggle Sidebar\")}\n tabIndex={-1}\n onClick={toggleSidebar}\n title={adminText(\"Toggle Sidebar\")}\n className={cn(\n \"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"bg-sidebar-border mx-2 w-auto\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupLabel({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & React.ComponentProps<\"div\">) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-group-label\",\n sidebar: \"group-label\",\n },\n })\n}\n\nfunction SidebarGroupAction({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"button\"> & React.ComponentProps<\"button\">) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-group-action\",\n sidebar: \"group-action\",\n },\n })\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-0\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n )\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button group/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-medium [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction SidebarMenuButton({\n render,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: useRender.ComponentProps<\"button\"> &\n React.ComponentProps<\"button\"> & {\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>) {\n const { isMobile, state } = useSidebar()\n const comp = useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(sidebarMenuButtonVariants({ variant, size }), className),\n },\n props\n ),\n render: !tooltip ? render : <TooltipTrigger render={render} />,\n state: {\n slot: \"sidebar-menu-button\",\n sidebar: \"menu-button\",\n size,\n active: isActive,\n },\n })\n\n if (!tooltip) {\n return comp\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n {comp}\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n )\n}\n\nfunction SidebarMenuAction({\n className,\n render,\n showOnHover = false,\n ...props\n}: useRender.ComponentProps<\"button\"> &\n React.ComponentProps<\"button\"> & {\n showOnHover?: boolean\n }) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0\",\n showOnHover &&\n \"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-menu-action\",\n sidebar: \"menu-action\",\n },\n })\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n}) {\n // Random width between 50 to 90%.\n const [width] = React.useState(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n })\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubButton({\n render,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: useRender.ComponentProps<\"a\"> &\n React.ComponentProps<\"a\"> & {\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }) {\n return useRender({\n defaultTagName: \"a\",\n props: mergeProps<\"a\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-menu-sub-button\",\n sidebar: \"menu-sub-button\",\n size,\n active: isActive,\n },\n })\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n","import {\n CreditCardIcon,\n DashboardCircleIcon,\n PackageIcon,\n RepeatIcon,\n Settings01Icon,\n UserGroupIcon,\n Wrench01Icon,\n} from \"@hugeicons/core-free-icons\"\nimport type { IconSvgElement } from \"@hugeicons/react\"\nimport {\n useAdminArea,\n useCatalogArea,\n useMerchantConfig,\n useMetrics,\n} from \"./lib/capabilities\"\nexport interface AdminNavItem {\n title: string\n path: string\n icon?: IconSvgElement\n useVisible?: () => boolean\n order?: number\n items?: { title: string; path: string; useVisible?: () => boolean }[]\n}\nexport const coreNav: AdminNavItem[] = [\n {\n title: \"Dashboard\",\n path: \"/\",\n icon: DashboardCircleIcon,\n order: 0,\n useVisible: useMetrics,\n items: [\n { title: \"Overview\", path: \"/\" },\n { title: \"Reports\", path: \"/reports\" },\n ],\n },\n {\n title: \"Customers\",\n path: \"/customers\",\n icon: UserGroupIcon,\n order: 10,\n useVisible: useAdminArea,\n },\n {\n title: \"Subscriptions\",\n path: \"/subscriptions\",\n icon: RepeatIcon,\n order: 20,\n useVisible: useAdminArea,\n },\n {\n title: \"Payments\",\n path: \"/payments\",\n icon: CreditCardIcon,\n order: 30,\n useVisible: useAdminArea,\n items: [\n { title: \"Payments\", path: \"/payments\" },\n { title: \"Health\", path: \"/payments/health\", useVisible: useMetrics },\n { title: \"Attempts\", path: \"/payments/attempts\" },\n { title: \"Renewals\", path: \"/payments/cycles\" },\n ],\n },\n {\n title: \"Orders\",\n path: \"/orders\",\n icon: CreditCardIcon,\n order: 40,\n useVisible: useAdminArea,\n },\n {\n title: \"Catalog\",\n path: \"/catalog\",\n icon: PackageIcon,\n order: 50,\n useVisible: useCatalogArea,\n items: [\n { title: \"Products\", path: \"/catalog\" },\n { title: \"Prices\", path: \"/catalog/prices\" },\n { title: \"Metering\", path: \"/catalog/metering\" },\n { title: \"Drift\", path: \"/catalog/drift\", useVisible: useMerchantConfig },\n ],\n },\n {\n title: \"Ops\",\n path: \"/ops\",\n icon: Wrench01Icon,\n order: 60,\n useVisible: useMerchantConfig,\n },\n { title: \"Settings\", path: \"/settings\", icon: Settings01Icon, order: 70 },\n].map((item) => ({ ...item }))\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\n// App shell sidebar — same anatomy as the hosted product's shell\n// (inset variant, brand header, nav, footer user menu, rail).\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n Add01Icon,\n Tick02Icon,\n UnfoldMoreIcon,\n} from \"@hugeicons/core-free-icons\"\nimport { Link, useLocation, useNavigate } from \"#orck/admin/router\"\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"#orck/admin/components/ui/dropdown-menu\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarRail,\n} from \"#orck/admin/components/ui/sidebar\"\nimport { coreNav, type AdminNavItem } from \"../navigation\"\nimport { useAdminContext } from \"../context\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\n\n// A section's first sub-page IS the section URL (/catalog, /payments), so it\n// can only be the active one when nothing deeper is selected.\nfunction subItemIsActive(pathname: string, url: string, sectionURL: string) {\n return url === sectionURL ? pathname === url : pathname.startsWith(url)\n}\n\nexport function AppSidebar() {\n const { pathname } = useLocation()\n const groups = [{ label: \"Billing\", items: coreNav }]\n const active = [...coreNav]\n .sort((a, b) => b.path.length - a.path.length)\n .find(\n (item) =>\n pathname === item.path ||\n (item.path !== \"/\" && pathname.startsWith(item.path + \"/\"))\n )?.path\n return (\n <Sidebar variant=\"inset\" collapsible=\"icon\">\n <SidebarHeader>\n {/* No product lockup: this console mounts inside the host's own app\n (host-one, host-three), where a vendor mark belongs to someone else's\n product. The merchant switcher is the orientation that matters here,\n and it names the merchant and role rather than the software. */}\n <MerchantSwitcher />\n </SidebarHeader>\n <SidebarContent>\n {groups.map((group) => (\n <SidebarGroup key={group.label}>\n <SidebarGroupLabel>\n <AdminMessage id={group.label} />\n </SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n {group.items.map((item) => (\n <NavEntry\n key={item.path}\n item={item}\n active={item.path === active}\n pathname={pathname}\n />\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n )\n}\n\nconst always = () => true\n\nfunction NavEntry({\n item,\n active,\n pathname,\n}: {\n item: AdminNavItem\n active: boolean\n pathname: string\n}) {\n const { text: adminText } = useAdminUI()\n // A fixed hook per entry: an extension's item list never changes.\n const visible = (item.useVisible ?? always)()\n if (!visible) return null\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n isActive={active}\n tooltip={adminText(item.title)}\n render={\n <Link to={item.path}>\n {item.icon && <HugeiconsIcon icon={item.icon} />}\n <span>\n <AdminMessage id={item.title} />\n </span>\n </Link>\n }\n />\n {item.items && active && (\n <SidebarMenuSub>\n {item.items.map((sub) => (\n <NavSubEntry\n key={sub.path}\n sub={sub}\n active={subItemIsActive(pathname, sub.path, item.path)}\n />\n ))}\n </SidebarMenuSub>\n )}\n </SidebarMenuItem>\n )\n}\n\nfunction NavSubEntry({\n sub,\n active,\n}: {\n sub: NonNullable<AdminNavItem[\"items\"]>[number]\n active: boolean\n}) {\n // A fixed hook per entry, as for NavEntry.\n const visible = (sub.useVisible ?? always)()\n if (!visible) return null\n return (\n <SidebarMenuSubItem>\n <SidebarMenuSubButton\n isActive={active}\n render={\n <Link to={sub.path}>\n <span>\n <AdminMessage id={sub.title} />\n </span>\n </Link>\n }\n />\n </SidebarMenuSubItem>\n )\n}\n\nfunction MerchantSwitcher() {\n const { activeMerchant, merchants, selectMerchant } = useAuth()\n const navigate = useNavigate()\n const newMerchant = useAdminContext().props.newMerchantHref\n const label =\n activeMerchant?.display_name || activeMerchant?.slug || \"Select merchant\"\n const role = activeMerchant?.role || \"Merchant console\"\n const initials = activeMerchant?.slug.slice(0, 2) ?? \"µ\"\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <SidebarMenuButton\n size=\"lg\"\n tooltip={label}\n className=\"data-open:bg-sidebar-accent\"\n >\n <span className=\"flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-primary text-xs font-semibold text-primary-foreground uppercase\">\n {initials}\n </span>\n <span className=\"grid min-w-0 flex-1 text-left leading-tight\">\n <span className=\"truncate text-sm font-medium\">{label}</span>\n <span className=\"truncate text-xs text-muted-foreground capitalize\">\n {role}\n </span>\n </span>\n <HugeiconsIcon\n icon={UnfoldMoreIcon}\n className=\"ml-auto size-4 shrink-0\"\n />\n </SidebarMenuButton>\n }\n />\n <DropdownMenuContent side=\"bottom\" align=\"start\" className=\"min-w-60\">\n <DropdownMenuGroup>\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n <AdminMessage id={\"Merchants\"} />\n </DropdownMenuLabel>\n {merchants.map((merchant) => {\n const active = merchant.slug === activeMerchant?.slug\n return (\n <DropdownMenuItem\n key={merchant.slug}\n onClick={() => selectMerchant(merchant.slug)}\n className=\"gap-2 py-2\"\n >\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-semibold uppercase\">\n {merchant.slug.slice(0, 2)}\n </span>\n <span className=\"grid min-w-0 flex-1 leading-tight\">\n <span className=\"truncate text-sm\">\n {merchant.display_name || merchant.slug}\n </span>\n {merchant.role && (\n <span className=\"truncate text-xs text-muted-foreground capitalize\">\n {merchant.role}\n </span>\n )}\n </span>\n {active && (\n <HugeiconsIcon\n icon={Tick02Icon}\n className=\"ml-auto size-4 shrink-0 text-primary\"\n />\n )}\n </DropdownMenuItem>\n )\n })}\n </DropdownMenuGroup>\n {/* The console creates no merchants itself: the entry exists only\n when a host extension serves a creation page. */}\n {newMerchant && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => void navigate(newMerchant)}\n className=\"gap-2 py-2\"\n >\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-md border border-dashed border-border\">\n <HugeiconsIcon icon={Add01Icon} className=\"size-4\" />\n </span>\n <AdminMessage id={\"New merchant\"} />\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\n// NoAccess is a merchant page the signed-in staff member may not use: none of\n// the console's areas, or not this one.\nexport function NoAccess({ area }: { area?: string }) {\n return (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-full max-w-sm\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-balance\">\n {area\n ? `You don't have access to ${area}`\n : \"You don't have access to this merchant's billing\"}\n </h1>\n <p className=\"mt-2 text-sm text-pretty text-muted-foreground\">\n <AdminMessage\n id={\"Ask an administrator for a role that includes it.\"}\n />\n </p>\n </div>\n </div>\n )\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useAdminContext } from \"../context\"\nexport function NoMerchants() {\n const { props } = useAdminContext()\n return (\n <div role=\"status\" className=\"p-8\">\n {props.emptyState ?? (\n <>\n <p>\n <AdminMessage id={\"Select a merchant to view its billing.\"} />\n </p>\n {props.newMerchantHref && (\n <a href={props.newMerchantHref}>\n <AdminMessage id={\"New merchant\"} />\n </a>\n )}\n </>\n )}\n </div>\n )\n}\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\nimport { useAdminServices } from \"#orck/admin/context\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n Alert01Icon,\n AlertCircleIcon,\n Notification01Icon,\n} from \"@hugeicons/core-free-icons\"\nimport * as React from \"react\"\nimport { useNavigate } from \"#orck/admin/router\"\nimport { useQuery } from \"@tanstack/react-query\"\n\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"#orck/admin/components/ui/dropdown-menu\"\nimport type { Finding } from \"#orck/admin/lib/api/types\"\nimport { timeAgo } from \"#orck/admin/lib/format\"\nimport { useMerchantConfig, useMetrics } from \"#orck/admin/lib/capabilities\"\n\n// The bell is the findings queue: the open findings that need a person. A\n// finding leaves it when it is resolved, by an operator or by itself. Its\n// count is a metrics query, shown only to staff holding Metrics.\nexport function NotificationBell() {\n const { text: adminText } = useAdminUI()\n\n const { adminQueries } = useAdminServices()\n\n const navigate = useNavigate()\n const [open, setOpen] = React.useState(false)\n const metrics = useMetrics()\n const merchantConfig = useMerchantConfig()\n const { data: count = 0 } = useQuery({\n ...adminQueries.unreadNotifications(),\n enabled: merchantConfig && metrics,\n })\n const { data, isFetching: loading } = useQuery(\n adminQueries.notifications(merchantConfig && open)\n )\n const items = data?.data ?? []\n if (!merchantConfig) return null\n\n const onItemClick = (f: Finding) => {\n setOpen(false)\n navigate(`/ops?finding=${encodeURIComponent(f.id)}`)\n }\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={adminText(\"Notifications\")}\n className=\"relative\"\n >\n <HugeiconsIcon icon={Notification01Icon} className=\"size-4\" />\n {count > 0 && (\n <span className=\"absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] font-medium text-white\">\n {count > 9 ? \"9+\" : count}\n </span>\n )}\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\" className=\"w-80 p-0 sm:w-96\">\n <div className=\"flex items-center justify-between border-b px-3 py-2\">\n <span className=\"text-sm font-medium\">\n <AdminMessage id={\"Needs attention\"} />\n </span>\n {count > items.length && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-xs\"\n onClick={() => {\n setOpen(false)\n navigate(\"/ops\")\n }}\n >\n <AdminMessage id={\"View all \"} />\n {count}\n </Button>\n )}\n </div>\n <div className=\"max-h-96 overflow-y-auto\">\n {loading ? (\n <p className=\"px-3 py-6 text-center text-sm text-muted-foreground\">\n <AdminMessage id={\"Loading…\"} />\n </p>\n ) : items.length === 0 ? (\n <div className=\"flex flex-col items-center gap-1 px-3 py-8 text-center\">\n <HugeiconsIcon\n icon={Notification01Icon}\n className=\"size-5 text-muted-foreground\"\n />\n <p className=\"text-sm text-muted-foreground\">\n <AdminMessage id={\"You're all caught up.\"} />\n </p>\n </div>\n ) : (\n items.map((f) => (\n <button\n key={f.id}\n type=\"button\"\n onClick={() => onItemClick(f)}\n className=\"flex w-full items-start gap-2 border-b px-3 py-2 text-left last:border-b-0 hover:bg-muted/50\"\n >\n <span className=\"mt-0.5 shrink-0\">\n {f.severity === \"critical\" || f.severity === \"high\" ? (\n <HugeiconsIcon\n icon={AlertCircleIcon}\n className=\"text-failed size-4\"\n />\n ) : (\n <HugeiconsIcon\n icon={Alert01Icon}\n className=\"text-held size-4\"\n />\n )}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-center justify-between gap-2\">\n <span className=\"truncate text-sm font-medium\">\n {f.finding_type}\n </span>\n <span className=\"shrink-0 text-[11px] text-muted-foreground\">\n {timeAgo(f.created_at)}\n </span>\n </span>\n {f.recommended_action && (\n <span className=\"mt-0.5 line-clamp-2 block text-xs text-muted-foreground\">\n {f.recommended_action}\n </span>\n )}\n </span>\n </button>\n ))\n )}\n </div>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\nimport * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { ChevronRightIcon, MoreHorizontalIcon } from \"lucide-react\"\n\nfunction Breadcrumb({ className, ...props }: React.ComponentProps<\"nav\">) {\n const { text: adminText } = useAdminUI()\n\n return (\n <nav\n aria-label={adminText(\"breadcrumb\")}\n data-slot=\"breadcrumb\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"inline-flex items-center gap-1\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbLink({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"a\">) {\n return useRender({\n defaultTagName: \"a\",\n props: mergeProps<\"a\">(\n {\n className: cn(\"transition-colors hover:text-foreground\", className),\n },\n props\n ),\n render,\n state: {\n slot: \"breadcrumb-link\",\n },\n })\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"flex size-5 items-center justify-center [&>svg]:size-4\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"More\"} />\n </span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport * as React from \"react\"\nimport { Link } from \"#orck/admin/router\"\n\nimport { NotificationBell } from \"#orck/admin/components/notification-bell\"\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"#orck/admin/components/ui/breadcrumb\"\nimport { Separator } from \"#orck/admin/components/ui/separator\"\nimport { SidebarTrigger } from \"#orck/admin/components/ui/sidebar\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\nimport { useMerchantConfig } from \"#orck/admin/lib/capabilities\"\n\nexport interface Crumb {\n label: string\n /** A link when the step is somewhere you can go; plain text otherwise. */\n to?: string\n}\n\nexport function SiteHeader({ trail }: { trail: Crumb[] }) {\n const { activeMerchant } = useAuth()\n // Findings belong to merchant configuration.\n const merchantConfig = useMerchantConfig()\n return (\n <header className=\"flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <SidebarTrigger className=\"-ml-1\" />\n <Separator orientation=\"vertical\" className=\"mr-2 h-4\" />\n <Breadcrumb>\n <BreadcrumbList>\n {trail.length === 0 ? (\n <BreadcrumbItem>\n <BreadcrumbPage>\n <AdminMessage id={\"Dashboard\"} />\n </BreadcrumbPage>\n </BreadcrumbItem>\n ) : (\n <>\n <BreadcrumbItem>\n <BreadcrumbLink\n render={\n <Link to=\"/\">\n <AdminMessage id={\"Dashboard\"} />\n </Link>\n }\n />\n </BreadcrumbItem>\n {trail.map((crumb, index) => (\n <React.Fragment key={crumb.label}>\n <BreadcrumbSeparator />\n <BreadcrumbItem>\n {crumb.to && index < trail.length - 1 ? (\n <BreadcrumbLink\n render={\n <Link to={crumb.to}>\n <AdminMessage id={crumb.label} />\n </Link>\n }\n />\n ) : (\n <BreadcrumbPage>\n <AdminMessage id={crumb.label} />\n </BreadcrumbPage>\n )}\n </BreadcrumbItem>\n </React.Fragment>\n ))}\n </>\n )}\n </BreadcrumbList>\n </Breadcrumb>\n <div className=\"ml-auto flex items-center gap-2\">\n {activeMerchant && merchantConfig && <NotificationBell />}\n </div>\n </header>\n )\n}\n","import { useQuery } from \"@tanstack/react-query\"\nimport { useAdminContext } from \"../context\"\nimport { AdminMessage } from \"../ui-context\"\nimport type { ReactNode } from \"react\"\nimport { useLocation } from \"#orck/admin/router\"\n\nimport { AppSidebar } from \"#orck/admin/components/app-sidebar\"\nimport { NoAccess } from \"#orck/admin/components/no-access\"\nimport { NoMerchants } from \"#orck/admin/components/no-merchants\"\nimport { SiteHeader } from \"#orck/admin/components/site-header\"\nimport {\n SidebarInset,\n SidebarProvider,\n} from \"#orck/admin/components/ui/sidebar\"\nimport { TooltipProvider } from \"#orck/admin/components/ui/tooltip\"\nimport type { AdminAccess } from \"#orck/client/generated/wire\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\nimport { hasAnyArea } from \"#orck/admin/lib/capabilities\"\n\n// Longest path first: the catalog sub-pages have to match before the section\n// they live under. A trail of more than one entry becomes a real breadcrumb.\nconst trails: [string, { label: string; to?: string }[]][] = [\n [\"/customers\", [{ label: \"Customers\" }]],\n [\"/subscriptions\", [{ label: \"Subscriptions\" }]],\n [\"/payments\", [{ label: \"Payments\" }]],\n [\n \"/catalog/metering\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Metering\" }],\n ],\n [\n \"/catalog/prices\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Prices\" }],\n ],\n [\n \"/catalog/drift\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Drift\" }],\n ],\n [\"/catalog\", [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Products\" }]],\n [\"/ops\", [{ label: \"Ops\" }]],\n [\"/settings\", [{ label: \"Settings\" }]],\n]\n\n// areaOf is the console area a merchant page belongs to, and whether the\n// caller may use it; Settings belongs to none (its tabs check their own).\nfunction areaOf(\n pathname: string,\n access: AdminAccess\n): { name: string; allowed: boolean } | null {\n const under = (prefix: string) =>\n pathname === prefix || pathname.startsWith(prefix + \"/\")\n if (under(\"/payments/health\"))\n return { name: \"payment health\", allowed: access.metrics === true }\n if ([\"/customers\", \"/subscriptions\", \"/payments\", \"/orders\"].some(under))\n return {\n name: \"customer support\",\n allowed: access.admin === \"read\" || access.admin === \"update\",\n }\n if (under(\"/ops\") || under(\"/catalog/drift\"))\n return {\n name: \"merchant configuration\",\n allowed:\n access.merchant_config === \"read\" ||\n access.merchant_config === \"update\",\n }\n if (under(\"/catalog\"))\n return {\n name: \"the catalog\",\n allowed: access.catalog === \"read\" || access.catalog === \"update\",\n }\n return null\n}\n\nexport function AppLayout({ children }: { children: ReactNode }) {\n const { activeMerchant } = useAuth()\n const { pathname } = useLocation()\n const { props, services } = useAdminContext()\n const permission = useQuery(services.adminQueries.access())\n const access = permission.data\n const hostSettings =\n (props.settingsTabs?.length ?? 0) > 0 &&\n (pathname === \"/settings\" || pathname === \"/\")\n const trail =\n trails.find(([prefix]) => pathname.startsWith(prefix))?.[1] ?? []\n if (!activeMerchant) return <NoMerchants />\n if (permission.isPending)\n return (\n <p role=\"status\" className=\"p-6\">\n <AdminMessage id=\"Loading billing permissions…\" />\n </p>\n )\n if (permission.error)\n return (\n <div role=\"alert\" className=\"p-6\">\n <p>{permission.error.message}</p>\n <button type=\"button\" onClick={() => void permission.refetch()}>\n <AdminMessage id=\"Try again\" />\n </button>\n </div>\n )\n if (\n activeMerchant.id &&\n access?.scope_id &&\n activeMerchant.id !== access.scope_id\n )\n return (\n <p role=\"alert\" className=\"p-6\">\n <AdminMessage id=\"The authenticated connection is bound to another merchant. Update the host connection before opening this merchant.\" />\n </p>\n )\n return (\n <TooltipProvider>\n <SidebarProvider>\n <AppSidebar />\n <SidebarInset>\n <SiteHeader trail={trail} />\n {/* A switch remounts the merchant's pages: nothing of the\n previous merchant's survives it. */}\n <main\n key={activeMerchant?.id || activeMerchant?.slug || \"\"}\n className=\"flex min-w-0 flex-1 flex-col p-4 md:p-8\"\n >\n <div className=\"mx-auto w-full max-w-7xl min-w-0\">\n {access &&\n ((!hasAnyArea(access) && !hostSettings) ||\n areaOf(pathname, access)?.allowed === false) ? (\n <NoAccess area={areaOf(pathname, access)?.name} />\n ) : (\n children\n )}\n </div>\n </main>\n </SidebarInset>\n </SidebarProvider>\n </TooltipProvider>\n )\n}\n","import { useAdminContext } from \"#orck/admin/context\"\nimport * as React from \"react\"\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\n\nfunction AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {\n return (\n <AlertDialogPrimitive.Portal\n container={useAdminContext().portal}\n data-slot=\"alert-dialog-portal\"\n {...props}\n />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: AlertDialogPrimitive.Backdrop.Props) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"fixed inset-0 isolate z-50 bg-black/10 duration-100 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Popup.Props & {\n size?: \"default\" | \"sm\"\n}) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n \"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n \"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n \"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\n \"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof Button>) {\n return (\n <Button\n data-slot=\"alert-dialog-action\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = \"outline\",\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Close.Props &\n Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\">) {\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n className={cn(className)}\n render={<Button variant={variant} size={size} />}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n}\n","// Promise-based confirmation for the console's plain (non-typed) confirms:\n//\n// const confirm = useConfirm()\n// if (await confirm({ title, description, confirmLabel, tone })) …\n//\n// One dialog per ConfirmProvider; a newer request answers an older one false.\n// Destructive acts that need a typed word use TypedConfirmDialog instead.\nimport * as React from \"react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"#orck/admin/components/ui/alert-dialog\"\nimport {\n ConfirmContext,\n type Confirm,\n type ConfirmOptions,\n} from \"#orck/admin/lib/confirm\"\n\nexport function ConfirmProvider({ children }: { children: React.ReactNode }) {\n const [options, setOptions] = React.useState<ConfirmOptions | null>(null)\n const [open, setOpen] = React.useState(false)\n const pending = React.useRef<((answer: boolean) => void) | null>(null)\n\n const settle = React.useCallback((answer: boolean) => {\n pending.current?.(answer)\n pending.current = null\n setOpen(false)\n }, [])\n\n const confirm = React.useCallback<Confirm>(\n (next) =>\n new Promise<boolean>((resolve) => {\n pending.current?.(false)\n pending.current = resolve\n setOptions(next)\n setOpen(true)\n }),\n []\n )\n\n React.useEffect(() => () => pending.current?.(false), [])\n\n return (\n <ConfirmContext.Provider value={confirm}>\n {children}\n <AlertDialog\n open={open}\n onOpenChange={(next) => {\n if (!next) settle(false)\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{options?.title}</AlertDialogTitle>\n {options?.description ? (\n <AlertDialogDescription>\n {options.description}\n </AlertDialogDescription>\n ) : null}\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {options?.cancelLabel ?? \"Cancel\"}\n </AlertDialogCancel>\n <AlertDialogAction\n variant={\n options?.tone === \"destructive\" ? \"destructive\" : \"default\"\n }\n onClick={() => settle(true)}\n >\n {options?.confirmLabel ?? \"Confirm\"}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </ConfirmContext.Provider>\n )\n}\n","\"use client\"\n\nimport { useAdminContext } from \"#orck/admin/context\"\nimport { Toaster as Sonner, type ToasterProps } from \"sonner\"\nimport {\n CircleCheckIcon,\n InfoIcon,\n TriangleAlertIcon,\n OctagonXIcon,\n Loader2Icon,\n} from \"lucide-react\"\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const theme = useAdminContext().props.appearance?.theme ?? \"system\"\n\n return (\n <Sonner\n id={useAdminContext().services.namespace}\n theme={(theme === \"inherit\" ? \"system\" : theme) as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n icons={{\n success: <CircleCheckIcon className=\"size-4\" />,\n info: <InfoIcon className=\"size-4\" />,\n warning: <TriangleAlertIcon className=\"size-4\" />,\n error: <OctagonXIcon className=\"size-4\" />,\n loading: <Loader2Icon className=\"size-4 animate-spin\" />,\n }}\n style={\n {\n \"--normal-bg\": \"var(--popover)\",\n \"--normal-text\": \"var(--popover-foreground)\",\n \"--normal-border\": \"var(--border)\",\n \"--border-radius\": \"var(--radius)\",\n } as React.CSSProperties\n }\n toastOptions={{\n classNames: {\n toast: \"cn-toast\",\n },\n }}\n {...props}\n />\n )\n}\n\nexport { Toaster }\n","// A deploy rotates chunk hashes, so an open tab's lazy chunk is gone: only a\n// document reload fetches the new index.html.\nconst CHUNK_ERRORS = [\n /dynamically imported module/i,\n /failed to load module script/i,\n /importing a module script failed/i,\n /loading (css )?chunk \\S+ failed/i,\n /unable to preload css/i,\n]\n\nexport function isChunkLoadError(error: unknown): boolean {\n const e = error as { name?: string; message?: string } | null\n if (e?.name === \"ChunkLoadError\") return true\n return CHUNK_ERRORS.some((pattern) => pattern.test(e?.message ?? \"\"))\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\n// A page that failed to render or load. After a deploy the hashed chunk an\n// open tab asks for is gone; only a document reload fetches the new\n// index.html, so that case offers a reload instead of a broken page.\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { Refresh01Icon } from \"@hugeicons/core-free-icons\"\nimport { Link } from \"#orck/admin/router\"\n\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { isChunkLoadError } from \"#orck/admin/lib/chunk-error\"\n\nexport function RouteError({ error }: { error: unknown }) {\n const stale = isChunkLoadError(error)\n const message = error instanceof Error ? error.message : \"\"\n return (\n <div\n role=\"alert\"\n className=\"flex min-h-[50vh] flex-col items-center justify-center gap-4 p-6 text-center\"\n >\n <div className=\"max-w-md\">\n <p className=\"font-medium\">\n {stale\n ? \"The console has been updated. Reload to use the new version.\"\n : \"This page failed to load.\"}\n </p>\n {!stale && message ? (\n <p className=\"mt-1 text-sm break-words text-muted-foreground\">\n {message}\n </p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap items-center justify-center gap-3\">\n <Button onClick={() => window.location.reload()}>\n <HugeiconsIcon icon={Refresh01Icon} className=\"size-4\" />\n {stale ? \"Reload\" : \"Try again\"}\n </Button>\n {/* A document load, not client-side navigation: a stale chunk keeps\n failing until index.html is fetched again. */}\n <Link\n to=\"/\"\n className=\"text-sm text-muted-foreground underline underline-offset-4\"\n >\n <AdminMessage id={\"Console home\"} />\n </Link>\n </div>\n </div>\n )\n}\n","import { QueryCache, QueryClient } from \"@tanstack/react-query\"\n\nimport { ApiError } from \"#orck/admin/lib/api/client\"\nimport { createAdminToast, createToastHandlers } from \"#orck/admin/lib/toast\"\n\nexport function shouldRetry(failureCount: number, error: unknown): boolean {\n if (error instanceof ApiError && error.status < 500) return false\n return failureCount < 2\n}\n\nexport const createAdminQueryClient = (namespace?: string) => {\n const { toastApiError } = createToastHandlers(createAdminToast(namespace))\n return new QueryClient({\n queryCache: new QueryCache({\n onError: (error, query) => {\n const action = query.meta?.errorAction\n if (typeof action === \"string\") toastApiError(error, action)\n },\n }),\n defaultOptions: {\n queries: {\n staleTime: 20_000,\n gcTime: 5 * 60_000,\n retry: shouldRetry,\n },\n mutations: {\n retry: false,\n },\n },\n })\n}\n","import { useSyncExternalStore } from \"react\"\nimport type { BillingTheme } from \"../appearance\"\n\nconst media = () => window.matchMedia?.(\"(prefers-color-scheme: dark)\")\nconst subscribe = (notify: () => void) => {\n const query = media()\n query?.addEventListener(\"change\", notify)\n return () => query?.removeEventListener(\"change\", notify)\n}\nconst snapshot = () => (media()?.matches ? \"dark\" : \"light\")\nconst serverSnapshot = () => \"light\" as const\nconst unchanged = () => () => {}\n\nexport function useAdminTheme(theme: BillingTheme = \"inherit\") {\n const system = useSyncExternalStore(\n theme === \"auto\" ? subscribe : unchanged,\n snapshot,\n serverSnapshot\n )\n return theme === \"auto\" ? system : theme\n}\n","import { AdminUIContext } from \"./ui-context\"\nimport {\n Component,\n useId,\n useMemo,\n useRef,\n useCallback,\n useLayoutEffect,\n useState,\n type ReactNode,\n} from \"react\"\nimport { QueryClientProvider } from \"@tanstack/react-query\"\nimport { appearanceStyle } from \"../appearance\"\nimport { AdminContext, createAdminServices } from \"./context\"\nimport { AdminRouter, useLocation } from \"./router\"\nimport { AdminPages } from \"./routes\"\nimport { AppLayout } from \"./layouts/app-layout\"\nimport { ConfirmProvider } from \"./components/confirm\"\nimport { Toaster } from \"./components/ui/sonner\"\nimport { RouteError } from \"./components/route-error\"\nimport { createAdminQueryClient } from \"./lib/query-client\"\nimport type { BillingAdminMerchant, BillingAdminProps } from \"./types\"\nimport { useAdminTheme } from \"./theme\"\n\nconst merchantFrom = (\n merchant: string | BillingAdminMerchant\n): BillingAdminMerchant =>\n typeof merchant === \"string\" ? { id: merchant, slug: merchant } : merchant\n\n/** Staff billing pages inside the host's app, authentication, router, and theme. */\nexport function BillingAdmin(props: BillingAdminProps) {\n const [selected, setSelected] = useState<string>()\n const [connection, setConnection] = useState({\n auth: props.auth,\n baseUrl: props.baseUrl,\n generation: 0,\n })\n if (connection.auth !== props.auth || connection.baseUrl !== props.baseUrl)\n setConnection({\n auth: props.auth,\n baseUrl: props.baseUrl,\n generation: connection.generation + 1,\n })\n return (\n <BillingAdminInstance\n key={connection.generation}\n {...props}\n selected={selected}\n onSelected={setSelected}\n />\n )\n}\n\nfunction BillingAdminInstance({\n selected,\n onSelected,\n ...props\n}: BillingAdminProps & {\n selected?: string\n onSelected: (value: string) => void\n}) {\n const theme = useAdminTheme(props.appearance?.theme)\n const namespace = useId()\n const [portal, setPortal] = useState<HTMLDivElement | null>(null)\n const merchants = useMemo(\n () =>\n props.merchants ??\n (props.merchant\n ? [merchantFrom(props.merchant)]\n : [{ id: \"\", slug: \"\", display_name: \"Billing\" }]),\n [props.merchants, props.merchant]\n )\n const requested = props.merchant ? merchantFrom(props.merchant).id : selected\n const activeMerchant =\n merchants.find((m) => m.id === requested || m.slug === requested) ??\n merchants[0]\n const scope = `${props.baseUrl}:${activeMerchant?.id ?? \"\"}:${activeMerchant?.slug ?? \"\"}`\n const currentScope = useRef<string | undefined>(scope)\n useLayoutEffect(() => {\n currentScope.current = scope\n return () => {\n currentScope.current = undefined\n }\n }, [scope])\n const isCurrent = useCallback(() => currentScope.current === scope, [scope])\n const queryClient = useMemo(\n () => props.queryClient ?? createAdminQueryClient(namespace),\n [namespace, props.queryClient]\n )\n const services = useMemo(\n () =>\n // The factory captures this callback; only request-time checks read the ref.\n // eslint-disable-next-line react-hooks/refs\n createAdminServices({\n namespace,\n isCurrent,\n baseUrl: props.baseUrl,\n auth: props.auth,\n merchant: activeMerchant,\n exchange: props.exchange,\n }),\n [\n isCurrent,\n namespace,\n props.baseUrl,\n props.auth,\n props.exchange,\n activeMerchant,\n ]\n )\n const value = {\n props,\n services,\n merchants,\n activeMerchant,\n portal,\n selectMerchant(slug: string) {\n const merchant = merchants.find((m) => m.slug === slug || m.id === slug)\n if (!merchant) return\n onSelected(merchant.id)\n props.onMerchantChange?.(merchant)\n },\n }\n return (\n <div\n lang={props.language ?? \"en\"}\n className={[\"orba\", props.className].filter(Boolean).join(\" \")}\n data-orba-theme={theme}\n style={{ ...appearanceStyle(props.appearance, \"orba\"), ...props.style }}\n >\n <AdminUIContext.Provider value={{ namespace, messages: props.messages }}>\n <AdminContext.Provider value={value}>\n <QueryClientProvider client={queryClient}>\n <AdminRouter\n basePath={props.basePath}\n navigation={props.navigation}\n >\n <ConfirmProvider>\n <AppLayout>\n <PageBoundary>\n <AdminPages />\n </PageBoundary>\n </AppLayout>\n </ConfirmProvider>\n <Toaster />\n </AdminRouter>\n </QueryClientProvider>\n <div ref={setPortal} />\n </AdminContext.Provider>\n </AdminUIContext.Provider>\n </div>\n )\n}\n\nclass Boundary extends Component<{ children: ReactNode }, { error?: unknown }> {\n state: { error?: unknown } = {}\n static getDerivedStateFromError(error: unknown) {\n return { error }\n }\n render() {\n return this.state.error ? (\n <RouteError error={this.state.error} />\n ) : (\n this.props.children\n )\n }\n}\nfunction PageBoundary({ children }: { children: ReactNode }) {\n const location = useLocation()\n return <Boundary key={location.pathname}>{children}</Boundary>\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useCallback, useEffect, useMemo, useState } from \"react\"\nimport { appearanceStyle } from \"../appearance\"\nimport type { AdminAccess } from \"../client/generated/wire\"\nimport { createAdminClient } from \"./lib/api/client\"\nimport { createAdminAPI } from \"./lib/api\"\nimport { formatNativeAmount } from \"./lib/format\"\nimport type { BillingAdminProps } from \"./types\"\nimport { useAdminTheme } from \"./theme\"\n\ntype Connection = Pick<\n BillingAdminProps,\n \"baseUrl\" | \"auth\" | \"merchant\" | \"exchange\"\n>\n\nfunction useAPI(options: Connection) {\n const id =\n typeof options.merchant === \"string\"\n ? options.merchant\n : options.merchant?.id\n const slug =\n typeof options.merchant === \"string\"\n ? options.merchant\n : options.merchant?.slug\n return useMemo(\n () =>\n createAdminAPI(\n createAdminClient({\n baseUrl: options.baseUrl,\n auth: options.auth,\n exchange: options.exchange,\n merchant: id ? { id, slug: slug ?? id } : undefined,\n })\n ),\n [options.baseUrl, options.auth, options.exchange, id, slug]\n )\n}\n\nfunction useRead<T>(load: (signal: AbortSignal) => Promise<T>) {\n const [attempt, setAttempt] = useState(0)\n const [result, setResult] = useState<{\n load: typeof load\n attempt: number\n data?: T\n error?: Error\n }>()\n useEffect(() => {\n const abort = new AbortController()\n load(abort.signal).then(\n (data) => {\n if (!abort.signal.aborted) setResult({ load, attempt, data })\n },\n (error) => {\n if (!abort.signal.aborted)\n setResult({\n load,\n attempt,\n error: error instanceof Error ? error : new Error(String(error)),\n })\n }\n )\n return () => abort.abort()\n }, [load, attempt])\n const current =\n result?.load === load && result.attempt === attempt ? result : undefined\n return {\n data: current?.data,\n error: current?.error,\n isPending: !current,\n refetch: () => setAttempt((n) => n + 1),\n }\n}\n\n/** Reads tab permissions without requiring a BillingAdmin or QueryClient provider. */\nexport function useBillingAdminAccess(options: Connection) {\n const api = useAPI(options)\n return useRead<AdminAccess>(\n useCallback((signal) => api.getAdminAccess(signal), [api])\n )\n}\n\nexport interface BillingCustomerSummaryProps extends Connection {\n customer: string\n href?: string\n appearance?: BillingAdminProps[\"appearance\"]\n className?: string\n}\n\n/** A bounded preview for the host's customer or user page. */\nexport function BillingCustomerSummary(props: BillingCustomerSummaryProps) {\n const theme = useAdminTheme(props.appearance?.theme)\n const api = useAPI(props)\n const { data, error, isPending, refetch } = useRead(\n useCallback(\n async (signal: AbortSignal) => {\n const [customer, subscriptions, entitlements, access, payments] =\n await Promise.all([\n api.getCustomer(props.customer, signal),\n api.listSubscriptions(\n { customer_id: props.customer, status: \"active\" },\n 5,\n undefined,\n signal\n ),\n api.listCustomerEntitlements(props.customer, { limit: 5 }, signal),\n api.listCustomerProductAccess(props.customer, { limit: 5 }, signal),\n api.listPayments(\n { customer_id: props.customer },\n { limit: 5 },\n signal\n ),\n ])\n return { customer, subscriptions, entitlements, access, payments }\n },\n [api, props.customer]\n )\n )\n return (\n <section\n className={[\"orba\", props.className].filter(Boolean).join(\" \")}\n data-orba-theme={theme}\n style={appearanceStyle(props.appearance, \"orba\")}\n >\n <div className=\"rounded-lg border p-4\">\n <h3 className=\"font-semibold\">\n <AdminMessage id={\"Billing\"} />\n </h3>\n {isPending && (\n <p role=\"status\">\n <AdminMessage id={\"Loading billing…\"} />\n </p>\n )}\n {error && (\n <p role=\"alert\">\n {error.message}{\" \"}\n <button type=\"button\" onClick={refetch}>\n <AdminMessage id={\"Try again\"} />\n </button>\n </p>\n )}\n {data && (\n <>\n <dl>\n {data.customer.balances.map((balance) => (\n <div key={balance.currency}>\n <dt>\n <AdminMessage id={\"Available balance\"} />\n </dt>\n <dd>\n {formatNativeAmount(\n balance.available_amount,\n balance.currency\n )}\n </dd>\n </div>\n ))}\n </dl>\n <h4>\n <AdminMessage id={\"Active subscriptions\"} />\n </h4>\n {data.subscriptions.data.length ? (\n <ul>\n {data.subscriptions.data.map((subscription) => (\n <li key={subscription.id}>{subscription.id}</li>\n ))}\n </ul>\n ) : (\n <p>\n <AdminMessage id={\"No active subscriptions.\"} />\n </p>\n )}\n <h4>\n <AdminMessage id={\"Entitlements\"} />\n </h4>\n <ul>\n {data.entitlements.data.map((entitlement) => (\n <li key={entitlement.entitlement}>{entitlement.entitlement}</li>\n ))}\n </ul>\n <h4>\n <AdminMessage id={\"Product access\"} />\n </h4>\n <ul>\n {data.access.data.map((access) => (\n <li key={access.id}>\n {access.product_name} · {access.status}\n </li>\n ))}\n </ul>\n <h4>\n <AdminMessage id={\"Recent payments\"} />\n </h4>\n <ul>\n {data.payments.data.map((payment) => (\n <li key={payment.id}>\n {formatNativeAmount(payment.amount, payment.currency)} ·{\" \"}\n {payment.status}\n </li>\n ))}\n </ul>\n </>\n )}\n {props.href && (\n <a className=\"underline\" href={props.href}>\n <AdminMessage id={\"View billing details\"} />\n </a>\n )}\n </div>\n </section>\n )\n}\n\n/** A ban or account deletion never cancels the customer's subscriptions. */\nexport function billingConfirmWarnings(customer: {\n subscriptions: readonly { status: string }[]\n}): string[] {\n return customer.subscriptions.some(\n (subscription) => subscription.status !== \"canceled\"\n )\n ? [\n \"This customer has ongoing subscriptions. Banning or deleting the account does not cancel them; cancel them separately in billing.\",\n ]\n : []\n}\n\nconst permissionAreas: Record<string, string> = {\n \"customer:read\": \"Read customers, subscriptions, payments, and orders.\",\n \"customer:manage\":\n \"Change customer billing, including refunds, cancellations, and credits.\",\n \"catalog:manage\": \"Change products, prices, meters, and catalog migrations.\",\n \"catalog:read\": \"Read products, prices, meters, and catalog migrations.\",\n \"config:read\":\n \"Read merchant configuration, PSPs, findings, and notifications.\",\n \"config:manage\":\n \"Change merchant configuration, PSPs, findings, and notifications.\",\n \"metrics:read\": \"Read revenue metrics, reports, and dashboards.\",\n \"entitlements:read\":\n \"Read customer entitlements through the application API.\",\n \"usage:read\":\n \"Read usage, admissions, and running charges through the application API.\",\n \"usage:manage\": \"Admit and charge usage through the application API.\",\n \"events:read\":\n \"Read and acknowledge billing events through the application API.\",\n \"orders:manage\":\n \"Preview, create, and withdraw merchant orders through the application API.\",\n \"customers:read\":\n \"Find customers by their network account through the application API.\",\n}\n\n/** Descriptions for a host's role editor; permissions are enforced by the API. */\nexport const billingPermissionHelp: Readonly<Record<string, string>> =\n Object.fromEntries(\n [\"merchant\", \"root\"].flatMap((scope) =>\n Object.entries(permissionAreas).map(([permission, description]) => [\n `${scope}:${permission}`,\n `${description} ${scope === \"root\" ? \"Applies across merchants.\" : \"Applies within this merchant.\"}`,\n ])\n )\n )\n","/** English message keys. Override individual entries with BillingAdmin.messages. */\nexport const billingAdminMessages = {\n \" Edit widget\": \" Edit widget\",\n \" Price\": \" Price\",\n \" Product\": \" Product\",\n \" Product access\": \" Product access\",\n \" Refund\": \" Refund\",\n \" affected · requires human confirm\": \" affected · requires human confirm\",\n \" balance\": \" balance\",\n \" credentials · \": \" credentials · \",\n \" days away. Card networks require that much notice before a price goes up. You can change the number in Settings.\":\n \" days away. Card networks require that much notice before a price goes up. You can change the number in Settings.\",\n \" days. Pick a shorter range.\": \" days. Pick a shorter range.\",\n \" is not a supported currency.\": \" is not a supported currency.\",\n \" left alone because another change was already scheduled for them.\":\n \" left alone because another change was already scheduled for them.\",\n \" more\": \" more\",\n \" of\": \" of\",\n \" of 3:\": \" of 3:\",\n \" on \": \" on \",\n \" rail. Remaining refundable: \": \" rail. Remaining refundable: \",\n \" seats.\": \" seats.\",\n \" subscription\": \" subscription\",\n \" to\": \" to\",\n \" to \": \" to \",\n \" to confirm\": \" to confirm\",\n \" to this customer.\": \" to this customer.\",\n \" with this shape.\": \" with this shape.\",\n \" · due \": \" · due \",\n \" · exp \": \" · exp \",\n \" · last seen\": \" · last seen\",\n \" · owed\": \" · owed\",\n \" · since \": \" · since \",\n \" · theirs\": \" · theirs\",\n \" · txn\": \" · txn\",\n '\"Not sent to provider\" is fixed by publishing the catalog. Everything else is fixed under Settings, Payment providers.':\n '\"Not sent to provider\" is fixed by publishing the catalog. Everything else is fixed under Settings, Payment providers.',\n \", an edit set\": \", an edit set\",\n \", before another action.\": \", before another action.\",\n \". Active holds may prevent revocation. Payment refunds are managed separately.\":\n \". Active holds may prevent revocation. Payment refunds are managed separately.\",\n \". Currency and interval stay locked to the current price.\":\n \". Currency and interval stay locked to the current price.\",\n \"/app/usage-events\": \"/app/usage-events\",\n \"1 day\": \"1 day\",\n \"30 days\": \"30 days\",\n \"365 days\": \"365 days\",\n \"7 days\": \"7 days\",\n \": the batch says\": \": the batch says\",\n \": yours \": \": yours \",\n \"A collection of this order is in progress. It must finish, or be resolved with \":\n \"A collection of this order is in progress. It must finish, or be resolved with \",\n \"A price going down needs no notice, so today is fine.\":\n \"A price going down needs no notice, so today is fine.\",\n \"A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it.\":\n \"A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it.\",\n \"A reprice_scheduled notice is queued for every affected subscriber as soon as you confirm.\":\n \"A reprice_scheduled notice is queued for every affected subscriber as soon as you confirm.\",\n \"Access duration\": \"Access duration\",\n \"Access, not paying\": \"Access, not paying\",\n \"Account ID\": \"Account ID\",\n \"Accrual cap\": \"Accrual cap\",\n \"Accrue from another meter\": \"Accrue from another meter\",\n Action: \"Action\",\n Active: \"Active\",\n \"Active subscriptions\": \"Active subscriptions\",\n Activity: \"Activity\",\n \"Add PSP\": \"Add PSP\",\n \"Add a PSP\": \"Add a PSP\",\n \"Add cell\": \"Add cell\",\n \"Add contact\": \"Add contact\",\n \"Add credit in \": \"Add credit in \",\n \"Add dimension\": \"Add dimension\",\n \"Add filter\": \"Add filter\",\n \"Add tax detail\": \"Add tax detail\",\n \"Add tier\": \"Add tier\",\n Aggregation: \"Aggregation\",\n \"Alert email\": \"Alert email\",\n All: \"All\",\n \"All PSPs\": \"All PSPs\",\n \"All origins\": \"All origins\",\n \"All owners\": \"All owners\",\n \"All rails\": \"All rails\",\n \"All statuses\": \"All statuses\",\n Allowance: \"Allowance\",\n \"Also revoke access immediately\": \"Also revoke access immediately\",\n \"Also revoke granted access\": \"Also revoke granted access\",\n Amount: \"Amount\",\n \"Amount (\": \"Amount (\",\n \"Apply catalog\": \"Apply catalog\",\n \"Apply catalog changes\": \"Apply catalog changes\",\n \"Apply filters\": \"Apply filters\",\n \"Apply reviewed batch\": \"Apply reviewed batch\",\n Archive: \"Archive\",\n Ask: \"Ask\",\n \"Ask an administrator for a role that includes it.\":\n \"Ask an administrator for a role that includes it.\",\n \"Attempt not found.\": \"Attempt not found.\",\n Attempted: \"Attempted\",\n Attempts: \"Attempts\",\n \"Available balance\": \"Available balance\",\n Back: \"Back\",\n \"Back to metering\": \"Back to metering\",\n Balance: \"Balance\",\n \"Batch receipt\": \"Batch receipt\",\n Billing: \"Billing\",\n \"Billing contacts\": \"Billing contacts\",\n \"Billing interval\": \"Billing interval\",\n \"Billing support\": \"Billing support\",\n \"Can this be bought?\": \"Can this be bought?\",\n Cancel: \"Cancel\",\n \"Cancel subscription\": \"Cancel subscription\",\n \"Cancel this migration?\": \"Cancel this migration?\",\n Canceled: \"Canceled\",\n Card: \"Card\",\n \"Card verifications\": \"Card verifications\",\n Catalog: \"Catalog\",\n \"Catalog document\": \"Catalog document\",\n \"Catalog updates are disabled. Meter definitions and rates are visible here; changes require the host operator.\":\n \"Catalog updates are disabled. Meter definitions and rates are visible here; changes require the host operator.\",\n \"Catalog updates are disabled. The console is read-only.\":\n \"Catalog updates are disabled. The console is read-only.\",\n \"Catalog updates are unavailable. You can still browse products and prices.\":\n \"Catalog updates are unavailable. You can still browse products and prices.\",\n \"Category / reason\": \"Category / reason\",\n \"Schedule the customer's plan or seats for the next renewal. No card is charged now. Choosing the current plan and seats clears a pending change. The customer is told.\":\n \"Schedule the customer's plan or seats for the next renewal. No card is charged now. Choosing the current plan and seats clears a pending change. The customer is told.\",\n \"Change payment method\": \"Change payment method\",\n \"Change price\": \"Change price\",\n \"Change price for \": \"Change price for \",\n \"Change subscription\": \"Change subscription\",\n \"Change the title, chart type or date range behavior. The query stays the same.\":\n \"Change the title, chart type or date range behavior. The query stays the same.\",\n Channel: \"Channel\",\n \"Charged twice\": \"Charged twice\",\n \"Chart type\": \"Chart type\",\n \"Checking your catalog…\": \"Checking your catalog…\",\n \"Choose a method\": \"Choose a method\",\n Churn: \"Churn\",\n \"Clear all\": \"Clear all\",\n \"Clear customer filter\": \"Clear customer filter\",\n \"Clear filters\": \"Clear filters\",\n Close: \"Close\",\n Code: \"Code\",\n Collected: \"Collected\",\n \"Collection method\": \"Collection method\",\n \"Collection:\": \"Collection:\",\n \"Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again.\":\n \"Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again.\",\n \"Console home\": \"Console home\",\n Contact: \"Contact\",\n \"Continue with payment provider\": \"Continue with payment provider\",\n \"Could not load the available plans.\": \"Could not load the available plans.\",\n \"Count events\": \"Count events\",\n \"Count uses one unit for every matching event.\":\n \"Count uses one unit for every matching event.\",\n Coverage: \"Coverage\",\n \"Create a meter to describe the events your application will report and bill.\":\n \"Create a meter to describe the events your application will report and bill.\",\n \"Create or activate a product first\": \"Create or activate a product first\",\n Created: \"Created\",\n \"Creating this meter does not send events. The host application must report idempotent usage to\":\n \"Creating this meter does not send events. The host application must report idempotent usage to\",\n Credentials: \"Credentials\",\n \"Credit and trust\": \"Credit and trust\",\n \"Credit grants\": \"Credit grants\",\n \"Credit limit\": \"Credit limit\",\n \"Credit transaction ledger\": \"Credit transaction ledger\",\n Credits: \"Credits\",\n Currency: \"Currency\",\n \"Currency · interval\": \"Currency · interval\",\n \"Current amount\": \"Current amount\",\n \"Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now.\":\n \"Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now.\",\n \"Current period\": \"Current period\",\n \"Custom range\": \"Custom range\",\n Customer: \"Customer\",\n \"Customer ID\": \"Customer ID\",\n \"Customer UUID\": \"Customer UUID\",\n \"Customer controls\": \"Customer controls\",\n \"Customer lookup\": \"Customer lookup\",\n \"Customer not found.\": \"Customer not found.\",\n \"Customer-facing merchant details used on invoices and emails.\":\n \"Customer-facing merchant details used on invoices and emails.\",\n Customers: \"Customers\",\n Cycles: \"Cycles\",\n \"Daily subscriptions\": \"Daily subscriptions\",\n Dashboard: \"Dashboard\",\n Date: \"Date\",\n \"Date range\": \"Date range\",\n \"Days are added after any access they already have.\":\n \"Days are added after any access they already have.\",\n \"Decline reasons\": \"Decline reasons\",\n Declined: \"Declined\",\n Declines: \"Declines\",\n \"Default price\": \"Default price\",\n \"Default rate\": \"Default rate\",\n \"Default · \": \"Default · \",\n \"Define the event fields OpenRails will aggregate. Your host still reports each event through the usage API.\":\n \"Define the event fields OpenRails will aggregate. Your host still reports each event through the usage API.\",\n \"Define usage streams and the default rates charged when usage is recorded. Applications report the events separately.\":\n \"Define usage streams and the default rates charged when usage is recorded. Applications report the events separately.\",\n \"Delete webhook\": \"Delete webhook\",\n Description: \"Description\",\n \"Description (optional)\": \"Description (optional)\",\n Detected: \"Detected\",\n Dimension: \"Dimension\",\n Dimensions: \"Dimensions\",\n Directory: \"Directory\",\n Discord: \"Discord\",\n \"Dismiss answer\": \"Dismiss answer\",\n \"Display name\": \"Display name\",\n \"Displays the mobile sidebar.\": \"Displays the mobile sidebar.\",\n Divisor: \"Divisor\",\n Down: \"Down\",\n \"Download CSV\": \"Download CSV\",\n \"Draft: new price\": \"Draft: new price\",\n \"Draft: price change\": \"Draft: price change\",\n Drift: \"Drift\",\n Due: \"Due\",\n \"Due now\": \"Due now\",\n \"Due: \": \"Due: \",\n Dunning: \"Dunning\",\n \"Dunning recovery by days since the first failure\":\n \"Dunning recovery by days since the first failure\",\n \"Dunning recovery by retry (share of failed cycles)\":\n \"Dunning recovery by retry (share of failed cycles)\",\n \"Dunning recovery rate\": \"Dunning recovery rate\",\n Edit: \"Edit\",\n \"Edit batch\": \"Edit batch\",\n \"Edit definition\": \"Edit definition\",\n \"Edit widget\": \"Edit widget\",\n Effective: \"Effective\",\n \"Effective date\": \"Effective date\",\n Email: \"Email\",\n \"Email delivery\": \"Email delivery\",\n Enabled: \"Enabled\",\n End: \"End\",\n \"Enter 0 to turn credit off.\": \"Enter 0 to turn credit off.\",\n Entitlements: \"Entitlements\",\n Environment: \"Environment\",\n Event: \"Event\",\n \"Event contract\": \"Event contract\",\n \"Event filters\": \"Event filters\",\n \"Event type\": \"Event type\",\n \"Executes the refund at the \": \"Executes the refund at the \",\n \"Existing subscribers keep the current price.\":\n \"Existing subscribers keep the current price.\",\n Expired: \"Expired\",\n Expires: \"Expires\",\n \"Expires (optional)\": \"Expires (optional)\",\n Failure: \"Failure\",\n Field: \"Field\",\n Filter: \"Filter\",\n \"Filter meters on this page\": \"Filter meters on this page\",\n \"Filter this page…\": \"Filter this page…\",\n \"Find a customer by ID and currency.\": \"Find a customer by ID and currency.\",\n \"First outcome\": \"First outcome\",\n \"First page\": \"First page\",\n \"Fixed included units\": \"Fixed included units\",\n \"Flat amount\": \"Flat amount\",\n Format: \"Format\",\n \"Free units\": \"Free units\",\n \"From email\": \"From email\",\n \"Generic (your own receiver)\": \"Generic (your own receiver)\",\n \"Give this customer one of your products without a payment. They hold its keys while the grant lasts, including keys you add to the product later.\":\n \"Give this customer one of your products without a payment. They hold its keys while the grant lasts, including keys you add to the product later.\",\n Graduated: \"Graduated\",\n \"Grandfather.\": \"Grandfather.\",\n Grant: \"Grant\",\n \"Grant credit\": \"Grant credit\",\n \"Grant product access\": \"Grant product access\",\n \"Grants · \": \"Grants · \",\n Health: \"Health\",\n \"How long it lasts\": \"How long it lasts\",\n \"Human-readable quantity shown in billing.\":\n \"Human-readable quantity shown in billing.\",\n Ignore: \"Ignore\",\n Included: \"Included\",\n \"Included units\": \"Included units\",\n \"Included units per period\": \"Included units per period\",\n \"Included usage\": \"Included usage\",\n \"Invoice memo\": \"Invoice memo\",\n \"Invoice profile\": \"Invoice profile\",\n \"Invoice profile saved. Billed orders were not changed.\":\n \"Invoice profile saved. Billed orders were not changed.\",\n \"Keep it\": \"Keep it\",\n \"Keep its own range\": \"Keep its own range\",\n \"Kept with the scheduled change.\": \"Kept with the scheduled change.\",\n Key: \"Key\",\n Kind: \"Kind\",\n \"Kind / reason\": \"Kind / reason\",\n \"Last 3 months\": \"Last 3 months\",\n \"Last 30 days\": \"Last 30 days\",\n \"Last 6 months\": \"Last 6 months\",\n \"Last 7 days\": \"Last 7 days\",\n \"Last 90 days\": \"Last 90 days\",\n \"Last active\": \"Last active\",\n \"Last day (UTC)\": \"Last day (UTC)\",\n \"Last decline\": \"Last decline\",\n \"Last event\": \"Last event\",\n \"Last failure: \": \"Last failure: \",\n \"Last seen\": \"Last seen\",\n \"Last validated \": \"Last validated \",\n \"Last year\": \"Last year\",\n \"Leave blank to use the meter key.\": \"Leave blank to use the meter key.\",\n \"Leave the final limit blank for the unbounded tier.\":\n \"Leave the final limit blank for the unbounded tier.\",\n Lines: \"Lines\",\n \"Loading billing permissions…\": \"Loading billing permissions…\",\n \"Loading billing…\": \"Loading billing…\",\n \"Loading grants…\": \"Loading grants…\",\n \"Loading invoice profile…\": \"Loading invoice profile…\",\n \"Loading order…\": \"Loading order…\",\n \"Loading products…\": \"Loading products…\",\n \"Loading transactions…\": \"Loading transactions…\",\n \"Loading…\": \"Loading…\",\n \"Logo URL\": \"Logo URL\",\n \"Manual remittance\": \"Manual remittance\",\n \"Matrix cells\": \"Matrix cells\",\n Maximum: \"Maximum\",\n \"Memo: \": \"Memo: \",\n Merchant: \"Merchant\",\n \"Merchant profile\": \"Merchant profile\",\n Merchants: \"Merchants\",\n Meter: \"Meter\",\n \"Meter key\": \"Meter key\",\n Metering: \"Metering\",\n \"Metering access is restricted\": \"Metering access is restricted\",\n \"Metering could not be loaded\": \"Metering could not be loaded\",\n Method: \"Method\",\n \"Migrate.\": \"Migrate.\",\n \"Missed rebills\": \"Missed rebills\",\n Model: \"Model\",\n \"Money for this price would go to\": \"Money for this price would go to\",\n Month: \"Month\",\n \"Monthly renewals\": \"Monthly renewals\",\n More: \"More\",\n \"Move everyone to the new price at their first renewal on or after a date you choose.\":\n \"Move everyone to the new price at their first renewal on or after a date you choose.\",\n \"Must be at least \": \"Must be at least \",\n \"NMI history (before OpenRails recorded attempts)\":\n \"NMI history (before OpenRails recorded attempts)\",\n \"NMI's own transaction history, read daily and kept 25 months. It counts every sender, OpenRails too once it started. One-off sales mix initial sales, upgrades and retries of declined rebills: the history cannot tell them apart. Scheduled rebills are NMI's own charges, each the first try of its period. Rates count authorizations, not buyers.\":\n \"NMI's own transaction history, read daily and kept 25 months. It counts every sender, OpenRails too once it started. One-off sales mix initial sales, upgrades and retries of declined rebills: the history cannot tell them apart. Scheduled rebills are NMI's own charges, each the first try of its period. Rates count authorizations, not buyers.\",\n \"NMI-owned\": \"NMI-owned\",\n \"NMI-scheduled rebills\": \"NMI-scheduled rebills\",\n Name: \"Name\",\n \"Name, such as tax_id\": \"Name, such as tax_id\",\n Nearest: \"Nearest\",\n \"Needs attention\": \"Needs attention\",\n \"Needs card\": \"Needs card\",\n \"Net change\": \"Net change\",\n \"Never expires\": \"Never expires\",\n New: \"New\",\n \"New amount (major units)\": \"New amount (major units)\",\n \"New batch\": \"New batch\",\n \"New cards by AVS result\": \"New cards by AVS result\",\n \"New cards by CVV result\": \"New cards by CVV result\",\n \"New purchase on this rail is refused until another PSP is armed. Existing subscriptions, refunds and webhooks keep using this one.\":\n \"New purchase on this rail is refused until another PSP is armed. Existing subscriptions, refunds and webhooks keep using this one.\",\n \"New merchant\": \"New merchant\",\n \"New plan\": \"New plan\",\n \"New price\": \"New price\",\n \"New-card purchase failure rate\": \"New-card purchase failure rate\",\n \"New-card decline rate\": \"New-card decline rate\",\n \"New-card decline rate by week\": \"New-card decline rate by week\",\n Next: \"Next\",\n \"Next attempt: \": \"Next attempt: \",\n \"Next billing date\": \"Next billing date\",\n \"Next charge\": \"Next charge\",\n \"Next page\": \"Next page\",\n \"No NMI history yet: it is read daily.\":\n \"No NMI history yet: it is read daily.\",\n \"No PSPs configured.\": \"No PSPs configured.\",\n \"No actions are available for your permissions and this order's state.\":\n \"No actions are available for your permissions and this order's state.\",\n \"No active products are available.\": \"No active products are available.\",\n \"No active subscriptions.\": \"No active subscriptions.\",\n \"No allowance\": \"No allowance\",\n \"No credit grants in this currency.\": \"No credit grants in this currency.\",\n \"No declines in this range.\": \"No declines in this range.\",\n \"No default rate. Usage is recorded but is not billed by this meter.\":\n \"No default rate. Usage is recorded but is not billed by this meter.\",\n \"No eligible recurring plans share this tier group and currency.\":\n \"No eligible recurring plans share this tier group and currency.\",\n \"No entitlements.\": \"No entitlements.\",\n \"No history yet.\": \"No history yet.\",\n \"No lines.\": \"No lines.\",\n \"No maximum\": \"No maximum\",\n \"No meters on this page match “\": \"No meters on this page match “\",\n \"No missed rebills in this range.\": \"No missed rebills in this range.\",\n \"No open drift events. Catalog is in sync.\":\n \"No open drift events. Catalog is in sync.\",\n \"No payment methods on file.\": \"No payment methods on file.\",\n \"No payments recorded.\": \"No payments recorded.\",\n \"No payments.\": \"No payments.\",\n \"No prices yet.\": \"No prices yet.\",\n \"No product access.\": \"No product access.\",\n \"No products yet.\": \"No products yet.\",\n \"No provider can take this payment, so nobody can buy this price yet.\":\n \"No provider can take this payment, so nobody can buy this price yet.\",\n \"No provider-scheduled charges in this range.\":\n \"No provider-scheduled charges in this range.\",\n \"No recovered cycles.\": \"No recovered cycles.\",\n \"No refunds.\": \"No refunds.\",\n \"No refusals in NMI's history.\": \"No refusals in NMI's history.\",\n \"No saved payment methods. Add one on the customer page before retrying collection.\":\n \"No saved payment methods. Add one on the customer page before retrying collection.\",\n \"No subscriptions.\": \"No subscriptions.\",\n \"No transactions in this currency.\": \"No transactions in this currency.\",\n \"No usage meters yet\": \"No usage meters yet\",\n \"No webhooks configured.\": \"No webhooks configured.\",\n \"No widgets yet\": \"No widgets yet\",\n \"None required\": \"None required\",\n Note: \"Note\",\n \"Notes \": \"Notes \",\n \"Nothing here can be fixed automatically. You can only note why you are leaving it.\":\n \"Nothing here can be fixed automatically. You can only note why you are leaving it.\",\n \"Nothing in this range. Pick a wider range.\":\n \"Nothing in this range. Pick a wider range.\",\n \"Nothing is claimed about the providers' copies until you press Verify.\":\n \"Nothing is claimed about the providers' copies until you press Verify.\",\n \"Nothing needs attention right now.\": \"Nothing needs attention right now.\",\n \"Notice period\": \"Notice period\",\n \"Notice period (days)\": \"Notice period (days)\",\n Notifications: \"Notifications\",\n \"Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active.\":\n \"Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active.\",\n \"One-off sales\": \"One-off sales\",\n \"One-time payment.\": \"One-time payment.\",\n Open: \"Open\",\n \"Open issues\": \"Open issues\",\n \"Open matching list\": \"Open matching list\",\n OpenRails: \"OpenRails\",\n \"OpenRails starts\": \"OpenRails starts\",\n \"OpenRails-owned\": \"OpenRails-owned\",\n \"Operational notifications will stop delivering to this webhook. This cannot be undone.\":\n \"Operational notifications will stop delivering to this webhook. This cannot be undone.\",\n Ops: \"Ops\",\n \"Optional. Only events with one of the listed dimension values are rated.\":\n \"Optional. Only events with one of the listed dimension values are rated.\",\n Order: \"Order\",\n \"Order not found.\": \"Order not found.\",\n Orders: \"Orders\",\n Origin: \"Origin\",\n Original: \"Original\",\n Outcome: \"Outcome\",\n \"Overdue only: still owed past the due date\":\n \"Overdue only: still owed past the due date\",\n \"Overdue usage orders\": \"Overdue usage orders\",\n Overview: \"Overview\",\n \"Overwrite edits\": \"Overwrite edits\",\n Owner: \"Owner\",\n PSP: \"PSP\",\n \"PSP answer\": \"PSP answer\",\n PSPs: \"PSPs\",\n Package: \"Package\",\n \"Package price\": \"Package price\",\n Paid: \"Paid\",\n \"Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set.\":\n \"Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set.\",\n Paying: \"Paying\",\n \"Paying, no access\": \"Paying, no access\",\n Payment: \"Payment\",\n \"Payment attempts\": \"Payment attempts\",\n \"Payment health\": \"Payment health\",\n \"Payment history\": \"Payment history\",\n \"Payment method\": \"Payment method\",\n \"Payment methods\": \"Payment methods\",\n \"Payment not found.\": \"Payment not found.\",\n \"Payment providers\": \"Payment providers\",\n \"Payment rail\": \"Payment rail\",\n \"Payment reference\": \"Payment reference\",\n \"Payment terms (days)\": \"Payment terms (days)\",\n Payments: \"Payments\",\n Pending: \"Pending\",\n \"Per unit\": \"Per unit\",\n \"Period ends\": \"Period ends\",\n \"Period maximum\": \"Period maximum\",\n \"Period: \": \"Period: \",\n \"Pick a later date.\": \"Pick a later date.\",\n \"Pick a product\": \"Pick a product\",\n \"Pick a product…\": \"Pick a product…\",\n \"Pick a rail…\": \"Pick a rail…\",\n \"Pick a stored payment method\": \"Pick a stored payment method\",\n \"Pinned to an archived (prior) version\":\n \"Pinned to an archived (prior) version\",\n \"Points future renewals of this subscription at another of the customer's stored cards (same rail), or back at their default card for its currency.\":\n \"Points future renewals of this subscription at another of the customer's stored cards (same rail), or back at their default card for its currency.\",\n Preview: \"Preview\",\n \"Previous page\": \"Previous page\",\n \"Previous period\": \"Previous period\",\n Price: \"Price\",\n \"Price each value of one registered dimension separately.\":\n \"Price each value of one registered dimension separately.\",\n \"Price history\": \"Price history\",\n \"Price per divisor\": \"Price per divisor\",\n Prices: \"Prices\",\n \"Pricing model\": \"Pricing model\",\n \"Pricing policies\": \"Pricing policies\",\n Product: \"Product\",\n \"Product access\": \"Product access\",\n \"Product and model\": \"Product and model\",\n Products: \"Products\",\n Provider: \"Provider\",\n \"Provider charges seen by webhook\": \"Provider charges seen by webhook\",\n \"Provider-owned\": \"Provider-owned\",\n Providers: \"Providers\",\n Pull: \"Pull\",\n \"Purchase order\": \"Purchase order\",\n \"Purchase order: \": \"Purchase order: \",\n Purchased: \"Purchased\",\n \"Purchases, subscription renewals and usage billed in arrears: what each owes and how it was paid.\":\n \"Purchases, subscription renewals and usage billed in arrears: what each owes and how it was paid.\",\n Quantity: \"Quantity\",\n Rail: \"Rail\",\n Range: \"Range\",\n Rate: \"Rate\",\n \"Rate preview\": \"Rate preview\",\n \"Read-only: this merchant's configuration comes from a file. Change it there.\":\n \"Read-only: this merchant's configuration comes from a file. Change it there.\",\n Reason: \"Reason\",\n \"Reason (optional)\": \"Reason (optional)\",\n \"Rebill collection rate\": \"Rebill collection rate\",\n \"Rebill first-attempt failure rate\": \"Rebill first-attempt failure rate\",\n \"Rebill first-attempt failure rate by week\":\n \"Rebill first-attempt failure rate by week\",\n \"Recent payments\": \"Recent payments\",\n \"Recently canceled\": \"Recently canceled\",\n Recommendation: \"Recommendation\",\n \"Recommended: \": \"Recommended: \",\n \"Recovered by\": \"Recovered by\",\n \"Recurring billing\": \"Recurring billing\",\n Reference: \"Reference\",\n Refresh: \"Refresh\",\n \"Refresh payment methods\": \"Refresh payment methods\",\n \"Refresh scan\": \"Refresh scan\",\n \"Refresh widget\": \"Refresh widget\",\n Refund: \"Refund\",\n \"Refund payment\": \"Refund payment\",\n Refunded: \"Refunded\",\n Refunds: \"Refunds\",\n \"Refusal rate by month\": \"Refusal rate by month\",\n Refused: \"Refused\",\n \"Register event properties used by filters or matrix rates.\":\n \"Register event properties used by filters or matrix rates.\",\n Remaining: \"Remaining\",\n Remote: \"Remote\",\n Remove: \"Remove\",\n \"Remove the default rate?\": \"Remove the default rate?\",\n Renewal: \"Renewal\",\n \"Renewal not found.\": \"Renewal not found.\",\n \"Renewal payments, cancellations and churn each calendar month (UTC); churn is the month's cancellations over the subscriptions it began with.\":\n \"Renewal payments, cancellations and churn each calendar month (UTC); churn is the month's cancellations over the subscriptions it began with.\",\n Renewals: \"Renewals\",\n \"Renewing soon\": \"Renewing soon\",\n Renews: \"Renews\",\n \"Replace the default rate?\": \"Replace the default rate?\",\n Reports: \"Reports\",\n Reset: \"Reset\",\n Resolve: \"Resolve\",\n \"Resolve finding\": \"Resolve finding\",\n Resource: \"Resource\",\n Result: \"Result\",\n Retry: \"Retry\",\n Reverses: \"Reverses\",\n Review: \"Review\",\n \"Review batch\": \"Review batch\",\n \"Review complete. Applying sends this exact document; this is not a database diff.\":\n \"Review complete. Applying sends this exact document; this is not a database diff.\",\n Revoke: \"Revoke\",\n \"Revoke product access\": \"Revoke product access\",\n \"Revoke remaining credit\": \"Revoke remaining credit\",\n \"Revoke the unspent remainder of\": \"Revoke the unspent remainder of\",\n Revoked: \"Revoked\",\n Rotate: \"Rotate\",\n \"Rotate \": \"Rotate \",\n Rounding: \"Rounding\",\n \"Rows per page\": \"Rows per page\",\n \"Save changes\": \"Save changes\",\n \"Saved payment method\": \"Saved payment method\",\n \"Search customer email, ref, or id…\": \"Search customer email, ref, or id…\",\n \"Search email, username, name or id…\": \"Search email, username, name or id…\",\n Seats: \"Seats\",\n \"Select a merchant to view its billing.\":\n \"Select a merchant to view its billing.\",\n \"Select dimension\": \"Select dimension\",\n \"Select product\": \"Select product\",\n \"Send alerts to Discord, Slack, or your own endpoint.\":\n \"Send alerts to Discord, Slack, or your own endpoint.\",\n \"Send email alerts to this address.\": \"Send email alerts to this address.\",\n Sent: \"Sent\",\n \"Set how much notice customers receive before a price increase.\":\n \"Set how much notice customers receive before a price increase.\",\n \"Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.\":\n \"Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.\",\n Settings: \"Settings\",\n Severity: \"Severity\",\n Share: \"Share\",\n Sidebar: \"Sidebar\",\n Since: \"Since\",\n \"Skipped objects\": \"Skipped objects\",\n Slack: \"Slack\",\n Source: \"Source\",\n \"Source meter\": \"Source meter\",\n Spent: \"Spent\",\n \"Stable identifier. It cannot be renamed after creation.\":\n \"Stable identifier. It cannot be renamed after creation.\",\n Start: \"Start\",\n Started: \"Started\",\n State: \"State\",\n Status: \"Status\",\n \"Status: \": \"Status: \",\n \"Step \": \"Step \",\n \"Still matches\": \"Still matches\",\n Subject: \"Subject\",\n Subscription: \"Subscription\",\n \"Subscription not found.\": \"Subscription not found.\",\n \"Subscription:\": \"Subscription:\",\n Subscriptions: \"Subscriptions\",\n \"Subscriptions started and canceled each day (UTC), newest first.\":\n \"Subscriptions started and canceled each day (UTC), newest first.\",\n \"Sum a numeric field\": \"Sum a numeric field\",\n \"Support URL\": \"Support URL\",\n Synced: \"Synced\",\n \"Take the product back\": \"Take the product back\",\n \"Tax details\": \"Tax details\",\n \"Terminal cancellation at the payment rail. This is a last resort. Dunning parks subscriptions as past_due without losing entitlements.\":\n \"Terminal cancellation at the payment rail. This is a last resort. Dunning parks subscriptions as past_due without losing entitlements.\",\n \"Terms and billing facts for future usage orders. Billed orders keep their original snapshots. Tax details are recorded; no tax is calculated.\":\n \"Terms and billing facts for future usage orders. Billed orders keep their original snapshots. Tax details are recorded; no tax is calculated.\",\n \"The accounts this merchant takes payments through, one or more per rail.\":\n \"The accounts this merchant takes payments through, one or more per rail.\",\n \"The customer loses its entitlements now. The grant stays on record with your reason.\":\n \"The customer loses its entitlements now. The grant stays on record with your reason.\",\n \"The customer's default card\": \"The customer's default card\",\n \"The daily report covers at most \": \"The daily report covers at most \",\n \"The keys of the products this customer holds now.\":\n \"The keys of the products this customer holds now.\",\n \"The payment provider calculates the final prorated amount.\":\n \"The payment provider calculates the final prorated amount.\",\n \"Their reference\": \"Their reference\",\n \"There were no providers to consider.\":\n \"There were no providers to consider.\",\n \"These are the customer's invoice profile when the order was billed. Editing the profile affects later orders.\":\n \"These are the customer's invoice profile when the order was billed. Editing the profile affects later orders.\",\n \"These terms cannot be changed later. To charge a different amount, create another price and deactivate this one.\":\n \"These terms cannot be changed later. To charge a different amount, create another price and deactivate this one.\",\n \"This billing page does not exist.\": \"This billing page does not exist.\",\n \"This is a price\": \"This is a price\",\n \"This meter uses an aggregation that the billing engine cannot rate.\":\n \"This meter uses an aggregation that the billing engine cannot rate.\",\n \"This price has not been sent to any provider, so nobody can be charged for it yet.\":\n \"This price has not been sent to any provider, so nobody can be charged for it yet.\",\n Tier: \"Tier\",\n \"Tier group\": \"Tier group\",\n \"Tier mode\": \"Tier mode\",\n \"Tier rank\": \"Tier rank\",\n Tiered: \"Tiered\",\n Tiers: \"Tiers\",\n Title: \"Title\",\n \"Toggle Sidebar\": \"Toggle Sidebar\",\n \"Top refusal reasons\": \"Top refusal reasons\",\n Total: \"Total\",\n \"Transaction ledger · \": \"Transaction ledger · \",\n \"Trust level\": \"Trust level\",\n \"Try again\": \"Try again\",\n \"Try again. If the problem continues, check the OpenRails API logs.\":\n \"Try again. If the problem continues, check the OpenRails API logs.\",\n Type: \"Type\",\n \"Type \": \"Type \",\n USD: \"USD\",\n Unit: \"Unit\",\n \"Unit price\": \"Unit price\",\n \"Units per package\": \"Units per package\",\n Unpaid: \"Unpaid\",\n \"Until a date\": \"Until a date\",\n Unverified: \"Unverified\",\n Up: \"Up\",\n Updated: \"Updated\",\n \"Upper limit\": \"Upper limit\",\n \"Usage billed\": \"Usage billed\",\n \"Use matrix rates\": \"Use matrix rates\",\n \"Used for every customer.\": \"Used for every customer.\",\n Username: \"Username\",\n Value: \"Value\",\n \"Value property\": \"Value property\",\n Values: \"Values\",\n View: \"View\",\n \"View all \": \"View all \",\n \"View billing details\": \"View billing details\",\n \"View customer usage orders\": \"View customer usage orders\",\n \"View user account\": \"View user account\",\n Volume: \"Volume\",\n Webhook: \"Webhook\",\n \"Webhook URL\": \"Webhook URL\",\n Webhooks: \"Webhooks\",\n \"What the customer asked for\": \"What the customer asked for\",\n \"Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.\":\n \"Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.\",\n \"Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.\":\n \"Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.\",\n Why: \"Why\",\n \"Why it was granted\": \"Why it was granted\",\n \"Widget menu\": \"Widget menu\",\n \"Widget title\": \"Widget title\",\n \"You're all caught up.\": \"You're all caught up.\",\n \"Your directory holds no contact for this customer.\":\n \"Your directory holds no contact for this customer.\",\n \"Your role does not have permission to read the merchant catalog.\":\n \"Your role does not have permission to read the merchant catalog.\",\n active: \"active\",\n \"active-seats\": \"active-seats\",\n \"alerts@example.com\": \"alerts@example.com\",\n \"api-tokens\": \"api-tokens\",\n archived: \"archived\",\n \"at the first renewal from \": \"at the first renewal from \",\n breadcrumb: \"breadcrumb\",\n default: \"default\",\n disabled: \"disabled\",\n \"drafted by copilot\": \"drafted by copilot\",\n \"draining (\": \"draining (\",\n \"e.g. #billing-alerts\": \"e.g. #billing-alerts\",\n \"eu, us\": \"eu, us\",\n \"gpt-5\": \"gpt-5\",\n \"held \": \"held \",\n \"https://example.com/logo.png\": \"https://example.com/logo.png\",\n \"https://example.com/support\": \"https://example.com/support\",\n \"key: \": \"key: \",\n \"metadata.model\": \"metadata.model\",\n model: \"model\",\n moved: \"moved\",\n \"no data in range\": \"no data in range\",\n \"no measure\": \"no measure\",\n \"of \": \"of \",\n offered: \"offered\",\n \"openrails intents resolve\": \"openrails intents resolve\",\n \"premium, downloads\": \"premium, downloads\",\n \"premium-monthly\": \"premium-monthly\",\n \"prior version\": \"prior version\",\n \"read-only\": \"read-only\",\n \"refused: \": \"refused: \",\n retired: \"retired\",\n selected: \"selected\",\n skipped: \"skipped\",\n \"token.used\": \"token.used\",\n tokens: \"tokens\",\n \"why is this being canceled?\": \"why is this being canceled?\",\n \"· owed \": \"· owed \",\n \"← Orders\": \"← Orders\",\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,KAA0D;CAC9D,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,OAAO;CACP,SAAS;CACT,mBAAmB;CACnB,aAAa;CACb,MAAM;CACN,QAAQ;CACR,YAAY;AACd;AAEA,SAAgB,EACd,GACA,IAA6B,QACF;CAC3B,IAAM,IAAY,GAAY;CAC9B,IAAI,CAAC,GAAW;CAChB,IAAM,IAAgC,CAAC;CACvC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAS,GAC5C,MACL,EACE,GAAgB,EAA8B,CAAC,QAC7C,WACA,KAAK,EAAU,EACjB,KACE;CAEN,OAAO;AACT;;;AC7DA,IAAM,KAAS;CACb;EACE,MAAM;EACN,WAAW,QACT,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAC/C,SAAS,EAAE,aACb,EAAE,CACJ;CACF;CACA;EACE,MAAM;EACN,WAAW,QACT,OAAO,+BAA2B,CAAC,MAAM,OAAO,EAC9C,SAAS,EAAE,oBACb,EAAE,CACJ;CACF;C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,iBAAiB;CACjB,wBAAwB;CACxB,SAAS;CACT,KAAK;CACL,qDACE;CACF,sBAAsB;CACtB,WAAW;CACX,UAAU;CACV,qBAAqB;CACrB,MAAM;CACN,oBAAoB;CACpB,SAAS;CACT,iBAAiB;CACjB,SAAS;CACT,oBAAoB;CACpB,oBAAoB;CACpB,mBAAmB;CACnB,uBAAuB;CACvB,QAAQ;CACR,uBAAuB;CACvB,0BAA0B;CAC1B,UAAU;CACV,MAAM;CACN,sBAAsB;CACtB,SAAS;CACT,oBAAoB;CACpB,kHACE;CACF,2DACE;CACF,8EACE;CACF,qBAAqB;CACrB,0KACE;CACF,yBAAyB;CACzB,gBAAgB;CAChB,qBAAqB;CACrB,uBAAuB;CACvB,kFACE;CACF,SAAS;CACT,iBAAiB;CACjB,cAAc;CACd,0BAA0B;CAC1B,mBAAmB;CACnB,OAAO;CACP,aAAa;CACb,yBAAyB;CACzB,iBAAiB;CACjB,OAAO;CACP,MAAM;CACN,WAAW;CACX,qBAAqB;CACrB,eAAe;CACf,8HACE;CACF,gBAAgB;CAChB,SAAS;CACT,kCAAkC;CAClC,uCAAuC;CACvC,gBAAgB;CAChB,iDACE;CACF,UAAU;CACV,gFACE;CACF,sCAAsC;CACtC,SAAS;CACT,kGACE;CACF,aAAa;CACb,oBAAoB;CACpB,iBAAiB;CACjB,gBAAgB;CAChB,6BAA6B;CAC7B,SAAS;CACT,UAAU;CACV,uBAAuB;CACvB,kBAAkB;CAClB,gNACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,UAAU;CACV,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,mBAAmB;CACnB,uBAAuB;CACvB,iEACE;CACF,WAAW;CACX,QAAQ;CACR,uBAAuB;CACvB,WAAW;CACX,MAAM;CACN,cAAc;CACd,sDACE;CACF,mBAAmB;CACnB,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,gBAAgB;CAChB,cAAc;CACd,+GACE;CACF,yHACE;CACF,kBAAkB;CAClB,aAAa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M;CACN,UAAU;CACV,sFACE;CACF,8CACE;CACF,0EACE;CACF,sCAAsC;CACtC,iBAAiB;CACjB,wBAAwB;CACxB,eAAe;CACf,uLACE;CACF,iBAAiB;CACjB,qBAAqB;CACrB,MAAM;CACN,eAAe;CACf,sBAAsB;CACtB,WAAW;CACX,oBAAoB;CACpB,mBAAmB;CACnB,0FACE;CACF,KAAK;CACL,4EACE;CACF,OAAO;CACP,oBAAoB;CACpB,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,SAAS;CACT,8CACE;CACF,wBAAwB;CACxB,UAAU;CACV,mBAAmB;CACnB,OAAO;CACP,KAAK;CACL,cAAc;CACd,MAAM;CACN,SAAS;CACT,iBAAiB;CACjB,MAAM;CACN,4aACE;CACF,QAAQ;CACR,qBAAqB;CACrB,SAAS;CACT,oBAAoB;CACpB,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,mBAAmB;CACnB,sBAAsB;CACtB,qBAAqB;CACrB,gBAAgB;CAChB,qBAAqB;CACrB,wBAAwB;CACxB,UAAU;CACV,SAAS;CACT,YAAY;CACZ,eAAe;CACf,kBAAkB;CAClB,YAAY;CACZ,sBAAsB;CACtB,kBAAkB;CAClB,mBAAmB;CACnB,gBAAgB;CAChB,gCAAgC;CAChC,yCACE;CACF,2JACE;CACF,SAAS;CACT,iBAAiB;CACjB,mBAAmB;CACnB,OAAO;CACP,4DACE;CACF,iBAAiB;CACjB,qBAAqB;CACrB,QAAQ;CACR,iBAAiB;CACjB,oBAAoB;CACpB,SAAS;CACT,kBAAkB;CAClB,qBAAqB;CACrB,UAAU;CACV,UAAU;CACV,oCAAoC;CACpC,kBAAkB;CAClB,WAAW;CACX,MAAM;CACN,kBAAkB;CAClB,oBAAoB;CACpB,WAAW;CACX,qGACE;CACF,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACN,gBAAgB;CAChB,gFACE;CACF,QAAQ;CACR,qBAAqB;CACrB,0BAA0B;CAC1B,qCAAqC;CACrC,6C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":3,"file":"admin.js","names":[],"sources":["../src/appearance.ts","../src/admin/routes.tsx","../src/admin/hooks/use-mobile.ts","../src/admin/components/ui/separator.tsx","../src/admin/components/ui/sheet.tsx","../src/admin/components/ui/tooltip.tsx","../src/admin/components/ui/sidebar.tsx","../src/admin/navigation.tsx","../src/admin/components/app-sidebar.tsx","../src/admin/components/no-access.tsx","../src/admin/components/no-merchants.tsx","../src/admin/components/notification-bell.tsx","../src/admin/components/ui/breadcrumb.tsx","../src/admin/components/site-header.tsx","../src/admin/layouts/app-layout.tsx","../src/admin/components/ui/alert-dialog.tsx","../src/admin/components/confirm.tsx","../src/admin/components/ui/sonner.tsx","../src/admin/lib/chunk-error.ts","../src/admin/components/route-error.tsx","../src/admin/lib/query-client.ts","../src/admin/theme.ts","../src/admin/billing-admin.tsx","../src/admin/summary.tsx","../src/admin/messages.ts"],"sourcesContent":["// Integrator theming. The component scopes the standard shadcn token set\n// under its root, so `theme` flips the whole palette and `variables` override\n// individual tokens without the integrator touching our CSS.\nimport type { CSSProperties } from \"react\"\n\n// `inherit` uses the host page's shadcn tokens (`--background`, ...) and its\n// `.dark` class instead of the bundled zinc palette.\nexport type BillingTheme = \"light\" | \"dark\" | \"auto\" | \"inherit\"\n\n// The tokens integrators may override. Values are raw CSS color/length\n// strings; they land as custom properties on the purchase root.\nexport interface BillingVariables {\n background?: string\n foreground?: string\n card?: string\n mutedForeground?: string\n faintForeground?: string\n border?: string\n input?: string\n primary?: string\n primaryForeground?: string\n destructive?: string\n ring?: string\n radius?: string\n fontFamily?: string\n}\n\nexport interface BillingAppearance {\n theme?: BillingTheme\n variables?: BillingVariables\n}\n\nconst VARIABLE_TO_CSS: Record<keyof BillingVariables, string> = {\n background: \"--background\",\n foreground: \"--foreground\",\n card: \"--card\",\n mutedForeground: \"--muted-foreground\",\n faintForeground: \"--orck-faint\",\n border: \"--border\",\n input: \"--input\",\n primary: \"--primary\",\n primaryForeground: \"--primary-foreground\",\n destructive: \"--destructive\",\n ring: \"--ring\",\n radius: \"--radius\",\n fontFamily: \"--orck-font\",\n}\n\nexport function appearanceStyle(\n appearance: BillingAppearance | undefined,\n namespace: \"orck\" | \"orba\" = \"orck\"\n): CSSProperties | undefined {\n const variables = appearance?.variables\n if (!variables) return undefined\n const style: Record<string, string> = {}\n for (const [key, value] of Object.entries(variables)) {\n if (!value) continue\n style[\n VARIABLE_TO_CSS[key as keyof BillingVariables].replace(\n \"--orck-\",\n `--${namespace}-`\n )\n ] = value\n }\n return style as CSSProperties\n}\n\nexport function appearanceTheme(\n appearance: BillingAppearance | undefined\n): BillingTheme {\n return appearance?.theme ?? \"auto\"\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { lazy, Suspense } from \"react\"\nimport { RouteParams, useLocation } from \"./router\"\n\nconst routes = [\n {\n path: \"/payments/attempts\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.AttemptsPage,\n }))\n ),\n },\n {\n path: \"/catalog/metering\",\n Component: lazy(() =>\n import(\"./pages/catalog/metering\").then((m) => ({\n default: m.CatalogMeteringPage,\n }))\n ),\n },\n {\n path: \"/payments/health\",\n Component: lazy(() =>\n import(\"./pages/payments/health\").then((m) => ({\n default: m.PaymentHealthPage,\n }))\n ),\n },\n {\n path: \"/payments/cycles\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.CyclesPage,\n }))\n ),\n },\n {\n path: \"/catalog/prices\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({ default: m.CatalogPricesPage }))\n ),\n },\n {\n path: \"/subscriptions\",\n Component: lazy(() =>\n import(\"./pages/subscriptions\").then((m) => ({\n default: m.SubscriptionsPage,\n }))\n ),\n },\n {\n path: \"/catalog/drift\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({ default: m.CatalogDriftPage }))\n ),\n },\n {\n path: \"/customers\",\n Component: lazy(() =>\n import(\"./pages/customers\").then((m) => ({ default: m.CustomersPage }))\n ),\n },\n {\n path: \"/payments\",\n Component: lazy(() =>\n import(\"./pages/payments\").then((m) => ({ default: m.PaymentsPage }))\n ),\n },\n {\n path: \"/settings\",\n Component: lazy(() =>\n import(\"./pages/settings\").then((m) => ({ default: m.SettingsPage }))\n ),\n },\n {\n path: \"/reports\",\n Component: lazy(() =>\n import(\"./pages/dashboard/reports\").then((m) => ({\n default: m.ReportsPage,\n }))\n ),\n },\n {\n path: \"/catalog\",\n Component: lazy(() =>\n import(\"./pages/catalog\").then((m) => ({\n default: m.CatalogProductsPage,\n }))\n ),\n },\n {\n path: \"/orders\",\n Component: lazy(() =>\n import(\"./pages/orders\").then((m) => ({ default: m.OrdersPage }))\n ),\n },\n {\n path: \"/ops\",\n Component: lazy(() =>\n import(\"./pages/ops\").then((m) => ({ default: m.OpsPage }))\n ),\n },\n {\n path: \"/\",\n Component: lazy(() =>\n import(\"./pages/dashboard\").then((m) => ({ default: m.DashboardPage }))\n ),\n },\n {\n path: \"/customers/:customerId\",\n Component: lazy(() =>\n import(\"./pages/customers/detail\").then((m) => ({\n default: m.CustomerDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/attempts/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.AttemptDetailPage,\n }))\n ),\n },\n {\n path: \"/catalog/metering/:key\",\n Component: lazy(() =>\n import(\"./pages/catalog/metering\").then((m) => ({\n default: m.MeterDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/cycles/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/attempts\").then((m) => ({\n default: m.CycleDetailPage,\n }))\n ),\n },\n {\n path: \"/catalog/prices/:id\",\n Component: lazy(() =>\n import(\"./pages/catalog/price-detail\").then((m) => ({\n default: m.PriceDetailPage,\n }))\n ),\n },\n {\n path: \"/subscriptions/:id\",\n Component: lazy(() =>\n import(\"./pages/subscriptions/detail\").then((m) => ({\n default: m.SubscriptionDetailPage,\n }))\n ),\n },\n {\n path: \"/payments/:id\",\n Component: lazy(() =>\n import(\"./pages/payments/detail\").then((m) => ({\n default: m.PaymentDetailPage,\n }))\n ),\n },\n {\n path: \"/orders/:id\",\n Component: lazy(() =>\n import(\"./pages/orders/detail\").then((m) => ({\n default: m.OrderDetailPage,\n }))\n ),\n },\n]\n\nexport function matchAdminRoute(pathname: string) {\n for (const { path, Component } of routes) {\n const actual = pathname.replace(/\\/$/, \"\").split(\"/\")\n const expected = path === \"/\" ? [\"\"] : path.split(\"/\")\n const params: Record<string, string> = {}\n if (actual.length !== expected.length) continue\n if (\n !expected.every((part, i) => {\n if (part.startsWith(\":\")) {\n try {\n params[part.slice(1)] = decodeURIComponent(actual[i])\n return true\n } catch {\n return false\n }\n }\n return part === actual[i]\n })\n )\n continue\n return { Component, params }\n }\n}\nexport function AdminPages() {\n const match = matchAdminRoute(useLocation().pathname)\n if (!match)\n return (\n <p role=\"status\">\n <AdminMessage id={\"This billing page does not exist.\"} />\n </p>\n )\n return (\n <RouteParams params={match.params}>\n <Suspense\n fallback={\n <p role=\"status\">\n <AdminMessage id={\"Loading…\"} />\n </p>\n }\n >\n <match.Component />\n </Suspense>\n </RouteParams>\n )\n}\n","import { useSyncExternalStore } from \"react\"\nconst query = \"(max-width: 767px)\"\nconst subscribe = (notify: () => void) => {\n const media = window.matchMedia(query)\n media.addEventListener(\"change\", notify)\n return () => media.removeEventListener(\"change\", notify)\n}\nexport function useIsMobile() {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(query).matches,\n () => false\n )\n}\n","import { Separator as SeparatorPrimitive } from \"@base-ui/react/separator\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n ...props\n}: SeparatorPrimitive.Props) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useAdminContext } from \"#orck/admin/context\"\nimport * as React from \"react\"\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: SheetPrimitive.Close.Props) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {\n return (\n <SheetPrimitive.Portal\n container={useAdminContext().portal}\n data-slot=\"sheet-portal\"\n {...props}\n />\n )\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 right-3\"\n size=\"icon-sm\"\n />\n }\n >\n <XIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"Close\"} />\n </span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-0.5 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\n \"font-heading text-base font-medium text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: SheetPrimitive.Description.Props) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n","\"use client\"\nimport { useAdminContext } from \"#orck/admin/context\"\n\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\n\nfunction TooltipProvider({\n delay = 0,\n ...props\n}: TooltipPrimitive.Provider.Props) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delay}\n {...props}\n />\n )\n}\n\nfunction Tooltip({ ...props }: TooltipPrimitive.Root.Props) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\nfunction TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n className,\n side = \"top\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n children,\n ...props\n}: TooltipPrimitive.Popup.Props &\n Pick<\n TooltipPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <TooltipPrimitive.Portal container={useAdminContext().portal}>\n <TooltipPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-content\"\n className={cn(\n \"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5\" />\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n","\"use client\"\nimport { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\n\nimport * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { useIsMobile } from \"#orck/admin/hooks/use-mobile\"\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { Input } from \"#orck/admin/components/ui/input\"\nimport { Separator } from \"#orck/admin/components/ui/separator\"\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"#orck/admin/components/ui/sheet\"\nimport { Skeleton } from \"#orck/admin/components/ui/skeleton\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"#orck/admin/components/ui/tooltip\"\nimport { PanelLeftIcon } from \"lucide-react\"\n\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\"\n open: boolean\n setOpen: (open: boolean) => void\n openMobile: boolean\n setOpenMobile: (open: boolean) => void\n isMobile: boolean\n toggleSidebar: () => void\n}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\")\n }\n\n return context\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}) {\n const isMobile = useIsMobile()\n const [openMobile, setOpenMobile] = React.useState(false)\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen)\n const open = openProp ?? _open\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value\n if (setOpenProp) {\n setOpenProp(openState)\n } else {\n _setOpen(openState)\n }\n },\n [setOpenProp, open]\n )\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)\n }, [isMobile, setOpen, setOpenMobile])\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\"\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n data-slot=\"sidebar-wrapper\"\n onKeyDown={(event) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault()\n toggleSidebar()\n }\n }}\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar relative flex min-h-[30rem] w-full\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n )\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n dir,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\"\n variant?: \"sidebar\" | \"floating\" | \"inset\"\n collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n )\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n dir={dir}\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>\n <AdminMessage id={\"Sidebar\"} />\n </SheetTitle>\n <SheetDescription>\n <AdminMessage id={\"Displays the mobile sidebar.\"} />\n </SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n )\n }\n\n return (\n <div\n className=\"group peer text-sidebar-foreground relative hidden md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n data-side={side}\n className={cn(\n \"absolute inset-y-0 z-10 hidden h-full w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1\"\n >\n {children}\n </div>\n </div>\n </div>\n )\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar()\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn(className)}\n onClick={(event) => {\n onClick?.(event)\n toggleSidebar()\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"Toggle Sidebar\"} />\n </span>\n </Button>\n )\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { text: adminText } = useAdminUI()\n\n const { toggleSidebar } = useSidebar()\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label={adminText(\"Toggle Sidebar\")}\n tabIndex={-1}\n onClick={toggleSidebar}\n title={adminText(\"Toggle Sidebar\")}\n className={cn(\n \"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"bg-sidebar-border mx-2 w-auto\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarGroupLabel({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & React.ComponentProps<\"div\">) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-group-label\",\n sidebar: \"group-label\",\n },\n })\n}\n\nfunction SidebarGroupAction({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"button\"> & React.ComponentProps<\"button\">) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-group-action\",\n sidebar: \"group-action\",\n },\n })\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-0\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n )\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button group/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-medium [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction SidebarMenuButton({\n render,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: useRender.ComponentProps<\"button\"> &\n React.ComponentProps<\"button\"> & {\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n } & VariantProps<typeof sidebarMenuButtonVariants>) {\n const { isMobile, state } = useSidebar()\n const comp = useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(sidebarMenuButtonVariants({ variant, size }), className),\n },\n props\n ),\n render: !tooltip ? render : <TooltipTrigger render={render} />,\n state: {\n slot: \"sidebar-menu-button\",\n sidebar: \"menu-button\",\n size,\n active: isActive,\n },\n })\n\n if (!tooltip) {\n return comp\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n }\n }\n\n return (\n <Tooltip>\n {comp}\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n )\n}\n\nfunction SidebarMenuAction({\n className,\n render,\n showOnHover = false,\n ...props\n}: useRender.ComponentProps<\"button\"> &\n React.ComponentProps<\"button\"> & {\n showOnHover?: boolean\n }) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0\",\n showOnHover &&\n \"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-menu-action\",\n sidebar: \"menu-action\",\n },\n })\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean\n}) {\n // Random width between 50 to 90%.\n const [width] = React.useState(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`\n })\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n )\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n )\n}\n\nfunction SidebarMenuSubButton({\n render,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: useRender.ComponentProps<\"a\"> &\n React.ComponentProps<\"a\"> & {\n size?: \"sm\" | \"md\"\n isActive?: boolean\n }) {\n return useRender({\n defaultTagName: \"a\",\n props: mergeProps<\"a\">(\n {\n className: cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"sidebar-menu-sub-button\",\n sidebar: \"menu-sub-button\",\n size,\n active: isActive,\n },\n })\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n}\n","import {\n CreditCardIcon,\n DashboardCircleIcon,\n PackageIcon,\n RepeatIcon,\n Settings01Icon,\n UserGroupIcon,\n Wrench01Icon,\n} from \"@hugeicons/core-free-icons\"\nimport type { IconSvgElement } from \"@hugeicons/react\"\nimport {\n useAdminArea,\n useCatalogArea,\n useMerchantConfig,\n useMetrics,\n} from \"./lib/capabilities\"\nexport interface AdminNavItem {\n title: string\n path: string\n icon?: IconSvgElement\n useVisible?: () => boolean\n order?: number\n items?: { title: string; path: string; useVisible?: () => boolean }[]\n}\nexport const coreNav: AdminNavItem[] = [\n {\n title: \"Dashboard\",\n path: \"/\",\n icon: DashboardCircleIcon,\n order: 0,\n useVisible: useMetrics,\n items: [\n { title: \"Overview\", path: \"/\" },\n { title: \"Reports\", path: \"/reports\" },\n ],\n },\n {\n title: \"Customers\",\n path: \"/customers\",\n icon: UserGroupIcon,\n order: 10,\n useVisible: useAdminArea,\n },\n {\n title: \"Subscriptions\",\n path: \"/subscriptions\",\n icon: RepeatIcon,\n order: 20,\n useVisible: useAdminArea,\n },\n {\n title: \"Payments\",\n path: \"/payments\",\n icon: CreditCardIcon,\n order: 30,\n useVisible: useAdminArea,\n items: [\n { title: \"Payments\", path: \"/payments\" },\n { title: \"Health\", path: \"/payments/health\", useVisible: useMetrics },\n { title: \"Attempts\", path: \"/payments/attempts\" },\n { title: \"Renewals\", path: \"/payments/cycles\" },\n ],\n },\n {\n title: \"Orders\",\n path: \"/orders\",\n icon: CreditCardIcon,\n order: 40,\n useVisible: useAdminArea,\n },\n {\n title: \"Catalog\",\n path: \"/catalog\",\n icon: PackageIcon,\n order: 50,\n useVisible: useCatalogArea,\n items: [\n { title: \"Products\", path: \"/catalog\" },\n { title: \"Prices\", path: \"/catalog/prices\" },\n { title: \"Metering\", path: \"/catalog/metering\" },\n { title: \"Drift\", path: \"/catalog/drift\", useVisible: useMerchantConfig },\n ],\n },\n {\n title: \"Ops\",\n path: \"/ops\",\n icon: Wrench01Icon,\n order: 60,\n useVisible: useMerchantConfig,\n },\n { title: \"Settings\", path: \"/settings\", icon: Settings01Icon, order: 70 },\n].map((item) => ({ ...item }))\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\n// App shell sidebar — same anatomy as the hosted product's shell\n// (inset variant, brand header, nav, footer user menu, rail).\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n Add01Icon,\n Tick02Icon,\n UnfoldMoreIcon,\n} from \"@hugeicons/core-free-icons\"\nimport { Link, useLocation, useNavigate } from \"#orck/admin/router\"\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"#orck/admin/components/ui/dropdown-menu\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarRail,\n} from \"#orck/admin/components/ui/sidebar\"\nimport { coreNav, type AdminNavItem } from \"../navigation\"\nimport { useAdminContext } from \"../context\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\n\n// A section's first sub-page IS the section URL (/catalog, /payments), so it\n// can only be the active one when nothing deeper is selected.\nfunction subItemIsActive(pathname: string, url: string, sectionURL: string) {\n return url === sectionURL ? pathname === url : pathname.startsWith(url)\n}\n\nexport function AppSidebar() {\n const { pathname } = useLocation()\n const groups = [{ label: \"Billing\", items: coreNav }]\n const active = [...coreNav]\n .sort((a, b) => b.path.length - a.path.length)\n .find(\n (item) =>\n pathname === item.path ||\n (item.path !== \"/\" && pathname.startsWith(item.path + \"/\"))\n )?.path\n return (\n <Sidebar variant=\"inset\" collapsible=\"icon\">\n <SidebarHeader>\n {/* No product lockup: this console mounts inside the host's own app\n (host-one, host-three), where a vendor mark belongs to someone else's\n product. The merchant switcher is the orientation that matters here,\n and it names the merchant and role rather than the software. */}\n <MerchantSwitcher />\n </SidebarHeader>\n <SidebarContent>\n {groups.map((group) => (\n <SidebarGroup key={group.label}>\n <SidebarGroupLabel>\n <AdminMessage id={group.label} />\n </SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n {group.items.map((item) => (\n <NavEntry\n key={item.path}\n item={item}\n active={item.path === active}\n pathname={pathname}\n />\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n )\n}\n\nconst always = () => true\n\nfunction NavEntry({\n item,\n active,\n pathname,\n}: {\n item: AdminNavItem\n active: boolean\n pathname: string\n}) {\n const { text: adminText } = useAdminUI()\n // A fixed hook per entry: an extension's item list never changes.\n const visible = (item.useVisible ?? always)()\n if (!visible) return null\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n isActive={active}\n tooltip={adminText(item.title)}\n render={\n <Link to={item.path}>\n {item.icon && <HugeiconsIcon icon={item.icon} />}\n <span>\n <AdminMessage id={item.title} />\n </span>\n </Link>\n }\n />\n {item.items && active && (\n <SidebarMenuSub>\n {item.items.map((sub) => (\n <NavSubEntry\n key={sub.path}\n sub={sub}\n active={subItemIsActive(pathname, sub.path, item.path)}\n />\n ))}\n </SidebarMenuSub>\n )}\n </SidebarMenuItem>\n )\n}\n\nfunction NavSubEntry({\n sub,\n active,\n}: {\n sub: NonNullable<AdminNavItem[\"items\"]>[number]\n active: boolean\n}) {\n // A fixed hook per entry, as for NavEntry.\n const visible = (sub.useVisible ?? always)()\n if (!visible) return null\n return (\n <SidebarMenuSubItem>\n <SidebarMenuSubButton\n isActive={active}\n render={\n <Link to={sub.path}>\n <span>\n <AdminMessage id={sub.title} />\n </span>\n </Link>\n }\n />\n </SidebarMenuSubItem>\n )\n}\n\nfunction MerchantSwitcher() {\n const { activeMerchant, merchants, selectMerchant } = useAuth()\n const navigate = useNavigate()\n const newMerchant = useAdminContext().props.newMerchantHref\n const label =\n activeMerchant?.display_name || activeMerchant?.slug || \"Select merchant\"\n const role = activeMerchant?.role || \"Merchant console\"\n const initials = activeMerchant?.slug.slice(0, 2) ?? \"µ\"\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <SidebarMenuButton\n size=\"lg\"\n tooltip={label}\n className=\"data-open:bg-sidebar-accent\"\n >\n <span className=\"flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-primary text-xs font-semibold text-primary-foreground uppercase\">\n {initials}\n </span>\n <span className=\"grid min-w-0 flex-1 text-left leading-tight\">\n <span className=\"truncate text-sm font-medium\">{label}</span>\n <span className=\"truncate text-xs text-muted-foreground capitalize\">\n {role}\n </span>\n </span>\n <HugeiconsIcon\n icon={UnfoldMoreIcon}\n className=\"ml-auto size-4 shrink-0\"\n />\n </SidebarMenuButton>\n }\n />\n <DropdownMenuContent side=\"bottom\" align=\"start\" className=\"min-w-60\">\n <DropdownMenuGroup>\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n <AdminMessage id={\"Merchants\"} />\n </DropdownMenuLabel>\n {merchants.map((merchant) => {\n const active = merchant.slug === activeMerchant?.slug\n return (\n <DropdownMenuItem\n key={merchant.slug}\n onClick={() => selectMerchant(merchant.slug)}\n className=\"gap-2 py-2\"\n >\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-semibold uppercase\">\n {merchant.slug.slice(0, 2)}\n </span>\n <span className=\"grid min-w-0 flex-1 leading-tight\">\n <span className=\"truncate text-sm\">\n {merchant.display_name || merchant.slug}\n </span>\n {merchant.role && (\n <span className=\"truncate text-xs text-muted-foreground capitalize\">\n {merchant.role}\n </span>\n )}\n </span>\n {active && (\n <HugeiconsIcon\n icon={Tick02Icon}\n className=\"ml-auto size-4 shrink-0 text-primary\"\n />\n )}\n </DropdownMenuItem>\n )\n })}\n </DropdownMenuGroup>\n {/* The console creates no merchants itself: the entry exists only\n when a host extension serves a creation page. */}\n {newMerchant && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => void navigate(newMerchant)}\n className=\"gap-2 py-2\"\n >\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-md border border-dashed border-border\">\n <HugeiconsIcon icon={Add01Icon} className=\"size-4\" />\n </span>\n <AdminMessage id={\"New merchant\"} />\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\n// NoAccess is a merchant page the signed-in staff member may not use: none of\n// the console's areas, or not this one.\nexport function NoAccess({ area }: { area?: string }) {\n return (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-full max-w-sm\">\n <h1 className=\"text-2xl font-semibold tracking-tight text-balance\">\n {area\n ? `You don't have access to ${area}`\n : \"You don't have access to this merchant's billing\"}\n </h1>\n <p className=\"mt-2 text-sm text-pretty text-muted-foreground\">\n <AdminMessage\n id={\"Ask an administrator for a role that includes it.\"}\n />\n </p>\n </div>\n </div>\n )\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useAdminContext } from \"../context\"\nexport function NoMerchants() {\n const { props } = useAdminContext()\n return (\n <div role=\"status\" className=\"p-8\">\n {props.emptyState ?? (\n <>\n <p>\n <AdminMessage id={\"Select a merchant to view its billing.\"} />\n </p>\n {props.newMerchantHref && (\n <a href={props.newMerchantHref}>\n <AdminMessage id={\"New merchant\"} />\n </a>\n )}\n </>\n )}\n </div>\n )\n}\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\nimport { useAdminServices } from \"#orck/admin/context\"\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport {\n Alert01Icon,\n AlertCircleIcon,\n Notification01Icon,\n} from \"@hugeicons/core-free-icons\"\nimport * as React from \"react\"\nimport { useNavigate } from \"#orck/admin/router\"\nimport { useQuery } from \"@tanstack/react-query\"\n\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"#orck/admin/components/ui/dropdown-menu\"\nimport type { Finding } from \"#orck/admin/lib/api/types\"\nimport { timeAgo } from \"#orck/admin/lib/format\"\nimport { useMerchantConfig, useMetrics } from \"#orck/admin/lib/capabilities\"\n\n// The bell is the findings queue: the open findings that need a person. A\n// finding leaves it when it is resolved, by an operator or by itself. Its\n// count is a metrics query, shown only to staff holding Metrics.\nexport function NotificationBell() {\n const { text: adminText } = useAdminUI()\n\n const { adminQueries } = useAdminServices()\n\n const navigate = useNavigate()\n const [open, setOpen] = React.useState(false)\n const metrics = useMetrics()\n const merchantConfig = useMerchantConfig()\n const { data: count = 0 } = useQuery({\n ...adminQueries.unreadNotifications(),\n enabled: merchantConfig && metrics,\n })\n const { data, isFetching: loading } = useQuery(\n adminQueries.notifications(merchantConfig && open)\n )\n const items = data?.data ?? []\n if (!merchantConfig) return null\n\n const onItemClick = (f: Finding) => {\n setOpen(false)\n navigate(`/ops?finding=${encodeURIComponent(f.id)}`)\n }\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n render={\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={adminText(\"Notifications\")}\n className=\"relative\"\n >\n <HugeiconsIcon icon={Notification01Icon} className=\"size-4\" />\n {count > 0 && (\n <span className=\"absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] font-medium text-white\">\n {count > 9 ? \"9+\" : count}\n </span>\n )}\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\" className=\"w-80 p-0 sm:w-96\">\n <div className=\"flex items-center justify-between border-b px-3 py-2\">\n <span className=\"text-sm font-medium\">\n <AdminMessage id={\"Needs attention\"} />\n </span>\n {count > items.length && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-6 px-2 text-xs\"\n onClick={() => {\n setOpen(false)\n navigate(\"/ops\")\n }}\n >\n <AdminMessage id={\"View all \"} />\n {count}\n </Button>\n )}\n </div>\n <div className=\"max-h-96 overflow-y-auto\">\n {loading ? (\n <p className=\"px-3 py-6 text-center text-sm text-muted-foreground\">\n <AdminMessage id={\"Loading…\"} />\n </p>\n ) : items.length === 0 ? (\n <div className=\"flex flex-col items-center gap-1 px-3 py-8 text-center\">\n <HugeiconsIcon\n icon={Notification01Icon}\n className=\"size-5 text-muted-foreground\"\n />\n <p className=\"text-sm text-muted-foreground\">\n <AdminMessage id={\"You're all caught up.\"} />\n </p>\n </div>\n ) : (\n items.map((f) => (\n <button\n key={f.id}\n type=\"button\"\n onClick={() => onItemClick(f)}\n className=\"flex w-full items-start gap-2 border-b px-3 py-2 text-left last:border-b-0 hover:bg-muted/50\"\n >\n <span className=\"mt-0.5 shrink-0\">\n {f.severity === \"critical\" || f.severity === \"high\" ? (\n <HugeiconsIcon\n icon={AlertCircleIcon}\n className=\"text-failed size-4\"\n />\n ) : (\n <HugeiconsIcon\n icon={Alert01Icon}\n className=\"text-held size-4\"\n />\n )}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-center justify-between gap-2\">\n <span className=\"truncate text-sm font-medium\">\n {f.finding_type}\n </span>\n <span className=\"shrink-0 text-[11px] text-muted-foreground\">\n {timeAgo(f.created_at)}\n </span>\n </span>\n {f.recommended_action && (\n <span className=\"mt-0.5 line-clamp-2 block text-xs text-muted-foreground\">\n {f.recommended_action}\n </span>\n )}\n </span>\n </button>\n ))\n )}\n </div>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import { AdminMessage, useAdminUI } from \"#orck/admin/ui-context\"\nimport * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { ChevronRightIcon, MoreHorizontalIcon } from \"lucide-react\"\n\nfunction Breadcrumb({ className, ...props }: React.ComponentProps<\"nav\">) {\n const { text: adminText } = useAdminUI()\n\n return (\n <nav\n aria-label={adminText(\"breadcrumb\")}\n data-slot=\"breadcrumb\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"inline-flex items-center gap-1\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbLink({\n className,\n render,\n ...props\n}: useRender.ComponentProps<\"a\">) {\n return useRender({\n defaultTagName: \"a\",\n props: mergeProps<\"a\">(\n {\n className: cn(\"transition-colors hover:text-foreground\", className),\n },\n props\n ),\n render,\n state: {\n slot: \"breadcrumb-link\",\n },\n })\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n )\n}\n\nfunction BreadcrumbEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-ellipsis\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"flex size-5 items-center justify-center [&>svg]:size-4\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon />\n <span className=\"sr-only\">\n <AdminMessage id={\"More\"} />\n </span>\n </span>\n )\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport * as React from \"react\"\nimport { Link } from \"#orck/admin/router\"\n\nimport { NotificationBell } from \"#orck/admin/components/notification-bell\"\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"#orck/admin/components/ui/breadcrumb\"\nimport { Separator } from \"#orck/admin/components/ui/separator\"\nimport { SidebarTrigger } from \"#orck/admin/components/ui/sidebar\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\nimport { useMerchantConfig } from \"#orck/admin/lib/capabilities\"\n\nexport interface Crumb {\n label: string\n /** A link when the step is somewhere you can go; plain text otherwise. */\n to?: string\n}\n\nexport function SiteHeader({ trail }: { trail: Crumb[] }) {\n const { activeMerchant } = useAuth()\n // Findings belong to merchant configuration.\n const merchantConfig = useMerchantConfig()\n return (\n <header className=\"flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <SidebarTrigger className=\"-ml-1\" />\n <Separator orientation=\"vertical\" className=\"mr-2 h-4\" />\n <Breadcrumb>\n <BreadcrumbList>\n {trail.length === 0 ? (\n <BreadcrumbItem>\n <BreadcrumbPage>\n <AdminMessage id={\"Dashboard\"} />\n </BreadcrumbPage>\n </BreadcrumbItem>\n ) : (\n <>\n <BreadcrumbItem>\n <BreadcrumbLink\n render={\n <Link to=\"/\">\n <AdminMessage id={\"Dashboard\"} />\n </Link>\n }\n />\n </BreadcrumbItem>\n {trail.map((crumb, index) => (\n <React.Fragment key={crumb.label}>\n <BreadcrumbSeparator />\n <BreadcrumbItem>\n {crumb.to && index < trail.length - 1 ? (\n <BreadcrumbLink\n render={\n <Link to={crumb.to}>\n <AdminMessage id={crumb.label} />\n </Link>\n }\n />\n ) : (\n <BreadcrumbPage>\n <AdminMessage id={crumb.label} />\n </BreadcrumbPage>\n )}\n </BreadcrumbItem>\n </React.Fragment>\n ))}\n </>\n )}\n </BreadcrumbList>\n </Breadcrumb>\n <div className=\"ml-auto flex items-center gap-2\">\n {activeMerchant && merchantConfig && <NotificationBell />}\n </div>\n </header>\n )\n}\n","import { useQuery } from \"@tanstack/react-query\"\nimport { useAdminContext } from \"../context\"\nimport { AdminMessage } from \"../ui-context\"\nimport type { ReactNode } from \"react\"\nimport { useLocation } from \"#orck/admin/router\"\n\nimport { AppSidebar } from \"#orck/admin/components/app-sidebar\"\nimport { NoAccess } from \"#orck/admin/components/no-access\"\nimport { NoMerchants } from \"#orck/admin/components/no-merchants\"\nimport { SiteHeader } from \"#orck/admin/components/site-header\"\nimport {\n SidebarInset,\n SidebarProvider,\n} from \"#orck/admin/components/ui/sidebar\"\nimport { TooltipProvider } from \"#orck/admin/components/ui/tooltip\"\nimport type { AdminAccess } from \"#orck/client/generated/wire\"\nimport { useAuth } from \"#orck/admin/lib/auth\"\nimport { hasAnyArea } from \"#orck/admin/lib/capabilities\"\n\n// Longest path first: the catalog sub-pages have to match before the section\n// they live under. A trail of more than one entry becomes a real breadcrumb.\nconst trails: [string, { label: string; to?: string }[]][] = [\n [\"/customers\", [{ label: \"Customers\" }]],\n [\"/subscriptions\", [{ label: \"Subscriptions\" }]],\n [\"/payments\", [{ label: \"Payments\" }]],\n [\n \"/catalog/metering\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Metering\" }],\n ],\n [\n \"/catalog/prices\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Prices\" }],\n ],\n [\n \"/catalog/drift\",\n [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Drift\" }],\n ],\n [\"/catalog\", [{ label: \"Catalog\", to: \"/catalog\" }, { label: \"Products\" }]],\n [\"/ops\", [{ label: \"Ops\" }]],\n [\"/settings\", [{ label: \"Settings\" }]],\n]\n\n// areaOf is the console area a merchant page belongs to, and whether the\n// caller may use it; Settings belongs to none (its tabs check their own).\nfunction areaOf(\n pathname: string,\n access: AdminAccess\n): { name: string; allowed: boolean } | null {\n const under = (prefix: string) =>\n pathname === prefix || pathname.startsWith(prefix + \"/\")\n if (under(\"/payments/health\"))\n return { name: \"payment health\", allowed: access.metrics === true }\n if ([\"/customers\", \"/subscriptions\", \"/payments\", \"/orders\"].some(under))\n return {\n name: \"customer support\",\n allowed: access.admin === \"read\" || access.admin === \"update\",\n }\n if (under(\"/ops\") || under(\"/catalog/drift\"))\n return {\n name: \"merchant configuration\",\n allowed:\n access.merchant_config === \"read\" ||\n access.merchant_config === \"update\",\n }\n if (under(\"/catalog\"))\n return {\n name: \"the catalog\",\n allowed: access.catalog === \"read\" || access.catalog === \"update\",\n }\n return null\n}\n\nexport function AppLayout({ children }: { children: ReactNode }) {\n const { activeMerchant } = useAuth()\n const { pathname } = useLocation()\n const { props, services } = useAdminContext()\n const permission = useQuery(services.adminQueries.access())\n const access = permission.data\n const hostSettings =\n (props.settingsTabs?.length ?? 0) > 0 &&\n (pathname === \"/settings\" || pathname === \"/\")\n const trail =\n trails.find(([prefix]) => pathname.startsWith(prefix))?.[1] ?? []\n if (!activeMerchant) return <NoMerchants />\n if (permission.isPending)\n return (\n <p role=\"status\" className=\"p-6\">\n <AdminMessage id=\"Loading billing permissions…\" />\n </p>\n )\n if (permission.error)\n return (\n <div role=\"alert\" className=\"p-6\">\n <p>{permission.error.message}</p>\n <button type=\"button\" onClick={() => void permission.refetch()}>\n <AdminMessage id=\"Try again\" />\n </button>\n </div>\n )\n if (\n activeMerchant.id &&\n access?.scope_id &&\n activeMerchant.id !== access.scope_id\n )\n return (\n <p role=\"alert\" className=\"p-6\">\n <AdminMessage id=\"The authenticated connection is bound to another merchant. Update the host connection before opening this merchant.\" />\n </p>\n )\n return (\n <TooltipProvider>\n <SidebarProvider>\n <AppSidebar />\n <SidebarInset>\n <SiteHeader trail={trail} />\n {/* A switch remounts the merchant's pages: nothing of the\n previous merchant's survives it. */}\n <main\n key={activeMerchant?.id || activeMerchant?.slug || \"\"}\n className=\"flex min-w-0 flex-1 flex-col p-4 md:p-8\"\n >\n <div className=\"mx-auto w-full max-w-7xl min-w-0\">\n {access &&\n ((!hasAnyArea(access) && !hostSettings) ||\n areaOf(pathname, access)?.allowed === false) ? (\n <NoAccess area={areaOf(pathname, access)?.name} />\n ) : (\n children\n )}\n </div>\n </main>\n </SidebarInset>\n </SidebarProvider>\n </TooltipProvider>\n )\n}\n","import { useAdminContext } from \"#orck/admin/context\"\nimport * as React from \"react\"\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\"\n\nimport { cn } from \"#orck/admin/lib/utils\"\nimport { Button } from \"#orck/admin/components/ui/button\"\n\nfunction AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {\n return (\n <AlertDialogPrimitive.Portal\n container={useAdminContext().portal}\n data-slot=\"alert-dialog-portal\"\n {...props}\n />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: AlertDialogPrimitive.Backdrop.Props) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"fixed inset-0 isolate z-50 bg-black/10 duration-100 data-closed:animate-out data-closed:fade-out-0 data-open:animate-in data-open:fade-in-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Popup.Props & {\n size?: \"default\" | \"sm\"\n}) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n \"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n \"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogMedia({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n \"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\n \"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof Button>) {\n return (\n <Button\n data-slot=\"alert-dialog-action\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n variant = \"outline\",\n size = \"default\",\n ...props\n}: AlertDialogPrimitive.Close.Props &\n Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\">) {\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n className={cn(className)}\n render={<Button variant={variant} size={size} />}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n}\n","// Promise-based confirmation for the console's plain (non-typed) confirms:\n//\n// const confirm = useConfirm()\n// if (await confirm({ title, description, confirmLabel, tone })) …\n//\n// One dialog per ConfirmProvider; a newer request answers an older one false.\n// Destructive acts that need a typed word use TypedConfirmDialog instead.\nimport * as React from \"react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"#orck/admin/components/ui/alert-dialog\"\nimport {\n ConfirmContext,\n type Confirm,\n type ConfirmOptions,\n} from \"#orck/admin/lib/confirm\"\n\nexport function ConfirmProvider({ children }: { children: React.ReactNode }) {\n const [options, setOptions] = React.useState<ConfirmOptions | null>(null)\n const [open, setOpen] = React.useState(false)\n const pending = React.useRef<((answer: boolean) => void) | null>(null)\n\n const settle = React.useCallback((answer: boolean) => {\n pending.current?.(answer)\n pending.current = null\n setOpen(false)\n }, [])\n\n const confirm = React.useCallback<Confirm>(\n (next) =>\n new Promise<boolean>((resolve) => {\n pending.current?.(false)\n pending.current = resolve\n setOptions(next)\n setOpen(true)\n }),\n []\n )\n\n React.useEffect(() => () => pending.current?.(false), [])\n\n return (\n <ConfirmContext.Provider value={confirm}>\n {children}\n <AlertDialog\n open={open}\n onOpenChange={(next) => {\n if (!next) settle(false)\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{options?.title}</AlertDialogTitle>\n {options?.description ? (\n <AlertDialogDescription>\n {options.description}\n </AlertDialogDescription>\n ) : null}\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {options?.cancelLabel ?? \"Cancel\"}\n </AlertDialogCancel>\n <AlertDialogAction\n variant={\n options?.tone === \"destructive\" ? \"destructive\" : \"default\"\n }\n onClick={() => settle(true)}\n >\n {options?.confirmLabel ?? \"Confirm\"}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </ConfirmContext.Provider>\n )\n}\n","\"use client\"\n\nimport { useAdminContext } from \"#orck/admin/context\"\nimport { Toaster as Sonner, type ToasterProps } from \"sonner\"\nimport {\n CircleCheckIcon,\n InfoIcon,\n TriangleAlertIcon,\n OctagonXIcon,\n Loader2Icon,\n} from \"lucide-react\"\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const theme = useAdminContext().props.appearance?.theme ?? \"system\"\n\n return (\n <Sonner\n id={useAdminContext().services.namespace}\n theme={(theme === \"inherit\" ? \"system\" : theme) as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n icons={{\n success: <CircleCheckIcon className=\"size-4\" />,\n info: <InfoIcon className=\"size-4\" />,\n warning: <TriangleAlertIcon className=\"size-4\" />,\n error: <OctagonXIcon className=\"size-4\" />,\n loading: <Loader2Icon className=\"size-4 animate-spin\" />,\n }}\n style={\n {\n \"--normal-bg\": \"var(--popover)\",\n \"--normal-text\": \"var(--popover-foreground)\",\n \"--normal-border\": \"var(--border)\",\n \"--border-radius\": \"var(--radius)\",\n } as React.CSSProperties\n }\n toastOptions={{\n classNames: {\n toast: \"cn-toast\",\n },\n }}\n {...props}\n />\n )\n}\n\nexport { Toaster }\n","// A deploy rotates chunk hashes, so an open tab's lazy chunk is gone: only a\n// document reload fetches the new index.html.\nconst CHUNK_ERRORS = [\n /dynamically imported module/i,\n /failed to load module script/i,\n /importing a module script failed/i,\n /loading (css )?chunk \\S+ failed/i,\n /unable to preload css/i,\n]\n\nexport function isChunkLoadError(error: unknown): boolean {\n const e = error as { name?: string; message?: string } | null\n if (e?.name === \"ChunkLoadError\") return true\n return CHUNK_ERRORS.some((pattern) => pattern.test(e?.message ?? \"\"))\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\n// A page that failed to render or load. After a deploy the hashed chunk an\n// open tab asks for is gone; only a document reload fetches the new\n// index.html, so that case offers a reload instead of a broken page.\nimport { HugeiconsIcon } from \"@hugeicons/react\"\nimport { Refresh01Icon } from \"@hugeicons/core-free-icons\"\nimport { Link } from \"#orck/admin/router\"\n\nimport { Button } from \"#orck/admin/components/ui/button\"\nimport { isChunkLoadError } from \"#orck/admin/lib/chunk-error\"\n\nexport function RouteError({ error }: { error: unknown }) {\n const stale = isChunkLoadError(error)\n const message = error instanceof Error ? error.message : \"\"\n return (\n <div\n role=\"alert\"\n className=\"flex min-h-[50vh] flex-col items-center justify-center gap-4 p-6 text-center\"\n >\n <div className=\"max-w-md\">\n <p className=\"font-medium\">\n {stale\n ? \"The console has been updated. Reload to use the new version.\"\n : \"This page failed to load.\"}\n </p>\n {!stale && message ? (\n <p className=\"mt-1 text-sm break-words text-muted-foreground\">\n {message}\n </p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap items-center justify-center gap-3\">\n <Button onClick={() => window.location.reload()}>\n <HugeiconsIcon icon={Refresh01Icon} className=\"size-4\" />\n {stale ? \"Reload\" : \"Try again\"}\n </Button>\n {/* A document load, not client-side navigation: a stale chunk keeps\n failing until index.html is fetched again. */}\n <Link\n to=\"/\"\n className=\"text-sm text-muted-foreground underline underline-offset-4\"\n >\n <AdminMessage id={\"Console home\"} />\n </Link>\n </div>\n </div>\n )\n}\n","import { QueryCache, QueryClient } from \"@tanstack/react-query\"\n\nimport { ApiError } from \"#orck/admin/lib/api/client\"\nimport { createAdminToast, createToastHandlers } from \"#orck/admin/lib/toast\"\n\nexport function shouldRetry(failureCount: number, error: unknown): boolean {\n if (error instanceof ApiError && error.status < 500) return false\n return failureCount < 2\n}\n\nexport const createAdminQueryClient = (namespace?: string) => {\n const { toastApiError } = createToastHandlers(createAdminToast(namespace))\n return new QueryClient({\n queryCache: new QueryCache({\n onError: (error, query) => {\n const action = query.meta?.errorAction\n if (typeof action === \"string\") toastApiError(error, action)\n },\n }),\n defaultOptions: {\n queries: {\n staleTime: 20_000,\n gcTime: 5 * 60_000,\n retry: shouldRetry,\n },\n mutations: {\n retry: false,\n },\n },\n })\n}\n","import { useSyncExternalStore } from \"react\"\nimport type { BillingTheme } from \"../appearance\"\n\nconst media = () => window.matchMedia?.(\"(prefers-color-scheme: dark)\")\nconst subscribe = (notify: () => void) => {\n const query = media()\n query?.addEventListener(\"change\", notify)\n return () => query?.removeEventListener(\"change\", notify)\n}\nconst snapshot = () => (media()?.matches ? \"dark\" : \"light\")\nconst serverSnapshot = () => \"light\" as const\nconst unchanged = () => () => {}\n\nexport function useAdminTheme(theme: BillingTheme = \"inherit\") {\n const system = useSyncExternalStore(\n theme === \"auto\" ? subscribe : unchanged,\n snapshot,\n serverSnapshot\n )\n return theme === \"auto\" ? system : theme\n}\n","import { AdminUIContext } from \"./ui-context\"\nimport {\n Component,\n useId,\n useMemo,\n useRef,\n useCallback,\n useLayoutEffect,\n useState,\n type ReactNode,\n} from \"react\"\nimport { QueryClientProvider } from \"@tanstack/react-query\"\nimport { appearanceStyle } from \"../appearance\"\nimport { AdminContext, createAdminServices } from \"./context\"\nimport { AdminRouter, useLocation } from \"./router\"\nimport { AdminPages } from \"./routes\"\nimport { AppLayout } from \"./layouts/app-layout\"\nimport { ConfirmProvider } from \"./components/confirm\"\nimport { Toaster } from \"./components/ui/sonner\"\nimport { RouteError } from \"./components/route-error\"\nimport { createAdminQueryClient } from \"./lib/query-client\"\nimport type { BillingAdminMerchant, BillingAdminProps } from \"./types\"\nimport { useAdminTheme } from \"./theme\"\n\nconst merchantFrom = (\n merchant: string | BillingAdminMerchant\n): BillingAdminMerchant =>\n typeof merchant === \"string\" ? { id: merchant, slug: merchant } : merchant\n\n/** Staff billing pages inside the host's app, authentication, router, and theme. */\nexport function BillingAdmin(props: BillingAdminProps) {\n const [selected, setSelected] = useState<string>()\n const [connection, setConnection] = useState({\n auth: props.auth,\n baseUrl: props.baseUrl,\n generation: 0,\n })\n if (connection.auth !== props.auth || connection.baseUrl !== props.baseUrl)\n setConnection({\n auth: props.auth,\n baseUrl: props.baseUrl,\n generation: connection.generation + 1,\n })\n return (\n <BillingAdminInstance\n key={connection.generation}\n {...props}\n selected={selected}\n onSelected={setSelected}\n />\n )\n}\n\nfunction BillingAdminInstance({\n selected,\n onSelected,\n ...props\n}: BillingAdminProps & {\n selected?: string\n onSelected: (value: string) => void\n}) {\n const theme = useAdminTheme(props.appearance?.theme)\n const namespace = useId()\n const [portal, setPortal] = useState<HTMLDivElement | null>(null)\n const merchants = useMemo(\n () =>\n props.merchants ??\n (props.merchant\n ? [merchantFrom(props.merchant)]\n : [{ id: \"\", slug: \"\", display_name: \"Billing\" }]),\n [props.merchants, props.merchant]\n )\n const requested = props.merchant ? merchantFrom(props.merchant).id : selected\n const activeMerchant =\n merchants.find((m) => m.id === requested || m.slug === requested) ??\n merchants[0]\n const scope = `${props.baseUrl}:${activeMerchant?.id ?? \"\"}:${activeMerchant?.slug ?? \"\"}`\n const currentScope = useRef<string | undefined>(scope)\n useLayoutEffect(() => {\n currentScope.current = scope\n return () => {\n currentScope.current = undefined\n }\n }, [scope])\n const isCurrent = useCallback(() => currentScope.current === scope, [scope])\n const queryClient = useMemo(\n () => props.queryClient ?? createAdminQueryClient(namespace),\n [namespace, props.queryClient]\n )\n const services = useMemo(\n () =>\n // The factory captures this callback; only request-time checks read the ref.\n // eslint-disable-next-line react-hooks/refs\n createAdminServices({\n namespace,\n isCurrent,\n baseUrl: props.baseUrl,\n auth: props.auth,\n merchant: activeMerchant,\n exchange: props.exchange,\n }),\n [\n isCurrent,\n namespace,\n props.baseUrl,\n props.auth,\n props.exchange,\n activeMerchant,\n ]\n )\n const value = {\n props,\n services,\n merchants,\n activeMerchant,\n portal,\n selectMerchant(slug: string) {\n const merchant = merchants.find((m) => m.slug === slug || m.id === slug)\n if (!merchant) return\n onSelected(merchant.id)\n props.onMerchantChange?.(merchant)\n },\n }\n return (\n <div\n lang={props.language ?? \"en\"}\n className={[\"orba\", props.className].filter(Boolean).join(\" \")}\n data-orba-theme={theme}\n style={{ ...appearanceStyle(props.appearance, \"orba\"), ...props.style }}\n >\n <AdminUIContext.Provider value={{ namespace, messages: props.messages }}>\n <AdminContext.Provider value={value}>\n <QueryClientProvider client={queryClient}>\n <AdminRouter\n basePath={props.basePath}\n navigation={props.navigation}\n >\n <ConfirmProvider>\n <AppLayout>\n <PageBoundary>\n <AdminPages />\n </PageBoundary>\n </AppLayout>\n </ConfirmProvider>\n <Toaster />\n </AdminRouter>\n </QueryClientProvider>\n <div ref={setPortal} />\n </AdminContext.Provider>\n </AdminUIContext.Provider>\n </div>\n )\n}\n\nclass Boundary extends Component<{ children: ReactNode }, { error?: unknown }> {\n state: { error?: unknown } = {}\n static getDerivedStateFromError(error: unknown) {\n return { error }\n }\n render() {\n return this.state.error ? (\n <RouteError error={this.state.error} />\n ) : (\n this.props.children\n )\n }\n}\nfunction PageBoundary({ children }: { children: ReactNode }) {\n const location = useLocation()\n return <Boundary key={location.pathname}>{children}</Boundary>\n}\n","import { AdminMessage } from \"#orck/admin/ui-context\"\nimport { useCallback, useEffect, useMemo, useState } from \"react\"\nimport { appearanceStyle } from \"../appearance\"\nimport type { AdminAccess } from \"../client/generated/wire\"\nimport { createAdminClient } from \"./lib/api/client\"\nimport { createAdminAPI } from \"./lib/api\"\nimport { formatNativeAmount } from \"./lib/format\"\nimport type { BillingAdminProps } from \"./types\"\nimport { useAdminTheme } from \"./theme\"\n\ntype Connection = Pick<\n BillingAdminProps,\n \"baseUrl\" | \"auth\" | \"merchant\" | \"exchange\"\n>\n\nfunction useAPI(options: Connection) {\n const id =\n typeof options.merchant === \"string\"\n ? options.merchant\n : options.merchant?.id\n const slug =\n typeof options.merchant === \"string\"\n ? options.merchant\n : options.merchant?.slug\n return useMemo(\n () =>\n createAdminAPI(\n createAdminClient({\n baseUrl: options.baseUrl,\n auth: options.auth,\n exchange: options.exchange,\n merchant: id ? { id, slug: slug ?? id } : undefined,\n })\n ),\n [options.baseUrl, options.auth, options.exchange, id, slug]\n )\n}\n\nfunction useRead<T>(load: (signal: AbortSignal) => Promise<T>) {\n const [attempt, setAttempt] = useState(0)\n const [result, setResult] = useState<{\n load: typeof load\n attempt: number\n data?: T\n error?: Error\n }>()\n useEffect(() => {\n const abort = new AbortController()\n load(abort.signal).then(\n (data) => {\n if (!abort.signal.aborted) setResult({ load, attempt, data })\n },\n (error) => {\n if (!abort.signal.aborted)\n setResult({\n load,\n attempt,\n error: error instanceof Error ? error : new Error(String(error)),\n })\n }\n )\n return () => abort.abort()\n }, [load, attempt])\n const current =\n result?.load === load && result.attempt === attempt ? result : undefined\n return {\n data: current?.data,\n error: current?.error,\n isPending: !current,\n refetch: () => setAttempt((n) => n + 1),\n }\n}\n\n/** Reads tab permissions without requiring a BillingAdmin or QueryClient provider. */\nexport function useBillingAdminAccess(options: Connection) {\n const api = useAPI(options)\n return useRead<AdminAccess>(\n useCallback((signal) => api.getAdminAccess(signal), [api])\n )\n}\n\nexport interface BillingCustomerSummaryProps extends Connection {\n customer: string\n href?: string\n appearance?: BillingAdminProps[\"appearance\"]\n className?: string\n}\n\n/** A bounded preview for the host's customer or user page. */\nexport function BillingCustomerSummary(props: BillingCustomerSummaryProps) {\n const theme = useAdminTheme(props.appearance?.theme)\n const api = useAPI(props)\n const { data, error, isPending, refetch } = useRead(\n useCallback(\n async (signal: AbortSignal) => {\n const [customer, subscriptions, entitlements, access, payments] =\n await Promise.all([\n api.getCustomer(props.customer, signal),\n api.listSubscriptions(\n { customer_id: props.customer, status: \"active\" },\n 5,\n undefined,\n signal\n ),\n api.listCustomerEntitlements(props.customer, { limit: 5 }, signal),\n api.listCustomerProductAccess(props.customer, { limit: 5 }, signal),\n api.listPayments(\n { customer_id: props.customer },\n { limit: 5 },\n signal\n ),\n ])\n return { customer, subscriptions, entitlements, access, payments }\n },\n [api, props.customer]\n )\n )\n return (\n <section\n className={[\"orba\", props.className].filter(Boolean).join(\" \")}\n data-orba-theme={theme}\n style={appearanceStyle(props.appearance, \"orba\")}\n >\n <div className=\"rounded-lg border p-4\">\n <h3 className=\"font-semibold\">\n <AdminMessage id={\"Billing\"} />\n </h3>\n {isPending && (\n <p role=\"status\">\n <AdminMessage id={\"Loading billing…\"} />\n </p>\n )}\n {error && (\n <p role=\"alert\">\n {error.message}{\" \"}\n <button type=\"button\" onClick={refetch}>\n <AdminMessage id={\"Try again\"} />\n </button>\n </p>\n )}\n {data && (\n <>\n <dl>\n {data.customer.balances.map((balance) => (\n <div key={balance.currency}>\n <dt>\n <AdminMessage id={\"Available balance\"} />\n </dt>\n <dd>\n {formatNativeAmount(\n balance.available_amount,\n balance.currency\n )}\n </dd>\n </div>\n ))}\n </dl>\n <h4>\n <AdminMessage id={\"Active subscriptions\"} />\n </h4>\n {data.subscriptions.data.length ? (\n <ul>\n {data.subscriptions.data.map((subscription) => (\n <li key={subscription.id}>{subscription.id}</li>\n ))}\n </ul>\n ) : (\n <p>\n <AdminMessage id={\"No active subscriptions.\"} />\n </p>\n )}\n <h4>\n <AdminMessage id={\"Entitlements\"} />\n </h4>\n <ul>\n {data.entitlements.data.map((entitlement) => (\n <li key={entitlement.entitlement}>{entitlement.entitlement}</li>\n ))}\n </ul>\n <h4>\n <AdminMessage id={\"Product access\"} />\n </h4>\n <ul>\n {data.access.data.map((access) => (\n <li key={access.id}>\n {access.product_name} · {access.status}\n </li>\n ))}\n </ul>\n <h4>\n <AdminMessage id={\"Recent payments\"} />\n </h4>\n <ul>\n {data.payments.data.map((payment) => (\n <li key={payment.id}>\n {formatNativeAmount(payment.amount, payment.currency)} ·{\" \"}\n {payment.status}\n </li>\n ))}\n </ul>\n </>\n )}\n {props.href && (\n <a className=\"underline\" href={props.href}>\n <AdminMessage id={\"View billing details\"} />\n </a>\n )}\n </div>\n </section>\n )\n}\n\n/** A ban or account deletion never cancels the customer's subscriptions. */\nexport function billingConfirmWarnings(customer: {\n subscriptions: readonly { status: string }[]\n}): string[] {\n return customer.subscriptions.some(\n (subscription) => subscription.status !== \"canceled\"\n )\n ? [\n \"This customer has ongoing subscriptions. Banning or deleting the account does not cancel them; cancel them separately in billing.\",\n ]\n : []\n}\n\nconst permissionAreas: Record<string, string> = {\n \"customer:read\": \"Read customers, subscriptions, payments, and orders.\",\n \"customer:manage\":\n \"Change customer billing, including refunds, cancellations, and credits.\",\n \"catalog:manage\": \"Change products, prices, meters, and catalog migrations.\",\n \"catalog:read\": \"Read products, prices, meters, and catalog migrations.\",\n \"config:read\":\n \"Read merchant configuration, PSPs, findings, and notifications.\",\n \"config:manage\":\n \"Change merchant configuration, PSPs, findings, and notifications.\",\n \"metrics:read\": \"Read revenue metrics, reports, and dashboards.\",\n \"entitlements:read\":\n \"Read customer entitlements through the application API.\",\n \"usage:read\":\n \"Read usage, admissions, and running charges through the application API.\",\n \"usage:manage\": \"Admit and charge usage through the application API.\",\n \"events:read\":\n \"Read and acknowledge billing events through the application API.\",\n \"orders:manage\":\n \"Preview, create, and withdraw merchant orders through the application API.\",\n \"customers:read\":\n \"Find customers by their network account through the application API.\",\n}\n\n/** Descriptions for a host's role editor; permissions are enforced by the API. */\nexport const billingPermissionHelp: Readonly<Record<string, string>> =\n Object.fromEntries(\n [\"merchant\", \"root\"].flatMap((scope) =>\n Object.entries(permissionAreas).map(([permission, description]) => [\n `${scope}:${permission}`,\n `${description} ${scope === \"root\" ? \"Applies across merchants.\" : \"Applies within this merchant.\"}`,\n ])\n )\n )\n","/** English message keys. Override individual entries with BillingAdmin.messages. */\nexport const billingAdminMessages = {\n \" Edit widget\": \" Edit widget\",\n \" Price\": \" Price\",\n \" Product\": \" Product\",\n \" Product access\": \" Product access\",\n \" Refund\": \" Refund\",\n \" affected · requires human confirm\": \" affected · requires human confirm\",\n \" balance\": \" balance\",\n \" credentials · \": \" credentials · \",\n \" days away. Card networks require that much notice before a price goes up. You can change the number in Settings.\":\n \" days away. Card networks require that much notice before a price goes up. You can change the number in Settings.\",\n \" days. Pick a shorter range.\": \" days. Pick a shorter range.\",\n \" is not a supported currency.\": \" is not a supported currency.\",\n \" left alone because another change was already scheduled for them.\":\n \" left alone because another change was already scheduled for them.\",\n \" more\": \" more\",\n \" of\": \" of\",\n \" of 3:\": \" of 3:\",\n \" on \": \" on \",\n \" rail. Remaining refundable: \": \" rail. Remaining refundable: \",\n \" seats.\": \" seats.\",\n \" subscription\": \" subscription\",\n \" to\": \" to\",\n \" to \": \" to \",\n \" to confirm\": \" to confirm\",\n \" to this customer.\": \" to this customer.\",\n \" with this shape.\": \" with this shape.\",\n \" · due \": \" · due \",\n \" · exp \": \" · exp \",\n \" · last seen\": \" · last seen\",\n \" · owed\": \" · owed\",\n \" · since \": \" · since \",\n \" · theirs\": \" · theirs\",\n \" · txn\": \" · txn\",\n '\"Not sent to provider\" is fixed by publishing the catalog. Everything else is fixed under Settings, Payment providers.':\n '\"Not sent to provider\" is fixed by publishing the catalog. Everything else is fixed under Settings, Payment providers.',\n \", an edit set\": \", an edit set\",\n \", before another action.\": \", before another action.\",\n \". Active holds may prevent revocation. Payment refunds are managed separately.\":\n \". Active holds may prevent revocation. Payment refunds are managed separately.\",\n \". Currency and interval stay locked to the current price.\":\n \". Currency and interval stay locked to the current price.\",\n \"/app/usage-events\": \"/app/usage-events\",\n \"1 day\": \"1 day\",\n \"30 days\": \"30 days\",\n \"365 days\": \"365 days\",\n \"7 days\": \"7 days\",\n \": the batch says\": \": the batch says\",\n \": yours \": \": yours \",\n \"A collection of this order is in progress. It must finish, or be resolved with \":\n \"A collection of this order is in progress. It must finish, or be resolved with \",\n \"A price going down needs no notice, so today is fine.\":\n \"A price going down needs no notice, so today is fine.\",\n \"A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it.\":\n \"A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it.\",\n \"A reprice_scheduled notice is queued for every affected subscriber as soon as you confirm.\":\n \"A reprice_scheduled notice is queued for every affected subscriber as soon as you confirm.\",\n \"Access duration\": \"Access duration\",\n \"Access, not paying\": \"Access, not paying\",\n \"Account ID\": \"Account ID\",\n \"Accrual cap\": \"Accrual cap\",\n \"Accrue from another meter\": \"Accrue from another meter\",\n Action: \"Action\",\n Active: \"Active\",\n \"Active subscriptions\": \"Active subscriptions\",\n Activity: \"Activity\",\n \"Add PSP\": \"Add PSP\",\n \"Add a PSP\": \"Add a PSP\",\n \"Add cell\": \"Add cell\",\n \"Add contact\": \"Add contact\",\n \"Add credit in \": \"Add credit in \",\n \"Add dimension\": \"Add dimension\",\n \"Add filter\": \"Add filter\",\n \"Add tax detail\": \"Add tax detail\",\n \"Add tier\": \"Add tier\",\n Aggregation: \"Aggregation\",\n \"Alert email\": \"Alert email\",\n All: \"All\",\n \"All PSPs\": \"All PSPs\",\n \"All origins\": \"All origins\",\n \"All owners\": \"All owners\",\n \"All rails\": \"All rails\",\n \"All statuses\": \"All statuses\",\n Allowance: \"Allowance\",\n \"Also revoke access immediately\": \"Also revoke access immediately\",\n \"Also revoke granted access\": \"Also revoke granted access\",\n Amount: \"Amount\",\n \"Amount (\": \"Amount (\",\n \"Apply catalog\": \"Apply catalog\",\n \"Apply catalog changes\": \"Apply catalog changes\",\n \"Apply filters\": \"Apply filters\",\n \"Apply reviewed batch\": \"Apply reviewed batch\",\n Archive: \"Archive\",\n Ask: \"Ask\",\n \"Ask an administrator for a role that includes it.\":\n \"Ask an administrator for a role that includes it.\",\n \"Attempt not found.\": \"Attempt not found.\",\n Attempted: \"Attempted\",\n Attempts: \"Attempts\",\n \"Available balance\": \"Available balance\",\n Back: \"Back\",\n \"Back to metering\": \"Back to metering\",\n Balance: \"Balance\",\n \"Batch receipt\": \"Batch receipt\",\n Billing: \"Billing\",\n \"Billing contacts\": \"Billing contacts\",\n \"Billing interval\": \"Billing interval\",\n \"Billing support\": \"Billing support\",\n \"Billing URL\": \"Billing URL\",\n \"Can this be bought?\": \"Can this be bought?\",\n Cancel: \"Cancel\",\n \"Cancel subscription\": \"Cancel subscription\",\n \"Cancel this migration?\": \"Cancel this migration?\",\n Canceled: \"Canceled\",\n Card: \"Card\",\n \"Card verifications\": \"Card verifications\",\n Catalog: \"Catalog\",\n \"Catalog document\": \"Catalog document\",\n \"Catalog updates are disabled. Meter definitions and rates are visible here; changes require the host operator.\":\n \"Catalog updates are disabled. Meter definitions and rates are visible here; changes require the host operator.\",\n \"Catalog updates are disabled. The console is read-only.\":\n \"Catalog updates are disabled. The console is read-only.\",\n \"Catalog updates are unavailable. You can still browse products and prices.\":\n \"Catalog updates are unavailable. You can still browse products and prices.\",\n \"Category / reason\": \"Category / reason\",\n \"Schedule the customer's plan or seats for the next renewal. No card is charged now. Choosing the current plan and seats clears a pending change. The customer is told.\":\n \"Schedule the customer's plan or seats for the next renewal. No card is charged now. Choosing the current plan and seats clears a pending change. The customer is told.\",\n \"Change payment method\": \"Change payment method\",\n \"Change price\": \"Change price\",\n \"Change price for \": \"Change price for \",\n \"Change subscription\": \"Change subscription\",\n \"Change the title, chart type or date range behavior. The query stays the same.\":\n \"Change the title, chart type or date range behavior. The query stays the same.\",\n Channel: \"Channel\",\n \"Charged twice\": \"Charged twice\",\n \"Chart type\": \"Chart type\",\n \"Checking your catalog…\": \"Checking your catalog…\",\n \"Choose a method\": \"Choose a method\",\n Churn: \"Churn\",\n \"Clear all\": \"Clear all\",\n \"Clear customer filter\": \"Clear customer filter\",\n \"Clear filters\": \"Clear filters\",\n Close: \"Close\",\n Code: \"Code\",\n Collected: \"Collected\",\n \"Collection method\": \"Collection method\",\n \"Collection:\": \"Collection:\",\n \"Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again.\":\n \"Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again.\",\n \"Console home\": \"Console home\",\n Contact: \"Contact\",\n \"Continue with payment provider\": \"Continue with payment provider\",\n \"Could not load the available plans.\": \"Could not load the available plans.\",\n \"Count events\": \"Count events\",\n \"Count uses one unit for every matching event.\":\n \"Count uses one unit for every matching event.\",\n Coverage: \"Coverage\",\n \"Create a meter to describe the events your application will report and bill.\":\n \"Create a meter to describe the events your application will report and bill.\",\n \"Create or activate a product first\": \"Create or activate a product first\",\n Created: \"Created\",\n \"Creating this meter does not send events. The host application must report idempotent usage to\":\n \"Creating this meter does not send events. The host application must report idempotent usage to\",\n Credentials: \"Credentials\",\n \"Credit and trust\": \"Credit and trust\",\n \"Credit grants\": \"Credit grants\",\n \"Credit limit\": \"Credit limit\",\n \"Credit transaction ledger\": \"Credit transaction ledger\",\n Credits: \"Credits\",\n Currency: \"Currency\",\n \"Currency · interval\": \"Currency · interval\",\n \"Current amount\": \"Current amount\",\n \"Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now.\":\n \"Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now.\",\n \"Current period\": \"Current period\",\n \"Custom range\": \"Custom range\",\n Customer: \"Customer\",\n \"Customer ID\": \"Customer ID\",\n \"Customer UUID\": \"Customer UUID\",\n \"Customer controls\": \"Customer controls\",\n \"Customer lookup\": \"Customer lookup\",\n \"Customer not found.\": \"Customer not found.\",\n \"Customer-facing merchant details used on invoices and emails.\":\n \"Customer-facing merchant details used on invoices and emails.\",\n Customers: \"Customers\",\n Cycles: \"Cycles\",\n \"Daily subscriptions\": \"Daily subscriptions\",\n Dashboard: \"Dashboard\",\n Date: \"Date\",\n \"Date range\": \"Date range\",\n \"Days are added after any access they already have.\":\n \"Days are added after any access they already have.\",\n \"Decline reasons\": \"Decline reasons\",\n Declined: \"Declined\",\n Declines: \"Declines\",\n \"Default price\": \"Default price\",\n \"Default rate\": \"Default rate\",\n \"Default · \": \"Default · \",\n \"Define the event fields OpenRails will aggregate. Your host still reports each event through the usage API.\":\n \"Define the event fields OpenRails will aggregate. Your host still reports each event through the usage API.\",\n \"Define usage streams and the default rates charged when usage is recorded. Applications report the events separately.\":\n \"Define usage streams and the default rates charged when usage is recorded. Applications report the events separately.\",\n \"Delete webhook\": \"Delete webhook\",\n Description: \"Description\",\n \"Description (optional)\": \"Description (optional)\",\n Detected: \"Detected\",\n Dimension: \"Dimension\",\n Dimensions: \"Dimensions\",\n Directory: \"Directory\",\n Discord: \"Discord\",\n \"Dismiss answer\": \"Dismiss answer\",\n \"Display name\": \"Display name\",\n \"Displays the mobile sidebar.\": \"Displays the mobile sidebar.\",\n Divisor: \"Divisor\",\n Down: \"Down\",\n \"Download CSV\": \"Download CSV\",\n \"Draft: new price\": \"Draft: new price\",\n \"Draft: price change\": \"Draft: price change\",\n Drift: \"Drift\",\n Due: \"Due\",\n \"Due now\": \"Due now\",\n \"Due: \": \"Due: \",\n Dunning: \"Dunning\",\n \"Dunning recovery by days since the first failure\":\n \"Dunning recovery by days since the first failure\",\n \"Dunning recovery by retry (share of failed cycles)\":\n \"Dunning recovery by retry (share of failed cycles)\",\n \"Dunning recovery rate\": \"Dunning recovery rate\",\n Edit: \"Edit\",\n \"Edit batch\": \"Edit batch\",\n \"Edit definition\": \"Edit definition\",\n \"Edit widget\": \"Edit widget\",\n Effective: \"Effective\",\n \"Effective date\": \"Effective date\",\n Email: \"Email\",\n \"Email delivery\": \"Email delivery\",\n Enabled: \"Enabled\",\n End: \"End\",\n \"Enter 0 to turn credit off.\": \"Enter 0 to turn credit off.\",\n Entitlements: \"Entitlements\",\n Environment: \"Environment\",\n Event: \"Event\",\n \"Event contract\": \"Event contract\",\n \"Event filters\": \"Event filters\",\n \"Event type\": \"Event type\",\n \"Executes the refund at the \": \"Executes the refund at the \",\n \"Existing subscribers keep the current price.\":\n \"Existing subscribers keep the current price.\",\n Expired: \"Expired\",\n Expires: \"Expires\",\n \"Expires (optional)\": \"Expires (optional)\",\n Failure: \"Failure\",\n Field: \"Field\",\n Filter: \"Filter\",\n \"Filter meters on this page\": \"Filter meters on this page\",\n \"Filter this page…\": \"Filter this page…\",\n \"Find a customer by ID and currency.\": \"Find a customer by ID and currency.\",\n \"First outcome\": \"First outcome\",\n \"First page\": \"First page\",\n \"Fixed included units\": \"Fixed included units\",\n \"Flat amount\": \"Flat amount\",\n Format: \"Format\",\n \"Free units\": \"Free units\",\n \"From email\": \"From email\",\n \"Generic (your own receiver)\": \"Generic (your own receiver)\",\n \"Give this customer one of your products without a payment. They hold its keys while the grant lasts, including keys you add to the product later.\":\n \"Give this customer one of your products without a payment. They hold its keys while the grant lasts, including keys you add to the product later.\",\n Graduated: \"Graduated\",\n \"Grandfather.\": \"Grandfather.\",\n Grant: \"Grant\",\n \"Grant credit\": \"Grant credit\",\n \"Grant product access\": \"Grant product access\",\n \"Grants · \": \"Grants · \",\n Health: \"Health\",\n \"How long it lasts\": \"How long it lasts\",\n \"Human-readable quantity shown in billing.\":\n \"Human-readable quantity shown in billing.\",\n Ignore: \"Ignore\",\n Included: \"Included\",\n \"Included units\": \"Included units\",\n \"Included units per period\": \"Included units per period\",\n \"Included usage\": \"Included usage\",\n \"Invoice memo\": \"Invoice memo\",\n \"Invoice profile\": \"Invoice profile\",\n \"Invoice profile saved. Billed orders were not changed.\":\n \"Invoice profile saved. Billed orders were not changed.\",\n \"Keep it\": \"Keep it\",\n \"Keep its own range\": \"Keep its own range\",\n \"Kept with the scheduled change.\": \"Kept with the scheduled change.\",\n Key: \"Key\",\n Kind: \"Kind\",\n \"Kind / reason\": \"Kind / reason\",\n \"Last 3 months\": \"Last 3 months\",\n \"Last 30 days\": \"Last 30 days\",\n \"Last 6 months\": \"Last 6 months\",\n \"Last 7 days\": \"Last 7 days\",\n \"Last 90 days\": \"Last 90 days\",\n \"Last active\": \"Last active\",\n \"Last day (UTC)\": \"Last day (UTC)\",\n \"Last decline\": \"Last decline\",\n \"Last event\": \"Last event\",\n \"Last failure: \": \"Last failure: \",\n \"Last seen\": \"Last seen\",\n \"Last validated \": \"Last validated \",\n \"Last year\": \"Last year\",\n \"Leave blank to use the meter key.\": \"Leave blank to use the meter key.\",\n \"Leave the final limit blank for the unbounded tier.\":\n \"Leave the final limit blank for the unbounded tier.\",\n Lines: \"Lines\",\n \"Loading billing permissions…\": \"Loading billing permissions…\",\n \"Loading billing…\": \"Loading billing…\",\n \"Loading grants…\": \"Loading grants…\",\n \"Loading invoice profile…\": \"Loading invoice profile…\",\n \"Loading order…\": \"Loading order…\",\n \"Loading products…\": \"Loading products…\",\n \"Loading transactions…\": \"Loading transactions…\",\n \"Loading…\": \"Loading…\",\n \"Logo URL\": \"Logo URL\",\n \"Manual remittance\": \"Manual remittance\",\n \"Matrix cells\": \"Matrix cells\",\n Maximum: \"Maximum\",\n \"Memo: \": \"Memo: \",\n Merchant: \"Merchant\",\n \"Merchant profile\": \"Merchant profile\",\n Merchants: \"Merchants\",\n Meter: \"Meter\",\n \"Meter key\": \"Meter key\",\n Metering: \"Metering\",\n \"Metering access is restricted\": \"Metering access is restricted\",\n \"Metering could not be loaded\": \"Metering could not be loaded\",\n Method: \"Method\",\n \"Migrate.\": \"Migrate.\",\n \"Missed rebills\": \"Missed rebills\",\n Model: \"Model\",\n \"Money for this price would go to\": \"Money for this price would go to\",\n Month: \"Month\",\n \"Monthly renewals\": \"Monthly renewals\",\n More: \"More\",\n \"Move everyone to the new price at their first renewal on or after a date you choose.\":\n \"Move everyone to the new price at their first renewal on or after a date you choose.\",\n \"Must be at least \": \"Must be at least \",\n \"NMI history (before OpenRails recorded attempts)\":\n \"NMI history (before OpenRails recorded attempts)\",\n \"NMI's own transaction history, read daily and kept 25 months. It counts every sender, OpenRails too once it started. One-off sales mix initial sales, upgrades and retries of declined rebills: the history cannot tell them apart. Scheduled rebills are NMI's own charges, each the first try of its period. Rates count authorizations, not buyers.\":\n \"NMI's own transaction history, read daily and kept 25 months. It counts every sender, OpenRails too once it started. One-off sales mix initial sales, upgrades and retries of declined rebills: the history cannot tell them apart. Scheduled rebills are NMI's own charges, each the first try of its period. Rates count authorizations, not buyers.\",\n \"NMI-owned\": \"NMI-owned\",\n \"NMI-scheduled rebills\": \"NMI-scheduled rebills\",\n Name: \"Name\",\n \"Name, such as tax_id\": \"Name, such as tax_id\",\n Nearest: \"Nearest\",\n \"Needs attention\": \"Needs attention\",\n \"Needs card\": \"Needs card\",\n \"Net change\": \"Net change\",\n \"Never expires\": \"Never expires\",\n New: \"New\",\n \"New amount (major units)\": \"New amount (major units)\",\n \"New batch\": \"New batch\",\n \"New cards by AVS result\": \"New cards by AVS result\",\n \"New cards by CVV result\": \"New cards by CVV result\",\n \"New purchase on this rail is refused until another PSP is armed. Existing subscriptions, refunds and webhooks keep using this one.\":\n \"New purchase on this rail is refused until another PSP is armed. Existing subscriptions, refunds and webhooks keep using this one.\",\n \"New merchant\": \"New merchant\",\n \"New plan\": \"New plan\",\n \"New price\": \"New price\",\n \"New-card purchase failure rate\": \"New-card purchase failure rate\",\n \"New-card decline rate\": \"New-card decline rate\",\n \"New-card decline rate by week\": \"New-card decline rate by week\",\n Next: \"Next\",\n \"Next attempt: \": \"Next attempt: \",\n \"Next billing date\": \"Next billing date\",\n \"Next charge\": \"Next charge\",\n \"Next page\": \"Next page\",\n \"No NMI history yet: it is read daily.\":\n \"No NMI history yet: it is read daily.\",\n \"No PSPs configured.\": \"No PSPs configured.\",\n \"No actions are available for your permissions and this order's state.\":\n \"No actions are available for your permissions and this order's state.\",\n \"No active products are available.\": \"No active products are available.\",\n \"No active subscriptions.\": \"No active subscriptions.\",\n \"No allowance\": \"No allowance\",\n \"No credit grants in this currency.\": \"No credit grants in this currency.\",\n \"No declines in this range.\": \"No declines in this range.\",\n \"No default rate. Usage is recorded but is not billed by this meter.\":\n \"No default rate. Usage is recorded but is not billed by this meter.\",\n \"No eligible recurring plans share this tier group and currency.\":\n \"No eligible recurring plans share this tier group and currency.\",\n \"No entitlements.\": \"No entitlements.\",\n \"No history yet.\": \"No history yet.\",\n \"No lines.\": \"No lines.\",\n \"No maximum\": \"No maximum\",\n \"No meters on this page match “\": \"No meters on this page match “\",\n \"No missed rebills in this range.\": \"No missed rebills in this range.\",\n \"No open drift events. Catalog is in sync.\":\n \"No open drift events. Catalog is in sync.\",\n \"No payment methods on file.\": \"No payment methods on file.\",\n \"No payments recorded.\": \"No payments recorded.\",\n \"No payments.\": \"No payments.\",\n \"No prices yet.\": \"No prices yet.\",\n \"No product access.\": \"No product access.\",\n \"No products yet.\": \"No products yet.\",\n \"No provider can take this payment, so nobody can buy this price yet.\":\n \"No provider can take this payment, so nobody can buy this price yet.\",\n \"No provider-scheduled charges in this range.\":\n \"No provider-scheduled charges in this range.\",\n \"No recovered cycles.\": \"No recovered cycles.\",\n \"No refunds.\": \"No refunds.\",\n \"No refusals in NMI's history.\": \"No refusals in NMI's history.\",\n \"No saved payment methods. Add one on the customer page before retrying collection.\":\n \"No saved payment methods. Add one on the customer page before retrying collection.\",\n \"No subscriptions.\": \"No subscriptions.\",\n \"No transactions in this currency.\": \"No transactions in this currency.\",\n \"No usage meters yet\": \"No usage meters yet\",\n \"No webhooks configured.\": \"No webhooks configured.\",\n \"No widgets yet\": \"No widgets yet\",\n \"None required\": \"None required\",\n Note: \"Note\",\n \"Notes \": \"Notes \",\n \"Nothing here can be fixed automatically. You can only note why you are leaving it.\":\n \"Nothing here can be fixed automatically. You can only note why you are leaving it.\",\n \"Nothing in this range. Pick a wider range.\":\n \"Nothing in this range. Pick a wider range.\",\n \"Nothing is claimed about the providers' copies until you press Verify.\":\n \"Nothing is claimed about the providers' copies until you press Verify.\",\n \"Nothing needs attention right now.\": \"Nothing needs attention right now.\",\n \"Notice period\": \"Notice period\",\n \"Notice period (days)\": \"Notice period (days)\",\n Notifications: \"Notifications\",\n \"Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active.\":\n \"Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active.\",\n \"One-off sales\": \"One-off sales\",\n \"One-time payment.\": \"One-time payment.\",\n Open: \"Open\",\n \"Open issues\": \"Open issues\",\n \"Open matching list\": \"Open matching list\",\n OpenRails: \"OpenRails\",\n \"OpenRails starts\": \"OpenRails starts\",\n \"OpenRails-owned\": \"OpenRails-owned\",\n \"Operational notifications will stop delivering to this webhook. This cannot be undone.\":\n \"Operational notifications will stop delivering to this webhook. This cannot be undone.\",\n Ops: \"Ops\",\n \"Optional. Only events with one of the listed dimension values are rated.\":\n \"Optional. Only events with one of the listed dimension values are rated.\",\n Order: \"Order\",\n \"Order not found.\": \"Order not found.\",\n Orders: \"Orders\",\n Origin: \"Origin\",\n Original: \"Original\",\n Outcome: \"Outcome\",\n \"Overdue only: still owed past the due date\":\n \"Overdue only: still owed past the due date\",\n \"Overdue usage orders\": \"Overdue usage orders\",\n Overview: \"Overview\",\n \"Overwrite edits\": \"Overwrite edits\",\n Owner: \"Owner\",\n PSP: \"PSP\",\n \"PSP answer\": \"PSP answer\",\n PSPs: \"PSPs\",\n Package: \"Package\",\n \"Package price\": \"Package price\",\n Paid: \"Paid\",\n \"Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set.\":\n \"Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set.\",\n Paying: \"Paying\",\n \"Paying, no access\": \"Paying, no access\",\n Payment: \"Payment\",\n \"Payment attempts\": \"Payment attempts\",\n \"Payment health\": \"Payment health\",\n \"Payment history\": \"Payment history\",\n \"Payment method\": \"Payment method\",\n \"Payment methods\": \"Payment methods\",\n \"Payment not found.\": \"Payment not found.\",\n \"Payment providers\": \"Payment providers\",\n \"Payment rail\": \"Payment rail\",\n \"Payment reference\": \"Payment reference\",\n \"Payment terms (days)\": \"Payment terms (days)\",\n Payments: \"Payments\",\n Pending: \"Pending\",\n \"Per unit\": \"Per unit\",\n \"Period ends\": \"Period ends\",\n \"Period maximum\": \"Period maximum\",\n \"Period: \": \"Period: \",\n \"Pick a later date.\": \"Pick a later date.\",\n \"Pick a product\": \"Pick a product\",\n \"Pick a product…\": \"Pick a product…\",\n \"Pick a rail…\": \"Pick a rail…\",\n \"Pick an environment…\": \"Pick an environment…\",\n \"Live: real money\": \"Live: real money\",\n \"Test: the provider's own system, no money moves\":\n \"Test: the provider's own system, no money moves\",\n \"Sandbox: the provider's separate sandbox\":\n \"Sandbox: the provider's separate sandbox\",\n \"Pick a stored payment method\": \"Pick a stored payment method\",\n \"Pinned to an archived (prior) version\":\n \"Pinned to an archived (prior) version\",\n \"Points future renewals of this subscription at another of the customer's stored cards (same rail), or back at their default card for its currency.\":\n \"Points future renewals of this subscription at another of the customer's stored cards (same rail), or back at their default card for its currency.\",\n Preview: \"Preview\",\n \"Previous page\": \"Previous page\",\n \"Previous period\": \"Previous period\",\n Price: \"Price\",\n \"Price each value of one registered dimension separately.\":\n \"Price each value of one registered dimension separately.\",\n \"Price history\": \"Price history\",\n \"Price per divisor\": \"Price per divisor\",\n Prices: \"Prices\",\n \"Pricing model\": \"Pricing model\",\n \"Pricing policies\": \"Pricing policies\",\n Product: \"Product\",\n \"Product access\": \"Product access\",\n \"Product and model\": \"Product and model\",\n Products: \"Products\",\n Provider: \"Provider\",\n \"Provider charges seen by webhook\": \"Provider charges seen by webhook\",\n \"Provider-owned\": \"Provider-owned\",\n Providers: \"Providers\",\n Pull: \"Pull\",\n \"Purchase order\": \"Purchase order\",\n \"Purchase order: \": \"Purchase order: \",\n Purchased: \"Purchased\",\n \"Purchases, subscription renewals and usage billed in arrears: what each owes and how it was paid.\":\n \"Purchases, subscription renewals and usage billed in arrears: what each owes and how it was paid.\",\n Quantity: \"Quantity\",\n Rail: \"Rail\",\n Range: \"Range\",\n Rate: \"Rate\",\n \"Rate preview\": \"Rate preview\",\n \"Read-only: this merchant's configuration comes from a file. Change it there.\":\n \"Read-only: this merchant's configuration comes from a file. Change it there.\",\n Reason: \"Reason\",\n \"Reason (optional)\": \"Reason (optional)\",\n \"Rebill collection rate\": \"Rebill collection rate\",\n \"Rebill first-attempt failure rate\": \"Rebill first-attempt failure rate\",\n \"Rebill first-attempt failure rate by week\":\n \"Rebill first-attempt failure rate by week\",\n \"Recent payments\": \"Recent payments\",\n \"Recently canceled\": \"Recently canceled\",\n Recommendation: \"Recommendation\",\n \"Recommended: \": \"Recommended: \",\n \"Recovered by\": \"Recovered by\",\n \"Recurring billing\": \"Recurring billing\",\n Reference: \"Reference\",\n Refresh: \"Refresh\",\n \"Refresh payment methods\": \"Refresh payment methods\",\n \"Refresh scan\": \"Refresh scan\",\n \"Refresh widget\": \"Refresh widget\",\n Refund: \"Refund\",\n \"Refund payment\": \"Refund payment\",\n Refunded: \"Refunded\",\n Refunds: \"Refunds\",\n \"Refusal rate by month\": \"Refusal rate by month\",\n Refused: \"Refused\",\n \"Register event properties used by filters or matrix rates.\":\n \"Register event properties used by filters or matrix rates.\",\n Remaining: \"Remaining\",\n Remote: \"Remote\",\n Remove: \"Remove\",\n \"Remove the default rate?\": \"Remove the default rate?\",\n Renewal: \"Renewal\",\n \"Renewal not found.\": \"Renewal not found.\",\n \"Renewal payments, cancellations and churn each calendar month (UTC); churn is the month's cancellations over the subscriptions it began with.\":\n \"Renewal payments, cancellations and churn each calendar month (UTC); churn is the month's cancellations over the subscriptions it began with.\",\n Renewals: \"Renewals\",\n \"Renewing soon\": \"Renewing soon\",\n Renews: \"Renews\",\n \"Replace the default rate?\": \"Replace the default rate?\",\n Reports: \"Reports\",\n Reset: \"Reset\",\n Resolve: \"Resolve\",\n \"Resolve finding\": \"Resolve finding\",\n Resource: \"Resource\",\n Result: \"Result\",\n Retry: \"Retry\",\n Reverses: \"Reverses\",\n Review: \"Review\",\n \"Review batch\": \"Review batch\",\n \"Review complete. Applying sends this exact document; this is not a database diff.\":\n \"Review complete. Applying sends this exact document; this is not a database diff.\",\n Revoke: \"Revoke\",\n \"Revoke product access\": \"Revoke product access\",\n \"Revoke remaining credit\": \"Revoke remaining credit\",\n \"Revoke the unspent remainder of\": \"Revoke the unspent remainder of\",\n Revoked: \"Revoked\",\n Rotate: \"Rotate\",\n \"Rotate \": \"Rotate \",\n Rounding: \"Rounding\",\n \"Rows per page\": \"Rows per page\",\n \"Save changes\": \"Save changes\",\n \"Saved payment method\": \"Saved payment method\",\n \"Search customer email, ref, or id…\": \"Search customer email, ref, or id…\",\n \"Search email, username, name or id…\": \"Search email, username, name or id…\",\n Seats: \"Seats\",\n \"Select a merchant to view its billing.\":\n \"Select a merchant to view its billing.\",\n \"Select dimension\": \"Select dimension\",\n \"Select product\": \"Select product\",\n \"Send alerts to Discord, Slack, or your own endpoint.\":\n \"Send alerts to Discord, Slack, or your own endpoint.\",\n \"Send email alerts to this address.\": \"Send email alerts to this address.\",\n Sent: \"Sent\",\n \"Set how much notice customers receive before a price increase.\":\n \"Set how much notice customers receive before a price increase.\",\n \"Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.\":\n \"Set the price that charges every customer's usage as it is recorded. Money is entered in major currency units.\",\n Settings: \"Settings\",\n Severity: \"Severity\",\n Share: \"Share\",\n Sidebar: \"Sidebar\",\n Since: \"Since\",\n \"Skipped objects\": \"Skipped objects\",\n Slack: \"Slack\",\n Source: \"Source\",\n \"Source meter\": \"Source meter\",\n Spent: \"Spent\",\n \"Stable identifier. It cannot be renamed after creation.\":\n \"Stable identifier. It cannot be renamed after creation.\",\n Start: \"Start\",\n Started: \"Started\",\n State: \"State\",\n Status: \"Status\",\n \"Status: \": \"Status: \",\n \"Step \": \"Step \",\n \"Still matches\": \"Still matches\",\n Subject: \"Subject\",\n Subscription: \"Subscription\",\n \"Subscription not found.\": \"Subscription not found.\",\n \"Subscription:\": \"Subscription:\",\n Subscriptions: \"Subscriptions\",\n \"Subscriptions started and canceled each day (UTC), newest first.\":\n \"Subscriptions started and canceled each day (UTC), newest first.\",\n \"Sum a numeric field\": \"Sum a numeric field\",\n \"Subscribe URL\": \"Subscribe URL\",\n \"Support URL\": \"Support URL\",\n Synced: \"Synced\",\n \"Take the product back\": \"Take the product back\",\n \"Tax details\": \"Tax details\",\n \"Terminal cancellation at the payment rail. This is a last resort. Dunning parks subscriptions as past_due without losing entitlements.\":\n \"Terminal cancellation at the payment rail. This is a last resort. Dunning parks subscriptions as past_due without losing entitlements.\",\n \"Terms and billing facts for future usage orders. Billed orders keep their original snapshots. Tax details are recorded; no tax is calculated.\":\n \"Terms and billing facts for future usage orders. Billed orders keep their original snapshots. Tax details are recorded; no tax is calculated.\",\n \"The accounts this merchant takes payments through, one or more per rail.\":\n \"The accounts this merchant takes payments through, one or more per rail.\",\n \"The customer loses its entitlements now. The grant stays on record with your reason.\":\n \"The customer loses its entitlements now. The grant stays on record with your reason.\",\n \"The customer's default card\": \"The customer's default card\",\n \"The daily report covers at most \": \"The daily report covers at most \",\n \"The keys of the products this customer holds now.\":\n \"The keys of the products this customer holds now.\",\n \"The payment provider calculates the final prorated amount.\":\n \"The payment provider calculates the final prorated amount.\",\n \"Their reference\": \"Their reference\",\n \"There were no providers to consider.\":\n \"There were no providers to consider.\",\n \"These are the customer's invoice profile when the order was billed. Editing the profile affects later orders.\":\n \"These are the customer's invoice profile when the order was billed. Editing the profile affects later orders.\",\n \"These terms cannot be changed later. To charge a different amount, create another price and deactivate this one.\":\n \"These terms cannot be changed later. To charge a different amount, create another price and deactivate this one.\",\n \"This billing page does not exist.\": \"This billing page does not exist.\",\n \"This is a price\": \"This is a price\",\n \"This meter uses an aggregation that the billing engine cannot rate.\":\n \"This meter uses an aggregation that the billing engine cannot rate.\",\n \"This price has not been sent to any provider, so nobody can be charged for it yet.\":\n \"This price has not been sent to any provider, so nobody can be charged for it yet.\",\n Tier: \"Tier\",\n \"Tier group\": \"Tier group\",\n \"Tier mode\": \"Tier mode\",\n \"Tier rank\": \"Tier rank\",\n Tiered: \"Tiered\",\n Tiers: \"Tiers\",\n Title: \"Title\",\n \"Toggle Sidebar\": \"Toggle Sidebar\",\n \"Top refusal reasons\": \"Top refusal reasons\",\n Total: \"Total\",\n \"Transaction ledger · \": \"Transaction ledger · \",\n \"Trust level\": \"Trust level\",\n \"Try again\": \"Try again\",\n \"Try again. If the problem continues, check the OpenRails API logs.\":\n \"Try again. If the problem continues, check the OpenRails API logs.\",\n Type: \"Type\",\n \"Type \": \"Type \",\n USD: \"USD\",\n Unit: \"Unit\",\n \"Unit price\": \"Unit price\",\n \"Units per package\": \"Units per package\",\n Unpaid: \"Unpaid\",\n \"Until a date\": \"Until a date\",\n Unverified: \"Unverified\",\n Up: \"Up\",\n Updated: \"Updated\",\n \"Upper limit\": \"Upper limit\",\n \"Usage billed\": \"Usage billed\",\n \"Use matrix rates\": \"Use matrix rates\",\n \"Used for every customer.\": \"Used for every customer.\",\n Username: \"Username\",\n Value: \"Value\",\n \"Value property\": \"Value property\",\n Values: \"Values\",\n View: \"View\",\n \"View all \": \"View all \",\n \"View billing details\": \"View billing details\",\n \"View customer usage orders\": \"View customer usage orders\",\n \"View user account\": \"View user account\",\n Volume: \"Volume\",\n Webhook: \"Webhook\",\n \"Webhook URL\": \"Webhook URL\",\n Webhooks: \"Webhooks\",\n \"What the customer asked for\": \"What the customer asked for\",\n \"Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.\":\n \"Which provider would take the money if someone bought this right now, and why the others were passed over. This asks the same question a real purchase asks, without starting one.\",\n \"Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.\":\n \"Which providers this price has been sent to, and whether their copy still matches yours. Publishing the catalog is what sends it; this page only reports. Verify asks each provider what it currently holds, and changes nothing.\",\n Why: \"Why\",\n \"Why it was granted\": \"Why it was granted\",\n \"Widget menu\": \"Widget menu\",\n \"Widget title\": \"Widget title\",\n \"You're all caught up.\": \"You're all caught up.\",\n \"Your directory holds no contact for this customer.\":\n \"Your directory holds no contact for this customer.\",\n \"Your role does not have permission to read the merchant catalog.\":\n \"Your role does not have permission to read the merchant catalog.\",\n active: \"active\",\n \"active-seats\": \"active-seats\",\n \"alerts@example.com\": \"alerts@example.com\",\n \"api-tokens\": \"api-tokens\",\n archived: \"archived\",\n \"at the first renewal from \": \"at the first renewal from \",\n breadcrumb: \"breadcrumb\",\n default: \"default\",\n disabled: \"disabled\",\n \"drafted by copilot\": \"drafted by copilot\",\n \"draining (\": \"draining (\",\n \"e.g. #billing-alerts\": \"e.g. #billing-alerts\",\n \"eu, us\": \"eu, us\",\n \"gpt-5\": \"gpt-5\",\n \"held \": \"held \",\n \"https://example.com/account\": \"https://example.com/account\",\n \"https://example.com/logo.png\": \"https://example.com/logo.png\",\n \"https://example.com/subscribe\": \"https://example.com/subscribe\",\n \"https://example.com/support\": \"https://example.com/support\",\n \"key: \": \"key: \",\n \"metadata.model\": \"metadata.model\",\n model: \"model\",\n moved: \"moved\",\n \"no data in range\": \"no data in range\",\n \"no measure\": \"no measure\",\n \"of \": \"of \",\n offered: \"offered\",\n \"openrails intents resolve\": \"openrails intents resolve\",\n \"premium, downloads\": \"premium, downloads\",\n \"premium-monthly\": \"premium-monthly\",\n \"prior version\": \"prior version\",\n \"read-only\": \"read-only\",\n \"refused: \": \"refused: \",\n retired: \"retired\",\n selected: \"selected\",\n skipped: \"skipped\",\n \"token.used\": \"token.used\",\n tokens: \"tokens\",\n \"why is this being canceled?\": \"why is this being canceled?\",\n \"· owed \": \"· owed \",\n \"← Orders\": \"← Orders\",\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,KAA0D;CAC9D,YAAY;CACZ,YAAY;CACZ,MAAM;CACN,i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BAAqB;CACrB,eAAe;CACf,8HACE;CACF,gBAAgB;CAChB,SAAS;CACT,kCAAkC;CAClC,uCAAuC;CACvC,gBAAgB;CAChB,iDACE;CACF,UAAU;CACV,gFACE;CACF,sCAAsC;CACtC,SAAS;CACT,kGACE;CACF,aAAa;CACb,oBAAoB;CACpB,iBAAiB;CACjB,gBAAgB;CAChB,6BAA6B;CAC7B,SAAS;CACT,UAAU;CACV,uBAAuB;CACvB,kBAAkB;CAClB,gNACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,UAAU;CACV,eAAe;CACf,iBAAiB;CACjB,qBAAqB;CACrB,mBAAmB;CACnB,uBAAuB;CACvB,iEACE;CACF,WAAW;CACX,QAAQ;CACR,uBAAuB;CACvB,WAAW;CACX,MAAM;CACN,cAAc;CACd,sDACE;CACF,mBAAmB;CACnB,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,gBAAgB;CAChB,cAAc;CACd,+GACE;CACF,yHACE;CACF,kBAAkB;CAClB,aAAa;CACb,0BAA0B;CAC1B,UAAU;CACV,WAAW;CACX,YAAY;CACZ,WAAW;CACX,SAAS;CACT,kBAAkB;CAClB,gBAAgB;CAChB,gCAAgC;CAChC,SAAS;CACT,MAAM;CACN,gBAAgB;CAChB,oBAAoB;CACpB,uBAAuB;CACvB,OAAO;CACP,KAAK;CACL,WAAW;CACX,SAAS;CACT,SAAS;CACT,oDACE;CACF,sDACE;CACF,yBAAyB;CACzB,MAAM;CACN,cAAc;CACd,mBAAmB;CACnB,eAAe;CACf,WAAW;CACX,kBAAkB;CAClB,OAAO;CACP,kBAAkB;CAClB,SAAS;CACT,KAAK;CACL,+BAA+B;CAC/B,cAAc;CACd,aAAa;CACb,OAAO;CACP,kBAAkB;CAClB,iBAAiB;CACjB,cAAc;CACd,+BAA+B;CAC/B,gDACE;CACF,SAAS;CACT,SAAS;CACT,sBAAsB;CACtB,SAAS;CACT,OAAO;CACP,QAAQ;CACR,8BAA8B;CAC9B,qBAAqB;CACrB,uCA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ACF,gBAAgB;CAChB,YAAY;CACZ,aAAa;CACb,kCAAkC;CAClC,yBAAyB;CACzB,iCAAiC;CACjC,MAAM;CACN,kBAAkB;CAClB,qBAAqB;CACrB,eAAe;CACf,aAAa;CACb,yCACE;CACF,uBAAuB;CACvB,8EACE;CACF,qCAAqC;CACrC,4BAA4B;CAC5B,gBAAgB;CAChB,sCAAsC;CACtC,8BAA8B;CAC9B,uEACE;CACF,mEACE;CACF,oBAAoB;CACpB,mBAAmB;CACnB,aAAa;CACb,cAAc;CACd,kCAAkC;CAClC,oCAAoC;CACpC,6CACE;CACF,+BAA+B;CAC/B,yBAAyB;CACzB,gBAAgB;CAChB,kBAAkB;CAClB,sBAAsB;CACtB,oBAAoB;CACpB,wEACE;CACF,gDACE;CACF,wBAAwB;CACxB,eAAe;CACf,iCAAiC;CACjC,sFACE;CACF,qBAAqB;CACrB,qCAAqC;CACrC,uBAAuB;CACvB,2BAA2B;CAC3B,kBAAkB;CAClB,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,sFACE;CACF,8CACE;CACF,0EACE;CACF,sCAAsC;CACtC,iBAAiB;CACjB,wBAAwB;CACxB,eAAe;CACf,uLACE;CACF,iBAAiB;CACjB,qBAAqB;CACrB,MAAM;CACN,eAAe;CACf,sBAAsB;CACtB,WAAW;CACX,oBAAoB;CACpB,mBAAmB;CACnB,0FACE;CACF,KAAK;CACL,4EACE;CACF,OAAO;CACP,oBAAoB;CACpB,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,SAAS;CACT,8CACE;CACF,wBAAwB;CACxB,UAAU;CACV,mBAAmB;CACnB,OAAO;CACP,KAAK;CACL,cAAc;CACd,MAAM;CACN,SAAS;CACT,iBAAiB;CACjB,MAAM;CACN,4aACE;CACF,QAAQ;CACR,qBAAqB;CACrB,SAAS;CACT,oBAAoB;CACpB,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,mBAAmB;CACnB,sBAAsB;CACtB,qBAAqB;CACrB,gBAAgB;C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C;CACnC,SAAS;CACT,QAAQ;CACR,WAAW;CACX,UAAU;CACV,iBAAiB;CACjB,gBAAgB;CAChB,wBAAwB;CACxB,sCAAsC;CACtC,uCAAuC;CACvC,OAAO;CACP,0CACE;CACF,oBAAoB;CACpB,kBAAkB;CAClB,wDACE;CACF,sCAAsC;CACtC,MAAM;CACN,kEACE;CACF,kHACE;CACF,UAAU;CACV,UAAU;CACV,OAAO;CACP,SAAS;CACT,OAAO;CACP,mBAAmB;CACnB,OAAO;CACP,QAAQ;CACR,gBAAgB;CAChB,OAAO;CACP,2DACE;CACF,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,iBAAiB;CACjB,SAAS;CACT,cAAc;CACd,2BAA2B;CAC3B,iBAAiB;CACjB,eAAe;CACf,oEACE;CACF,uBAAuB;CACvB,iBAAiB;CACjB,eAAe;CACf,QAAQ;CACR,yBAAyB;CACzB,eAAe;CACf,0IACE;CACF,iJACE;CACF,4EACE;CACF,wFACE;CACF,oCAAoC;CACpC,oCAAoC;CACpC,qDACE;CACF,8DACE;CACF,mBAAmB;CACnB,wCACE;CACF,sHACE;CACF,oHACE;CACF,qCAAqC;CACrC,mBAAmB;CACnB,uEACE;CACF,sFACE;CACF,MAAM;CACN,cAAc;CACd,aAAa;CACb,aAAa;CACb,QAAQ;CACR,OAAO;CACP,OAAO;CACP,kBAAkB;CAClB,uBAAuB;CACvB,OAAO;CACP,yBAAyB;CACzB,eAAe;CACf,aAAa;CACb,sEACE;CACF,MAAM;CACN,SAAS;CACT,KAAK;CACL,MAAM;CACN,cAAc;CACd,qBAAqB;CACrB,QAAQ;CACR,gBAAgB;CAChB,YAAY;CACZ,IAAI;CACJ,SAAS;CACT,eAAe;CACf,gBAAgB;CAChB,oBAAoB;CACpB,4BAA4B;CAC5B,UAAU;CACV,OAAO;CACP,kBAAkB;CAClB,QAAQ;CACR,MAAM;CACN,aAAa;CACb,wBAAwB;CACxB,8BAA8B;CAC9B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