Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: dub partners program

Iuliia Shnai500671df3ca2
diff --git a/components/layouts/breadcrumb.tsx b/components/layouts/breadcrumb.tsx
index 24589d3f..9f4c2d77 100644
--- a/components/layouts/breadcrumb.tsx
+++ b/components/layouts/breadcrumb.tsx
@@ -514,6 +514,19 @@ export const AppBreadcrumb = () => {
return <AccountBreadcrumb />;
}
+ // Partner program route
+ if (path === "/partners") {
+ return (
+ <Breadcrumb>
+ <BreadcrumbList>
+ <BreadcrumbItem>
+ <BreadcrumbPage>Partner program</BreadcrumbPage>
+ </BreadcrumbItem>
+ </BreadcrumbList>
+ </Breadcrumb>
+ );
+ }
+
// Global branding route
if (path === "/branding") {
return (
diff --git a/components/layouts/mobile-header.tsx b/components/layouts/mobile-header.tsx
index d28b0057..6974f9e8 100644
--- a/components/layouts/mobile-header.tsx
+++ b/components/layouts/mobile-header.tsx
@@ -1,9 +1,11 @@
import Link from "next/link";
import { useRouter } from "next/router";
+import { isReferralsEnabled } from "@/ee/features/partners/lib/referrals";
import {
ChevronLeftIcon,
CircleUserRound,
+ GiftIcon,
LogOut,
MailIcon,
} from "lucide-react";
@@ -131,6 +133,14 @@ export function MobileHeader() {
<MailIcon className="mr-2 h-4 w-4" />
Contact Support
</DropdownMenuItem>
+ {isReferralsEnabled() ? (
+ <Link href="/partners">
+ <DropdownMenuItem>
+ <GiftIcon className="mr-2 h-4 w-4" />
+ Earn and Refer
+ </DropdownMenuItem>
+ </Link>
+ ) : null}
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem
diff --git a/components/sidebar/nav-user.tsx b/components/sidebar/nav-user.tsx
index e663ac25..7366b5c3 100644
--- a/components/sidebar/nav-user.tsx
+++ b/components/sidebar/nav-user.tsx
@@ -4,10 +4,12 @@ import Link from "next/link";
import { useState } from "react";
+import { isReferralsEnabled } from "@/ee/features/partners/lib/referrals";
import {
ChevronsUpDown,
CircleUserRound,
FileTextIcon,
+ GiftIcon,
LifeBuoyIcon,
LogOut,
MailIcon,
@@ -172,6 +174,14 @@ export function NavUser() {
<MailIcon />
Contact Support
</DropdownMenuItem>
+ {isReferralsEnabled() ? (
+ <Link href="/partners">
+ <DropdownMenuItem>
+ <GiftIcon />
+ Earn and Refer
+ </DropdownMenuItem>
+ </Link>
+ ) : null}
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem
diff --git a/components/teams/add-team-member-modal.tsx b/components/teams/add-team-member-modal.tsx
index 6f3cfbdb..2b4f8469 100644
--- a/components/teams/add-team-member-modal.tsx
+++ b/components/teams/add-team-member-modal.tsx
@@ -1,11 +1,17 @@
-import { useEffect, useMemo, useState } from "react";
import { useRouter } from "next/router";
+import { useEffect, useMemo, useRef, useState } from "react";
+
import { useTeam } from "@/context/team-context";
+import { InfoIcon } from "lucide-react";
import { toast } from "sonner";
import { mutate } from "swr";
import { z } from "zod";
+import { useAnalytics } from "@/lib/analytics";
+import { usePlan } from "@/lib/swr/use-billing";
+import useDataroomsSimple from "@/lib/swr/use-datarooms-simple";
+
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import {
@@ -26,10 +32,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
-
-import { useAnalytics } from "@/lib/analytics";
-import { usePlan } from "@/lib/swr/use-billing";
-import useDataroomsSimple from "@/lib/swr/use-datarooms-simple";
+import { BadgeTooltip } from "@/components/ui/tooltip";
type InviteRole = "ADMIN" | "MANAGER" | "MEMBER" | "DATAROOM_MEMBER";
@@ -63,6 +66,7 @@ export function AddTeamMembers({
defaultDataroomIds ?? [],
);
const [loading, setLoading] = useState<boolean>(false);
+ const emailInputRef = useRef<HTMLInputElement>(null);
const teamInfo = useTeam();
const teamId = teamInfo?.currentTeam?.id;
const analytics = useAnalytics();
@@ -161,11 +165,50 @@ export function AddTeamMembers({
return (
<Dialog open={open} onOpenChange={setOpen}>
{children ? <DialogTrigger asChild>{children}</DialogTrigger> : null}
- <DialogContent className="sm:max-w-[425px]">
+ <DialogContent
+ className="sm:max-w-[425px]"
+ onOpenAutoFocus={(event) => {
+ // The info button is the first focusable element in the dialog, and
+ // Radix tooltips open on focus — without this the tooltip pops open
+ // on its own every time the modal is launched.
+ event.preventDefault();
+ emailInputRef.current?.focus();
+ }}
+ >
<DialogHeader className="text-start">
<DialogTitle>Add Member</DialogTitle>
<DialogDescription>
- You can easily add team members.
+ You can easily add team members.{" "}
+ <BadgeTooltip
+ side="bottom"
+ align="start"
+ className="max-w-xs text-left"
+ content={
+ <div className="space-y-1.5">
+ <p>
+ <span className="font-medium text-foreground">Members</span>{" "}
+ join your team and can edit and manage documents, data
+ rooms, and links.
+ </p>
+ <p>
+ <span className="font-medium text-foreground">
+ Visitors
+ </span>{" "}
+ are people you share links with. They only get view access,
+ plus upload access on some plans. Visitors are unlimited on
+ every plan.
+ </p>
+ </div>
+ }
+ >
+ <button
+ type="button"
+ aria-label="Learn about members and visitors"
+ className="inline-flex translate-y-0.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ >
+ <InfoIcon className="size-3.5" />
+ </button>
+ </BadgeTooltip>
</DialogDescription>
</DialogHeader>
<form onSubmit={handleSubmit} className="grid gap-4">
@@ -175,6 +218,7 @@ export function AddTeamMembers({
</Label>
<Input
id="email"
+ ref={emailInputRef}
placeholder="[email protected]"
className="w-full"
onChange={(e) => setEmail(e.target.value)}
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx
index c5078f5e..be797163 100644
--- a/components/ui/dialog.tsx
+++ b/components/ui/dialog.tsx
@@ -55,6 +55,8 @@ const DialogContent = React.forwardRef<
isDocumentDialog?: boolean;
isPreviewDialog?: boolean;
mobileFullScreen?: boolean;
+ /** For dialogs that require a choice, where a close button would be a dead control. */
+ hideCloseButton?: boolean;
}
>(
(
@@ -64,6 +66,7 @@ const DialogContent = React.forwardRef<
isDocumentDialog,
isPreviewDialog,
mobileFullScreen,
+ hideCloseButton,
...props
},
ref,
@@ -85,15 +88,17 @@ const DialogContent = React.forwardRef<
{...props}
>
{children}
- <DialogPrimitive.Close
- className={cn(
- "absolute z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
- isDocumentDialog ? "right-8 top-20" : "right-4 top-4",
- )}
- >
- <X className="h-5 w-5 sm:h-4 sm:w-4" />
- <span className="sr-only">Close</span>
- </DialogPrimitive.Close>
+ {hideCloseButton ? null : (
+ <DialogPrimitive.Close
+ className={cn(
+ "absolute z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
+ isDocumentDialog ? "right-8 top-20" : "right-4 top-4",
+ )}
+ >
+ <X className="h-5 w-5 sm:h-4 sm:w-4" />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ )}
</DialogPrimitive.Content>
</DialogPortal>
),
diff --git a/lib/api/parse-json-body.ts b/lib/api/parse-json-body.ts
new file mode 100644
index 00000000..5f08a30a
--- /dev/null
+++ b/lib/api/parse-json-body.ts
@@ -0,0 +1,16 @@
+import { ZodType, ZodTypeDef } from "zod";
+
+/**
+ * Reads and validates a route handler's JSON body.
+ *
+ * `req.json()` throws on an absent or malformed body, which would surface as a
+ * 500 rather than the 400 the schema failure produces. Both paths are folded
+ * into the same `safeParse` failure so the caller only has one to answer.
+ */
+export async function parseJsonBody<TOut, TDef extends ZodTypeDef, TIn>(
+ req: Request,
+ schema: ZodType<TOut, TDef, TIn>,
+) {
+ const body = await req.json().catch(() => undefined);
+ return schema.safeParse(body);
+}
diff --git a/lib/errorHandler.ts b/lib/errorHandler.ts
index 46129af5..290f57c4 100644
--- a/lib/errorHandler.ts
+++ b/lib/errorHandler.ts
@@ -1,4 +1,5 @@
import { NextApiResponse } from "next";
+import { NextResponse } from "next/server";
function sanitizeError(err: unknown) {
if (!(err instanceof Error)) {
@@ -26,6 +27,22 @@ export function errorhandler(err: unknown, res: NextApiResponse) {
}
}
+/**
+ * {@link errorhandler} for App Router route handlers, which return a response
+ * rather than write to one.
+ */
+export function errorResponse(err: unknown) {
+ if (err instanceof TeamError || err instanceof DocumentError) {
+ return new NextResponse(err.message, { status: err.statusCode });
+ }
+
+ console.error("[errorhandler] unhandled error", sanitizeError(err));
+ return NextResponse.json(
+ { message: "Internal Server Error" },
+ { status: 500 },
+ );
+}
+
export class TeamError extends Error {
statusCode = 400;
constructor(public message: string) {
diff --git a/lib/team-name.ts b/lib/team-name.ts
new file mode 100644
index 00000000..153f9e19
--- /dev/null
+++ b/lib/team-name.ts
@@ -0,0 +1,49 @@
+/**
+ * Naming a team after the organisation behind it. Signup cannot know that name,
+ * so it uses a placeholder; anything that later learns the real one — a data
+ * room trial, a partner enrolment — replaces the placeholder and only that.
+ */
+
+/** What the team settings form accepts. */
+export const TEAM_NAME_MAX_LENGTH = 32;
+
+/**
+ * The names `pages/api/teams/index.ts` gives a team at signup. They name the
+ * person, or nothing at all, so they say nothing about the organisation and are
+ * safe to replace. A name anyone chose deliberately is never overwritten.
+ */
+export function isGeneratedTeamName(
+ teamName?: string | null,
+ userName?: string | null,
+) {
+ const name = teamName?.trim().toLowerCase();
+ if (!name) return true;
+ if (name === "personal team") return true;
+
+ const owner = userName?.trim().toLowerCase();
+ return !!owner && name === `${owner}'s team`;
+}
+
+/**
+ * "Acme" → "Acme Team". Already ends in "team" — "Acme Team", "Acme team" — and
+ * it is left as it is rather than becoming "Acme Team Team".
+ */
+export function companyTeamName(companyName?: string | null) {
+ const base = companyName?.trim().replace(/\s+/g, " ") ?? "";
+ if (!base) return "";
+
+ const named = /\bteams?$/i.test(base) ? base : `${base} Team`;
+ return named.slice(0, TEAM_NAME_MAX_LENGTH).trim();
+}
+
+/**
+ * The inverse: "Acme Team" → "Acme". The suffix belongs to the workspace, not to
+ * the organisation, so anything addressed to the outside — a referral link, an
+ * invite from the fund — drops it. Returns the name unchanged when "team" is all
+ * there is, since "" would say less than "Team" does.
+ */
+export function withoutTeamSuffix(teamName?: string | null) {
+ const base = teamName?.trim().replace(/\s+/g, " ") ?? "";
+ const stripped = base.replace(/\s+teams?$/i, "").trim();
+ return stripped || base;
+}
diff --git a/package-lock.json b/package-lock.json
index 1e083727..4a49d769 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,6 +26,7 @@
"@dnd-kit/utilities": "^3.2.2",
"@documenso/embed-react": "^0.6.0",
"@documenso/sdk-typescript": "^0.8.1",
+ "@dub/embed-react": "^0.0.16",
"@github/webauthn-json": "^2.1.1",
"@hookform/resolvers": "^5.2.2",
"@jitsu/js": "^1.10.4",
@@ -3368,6 +3369,28 @@
"mcp": "bin/mcp-server.js"
}
},
+ "node_modules/@dub/embed-core": {
+ "version": "0.0.16",
+ "resolved": "https://registry.npmjs.org/@dub/embed-core/-/embed-core-0.0.16.tgz",
+ "integrity": "sha512-CsPVxvC2E8OcgwVUA5zIwy+x+XGP4IaE4LLlMz4GoK24ACn6Hcy7Pn/2vb4HFMSPay8fzd47cEQk/2MXsFQXPQ==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.6.12"
+ }
+ },
+ "node_modules/@dub/embed-react": {
+ "version": "0.0.16",
+ "resolved": "https://registry.npmjs.org/@dub/embed-react/-/embed-react-0.0.16.tgz",
+ "integrity": "sha512-HVo20cEKEX5nRxJsUq6XiUsv2HnmZec2iQbGruWf+Z//OyiUboquaGqOUnNNOmLPdmWONzaYxXYhvAmEjKU1XQ==",
+ "dependencies": {
+ "@dub/embed-core": "^0.0.16",
+ "class-variance-authority": "^0.7.0",
+ "vite": "5.2.9"
+ },
+ "peerDependencies": {
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0"
+ }
+ },
"node_modules/@electric-sql/client": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/@electric-sql/client/-/client-1.0.14.tgz",
@@ -5023,6 +5046,22 @@
"sparse-bitfield": "^3.0.3"
}
},
+ "node_modules/@napi-rs/lzma-linux-x64-gnu": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
+ "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^22.20 || ^24.12 || >=25"
+ }
+ },
"node_modules/@napi-rs/wasm-runtime": {
"version": "0.2.12",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
@@ -7963,6 +8002,32 @@
"@redis/client": "^1.0.0"
}
},
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.4.tgz",
+ "integrity": "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.4.tgz",
+ "integrity": "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.62.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.4.tgz",
@@ -7976,133 +8041,419 @@
"darwin"
]
},
- "node_modules/@rtsao/scc": {
- "version": "1.1.0",
- "license": "MIT"
- },
- "node_modules/@rushstack/eslint-patch": {
- "version": "1.16.1",
- "license": "MIT"
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.4.tgz",
+ "integrity": "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "node_modules/@s2-dev/streamstore": {
- "version": "0.25.0",
- "resolved": "https://registry.npmjs.org/@s2-dev/streamstore/-/streamstore-0.25.0.tgz",
- "integrity": "sha512-oB8OJObT/s2Q68Tr01NLfDnQPFJp/Kn2pP3seWybgP7VrjQ+j1efXReOsyVCDsUBVMxkyPlzt75o/+GuL5Q3vg==",
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.4.tgz",
+ "integrity": "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@protobuf-ts/runtime": "^2.11.1",
- "debug": "^4.4.3"
- }
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "node_modules/@scure/base": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.2.0.tgz",
- "integrity": "sha512-b8XEupJibegiXV+tDUseI8oLQc8ei3d/4Jkb2RpbHh3MfE054ov3uIz2dhFkB3FI8iwYkEh0gGCApkrYggkPNg==",
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.4.tgz",
+ "integrity": "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "node_modules/@selderee/plugin-htmlparser2": {
- "version": "0.11.0",
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.4.tgz",
+ "integrity": "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==",
+ "cpu": [
+ "arm"
+ ],
"license": "MIT",
- "dependencies": {
- "domhandler": "^5.0.3",
- "selderee": "^0.11.0"
- },
- "funding": {
- "url": "https://ko-fi.com/killymxi"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/core": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.4.tgz",
+ "integrity": "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==",
+ "cpu": [
+ "arm"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/types": "3.23.0",
- "@shikijs/vscode-textmate": "^10.0.2",
- "@types/hast": "^3.0.4",
- "hast-util-to-html": "^9.0.5"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/engine-javascript": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.4.tgz",
+ "integrity": "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/types": "3.23.0",
- "@shikijs/vscode-textmate": "^10.0.2",
- "oniguruma-to-es": "^4.3.4"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/engine-oniguruma": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.4.tgz",
+ "integrity": "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/types": "3.23.0",
- "@shikijs/vscode-textmate": "^10.0.2"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/langs": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.4.tgz",
+ "integrity": "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==",
+ "cpu": [
+ "loong64"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/types": "3.23.0"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/themes": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.4.tgz",
+ "integrity": "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==",
+ "cpu": [
+ "loong64"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/types": "3.23.0"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/types": {
- "version": "3.23.0",
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.4.tgz",
+ "integrity": "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==",
+ "cpu": [
+ "ppc64"
+ ],
"license": "MIT",
- "dependencies": {
- "@shikijs/vscode-textmate": "^10.0.2",
- "@types/hast": "^3.0.4"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shikijs/vscode-textmate": {
- "version": "10.0.2",
- "license": "MIT"
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.4.tgz",
+ "integrity": "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@shopify/semaphore": {
- "version": "3.1.0",
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.4.tgz",
+ "integrity": "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==",
+ "cpu": [
+ "riscv64"
+ ],
"license": "MIT",
- "engines": {
- "node": ">=18.12.0"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@sindresorhus/slugify": {
- "version": "3.0.0",
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.4.tgz",
+ "integrity": "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==",
+ "cpu": [
+ "riscv64"
+ ],
"license": "MIT",
- "dependencies": {
- "@sindresorhus/transliterate": "^2.0.0",
- "escape-string-regexp": "^5.0.0"
- },
- "engines": {
- "node": ">=20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@sindresorhus/transliterate": {
- "version": "2.3.1",
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.4.tgz",
+ "integrity": "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==",
+ "cpu": [
+ "s390x"
+ ],
"license": "MIT",
- "engines": {
- "node": ">=20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@smithy/config-resolver": {
- "version": "4.4.16",
- "license": "Apache-2.0",
- "dependencies": {
- "@smithy/node-config-provider": "^4.3.14",
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.4.tgz",
+ "integrity": "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.4.tgz",
+ "integrity": "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.4.tgz",
+ "integrity": "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.4.tgz",
+ "integrity": "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.4.tgz",
+ "integrity": "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.4.tgz",
+ "integrity": "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.4.tgz",
+ "integrity": "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.4.tgz",
+ "integrity": "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rtsao/scc": {
+ "version": "1.1.0",
+ "license": "MIT"
+ },
+ "node_modules/@rushstack/eslint-patch": {
+ "version": "1.16.1",
+ "license": "MIT"
+ },
+ "node_modules/@s2-dev/streamstore": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@s2-dev/streamstore/-/streamstore-0.25.0.tgz",
+ "integrity": "sha512-oB8OJObT/s2Q68Tr01NLfDnQPFJp/Kn2pP3seWybgP7VrjQ+j1efXReOsyVCDsUBVMxkyPlzt75o/+GuL5Q3vg==",
+ "license": "MIT",
+ "dependencies": {
+ "@protobuf-ts/runtime": "^2.11.1",
+ "debug": "^4.4.3"
+ }
+ },
+ "node_modules/@scure/base": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.2.0.tgz",
+ "integrity": "sha512-b8XEupJibegiXV+tDUseI8oLQc8ei3d/4Jkb2RpbHh3MfE054ov3uIz2dhFkB3FI8iwYkEh0gGCApkrYggkPNg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@selderee/plugin-htmlparser2": {
+ "version": "0.11.0",
+ "license": "MIT",
+ "dependencies": {
+ "domhandler": "^5.0.3",
+ "selderee": "^0.11.0"
+ },
+ "funding": {
+ "url": "https://ko-fi.com/killymxi"
+ }
+ },
+ "node_modules/@shikijs/core": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "3.23.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4",
+ "hast-util-to-html": "^9.0.5"
+ }
+ },
+ "node_modules/@shikijs/engine-javascript": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "3.23.0",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "oniguruma-to-es": "^4.3.4"
+ }
+ },
+ "node_modules/@shikijs/engine-oniguruma": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "3.23.0",
+ "@shikijs/vscode-textmate": "^10.0.2"
+ }
+ },
+ "node_modules/@shikijs/langs": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "3.23.0"
+ }
+ },
+ "node_modules/@shikijs/themes": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "3.23.0"
+ }
+ },
+ "node_modules/@shikijs/types": {
+ "version": "3.23.0",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.4"
+ }
+ },
+ "node_modules/@shikijs/vscode-textmate": {
+ "version": "10.0.2",
+ "license": "MIT"
+ },
+ "node_modules/@shopify/semaphore": {
+ "version": "3.1.0",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.12.0"
+ }
+ },
+ "node_modules/@sindresorhus/slugify": {
+ "version": "3.0.0",
+ "license": "MIT",
+ "dependencies": {
+ "@sindresorhus/transliterate": "^2.0.0",
+ "escape-string-regexp": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@sindresorhus/transliterate": {
+ "version": "2.3.1",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@smithy/config-resolver": {
+ "version": "4.4.16",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@smithy/node-config-provider": "^4.3.14",
"@smithy/types": "^4.14.1",
"@smithy/util-config-provider": "^4.2.2",
"@smithy/util-endpoints": "^3.4.1",
@@ -9970,7 +10321,9 @@
"peer": true
},
"node_modules/@types/estree": {
- "version": "1.0.8",
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
"license": "MIT"
},
"node_modules/@types/estree-jsx": {
@@ -22419,6 +22772,51 @@
"version": "3.0.3",
"license": "Unlicense"
},
+ "node_modules/rollup": {
+ "version": "4.62.4",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.4.tgz",
+ "integrity": "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
+ "@rollup/rollup-android-arm-eabi": "4.62.4",
+ "@rollup/rollup-android-arm64": "4.62.4",
+ "@rollup/rollup-darwin-arm64": "4.62.4",
+ "@rollup/rollup-darwin-x64": "4.62.4",
+ "@rollup/rollup-freebsd-arm64": "4.62.4",
+ "@rollup/rollup-freebsd-x64": "4.62.4",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.4",
+ "@rollup/rollup-linux-arm-musleabihf": "4.62.4",
+ "@rollup/rollup-linux-arm64-gnu": "4.62.4",
+ "@rollup/rollup-linux-arm64-musl": "4.62.4",
+ "@rollup/rollup-linux-loong64-gnu": "4.62.4",
+ "@rollup/rollup-linux-loong64-musl": "4.62.4",
+ "@rollup/rollup-linux-ppc64-gnu": "4.62.4",
+ "@rollup/rollup-linux-ppc64-musl": "4.62.4",
+ "@rollup/rollup-linux-riscv64-gnu": "4.62.4",
+ "@rollup/rollup-linux-riscv64-musl": "4.62.4",
+ "@rollup/rollup-linux-s390x-gnu": "4.62.4",
+ "@rollup/rollup-linux-x64-gnu": "4.62.4",
+ "@rollup/rollup-linux-x64-musl": "4.62.4",
+ "@rollup/rollup-openbsd-x64": "4.62.4",
+ "@rollup/rollup-openharmony-arm64": "4.62.4",
+ "@rollup/rollup-win32-arm64-msvc": "4.62.4",
+ "@rollup/rollup-win32-ia32-msvc": "4.62.4",
+ "@rollup/rollup-win32-x64-gnu": "4.62.4",
+ "@rollup/rollup-win32-x64-msvc": "4.62.4",
+ "fsevents": "~2.3.2"
+ }
+ },
"node_modules/rope-sequence": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz",
@@ -25031,6 +25429,467 @@
"d3-timer": "^3.0.1"
}
},
+ "node_modules/vite": {
+ "version": "5.2.9",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.9.tgz",
+ "integrity": "sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==",
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.20.1",
+ "postcss": "^8.4.38",
+ "rollup": "^4.13.0"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || >=20.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || >=20.0.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/aix-ppc64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
+ "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-arm": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz",
+ "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz",
+ "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/android-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz",
+ "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz",
+ "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/darwin-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
+ "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz",
+ "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/freebsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz",
+ "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz",
+ "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz",
+ "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ia32": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz",
+ "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-loong64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz",
+ "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-mips64el": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz",
+ "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-ppc64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz",
+ "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-riscv64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz",
+ "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-s390x": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz",
+ "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/linux-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz",
+ "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/netbsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/openbsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/sunos-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz",
+ "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz",
+ "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-ia32": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz",
+ "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/@esbuild/win32-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz",
+ "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/vite/node_modules/esbuild": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
+ "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.20.2",
+ "@esbuild/android-arm": "0.20.2",
+ "@esbuild/android-arm64": "0.20.2",
+ "@esbuild/android-x64": "0.20.2",
+ "@esbuild/darwin-arm64": "0.20.2",
+ "@esbuild/darwin-x64": "0.20.2",
+ "@esbuild/freebsd-arm64": "0.20.2",
+ "@esbuild/freebsd-x64": "0.20.2",
+ "@esbuild/linux-arm": "0.20.2",
+ "@esbuild/linux-arm64": "0.20.2",
+ "@esbuild/linux-ia32": "0.20.2",
+ "@esbuild/linux-loong64": "0.20.2",
+ "@esbuild/linux-mips64el": "0.20.2",
+ "@esbuild/linux-ppc64": "0.20.2",
+ "@esbuild/linux-riscv64": "0.20.2",
+ "@esbuild/linux-s390x": "0.20.2",
+ "@esbuild/linux-x64": "0.20.2",
+ "@esbuild/netbsd-x64": "0.20.2",
+ "@esbuild/openbsd-x64": "0.20.2",
+ "@esbuild/sunos-x64": "0.20.2",
+ "@esbuild/win32-arm64": "0.20.2",
+ "@esbuild/win32-ia32": "0.20.2",
+ "@esbuild/win32-x64": "0.20.2"
+ }
+ },
"node_modules/void-elements": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
diff --git a/package.json b/package.json
index 2ebd182f..f79d1722 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,6 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
- "check:access-form": "tsx scripts/check-access-form-footer.ts",
"check:brand-logo": "tsx scripts/check-brand-logo.ts",
"postinstall": "prisma generate",
"vercel-build": "prisma migrate deploy && next build",
@@ -40,6 +39,7 @@
"@dnd-kit/utilities": "^3.2.2",
"@documenso/embed-react": "^0.6.0",
"@documenso/sdk-typescript": "^0.8.1",
+ "@dub/embed-react": "^0.0.16",
"@github/webauthn-json": "^2.1.1",
"@hookform/resolvers": "^5.2.2",
"@jitsu/js": "^1.10.4",
@@ -226,4 +226,4 @@
"tar": "7.5.10",
"lodash": "4.18.1"
}
-}
\ No newline at end of file
+}
diff --git a/pages/api/teams/[teamId]/datarooms/trial.ts b/pages/api/teams/[teamId]/datarooms/trial.ts
index fdfb0cfb..63059029 100644
--- a/pages/api/teams/[teamId]/datarooms/trial.ts
+++ b/pages/api/teams/[teamId]/datarooms/trial.ts
@@ -1,5 +1,10 @@
import { NextApiRequest, NextApiResponse } from "next";
+import {
+ sendDataroomTrial24hReminderEmailTask,
+ sendDataroomTrialExpiredEmailTask,
+ sendDataroomTrialInfoEmailTask,
+} from "@/ee/features/billing/dataroom-trial/lib/trigger/send-scheduled-email";
import { authOptions } from "@/pages/api/auth/[...nextauth]";
import { waitUntil } from "@vercel/functions";
import { getServerSession } from "next-auth/next";
@@ -7,11 +12,7 @@ import { getServerSession } from "next-auth/next";
import { sendDataroomTrialWelcome } from "@/lib/emails/send-dataroom-trial";
import { newId } from "@/lib/id-helper";
import prisma from "@/lib/prisma";
-import {
- sendDataroomTrial24hReminderEmailTask,
- sendDataroomTrialExpiredEmailTask,
- sendDataroomTrialInfoEmailTask,
-} from "@/ee/features/billing/dataroom-trial/lib/trigger/send-scheduled-email";
+import { companyTeamName, isGeneratedTeamName } from "@/lib/team-name";
import { CustomUser } from "@/lib/types";
import { log, logStore } from "@/lib/utils";
@@ -58,6 +59,7 @@ export default async function handle(
},
select: {
id: true,
+ name: true,
plan: true,
_count: {
select: {
@@ -95,10 +97,17 @@ export default async function handle(
},
});
+ // The trial form is the first place we learn who the team actually is, so
+ // "Personal Team" becomes "Acme Team". A name they chose is left alone.
+ const renamed = isGeneratedTeamName(team.name, fullName)
+ ? companyTeamName(companyName)
+ : "";
+
await prisma.team.update({
where: { id: teamId },
data: {
plan: `${team.plan}+drtrial`,
+ ...(renamed ? { name: renamed } : {}),
},
});
diff --git a/pages/partners.tsx b/pages/partners.tsx
new file mode 100644
index 00000000..4672f36a
--- /dev/null
+++ b/pages/partners.tsx
@@ -0,0 +1 @@
+export { default } from "@/ee/features/partners/pages/partner-program";
diff --git a/prisma/migrations/20260811000000_add_referral_program/migration.sql b/prisma/migrations/20260811000000_add_referral_program/migration.sql
new file mode 100644
index 00000000..16d82d78
--- /dev/null
+++ b/prisma/migrations/20260811000000_add_referral_program/migration.sql
@@ -0,0 +1,40 @@
+-- CreateEnum
+CREATE TYPE "ReferralTrack" AS ENUM ('AFFILIATE', 'PARTNER_DISCOUNT');
+
+-- AlterTable
+ALTER TABLE "User" ADD COLUMN "referralProfile" JSONB,
+ADD COLUMN "referralTrack" "ReferralTrack",
+ADD COLUMN "referralTrackSelectedAt" TIMESTAMP(3);
+
+-- AlterTable
+ALTER TABLE "Team" ADD COLUMN "referralProfile" JSONB,
+ADD COLUMN "referralTrack" "ReferralTrack",
+ADD COLUMN "referralTrackSelectedAt" TIMESTAMP(3);
+
+-- CreateTable
+CREATE TABLE "ReferralInvite" (
+ "id" TEXT NOT NULL,
+ "userId" TEXT NOT NULL,
+ "teamId" TEXT,
+ "scopeId" TEXT NOT NULL,
+ "email" TEXT NOT NULL,
+ "referralLink" TEXT,
+ "sentAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+
+ CONSTRAINT "ReferralInvite_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateIndex
+CREATE INDEX "ReferralInvite_userId_idx" ON "ReferralInvite"("userId");
+
+-- CreateIndex
+CREATE INDEX "ReferralInvite_teamId_idx" ON "ReferralInvite"("teamId");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "ReferralInvite_scopeId_email_key" ON "ReferralInvite"("scopeId", "email");
+
+-- AddForeignKey
+ALTER TABLE "ReferralInvite" ADD CONSTRAINT "ReferralInvite_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "ReferralInvite" ADD CONSTRAINT "ReferralInvite_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;
diff --git a/prisma/schema/referral.prisma b/prisma/schema/referral.prisma
new file mode 100644
index 00000000..04d2a3e4
--- /dev/null
+++ b/prisma/schema/referral.prisma
@@ -0,0 +1,27 @@
+enum ReferralTrack {
+ AFFILIATE
+ PARTNER_DISCOUNT
+}
+
+model ReferralInvite {
+ id String @id @default(cuid())
+ userId String
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
+ teamId String?
+ team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)
+ /**
+ * Whose cap and discount this invite counts against — the fund's team, or the
+ * sender alone. One non-null key rather than a pair of nullable ones: on a
+ * nullable teamId every personal invite is distinct to Postgres, so the two
+ * keys guarded different scopes and a member could not invite a company both
+ * for their fund and for themselves.
+ */
+ scopeId String
+ email String
+ referralLink String?
+ sentAt DateTime @default(now())
+
+ @@unique([scopeId, email])
+ @@index([userId])
+ @@index([teamId])
+}
diff --git a/prisma/schema/schema.prisma b/prisma/schema/schema.prisma
index 386df8d8..e484d746 100644
--- a/prisma/schema/schema.prisma
+++ b/prisma/schema/schema.prisma
@@ -83,6 +83,15 @@ model User {
taskActivities TaskActivity[] @relation("taskActivities")
notificationPreferences NotificationPreference[]
+
+ // Dub referral program
+ referralTrack ReferralTrack?
+ referralTrackSelectedAt DateTime?
+ // Self-declared answers from the partner form, following the same shape-in-a-column
+ // convention as Team.surveyData:
+ // { useCase?: string, useCaseOther?: string, role?: string, roleOther?: string }
+ referralProfile Json?
+ referralInvites ReferralInvite[]
}
model Brand {
diff --git a/prisma/schema/team.prisma b/prisma/schema/team.prisma
index 21a5cc2f..548e0c89 100644
--- a/prisma/schema/team.prisma
+++ b/prisma/schema/team.prisma
@@ -84,6 +84,15 @@ model Team {
globalBlockList String[] // Email and domains that are blocked for the team
notificationPreferences NotificationPreference[]
+
+ // Partner program, portfolio-discount track only. The discount lands on this
+ // team's plan, so the enrolment belongs to the team rather than to whoever
+ // filled the form: one link every member shares, one invite list, one cap.
+ // The affiliate track stays on User, where the commission is paid.
+ referralTrack ReferralTrack?
+ referralTrackSelectedAt DateTime?
+ referralProfile Json?
+ referralInvites ReferralInvite[]
}
enum Role {